Pajama Party: option to sleep forever
This commit is contained in:
parent
85f3e002ac
commit
41091f5089
|
@ -124,7 +124,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
Projectile.SetActive(true);
|
Projectile.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ReadySleep(float beat)
|
public void ReadySleep(float beat, int action)
|
||||||
{
|
{
|
||||||
var cond = Conductor.instance;
|
var cond = Conductor.instance;
|
||||||
startThrowTime = Single.MinValue;
|
startThrowTime = Single.MinValue;
|
||||||
|
@ -161,6 +161,8 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
seq.Add(new BeatAction.Action( beat + 3f, delegate { anim.DoScaledAnimationAsync("MonkeyReadySleep"); }));
|
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 + 4f, delegate { anim.DoScaledAnimationAsync("MonkeySleep02"); }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action != (int) PajamaParty.SleepType.NoAwake)
|
||||||
seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); }));
|
seq.Add(new BeatAction.Action( beat + 7f, delegate { anim.DoScaledAnimationAsync("MonkeyAwake"); }));
|
||||||
|
|
||||||
BeatAction.New(Monkey, seq);
|
BeatAction.New(Monkey, seq);
|
||||||
|
|
|
@ -34,12 +34,14 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
bool throwType = true;
|
bool throwType = true;
|
||||||
bool hasThrown = false;
|
bool hasThrown = false;
|
||||||
bool throwNg = false;
|
bool throwNg = false;
|
||||||
|
bool longSleep = false;
|
||||||
|
|
||||||
public bool canSleep = false;
|
public bool canSleep = false;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
anim = Player.GetComponent<Animator>();
|
anim = Player.GetComponent<Animator>();
|
||||||
|
longSleep = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -306,7 +308,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
//
|
//
|
||||||
|
|
||||||
// sleep cue
|
// sleep cue
|
||||||
public void StartSleepSequence(float beat, bool alt)
|
public void StartSleepSequence(float beat, bool alt, int action)
|
||||||
{
|
{
|
||||||
if (hasJumped)
|
if (hasJumped)
|
||||||
{
|
{
|
||||||
|
@ -347,6 +349,11 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
Player.transform.localPosition = new Vector3(0, 0);
|
Player.transform.localPosition = new Vector3(0, 0);
|
||||||
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
|
Shadow.transform.localScale = new Vector3(1.65f, 1f, 1f);
|
||||||
|
|
||||||
|
if (action == (int) PajamaParty.SleepType.NoAwake)
|
||||||
|
{
|
||||||
|
longSleep = true;
|
||||||
|
}
|
||||||
|
|
||||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||||
{
|
{
|
||||||
new BeatAction.Action(
|
new BeatAction.Action(
|
||||||
|
@ -394,6 +401,8 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
Jukebox.PlayOneShotGame("pajamaParty/siesta4");
|
Jukebox.PlayOneShotGame("pajamaParty/siesta4");
|
||||||
anim.DoScaledAnimationAsync("MakoSleepJust");
|
anim.DoScaledAnimationAsync("MakoSleepJust");
|
||||||
|
|
||||||
|
if (!longSleep)
|
||||||
|
{
|
||||||
BeatAction.New(Player, new List<BeatAction.Action>()
|
BeatAction.New(Player, new List<BeatAction.Action>()
|
||||||
{
|
{
|
||||||
new BeatAction.Action(
|
new BeatAction.Action(
|
||||||
|
@ -405,6 +414,8 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
longSleep = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,9 @@ namespace HeavenStudio.Games.Loaders
|
||||||
inactiveFunction: delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
|
inactiveFunction: delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
|
||||||
),
|
),
|
||||||
//idem
|
//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")
|
new Param("toggle", false, "Alt. Animation", "Use an alternate animation for Mako")
|
||||||
},
|
},
|
||||||
inactiveFunction: delegate {var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e.toggle);}
|
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 WantThrowSequence = Single.MinValue;
|
||||||
static float WantSleepSequence = Single.MinValue;
|
static float WantSleepSequence = Single.MinValue;
|
||||||
static bool WantSleepType = false;
|
static bool WantSleepType = false;
|
||||||
|
static int WantSleepAction = (int) PajamaParty.SleepType.Normal;
|
||||||
|
|
||||||
|
public enum SleepType {
|
||||||
|
Normal,
|
||||||
|
NoAwake,
|
||||||
|
}
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
@ -128,7 +135,7 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
if (WantSleepSequence != Single.MinValue)
|
if (WantSleepSequence != Single.MinValue)
|
||||||
{
|
{
|
||||||
DoSleepSequence(WantSleepSequence, WantSleepType, false);
|
DoSleepSequence(WantSleepSequence, WantSleepType, WantSleepAction, false);
|
||||||
WantSleepSequence = Single.MinValue;
|
WantSleepSequence = Single.MinValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -245,11 +252,11 @@ namespace HeavenStudio.Games
|
||||||
}, forcePlay: force);
|
}, 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;
|
var cond = Conductor.instance;
|
||||||
Mako.StartSleepSequence(beat, alt);
|
Mako.StartSleepSequence(beat, alt, action);
|
||||||
MonkeySleep(beat);
|
MonkeySleep(beat, action);
|
||||||
if (doSound)
|
if (doSound)
|
||||||
MultiSound.Play(new MultiSound.Sound[] {
|
MultiSound.Play(new MultiSound.Sound[] {
|
||||||
new MultiSound.Sound("pajamaParty/siesta1", beat),
|
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)
|
foreach (CtrPillowMonkey monkey in monkeys)
|
||||||
{
|
{
|
||||||
if (monkey != null)
|
if (monkey != null)
|
||||||
{
|
{
|
||||||
monkey.ReadySleep(beat);
|
monkey.ReadySleep(beat, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue