From b624b54b93dfdfed63130bd681f72e870d7baec4 Mon Sep 17 00:00:00 2001
From: Amy54Desu <69287652+Amy54Desu@users.noreply.github.com>
Date: Fri, 23 Dec 2022 12:12:33 -0500
Subject: [PATCH] Karateka
Adjusted how pot breaking worked to now use the beats, instead of item curve. Attempt to implement pot break delay slider
---
Assets/Scripts/Games/KarateMan/KarateMan.cs | 9 ++-
.../Scripts/Games/KarateMan/KarateManPot.cs | 63 ++++++++++---------
2 files changed, 39 insertions(+), 33 deletions(-)
diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs
index e16089d1b..660c38fae 100644
--- a/Assets/Scripts/Games/KarateMan/KarateMan.cs
+++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs
@@ -120,7 +120,7 @@ namespace HeavenStudio.Games.Loaders
},
new GameAction("set gameplay modifiers", "Gameplay Modifiers")
{
- function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["type"], e["type2"], e["toggle"], e["toggle2"], e["toggle3"], e["type3"]); },
+ function = delegate { var e = eventCaller.currentEntity; KarateMan.instance.SetGameplayMods(e.beat, e["type"], e["type2"], e["toggle"], e["toggle2"], e["toggle3"], e["type3"], e["valA"]); },
defaultLength = 0.5f,
parameters = new List()
{
@@ -129,7 +129,8 @@ namespace HeavenStudio.Games.Loaders
new Param("toggle", true, "Enable Combos", "Allow the player to combo? (Contextual combos will still be allowed even when off)"),
new Param("toggle2", false, "Pot Break Sound", "Should there be a breaking sound when punching an object with high flow?"),
new Param("toggle3", false, "High Flow Punch", "Determines if Joe punches with the right hand when having high flow"),
- new Param("type3", KarateMan.SoundEffectTypes.Megamix3DS, "Sound Effect Ver", "The version of sounds that will play")
+ new Param("type3", KarateMan.SoundEffectTypes.Megamix3DS, "Sound Effect Ver", "The version of sounds that will play"),
+ new Param("valA", new EntityTypes.Float(0, 5), "Pot Break Delay", "Sets the pot break delay, used in Tengoku Arcade")
}
},
new GameAction("set background effects", "Background Appearance")
@@ -564,6 +565,7 @@ namespace HeavenStudio.Games
public static float WantBgChangeStart = Single.MinValue;
public static float WantBgChangeLength = 0f;
public static float BopLength = 1f;
+ public static float PotBreakDelay = 0f;
private void Awake()
{
@@ -1253,7 +1255,7 @@ namespace HeavenStudio.Games
UpdateFilterColour(bgColour, filterColour);
}
- public void SetGameplayMods(float beat, int mode, int bg, bool combo, bool noriBreak, bool highFlow, int soundVer)
+ public void SetGameplayMods(float beat, int mode, int bg, bool combo, bool noriBreak, bool highFlow, int soundVer, float breakDelay)
{
NoriGO.SetActive(true);
Nori.SetNoriMode(beat, mode);
@@ -1261,6 +1263,7 @@ namespace HeavenStudio.Games
NoriBreakSound = noriBreak;
HighFlowPunch = highFlow;
SoundEffectsVersion = soundVer;
+ PotBreakDelay = breakDelay;
IsComboEnable = combo;
}
diff --git a/Assets/Scripts/Games/KarateMan/KarateManPot.cs b/Assets/Scripts/Games/KarateMan/KarateManPot.cs
index d9a767bb0..7c1147355 100644
--- a/Assets/Scripts/Games/KarateMan/KarateManPot.cs
+++ b/Assets/Scripts/Games/KarateMan/KarateManPot.cs
@@ -333,35 +333,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan
Jukebox.PlayOneShotGame("karateman/bombBreak", volume: 0.25f);
return;
}
- else if ((KarateMan.instance.IsNoriActive && KarateMan.instance.NoriPerformance >= 0.6f || KarateMan.HonkiMode) && KarateMan.NoriBreakSound && ItemBreakable() && cond.songPositionInBeats >= startBeat + curveTargetBeat && CurrentCurve.GetApproximateLength() > 16)
- {
- ParticleSystem p = Instantiate(HitParticles[2], CurrentCurve.GetPoint(1f), Quaternion.identity, KarateMan.instance.ItemHolder);
- p.Play();
-
- GameObject.Destroy(ShadowInstance.gameObject);
- GameObject.Destroy(gameObject);
-
- if (cond.songPositionInBeats >= startBeat)
- {
- switch (type)
- {
- case ItemType.Pot:
- Jukebox.PlayOneShotGame("karateman/potBreak", volume: 0.60f);
- break;
- case ItemType.Bulb:
- Jukebox.PlayOneShotGame("karateman/lightbulbBreak", volume: 0.65f);
- break;
- case ItemType.Rock:
- case ItemType.TacoBell:
- Jukebox.PlayOneShotGame("karateman/rockBreak", volume: 0.75f);
- break;
- case ItemType.Ball:
- Jukebox.PlayOneShotGame("karateman/soccerBreak", volume: 0.75f);
- break;
- }
- }
- return;
- }
else if (cond.songPositionInBeats >= startBeat + Mathf.Max(2f, curveTargetBeat) || CurrentCurve == null)
{
@@ -471,6 +442,32 @@ namespace HeavenStudio.Games.Scripts_KarateMan
hitMark.SetActive(true);
}
+ void DestoryPot()
+ {
+ ParticleSystem p = Instantiate(HitParticles[2], CurrentCurve.GetPoint(1f), Quaternion.identity, KarateMan.instance.ItemHolder);
+ p.Play();
+
+ GameObject.Destroy(ShadowInstance.gameObject);
+ GameObject.Destroy(gameObject);
+
+ switch (type)
+ {
+ case ItemType.Pot:
+ Jukebox.PlayOneShotGame("karateman/potBreak", volume: 0.60f);
+ break;
+ case ItemType.Bulb:
+ Jukebox.PlayOneShotGame("karateman/lightbulbBreak", volume: 0.65f);
+ break;
+ case ItemType.Rock:
+ case ItemType.TacoBell:
+ Jukebox.PlayOneShotGame("karateman/rockBreak", volume: 0.75f);
+ break;
+ case ItemType.Ball:
+ Jukebox.PlayOneShotGame("karateman/soccerBreak", volume: 0.75f);
+ break;
+ }
+ }
+
//handles hitsound and particles
void ItemHitEffect(bool straight = false)
{
@@ -662,10 +659,16 @@ namespace HeavenStudio.Games.Scripts_KarateMan
break;
}
-
if (KarateMan.instance.IsNoriActive && KarateMan.instance.NoriPerformance >= 0.6f)
ItemHitNori = Conductor.instance.songPositionInBeats + curveTargetBeat + 1f;
startBeat = Conductor.instance.songPositionInBeats;
+ if ((KarateMan.instance.IsNoriActive && KarateMan.instance.NoriPerformance >= 0.6f || KarateMan.HonkiMode) && KarateMan.NoriBreakSound && ItemBreakable())
+ {
+ BeatAction.New(gameObject, new List()
+ {
+ new BeatAction.Action(startBeat + 1f + KarateMan.PotBreakDelay, delegate { DestoryPot(); })
+ });
+ }
status = FlyStatus.Hit;
}