public void takeDamage(float phDamage, float maDamage) { float totalDamage = 0; totalDamage += damageModule.phDamageReduction(phDamage, damageModule.getAttribute(Attribute.PhysicalDefense)); totalDamage += damageModule.maDamageReduction(maDamage, damageModule.getAttribute(Attribute.MagicalDefense)); healthBar.takeDamage(totalDamage, health); audioSource.PlayOneShot(hitSound); }
public void addPoints(Image actionMeter, Image health) { if (!GAME_OVER) { float points = POINTS_RATE * (damageModule.getAttribute(Attribute.Speed)) * SPEED_MODIFIER * attackSpeed; actionPoints.addPoints(points); if (actionPoints.isKO() && actionPoints.isReady()) { revive(actionMeter, health); } } }