last of the easy games' touch
This commit is contained in:
parent
4d2ae2f636
commit
e4aa90def4
|
|
@ -146,8 +146,8 @@ namespace HeavenStudio.Games
|
||||||
if (!want)
|
if (!want)
|
||||||
{
|
{
|
||||||
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt)
|
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt)
|
||||||
&& instance.IsExpectingInputNow(InputAction_Left.inputLockCategory)
|
&& instance.IsExpectingInputNow(InputAction_Left)
|
||||||
&& instance.IsExpectingInputNow(InputAction_Right.inputLockCategory);
|
&& instance.IsExpectingInputNow(InputAction_Right);
|
||||||
}
|
}
|
||||||
return want || simul;
|
return want || simul;
|
||||||
}
|
}
|
||||||
|
|
@ -167,8 +167,8 @@ namespace HeavenStudio.Games
|
||||||
if (!want)
|
if (!want)
|
||||||
{
|
{
|
||||||
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt)
|
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt)
|
||||||
&& instance.IsExpectingInputNow(InputAction_Left.inputLockCategory)
|
&& instance.IsExpectingInputNow(InputAction_Left)
|
||||||
&& instance.IsExpectingInputNow(InputAction_Right.inputLockCategory);
|
&& instance.IsExpectingInputNow(InputAction_Right);
|
||||||
}
|
}
|
||||||
return want || simul;
|
return want || simul;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ namespace HeavenStudio.Games
|
||||||
sfxNumR = sfxNumR,
|
sfxNumR = sfxNumR,
|
||||||
});
|
});
|
||||||
|
|
||||||
prepare = prepare && PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch;
|
prepare = prepare && PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch && PlayerInput.PlayerHasControl();
|
||||||
if (prepare) DogNinja.instance.DogAnim.SetBool("needPrepare", true);
|
if (prepare) DogNinja.instance.DogAnim.SetBool("needPrepare", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -348,7 +348,7 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
public void Prepare(double beat)
|
public void Prepare(double beat)
|
||||||
{
|
{
|
||||||
if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch) return;
|
if (PlayerInput.CurrentControlStyle == InputController.ControlStyles.Touch && PlayerInput.PlayerHasControl()) return;
|
||||||
if (!DogAnim.GetBool("needPrepare")) DogAnim.DoScaledAnimationAsync("Prepare", 0.5f);
|
if (!DogAnim.GetBool("needPrepare")) DogAnim.DoScaledAnimationAsync("Prepare", 0.5f);
|
||||||
DogAnim.SetBool("needPrepare", true);
|
DogAnim.SetBool("needPrepare", true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_Kitties
|
||||||
private bool hasClapped = false;
|
private bool hasClapped = false;
|
||||||
public bool canClap = false;
|
public bool canClap = false;
|
||||||
|
|
||||||
private bool hasSpun = true;
|
private bool hasSpun = false;
|
||||||
private bool checkSpin = false;
|
private bool checkSpin = false;
|
||||||
|
|
||||||
private bool hasFish = false;
|
private bool hasFish = false;
|
||||||
|
|
@ -34,17 +34,21 @@ namespace HeavenStudio.Games.Scripts_Kitties
|
||||||
{
|
{
|
||||||
var cond = Conductor.instance;
|
var cond = Conductor.instance;
|
||||||
|
|
||||||
if (PlayerInput.Pressed() && canClap && !Kitties.instance.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
if (PlayerInput.GetIsAction(Kitties.InputAction_BasicPress) && canClap && !Kitties.instance.IsExpectingInputNow(Kitties.InputAction_BasicPress))
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShot("miss");
|
if (PlayerInput.CurrentControlStyle == InputSystem.InputController.ControlStyles.Touch && !Kitties.instance.IsExpectingInputNow(Kitties.InputAction_AltStart))
|
||||||
if (spawnType != 3)
|
{
|
||||||
anim.Play("ClapFail", 0, 0);
|
SoundByte.PlayOneShot("miss");
|
||||||
else
|
if (spawnType != 3)
|
||||||
anim.Play("FaceClapFail", 0, 0);
|
anim.Play("ClapFail", 0, 0);
|
||||||
|
else
|
||||||
|
anim.Play("FaceClapFail", 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PlayerInput.AltPressed() && canClap && !Kitties.instance.IsExpectingInputNow(InputType.STANDARD_ALT_DOWN)
|
if ((PlayerInput.GetIsAction(Kitties.InputAction_AltStart) && canClap && !(Kitties.instance.IsExpectingInputNow(Kitties.InputAction_AltStart) || Kitties.instance.IsExpectingInputNow(Kitties.InputAction_BasicPress)))
|
||||||
|| PlayerInput.AltPressedUp() && canClap && !Kitties.instance.IsExpectingInputNow(InputType.STANDARD_ALT_UP) && hasSpun)
|
|| (PlayerInput.GetIsAction(Kitties.InputAction_AltFinish) && canClap && !Kitties.instance.IsExpectingInputNow(Kitties.InputAction_AltFinish) && hasSpun)
|
||||||
|
|| ((PlayerInput.GetIsAction(Kitties.InputAction_TouchRelease) && !PlayerInput.GetIsAction(Kitties.InputAction_AltFinish)) && canClap && hasSpun))
|
||||||
{
|
{
|
||||||
RollFail();
|
RollFail();
|
||||||
}
|
}
|
||||||
|
|
@ -53,25 +57,24 @@ namespace HeavenStudio.Games.Scripts_Kitties
|
||||||
public void ScheduleClap(double beat, int type)
|
public void ScheduleClap(double beat, int type)
|
||||||
{
|
{
|
||||||
spawnType = type;
|
spawnType = type;
|
||||||
Kitties.instance.ScheduleInput(beat, 2.5f, InputType.STANDARD_DOWN, ClapSuccessOne, ClapMissOne, ClapEmpty);
|
Kitties.instance.ScheduleInput(beat, 2.5f, Kitties.InputAction_BasicPress, ClapSuccessOne, ClapMissOne, ClapEmpty);
|
||||||
Kitties.instance.ScheduleInput(beat, 3f, InputType.STANDARD_DOWN, ClapSuccessTwo, ClapMissTwo, ClapEmpty);
|
Kitties.instance.ScheduleInput(beat, 3f, Kitties.InputAction_BasicPress, ClapSuccessTwo, ClapMissTwo, ClapEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScheduleRoll(double beat)
|
public void ScheduleRoll(double beat)
|
||||||
{
|
{
|
||||||
Kitties.instance.ScheduleInput(beat, 2f, InputType.STANDARD_ALT_DOWN, SpinSuccessOne, SpinMissOne, SpinEmpty);
|
Kitties.instance.ScheduleInput(beat, 2f, Kitties.InputAction_AltStart, SpinSuccessOne, SpinMissOne, SpinEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScheduleRollFinish(double beat)
|
public void ScheduleRollFinish(double beat)
|
||||||
{
|
{
|
||||||
Debug.Log(hasSpun);
|
|
||||||
if (hasSpun)
|
if (hasSpun)
|
||||||
Kitties.instance.ScheduleInput(beat, 2.75f, InputType.STANDARD_ALT_UP, SpinSuccessTwo, SpinMissTwo, SpinEmpty);
|
Kitties.instance.ScheduleInput(beat, 2.75f, Kitties.InputAction_AltFinish, SpinSuccessTwo, SpinMissTwo, SpinEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ScheduleFish(double beat)
|
public void ScheduleFish(double beat)
|
||||||
{
|
{
|
||||||
Kitties.instance.ScheduleInput(beat, 2.75f, InputType.STANDARD_DOWN, FishSuccess, FishMiss, FishEmpty);
|
Kitties.instance.ScheduleInput(beat, 2.75f, Kitties.InputAction_BasicPress, FishSuccess, FishMiss, FishEmpty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClapSuccessOne(PlayerActionEvent Caller, float state)
|
public void ClapSuccessOne(PlayerActionEvent Caller, float state)
|
||||||
|
|
@ -152,12 +155,14 @@ namespace HeavenStudio.Games.Scripts_Kitties
|
||||||
hasSpun = true;
|
hasSpun = true;
|
||||||
SoundByte.PlayOneShotGame("kitties/roll5");
|
SoundByte.PlayOneShotGame("kitties/roll5");
|
||||||
anim.Play("Rolling", 0, 0);
|
anim.Play("Rolling", 0, 0);
|
||||||
|
ScheduleRollFinish(caller.startBeat);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpinSuccessTwo(PlayerActionEvent caller, float beat)
|
public void SpinSuccessTwo(PlayerActionEvent caller, float beat)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("kitties/roll6");
|
SoundByte.PlayOneShotGame("kitties/roll6");
|
||||||
anim.Play("RollEnd", 0, 0);
|
anim.Play("RollEnd", 0, 0);
|
||||||
|
hasSpun = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SpinMissOne(PlayerActionEvent caller)
|
public void SpinMissOne(PlayerActionEvent caller)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HeavenStudio.Util;
|
using HeavenStudio.Util;
|
||||||
|
using HeavenStudio.InputSystem;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -110,6 +111,42 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
public static Kitties instance;
|
public static Kitties instance;
|
||||||
|
|
||||||
|
const int IAAltDownCat = 4;
|
||||||
|
const int IAAltUpCat = 5;
|
||||||
|
|
||||||
|
protected static bool IA_PadAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.South, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_BatonAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetSqueezeDown(out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_TouchAltPress(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetTouchDown(InputController.ActionsTouch.Tap, out dt)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_AltStart);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static bool IA_PadAltRelease(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadUp(InputController.ActionsPad.South, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_BatonAltRelease(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetSqueezeUp(out dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlayerInput.InputAction InputAction_AltStart =
|
||||||
|
new("CtrTeppanAltStart", new int[] { IAAltDownCat, IAAltDownCat, IAAltDownCat },
|
||||||
|
IA_PadAltPress, IA_TouchAltPress, IA_BatonAltPress);
|
||||||
|
public static PlayerInput.InputAction InputAction_AltFinish =
|
||||||
|
new("CtrTeppanAltFinish", new int[] { IAAltUpCat, IAFlickCat, IAAltUpCat },
|
||||||
|
IA_PadAltRelease, IA_TouchFlick, IA_BatonAltRelease);
|
||||||
|
public static PlayerInput.InputAction InputAction_TouchRelease =
|
||||||
|
new("CtrTeppanTouchRelease", new int[] { IAEmptyCat, IAReleaseCat, IAEmptyCat },
|
||||||
|
IA_Empty, IA_TouchBasicRelease, IA_Empty);
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
@ -229,7 +266,7 @@ namespace HeavenStudio.Games
|
||||||
new BeatAction.Action(beat + 1.5f, delegate { kitties[0].Play("RollStart", 0, 0); }),
|
new BeatAction.Action(beat + 1.5f, delegate { kitties[0].Play("RollStart", 0, 0); }),
|
||||||
new BeatAction.Action(beat + 2f, delegate { kitties[0].Play("Rolling", 0, 0); }),
|
new BeatAction.Action(beat + 2f, delegate { kitties[0].Play("Rolling", 0, 0); }),
|
||||||
new BeatAction.Action(beat + 2.75f, delegate { kitties[0].Play("RollEnd", 0, 0); })
|
new BeatAction.Action(beat + 2.75f, delegate { kitties[0].Play("RollEnd", 0, 0); })
|
||||||
});
|
});
|
||||||
|
|
||||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||||
{
|
{
|
||||||
|
|
@ -246,9 +283,8 @@ namespace HeavenStudio.Games
|
||||||
new BeatAction.Action(beat, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
new BeatAction.Action(beat, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
||||||
new BeatAction.Action(beat + .5f, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
new BeatAction.Action(beat + .5f, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
||||||
new BeatAction.Action(beat + 1f, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
new BeatAction.Action(beat + 1f, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
||||||
new BeatAction.Action(beat + 1.5f, delegate { kitties[2].Play("RollStart", 0, 0); }),
|
new BeatAction.Action(beat + 1.5f, delegate { kitties[2].Play("RollStart", 0, 0); })
|
||||||
new BeatAction.Action(beat + 2f, delegate { player.ScheduleRollFinish(beat); })
|
});
|
||||||
});
|
|
||||||
|
|
||||||
if (!keepSpawned)
|
if (!keepSpawned)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
{
|
{
|
||||||
game = RhythmTweezers.instance;
|
game = RhythmTweezers.instance;
|
||||||
tweezers = tweezer;
|
tweezers = tweezer;
|
||||||
game.ScheduleInput(beat, length, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Just, Miss, Out);
|
game.ScheduleInput(beat, length, RhythmTweezers.InputAction_Press, Just, Miss, Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Ace()
|
public void Ace()
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
anim = GetComponent<Animator>();
|
anim = GetComponent<Animator>();
|
||||||
tweezers = tweezer;
|
tweezers = tweezer;
|
||||||
inputBeat = beat + length;
|
inputBeat = beat + length;
|
||||||
game.ScheduleInput(beat, length, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, StartJust, StartMiss, Out);
|
game.ScheduleInput(beat, length, RhythmTweezers.InputAction_Press, StartJust, StartMiss, Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
|
|
@ -46,7 +46,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
float normalizedBeat = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f);
|
float normalizedBeat = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f);
|
||||||
anim.Play("LoopPull", 0, normalizedBeat);
|
anim.Play("LoopPull", 0, normalizedBeat);
|
||||||
tweezers.anim.Play("Tweezers_LongPluck", 0, normalizedBeat);
|
tweezers.anim.Play("Tweezers_LongPluck", 0, normalizedBeat);
|
||||||
if (!game.IsExpectingInputNow(InputType.STANDARD_UP | InputType.DIRECTION_DOWN_UP) && (PlayerInput.PressedUp() || PlayerInput.GetAnyDirectionUp()) && normalizedBeat < 1f)
|
if (!game.IsExpectingInputNow(RhythmTweezers.InputAction_Release) && PlayerInput.GetIsAction(RhythmTweezers.InputAction_Release) && normalizedBeat < 1f)
|
||||||
{
|
{
|
||||||
EndEarly();
|
EndEarly();
|
||||||
endEvent.Disable();
|
endEvent.Disable();
|
||||||
|
|
@ -92,7 +92,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
}
|
}
|
||||||
pullSound = SoundByte.PlayOneShotGame($"rhythmTweezers/longPull{UnityEngine.Random.Range(1, 5)}");
|
pullSound = SoundByte.PlayOneShotGame($"rhythmTweezers/longPull{UnityEngine.Random.Range(1, 5)}");
|
||||||
pluckState = 1;
|
pluckState = 1;
|
||||||
endEvent = game.ScheduleInput(inputBeat, 0.5f, InputType.STANDARD_UP | InputType.DIRECTION_DOWN_UP, EndJust, Out, Out);
|
endEvent = game.ScheduleInput(inputBeat, 0.5f, RhythmTweezers.InputAction_Release, EndJust, Out, Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void StartMiss(PlayerActionEvent caller)
|
private void StartMiss(PlayerActionEvent caller)
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using System;
|
||||||
using Starpelly;
|
using Starpelly;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using HeavenStudio.Util;
|
using HeavenStudio.Util;
|
||||||
|
using HeavenStudio.InputSystem;
|
||||||
|
|
||||||
namespace HeavenStudio.Games.Loaders
|
namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
|
|
@ -208,6 +209,35 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
private static List<QueuedInterval> queuedIntervals = new List<QueuedInterval>();
|
private static List<QueuedInterval> queuedIntervals = new List<QueuedInterval>();
|
||||||
|
|
||||||
|
protected static bool IA_PadAnyDown(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_PadAnyUp(out double dt)
|
||||||
|
{
|
||||||
|
bool face = PlayerInput.GetPadUp(InputController.ActionsPad.East, out dt)
|
||||||
|
&& !(PlayerInput.GetPad(InputController.ActionsPad.Up)
|
||||||
|
|| PlayerInput.GetPad(InputController.ActionsPad.Down)
|
||||||
|
|| PlayerInput.GetPad(InputController.ActionsPad.Left)
|
||||||
|
|| PlayerInput.GetPad(InputController.ActionsPad.Right));
|
||||||
|
bool pad = (PlayerInput.GetPadUp(InputController.ActionsPad.Up)
|
||||||
|
|| PlayerInput.GetPadUp(InputController.ActionsPad.Down)
|
||||||
|
|| PlayerInput.GetPadUp(InputController.ActionsPad.Left)
|
||||||
|
|| PlayerInput.GetPadUp(InputController.ActionsPad.Right))
|
||||||
|
&& !PlayerInput.GetPad(InputController.ActionsPad.East);
|
||||||
|
return face || pad;
|
||||||
|
}
|
||||||
|
public static PlayerInput.InputAction InputAction_Press =
|
||||||
|
new("AgbHairPress", new int[] { IAPressCat, IAPressCat, IAPressCat },
|
||||||
|
IA_PadAnyDown, IA_TouchBasicPress, IA_BatonBasicPress);
|
||||||
|
public static PlayerInput.InputAction InputAction_Release =
|
||||||
|
new("AgbHairRelease", new int[] { IAReleaseCat, IAReleaseCat, IAReleaseCat },
|
||||||
|
IA_PadAnyUp, IA_TouchBasicRelease, IA_BatonBasicRelease);
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
|
||||||
|
|
@ -60,20 +60,15 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (PlayerInput.GetIsAction(RhythmTweezers.InputAction_Press) && !game.IsExpectingInputNow(RhythmTweezers.InputAction_Press))
|
||||||
|
{
|
||||||
|
DropHeldHair();
|
||||||
|
anim.Play("Tweezers_Pluck", 0, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
{
|
{
|
||||||
if (PlayerInput.Pressed() || PlayerInput.GetAnyDirectionDown())
|
|
||||||
{
|
|
||||||
if (!pluckingThisFrame) // Did you do a successful pluck earlier in the frame?
|
|
||||||
{
|
|
||||||
DropHeldHair();
|
|
||||||
anim.Play("Tweezers_Pluck", 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pluckingThisFrame = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Pluck(bool ace, Hair hair)
|
public void Pluck(bool ace, Hair hair)
|
||||||
|
|
@ -110,7 +105,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
anim.Play("Tweezers_Pluck_Fail", 0, 0);
|
anim.Play("Tweezers_Pluck_Fail", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pluckingThisFrame = true; // Prevents standard pluck from playing in LateUpdate().
|
// pluckingThisFrame = true; // Prevents standard pluck from playing in LateUpdate().
|
||||||
holdingHair = true;
|
holdingHair = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -138,7 +133,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers
|
||||||
anim.Play("Tweezers_Pluck_Success", 0, 0);
|
anim.Play("Tweezers_Pluck_Success", 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
pluckingThisFrame = true;
|
// pluckingThisFrame = true;
|
||||||
holdingHair = true;
|
holdingHair = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@ namespace HeavenStudio.Games.Loaders
|
||||||
using static Minigames;
|
using static Minigames;
|
||||||
public static class AgbTapLoader
|
public static class AgbTapLoader
|
||||||
{
|
{
|
||||||
public static Minigame AddGame(EventCaller eventCaller) {
|
public static Minigame AddGame(EventCaller eventCaller)
|
||||||
|
{
|
||||||
return new Minigame("tapTrial", "Tap Trial", "94ffb5", false, false, new List<GameAction>()
|
return new Minigame("tapTrial", "Tap Trial", "94ffb5", false, false, new List<GameAction>()
|
||||||
{
|
{
|
||||||
new GameAction("bop", "Bop")
|
new GameAction("bop", "Bop")
|
||||||
|
|
@ -82,9 +83,9 @@ namespace HeavenStudio.Games.Loaders
|
||||||
hidden = true
|
hidden = true
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
new List<string>() {"agb", "normal"},
|
new List<string>() { "agb", "normal" },
|
||||||
"agbtap", "en",
|
"agbtap", "en",
|
||||||
new List<string>() {}
|
new List<string>() { }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -255,7 +256,7 @@ namespace HeavenStudio.Games
|
||||||
if (bop)
|
if (bop)
|
||||||
{
|
{
|
||||||
List<BeatAction.Action> actions = new();
|
List<BeatAction.Action> actions = new();
|
||||||
for (int i = 0; i < length; i++)
|
for (int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
actions.Add(new BeatAction.Action(beat + i, delegate { SingleBop(); }));
|
actions.Add(new BeatAction.Action(beat + i, delegate { SingleBop(); }));
|
||||||
}
|
}
|
||||||
|
|
@ -302,7 +303,7 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1, 1.4f, 0.5f),
|
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1, 1.4f, 0.5f),
|
||||||
});
|
});
|
||||||
|
|
||||||
ScheduleInput(beat, 1, InputType.STANDARD_DOWN, JustTap, Miss, Empty);
|
ScheduleInput(beat, 1, InputAction_BasicPress, JustTap, Miss, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoubleTap(double beat)
|
public void DoubleTap(double beat)
|
||||||
|
|
@ -340,8 +341,8 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1.5, 1.4f, 0.5f),
|
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1.5, 1.4f, 0.5f),
|
||||||
});
|
});
|
||||||
|
|
||||||
ScheduleInput(beat, 1, InputType.STANDARD_DOWN, JustDoubleTap, Miss, Empty);
|
ScheduleInput(beat, 1, InputAction_BasicPress, JustDoubleTap, Miss, Empty);
|
||||||
ScheduleInput(beat, 1.5, InputType.STANDARD_DOWN, JustDoubleTap, Miss, Empty);
|
ScheduleInput(beat, 1.5, InputAction_BasicPress, JustDoubleTap, Miss, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TripleTap(double beat)
|
public void TripleTap(double beat)
|
||||||
|
|
@ -384,9 +385,9 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("tapTrial/tapMonkey", beat + 3, 1.4f, 0.5f),
|
new MultiSound.Sound("tapTrial/tapMonkey", beat + 3, 1.4f, 0.5f),
|
||||||
});
|
});
|
||||||
|
|
||||||
ScheduleInput(beat, 2, InputType.STANDARD_DOWN, JustTripleTap, Miss, Empty);
|
ScheduleInput(beat, 2, InputAction_BasicPress, JustTripleTap, Miss, Empty);
|
||||||
ScheduleInput(beat, 2.5, InputType.STANDARD_DOWN, JustTripleTap, Miss, Empty);
|
ScheduleInput(beat, 2.5, InputAction_BasicPress, JustTripleTap, Miss, Empty);
|
||||||
ScheduleInput(beat, 3, InputType.STANDARD_DOWN, JustTripleTap, Miss, Empty);
|
ScheduleInput(beat, 3, InputAction_BasicPress, JustTripleTap, Miss, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void JumpPrepare()
|
public void JumpPrepare()
|
||||||
|
|
@ -425,7 +426,7 @@ namespace HeavenStudio.Games
|
||||||
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1, 1.4f, 0.5f),
|
new MultiSound.Sound("tapTrial/tapMonkey", beat + 1, 1.4f, 0.5f),
|
||||||
});
|
});
|
||||||
|
|
||||||
ScheduleInput(beat, 1, InputType.STANDARD_DOWN, final ? JustJumpTapFinal : JustJumpTap, final ? MissJumpFinal : MissJump, Empty);
|
ScheduleInput(beat, 1, InputAction_BasicPress, final ? JustJumpTapFinal : JustJumpTap, final ? MissJumpFinal : MissJump, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void JustJumpTap(PlayerActionEvent caller, float state)
|
private void JustJumpTap(PlayerActionEvent caller, float state)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace HeavenStudio.Games.Scripts_TapTrial
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
{
|
{
|
||||||
if (PlayerInput.Pressed() && !game.IsExpectingInputNow(InputType.STANDARD_DOWN))
|
if (PlayerInput.GetIsAction(TapTrial.InputAction_BasicPress) && !game.IsExpectingInputNow(TapTrial.InputAction_BasicPress))
|
||||||
{
|
{
|
||||||
WhiffTap();
|
WhiffTap();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -233,7 +233,7 @@ namespace HeavenStudio.Games
|
||||||
}
|
}
|
||||||
queuedTaps.Clear();
|
queuedTaps.Clear();
|
||||||
}
|
}
|
||||||
if (PlayerInput.Pressed() && !IsExpectingInputNow(InputType.STANDARD_DOWN))
|
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress))
|
||||||
{
|
{
|
||||||
if (canSpit && !useTutorialMissFace) SoundByte.PlayOneShotGame("tapTroupe/spit", -1, 1, 0.5f);
|
if (canSpit && !useTutorialMissFace) SoundByte.PlayOneShotGame("tapTroupe/spit", -1, 1, 0.5f);
|
||||||
SoundByte.PlayOneShotGame("tapTroupe/miss");
|
SoundByte.PlayOneShotGame("tapTroupe/miss");
|
||||||
|
|
@ -351,7 +351,7 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
for (int i = 0; i < length; i++)
|
for (int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
TapTroupe.instance.ScheduleInput(beat - 1, 1 + i, InputType.STANDARD_DOWN, TapTroupe.instance.JustStep, TapTroupe.instance.MissStep, TapTroupe.instance.Nothing);
|
TapTroupe.instance.ScheduleInput(beat - 1, 1 + i, InputAction_BasicPress, TapTroupe.instance.JustStep, TapTroupe.instance.MissStep, TapTroupe.instance.Nothing);
|
||||||
BeatAction.New(instance, new List<BeatAction.Action>()
|
BeatAction.New(instance, new List<BeatAction.Action>()
|
||||||
{
|
{
|
||||||
new BeatAction.Action(beat + i, delegate
|
new BeatAction.Action(beat + i, delegate
|
||||||
|
|
@ -503,7 +503,7 @@ namespace HeavenStudio.Games
|
||||||
soundsToPlay.Add(new MultiSound.Sound($"tapTroupe/{otherSoundToPlay}", beatToSpawn));
|
soundsToPlay.Add(new MultiSound.Sound($"tapTroupe/{otherSoundToPlay}", beatToSpawn));
|
||||||
shouldDoSecondBam = secondBam;
|
shouldDoSecondBam = secondBam;
|
||||||
secondBam = !secondBam;
|
secondBam = !secondBam;
|
||||||
ScheduleInput(beatToSpawn - 1, 1f, InputType.STANDARD_DOWN, JustTap, MissTap, Nothing);
|
ScheduleInput(beatToSpawn - 1, 1f, InputAction_BasicPress, JustTap, MissTap, Nothing);
|
||||||
}
|
}
|
||||||
int actualOkayType = okayType;
|
int actualOkayType = okayType;
|
||||||
if (actualOkayType == (int)OkayType.Random) actualOkayType = UnityEngine.Random.Range(0, 3);
|
if (actualOkayType == (int)OkayType.Random) actualOkayType = UnityEngine.Random.Range(0, 3);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using HeavenStudio.Util;
|
using HeavenStudio.Util;
|
||||||
|
using HeavenStudio.InputSystem;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
@ -97,6 +98,61 @@ namespace HeavenStudio.Games
|
||||||
private bool goingUp = true;
|
private bool goingUp = true;
|
||||||
private Util.EasingFunction.Ease curtainEase = Util.EasingFunction.Ease.Linear;
|
private Util.EasingFunction.Ease curtainEase = Util.EasingFunction.Ease.Linear;
|
||||||
|
|
||||||
|
const int IALeft = 0;
|
||||||
|
const int IARight = 1;
|
||||||
|
protected static bool IA_PadLeft(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_BatonLeft(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetBatonDown(InputController.ActionsBaton.West, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_TouchLeft(out double dt)
|
||||||
|
{
|
||||||
|
bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt);
|
||||||
|
bool simul = false;
|
||||||
|
if (!want)
|
||||||
|
{
|
||||||
|
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_Left)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_Right);
|
||||||
|
}
|
||||||
|
return want || simul;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static bool IA_PadRight(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_BatonRight(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetBatonDown(InputController.ActionsBaton.East, out dt);
|
||||||
|
}
|
||||||
|
protected static bool IA_TouchRight(out double dt)
|
||||||
|
{
|
||||||
|
bool want = PlayerInput.GetTouchDown(InputController.ActionsTouch.Right, out dt);
|
||||||
|
bool simul = false;
|
||||||
|
if (!want)
|
||||||
|
{
|
||||||
|
simul = PlayerInput.GetTouchDown(InputController.ActionsTouch.Left, out dt)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_Left)
|
||||||
|
&& instance.IsExpectingInputNow(InputAction_Right);
|
||||||
|
}
|
||||||
|
return want || simul;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PlayerInput.InputAction InputAction_Left =
|
||||||
|
new("AgbTramLeft", new int[] { IALeft, IALeft, IALeft },
|
||||||
|
IA_PadLeft, IA_TouchLeft, IA_BatonLeft);
|
||||||
|
|
||||||
|
public static PlayerInput.InputAction InputAction_Right =
|
||||||
|
new("AgbTramRight", new int[] { IARight, IARight, IARight },
|
||||||
|
IA_PadRight, IA_TouchRight, IA_BatonRight);
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
@ -226,14 +282,14 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("tramAndPauline/jump" + UnityEngine.Random.Range(1, 3));
|
SoundByte.PlayOneShotGame("tramAndPauline/jump" + UnityEngine.Random.Range(1, 3));
|
||||||
tram.Jump(beat);
|
tram.Jump(beat);
|
||||||
ScheduleInput(beat, 1, InputType.DIRECTION_DOWN, audienceReact ? TramJustAudience : TramJust, Empty, Empty);
|
ScheduleInput(beat, 1, InputAction_Left, audienceReact ? TramJustAudience : TramJust, Empty, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PaulineJump(double beat, bool audienceReact)
|
private void PaulineJump(double beat, bool audienceReact)
|
||||||
{
|
{
|
||||||
SoundByte.PlayOneShotGame("tramAndPauline/jump" + UnityEngine.Random.Range(1, 3));
|
SoundByte.PlayOneShotGame("tramAndPauline/jump" + UnityEngine.Random.Range(1, 3));
|
||||||
pauline.Jump(beat);
|
pauline.Jump(beat);
|
||||||
ScheduleInput(beat, 1, InputType.STANDARD_DOWN, audienceReact ? PaulineJustAudience : PaulineJust, Empty, Empty);
|
ScheduleInput(beat, 1, InputAction_Right, audienceReact ? PaulineJustAudience : PaulineJust, Empty, Empty);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TramJust(PlayerActionEvent caller, float state)
|
private void TramJust(PlayerActionEvent caller, float state)
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ namespace HeavenStudio.Games
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PlayerInput.Pressed() && !IsExpectingInputNow())
|
if (PlayerInput.GetIsAction(InputAction_BasicPress) && !IsExpectingInputNow(InputAction_BasicPress))
|
||||||
{
|
{
|
||||||
HitCowbell();
|
HitCowbell();
|
||||||
//print("unexpected input");
|
//print("unexpected input");
|
||||||
|
|
@ -154,7 +154,7 @@ namespace HeavenStudio.Games
|
||||||
started = true;
|
started = true;
|
||||||
for(int i = 0; i < length; i++)
|
for(int i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
ScheduleInput(beat, i, InputType.STANDARD_DOWN, CowbellSuccess, CowbellMiss, CowbellEmpty);
|
ScheduleInput(beat, i, InputAction_BasicPress, CowbellSuccess, CowbellMiss, CowbellEmpty);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz
|
||||||
|
|
||||||
public void StartInput(double beat, float length)
|
public void StartInput(double beat, float length)
|
||||||
{
|
{
|
||||||
game.ScheduleInput(beat, length, InputType.STANDARD_DOWN | InputType.DIRECTION_DOWN, Just, Miss, Out);
|
game.ScheduleInput(beat, length, WizardsWaltz.InputAction_Press, Just, Miss, Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Update()
|
private void Update()
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ namespace HeavenStudio.Games.Scripts_WizardsWaltz
|
||||||
|
|
||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
{
|
{
|
||||||
if (PlayerInput.Pressed() || PlayerInput.GetAnyDirectionDown())
|
if (PlayerInput.GetIsAction(WizardsWaltz.InputAction_Press))
|
||||||
{
|
{
|
||||||
animator.Play("Magic", 0, 0);
|
animator.Play("Magic", 0, 0);
|
||||||
SoundByte.PlayOneShotGame("wizardsWaltz/wand");
|
SoundByte.PlayOneShotGame("wizardsWaltz/wand");
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using System;
|
||||||
using Starpelly;
|
using Starpelly;
|
||||||
|
|
||||||
using HeavenStudio.Util;
|
using HeavenStudio.Util;
|
||||||
|
using HeavenStudio.InputSystem;
|
||||||
|
|
||||||
namespace HeavenStudio.Games.Loaders
|
namespace HeavenStudio.Games.Loaders
|
||||||
{
|
{
|
||||||
|
|
@ -71,6 +72,18 @@ namespace HeavenStudio.Games
|
||||||
|
|
||||||
private static CallAndResponseHandler crHandlerInstance;
|
private static CallAndResponseHandler crHandlerInstance;
|
||||||
|
|
||||||
|
protected static bool IA_PadAnyDown(out double dt)
|
||||||
|
{
|
||||||
|
return PlayerInput.GetPadDown(InputController.ActionsPad.East, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Up, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Down, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Left, out dt)
|
||||||
|
|| PlayerInput.GetPadDown(InputController.ActionsPad.Right, out dt);
|
||||||
|
}
|
||||||
|
public static PlayerInput.InputAction InputAction_Press =
|
||||||
|
new("AgbWizardPress", new int[] { IAPressCat, IAPressCat, IAPressCat },
|
||||||
|
IA_PadAnyDown, IA_TouchBasicPress, IA_BatonBasicPress);
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue