ssds nop samurai bop

This commit is contained in:
minenice55 2024-01-14 20:45:59 -05:00
parent f28300b30c
commit bb57d9b84f

View file

@ -19,12 +19,12 @@ namespace HeavenStudio.Games.Loaders
{ {
new GameAction("bop", "Bop") new GameAction("bop", "Bop")
{ {
function = delegate {var e = eventCaller.currentEntity; SamuraiSliceNtr.instance.Bop(e.beat, e.length, e["whoBops"], e["whoBopsAuto"]); }, function = delegate {var e = eventCaller.currentEntity; SamuraiSliceNtr.instance.Bop(e.beat, e.length, e["bop"], e["bopAuto"]); },
resizable = true, resizable = true,
parameters = new List<Param>() parameters = new List<Param>()
{ {
new Param("whoBops", SamuraiSliceNtr.WhoBops.Both, "Bop", "Toggle if the child should bop for the duration of this event."), new Param("bop", true, "Bop", "Toggle if the child should bop for the duration of this event."),
new Param("whoBopsAuto", SamuraiSliceNtr.WhoBops.None, "Bop (Auto)", "Toggle if the child should automatically bop until another Bop event is reached.") new Param("bopAuto", false, "Bop (Auto)", "Toggle if the child should automatically bop until another Bop event is reached.")
} }
}, },
new GameAction("melon", "Melon") new GameAction("melon", "Melon")
@ -167,17 +167,12 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
SetupBopRegion("samuraiSliceNtr", "bop", "whoBopsAuto", false); SetupBopRegion("samuraiSliceNtr", "bop", "bopAuto", false);
} }
public override void OnBeatPulse(double beat) public override void OnBeatPulse(double beat)
{ {
int whoBopsAuto = BeatIsInBopRegionInt(beat); if (BeatIsInBopRegion(beat)) childParent.GetComponent<NtrSamuraiChild>().Bop();
bool goBopSamurai = whoBopsAuto == (int)WhoBops.Samurai || whoBopsAuto == (int)WhoBops.Both;
bool goBopChild = whoBopsAuto == (int)WhoBops.Children || whoBopsAuto == (int)WhoBops.Both;
if (goBopSamurai) player.Bop();
if (goBopChild) childParent.GetComponent<NtrSamuraiChild>().Bop();
} }
void Update() void Update()
@ -190,7 +185,7 @@ namespace HeavenStudio.Games
DoSlice(); DoSlice();
} }
public void Bop(double beat, float length, int whoBops, int whoBopsAuto) public void Bop(double beat, float length, bool whoBops, bool whoBopsAuto)
{ {
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)
{ {
@ -201,22 +196,11 @@ namespace HeavenStudio.Games
} }
} }
void BopSingle(int whoBops) void BopSingle(bool whoBops)
{ {
switch (whoBops) if (whoBops)
{ {
case (int)WhoBops.Samurai: childParent.GetComponent<NtrSamuraiChild>().Bop();
player.Bop();
break;
case (int)WhoBops.Children:
childParent.GetComponent<NtrSamuraiChild>().Bop();
break;
case (int)WhoBops.Both:
player.Bop();
childParent.GetComponent<NtrSamuraiChild>().Bop();
break;
default:
break;
} }
} }