mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 13:07:38 +02:00
a lot
* munchy monk input + mustache fixes * fork lifter and pajama party bopping * meat grinder miss bop fix * cloud monkey Real * marching orders Go! was broken * force march doesn't break when it's too early from a game switch * you can use the March! block without the marching now
This commit is contained in:
@ -34,7 +34,6 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
new GameAction("sigh", "Sigh")
|
||||
{
|
||||
|
||||
function = delegate { Jukebox.PlayOneShot("games/forkLifter/sigh"); }
|
||||
},
|
||||
new GameAction("color", "Background Color")
|
||||
@ -59,6 +58,17 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
resizable = true
|
||||
},
|
||||
new GameAction("bop", "Bop")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; ForkLifter.instance.Bop(e.beat, e.length, e["bop"], e["autoBop"]); },
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("bop", true, "Keep Bopping", "Should Fork bop for the duration of the block?"),
|
||||
new Param("autoBop", false, "Keep Bopping (Auto)", "Should Fork bop indefinitely?"),
|
||||
},
|
||||
resizable = true,
|
||||
},
|
||||
|
||||
// These are still here for backwards-compatibility but are hidden in the editor
|
||||
new GameAction("pea", "")
|
||||
{
|
||||
@ -143,6 +153,18 @@ namespace HeavenStudio.Games
|
||||
ForkLifterHand.CheckNextFlick();
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length, bool doesBop, bool autoBop)
|
||||
{
|
||||
playerInstance.shouldBop = (autoBop || doesBop);
|
||||
if (!autoBop && doesBop) {
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>() {
|
||||
new BeatAction.Action(beat + length, delegate {
|
||||
playerInstance.shouldBop = false;
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void Flick(float beat, int type)
|
||||
{
|
||||
Jukebox.PlayOneShotGame("forkLifter/flick");
|
||||
|
@ -13,24 +13,21 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
public static ForkLifterPlayer instance { get; set; }
|
||||
|
||||
[Header("Objects")]
|
||||
public GameObject fork;
|
||||
public Sprite peaSprite;
|
||||
public Sprite hitFX;
|
||||
public Sprite hitFXG;
|
||||
public Sprite hitFXMiss;
|
||||
public Sprite hitFX2;
|
||||
public Transform early, perfect, late;
|
||||
|
||||
[SerializeField]
|
||||
private BoxCollider2D col;
|
||||
|
||||
private Animator anim;
|
||||
|
||||
private int currentHitInList = 0;
|
||||
|
||||
public bool shouldBop;
|
||||
public int currentEarlyPeasOnFork;
|
||||
public int currentPerfectPeasOnFork;
|
||||
public int currentLatePeasOnFork;
|
||||
private float lastReportedBeat;
|
||||
|
||||
private bool isEating = false;
|
||||
|
||||
@ -57,6 +54,11 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
{
|
||||
currentHitInList = 0;
|
||||
}
|
||||
|
||||
if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && shouldBop)
|
||||
{
|
||||
anim.DoScaledAnimationAsync("Player_Bop", 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public void Eat()
|
||||
@ -68,6 +70,7 @@ namespace HeavenStudio.Games.Scripts_ForkLifter
|
||||
}
|
||||
}
|
||||
|
||||
// used in an animation event
|
||||
public void EatConfirm()
|
||||
{
|
||||
if (topbun && middleburger && bottombun)
|
||||
|
@ -46,12 +46,13 @@ namespace HeavenStudio.Games.Loaders
|
||||
},
|
||||
new GameAction("march", "March!")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.SargeMarch(e.beat, e["disableVoice"]); },
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.SargeMarch(e.beat, e["disableVoice"]); },
|
||||
function = delegate { var e = eventCaller.currentEntity; MarchingOrders.SargeMarch(e.beat, e["disableVoice"], e["shouldMarch"]); },
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; MarchingOrders.SargeMarch(e.beat, e["disableVoice"], e["shouldMarch"]); },
|
||||
defaultLength = 2f,
|
||||
parameters = new List<Param>
|
||||
{
|
||||
new Param("disableVoice", false, "Disable Voice", "Disable the Drill Sergeant's call")
|
||||
new Param("disableVoice", false, "Disable Voice", "Disable the Drill Sergeant's call"),
|
||||
new Param("shouldMarch", true, "March", "Disable automatic marching"),
|
||||
},
|
||||
priority = 5,
|
||||
},
|
||||
@ -96,7 +97,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("start", true, "Start Moving", "Start moving the conveyor"),
|
||||
new Param("direction", MarchingOrders.Direction.Right, "Direction", "Direction"),
|
||||
new Param("direction", MarchingOrders.Direction.Right, "Direction", "The direction the cadets will move"),
|
||||
},
|
||||
defaultLength = 7f,
|
||||
resizable = true,
|
||||
@ -129,19 +130,19 @@ namespace HeavenStudio.Games.Loaders
|
||||
var e = eventCaller.currentEntity;
|
||||
MarchingOrders.instance.ForceMarching(e.beat, e.length);
|
||||
},
|
||||
preFunctionLength = 1,
|
||||
preFunctionLength = 0.2f,
|
||||
resizable = true,
|
||||
},
|
||||
|
||||
// hidden in the editor but here cuz backwards compatibility
|
||||
new GameAction("marching", "Start Marching (old)")
|
||||
{
|
||||
hidden = true,
|
||||
hidden = false,
|
||||
preFunction = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
MarchingOrders.instance.ForceMarching(e.beat, e.length);
|
||||
},
|
||||
preFunctionLength = 1,
|
||||
preFunctionLength = 0.2f,
|
||||
resizable = true,
|
||||
},
|
||||
new GameAction("face turn", "Direction to Turn (old)")
|
||||
@ -267,8 +268,8 @@ namespace HeavenStudio.Games
|
||||
|
||||
if (ConveyorGo[0].AutoScroll && (ConveyorGo[1].gameObject.transform.position.x < 0)) {
|
||||
foreach (var scroll in ConveyorGo) scroll.AutoScroll = false;
|
||||
ConveyorGo[0].gameObject.transform.position = new Vector3(0, 0);
|
||||
ConveyorGo[1].gameObject.transform.position = new Vector3(6.181f, -3.37f);
|
||||
ConveyorGo[0].gameObject.transform.position = new Vector3(6.181f, -3.37f);
|
||||
ConveyorGo[1].gameObject.transform.position = new Vector3(0, 0);
|
||||
}
|
||||
|
||||
// input stuff below
|
||||
@ -377,11 +378,9 @@ namespace HeavenStudio.Games
|
||||
});
|
||||
}
|
||||
|
||||
public static void SargeMarch(float beat, bool noVoice)
|
||||
public static void SargeMarch(float beat, bool noVoice, bool march)
|
||||
{
|
||||
if (MarchingOrders.wantMarch != float.MinValue) return;
|
||||
MarchingOrders.wantMarch = beat + 1;
|
||||
|
||||
if (march) MarchingOrders.wantMarch = beat + 1;
|
||||
if (!noVoice) PlaySoundSequence("marchingOrders", "susume", beat);
|
||||
|
||||
if (GameManager.instance.currentGame == "marchingOrders") {
|
||||
@ -393,7 +392,7 @@ namespace HeavenStudio.Games
|
||||
public void ForceMarching(float beat, float length)
|
||||
{
|
||||
for (int i = 0; i < length; i++) {
|
||||
ScheduleInput(beat + i - 1, 1f, InputType.STANDARD_DOWN, MarchHit, GenericMiss, Empty);
|
||||
ScheduleInput(beat + i - 0.2f, 0.2f, InputType.STANDARD_DOWN, MarchHit, GenericMiss, Empty);
|
||||
BeatAction.New(instance.gameObject, new List<BeatAction.Action>() {
|
||||
new BeatAction.Action(beat + i, delegate {
|
||||
marchOtherCount++;
|
||||
|
@ -119,10 +119,7 @@ namespace HeavenStudio.Games
|
||||
intervalStarted = false;
|
||||
beatInterval = 4f;
|
||||
}
|
||||
foreach (var evt in scheduledInputs)
|
||||
{
|
||||
evt.Disable();
|
||||
}
|
||||
foreach (var evt in scheduledInputs) evt.Disable();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@ -131,13 +128,13 @@ namespace HeavenStudio.Games
|
||||
TackAnim.DoScaledAnimationAsync("TackEmptyHit", 0.5f);
|
||||
TackAnim.SetBool("tackMeated", false);
|
||||
Jukebox.PlayOneShotGame(sfxName+"whiff");
|
||||
if (bossAnnoyed) BossAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
||||
bossAnnoyed = false;
|
||||
}
|
||||
|
||||
if (bossAnnoyed) BossAnim.SetBool("bossAnnoyed", true);
|
||||
|
||||
if (queuedIntervals.Count > 0) {
|
||||
foreach (var interval in queuedIntervals) { StartInterval(interval.beat, interval.length); }
|
||||
foreach (var interval in queuedIntervals) StartInterval(interval.beat, interval.length);
|
||||
queuedIntervals.Clear();
|
||||
}
|
||||
}
|
||||
@ -178,9 +175,7 @@ namespace HeavenStudio.Games
|
||||
length = length,
|
||||
});
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("meatGrinder/startSignal", beat - 1),
|
||||
}, forcePlay: true);
|
||||
Jukebox.PlayOneShotGame("meatGrinder/startSignal", beat - 1, forcePlay: true);
|
||||
|
||||
if (GameManager.instance.currentGame == "meatGrinder") {
|
||||
BeatAction.New(MeatGrinder.instance.gameObject, new List<BeatAction.Action>() {
|
||||
|
@ -32,6 +32,7 @@ namespace HeavenStudio.Games.Loaders
|
||||
var e = eventCaller.currentEntity;
|
||||
MunchyMonk.instance.MonkMove(e.beat, e.length, e["goToSide"], e["ease"]);
|
||||
},
|
||||
defaultLength = 8f,
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
@ -133,6 +134,20 @@ namespace HeavenStudio.Games.Loaders
|
||||
new Param("ease", EasingFunction.Ease.Linear, "Ease", "Which ease should the scroll ramp up have?"),
|
||||
}
|
||||
},
|
||||
new GameAction("CloudMonkey", "Cloud Monkey")
|
||||
{
|
||||
function = delegate {
|
||||
var e = eventCaller.currentEntity;
|
||||
MunchyMonk.instance.MoveCloudMonkey(e.beat, e.length, e["start"], e["direction"]);
|
||||
},
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("start", true, "Start Moving", "Start moving the monkey"),
|
||||
new Param("direction", MunchyMonk.WhichSide.Right, "Direction", "The direction the monkey will move."),
|
||||
},
|
||||
defaultLength = 8f,
|
||||
resizable = true,
|
||||
},
|
||||
},
|
||||
new List<string>() {"ntr", "normal"},
|
||||
"ntrshugyo", "en",
|
||||
@ -176,6 +191,8 @@ namespace HeavenStudio.Games
|
||||
[SerializeField] GameObject BrowHolder;
|
||||
[SerializeField] GameObject StacheHolder;
|
||||
[SerializeField] GameObject DumplingObj;
|
||||
[SerializeField] GameObject CloudMonkey;
|
||||
[SerializeField] ScrollObject CloudMonkeyScroll;
|
||||
|
||||
[Header("Animators")]
|
||||
[SerializeField] Animator OneGiverAnim;
|
||||
@ -230,31 +247,39 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
scrollObjects = FindObjectsByType<ScrollObject>(FindObjectsSortMode.None);
|
||||
foreach (var obj in scrollObjects) obj.SpeedMod = scrollModCurrent;
|
||||
if (growLevel > 0) {
|
||||
StacheHolder.SetActive(true);
|
||||
StacheAnim.Play($"Idle{growLevel}");
|
||||
if (growLevel == 4) {
|
||||
BrowHolder.SetActive(true);
|
||||
BrowAnim.Play("Idle");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
// reset static variables
|
||||
if (queuedOnes.Count > 0) queuedOnes.Clear();
|
||||
if (queuedTwoTwos.Count > 0) queuedThrees.Clear();
|
||||
if (queuedThrees.Count > 0) queuedThrees.Clear();
|
||||
// reset static variables only when the game is stopped (so that it carries over between game switches)
|
||||
if (!Conductor.instance.NotStopped()) {
|
||||
if (queuedOnes.Count > 0) queuedOnes.Clear();
|
||||
if (queuedTwoTwos.Count > 0) queuedThrees.Clear();
|
||||
if (queuedThrees.Count > 0) queuedThrees.Clear();
|
||||
|
||||
howManyGulps = 0;
|
||||
growLevel = 0;
|
||||
inputsTilGrow = 10;
|
||||
noBlush = false;
|
||||
disableBaby = false;
|
||||
|
||||
foreach (var evt in scheduledInputs)
|
||||
{
|
||||
evt.Disable();
|
||||
howManyGulps = 0;
|
||||
growLevel = 0;
|
||||
inputsTilGrow = 10;
|
||||
noBlush = false;
|
||||
disableBaby = false;
|
||||
}
|
||||
|
||||
foreach (var evt in scheduledInputs) evt.Disable();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
// input stuff
|
||||
if (PlayerInput.Pressed(true) && (!IsExpectingInputNow(InputType.STANDARD_DOWN) || !IsExpectingInputNow(InputType.DIRECTION_DOWN))) {
|
||||
if (PlayerInput.Pressed(true) && !IsExpectingInputNow(InputType.STANDARD_DOWN)) {
|
||||
Debug.Log("ooops" + PlayerInput.Pressed(true));
|
||||
MonkArmsAnim.DoScaledAnimationAsync("WristSlap", 0.5f);
|
||||
Jukebox.PlayOneShotGame(sfxName+"slap");
|
||||
isStaring = false;
|
||||
@ -304,6 +329,10 @@ namespace HeavenStudio.Games
|
||||
foreach (var obj in scrollObjects) obj.SpeedMod = newPos;
|
||||
}
|
||||
|
||||
if (CloudMonkey.transform.position.x < -5 || CloudMonkey.transform.position.x > 15.5) {
|
||||
CloudMonkey.SetActive(false);
|
||||
}
|
||||
|
||||
// cue queuing stuff
|
||||
if (queuedOnes.Count > 0) {
|
||||
foreach (var dumpling in queuedOnes) OneGoCue(dumpling.beat, dumpling.color1);
|
||||
@ -335,6 +364,10 @@ namespace HeavenStudio.Games
|
||||
if (growLevel == 4) BrowAnim.DoScaledAnimationAsync("Bop", 0.5f);
|
||||
if (growLevel > 0) StacheAnim.DoScaledAnimationAsync($"Bop{growLevel}", 0.5f);
|
||||
}
|
||||
|
||||
if (CloudMonkey.activeInHierarchy) {
|
||||
CloudMonkey.GetComponent<Animator>().DoScaledAnimationAsync("Bop", 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,8 +415,10 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
PlaySoundSequence("munchyMonk", "one_go", beat);
|
||||
|
||||
queuedOnes.Add(new QueuedDumpling()
|
||||
{ beat = beat, color1 = firstColor, });
|
||||
queuedOnes.Add(new QueuedDumpling() {
|
||||
beat = beat,
|
||||
color1 = firstColor,
|
||||
});
|
||||
}
|
||||
|
||||
public void OneGoCue(float beat, Color firstColor)
|
||||
@ -539,16 +574,28 @@ namespace HeavenStudio.Games
|
||||
|
||||
public static void Modifiers(float beat, int inputsTilGrow, bool resetLevel, int setLevel, bool disableBaby, bool shouldBlush)
|
||||
{
|
||||
if (MunchyMonk.inputsTilGrow != inputsTilGrow) MunchyMonk.howManyGulps = inputsTilGrow * MunchyMonk.growLevel;
|
||||
if (setLevel != 0) MunchyMonk.growLevel = setLevel;
|
||||
if (MunchyMonk.inputsTilGrow != inputsTilGrow) {
|
||||
// no matter what you set inputsTilGrow to, it will reset howManyGulps to a value inbetween the level-ups relative to the old level and old inputsTilGrow.
|
||||
MunchyMonk.howManyGulps = ((inputsTilGrow * MunchyMonk.growLevel) + inputsTilGrow * (MunchyMonk.howManyGulps % MunchyMonk.inputsTilGrow)/MunchyMonk.inputsTilGrow);
|
||||
MunchyMonk.inputsTilGrow = inputsTilGrow;
|
||||
}
|
||||
|
||||
if (setLevel != 0) {
|
||||
MunchyMonk.growLevel = setLevel;
|
||||
MunchyMonk.howManyGulps = setLevel*inputsTilGrow;
|
||||
if (GameManager.instance.currentGame == "munchyMonk") {
|
||||
MunchyMonk.instance.StacheAnim.Play($"Idle{setLevel}", 0, 0);
|
||||
MunchyMonk.instance.StacheHolder.SetActive(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (resetLevel) {
|
||||
MunchyMonk.growLevel = 0;
|
||||
MunchyMonk.howManyGulps = 0;
|
||||
if (GameManager.instance.currentGame == "munchyMonk") MunchyMonk.instance.StacheHolder.SetActive(false);
|
||||
}
|
||||
|
||||
|
||||
MunchyMonk.noBlush = !shouldBlush;
|
||||
MunchyMonk.inputsTilGrow = inputsTilGrow;
|
||||
MunchyMonk.disableBaby = disableBaby;
|
||||
|
||||
if (GameManager.instance.currentGame == "munchyMonk")
|
||||
@ -563,5 +610,14 @@ namespace HeavenStudio.Games
|
||||
scrollRampUp = true;
|
||||
scrollEase = (EasingFunction.Ease)ease;
|
||||
}
|
||||
|
||||
public void MoveCloudMonkey(float beat, float length, bool go, int direction)
|
||||
{
|
||||
bool wasActive = CloudMonkey.activeInHierarchy;
|
||||
CloudMonkey.SetActive(true);
|
||||
CloudMonkeyScroll.SpeedMod = ((direction == 0 ? 34 : -34)/length)*(Conductor.instance.songBpm/100);
|
||||
CloudMonkeyScroll.AutoScroll = go;
|
||||
if (!wasActive) CloudMonkey.transform.position = new Vector3((direction == 0 ? -5f : 15.5f), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
@ -15,20 +15,24 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
public GameObject Projectile;
|
||||
|
||||
public Animator anim;
|
||||
public bool shouldBop = false;
|
||||
|
||||
public int row;
|
||||
public int col;
|
||||
|
||||
float lastReportedBeat;
|
||||
float startJumpTime = Single.MinValue;
|
||||
float jumpLength = 1f;
|
||||
float jumpHeight = 4f;
|
||||
int jumpAlt;
|
||||
|
||||
private bool hasJumped = false;
|
||||
bool shouldntBop = false;
|
||||
bool hasJumped = false;
|
||||
|
||||
float startThrowTime = Single.MinValue;
|
||||
float throwLength = 4f;
|
||||
float throwHeight = 12f;
|
||||
|
||||
private bool hasThrown = false;
|
||||
|
||||
void Awake()
|
||||
@ -67,6 +71,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
{
|
||||
if (hasJumped)
|
||||
{
|
||||
shouldntBop = false;
|
||||
hasJumped = false;
|
||||
PajamaParty.instance.DoBedImpact();
|
||||
anim.DoScaledAnimationAsync("MonkeyLand");
|
||||
@ -98,10 +103,19 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
anim.DoUnscaledAnimation("MonkeyBeat");
|
||||
Projectile.SetActive(false);
|
||||
hasThrown = false;
|
||||
shouldntBop = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && !hasThrown && !shouldntBop && shouldBop)
|
||||
{
|
||||
anim.DoScaledAnimationAsync("MonkeyBeat", 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public void Jump(float beat, int alt = 1)
|
||||
{
|
||||
startJumpTime = beat;
|
||||
@ -114,6 +128,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
|
||||
public void Charge(float beat)
|
||||
{
|
||||
shouldntBop = true;
|
||||
anim.DoUnscaledAnimation("MonkeyReady");
|
||||
}
|
||||
|
||||
@ -126,6 +141,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
|
||||
public void ReadySleep(float beat, int action)
|
||||
{
|
||||
shouldntBop = true;
|
||||
var cond = Conductor.instance;
|
||||
startThrowTime = Single.MinValue;
|
||||
Projectile.transform.localPosition = new Vector3(0, 0);
|
||||
|
@ -16,27 +16,31 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
public GameObject Projectile_Root;
|
||||
|
||||
public Animator anim;
|
||||
float lastReportedBeat;
|
||||
float startJumpTime = Single.MinValue;
|
||||
float jumpLength = 0;
|
||||
float jumpHeight = 0;
|
||||
bool jumpNg = false;
|
||||
|
||||
private bool hasJumped = false;
|
||||
private bool canJump = true;
|
||||
bool canJump = true;
|
||||
bool hasJumped = false;
|
||||
|
||||
private bool charging = false;
|
||||
private bool canCharge = true;
|
||||
|
||||
private bool startedSleeping = false;
|
||||
|
||||
float startThrowTime = Single.MinValue;
|
||||
float throwLength = 0;
|
||||
float throwHeight = 0;
|
||||
// true = throw, false = dropped ("Out")
|
||||
bool throwType = true;
|
||||
|
||||
bool throwType = true; // true = throw, false = dropped ("Out")
|
||||
bool hasThrown = false;
|
||||
bool throwNg = false;
|
||||
bool longSleep = false;
|
||||
|
||||
public bool canSleep = false;
|
||||
public bool shouldBop = false;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
@ -44,7 +48,6 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
longSleep = false;
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
@ -145,6 +148,14 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
}
|
||||
}
|
||||
|
||||
private void LateUpdate()
|
||||
{
|
||||
if (Conductor.instance.ReportBeat(ref lastReportedBeat) && anim.IsAnimationNotPlaying() && !hasThrown && !startedSleeping && canCharge && shouldBop)
|
||||
{
|
||||
anim.DoScaledAnimationAsync("MakoBeat", 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public void ProjectileThrow(float beat, bool drop = false, bool ng = false)
|
||||
{
|
||||
throwNg = ng;
|
||||
@ -167,6 +178,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
|
||||
public void PlayerJump(float beat, bool pressout = false, bool ng = false)
|
||||
{
|
||||
startedSleeping = false;
|
||||
startJumpTime = beat;
|
||||
canCharge = false;
|
||||
canJump = false;
|
||||
@ -179,6 +191,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
|
||||
public void StartCharge()
|
||||
{
|
||||
startedSleeping = false;
|
||||
canJump = false;
|
||||
anim.DoUnscaledAnimation("MakoReady");
|
||||
charging = true;
|
||||
@ -312,6 +325,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty
|
||||
// sleep cue
|
||||
public void StartSleepSequence(float beat, bool alt, int action)
|
||||
{
|
||||
startedSleeping = true;
|
||||
if (hasJumped)
|
||||
{
|
||||
hasJumped = false;
|
||||
|
@ -14,36 +14,58 @@ namespace HeavenStudio.Games.Loaders
|
||||
public static Minigame AddGame(EventCaller eventCaller) {
|
||||
return new Minigame("pajamaParty", "Pajama Party", "fc9ac3", false, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", "Bop")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.Bop(e.beat, e.length, e["bop"], e["autoBop"]); },
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("bop", true, "Keep Bopping", "Should Mako and the monkeys bop for the duration of the block?"),
|
||||
new Param("autoBop", false, "Keep Bopping (Auto)", "Should Mako and the monkeys bop indefinitely?"),
|
||||
},
|
||||
resizable = true,
|
||||
},
|
||||
// both same timing
|
||||
new GameAction("jump (side to middle)", "Side to Middle Jumps")
|
||||
{
|
||||
function = delegate {PajamaParty.instance.DoThreeJump(eventCaller.currentEntity.beat);},
|
||||
function = delegate { PajamaParty.instance.DoThreeJump(eventCaller.currentEntity.beat); },
|
||||
defaultLength = 4f,
|
||||
inactiveFunction = delegate {PajamaParty.WarnThreeJump(eventCaller.currentEntity.beat);}
|
||||
inactiveFunction = delegate { PajamaParty.WarnThreeJump(eventCaller.currentEntity.beat); }
|
||||
},
|
||||
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,
|
||||
inactiveFunction = delegate {PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat);}
|
||||
inactiveFunction = delegate { PajamaParty.WarnFiveJump(eventCaller.currentEntity.beat); }
|
||||
},
|
||||
//idem
|
||||
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,
|
||||
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"], e["type"]);}
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnSleepSequence(e.beat, e["toggle"], e["type"]); }
|
||||
},
|
||||
new GameAction("throw", "Throw Pillows")
|
||||
{
|
||||
function = delegate {PajamaParty.instance.DoThrowSequence(eventCaller.currentEntity.beat);},
|
||||
function = delegate { PajamaParty.instance.DoThrowSequence(eventCaller.currentEntity.beat); },
|
||||
defaultLength = 8f,
|
||||
inactiveFunction = delegate {PajamaParty.WarnThrowSequence(eventCaller.currentEntity.beat);}
|
||||
inactiveFunction = delegate { PajamaParty.WarnThrowSequence(eventCaller.currentEntity.beat); }
|
||||
},
|
||||
new GameAction("instant slumber", "Instant Slumber")
|
||||
{
|
||||
function = delegate { var e = eventCaller.currentEntity; PajamaParty.instance.DoInstantSleep(e.beat + e.length - 1, e["type"]); },
|
||||
defaultLength = 0.5f,
|
||||
inactiveFunction = delegate { var e = eventCaller.currentEntity; PajamaParty.WarnInstantSleep(e.beat, e.length, e["type"]); },
|
||||
resizable = true,
|
||||
parameters = new List<Param>()
|
||||
{
|
||||
new Param("type", PajamaParty.SleepType.Normal, "Sleep Type", "Type of sleep action to use"),
|
||||
},
|
||||
priority = 5,
|
||||
},
|
||||
// todo cosmetic crap
|
||||
// background stuff
|
||||
@ -79,9 +101,11 @@ namespace HeavenStudio.Games
|
||||
static float WantFiveJump = Single.MinValue;
|
||||
static float WantThrowSequence = Single.MinValue;
|
||||
static float WantSleepSequence = Single.MinValue;
|
||||
static float WantInstantSleep = Single.MinValue;
|
||||
static bool WantSleepType = false;
|
||||
static int WantSleepAction = (int) PajamaParty.SleepType.Normal;
|
||||
|
||||
static int WantInstantSleepAction = (int) PajamaParty.SleepType.Normal;
|
||||
|
||||
public enum SleepType {
|
||||
Normal,
|
||||
NoAwake,
|
||||
@ -151,6 +175,32 @@ namespace HeavenStudio.Games
|
||||
DoSleepSequence(WantSleepSequence, WantSleepType, WantSleepAction, false);
|
||||
WantSleepSequence = Single.MinValue;
|
||||
}
|
||||
if (WantInstantSleep != Single.MinValue)
|
||||
{
|
||||
DoInstantSleep(WantInstantSleep, WantInstantSleepAction);
|
||||
WantInstantSleep = Single.MinValue;
|
||||
}
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length, bool doesBop, bool autoBop)
|
||||
{
|
||||
void Bops(bool bop) {
|
||||
Mako.shouldBop = bop;
|
||||
for (int y = 0; y < 5; y++) {
|
||||
for (int x = 0; x < 5; x++) {
|
||||
if (!(y == 0 && x == 2)) monkeys[x, y].shouldBop = bop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bops(autoBop || doesBop);
|
||||
if (!autoBop && doesBop) {
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>() {
|
||||
new BeatAction.Action(beat + length, delegate {
|
||||
Bops(false);
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public void DoThreeJump(float beat, bool doSound = true)
|
||||
@ -222,8 +272,8 @@ namespace HeavenStudio.Games
|
||||
|
||||
public static void WarnFiveJump(float beat)
|
||||
{
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("pajamaParty/five1", beat),
|
||||
MultiSound.Play(new MultiSound.Sound[] {
|
||||
new MultiSound.Sound("pajamaParty/five1", beat),
|
||||
new MultiSound.Sound("pajamaParty/five2", beat + 0.5f),
|
||||
new MultiSound.Sound("pajamaParty/five3", beat + 1f),
|
||||
new MultiSound.Sound("pajamaParty/five4", beat + 1.5f),
|
||||
@ -240,8 +290,8 @@ namespace HeavenStudio.Games
|
||||
|
||||
BeatAction.New(Mako.Player, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action( beat + 2f, delegate { MonkeyCharge(beat + 2f); } ),
|
||||
new BeatAction.Action( beat + 3f, delegate { MonkeyThrow(beat + 3f); } ),
|
||||
new BeatAction.Action(beat + 2f, delegate { MonkeyCharge(beat + 2f); } ),
|
||||
new BeatAction.Action(beat + 3f, delegate { MonkeyThrow(beat + 3f); } ),
|
||||
});
|
||||
}
|
||||
|
||||
@ -267,7 +317,6 @@ namespace HeavenStudio.Games
|
||||
|
||||
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, action);
|
||||
MonkeySleep(beat, action);
|
||||
if (doSound)
|
||||
@ -294,6 +343,35 @@ namespace HeavenStudio.Games
|
||||
WantSleepAction = action;
|
||||
}
|
||||
|
||||
public void DoInstantSleep(float deslumber, int action)
|
||||
{
|
||||
Mako.anim.Play("MakoSleepJust", -1, 1);
|
||||
for (int y = 0; y < 5; y++) {
|
||||
for (int x = 0; x < 5; x++) {
|
||||
if (!(y == 0 && x == 2)) monkeys[x, y].anim.Play("MonkeySleep02", -1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (action == 1) return;
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>() {
|
||||
new BeatAction.Action(deslumber, delegate {
|
||||
Mako.anim.DoScaledAnimationAsync("MakoAwake", 0.5f);
|
||||
Jukebox.PlayOneShotGame("pajamaParty/siestaDone");
|
||||
for (int y = 0; y < 5; y++) {
|
||||
for (int x = 0; x < 5; x++) {
|
||||
if (!(y == 0 && x == 2)) monkeys[x, y].anim.DoScaledAnimationAsync("MonkeyAwake", 0.5f);
|
||||
}
|
||||
}
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
public static void WarnInstantSleep(float beat, float length, int action)
|
||||
{
|
||||
WantInstantSleep = beat + length - 1;
|
||||
WantInstantSleepAction = action;
|
||||
}
|
||||
|
||||
public void DoBedImpact()
|
||||
{
|
||||
Bed.GetComponent<Animator>().Play("BedImpact", -1, 0);
|
||||
|
Reference in New Issue
Block a user