mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 08:07:38 +02:00
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:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user