Pajama Party: option to sleep forever

This commit is contained in:
minenice55 2022-06-17 21:24:23 -04:00
parent 85f3e002ac
commit 41091f5089
3 changed files with 39 additions and 19 deletions

View file

@ -124,7 +124,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
Projectile.SetActive(true);
}
public void ReadySleep(float beat)
public void ReadySleep(float beat, int action)
{
var cond = Conductor.instance;
startThrowTime = Single.MinValue;
@ -161,7 +161,9 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
seq.Add(new BeatAction.Action( beat + 3f, delegate { anim.DoScaledAnimationAsync("MonkeyReadySleep"); }));
seq.Add(new BeatAction.Action( beat + 4f, delegate { anim.DoScaledAnimationAsync("MonkeySleep02"); }));
}
seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); }));
if (action != (int) PajamaParty.SleepType.NoAwake)
seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); }));
BeatAction.New(Monkey, seq);
}

View file

@ -34,12 +34,14 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
bool throwType = true;
bool hasThrown = false;
bool throwNg = false;
bool longSleep = false;
public bool canSleep = false;
void Awake()
{
anim = Player.GetComponent<Animator>();
longSleep = false;
}
// Update is called once per frame
@ -306,7 +308,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
//
// sleep cue
public void StartSleepSequence(float beat, bool alt)
public void StartSleepSequence(float beat, bool alt, int action)
{
if (hasJumped)
{
@ -347,6 +349,11 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
Player.transform.localPosition = new Vector3(0, 0);
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
if (action == (int) PajamaParty.SleepType.NoAwake)
{
longSleep = true;
}
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(
@ -394,16 +401,20 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
Jukebox.PlayOneShotGame("pajamaParty/siesta4");
anim.DoScaledAnimationAsync("MakoSleepJust");
BeatAction.New(Player, new List<BeatAction.Action>()
if (!longSleep)
{
new BeatAction.Action(
caller.startBeat + 7f,
delegate {
anim.DoScaledAnimationAsync("MakoAwake");
Jukebox.PlayOneShotGame("pajamaParty/siestaDone");
}
),
});
BeatAction.New(Player, new List<BeatAction.Action>()
{
new BeatAction.Action(
caller.startBeat + 7f,
delegate {
anim.DoScaledAnimationAsync("MakoAwake");
Jukebox.PlayOneShotGame("pajamaParty/siestaDone");
}
),
});
}
longSleep = false;
}
}
}

View file

@ -22,8 +22,9 @@ namespace HeavenStudio.Games.Loaders
inactiveFunction: delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
),
//idem
new GameAction("slumber", delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e.toggle);}, 8f, false, parameters: new List<Param>()
new GameAction("slumber", delegate {var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e.toggle, e.type);}, 8f, false, parameters: new List<Param>()
{
new Param("type", PajamaParty.SleepType.Normal, "Sleep Type", "Type of sleep action to use"),
new Param("toggle", false, "Alt. Animation", "Use an alternate animation for Mako")
},
inactiveFunction: delegate {var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e.toggle);}
@ -66,6 +67,12 @@ namespace HeavenStudio.Games
static float WantThrowSequence = Single.MinValue;
static float WantSleepSequence = Single.MinValue;
static bool WantSleepType = false;
static int WantSleepAction = (int) PajamaParty.SleepType.Normal;
public enum SleepType {
Normal,
NoAwake,
}
void Awake()
{
@ -128,7 +135,7 @@ namespace HeavenStudio.Games
}
if (WantSleepSequence != Single.MinValue)
{
DoSleepSequence(WantSleepSequence, WantSleepType, false);
DoSleepSequence(WantSleepSequence, WantSleepType, WantSleepAction, false);
WantSleepSequence = Single.MinValue;
}
}
@ -245,11 +252,11 @@ namespace HeavenStudio.Games
}, forcePlay: force);
}
public void DoSleepSequence(float beat, bool alt = false, bool doSound = true)
public void DoSleepSequence(float beat, bool alt = false, int action = (int) PajamaParty.SleepType.Normal, bool doSound = true)
{
var cond = Conductor.instance;
Mako.StartSleepSequence(beat, alt);
MonkeySleep(beat);
Mako.StartSleepSequence(beat, alt, action);
MonkeySleep(beat, action);
if (doSound)
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/siesta1", beat),
@ -330,13 +337,13 @@ namespace HeavenStudio.Games
}
}
public void MonkeySleep(float beat)
public void MonkeySleep(float beat, int action)
{
foreach (CtrPillowMonkey monkey in monkeys)
{
if (monkey != null)
{
monkey.ReadySleep(beat);
monkey.ReadySleep(beat, action);
}
}
}