thankforpie Posted January 6, 2019 Report Share Posted January 6, 2019 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? Quote Link to comment Share on other sites More sharing options...
nani Posted January 6, 2019 Report Share Posted January 6, 2019 (edited) 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 January 6, 2019 by nani 3 Quote Link to comment Share on other sites More sharing options...
FeXoR Posted January 6, 2019 Report Share Posted January 6, 2019 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). 2 Quote Link to comment Share on other sites More sharing options...
thankforpie Posted January 6, 2019 Author Report Share Posted January 6, 2019 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.