From ad4a5b607f8e273da856dff50ab03b1058513e22 Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Fri, 7 Jul 2023 12:21:18 -0400 Subject: [PATCH] meow --- Assets/Scripts/Games/ClapTrap/ClapTrap.cs | 29 ++++++----------------- Assets/Scripts/Games/ClapTrap/Sword.cs | 21 +++++++++------- 2 files changed, 20 insertions(+), 30 deletions(-) diff --git a/Assets/Scripts/Games/ClapTrap/ClapTrap.cs b/Assets/Scripts/Games/ClapTrap/ClapTrap.cs index 015d57600..84955f316 100644 --- a/Assets/Scripts/Games/ClapTrap/ClapTrap.cs +++ b/Assets/Scripts/Games/ClapTrap/ClapTrap.cs @@ -213,12 +213,11 @@ namespace HeavenStudio.Games public void Clap(float beat, float length, int type, bool spotlightToggle) { - MultiSound.Play(new MultiSound.Sound[] { - new MultiSound.Sound("clapTrap/donk", beat), - new MultiSound.Sound("clapTrap/donk", beat + length), - new MultiSound.Sound("clapTrap/donk", beat + length * 2), - new MultiSound.Sound("clapTrap/whiff", beat + length * 4, offset : (float)(Jukebox.GetClipLengthGame("clapTrap/whiff"))), + new MultiSound.Sound("clapTrap/donk", beat), + new MultiSound.Sound("clapTrap/donk", beat + length), + new MultiSound.Sound("clapTrap/donk", beat + length * 2), + new MultiSound.Sound("clapTrap/whiff", beat + length * 4.5), }, forcePlay: true); if (spotlightToggle) @@ -242,13 +241,8 @@ namespace HeavenStudio.Games swordClone.cueLength = length * 4; swordClone.cueStart = beat; swordClone.cueType = type; - - } - - - public void DollAnimations(float beat, int animate) { if (animate == 0) @@ -269,20 +263,15 @@ namespace HeavenStudio.Games { dollHead.DoScaledAnimationAsync("HeadTalk", 0.5f); } - } - public void ChangeBackgroundColor(Color color, float beats) { var seconds = Conductor.instance.secPerBeat * beats; - { - if (bgColorTween != null) - bgColorTween.Kill(true); - } + if (bgColorTween != null) + bgColorTween.Kill(true); - if (seconds == 0) { bg.color = color; @@ -292,9 +281,7 @@ namespace HeavenStudio.Games bgColorTween = bg.DOColor(color, seconds); } - backgroundColor = color; - - + backgroundColor = color; } public void FadeBackgroundColor(Color start, Color end, float beats) @@ -319,7 +306,5 @@ namespace HeavenStudio.Games spotlightMaterial.SetColor("_ColorBravo", glowSpotlightColor); spotlightMaterial.SetColor("_ColorDelta", bottomSpotlightColor); } - - } } \ No newline at end of file diff --git a/Assets/Scripts/Games/ClapTrap/Sword.cs b/Assets/Scripts/Games/ClapTrap/Sword.cs index 9ad66d80b..a81365f3a 100644 --- a/Assets/Scripts/Games/ClapTrap/Sword.cs +++ b/Assets/Scripts/Games/ClapTrap/Sword.cs @@ -8,16 +8,23 @@ namespace HeavenStudio.Games.Scripts_ClapTrap { public class Sword : MonoBehaviour { - - public double cueStart; - public double cueLength; + public float cueLength; public int cueType; + private Animator dollHead; + private Animator dollArms; + + private ClapTrap game; + // Start is called before the first frame update void Awake() { - ClapTrap.instance.ScheduleInput(cueStart, cueLength, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Hit, Miss, Out); + game = ClapTrap.instance; + dollHead = game.dollHead; + dollArms = game.dollArms; + + game.ScheduleInput((float)cueStart, cueLength, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Hit, Miss, Out); } // Update is called once per frame @@ -50,11 +57,9 @@ namespace HeavenStudio.Games.Scripts_ClapTrap } dollArms.DoScaledAnimationAsync("ArmsHit", 0.5f); - clapEffect.DoScaledAnimationAsync("ClapEffect", 0.5f); + game.clapEffect.DoScaledAnimationAsync("ClapEffect", 0.5f); - - swordClone.SetActive(true); - swordClone.GetComponent().DoScaledAnimationAsync("swordHandHit", 0.5f); + GetComponent().DoScaledAnimationAsync("swordHandHit", 0.5f); } private void Miss(PlayerActionEvent caller)