public void Tick() { switch (_state) { case State.Spawn: _logic.OnSpawn(); _state = State.Turn; break; case State.Move: _battle.AskMoveUnitTo(this, _destX, _destY); _state = State.Turn; break; case State.Turn: if (Mana == MaxMana) { _logic.OnAbility(); SubMana(MaxMana); break; } _logic.OnTurn(); break; case State.Die: _logic.OnDie(); break; } }
public void OnDie() { _logic.OnDie(); for (int i = 0; i < Buffs.Count; i++) { Buffs[i].OnDie(); } }
public void Damage(int damage) { damage = _logic.OnDamage(damage); Health = Math.Max(0, Health - damage); if (IsStunned() && damage >= _removeStunDamage) { RemoveStun(); } if (!IsAlive()) { _state = State.Die; _logic.OnDie(); } }