feat: 플레이어 경직/다운 회복 구간 추가

- HitReactionController에 경직, 다운 회복 가능 구간, Hit 속도 배율 파라미터 처리를 추가

- DownBegin/Recover 상태 종료를 StateMachineBehaviour로 받아 구르기 허용 구간과 다운 해제를 분리

- 드로그 발구르기를 경직 이펙트로 전환하고 넉백/경직 이펙트에서 Hit 애니메이션 속도 배율을 설정 가능하게 정리

- PlayMode 테스트를 추가해 경직/넉백이 Hit 애니메이션 속도 배율을 실제로 반영하는지 자동 검증
This commit is contained in:
2026-04-06 18:03:50 +09:00
parent daaf54169a
commit 147e9baa25
28 changed files with 1665 additions and 38 deletions

View File

@@ -15,6 +15,13 @@ namespace Colosseum.Skills.Effects
[SerializeField] private float upwardForce = 2f;
[Min(0.05f)] [SerializeField] private float duration = 0.2f;
[Header("Hit Animation")]
[Tooltip("넉백 적용 시 경직 애니메이션 재생 여부")]
[SerializeField] private bool playHitAnimation = true;
[Tooltip("경직 애니메이션 재생 속도 배율")]
[Min(0.01f)] [SerializeField] private float hitAnimationSpeedMultiplier = 1f;
protected override void ApplyEffect(GameObject caster, GameObject target)
{
if (target == null || caster == null) return;
@@ -34,7 +41,7 @@ namespace Colosseum.Skills.Effects
if (hitReactionController != null)
{
hitReactionController.ApplyKnockback(knockbackVelocity, duration);
hitReactionController.ApplyKnockback(knockbackVelocity, duration, playHitAnimation, hitAnimationSpeedMultiplier);
return;
}

View File

@@ -0,0 +1,44 @@
using UnityEngine;
using Colosseum.Player;
namespace Colosseum.Skills.Effects
{
/// <summary>
/// 대상에게 제자리 경직을 적용하는 스킬 효과입니다.
/// </summary>
[CreateAssetMenu(fileName = "StaggerEffect", menuName = "Colosseum/Skills/Effects/Stagger")]
public class StaggerEffect : SkillEffect
{
[Header("Settings")]
[Tooltip("경직 지속 시간")]
[Min(0f)] [SerializeField] private float duration = 0.35f;
[Tooltip("경직 적용 시 피격 애니메이션 재생 여부")]
[SerializeField] private bool playHitAnimation = true;
[Tooltip("경직 애니메이션 재생 속도 배율")]
[Min(0.01f)] [SerializeField] private float hitAnimationSpeedMultiplier = 1f;
protected override void ApplyEffect(GameObject caster, GameObject target)
{
if (target == null)
{
Debug.LogWarning("[StaggerEffect] Target is null.");
return;
}
HitReactionController hitReactionController = target.GetComponent<HitReactionController>();
if (hitReactionController == null)
hitReactionController = target.GetComponentInParent<HitReactionController>();
if (hitReactionController == null)
{
Debug.LogWarning($"[StaggerEffect] HitReactionController not found on target: {target.name}");
return;
}
hitReactionController.ApplyStagger(duration, playHitAnimation, hitAnimationSpeedMultiplier);
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 675a8e51dce8ee00db904424ae5c8d9d

View File

@@ -6,6 +6,7 @@ using UnityEngine;
using Unity.Netcode;
using Colosseum.Abnormalities;
using Colosseum.Player;
#if UNITY_EDITOR
using UnityEditor;
@@ -23,6 +24,7 @@ namespace Colosseum.Skills
Interrupt,
Death,
Stun,
Stagger,
HitReaction,
Respawn,
Revive,
@@ -361,6 +363,12 @@ namespace Colosseum.Skills
return false;
}
if (skill.IsEvadeSkill)
{
HitReactionController hitReactionController = GetComponent<HitReactionController>();
hitReactionController?.TryConsumeDownRecoverableEvade();
}
currentLoadoutEntry = loadoutEntry != null ? loadoutEntry.CreateCopy() : SkillLoadoutEntry.CreateTemporary(skill);
currentSkill = skill;
lastCancelReason = SkillCancelReason.None;

View File

@@ -245,6 +245,8 @@ namespace Colosseum.Skills
public SkillRoleType SkillRole => skillRole;
public SkillActivationType ActivationType => activationType;
public SkillBaseType BaseTypes => baseTypes;
public bool IsEvadeSkill => ((baseTypes & SkillBaseType.Mobility) != 0)
&& (ContainsEvadeKeyword(skillName) || ContainsEvadeKeyword(name));
/// <summary>
/// 순차 재생할 클립 목록입니다.
/// </summary>
@@ -307,6 +309,15 @@ namespace Colosseum.Skills
return (equippedTraits & allowedWeaponTraits) == allowedWeaponTraits;
}
private static bool ContainsEvadeKeyword(string value)
{
if (string.IsNullOrWhiteSpace(value))
return false;
return value.IndexOf("구르기", StringComparison.OrdinalIgnoreCase) >= 0
|| value.IndexOf("회피", StringComparison.OrdinalIgnoreCase) >= 0;
}
}
/// <summary>