private IEnumerator Run(MainSystem sys) { _target.RemoveStatus(StatusType.Sleep); yield return(Anim.Par(sys, () => _target.DamageAnim(_damage), () => EffectAnim.PopupWhiteDigits(_target, _damage))); _target.DamageHp(_damage); if (_target.Hp <= 0 && _target is Enemy) { var pos = _target.Position; _target.Destroy(); yield return(EffectAnim.Dead(pos)); } AnimationFinished = true; }
public override IEnumerator Hit(CharacterBase sender, CharacterBase target, MainSystem sys) { yield return(EffectAnim.Thunder(target.Position)); int damage = 99; yield return(Anim.Par(sys, () => target.DamageAnim(damage), () => EffectAnim.PopupWhiteDigits(target, damage))); target.DamageHp(damage); if (target.Hp <= 0 && target is Enemy) { var pos = target.Position; target.Destroy(); yield return(EffectAnim.Dead(pos)); } }