2022-07-27 22:35:18 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
using HeavenStudio.Util;
|
|
|
|
|
|
|
|
namespace HeavenStudio.Games.Scripts_KarateMan
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
public class KarateManPot : PlayerActionObject
|
2022-07-27 22:35:18 +00:00
|
|
|
{
|
|
|
|
public float startBeat;
|
|
|
|
public ItemType type;
|
|
|
|
public int path = 1;
|
2022-07-28 23:12:21 +00:00
|
|
|
|
|
|
|
public GameObject Shadow;
|
|
|
|
public GameObject ShadowInstance;
|
|
|
|
|
|
|
|
public string awakeAnim;
|
|
|
|
FlyStatus status = FlyStatus.Fly;
|
2022-07-29 16:18:17 +00:00
|
|
|
Color effectTint = Color.white;
|
2022-07-28 23:12:21 +00:00
|
|
|
|
|
|
|
public int comboId = -1;
|
|
|
|
static int _lastCombo = -1;
|
|
|
|
public static int LastCombo { get { return _lastCombo; } }
|
|
|
|
public static int GetNewCombo() { _lastCombo++; return _lastCombo; }
|
|
|
|
public static void ResetLastCombo() { _lastCombo = -1; }
|
2022-07-27 22:35:18 +00:00
|
|
|
|
|
|
|
public enum ItemType {
|
|
|
|
Pot, // path 1
|
|
|
|
Bulb, // path 1
|
|
|
|
Rock, // path 1
|
|
|
|
Ball, // path 1
|
|
|
|
Cooking, // path 1
|
|
|
|
Alien, // path 1
|
|
|
|
TacoBell, // path 1
|
|
|
|
|
|
|
|
KickBarrel, // path 1
|
|
|
|
KickBomb, // no path
|
|
|
|
|
|
|
|
ComboPot1, // path 1
|
|
|
|
ComboPot2, // path 1
|
|
|
|
ComboPot3, // path 2
|
|
|
|
ComboPot4, // path 3
|
|
|
|
ComboPot5, // path 4
|
|
|
|
ComboBarrel // path 5
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum FlyStatus {
|
|
|
|
Fly,
|
|
|
|
Hit,
|
|
|
|
NG,
|
|
|
|
HitWeak
|
|
|
|
}
|
|
|
|
|
|
|
|
//pot trajectory stuff
|
|
|
|
public Transform[] HitPosition;
|
|
|
|
public float[] HitPositionOffset;
|
2022-07-28 23:12:21 +00:00
|
|
|
public Vector3[] StartPositionOffset;
|
|
|
|
public float[] ItemSlipRt;
|
2022-07-27 22:35:18 +00:00
|
|
|
|
2022-07-29 16:18:17 +00:00
|
|
|
public SpriteRenderer BulbLight;
|
|
|
|
|
|
|
|
public void SetBulbColor(Color c) {
|
|
|
|
effectTint = c;
|
|
|
|
BulbLight.color = c;
|
|
|
|
}
|
|
|
|
|
2022-07-27 22:35:18 +00:00
|
|
|
float ProgressToHitPosition(float progress) {
|
2022-07-28 23:12:21 +00:00
|
|
|
return progress + (HitPositionOffset[path] - 0.5f);
|
2022-07-27 22:35:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Vector3 ProgressToFlyPosition()
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
2022-07-28 23:12:21 +00:00
|
|
|
float progress = Mathf.Min(cond.GetPositionFromBeat(startBeat, 2f), 1f - ItemSlipRt[path]);
|
2022-07-27 22:35:18 +00:00
|
|
|
float progressToHitPosition = ProgressToHitPosition(progress);
|
|
|
|
|
2022-07-28 23:12:21 +00:00
|
|
|
Vector3 hitPosition = HitPosition[path].position;
|
2022-07-27 22:35:18 +00:00
|
|
|
|
|
|
|
//https://www.desmos.com/calculator/ycn9v62i4f
|
|
|
|
float offset = HitPositionOffset[path];
|
|
|
|
float flyHeight = (progressToHitPosition*(progressToHitPosition-1f))/(offset*(offset-1f));
|
|
|
|
float floorHeight = HitPosition[0].position.y;
|
|
|
|
|
2022-07-28 23:12:21 +00:00
|
|
|
Vector3 startPosition = hitPosition + StartPositionOffset[path];
|
|
|
|
Vector3 endPosition = hitPosition - StartPositionOffset[path];
|
2022-07-27 22:35:18 +00:00
|
|
|
Vector3 flyPosition = new Vector3(
|
|
|
|
Mathf.Lerp(startPosition.x, endPosition.x, progress),
|
2022-07-29 16:52:59 +00:00
|
|
|
floorHeight + (HitPosition[path].position.y - floorHeight + (StartPositionOffset[path].y * (1 - Mathf.Min(cond.GetPositionFromBeat(startBeat, 1f), 1f)))) * flyHeight,
|
2022-07-27 22:35:18 +00:00
|
|
|
Mathf.Lerp(startPosition.z, endPosition.z, progress)
|
|
|
|
);
|
|
|
|
|
|
|
|
if (progress >= 0.5f && flyPosition.y < HitPosition[0].position.y) {
|
|
|
|
flyPosition.y = floorHeight;
|
|
|
|
}
|
|
|
|
return flyPosition;
|
|
|
|
}
|
2022-07-28 23:12:21 +00:00
|
|
|
|
|
|
|
void Awake()
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case ItemType.ComboPot1:
|
2022-07-29 19:06:22 +00:00
|
|
|
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboStartJustOrNg, ComboStartThrough, ComboStartOut);
|
|
|
|
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboStartWrongAction, ComboStartOut, ComboStartOut);
|
2022-07-28 23:12:21 +00:00
|
|
|
path = 1;
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot2:
|
|
|
|
path = 1;
|
2022-07-29 02:09:48 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
|
|
|
case ItemType.ComboPot3:
|
|
|
|
path = 2;
|
2022-07-29 02:09:48 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
|
|
|
case ItemType.ComboPot4:
|
|
|
|
path = 3;
|
|
|
|
//if the button isn't held anymore make Joe spin
|
2022-07-29 02:09:48 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
|
|
|
case ItemType.ComboPot5:
|
|
|
|
path = 4;
|
2022-07-29 02:09:48 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>() { new BeatAction.Action(startBeat + 1f, delegate { JoeComboSequence(); }) });
|
2022-07-28 23:12:21 +00:00
|
|
|
break;
|
|
|
|
case ItemType.ComboBarrel:
|
2022-07-29 16:18:17 +00:00
|
|
|
//check for button release
|
2022-07-29 19:06:22 +00:00
|
|
|
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_ALT_UP, ComboEndJustOrNg, ComboEndThrough, ComboEndOut);
|
2022-07-29 16:18:17 +00:00
|
|
|
//button presses
|
2022-07-29 19:06:22 +00:00
|
|
|
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ComboEndWrongAction, ItemOut, ItemOut);
|
|
|
|
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ComboEndWrongActionAlt, ItemOut, ItemOut);
|
2022-07-28 23:12:21 +00:00
|
|
|
path = 5;
|
|
|
|
break;
|
|
|
|
default:
|
2022-07-29 19:06:22 +00:00
|
|
|
KarateMan.instance.ScheduleInput(startBeat, 1f, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, ItemJustOrNg, ItemThrough, ItemOut);
|
|
|
|
KarateMan.instance.ScheduleUserInput(startBeat, 1f, InputType.STANDARD_ALT_DOWN, ItemWrongAction, ItemOut, ItemOut);
|
2022-07-28 23:12:21 +00:00
|
|
|
path = 1;
|
|
|
|
comboId = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
float floorHeight = HitPosition[0].position.y;
|
|
|
|
transform.position = ProgressToFlyPosition();
|
|
|
|
|
|
|
|
Animator mobjAnim = GetComponent<Animator>();
|
|
|
|
mobjAnim.Play(awakeAnim, -1, 0);
|
|
|
|
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-360f * Time.deltaTime) + UnityEngine.Random.Range(0f, 360f));
|
|
|
|
|
2022-07-29 19:06:22 +00:00
|
|
|
ShadowInstance = GameObject.Instantiate(Shadow, KarateMan.instance.ItemHolder);
|
2022-07-28 23:12:21 +00:00
|
|
|
ShadowInstance.SetActive(true);
|
|
|
|
ShadowInstance.transform.position = new Vector3(transform.position.x, floorHeight - 0.5f, transform.position.z);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Update()
|
|
|
|
{
|
|
|
|
var cond = Conductor.instance;
|
|
|
|
float floorHeight = HitPosition[0].position.y;
|
|
|
|
ShadowInstance.transform.position = new Vector3(transform.position.x, floorHeight - 0.5f, transform.position.z);
|
|
|
|
switch (status)
|
|
|
|
{
|
|
|
|
case FlyStatus.Fly:
|
|
|
|
float prog = cond.GetPositionFromBeat(startBeat, 2f);
|
|
|
|
transform.position = ProgressToFlyPosition();
|
|
|
|
if (prog >= 2f) {
|
|
|
|
GameObject.Destroy(ShadowInstance.gameObject);
|
|
|
|
GameObject.Destroy(gameObject);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (prog < 1f - ItemSlipRt[path]) {
|
|
|
|
transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (90f * Time.deltaTime * (1/cond.pitchedSecPerBeat)));
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case FlyStatus.Hit:
|
|
|
|
//TEMPORARY
|
|
|
|
GameObject.Destroy(ShadowInstance.gameObject);
|
|
|
|
GameObject.Destroy(gameObject);
|
|
|
|
return;
|
|
|
|
case FlyStatus.NG:
|
|
|
|
//TEMPORARY
|
|
|
|
GameObject.Destroy(ShadowInstance.gameObject);
|
|
|
|
GameObject.Destroy(gameObject);
|
|
|
|
return;
|
|
|
|
case FlyStatus.HitWeak:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-29 16:18:17 +00:00
|
|
|
//handles hitsound and particles
|
|
|
|
void ItemHitEffect()
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case ItemType.Bulb:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/lightbulbHit", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.Rock:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.Ball:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/soccerHit", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.Cooking:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/cookingPot", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.Alien:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/alienHit", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.TacoBell:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/rockHit", forcePlay: true);
|
|
|
|
Jukebox.PlayOneShotGame("karateman/tacobell", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot1:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot2:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit1", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot3:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit2", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot4:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot5:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit3", forcePlay: true);
|
|
|
|
break;
|
|
|
|
case ItemType.ComboBarrel:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboHit4", forcePlay: true);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Jukebox.PlayOneShotGame("karateman/potHit", forcePlay: true);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
status = FlyStatus.Hit;
|
|
|
|
}
|
|
|
|
|
|
|
|
int ItemPunchHand()
|
|
|
|
{
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case ItemType.Rock:
|
|
|
|
return 2;
|
|
|
|
case ItemType.Ball:
|
|
|
|
return 2;
|
|
|
|
case ItemType.Cooking:
|
|
|
|
return 2;
|
|
|
|
case ItemType.Alien:
|
|
|
|
return 2;
|
|
|
|
case ItemType.TacoBell:
|
|
|
|
return 2;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-29 02:09:48 +00:00
|
|
|
void JoeComboSequence()
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 02:09:48 +00:00
|
|
|
if (joe.GetShouldComboId() != comboId || !joe.inCombo) return;
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case ItemType.ComboPot2:
|
|
|
|
joe.Punch(2);
|
|
|
|
if (joe.GetComboId() != comboId)
|
|
|
|
Jukebox.PlayOneShotGame("karateman/swingNoHit_Alt", forcePlay: true);
|
|
|
|
else
|
|
|
|
{
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot3:
|
|
|
|
joe.ComboSequence(0);
|
|
|
|
if (joe.GetComboId() != comboId) {}
|
|
|
|
else
|
|
|
|
{
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot4:
|
|
|
|
//if the button isn't held anymore make Joe spin
|
|
|
|
if (joe.GetComboId() != comboId) {
|
|
|
|
joe.ComboMiss(startBeat + 1f);
|
|
|
|
Jukebox.PlayOneShotGame("karateman/comboMiss", forcePlay: true);
|
|
|
|
joe.SetShouldComboId(-2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
joe.ComboSequence(1);
|
2022-07-29 19:06:22 +00:00
|
|
|
joe.lockedInCombo = true;
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case ItemType.ComboPot5:
|
|
|
|
joe.ComboSequence(2);
|
|
|
|
if (joe.GetComboId() != comboId) {}
|
|
|
|
else
|
|
|
|
{
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-07-28 23:12:21 +00:00
|
|
|
public void ItemJustOrNg(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (status == FlyStatus.Fly && !joe.inCombo) {
|
|
|
|
joe.Punch(ItemPunchHand());
|
2022-07-28 23:12:21 +00:00
|
|
|
if (state <= -1f || state >= 1f) {
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
status = FlyStatus.NG;
|
|
|
|
}
|
|
|
|
else {
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-28 23:12:21 +00:00
|
|
|
status = FlyStatus.Hit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ItemWrongAction(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
2022-07-28 23:12:21 +00:00
|
|
|
//hitting a normal object with the alt input
|
2022-07-29 16:18:17 +00:00
|
|
|
//WHEN SCORING THIS IS A MISS
|
2022-07-29 19:06:22 +00:00
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (status == FlyStatus.Fly && !joe.inCombo) {
|
|
|
|
joe.ForceFailCombo(Conductor.instance.songPositionInBeats);
|
|
|
|
if (state <= -1f || state >= 1f) {
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
status = FlyStatus.NG;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ItemHitEffect();
|
|
|
|
}
|
|
|
|
}
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ItemOut(PlayerActionEvent caller) {}
|
|
|
|
|
|
|
|
public void ItemThrough(PlayerActionEvent caller)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (status != FlyStatus.Fly || gameObject == null) return;
|
2022-07-28 23:12:21 +00:00
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(startBeat + 2f, delegate {
|
|
|
|
//TODO: play miss sound
|
|
|
|
//deduct flow if applicable
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboStartJustOrNg(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 02:09:48 +00:00
|
|
|
if (status == FlyStatus.Fly && !joe.inCombo) {
|
|
|
|
joe.inCombo = true;
|
|
|
|
joe.Punch(1);
|
|
|
|
joe.SetComboId(comboId);
|
|
|
|
joe.SetShouldComboId(comboId);
|
2022-07-28 23:12:21 +00:00
|
|
|
if (state <= -1f || state >= 1f) {
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
status = FlyStatus.NG;
|
|
|
|
}
|
|
|
|
else {
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboStartOut(PlayerActionEvent caller) {}
|
2022-07-29 16:18:17 +00:00
|
|
|
public void ComboStartThrough(PlayerActionEvent caller)
|
|
|
|
{
|
|
|
|
if (status != FlyStatus.Fly || gameObject == null) return;
|
|
|
|
}
|
2022-07-28 23:12:21 +00:00
|
|
|
|
|
|
|
public void ComboStartWrongAction(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
2022-07-29 16:18:17 +00:00
|
|
|
//hitting a combo start with the normal input
|
|
|
|
//WHEN SCORING THIS IS A MISS
|
2022-07-29 19:06:22 +00:00
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (status == FlyStatus.Fly && !joe.inCombo) {
|
|
|
|
joe.Punch(ItemPunchHand());
|
|
|
|
if (state <= -1f || state >= 1f) {
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
status = FlyStatus.NG;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
ItemHitEffect();
|
|
|
|
}
|
|
|
|
}
|
2022-07-28 23:12:21 +00:00
|
|
|
}
|
2022-07-29 02:09:48 +00:00
|
|
|
|
|
|
|
public void ComboEndJustOrNg(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 02:09:48 +00:00
|
|
|
if (status == FlyStatus.Fly && joe.inCombo && joe.GetComboId() == comboId) {
|
|
|
|
joe.inCombo = false;
|
|
|
|
joe.SetComboId(-1);
|
|
|
|
joe.SetShouldComboId(-1);
|
2022-07-29 16:18:17 +00:00
|
|
|
joe.ComboSequence(3);
|
2022-07-29 02:09:48 +00:00
|
|
|
if (state <= -1f || state >= 1f) {
|
|
|
|
Jukebox.PlayOneShot("miss");
|
|
|
|
status = FlyStatus.NG;
|
|
|
|
}
|
|
|
|
else {
|
2022-07-29 16:18:17 +00:00
|
|
|
ItemHitEffect();
|
2022-07-29 02:09:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboEndOut(PlayerActionEvent caller) {}
|
2022-07-29 16:18:17 +00:00
|
|
|
public void ComboEndThrough(PlayerActionEvent caller)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (status != FlyStatus.Fly || gameObject == null) return;
|
2022-07-29 19:06:22 +00:00
|
|
|
var joe = KarateMan.instance.Joe;
|
2022-07-29 16:18:17 +00:00
|
|
|
if (joe.GetComboId() != comboId || !joe.inCombo) return;
|
|
|
|
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
|
|
|
{
|
|
|
|
new BeatAction.Action(startBeat + 1.5f, delegate {
|
|
|
|
joe.inCombo = false;
|
|
|
|
joe.SetComboId(-1);
|
|
|
|
joe.SetShouldComboId(-1);
|
|
|
|
joe.ComboSequence(4);
|
|
|
|
})
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboEndWrongAction(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
KarateMan.instance.Joe.Punch(1);
|
2022-07-29 16:18:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ComboEndWrongActionAlt(PlayerActionEvent caller, float state)
|
|
|
|
{
|
2022-07-29 19:06:22 +00:00
|
|
|
if (GameManager.instance.currentGame != "karateman") return;
|
|
|
|
KarateMan.instance.Joe.ForceFailCombo(Conductor.instance.songPositionInBeats);
|
2022-07-29 16:18:17 +00:00
|
|
|
}
|
2022-07-27 22:35:18 +00:00
|
|
|
}
|
|
|
|
}
|