2022-07-28 23:12:21 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
using HeavenStudio.Util;
|
2023-10-29 19:44:47 +00:00
|
|
|
using HeavenStudio.InputSystem;
|
2022-07-28 23:12:21 +00:00
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_KarateMan
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
public class KarateManJoe : MonoBehaviour
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
|
|
|
public Animator anim;
|
|
|
|
public GameEvent bop = new GameEvent();
|
2022-08-03 22:55:13 +00:00
|
|
|
public SpriteRenderer[] Shadows;
|
2022-07-28 23:12:21 +00:00
|
|
|
|
2022-08-14 22:59:28 +00:00
|
|
|
public Color BombGlowTint;
|
2023-06-10 19:13:29 +00:00
|
|
|
double bombGlowStart = double.MinValue;
|
2022-08-14 22:59:28 +00:00
|
|
|
float bombGlowLength = 0f;
|
Karate Man Additions Part 1 (#559)
* starting out with adding so many things
* voiceless kicks and combos (that one was easy)
* queuing objects/specials
* starting on cutting out the voice
-i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice
* got rid of basically all of the static variables in favor of checking the last color blocks
-also means that the bg and object colors getting held over between remixes shouldn't happen anymore
* removed all of the super backwards compatibility
-im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues
* convert karateman to karateMan
* conversion stuff start
* voice cutting fully works and is consistent now
color conversion isn't working, but ill fix it eventually
background color isn't working rn either, and moving to the new system has caused a lot of errors
* it compiles now
this Background Appearance block got hands :bangbang:
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
* bunch of small stuff
i got this done while i was at a cabin
* bg still broken :(
* unconvert karateman from karateMan, bg finally works
well. bg ALMOST finally works
i'll be doing the fx stuff after, and ill combine it with the flow block
* bg nearly done
* i just might give up on bg compatibility
i tried for like an hour and a half to convert it but i couldn't.
minenice might be able to but idk.
* background + lightbulb stuffs
* FINALLY got old bg blocks updating + better bulb sfx
store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys.
bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley:
moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list
camera bug fixed (call update in awake and start)
recolorable barrels lol
* and with that, it's finished!
added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector
* fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
* oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
|
|
|
float bombGlowIntensity = 0f;
|
2022-08-14 22:59:28 +00:00
|
|
|
const float bombGlowRatio = 1f;
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
double lastPunchTime = double.MinValue;
|
|
|
|
double lastComboMissTime = double.MinValue;
|
2024-04-07 21:25:54 +00:00
|
|
|
//double lastUpperCutTime = double.MinValue; Unused value - Marc
|
2022-07-29 02:09:48 +00:00
|
|
|
public bool inCombo = false;
|
2022-07-29 19:06:22 +00:00
|
|
|
public bool lockedInCombo = false;
|
2022-08-08 00:24:07 +00:00
|
|
|
public bool comboWaiting = false;
|
2022-07-28 23:12:21 +00:00
|
|
|
int inComboId = -1;
|
2022-07-29 02:09:48 +00:00
|
|
|
int shouldComboId = -1;
|
2022-07-28 23:12:21 +00:00
|
|
|
public void SetComboId(int id) { inComboId = id; }
|
2022-07-29 02:09:48 +00:00
|
|
|
public void SetShouldComboId(int id) { shouldComboId = id; }
|
|
|
|
public int GetComboId() { return inComboId; }
|
|
|
|
public int GetShouldComboId() { return shouldComboId; }
|
2022-07-28 23:12:21 +00:00
|
|
|
|
2022-07-30 02:25:48 +00:00
|
|
|
public bool wantKick = false;
|
2023-10-29 19:44:47 +00:00
|
|
|
public bool inKick = false, inTouchCharge = false;
|
2023-06-10 19:13:29 +00:00
|
|
|
double lastChargeTime = double.MinValue;
|
|
|
|
double unPrepareTime = double.MinValue;
|
|
|
|
double noNuriJabTime = double.MinValue;
|
2024-01-25 20:11:43 +00:00
|
|
|
bool canEmote = false, justPunched = false;
|
2022-08-07 23:40:06 +00:00
|
|
|
public int wantFace = 0;
|
2022-07-30 02:25:48 +00:00
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
public bool inSpecial
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return inCombo || lockedInCombo || inKick || inNuriLock || inTouchCharge;
|
|
|
|
}
|
|
|
|
}
|
2023-06-10 19:13:29 +00:00
|
|
|
public bool inNuriLock { get { return (Conductor.instance.songPositionInBeatsAsDouble >= noNuriJabTime && Conductor.instance.songPositionInBeatsAsDouble < noNuriJabTime + 1f); } }
|
2022-07-30 02:25:48 +00:00
|
|
|
|
2023-11-23 16:19:39 +00:00
|
|
|
public void RequestBop()
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
|
|
|
if (cond.songPositionInBeatsAsDouble > bop.startBeat && cond.songPositionInBeatsAsDouble < bop.startBeat + bop.length && cond.songPositionInBeatsAsDouble >= unPrepareTime && !inCombo) Bop();
|
|
|
|
}
|
|
|
|
|
2022-07-28 23:12:21 +00:00
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
2022-08-07 23:40:06 +00:00
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
if (cond.songPositionInBeatsAsDouble < bombGlowStart)
|
2022-08-14 22:59:28 +00:00
|
|
|
{
|
|
|
|
bombGlowIntensity = 1f;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
float glowProg = cond.GetPositionFromBeat(bombGlowStart, bombGlowLength);
|
|
|
|
bombGlowIntensity = 1f - glowProg;
|
2023-06-10 19:13:29 +00:00
|
|
|
if (cond.songPositionInBeatsAsDouble >= bombGlowStart + bombGlowLength)
|
2022-08-14 22:59:28 +00:00
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
bombGlowStart = double.MinValue;
|
2022-08-14 22:59:28 +00:00
|
|
|
bombGlowLength = 0f;
|
|
|
|
}
|
|
|
|
}
|
Karate Man Additions Part 1 (#559)
* starting out with adding so many things
* voiceless kicks and combos (that one was easy)
* queuing objects/specials
* starting on cutting out the voice
-i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice
* got rid of basically all of the static variables in favor of checking the last color blocks
-also means that the bg and object colors getting held over between remixes shouldn't happen anymore
* removed all of the super backwards compatibility
-im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues
* convert karateman to karateMan
* conversion stuff start
* voice cutting fully works and is consistent now
color conversion isn't working, but ill fix it eventually
background color isn't working rn either, and moving to the new system has caused a lot of errors
* it compiles now
this Background Appearance block got hands :bangbang:
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
* bunch of small stuff
i got this done while i was at a cabin
* bg still broken :(
* unconvert karateman from karateMan, bg finally works
well. bg ALMOST finally works
i'll be doing the fx stuff after, and ill combine it with the flow block
* bg nearly done
* i just might give up on bg compatibility
i tried for like an hour and a half to convert it but i couldn't.
minenice might be able to but idk.
* background + lightbulb stuffs
* FINALLY got old bg blocks updating + better bulb sfx
store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys.
bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley:
moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list
camera bug fixed (call update in awake and start)
recolorable barrels lol
* and with that, it's finished!
added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector
* fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
* oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
|
|
|
UpdateJoeColour();
|
2022-08-13 01:06:41 +00:00
|
|
|
|
|
|
|
if (canEmote && wantFace >= 0)
|
|
|
|
{
|
|
|
|
SetFaceExpressionForced(wantFace);
|
2023-10-29 19:44:47 +00:00
|
|
|
if (wantFace == (int)KarateMan.KarateManFaces.Surprise) wantFace = -1;
|
2022-08-13 01:06:41 +00:00
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
if (cond.songPositionInBeatsAsDouble >= noNuriJabTime && cond.songPositionInBeatsAsDouble < noNuriJabTime + 1f)
|
2022-08-13 01:06:41 +00:00
|
|
|
{
|
|
|
|
anim.DoScaledAnimation("JabNoNuri", noNuriJabTime, 1f);
|
|
|
|
bop.startBeat = noNuriJabTime + 1f;
|
|
|
|
}
|
2023-06-10 19:13:29 +00:00
|
|
|
else if (cond.songPositionInBeatsAsDouble >= noNuriJabTime + 1f && noNuriJabTime != double.MinValue)
|
2022-08-13 01:06:41 +00:00
|
|
|
{
|
|
|
|
bop.startBeat = noNuriJabTime + 1f;
|
2023-06-10 19:13:29 +00:00
|
|
|
noNuriJabTime = double.MinValue;
|
2022-08-13 01:06:41 +00:00
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
if (unPrepareTime != double.MinValue && cond.songPositionInBeatsAsDouble >= unPrepareTime)
|
2022-08-07 23:40:06 +00:00
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
unPrepareTime = double.MinValue;
|
2022-08-07 23:40:06 +00:00
|
|
|
anim.speed = 1f;
|
|
|
|
anim.Play("Beat", -1, 0);
|
|
|
|
}
|
|
|
|
|
2022-07-29 02:09:48 +00:00
|
|
|
if (inCombo && shouldComboId == -2)
|
|
|
|
{
|
2022-07-29 16:18:17 +00:00
|
|
|
float missProg = cond.GetPositionFromBeat(lastComboMissTime, 3f);
|
2022-07-29 02:09:48 +00:00
|
|
|
if (missProg >= 0f && missProg < 1f)
|
|
|
|
{
|
2022-07-29 16:18:17 +00:00
|
|
|
anim.DoScaledAnimation("LowKickMiss", lastComboMissTime, 3f);
|
2022-07-30 02:25:48 +00:00
|
|
|
bop.startBeat = lastComboMissTime + 3f;
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
else if (missProg >= 1f)
|
|
|
|
{
|
|
|
|
anim.speed = 1f;
|
2022-07-29 16:18:17 +00:00
|
|
|
bop.startBeat = lastComboMissTime + 3f;
|
2023-06-10 19:13:29 +00:00
|
|
|
lastComboMissTime = double.MinValue;
|
2022-07-29 02:09:48 +00:00
|
|
|
inCombo = false;
|
|
|
|
inComboId = -1;
|
|
|
|
shouldComboId = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-30 02:25:48 +00:00
|
|
|
if (inKick)
|
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
float chargeProg = cond.GetPositionFromBeat(lastChargeTime, 1.75f);
|
2022-07-30 02:25:48 +00:00
|
|
|
if (chargeProg >= 0f && chargeProg < 1f)
|
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
anim.DoScaledAnimation("ManCharge", lastChargeTime, 1.75f);
|
2022-08-06 02:37:06 +00:00
|
|
|
bop.startBeat = lastChargeTime + 1.75f;
|
2022-07-30 02:25:48 +00:00
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
else if (cond.songPositionAsDouble >= lastChargeTime + 2.75f)
|
2022-07-30 02:25:48 +00:00
|
|
|
{
|
|
|
|
anim.speed = 1f;
|
2023-10-29 19:44:47 +00:00
|
|
|
bop.startBeat = lastChargeTime + 2.75f;
|
2023-06-10 19:13:29 +00:00
|
|
|
lastChargeTime = double.MinValue;
|
2022-07-30 02:25:48 +00:00
|
|
|
inKick = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-25 20:11:43 +00:00
|
|
|
if (PlayerInput.GetIsAction(KarateMan.InputAction_Press) && !(inSpecial || justPunched))
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
if (!KarateMan.instance.IsExpectingInputNow(KarateMan.InputAction_Press))
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
2023-12-12 16:54:04 +00:00
|
|
|
Punch(_lastPunchedHeavy ? 2 : 1, PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch, _lastPunchedHeavy);
|
2023-06-10 19:13:29 +00:00
|
|
|
SoundByte.PlayOneShotGame("karateman/swingNoHit", forcePlay: true);
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
if (PlayerInput.GetIsAction(KarateMan.InputAction_TouchUp) && lastChargeTime != double.MinValue && !(inTouchCharge || inKick))
|
|
|
|
{
|
|
|
|
lastChargeTime = double.MinValue;
|
|
|
|
}
|
|
|
|
if (lastChargeTime != double.MinValue && cond.songPositionInBeatsAsDouble > lastChargeTime + 0.25 && PlayerInput.GetIsAction(KarateMan.InputAction_Pressing) && !(inKick || inTouchCharge))
|
2022-07-29 02:09:48 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch)
|
|
|
|
{
|
|
|
|
inTouchCharge = true;
|
|
|
|
anim.DoScaledAnimationAsync("ManChargeOut", 0.5f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-05-10 01:06:13 +00:00
|
|
|
if (PlayerInput.GetIsAction(KarateMan.InputAction_AltDown) && (KarateMan.IsComboEnable != KarateMan.ComboMode.Disabled) && !inSpecial)
|
2023-10-29 19:44:47 +00:00
|
|
|
{
|
|
|
|
if (!KarateMan.instance.IsExpectingInputNow(KarateMan.InputAction_AltDown))
|
2022-07-29 02:09:48 +00:00
|
|
|
{
|
|
|
|
//start a forced-fail combo sequence
|
2023-06-10 19:13:29 +00:00
|
|
|
ForceFailCombo(cond.songPositionInBeatsAsDouble);
|
2023-01-25 03:54:19 +00:00
|
|
|
KarateMan.instance.ScoreMiss(2);
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
else if (PlayerInput.GetIsAction(KarateMan.InputAction_AltUp) || PlayerInput.GetIsAction(KarateMan.InputAction_TouchUp))
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
if (PlayerInput.GetIsAction(KarateMan.InputAction_TouchUp) && inComboId != -1 && !lockedInCombo)
|
|
|
|
{
|
|
|
|
inComboId = -1;
|
|
|
|
}
|
|
|
|
if (!KarateMan.instance.IsExpectingInputNow(KarateMan.InputAction_AltUp))
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (inComboId != -1 && !lockedInCombo)
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
|
|
|
inComboId = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-07-30 02:25:48 +00:00
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
if ((!GameManager.instance.autoplay)
|
|
|
|
&& (PlayerInput.GetIsAction(KarateMan.InputAction_Flick) || PlayerInput.GetIsAction(KarateMan.InputAction_BasicRelease))
|
|
|
|
&& !PlayerInput.GetIsAction(KarateMan.InputAction_Pressing))
|
2022-07-30 02:25:48 +00:00
|
|
|
{
|
2022-07-31 01:16:48 +00:00
|
|
|
if (wantKick)
|
|
|
|
{
|
|
|
|
//stopped holding, don't charge
|
|
|
|
wantKick = false;
|
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
else if (inKick || inTouchCharge)
|
2022-07-31 01:16:48 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
if (PlayerInput.GetIsAction(KarateMan.InputAction_Flick) && !KarateMan.instance.IsExpectingInputNow(KarateMan.InputAction_Flick))
|
|
|
|
{
|
|
|
|
Kick(cond.songPositionInBeatsAsDouble);
|
|
|
|
SoundByte.PlayOneShotGame("karateman/swingKick", forcePlay: true);
|
|
|
|
}
|
|
|
|
else if (PlayerInput.GetIsAction(KarateMan.InputAction_TouchUp))
|
|
|
|
{
|
|
|
|
Kick(cond.songPositionInBeatsAsDouble, true);
|
|
|
|
}
|
2022-07-31 01:16:48 +00:00
|
|
|
}
|
2022-07-30 02:25:48 +00:00
|
|
|
}
|
2024-01-25 20:11:43 +00:00
|
|
|
}
|
2022-08-06 23:15:44 +00:00
|
|
|
|
2024-01-25 20:11:43 +00:00
|
|
|
void LateUpdate()
|
|
|
|
{
|
|
|
|
justPunched = false;
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
|
|
|
|
2023-03-07 17:22:32 +00:00
|
|
|
public void Bop()
|
|
|
|
{
|
|
|
|
anim.speed = 1f;
|
|
|
|
anim.Play("Beat", -1, 0);
|
2023-06-10 19:13:29 +00:00
|
|
|
lastChargeTime = double.MinValue;
|
2023-03-07 17:22:32 +00:00
|
|
|
}
|
|
|
|
|
2023-12-12 16:54:04 +00:00
|
|
|
private bool _lastPunchedHeavy = false;
|
|
|
|
|
2024-05-10 01:57:49 +00:00
|
|
|
public bool Punch(int forceHand = 0, bool touchCharge = false, bool punchedHeavy = false, double wantBeat = double.MaxValue)
|
2022-07-28 23:12:21 +00:00
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return false;
|
2022-07-28 23:12:21 +00:00
|
|
|
var cond = Conductor.instance;
|
2022-07-29 02:09:48 +00:00
|
|
|
bool straight = false;
|
2022-07-31 01:16:48 +00:00
|
|
|
|
|
|
|
anim.speed = 1f;
|
2023-06-10 19:13:29 +00:00
|
|
|
unPrepareTime = double.MinValue;
|
|
|
|
lastChargeTime = double.MinValue;
|
2022-07-31 01:16:48 +00:00
|
|
|
inKick = false;
|
2023-12-12 16:54:04 +00:00
|
|
|
_lastPunchedHeavy = punchedHeavy;
|
2022-07-31 01:16:48 +00:00
|
|
|
|
2022-07-28 23:12:21 +00:00
|
|
|
switch (forceHand)
|
|
|
|
{
|
|
|
|
case 1:
|
2022-07-30 02:25:48 +00:00
|
|
|
anim.DoScaledAnimationAsync("Jab", 0.5f);
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2022-07-30 02:25:48 +00:00
|
|
|
anim.DoScaledAnimationAsync("Straight", 0.5f);
|
2022-07-29 02:09:48 +00:00
|
|
|
straight = true;
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
2022-08-13 01:06:41 +00:00
|
|
|
case 3:
|
2023-06-10 19:13:29 +00:00
|
|
|
lastPunchTime = double.MinValue;
|
2022-08-13 01:06:41 +00:00
|
|
|
anim.DoNormalizedAnimation("JabNoNuri");
|
2023-06-10 19:13:29 +00:00
|
|
|
noNuriJabTime = cond.songPositionInBeatsAsDouble;
|
2022-08-13 01:06:41 +00:00
|
|
|
break;
|
2024-01-25 20:11:43 +00:00
|
|
|
default:
|
2024-05-10 01:57:49 +00:00
|
|
|
if (wantBeat <= cond.GetBeatFromSongPos(lastPunchTime + Minigame.NgLateTime() - 1) + 0.25)
|
2024-01-25 20:11:43 +00:00
|
|
|
{
|
|
|
|
lastPunchTime = double.MinValue;
|
|
|
|
anim.DoScaledAnimationAsync("Straight", 0.5f);
|
|
|
|
straight = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2024-05-10 01:57:49 +00:00
|
|
|
lastPunchTime = cond.GetSongPosFromBeat(wantBeat, true);
|
2024-01-25 20:11:43 +00:00
|
|
|
anim.DoScaledAnimationAsync("Jab", 0.5f);
|
|
|
|
}
|
|
|
|
break;
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
2023-10-29 19:44:47 +00:00
|
|
|
if (touchCharge)
|
|
|
|
{
|
|
|
|
lastChargeTime = cond.songPositionInBeatsAsDouble;
|
|
|
|
bop.startBeat = double.MaxValue;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bop.startBeat = cond.songPositionInBeatsAsDouble + 0.5f;
|
|
|
|
}
|
2024-01-25 20:11:43 +00:00
|
|
|
justPunched = true;
|
2022-07-29 02:09:48 +00:00
|
|
|
return straight; //returns what hand was used to punch the object
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboSequence(int seq)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
2022-07-29 02:09:48 +00:00
|
|
|
var cond = Conductor.instance;
|
2023-06-10 19:13:29 +00:00
|
|
|
bop.startBeat = cond.songPositionInBeatsAsDouble + 1f;
|
|
|
|
unPrepareTime = double.MinValue;
|
2022-07-29 02:09:48 +00:00
|
|
|
switch (seq)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
anim.Play("LowJab", -1, 0);
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
anim.Play("LowKick", -1, 0);
|
|
|
|
break;
|
|
|
|
case 2:
|
2022-07-29 16:18:17 +00:00
|
|
|
anim.DoScaledAnimationAsync("BackHand", 0.5f);
|
2022-08-08 00:24:07 +00:00
|
|
|
comboWaiting = true;
|
2022-07-29 16:18:17 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2024-05-10 01:06:13 +00:00
|
|
|
anim.DoScaledAnimationAsync(KarateMan.IsComboEnable == KarateMan.ComboMode.Jump ? "UpperCutJump" : "UpperCut", 0.5f);
|
2022-07-29 19:06:22 +00:00
|
|
|
lockedInCombo = false;
|
2022-08-08 00:24:07 +00:00
|
|
|
comboWaiting = false;
|
2022-07-29 16:18:17 +00:00
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
anim.Play("ToReady", -1, 0);
|
2023-06-10 19:13:29 +00:00
|
|
|
bop.startBeat = cond.songPositionInBeatsAsDouble + 0.5f;
|
2022-07-29 19:06:22 +00:00
|
|
|
lockedInCombo = false;
|
2022-08-08 00:24:07 +00:00
|
|
|
comboWaiting = false;
|
2022-07-29 02:09:48 +00:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void ComboMiss(double beat)
|
2022-07-29 02:09:48 +00:00
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
|
|
|
lastComboMissTime = beat;
|
2022-07-29 16:18:17 +00:00
|
|
|
bop.startBeat = beat + 3f;
|
2023-06-10 19:13:29 +00:00
|
|
|
unPrepareTime = double.MinValue;
|
2022-08-07 23:40:06 +00:00
|
|
|
anim.DoNormalizedAnimation("LowKickMiss");
|
2022-07-29 16:18:17 +00:00
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void ForceFailCombo(double beat)
|
2022-07-29 16:18:17 +00:00
|
|
|
{
|
|
|
|
if (inCombo) return;
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(this, new List<BeatAction.Action>()
|
2022-07-29 16:18:17 +00:00
|
|
|
{
|
|
|
|
new BeatAction.Action(beat, delegate { Punch(1); inCombo = true; inComboId = -1; shouldComboId = -1;}),
|
|
|
|
new BeatAction.Action(beat + 0.25f, delegate { Punch(2); }),
|
|
|
|
new BeatAction.Action(beat + 0.5f, delegate { ComboSequence(0); }),
|
|
|
|
new BeatAction.Action(beat + 0.75f, delegate { shouldComboId = -2; ComboMiss(beat + 0.75f); }),
|
|
|
|
});
|
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
2022-07-29 16:18:17 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
new MultiSound.Sound("karateman/swingNoHit", beat),
|
|
|
|
new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.25f),
|
|
|
|
new MultiSound.Sound("karateman/swingNoHit_Alt", beat + 0.5f),
|
|
|
|
new MultiSound.Sound("karateman/comboMiss", beat + 0.75f),
|
2022-07-29 16:18:17 +00:00
|
|
|
}, forcePlay: true);
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
2022-07-30 02:25:48 +00:00
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void StartKickCharge(double beat)
|
2022-07-30 02:25:48 +00:00
|
|
|
{
|
|
|
|
wantKick = true;
|
2023-06-10 19:13:29 +00:00
|
|
|
unPrepareTime = double.MinValue;
|
2023-09-11 22:28:04 +00:00
|
|
|
BeatAction.New(this, new List<BeatAction.Action>()
|
2022-07-30 02:25:48 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
new BeatAction.Action(beat, delegate {
|
2022-07-30 02:25:48 +00:00
|
|
|
if (wantKick)
|
|
|
|
{
|
|
|
|
wantKick = false;
|
|
|
|
inKick = true;
|
|
|
|
lastChargeTime = beat;
|
2022-08-06 02:37:06 +00:00
|
|
|
bop.startBeat = beat + 1.75f;
|
2022-07-30 02:25:48 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
public void Kick(double beat, bool oldReturn = false)
|
2022-07-30 02:25:48 +00:00
|
|
|
{
|
2023-10-29 19:44:47 +00:00
|
|
|
if (!(inKick || inTouchCharge)) return;
|
2022-07-31 01:16:48 +00:00
|
|
|
//play the kick animation and reset stance
|
|
|
|
anim.speed = 1f;
|
2022-08-07 23:40:06 +00:00
|
|
|
bop.startBeat = beat + 1f;
|
2023-06-10 19:13:29 +00:00
|
|
|
unPrepareTime = double.MinValue;
|
|
|
|
lastChargeTime = double.MinValue;
|
2022-07-30 02:25:48 +00:00
|
|
|
inKick = false;
|
2023-10-29 19:44:47 +00:00
|
|
|
inTouchCharge = false;
|
2022-07-31 01:16:48 +00:00
|
|
|
|
2023-10-29 19:44:47 +00:00
|
|
|
if (oldReturn)
|
|
|
|
{
|
|
|
|
anim.DoScaledAnimationAsync("ManReturn", 0.5f);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
anim.DoScaledAnimationAsync("ManKick", 0.5f);
|
|
|
|
}
|
2022-07-30 02:25:48 +00:00
|
|
|
}
|
2022-08-03 22:55:13 +00:00
|
|
|
|
2022-08-06 02:37:06 +00:00
|
|
|
public void MarkCanEmote()
|
|
|
|
{
|
|
|
|
canEmote = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void MarkNoEmote()
|
|
|
|
{
|
|
|
|
canEmote = false;
|
|
|
|
}
|
|
|
|
|
Karate Man Additions Part 1 (#559)
* starting out with adding so many things
* voiceless kicks and combos (that one was easy)
* queuing objects/specials
* starting on cutting out the voice
-i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice
* got rid of basically all of the static variables in favor of checking the last color blocks
-also means that the bg and object colors getting held over between remixes shouldn't happen anymore
* removed all of the super backwards compatibility
-im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues
* convert karateman to karateMan
* conversion stuff start
* voice cutting fully works and is consistent now
color conversion isn't working, but ill fix it eventually
background color isn't working rn either, and moving to the new system has caused a lot of errors
* it compiles now
this Background Appearance block got hands :bangbang:
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
* bunch of small stuff
i got this done while i was at a cabin
* bg still broken :(
* unconvert karateman from karateMan, bg finally works
well. bg ALMOST finally works
i'll be doing the fx stuff after, and ill combine it with the flow block
* bg nearly done
* i just might give up on bg compatibility
i tried for like an hour and a half to convert it but i couldn't.
minenice might be able to but idk.
* background + lightbulb stuffs
* FINALLY got old bg blocks updating + better bulb sfx
store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys.
bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley:
moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list
camera bug fixed (call update in awake and start)
recolorable barrels lol
* and with that, it's finished!
added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector
* fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
* oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
|
|
|
public void UpdateJoeColour()
|
2022-08-03 22:55:13 +00:00
|
|
|
{
|
2024-01-21 04:59:26 +00:00
|
|
|
Material mappingMat = KarateMan.instance.MappingMaterial;
|
|
|
|
if (mappingMat == null) return;
|
Karate Man Additions Part 1 (#559)
* starting out with adding so many things
* voiceless kicks and combos (that one was easy)
* queuing objects/specials
* starting on cutting out the voice
-i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice
* got rid of basically all of the static variables in favor of checking the last color blocks
-also means that the bg and object colors getting held over between remixes shouldn't happen anymore
* removed all of the super backwards compatibility
-im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues
* convert karateman to karateMan
* conversion stuff start
* voice cutting fully works and is consistent now
color conversion isn't working, but ill fix it eventually
background color isn't working rn either, and moving to the new system has caused a lot of errors
* it compiles now
this Background Appearance block got hands :bangbang:
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
* bunch of small stuff
i got this done while i was at a cabin
* bg still broken :(
* unconvert karateman from karateMan, bg finally works
well. bg ALMOST finally works
i'll be doing the fx stuff after, and ill combine it with the flow block
* bg nearly done
* i just might give up on bg compatibility
i tried for like an hour and a half to convert it but i couldn't.
minenice might be able to but idk.
* background + lightbulb stuffs
* FINALLY got old bg blocks updating + better bulb sfx
store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys.
bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley:
moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list
camera bug fixed (call update in awake and start)
recolorable barrels lol
* and with that, it's finished!
added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector
* fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
* oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
|
|
|
Color mainCol = KarateMan.instance.BodyColor;
|
|
|
|
Color highlightCol = KarateMan.instance.HighlightColor;
|
2022-08-14 22:59:28 +00:00
|
|
|
|
|
|
|
if (bombGlowIntensity > 0)
|
|
|
|
{
|
|
|
|
highlightCol = Color.LerpUnclamped(highlightCol, mainCol, bombGlowIntensity);
|
2022-08-15 00:47:13 +00:00
|
|
|
mainCol = Color.LerpUnclamped(mainCol, BombGlowTint, bombGlowIntensity * bombGlowRatio);
|
2022-08-14 22:59:28 +00:00
|
|
|
}
|
|
|
|
|
2024-01-21 04:59:26 +00:00
|
|
|
mappingMat.SetColor("_ColorAlpha", mainCol);
|
|
|
|
mappingMat.SetColor("_ColorBravo", new Color(1, 0, 0, 1));
|
|
|
|
mappingMat.SetColor("_ColorDelta", highlightCol);
|
2022-08-03 22:55:13 +00:00
|
|
|
}
|
2022-08-06 02:37:06 +00:00
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void Prepare(double beat, float length)
|
2022-08-07 23:40:06 +00:00
|
|
|
{
|
|
|
|
anim.speed = 0f;
|
|
|
|
anim.Play("Beat", -1, 0);
|
|
|
|
unPrepareTime = beat + length;
|
|
|
|
}
|
|
|
|
|
2022-08-06 02:37:06 +00:00
|
|
|
public void SetFaceExpressionForced(int face)
|
|
|
|
{
|
2024-05-10 01:06:13 +00:00
|
|
|
anim.DoScaledAnimationAsync("Head.Face" + face.ToString("D2"));
|
2022-08-06 02:37:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void SetFaceExpression(int face, bool ignoreCheck = false)
|
|
|
|
{
|
2022-08-07 23:40:06 +00:00
|
|
|
wantFace = face;
|
2022-08-06 02:37:06 +00:00
|
|
|
if (canEmote || ignoreCheck)
|
2024-05-10 01:06:13 +00:00
|
|
|
anim.DoScaledAnimationAsync("Head.Face" + face.ToString("D2"));
|
2022-08-06 02:37:06 +00:00
|
|
|
}
|
2022-08-14 22:59:28 +00:00
|
|
|
|
|
|
|
public void ApplyBombGlow()
|
|
|
|
{
|
2023-06-10 19:13:29 +00:00
|
|
|
bombGlowStart = double.MaxValue;
|
2022-08-14 22:59:28 +00:00
|
|
|
bombGlowLength = 0f;
|
|
|
|
bombGlowIntensity = 1f;
|
|
|
|
}
|
|
|
|
|
2023-06-10 19:13:29 +00:00
|
|
|
public void RemoveBombGlow(double beat, float length = 0.5f)
|
2022-08-14 22:59:28 +00:00
|
|
|
{
|
Karate Man Additions Part 1 (#559)
* starting out with adding so many things
* voiceless kicks and combos (that one was easy)
* queuing objects/specials
* starting on cutting out the voice
-i was using MultiSound.Delete() but i found it very inconsistent and janky so im switching to a check of the next block and if it should cut out the voice
* got rid of basically all of the static variables in favor of checking the last color blocks
-also means that the bg and object colors getting held over between remixes shouldn't happen anymore
* removed all of the super backwards compatibility
-im almost certain these blocks are only available in .tengoku files though, so nobody should have any issues
* convert karateman to karateMan
* conversion stuff start
* voice cutting fully works and is consistent now
color conversion isn't working, but ill fix it eventually
background color isn't working rn either, and moving to the new system has caused a lot of errors
* it compiles now
this Background Appearance block got hands :bangbang:
working on converting everything to the new bg color system
this will be so annoying to build a RiqUpdater for.
* bunch of small stuff
i got this done while i was at a cabin
* bg still broken :(
* unconvert karateman from karateMan, bg finally works
well. bg ALMOST finally works
i'll be doing the fx stuff after, and ill combine it with the flow block
* bg nearly done
* i just might give up on bg compatibility
i tried for like an hour and a half to convert it but i couldn't.
minenice might be able to but idk.
* background + lightbulb stuffs
* FINALLY got old bg blocks updating + better bulb sfx
store the keys of the objects in the dictionary that i want to remove, create the properties, then remove all of the objects using the keys.
bulbs use a method that lets any sfx go through for the throw and hit, which means custom lightbulb cues :smiley:
moved all queuing into one list, then a foreach checks the datamodel of each riqentity in the list
camera bug fixed (call update in awake and start)
recolorable barrels lol
* and with that, it's finished!
added backwards compatibility for bg fx and fixed the particles (oops i forgot to assign them in the inspector
* fixed a bug
the warning would not go away if you dragged the playback bar behind a warning cuz it wasn't checking for the beginning of a warning block
* oops forgot to remove a debug log
2023-10-07 18:14:06 +00:00
|
|
|
if (double.IsNaN(bombGlowIntensity)) return;
|
2022-08-14 22:59:28 +00:00
|
|
|
bombGlowStart = beat;
|
|
|
|
bombGlowLength = length;
|
|
|
|
bombGlowIntensity = 0f;
|
|
|
|
}
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
|
|
|
}
|