IEnumerator attack(UnitBase from, UnitBase target, bool canFightBack) { yield return(DT_MoveTo(from, target)); if (target == null) { yield break; } if (from.triumph) { from.AddHP(1); } if (from.dualAttack) { yield return(DT_MoveTo(from, target)); } if (target.GetHP() > 0f && canFightBack) { target.Attack(from, true, false); } }
private void DoHeal(UnitBase Owner, UnitBase healer) { int delta = (int)(CurDelta + Owner.HP * CurPercent + Owner.MaxHP * BasePercent + (Owner.MaxHP - Owner.HP) * BaseDelta * 0.01f); Owner.AddHP(delta, healer); }