Jump to content

Damage formula


thankforpie
 Share

Recommended Posts

Whats the damage formula?

is it, for example:

skirmishers have:

- 50 hp

- 16 pierce attack

- 1 pierce armor

so skirmisher attacks other skirmisher for 16 - 1 (dmg - armor) = 15 therefore on every hit skirmisher loses 15 hp ?

 

or theres some other formula for damage?

Link to comment
Share on other sites

With a quick lookup

If ranged:

/**
* Take damage according to the entity's armor.
* @param {Object} strengths - { "hack": number, "pierce": number, "crush": number } or something like that.
* @param {number} multiplier - the damage multiplier.
* Returns object of the form { "killed": false, "change": -12 }.
*/
Armour.prototype.TakeDamage = function(strengths, multiplier = 1)
{
    if (this.invulnerable)
        return { "killed": false, "change": 0 };
 
    // Adjust damage values based on armour; exponential armour: damage = attack * 0.9^armour
    var armourStrengths = this.GetArmourStrengths();
 
    // Total is sum of individual damages
    // Don't bother rounding, since HP is no longer integral.
    var total = 0;
    for (let type in strengths)
        total += strengths[type] * multiplier * Math.pow(0.9, armourStrengths[type] || 0);
 
    // Reduce health
    var cmpHealth = Engine.QueryInterface(this.entity, IID_Health);
    return cmpHealth.Reduce(total);
};

strengths[type] *multiplier *(0.9^armourStrengths)

Edited by nani
  • Like 3
Link to comment
Share on other sites

If you select a unit and hover the mouse over the sword and shield icon you can see the armor values of that unit for each damage types (hack, pierce and slash) and the corresponding rounded relative damage reduction in % (1/100) behind that in brackets.

Considering a unit is hit the damage formula that is calculated here is:

[current health reduction of attacked unit] = [damage of attacking unit] * 0.9^[armor of attacked unit]

So the damage reduction shown in the game is: round(0.9^[armor of shown unit] / 100).

  • Like 2
Link to comment
Share on other sites

5 hours ago, FeXoR said:

If you select a unit and hover the mouse over the sword and shield icon you can see the armor values of that unit for each damage types (hack, pierce and slash) and the corresponding rounded relative damage reduction in % (1/100) behind that in brackets.

Considering a unit is hit the damage formula that is calculated here is:

[current health reduction of attacked unit] = [damage of attacking unit] * 0.9^[armor of attacked unit]

So the damage reduction shown in the game is: round(0.9^[armor of shown unit] / 100).

yeah i already calculated using nani's formula. but I didnt know that theres number showed in brackets. will help a lot lol. thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...