mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 05:27:38 +02:00
Big Nail Carpenter Updates (#743)
* Made Nail half-speed, changed long nail from hold B to press B, touched up animations - Made Nail Carpenter half-speed -- it shouldn't change much, just remember to double your tempo! - Also changed the long nail input from hold and release to simply pressing B -- the old way gives less reaction time and is just less fun overall - Also touched up the animations to make them snappier and improve gamefeel * Cleaned up animations a bit further, changed 'fusuma' to 'shoji' * Further animation improvements Hit animations are now instant, and the hammer animation is about snappy and responsive as it should be * Fixed touch controls FIxed touch controls being a miss no matter what * reimplemented touch mode whiffing cuz i forgor * fixed a sound effect playing at the wrong time * spawning logic overhaul also fixed issue where sweets would be hittable if a nail could be instead cues at full speed for testing need to halve the speed of everything later * remove stray sfx call * add missing exclaim animations to the forced object types * improve chunk based spawning improve animator setup * remove unused stuff * new animations girl randomly blinks puddings bounce when passing the girl nails pop out when missing * fix the sweet break check --------- Co-authored-by: minenice55 <star.elementa@gmail.com>
This commit is contained in:
@ -1,16 +1,15 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NaughtyBezierCurves;
|
||||
using DG.Tweening;
|
||||
|
||||
using HeavenStudio.Util;
|
||||
using HeavenStudio.InputSystem;
|
||||
|
||||
namespace HeavenStudio.Games.Scripts_NailCarpenter
|
||||
{
|
||||
public class LongNail : MonoBehaviour
|
||||
{
|
||||
public double targetBeat;
|
||||
public float targetX;
|
||||
public float metresPerSecond;
|
||||
public Animator nailAnim;
|
||||
|
||||
private NailCarpenter game;
|
||||
@ -18,49 +17,52 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
|
||||
public void Init()
|
||||
{
|
||||
game = NailCarpenter.instance;
|
||||
|
||||
game.ScheduleInput(targetBeat, 0.5f, NailCarpenter.InputAction_AltFinish, HammmerJust, HammmerMiss, Empty);
|
||||
|
||||
game.ScheduleInput(targetBeat, 0, NailCarpenter.InputAction_AltPress, HammmerJust, HammmerMiss, null);
|
||||
// wrongInput
|
||||
game.ScheduleUserInput(targetBeat, 0.5f, NailCarpenter.InputAction_BasicPress, weakHammmerJust, Empty, Empty);
|
||||
if (PlayerInput.CurrentControlStyle != InputController.ControlStyles.Touch)
|
||||
{
|
||||
game.ScheduleUserInput(targetBeat, 0, NailCarpenter.InputAction_RegPress, WeakHammmerJust, null, null);
|
||||
}
|
||||
Update();
|
||||
}
|
||||
|
||||
private void HammmerJust(PlayerActionEvent caller, float state)
|
||||
{
|
||||
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 0.5f);
|
||||
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 0.25f);
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
nailAnim.DoScaledAnimationAsync(
|
||||
(state >= 1f ? "longNailBendRight" : "longNailBendLeft"), 0.5f);
|
||||
(state >= 1f ? "longNailBendRight" : "longNailBendLeft"), 0.25f);
|
||||
SoundByte.PlayOneShot("miss");
|
||||
return;
|
||||
}
|
||||
SoundByte.PlayOneShotGame("nailCarpenter/HammerStrong");
|
||||
nailAnim.DoScaledAnimationAsync("longNailHammered", 0.5f);
|
||||
game.EyeAnim.DoScaledAnimationAsync("eyeSmile", 0.5f);
|
||||
nailAnim.DoScaledAnimationAsync("longNailHammered", 0.25f);
|
||||
game.Carpenter.DoScaledAnimationAsync("eyeSmile", 0.25f, animLayer: 1);
|
||||
}
|
||||
|
||||
private void weakHammmerJust(PlayerActionEvent caller, float state)
|
||||
private void WeakHammmerJust(PlayerActionEvent caller, float state)
|
||||
{
|
||||
game.ScoreMiss();
|
||||
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 0.5f);
|
||||
game.Carpenter.DoScaledAnimationAsync("carpenterHit", 0.25f);
|
||||
if (state >= 1f || state <= -1f)
|
||||
{
|
||||
nailAnim.DoScaledAnimationAsync(
|
||||
(state >= 1f ? "longNailBendRight" : "longNailBendLeft"), 0.5f);
|
||||
(state >= 1f ? "longNailBendRight" : "longNailBendLeft"), 0.25f);
|
||||
SoundByte.PlayOneShot("miss");
|
||||
return;
|
||||
}
|
||||
SoundByte.PlayOneShotGame("nailCarpenter/HammerWeak");
|
||||
nailAnim.DoScaledAnimationAsync("longNailWeakHammered", 0.5f);
|
||||
nailAnim.DoScaledAnimationAsync("longNailWeakHammered", 0.25f);
|
||||
}
|
||||
|
||||
private void HammmerMiss(PlayerActionEvent caller)
|
||||
{
|
||||
game.EyeAnim.DoScaledAnimationAsync("eyeBlink", 0.5f);
|
||||
game.Carpenter.DoScaledAnimationAsync("eyeBlink", 0.25f, animLayer: 1);
|
||||
nailAnim.DoScaledAnimationAsync("longNailMiss", 0.5f);
|
||||
}
|
||||
|
||||
private void Empty(PlayerActionEvent caller) { }
|
||||
|
||||
private void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
@ -68,7 +70,10 @@ namespace HeavenStudio.Games.Scripts_NailCarpenter
|
||||
if (cond.isPlaying && !cond.isPaused)
|
||||
{
|
||||
double beat = cond.songPositionInBeats;
|
||||
if (targetBeat != double.MinValue)
|
||||
Vector3 pos = transform.position;
|
||||
pos.x = targetX + (float)((beat - targetBeat) * metresPerSecond);
|
||||
transform.position = pos;
|
||||
if (targetBeat != double.MinValue)
|
||||
{
|
||||
if (beat >= targetBeat + 9) Destroy(gameObject);
|
||||
}
|
||||
|
Reference in New Issue
Block a user