feat: 플레이어 다운/넉백 피격 반응 추가
This commit is contained in:
@@ -22,6 +22,9 @@ namespace Colosseum.Player
|
||||
[Tooltip("스킬 실행 관리자")]
|
||||
[SerializeField] private SkillController skillController;
|
||||
|
||||
[Tooltip("피격 제어 관리자")]
|
||||
[SerializeField] private HitReactionController hitReactionController;
|
||||
|
||||
[Tooltip("관전 관리자")]
|
||||
[SerializeField] private PlayerSpectator spectator;
|
||||
|
||||
@@ -35,6 +38,11 @@ namespace Colosseum.Player
|
||||
/// </summary>
|
||||
public bool IsStunned => abnormalityManager != null && abnormalityManager.IsStunned;
|
||||
|
||||
/// <summary>
|
||||
/// 다운 상태 여부
|
||||
/// </summary>
|
||||
public bool IsDowned => hitReactionController != null && hitReactionController.IsDowned;
|
||||
|
||||
/// <summary>
|
||||
/// 침묵 상태 여부
|
||||
/// </summary>
|
||||
@@ -68,17 +76,17 @@ namespace Colosseum.Player
|
||||
/// <summary>
|
||||
/// 플레이어가 직접 이동 입력을 사용할 수 있는지 여부
|
||||
/// </summary>
|
||||
public bool CanMove => CanReceiveInput && !IsStunned && !BlocksMovementForCurrentSkill();
|
||||
public bool CanMove => CanReceiveInput && !IsStunned && !IsDowned && !BlocksMovementForCurrentSkill();
|
||||
|
||||
/// <summary>
|
||||
/// 점프 가능 여부
|
||||
/// </summary>
|
||||
public bool CanJump => CanReceiveInput && !IsStunned && !BlocksJumpForCurrentSkill();
|
||||
public bool CanJump => CanReceiveInput && !IsStunned && !IsDowned && !BlocksJumpForCurrentSkill();
|
||||
|
||||
/// <summary>
|
||||
/// 일반 스킬 시작 가능 여부
|
||||
/// </summary>
|
||||
public bool CanUseSkills => CanReceiveInput && !IsStunned && !IsSilenced && !BlocksSkillUseForCurrentSkill();
|
||||
public bool CanUseSkills => CanReceiveInput && !IsStunned && !IsDowned && !IsSilenced && !BlocksSkillUseForCurrentSkill();
|
||||
|
||||
/// <summary>
|
||||
/// 특정 스킬의 시작 가능 여부.
|
||||
@@ -89,7 +97,7 @@ namespace Colosseum.Player
|
||||
if (skill == null)
|
||||
return false;
|
||||
|
||||
if (!CanReceiveInput || IsStunned || IsSilenced)
|
||||
if (!CanReceiveInput || IsStunned || IsDowned || IsSilenced)
|
||||
return false;
|
||||
|
||||
return !BlocksSkillUseForCurrentSkill();
|
||||
@@ -102,7 +110,7 @@ namespace Colosseum.Player
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!CanReceiveInput || IsStunned)
|
||||
if (!CanReceiveInput || IsStunned || IsDowned)
|
||||
return 0f;
|
||||
|
||||
return abnormalityManager != null ? abnormalityManager.MoveSpeedMultiplier : 1f;
|
||||
@@ -117,6 +125,8 @@ namespace Colosseum.Player
|
||||
abnormalityManager = GetComponent<AbnormalityManager>();
|
||||
if (skillController == null)
|
||||
skillController = GetComponent<SkillController>();
|
||||
if (hitReactionController == null)
|
||||
hitReactionController = GetOrCreateHitReactionController();
|
||||
if (spectator == null)
|
||||
spectator = GetComponentInChildren<PlayerSpectator>();
|
||||
}
|
||||
@@ -144,5 +154,14 @@ namespace Colosseum.Player
|
||||
|
||||
return CurrentSkill == null || CurrentSkill.BlockOtherSkillsWhileCasting;
|
||||
}
|
||||
|
||||
private HitReactionController GetOrCreateHitReactionController()
|
||||
{
|
||||
HitReactionController foundController = GetComponent<HitReactionController>();
|
||||
if (foundController != null)
|
||||
return foundController;
|
||||
|
||||
return gameObject.AddComponent<HitReactionController>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user