feat: 플레이어 탱킹 및 지원 스킬 1차 구현
- 도발, 방어 태세, 철벽 스킬과 위협 생성 배율 시스템을 추가 - 치유, 광역 치유, 보호막 스킬과 관련 이상상태/이펙트 자산을 구성 - 보호막 흡수 로직과 체력 HUD 보너스 표시를 PlayerNetworkController, PlayerHUD, StatBar에 반영 - 플레이어 프리팹 슬롯과 디버그 메뉴를 확장해 탱킹·지원 스킬 검증 경로를 추가 - Unity 컴파일과 런타임 테스트에서 도발, 치유, 광역 치유, 보호막 발동 및 보호막 수치 적용을 확인
This commit is contained in:
60
Assets/_Game/Scripts/Skills/Effects/CombatBuffEffect.cs
Normal file
60
Assets/_Game/Scripts/Skills/Effects/CombatBuffEffect.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Abnormalities;
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 이상상태와 위협 생성 배율을 함께 적용하는 자기 강화 효과입니다.
|
||||
/// 탱킹 스킬의 방어/위협 유지 용도로 사용합니다.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "CombatBuffEffect", menuName = "Colosseum/Skills/Effects/Combat Buff")]
|
||||
public class CombatBuffEffect : SkillEffect
|
||||
{
|
||||
[Header("Buff")]
|
||||
[Tooltip("적용할 이상상태 데이터")]
|
||||
[SerializeField] private AbnormalityData abnormalityData;
|
||||
|
||||
[Tooltip("함께 적용할 위협 생성 배율")]
|
||||
[Min(0f)] [SerializeField] private float threatMultiplier = 1f;
|
||||
|
||||
[Tooltip("위협 생성 배율 지속 시간")]
|
||||
[Min(0f)] [SerializeField] private float threatMultiplierDuration = 0f;
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
ApplyAbnormality(target, caster);
|
||||
ApplyThreatMultiplier(target);
|
||||
}
|
||||
|
||||
private void ApplyAbnormality(GameObject target, GameObject caster)
|
||||
{
|
||||
if (abnormalityData == null)
|
||||
return;
|
||||
|
||||
AbnormalityManager abnormalityManager = target.GetComponent<AbnormalityManager>();
|
||||
if (abnormalityManager == null)
|
||||
return;
|
||||
|
||||
abnormalityManager.ApplyAbnormality(abnormalityData, caster);
|
||||
}
|
||||
|
||||
private void ApplyThreatMultiplier(GameObject target)
|
||||
{
|
||||
if (threatMultiplier <= 0f || threatMultiplierDuration <= 0f)
|
||||
return;
|
||||
|
||||
ThreatController threatController = target.GetComponent<ThreatController>();
|
||||
if (threatController == null)
|
||||
{
|
||||
threatController = target.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier, threatMultiplierDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 639a0e2e83c292b4aaf5bc4b1532f099
|
||||
47
Assets/_Game/Scripts/Skills/Effects/ShieldEffect.cs
Normal file
47
Assets/_Game/Scripts/Skills/Effects/ShieldEffect.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Player;
|
||||
using Colosseum.Stats;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 보호막 효과입니다.
|
||||
/// 대상에게 일정 시간 동안 피해를 흡수하는 보호막을 부여합니다.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "ShieldEffect", menuName = "Colosseum/Skills/Effects/Shield")]
|
||||
public class ShieldEffect : SkillEffect
|
||||
{
|
||||
[Header("Shield")]
|
||||
[Tooltip("기본 보호막 수치")]
|
||||
[Min(0f)] [SerializeField] private float baseShield = 100f;
|
||||
|
||||
[Tooltip("회복력 계수")]
|
||||
[Min(0f)] [SerializeField] private float shieldScaling = 0.5f;
|
||||
|
||||
[Tooltip("보호막 지속 시간")]
|
||||
[Min(0f)] [SerializeField] private float duration = 5f;
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (target == null)
|
||||
return;
|
||||
|
||||
PlayerNetworkController networkController = target.GetComponent<PlayerNetworkController>();
|
||||
if (networkController == null)
|
||||
return;
|
||||
|
||||
float totalShield = CalculateShield(caster);
|
||||
networkController.ApplyShield(totalShield, duration);
|
||||
}
|
||||
|
||||
private float CalculateShield(GameObject caster)
|
||||
{
|
||||
CharacterStats stats = caster != null ? caster.GetComponent<CharacterStats>() : null;
|
||||
if (stats == null)
|
||||
return baseShield;
|
||||
|
||||
return baseShield + (stats.HealPower * shieldScaling);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Game/Scripts/Skills/Effects/ShieldEffect.cs.meta
Normal file
2
Assets/_Game/Scripts/Skills/Effects/ShieldEffect.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6598d3be8b5522b4494d1f60cbc1986c
|
||||
87
Assets/_Game/Scripts/Skills/Effects/TauntEffect.cs
Normal file
87
Assets/_Game/Scripts/Skills/Effects/TauntEffect.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Combat;
|
||||
using Colosseum.Enemy;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 주변 적의 위협 수치를 높여 주 대상을 자신에게 돌리는 도발 효과입니다.
|
||||
/// 필요 시 시전자에게 임시 위협 생성 배율도 함께 부여합니다.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "TauntEffect", menuName = "Colosseum/Skills/Effects/Taunt")]
|
||||
public class TauntEffect : SkillEffect
|
||||
{
|
||||
[Header("Taunt Settings")]
|
||||
[Tooltip("도발 시 추가할 기본 위협 수치")]
|
||||
[Min(0f)] [SerializeField] private float flatThreatAmount = 50f;
|
||||
|
||||
[Tooltip("현재 최고 위협보다 이 값만큼 더 높게 설정합니다.")]
|
||||
[Min(0f)] [SerializeField] private float threatLeadBonus = 10f;
|
||||
|
||||
[Tooltip("도발과 함께 시전자에게 부여할 위협 생성 배율")]
|
||||
[Min(0f)] [SerializeField] private float selfThreatMultiplier = 1.5f;
|
||||
|
||||
[Tooltip("위협 생성 배율 지속 시간")]
|
||||
[Min(0f)] [SerializeField] private float selfThreatMultiplierDuration = 5f;
|
||||
|
||||
private readonly Collider[] overlapBuffer = new Collider[16];
|
||||
private readonly HashSet<EnemyBase> processedEnemies = new HashSet<EnemyBase>();
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (caster == null)
|
||||
return;
|
||||
|
||||
ApplySelfThreatMultiplier(caster);
|
||||
|
||||
processedEnemies.Clear();
|
||||
int hitCount = Physics.OverlapSphereNonAlloc(caster.transform.position, areaRadius, overlapBuffer, targetLayers);
|
||||
for (int i = 0; i < hitCount; i++)
|
||||
{
|
||||
Collider hit = overlapBuffer[i];
|
||||
if (hit == null)
|
||||
continue;
|
||||
|
||||
EnemyBase enemy = hit.GetComponentInParent<EnemyBase>();
|
||||
if (enemy == null || processedEnemies.Contains(enemy))
|
||||
continue;
|
||||
|
||||
if (!IsValidTarget(caster, enemy.gameObject))
|
||||
continue;
|
||||
|
||||
processedEnemies.Add(enemy);
|
||||
ApplyTauntThreat(enemy, caster);
|
||||
}
|
||||
}
|
||||
|
||||
private void ApplySelfThreatMultiplier(GameObject caster)
|
||||
{
|
||||
if (selfThreatMultiplier <= 0f || selfThreatMultiplierDuration <= 0f)
|
||||
return;
|
||||
|
||||
ThreatController threatController = caster.GetComponent<ThreatController>();
|
||||
if (threatController == null)
|
||||
{
|
||||
threatController = caster.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(selfThreatMultiplier, selfThreatMultiplierDuration);
|
||||
}
|
||||
|
||||
private void ApplyTauntThreat(EnemyBase enemy, GameObject caster)
|
||||
{
|
||||
if (enemy == null || caster == null || !enemy.UseThreatSystem)
|
||||
return;
|
||||
|
||||
GameObject highestThreatTarget = enemy.GetHighestThreatTarget();
|
||||
float highestThreat = highestThreatTarget != null ? enemy.GetThreat(highestThreatTarget) : 0f;
|
||||
float currentCasterThreat = enemy.GetThreat(caster);
|
||||
|
||||
float desiredThreat = Mathf.Max(currentCasterThreat + flatThreatAmount, highestThreat + threatLeadBonus + flatThreatAmount);
|
||||
enemy.SetThreat(caster, desiredThreat);
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Assets/_Game/Scripts/Skills/Effects/TauntEffect.cs.meta
Normal file
2
Assets/_Game/Scripts/Skills/Effects/TauntEffect.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bd72562b167fced4191f12bd3a86d341
|
||||
34
Assets/_Game/Scripts/Skills/Effects/ThreatModifierEffect.cs
Normal file
34
Assets/_Game/Scripts/Skills/Effects/ThreatModifierEffect.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using UnityEngine;
|
||||
|
||||
using Colosseum.Combat;
|
||||
|
||||
namespace Colosseum.Skills.Effects
|
||||
{
|
||||
/// <summary>
|
||||
/// 시전자 또는 대상의 위협 생성 배율을 일정 시간 증가시킵니다.
|
||||
/// </summary>
|
||||
[CreateAssetMenu(fileName = "ThreatModifierEffect", menuName = "Colosseum/Skills/Effects/Threat Modifier")]
|
||||
public class ThreatModifierEffect : SkillEffect
|
||||
{
|
||||
[Header("Threat Modifier")]
|
||||
[Tooltip("적용할 위협 생성 배율")]
|
||||
[Min(0f)] [SerializeField] private float threatMultiplier = 1.5f;
|
||||
|
||||
[Tooltip("배율 지속 시간")]
|
||||
[Min(0f)] [SerializeField] private float duration = 5f;
|
||||
|
||||
protected override void ApplyEffect(GameObject caster, GameObject target)
|
||||
{
|
||||
if (target == null || threatMultiplier <= 0f || duration <= 0f)
|
||||
return;
|
||||
|
||||
ThreatController threatController = target.GetComponent<ThreatController>();
|
||||
if (threatController == null)
|
||||
{
|
||||
threatController = target.AddComponent<ThreatController>();
|
||||
}
|
||||
|
||||
threatController.ApplyThreatMultiplier(threatMultiplier, duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae36db0b9307b554bae67c8825a36b99
|
||||
Reference in New Issue
Block a user