You can no longer stab multiple peas at once (Fork Lifter)

This commit is contained in:
Braedon
2022-02-05 23:03:31 -05:00
parent 2af84478ed
commit f376e30ee2
31 changed files with 2791 additions and 363 deletions

View File

@ -1,3 +1,4 @@
using System.Collections.Generic;
using UnityEngine;
using RhythmHeavenMania.Util;
@ -8,6 +9,7 @@ namespace RhythmHeavenMania.Games.DJSchool
{
[Header("Components")]
[SerializeField] private Student student;
[SerializeField] private GameObject djYellow;
[Header("Properties")]
public GameEvent bop = new GameEvent();
@ -55,6 +57,13 @@ namespace RhythmHeavenMania.Games.DJSchool
new MultiSound.Sound("djSchool/ooh", beat + 2f),
});
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("BreakCmon", 0, 0); }),
new BeatAction.Action(beat + 2f, delegate { djYellow.GetComponent<Animator>().Play("Hold", 0, 0); }),
});
student.holdBeat = beat;
student.ResetState();
}
@ -68,6 +77,13 @@ namespace RhythmHeavenMania.Games.DJSchool
new MultiSound.Sound("djSchool/hey", beat + 2f),
});
BeatAction.New(djYellow, new List<BeatAction.Action>()
{
new BeatAction.Action(beat, delegate { djYellow.GetComponent<Animator>().Play("Scratcho", 0, 0); }),
new BeatAction.Action(beat + 1f, delegate { djYellow.GetComponent<Animator>().Play("Scratcho2", 0, 0); }),
new BeatAction.Action(beat + 2.05f, delegate { djYellow.GetComponent<Animator>().Play("Hey", 0, 0); }),
});
student.swipeBeat = beat;
student.ResetState();
}

View File

@ -34,6 +34,8 @@ namespace RhythmHeavenMania.Games.ForkLifter
private bool isEating = false;
public int hitOnFrame;
// Burger shit
public bool topbun, middleburger, bottombun;
@ -50,13 +52,16 @@ namespace RhythmHeavenMania.Games.ForkLifter
anim = GetComponent<Animator>();
}
private void Update()
private void LateUpdate()
{
if (PlayerInput.Pressed())
{
hitOnFrame = 0;
Stab(null);
}
print(hitOnFrame);
if (ForkLifter.instance.EligibleHits.Count == 0)
{
currentHitInList = 0;
@ -118,7 +123,7 @@ namespace RhythmHeavenMania.Games.ForkLifter
public void Stab(Pea p)
{
if (isEating) return;
if (isEating || hitOnFrame > 0) return;
if (p == null)
{

View File

@ -180,7 +180,7 @@ namespace RhythmHeavenMania.Games.ForkLifter
StateCheck(normalizedBeat);
if (PlayerInput.Pressed())
if (PlayerInput.Pressed() && ForkLifterPlayer.instance.hitOnFrame == 0)
{
if (state.perfect)
{
@ -194,6 +194,8 @@ namespace RhythmHeavenMania.Games.ForkLifter
{
Late();
}
ForkLifterPlayer.instance.hitOnFrame++;
}
if (normalizedBeat > 1.35f)

View File

@ -295,11 +295,13 @@ namespace RhythmHeavenMania.Editor
if (changedMusic || currentRemixPath != path)
{
byte[] bytes = OggVorbis.VorbisPlugin.GetOggVorbis(Conductor.instance.musicSource.clip, 1);
var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression);
using (var zipStream = musicFile.Open())
zipStream.Write(bytes, 0, bytes.Length);
// this gets rid of the music file for some reason, someone remind me to find a fix for this soon
}
byte[] bytes = OggVorbis.VorbisPlugin.GetOggVorbis(Conductor.instance.musicSource.clip, 1);
var musicFile = archive.CreateEntry("song.ogg", System.IO.Compression.CompressionLevel.NoCompression);
using (var zipStream = musicFile.Open())
zipStream.Write(bytes, 0, bytes.Length);
}
currentRemixPath = path;