Ticket #3973: capture2.diff
File capture2.diff, 844 bytes (added by , 8 years ago) |
---|
-
binaries/data/mods/public/simulation/components/Attack.js
Attack.prototype.PerformAttack = functio 581 581 { 582 582 let multiplier = this.GetAttackBonus(type, target); 583 583 let cmpHealth = Engine.QueryInterface(target, IID_Health); 584 584 if (!cmpHealth || cmpHealth.GetHitpoints() == 0) 585 585 return; 586 multiplier *= cmpHealth.GetMaxHitpoints() / cmpHealth.GetHitpoints();586 multiplier /= 0.1 + 0.9 * cmpHealth.GetHitpoints() / cmpHealth.GetMaxHitpoints(); 587 587 588 588 let cmpOwnership = Engine.QueryInterface(this.entity, IID_Ownership); 589 589 if (!cmpOwnership || cmpOwnership.GetOwner() == -1) 590 590 return; 591 591