Update Chameleon.cs (#891)

Make countin depend on length
This commit is contained in:
blank3times 2024-04-23 07:57:22 -07:00 committed by GitHub
parent e96ce2f8b1
commit 0ce226fcbf

View file

@ -23,7 +23,7 @@ namespace HeavenStudio.Games.Loaders
preFunction = delegate { preFunction = delegate {
var e = eventCaller.currentEntity; var e = eventCaller.currentEntity;
Chameleon.PreSpawnFly(e.beat, e.length - 4, (int)Scripts_Chameleon.FlyType.Far); Chameleon.PreSpawnFly(e.beat, e.length - 4, (int)Scripts_Chameleon.FlyType.Far);
if (e["countIn"]) Chameleon.CountIn(e.beat); if (e["countIn"]) Chameleon.CountIn(e.beat, e.length - 4);
}, },
defaultLength = 8f, defaultLength = 8f,
resizable = true, resizable = true,
@ -37,7 +37,7 @@ namespace HeavenStudio.Games.Loaders
preFunction = delegate { preFunction = delegate {
var e = eventCaller.currentEntity; var e = eventCaller.currentEntity;
Chameleon.PreSpawnFly(e.beat, e.length - 4, (int)Scripts_Chameleon.FlyType.Close); Chameleon.PreSpawnFly(e.beat, e.length - 4, (int)Scripts_Chameleon.FlyType.Close);
if (e["countIn"]) Chameleon.CountIn(e.beat); if (e["countIn"]) Chameleon.CountIn(e.beat, e.length - 4);
}, },
defaultLength = 8f, defaultLength = 8f,
resizable = true, resizable = true,
@ -265,12 +265,13 @@ namespace HeavenStudio.Games
}); });
} }
public static void CountIn(double beat) public static void CountIn(double beat, double length)
{ {
if (length < 0) length = 4;
MultiSound.Play(new MultiSound.Sound[]{ MultiSound.Play(new MultiSound.Sound[]{
new MultiSound.Sound("count-ins/three2", beat + 4), new MultiSound.Sound("count-ins/three2", beat + length),
new MultiSound.Sound("count-ins/two2", beat + 5), new MultiSound.Sound("count-ins/two2", beat + length + 1),
new MultiSound.Sound("count-ins/one2", beat + 6), new MultiSound.Sound("count-ins/one2", beat + length + 2),
}, forcePlay: true, game: false); }, forcePlay: true, game: false);
} }