Ticket #3973: capture2.diff

File capture2.diff, 844 bytes (added by fatherbushido, 8 years ago)

with division

  • binaries/data/mods/public/simulation/components/Attack.js

    Attack.prototype.PerformAttack = functio  
    581581    {
    582582        let multiplier = this.GetAttackBonus(type, target);
    583583        let cmpHealth = Engine.QueryInterface(target, IID_Health);
    584584        if (!cmpHealth || cmpHealth.GetHitpoints() == 0)
    585585            return;
    586         multiplier *= cmpHealth.GetMaxHitpoints() / cmpHealth.GetHitpoints();
     586        multiplier /= 0.1 + 0.9 * cmpHealth.GetHitpoints() / cmpHealth.GetMaxHitpoints();
    587587
    588588        let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
    589589        if (!cmpOwnership || cmpOwnership.GetOwner() == -1)
    590590            return;
    591591