From 370e34cff90ea161b1fac236de63a3c8e66ace13 Mon Sep 17 00:00:00 2001 From: Steven Barker Date: Mon, 30 Mar 2015 20:22:57 -0700 Subject: [PATCH 1/2] Make staggerred modules with ammo work --- eos/capSim.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/eos/capSim.py b/eos/capSim.py index 90734d8e1..68e0dae29 100644 --- a/eos/capSim.py +++ b/eos/capSim.py @@ -82,18 +82,23 @@ class CapSimulator(object): if self.scale: duration, capNeed = self.scale_activation(duration, capNeed) - if self.stagger: - duration = int(duration/amount) - else: - capNeed *= amount - - period = lcm(period, duration) - # set clipSize to infinite if reloads are disabled unless it's # a cap booster module. if not self.reload and capNeed > 0: clipSize = 0 + if self.stagger: + if clipSize == 0: + duration = int(duration/amount) + else: + stagger_amount = (duration*clipsize+10000)/amount + for i in range(1, amount): + heapq.heappush(self.state, [i*stagger_amount, duration, capNeed, 0, clipSize]) + else: + capNeed *= amount + + period = lcm(period, duration) + # period optimization doesn't work when reloads are active. if clipSize: disable_period = True From cb1de9589ebfbfbeee9129814d7d43c6f692bdb3 Mon Sep 17 00:00:00 2001 From: Steven Barker Date: Tue, 31 Mar 2015 12:09:27 -0700 Subject: [PATCH 2/2] fix typo, pick a better stagger amount --- eos/capSim.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eos/capSim.py b/eos/capSim.py index 68e0dae29..0057e48cb 100644 --- a/eos/capSim.py +++ b/eos/capSim.py @@ -91,9 +91,11 @@ class CapSimulator(object): if clipSize == 0: duration = int(duration/amount) else: - stagger_amount = (duration*clipsize+10000)/amount + stagger_amount = (duration*clipSize+10000)/(amount*clipSize) for i in range(1, amount): - heapq.heappush(self.state, [i*stagger_amount, duration, capNeed, 0, clipSize]) + heapq.heappush(self.state, + [i*stagger_amount, duration, + capNeed, 0, clipSize]) else: capNeed *= amount