From 7cc7ffd69151067ae5a9bb50f889428f908239c1 Mon Sep 17 00:00:00 2001 From: Carson Kompon Date: Wed, 2 Mar 2022 23:23:20 -0500 Subject: [PATCH] Karate Joe hits Cooking Pot with right hand + code cleanup Also Taco Bell now plays the rock hit sound on top of the bell sound :) --- Assets/Resources/Games/karateman.prefab | 4 +++- Assets/Scripts/Games/KarateMan/KarateJoe.cs | 4 +--- Assets/Scripts/Games/KarateMan/KarateMan.cs | 21 +++++++++++++-------- Assets/Scripts/Games/KarateMan/Pot.cs | 7 +++++-- Assets/Scripts/Minigames.cs | 2 +- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/Assets/Resources/Games/karateman.prefab b/Assets/Resources/Games/karateman.prefab index 90509c680..1cf6ba51b 100644 --- a/Assets/Resources/Games/karateman.prefab +++ b/Assets/Resources/Games/karateman.prefab @@ -17797,9 +17797,9 @@ MonoBehaviour: - {fileID: -3530312539838775474, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 8671423413994339737, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -6341196331951941137, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - - {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 6243727673011286339, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: -8767211005568948338, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + - {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} BarrelSprites: - {fileID: 6524922379630696755, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 1156572009758090512, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} @@ -17809,6 +17809,8 @@ MonoBehaviour: CookingPotSprites: - {fileID: 6243727673011286339, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} - {fileID: 561377664857987667, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} + OtherSprites: + - {fileID: -6283416824598814145, guid: 868cd67f05ca7c646bae00fcc2ba7eaa, type: 3} BGSprites: - Sprites: - {fileID: 21300000, guid: 72431c7c58f54e848bcb7527635bb72b, type: 3} diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index 319b7b012..6db0c0945 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -12,8 +12,6 @@ namespace RhythmHeavenMania.Games.KarateMan [Header("Components")] public Animator anim; public GameObject HitEffect; - public ParticleSystem HitParticle; - public ParticleSystem RockParticle; public GameObject BulbHit; [SerializeField] private SpriteRenderer head; [SerializeField] private Sprite[] heads; @@ -268,7 +266,7 @@ namespace RhythmHeavenMania.Games.KarateMan } else { - if (p.type == 2 || p.type == 3 || p.type == 4 || p.type == 6) + if (p.type == 2 || p.type == 3 || p.type == 4 || p.type == 6 || p.type == 999) { punchLeft = false; } diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 7c6989587..2a754438e 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -14,9 +14,10 @@ namespace RhythmHeavenMania.Games.KarateMan Pot = 0, Rock = 2, Ball = 3, - CookingPot = 7, - Alien = 8, - TacoBell = 6, + CookingPot = 6, + Alien = 7, + + TacoBell = 999 } public enum LightBulbType @@ -68,6 +69,7 @@ namespace RhythmHeavenMania.Games.KarateMan public Sprite[] ObjectSprites; public Sprite[] BarrelSprites; public Sprite[] CookingPotSprites; + public Sprite[] OtherSprites; public List BGSprites; public SpriteRenderer BGSprite; @@ -155,7 +157,9 @@ namespace RhythmHeavenMania.Games.KarateMan p.createBeat = beat; p.isThrown = true; p.type = type; - p.Sprite.GetComponent().sprite = ObjectSprites[type]; + + if(type <= ObjectSprites.Length) + p.Sprite.GetComponent().sprite = ObjectSprites[type]; if (combo) { @@ -219,21 +223,22 @@ namespace RhythmHeavenMania.Games.KarateMan outSnd = "karateman/objectOut"; else outSnd = "karateman/offbeatObjectOut"; - p.hitSnd = "karateman/tacobell"; + p.hitSnd = "karateman/cookingPot"; break; case 7: if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f) outSnd = "karateman/objectOut"; else outSnd = "karateman/offbeatObjectOut"; - p.hitSnd = "karateman/cookingPot"; + p.hitSnd = "karateman/alienHit"; break; - case 8: + case 999: + p.Sprite.GetComponent().sprite = OtherSprites[0]; if (Starpelly.Mathp.GetDecimalFromFloat(beat) == 0f) outSnd = "karateman/objectOut"; else outSnd = "karateman/offbeatObjectOut"; - p.hitSnd = "karateman/alienHit"; + p.hitSnd = "karateman/tacobell"; break; } diff --git a/Assets/Scripts/Games/KarateMan/Pot.cs b/Assets/Scripts/Games/KarateMan/Pot.cs index deb5bfb4c..ef624c847 100644 --- a/Assets/Scripts/Games/KarateMan/Pot.cs +++ b/Assets/Scripts/Games/KarateMan/Pot.cs @@ -71,7 +71,7 @@ namespace RhythmHeavenMania.Games.KarateMan else hitLength = 14f; - if (type == 7) + if (type == 6) CookingPotLid.SetActive(true); /*if (combo) @@ -284,11 +284,14 @@ namespace RhythmHeavenMania.Games.KarateMan case 4: BarrelDestroy(false); break; - case 7: + case 6: // TODO: Rock destroy particle effect CookingPotLid.SetActive(false); CookingPotDestroy(); break; + case 999: + Jukebox.PlayOneShotGame("karateman/rockHit"); + break; } if (!kick) diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index 311452246..019705cd6 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -263,7 +263,7 @@ namespace RhythmHeavenMania new GameAction("pot", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 0); }, 2, hidden: true), new GameAction("rock", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 2); }, 2, hidden: true), new GameAction("ball", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 3); }, 2, hidden: true), - new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 6); }, 2, hidden: true), + new GameAction("tacobell", delegate { KarateMan.instance.Shoot(eventCaller.currentEntity.beat, 999); }, 2, hidden: true), new GameAction("hit4", delegate { KarateMan.instance.Hit4(eventCaller.currentEntity.beat); }, hidden: true), new GameAction("bgfxon", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.Sunburst); }, hidden: true), new GameAction("bgfxoff", delegate { KarateMan.instance.SetBackgroundFX(KarateMan.BackgroundFXType.None); }, hidden: true),