public override void ApplyDamage(int damage, CEnum.EAttackType damageType) { base.ApplyDamage(damage, damageType); m_BattleComponent.ApplyDamage(damage, damageType); var health = 0; if (m_BattleComponent.CalculateHealth(this.GetCurrentHealth(), out health)) { SetCurrentHealth(health); } }
public void ApplyDamage(int damage, CEnum.EAttackType damageType) { switch (damageType) { default: case CEnum.EAttackType.Pure: m_TotalDamage += damage; break; case CEnum.EAttackType.Physic: m_TotalPhysicDamage += damage - m_Target.GetPhysicDefend(); m_TotalPhysicDamage = Mathf.Max(1, m_TotalPhysicDamage); break; case CEnum.EAttackType.Magic: m_TotalMagicDamage += damage - m_Target.GetMagicDefend(); m_TotalMagicDamage = Mathf.Max(1, m_TotalMagicDamage); break; } }
public virtual void ApplyDamage(int damage, CEnum.EAttackType damageType) { }