feat: 플레이어 다운 및 넉백 피격 반응 추가
- HitReactionController로 다운과 넉백 전용 로직을 분리 - 다운 시작, 루프, 회복 애니메이션과 DownEffect를 연결 - 행동 상태와 스킬 취소가 피격 반응과 연동되도록 정리 - 자동 검증 러너에 다운 및 넉백 검증을 추가
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
using Unity.Netcode;
|
||||
using Colosseum.Stats;
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Skills;
|
||||
|
||||
namespace Colosseum.Abnormalities
|
||||
{
|
||||
@@ -20,6 +21,9 @@ namespace Colosseum.Abnormalities
|
||||
[Tooltip("PlayerNetworkController 컴포넌트 (HP/MP 관리용)")]
|
||||
[SerializeField] private PlayerNetworkController networkController;
|
||||
|
||||
[Tooltip("스킬 실행 관리자 (강제 취소 처리용)")]
|
||||
[SerializeField] private SkillController skillController;
|
||||
|
||||
// 활성화된 이상 상태 목록
|
||||
private readonly List<ActiveAbnormality> activeAbnormalities = new List<ActiveAbnormality>();
|
||||
|
||||
@@ -108,6 +112,9 @@ namespace Colosseum.Abnormalities
|
||||
if (networkController == null)
|
||||
networkController = GetComponent<PlayerNetworkController>();
|
||||
|
||||
if (skillController == null)
|
||||
skillController = GetComponent<SkillController>();
|
||||
|
||||
syncedAbnormalities = new NetworkList<AbnormalitySyncData>();
|
||||
}
|
||||
|
||||
@@ -414,9 +421,12 @@ namespace Colosseum.Abnormalities
|
||||
|
||||
private void ApplyControlEffect(AbnormalityData data)
|
||||
{
|
||||
bool enteredStun = false;
|
||||
|
||||
switch (data.controlType)
|
||||
{
|
||||
case ControlType.Stun:
|
||||
enteredStun = stunCount == 0;
|
||||
stunCount++;
|
||||
break;
|
||||
|
||||
@@ -434,6 +444,11 @@ namespace Colosseum.Abnormalities
|
||||
}
|
||||
|
||||
SyncControlEffects();
|
||||
|
||||
if (enteredStun)
|
||||
{
|
||||
TryCancelCurrentSkill(SkillCancelReason.Stun, data.abnormalityName);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveControlEffect(AbnormalityData data)
|
||||
@@ -584,6 +599,17 @@ namespace Colosseum.Abnormalities
|
||||
Debug.Log($"[Abnormality] Cleared all abnormalities on death: {gameObject.name}");
|
||||
}
|
||||
|
||||
private void TryCancelCurrentSkill(SkillCancelReason reason, string sourceName)
|
||||
{
|
||||
if (!IsServer || skillController == null || !skillController.IsPlayingAnimation)
|
||||
return;
|
||||
|
||||
if (skillController.CancelSkill(reason))
|
||||
{
|
||||
Debug.Log($"[Abnormality] Cancelled skill because '{sourceName}' applied to {gameObject.name}");
|
||||
}
|
||||
}
|
||||
|
||||
private AbnormalityData FindAbnormalityDataById(int instanceId)
|
||||
{
|
||||
var allData = Resources.FindObjectsOfTypeAll<AbnormalityData>();
|
||||
|
||||
Reference in New Issue
Block a user