bg open / close

This commit is contained in:
minenice55 2023-12-26 21:37:45 -05:00
parent 6de6462c17
commit 39106906db
5 changed files with 5475 additions and 144 deletions

File diff suppressed because it is too large Load diff

View file

@ -26,6 +26,32 @@ AnimatorState:
m_MirrorParameter: m_MirrorParameter:
m_CycleOffsetParameter: m_CycleOffsetParameter:
m_TimeParameter: m_TimeParameter:
--- !u!1102 &-6994252768423587492
AnimatorState:
serializedVersion: 6
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: SlideClose
m_Speed: -1
m_CycleOffset: 1
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: ae6ea55007552ff4fb8f9e46a07a0b28, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &-2889309577850128088 --- !u!1102 &-2889309577850128088
AnimatorState: AnimatorState:
serializedVersion: 6 serializedVersion: 6
@ -88,7 +114,10 @@ AnimatorStateMachine:
m_Position: {x: 200, y: 0, z: 0} m_Position: {x: 200, y: 0, z: 0}
- serializedVersion: 1 - serializedVersion: 1
m_State: {fileID: -7351194649355570482} m_State: {fileID: -7351194649355570482}
m_Position: {x: 235, y: 65, z: 0} m_Position: {x: 290, y: 70, z: 0}
- serializedVersion: 1
m_State: {fileID: -6994252768423587492}
m_Position: {x: 340, y: 130, z: 0}
m_ChildStateMachines: [] m_ChildStateMachines: []
m_AnyStateTransitions: [] m_AnyStateTransitions: []
m_EntryTransitions: [] m_EntryTransitions: []

View file

@ -120,7 +120,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: -18, y: 5.5, z: 0} value: {x: -26.6, y: 5.5, z: 0}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -129,7 +129,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1 time: 1
value: {x: -36.5, y: 5.5, z: 0} value: {x: -45, y: 5.5, z: 0}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -145,7 +145,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: {x: 18.6, y: 5.5, z: 0} value: {x: 26.6, y: 5.5, z: 0}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -154,7 +154,7 @@ AnimationClip:
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3 - serializedVersion: 3
time: 1 time: 1
value: {x: 36.5, y: 5.5, z: 0} value: {x: 45, y: 5.5, z: 0}
inSlope: {x: 0, y: 0, z: 0} inSlope: {x: 0, y: 0, z: 0}
outSlope: {x: 0, y: 0, z: 0} outSlope: {x: 0, y: 0, z: 0}
tangentMode: 0 tangentMode: 0
@ -404,7 +404,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: -18 value: -26.6
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -413,7 +413,7 @@ AnimationClip:
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1 time: 1
value: -36.5 value: -45
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -488,7 +488,7 @@ AnimationClip:
m_Curve: m_Curve:
- serializedVersion: 3 - serializedVersion: 3
time: 0 time: 0
value: 18.6 value: 26.6
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136
@ -497,7 +497,7 @@ AnimationClip:
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3 - serializedVersion: 3
time: 1 time: 1
value: 36.5 value: 45
inSlope: 0 inSlope: 0
outSlope: 0 outSlope: 0
tangentMode: 136 tangentMode: 136

View file

@ -288,10 +288,10 @@ TextureImporter:
name: pillow_half_half_4 name: pillow_half_half_4
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 78 x: 111
y: 3891 y: 3885
width: 1982 width: 1979
height: 252 height: 253
alignment: 0 alignment: 0
pivot: {x: 0.5, y: 0.5} pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}
@ -603,10 +603,10 @@ TextureImporter:
name: pillow_half_half_22 name: pillow_half_half_22
rect: rect:
serializedVersion: 2 serializedVersion: 2
x: 26.855469 x: 54
y: 639.64844 y: 657
width: 1645.5078 width: 1591
height: 1862.793 height: 1833
alignment: 0 alignment: 0
pivot: {x: 0.5, y: 0.5} pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0} border: {x: 0, y: 0, z: 0, w: 0}

View file

