Ticket #3973: capture.diff

File capture.diff, 876 bytes (added by fatherbushido, 8 years ago)

or mul

  • 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 *= cmpHealth.GetMaxHitpoints() / (0.1 * cmpHealth.GetMaxHitpoints() + 0.9 * cmpHealth.GetHitpoints());
    587587
    588588        let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership);
    589589        if (!cmpOwnership || cmpOwnership.GetOwner() == -1)
    590590            return;
    591591