Skip to content

Commit

Permalink
Add right number of levels to remove.
Browse files Browse the repository at this point in the history
(cherry picked from commit 1d0a682)
  • Loading branch information
Ebag333 committed Mar 24, 2017
1 parent 9df0ee9 commit 1da15cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_modules/test_eos/test_gamedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions tests/test_modules/test_eos/test_modifiedAttributeDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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
Expand All @@ -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()

Expand Down

0 comments on commit 1da15cf

Please sign in to comment.