@ -12,7 +12,8 @@ namespace HeavenStudio.Games.Loaders
using static Minigames; using static Minigames;
public static class CtrPillowLoader public static class CtrPillowLoader
{ {
public static Minigame AddGame(EventCaller eventCaller) { public static Minigame AddGame(EventCaller eventCaller)
{
return new Minigame("pajamaParty", "Pajama Party", "fc9ac3", false, false, new List<GameAction>() return new Minigame("pajamaParty", "Pajama Party", "fc9ac3", false, false, new List<GameAction>()
{ {
new GameAction("bop", "Bop") new GameAction("bop", "Bop")
@ -34,31 +35,44 @@ namespace HeavenStudio.Games.Loaders
}, },
new GameAction("jump (back to front)", "Back to Front Jumps") new GameAction("jump (back to front)", "Back to Front Jumps")
{ {
function = delegate { PajamaParty.instance.DoFiveJump(eventCaller.currentEntity.beat); }, function = delegate { PajamaParty.instance.DoFiveJump(eventCaller.currentEntity.beat); },
defaultLength = 4f, defaultLength = 4f,
inactiveFunction = delegate { PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat); } inactiveFunction = delegate { PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat); }
}, },
//idem //idem
new GameAction("slumber", "Slumber") new GameAction("slumber", "Slumber")
{ {
function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e["toggle"], e["type"]); }, function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoSleepSequence(e.beat, e["toggle"], e["type"]); },
defaultLength = 8f, defaultLength = 8f,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("type", PajamaParty.SleepType.Normal, "Sleep Type", "Type of sleep action to use"), 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"], e["type"]); } inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e["toggle"], e["type"]); }
}, },
new GameAction("throw", "Throw Pillows") new GameAction("throw", "Throw Pillows")
{ {
function = delegate { PajamaParty.instance.DoThrowSequence(eventCaller.currentEntity.beat); }, function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoThrowSequence(e.beat, high: e["high"]); },
defaultLength = 8f, defaultLength = 8f,
inactiveFunction = delegate { PajamaParty.WarnThrowSequence(eventCaller.currentEntity.beat); } inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnThrowSequence(e.beat, e["high"]); },
parameters = new List<Param>()
{
new Param("high", false, "Change Costumes", "Change character costumes"),
},
},
new GameAction("open background", "Open / Close Background")
{
function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.OpenBackground(e.beat, e.length, e["instant"]); },
defaultLength = 4f,
parameters = new List<Param>()
{
new Param("instant", false, "Instant", "Instantly open / close the background"),
},
}, },
new GameAction("instant slumber", "Instant Slumber") new GameAction("instant slumber", "Instant Slumber")
{ {
function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoInstantSleep(e.beat + e.length - 1, e["type"]); }, function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoInstantSleep(e.beat + e.length - 1, e["type"]); },
defaultLength = 0.5f, defaultLength = 0.5f,
inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnInstantSleep(e.beat, e.length, e["type"]); }, inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnInstantSleep(e.beat, e.length, e["type"]); },
resizable = true, resizable = true,
@ -72,9 +86,9 @@ namespace HeavenStudio.Games.Loaders
// background stuff // background stuff
// do shit with mako's face? (talking?) // do shit with mako's face? (talking?)
}, },
new List<string>() {"ctr", "normal"}, new List<string>() { "ctr", "normal" }
"ctrpillow", "jp", // "ctrpillow", "jp",
new List<string>() {"en", "jp", "ko"} // new List<string>() {"en", "jp", "ko"}
); );
} }
} }
@ -86,28 +100,35 @@ namespace HeavenStudio.Games
public class PajamaParty : Minigame public class PajamaParty : Minigame
{ {
[Header("Objects")] [Header("Objects")]
public CtrPillowPlayer Mako; [SerializeField] CtrPillowPlayer Mako;
public GameObject Bed; [SerializeField] GameObject Bed;
public GameObject MonkeyPrefab; [SerializeField] GameObject MonkeyPrefab;
[SerializeField] GameObject Castle;
[SerializeField] Animator BgAnimator;
[Header("Positions")] [Header("Positions")]
public Transform SpawnRoot; [SerializeField] Transform SpawnRoot;
[SerializeField] float HighCameraHeight;
//game scene //game scene
public static PajamaParty instance; public static PajamaParty instance;
CtrPillowMonkey[,] monkeys; CtrPillowMonkey[,] monkeys;
double cameraHighStart = double.MaxValue;
bool bgState, highState;
//cues while unoaded //cues while unoaded
static double WantThreeJump = double.MinValue; static double WantThreeJump = double.MinValue;
static double WantFiveJump = double.MinValue; static double WantFiveJump = double.MinValue;
static double WantThrowSequence = double.MinValue; static double WantThrowSequence = double.MinValue;
static bool WantThrowHigh = false;
static double WantSleepSequence = double.MinValue; static double WantSleepSequence = double.MinValue;
static double WantInstantSleep = double.MinValue; static double WantInstantSleep = double.MinValue;
static bool WantSleepType = false; static bool WantSleepType = false;
static int WantSleepAction = (int) PajamaParty.SleepType.Normal; static int WantSleepAction = (int)PajamaParty.SleepType.Normal;
static int WantInstantSleepAction = (int) PajamaParty.SleepType.Normal; static int WantInstantSleepAction = (int)PajamaParty.SleepType.Normal;
public enum SleepType { public enum SleepType
{
Normal, Normal,
NoAwake, NoAwake,
} }
@ -159,18 +180,18 @@ namespace HeavenStudio.Games
// m m m m m // m m m m m
// m m m m m // m m m m m
// m m P m m // m m P m m
monkeys = new CtrPillowMonkey[5,5]; monkeys = new CtrPillowMonkey[5, 5];
float RADIUS = 2.75f; float RADIUS = 2.75f;
float scale = 1.0f; float scale = 1.0f;
int sorting = 10; int sorting = 10;
//set our start position (at Mako + 2*radius to the right) //set our start position (at Mako + 2*radius to the right)
Vector3 spawnPos = SpawnRoot.position + new Vector3(-RADIUS*3, 0); Vector3 spawnPos = SpawnRoot.position + new Vector3(-RADIUS * 3, 0);
for (int y = 0; y < 5; y++) for (int y = 0; y < 5; y++)
{ {
for (int x = 0; x < 5; x++) for (int x = 0; x < 5; x++)
{ {
//on x-axis we go left to right //on x-axis we go left to right
spawnPos += new Vector3(RADIUS*scale, 0); spawnPos += new Vector3(RADIUS * scale, 0);
if (!(y == 0 && x == 2)) //don't spawn at the player's position if (!(y == 0 && x == 2)) //don't spawn at the player's position
{ {
GameObject mobj = Instantiate(MonkeyPrefab, SpawnRoot.parent); GameObject mobj = Instantiate(MonkeyPrefab, SpawnRoot.parent);
@ -185,11 +206,30 @@ namespace HeavenStudio.Games
} }
// on the y-axis we go front to back (player to the rear) // on the y-axis we go front to back (player to the rear)
scale -= 0.1f; scale -= 0.1f;
spawnPos = SpawnRoot.position - new Vector3(RADIUS*3*scale, -RADIUS/3.75f*(y+1), -RADIUS/5f*(y+1)); spawnPos = SpawnRoot.position - new Vector3(RADIUS * 3 * scale, -RADIUS / 3.75f * (y + 1), -RADIUS / 5f * (y + 1));
sorting--; sorting--;
} }
} }
void Start()
{
Castle.SetActive(false);
}
void Update()
{
var cond = Conductor.instance;
Vector3 additional = Vector3.zero;
if (cond.songPositionInBeatsAsDouble >= cameraHighStart && cond.songPositionInBeatsAsDouble < cameraHighStart + 4)
{
float prog = cond.GetPositionFromBeat(cameraHighStart, 4, true);
float yMul = prog * 2f - 1f;
float yWeight = -(yMul * yMul) + 1f;
additional.y = yWeight * HighCameraHeight;
}
GameCamera.AdditionalPosition = additional;
}
public override void OnGameSwitch(double beat) public override void OnGameSwitch(double beat)
{ {
if (WantThreeJump != double.MinValue) if (WantThreeJump != double.MinValue)
@ -222,20 +262,26 @@ namespace HeavenStudio.Games
public void Bop(double beat, double length, bool doesBop, bool autoBop) public void Bop(double beat, double length, bool doesBop, bool autoBop)
{ {
Mako.shouldBop = autoBop; Mako.shouldBop = autoBop;
for (int y = 0; y < 5; y++) { for (int y = 0; y < 5; y++)
for (int x = 0; x < 5; x++) { {
for (int x = 0; x < 5; x++)
{
if (!(y == 0 && x == 2)) monkeys[x, y].shouldBop = autoBop; if (!(y == 0 && x == 2)) monkeys[x, y].shouldBop = autoBop;
} }
} }
if (doesBop) { if (doesBop)
{
var actions = new List<BeatAction.Action>(); var actions = new List<BeatAction.Action>();
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
{ {
actions.Add(new BeatAction.Action(beat + i, delegate { actions.Add(new BeatAction.Action(beat + i, delegate
{
Mako.anim.DoScaledAnimationAsync("MakoBeat", 0.5f); Mako.anim.DoScaledAnimationAsync("MakoBeat", 0.5f);
for (int y = 0; y < 5; y++) { for (int y = 0; y < 5; y++)
for (int x = 0; x < 5; x++) { {
for (int x = 0; x < 5; x++)
{
if (!(y == 0 && x == 2)) monkeys[x, y].anim.DoScaledAnimationAsync("MonkeyBeat", 0.5f); if (!(y == 0 && x == 2)) monkeys[x, y].anim.DoScaledAnimationAsync("MonkeyBeat", 0.5f);
} }
} }
@ -249,10 +295,10 @@ namespace HeavenStudio.Games
{ {
Mako.ScheduleJump(beat); Mako.ScheduleJump(beat);
if (doSound) if (doSound)
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/three1", beat), new MultiSound.Sound("pajamaParty/three1", beat),
new MultiSound.Sound("pajamaParty/three2", beat + 1f), new MultiSound.Sound("pajamaParty/three2", beat + 1),
new MultiSound.Sound("pajamaParty/three3", beat + 2f), new MultiSound.Sound("pajamaParty/three3", beat + 2),
}); });
BeatAction.New(instance, new List<BeatAction.Action>() BeatAction.New(instance, new List<BeatAction.Action>()
@ -282,11 +328,11 @@ namespace HeavenStudio.Games
public static void WarnThreeJump(double beat) public static void WarnThreeJump(double beat)
{ {
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/three1", beat), new MultiSound.Sound("pajamaParty/three1", beat),
new MultiSound.Sound("pajamaParty/three2", beat + 1f), new MultiSound.Sound("pajamaParty/three2", beat + 1),
new MultiSound.Sound("pajamaParty/three3", beat + 2f), new MultiSound.Sound("pajamaParty/three3", beat + 2),
}, forcePlay:true); }, forcePlay: true);
WantThreeJump = beat; WantThreeJump = beat;
} }
@ -294,21 +340,21 @@ namespace HeavenStudio.Games
{ {
Mako.ScheduleJump(beat); Mako.ScheduleJump(beat);
if (doSound) if (doSound)
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/five1", beat), new MultiSound.Sound("pajamaParty/five1", beat),
new MultiSound.Sound("pajamaParty/five2", beat + 0.5f), new MultiSound.Sound("pajamaParty/five2", beat + 0.5),
new MultiSound.Sound("pajamaParty/five3", beat + 1f), new MultiSound.Sound("pajamaParty/five3", beat + 1),
new MultiSound.Sound("pajamaParty/five4", beat + 1.5f), new MultiSound.Sound("pajamaParty/five4", beat + 1.5),
new MultiSound.Sound("pajamaParty/five5", beat + 2f) new MultiSound.Sound("pajamaParty/five5", beat + 2)
}); });
BeatAction.New(instance, new List<BeatAction.Action>() BeatAction.New(instance, new List<BeatAction.Action>()
{ {
new BeatAction.Action( beat, delegate { JumpRow(4, beat); }), new BeatAction.Action( beat, delegate { JumpRow(4, beat); }),
new BeatAction.Action( beat + 0.5f, delegate { JumpRow(3, beat + 0.5f, 2); }), new BeatAction.Action( beat + 0.5, delegate { JumpRow(3, beat + 0.5, 2); }),
new BeatAction.Action( beat + 1f, delegate { JumpRow(2, beat + 1f); }), new BeatAction.Action( beat + 1, delegate { JumpRow(2, beat + 1); }),
new BeatAction.Action( beat + 1.5f, delegate { JumpRow(1, beat + 1.5f, 2); }), new BeatAction.Action( beat + 1.5, delegate { JumpRow(1, beat + 1.5, 2); }),
new BeatAction.Action( beat + 2f, delegate { JumpRow(0, beat + 2f); }), new BeatAction.Action( beat + 2, delegate { JumpRow(0, beat + 2); }),
}); });
} }
@ -316,69 +362,75 @@ namespace HeavenStudio.Games
{ {
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/five1", beat), new MultiSound.Sound("pajamaParty/five1", beat),
new MultiSound.Sound("pajamaParty/five2", beat + 0.5f), new MultiSound.Sound("pajamaParty/five2", beat + 0.5),
new MultiSound.Sound("pajamaParty/five3", beat + 1f), new MultiSound.Sound("pajamaParty/five3", beat + 1),
new MultiSound.Sound("pajamaParty/five4", beat + 1.5f), new MultiSound.Sound("pajamaParty/five4", beat + 1.5),
new MultiSound.Sound("pajamaParty/five5", beat + 2f) new MultiSound.Sound("pajamaParty/five5", beat + 2)
}, forcePlay:true); }, forcePlay: true);
WantFiveJump = beat; WantFiveJump = beat;
} }
public void DoThrowSequence(double beat, bool doSound = true) public void DoThrowSequence(double beat, bool doSound = true, bool high = false)
{ {
Mako.ScheduleThrow(beat); Mako.ScheduleThrow(beat);
if (doSound) if (doSound)
PlayThrowSequenceSound(beat); PlayThrowSequenceSound(beat);
if (high)
{
cameraHighStart = beat + 3;
}
BeatAction.New(Mako, new List<BeatAction.Action>() BeatAction.New(Mako, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + 2f, delegate { MonkeyCharge(beat + 2f); } ), new BeatAction.Action(beat + 2, delegate { MonkeyCharge(beat + 2); } ),
new BeatAction.Action(beat + 3f, delegate { MonkeyThrow(beat + 3f); } ), new BeatAction.Action(beat + 3, delegate { MonkeyThrow(beat + 3); } ),
}); });
} }
public static void WarnThrowSequence(double beat) public static void WarnThrowSequence(double beat, bool high = false)
{ {
PlayThrowSequenceSound(beat, true); PlayThrowSequenceSound(beat, true);
WantThrowSequence = beat; WantThrowSequence = beat;
WantThrowHigh = high;
} }
public static void PlayThrowSequenceSound(double beat, bool force = false) public static void PlayThrowSequenceSound(double beat, bool force = false)
{ {
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/throw1", beat), new MultiSound.Sound("pajamaParty/throw1", beat),
new MultiSound.Sound("pajamaParty/throw2", beat + 0.5f), new MultiSound.Sound("pajamaParty/throw2", beat + 0.5),
new MultiSound.Sound("pajamaParty/throw3", beat + 1f), new MultiSound.Sound("pajamaParty/throw3", beat + 1),
//TODO: change when locales are a thing //TODO: change when locales are a thing
new MultiSound.Sound("pajamaParty/throw4a", beat + 1.5f), new MultiSound.Sound("pajamaParty/throw4a", beat + 1.5),
new MultiSound.Sound("pajamaParty/charge", beat + 2f), new MultiSound.Sound("pajamaParty/charge", beat + 2),
}, forcePlay: force); }, forcePlay: force);
} }
public void DoSleepSequence(double beat, bool alt = false, int action = (int) PajamaParty.SleepType.Normal, bool doSound = true) public void DoSleepSequence(double beat, bool alt = false, int action = (int)PajamaParty.SleepType.Normal, bool doSound = true)
{ {
Mako.StartSleepSequence(beat, alt, action); Mako.StartSleepSequence(beat, alt, action);
MonkeySleep(beat, action); 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),
new MultiSound.Sound("pajamaParty/siesta2", beat + 0.5f), new MultiSound.Sound("pajamaParty/siesta2", beat + 0.5),
new MultiSound.Sound("pajamaParty/siesta3", beat + 1f), new MultiSound.Sound("pajamaParty/siesta3", beat + 1),
new MultiSound.Sound("pajamaParty/siesta3", beat + 2.5f), new MultiSound.Sound("pajamaParty/siesta3", beat + 2.5),
new MultiSound.Sound("pajamaParty/siesta3", beat + 4f) new MultiSound.Sound("pajamaParty/siesta3", beat + 4)
}); });
} }
public static void WarnSleepSequence(double beat, bool alt = false, int action = (int) PajamaParty.SleepType.Normal) public static void WarnSleepSequence(double beat, bool alt = false, int action = (int)PajamaParty.SleepType.Normal)
{ {
MultiSound.Play(new MultiSound.Sound[] { MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("pajamaParty/siesta1", beat), new MultiSound.Sound("pajamaParty/siesta1", beat),
new MultiSound.Sound("pajamaParty/siesta2", beat + 0.5f), new MultiSound.Sound("pajamaParty/siesta2", beat + 0.5),
new MultiSound.Sound("pajamaParty/siesta3", beat + 1f), new MultiSound.Sound("pajamaParty/siesta3", beat + 1),
new MultiSound.Sound("pajamaParty/siesta3", beat + 2.5f), new MultiSound.Sound("pajamaParty/siesta3", beat + 2.5),
new MultiSound.Sound("pajamaParty/siesta3", beat + 4f) new MultiSound.Sound("pajamaParty/siesta3", beat + 4)
}, forcePlay: true); }, forcePlay: true);
WantSleepSequence = beat; WantSleepSequence = beat;
WantSleepType = alt; WantSleepType = alt;
@ -388,17 +440,19 @@ namespace HeavenStudio.Games
public void DoInstantSleep(double deslumber, int action) public void DoInstantSleep(double deslumber, int action)
{ {
Mako.anim.Play("MakoSleepJust", -1, 1); Mako.anim.Play("MakoSleepJust", -1, 1);
for (int y = 0; y < 5; y++) { for (int y = 0; y < 5; y++)
for (int x = 0; x < 5; x++) { {
for (int x = 0; x < 5; x++)
{
if (!(y == 0 && x == 2)) monkeys[x, y].anim.Play("MonkeySleep02", -1, 1); if (!(y == 0 && x == 2)) monkeys[x, y].anim.Play("MonkeySleep02", -1, 1);
} }
} }
if (action == 1) return; if (action == 1) return;
BeatAction.New(this, new List<BeatAction.Action>() { BeatAction.New(this, new List<BeatAction.Action>() {
new BeatAction.Action(deslumber, delegate { new BeatAction.Action(deslumber, delegate {
Mako.anim.DoScaledAnimationAsync("MakoAwake", 0.5f); Mako.anim.DoScaledAnimationAsync("MakoAwake", 0.5f);
SoundByte.PlayOneShotGame("pajamaParty/siestaDone"); SoundByte.PlayOneShotGame("pajamaParty/siestaDone");
for (int y = 0; y < 5; y++) { for (int y = 0; y < 5; y++) {
for (int x = 0; x < 5; x++) { for (int x = 0; x < 5; x++) {
if (!(y == 0 && x == 2)) monkeys[x, y].anim.DoScaledAnimationAsync("MonkeyAwake", 0.5f); if (!(y == 0 && x == 2)) monkeys[x, y].anim.DoScaledAnimationAsync("MonkeyAwake", 0.5f);
@ -481,5 +535,19 @@ namespace HeavenStudio.Games
} }
} }
} }
public void OpenBackground(double beat, double length, bool instant = false)
{
bgState = !bgState;
if (instant)
{
BgAnimator.Play(bgState ? "SlideOpen" : "SlideClose", -1, 1);
BgAnimator.speed = 0;
}
else
{
BgAnimator.DoScaledAnimationAsync(bgState ? "SlideOpen" : "SlideClose", (float)(1.0 / length));
}
}
} }
} }