45 lines
1.0 KiB
C#
45 lines
1.0 KiB
C#
using Battle; // BattleManager.CurrentGameSeconds 참조
|
|
|
|
namespace Units
|
|
{
|
|
public class Champion : Unit
|
|
{
|
|
private int _championAtk;
|
|
private int _championMaxHP;
|
|
|
|
private int _reviveAt;
|
|
private int GetReviveDelay() => 5;
|
|
|
|
|
|
protected override void Init()
|
|
{
|
|
MaxHP = _championMaxHP;
|
|
Atk = _championAtk;
|
|
}
|
|
|
|
public override void Update()
|
|
{
|
|
if (_health.IsDead && BattleManager.CurrentGameSeconds >= _reviveAt)
|
|
Revive(); // 시간 도달 시 부활
|
|
}
|
|
|
|
protected override int GetAttackDamage(AttackType attackType)
|
|
{
|
|
//데미지 계산
|
|
return Atk;
|
|
}
|
|
|
|
protected override void OnDied()
|
|
{
|
|
_reviveAt = BattleManager.CurrentGameSeconds + GetReviveDelay(); // 예약
|
|
}
|
|
|
|
private void Revive()
|
|
{
|
|
_health.Revive();
|
|
|
|
//부활 지점에서 스폰 로직
|
|
}
|
|
}
|
|
}
|