protected IEnumerator Hit(BoardCreator board, UnitStats target, Tile source) { if (data.Damage > 0) { target.TakeDamage(unit.GetComponent <UnitStats>().GetAttack(board, data)); } if (data.Heal > 0) { target.Heal(data.Heal); } if (!target.IsDead()) { if (data.hasKnockback && target.GetComponent <Unit>().KnockbackAble()) { Point direction = source.pos - target.GetComponent <Unit>().tile.pos; yield return(StartCoroutine(target.ApplyKnockback(board, direction))); } if (data.status != StatusEffects.NONE) { target.AddStatus(data.status); } } }
public void Heal(float healAmount, UnitStats healTarget) { if (healTarget != null) { healTarget.Heal(healAmount); } }
public void Heal(float healAmount, UnitStats healTarget) { if (healTarget != null) { Debug.Log("Applying Heal"); healTarget.Heal(healAmount); } }
public virtual void HitTarget(GameObject target) { // Debug.Log("hit: " + target.name); statController.DealDamage(target, currentSkill.Amount); statController.Heal(currentSkill.HealthOnHit); statController.BleedTarget(target, currentSkill.Bleed); statController.GainEnergy(currentSkill.EnergyOnHit); }