Add right number of levels to remove.

(cherry picked from commit 1d0a682)
This commit is contained in:
Ebag333
2017-03-23 11:10:53 -07:00
parent 9df0ee9a1c
commit 1da15cfde3
2 changed files with 7 additions and 4 deletions

View File

@@ -3,7 +3,7 @@
import os
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..')))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..')))
# noinspection PyPackageRequirements
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata

View File

@@ -4,7 +4,7 @@ import math
import os
import sys
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..')))
sys.path.append(os.path.realpath(os.path.join(script_dir, '..', '..', '..')))
# noinspection PyPackageRequirements
from _development.helpers import DBInMemory as DB, Gamedata, Saveddata
@@ -21,18 +21,21 @@ def test_multiply_stacking_penalties(DB, Saveddata, RifterFit):
mod = Saveddata['Module'](DB['db'].getItem("EM Ward Amplifier II"))
item_modifer = mod.item.getAttribute("emDamageResistanceBonus")
RifterFit.calculateModifiedAttributes()
for _ in range(10):
# See: http://wiki.eveuniversity.org/Eve_Math#Stacking_Penalties
current_effectiveness = pow(0.5, (pow(0.45 * (_ - 1), 2)))
RifterFit.clear()
RifterFit.calculateModifiedAttributes()
if _ == 0:
# First run we have no modules, se don't try and calculate them.
calculated_resist = RifterFit.ship.getModifiedItemAttr("shieldEmDamageResonance")
else:
new_item_modifier = 1 + ((item_modifer * current_effectiveness) / 100)
calculated_resist = (em_resist * new_item_modifier)
RifterFit.clear()
RifterFit.modules.append(mod)
RifterFit.calculateModifiedAttributes()