First commit
This commit is contained in:
44
Units/Champion.cs
Normal file
44
Units/Champion.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
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();
|
||||
|
||||
//부활 지점에서 스폰 로직
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user