Marching orders fast face sound improvement + catchy tune control when da smile ends (#317)

* here do da fast one now

* boom

* lol

* Epic beat timing change
This commit is contained in:
Rapandrasmus
2023-02-25 04:41:18 +01:00
committed by GitHub
parent f59040f103
commit e9064f29bb
15 changed files with 67 additions and 61 deletions

View File

@ -20,9 +20,10 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
new Param("side", CatchyTune.Side.Left, "Side", "The side the orange falls down"),
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching")
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching"),
new Param("endSmile", new EntityTypes.Float(2, 100), "End Smile Beat", "How many beats after the catch should the smile end?")
},
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], false); },
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], false, e["endSmile"]); },
},
new GameAction("pineapple", "Pineapple")
@ -31,9 +32,10 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
new Param("side", CatchyTune.Side.Left, "Side", "The side the pineapple falls down"),
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching")
new Param("smile", false, "Smile", "If the characters smile with the heart message after catching"),
new Param("endSmile", new EntityTypes.Float(2, 100), "End Smile Beat", "How many beats after the catch should the smile end?")
},
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], true); },
preFunction = delegate {var e = eventCaller.currentEntity; CatchyTune.PreDropFruit(e.beat, e["side"], e["smile"], true, e["endSmile"]); },
},
new GameAction("bop", "Bop")
@ -117,6 +119,7 @@ namespace HeavenStudio.Games
public int side;
public bool smile;
public bool isPineapple;
public float endSmile;
}
private void Awake()
@ -137,7 +140,7 @@ namespace HeavenStudio.Games
{
foreach (var fruit in queuedFruits)
{
DropFruit(fruit.beat, fruit.side, fruit.smile, fruit.isPineapple);
DropFruit(fruit.beat, fruit.side, fruit.smile, fruit.isPineapple, fruit.endSmile);
}
queuedFruits.Clear();
}
@ -201,23 +204,23 @@ namespace HeavenStudio.Games
}
}
public void DropFruit(float beat, int side, bool smile, bool isPineapple)
public void DropFruit(float beat, int side, bool smile, bool isPineapple, float endSmile)
{
var objectToSpawn = isPineapple ? pineappleBase : orangeBase;
if (side == (int)Side.Left || side == (int)Side.Both)
{
DropFruitSingle(beat, false, smile, objectToSpawn);
DropFruitSingle(beat, false, smile, objectToSpawn, endSmile);
}
if (side == (int)Side.Right || side == (int)Side.Both)
{
DropFruitSingle(beat, true, smile, objectToSpawn);
DropFruitSingle(beat, true, smile, objectToSpawn, endSmile);
}
}
//minenice: experiment to test preFunction
public static void PreDropFruit(float beat, int side, bool smile, bool isPineapple)
public static void PreDropFruit(float beat, int side, bool smile, bool isPineapple, float endSmile)
{
float spawnBeat = beat - 1f;
beat = beat - (isPineapple ? 2f : 1f);
@ -225,7 +228,7 @@ namespace HeavenStudio.Games
{
BeatAction.New(instance.gameObject, new List<BeatAction.Action>()
{
new BeatAction.Action(spawnBeat, delegate { if (instance != null) instance.DropFruit(beat, side, smile, isPineapple); }),
new BeatAction.Action(spawnBeat, delegate { if (instance != null) instance.DropFruit(beat, side, smile, isPineapple, endSmile); }),
});
}
else
@ -235,7 +238,8 @@ namespace HeavenStudio.Games
beat = beat,
side = side,
smile = smile,
isPineapple = isPineapple
isPineapple = isPineapple,
endSmile = endSmile
});
}
@ -249,7 +253,7 @@ namespace HeavenStudio.Games
}
}
public void DropFruitSingle(float beat, bool side, bool smile, GameObject objectToSpawn)
public void DropFruitSingle(float beat, bool side, bool smile, GameObject objectToSpawn, float endSmile)
{
var newFruit = GameObject.Instantiate(objectToSpawn, fruitHolder);
@ -257,6 +261,7 @@ namespace HeavenStudio.Games
fruitComp.startBeat = beat;
fruitComp.side = side;
fruitComp.smile = smile;
fruitComp.endSmile = endSmile;
newFruit.SetActive(true);
}
@ -280,7 +285,7 @@ namespace HeavenStudio.Games
}
}
public void catchSuccess(bool side, bool isPineapple, bool smile, float beat)
public void catchSuccess(bool side, bool isPineapple, bool smile, float beat, float endSmile)
{
string anim = isPineapple ? "catchPineapple" : "catchOrange";
@ -298,7 +303,7 @@ namespace HeavenStudio.Games
if (smile)
{
startSmile = beat + 1f;
stopSmile = beat + 2f;
stopSmile = beat + endSmile;
}
}

View File

@ -21,6 +21,8 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
public bool smile;
public float endSmile;
private string soundText;
private Minigame.Eligible e = new Minigame.Eligible();
@ -155,7 +157,7 @@ namespace HeavenStudio.Games.Scripts_CatchyTune
else
{
Jukebox.PlayOneShotGame(soundText + "Catch");
game.catchSuccess(side, isPineapple, smile, startBeat + beatLength);
game.catchSuccess(side, isPineapple, smile, startBeat + beatLength, endSmile);
Destroy(this.gameObject);
}
}

View File

@ -148,8 +148,6 @@ namespace HeavenStudio.Games
private int background;
private float steamTime;
private string fastTurn;
static float wantMarch = float.MaxValue;
static float wantMarchLength = 0f;
@ -401,6 +399,7 @@ namespace HeavenStudio.Games
public void SargeFaceTurn(float beat, int type, int type2, bool toggle)
{
string fastTurn = "";
switch (type2)
{
case (int) MarchingOrders.FaceTurnLength.Fast:
@ -420,7 +419,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat, turnLength + 2f, InputType.DIRECTION_LEFT_DOWN, LeftSuccess, GenericMiss, LeftEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/leftFaceTurn1" + fastTurn, beat),
new MultiSound.Sound("marchingOrders/leftFaceTurn2" + fastTurn, beat + 0.6f),
new MultiSound.Sound("marchingOrders/leftFaceTurn2" + fastTurn, beat + 0.5f),
new MultiSound.Sound("marchingOrders/leftFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/turnAction", beat + turnLength + 2f),
}, forcePlay: true);
@ -439,7 +438,7 @@ namespace HeavenStudio.Games
ScheduleInput(beat, turnLength + 2f, InputType.DIRECTION_RIGHT_DOWN, RightSuccess, GenericMiss, RightEmpty);
MultiSound.Play(new MultiSound.Sound[] {
new MultiSound.Sound("marchingOrders/rightFaceTurn1" + fastTurn, beat),
new MultiSound.Sound("marchingOrders/rightFaceTurn2" + fastTurn, beat + 0.6f),
new MultiSound.Sound("marchingOrders/rightFaceTurn2" + fastTurn, beat + 0.5f),
new MultiSound.Sound("marchingOrders/rightFaceTurn3", beat + turnLength + 1f),
new MultiSound.Sound("marchingOrders/turnAction", beat + turnLength + 2f),
}, forcePlay: true);