public override void OnTurn() { var target = Core.GetNearestEnemy(Unit); if (target != null && target.IsAlive()) { if (Core.GetDistance(Unit, target) > _attackDistance) { Unit.MoveTo(target.X, target.Y); } else { target.Damage(_damage); } } Unit.AddMana(_manaRegen); }
public override void OnTurn() { var target = Core.GetNearestEnemy(Unit); if (target != null && target.IsAlive()) { if (Core.GetDistance(Unit, target) > 1) { Unit.MoveTo(target.X, target.Y); } else { var damage = Random.Range(0, 100) < _critChance ? _damage * _critRate : _damage; target.Damage(damage); } } Unit.AddMana(_manaRegen); }
public override void OnTurn() { if (_stunned == 0) { var target = Core.GetNearestEnemy(Unit); if (target != null && target.IsAlive()) { if (Core.GetDistance(Unit, target) > _attackDistance) { Unit.MoveTo(target.X, target.Y); } else { target.Damage(_damage); } } Unit.AddMana(_manaRegen); } _stunned = System.Math.Max(0, _stunned - 1); _turnReceiveDamage = 0; }
public override void OnTurn() { if (_stunned == 0) { var target = Core.GetNearestEnemy(Unit); if (target != null && target.IsAlive()) { if (Core.GetDistance(Unit, target) > _attackDistance) { Unit.MoveTo(target.X, target.Y); } else { target.Damage(_damage); } } Unit.AddMana(_manaRegen); } Unit.Heal((int)Math.Round(_turnReceiveDamage * _healDamagePercent / 100f)); _stunned = Math.Max(0, _stunned - 1); _turnReceiveDamage = 0; }
public override int OnDamage(int damage) { Unit.AddMana(_manaRegen); return(damage); }