km blocks fix + a few additions to other games

This commit is contained in:
AstrlJelly 2024-01-06 13:16:26 -05:00
parent e4d69e16a6
commit 9359af042a
3 changed files with 22 additions and 18 deletions

View file

@ -42,11 +42,12 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("sign", "Sign Enter")
{
function = delegate { var e = eventCaller.currentEntity; ClappyTrio.instance.Sign(e.beat, e.length, e["ease"], e["down"]); },
function = delegate { var e = eventCaller.currentEntity; ClappyTrio.instance.Sign(e.beat, e.length, e["ease"], e["down"], e["sfx"]); },
parameters = new List<Param>()
{
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Which ease should the sign move with?"),
new Param("down", true, "Down", "Should the sign go down?")
new Param("down", true, "Down", "Should the sign go down?"),
new Param("sfx", true, "Play SFX", "Should the sign play a sound effect"),
},
resizable = true
},
@ -156,9 +157,9 @@ namespace HeavenStudio.Games
}
}
public void Sign(double beat, float length, int ease, bool down)
public void Sign(double beat, float length, int ease, bool down, bool playSfx)
{
SoundByte.PlayOneShotGame("clappyTrio/sign");
if (playSfx) SoundByte.PlayOneShotGame("clappyTrio/sign");
signStartBeat = beat;
signLength = length;
lastEase = (Util.EasingFunction.Ease)ease;

View file

@ -202,7 +202,7 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
new Param("type", KarateMan.KarateManFaces.Happy, "Success Expression", "The facial expression to set Joe to on hit"),
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue?", new List<Param.CollapseParam>()
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue", new List<Param.CollapseParam>()
{
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }),
}),
@ -222,11 +222,11 @@ namespace HeavenStudio.Games.Loaders
parameters = new List<Param>()
{
new Param("whichWarning", KarateMan.HitThree.HitThree, "Which Warning", "The warning text to show and the sfx to play"),
new Param("pitchVoice", false, "Auto Pitch Voice", "Pitch the voice of this cue depending on the BPM", new List<Param.CollapseParam>()
new Param("pitchVoice", false, "Pitch Voice", "Pitch the voice of this cue", new List<Param.CollapseParam>()
{
new Param.CollapseParam((x, _) => (bool)x, new string[] { "forcePitch" }),
}),
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Pitch the voice of this cue depending on the value"),
new Param("forcePitch", new EntityTypes.Float(0.5f, 2f, 1f), "Force Pitch", "Override the automatic pitching if not set to 1"),
new Param("customLength", false, "Custom Length", "Have the warning text appear for the length of the block"),
new Param("cutOut", true, "Cut Out Voice", "Will this cue be cut out by another voice?"),
},
@ -238,8 +238,8 @@ namespace HeavenStudio.Games.Loaders
new GameAction("special camera", "Special Camera")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.DoSpecialCamera(e.beat, e.length, e["toggle"]); },
defaultLength = 8f,
resizable = true,
defaultLength = 8f,
resizable = true,
parameters = new List<Param>()
{
new Param("toggle", true, "Return Camera", "Camera zooms back in?"),
@ -248,7 +248,7 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("prepare", "Preparation Stance")
{
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);},
function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.Prepare(e.beat, e.length);},
resizable = true,
},
new GameAction("set gameplay modifiers", "Flow/Gameplay Modifiers")
@ -260,7 +260,7 @@ namespace HeavenStudio.Games.Loaders
new Param("fxType", KarateMan.BackgroundFXType.None, "FX Type", "The background effect to be displayed"),
new Param("type", KarateMan.NoriMode.None, "Flow Bar type", "The type of Flow bar to use", new List<Param.CollapseParam>()
{
new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "type" })
new Param.CollapseParam((x, _) => (int)x != (int)KarateMan.NoriMode.None, new string[] { "hitsPerHeart" })
}),
new Param("hitsPerHeart", new EntityTypes.Float(0f, 20f, 0f), "Hits Per Heart", "How many hits will it take for each heart to light up? (0 will do it automatically.)"),
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),

View file

@ -274,7 +274,7 @@ namespace HeavenStudio.Games
public override void OnPlay(double beat)
{
crHandlerInstance = null;
PersistColor(beat);
PersistBlocks(beat);
}
private void OnDestroy()
@ -562,15 +562,18 @@ namespace HeavenStudio.Games
}
//call this in OnPlay(double beat) and OnGameSwitch(double beat)
private void PersistColor(double beat)
private void PersistBlocks(double beat)
{
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("rhythmTweezers", new string[] { "fade background color" }).FindAll(x => x.beat < beat);
if (allEventsBeforeBeat.Count > 0)
var allEventsBeforeBeat = GameManager.instance.Beatmap.Entities.FindAll(x => x.datamodel.Split('/')[0] == "rhythmTweezers" && x.beat < beat);
var allColorEventsBeforeBeat = allEventsBeforeBeat.FindAll(x => x.datamodel == "rhythmTweezers/fade background color");
if (allColorEventsBeforeBeat.Count > 0)
{
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case
var lastEvent = allEventsBeforeBeat[^1];
allColorEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case
var lastEvent = allColorEventsBeforeBeat[^1];
BackgroundColor(lastEvent.beat, lastEvent.length, lastEvent["colorA"], lastEvent["colorB"], lastEvent["ease"]);
}
var allAltFaceEventsBeforeBeat = allEventsBeforeBeat.FindAll(x => x.datamodel == "rhythmTweezers/altSmile");
VegetableAnimator.SetBool("UseAltSmile", allAltFaceEventsBeforeBeat.Count % 2 == 1);
}
public static void PreNoPeeking(double beat, float length, int type)
@ -635,7 +638,7 @@ namespace HeavenStudio.Games
queuedIntervals.Clear();
}
}
PersistColor(beat);
PersistBlocks(beat);
}
private void ResetVegetable()