Skip to content

Commit

Permalink
Keep maximum and minimum values that can be added/subtracted from the…
Browse files Browse the repository at this point in the history
… rock so plu/minGain doesn't exceed the value limit
  • Loading branch information
erodozer committed Dec 26, 2011
1 parent 5dbea1d commit 2375c38
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Scorekeeper.py
Expand Up @@ -322,8 +322,10 @@ def getScoreMultiplier(self):
_rockLo = _rockMax/3.0
_multHi = 4
_multBassHi = 6
_minBase = 400
_minBase = 400.0
_minMax = 900.0
_pluBase = 15
_pluMax = 750.0
_minGain = 2
_pluGain = 7

Expand All @@ -335,7 +337,6 @@ def __init__(self, instrument, coOp = None, battle = None):
self.percentage = .5
self.failing = False #is the player failing
self.inGreen = False #is the player in the top percentile
self.player = player #player/instrument this rockmeter belongs to
self.coOp = coOp #co-op type
self.battle = battle #battle
self.minusRock = _minBase #amount of rock to subtract when decreasing
Expand All @@ -356,16 +357,16 @@ def start(self):
def increaseRock(self, vScore = 0):

if not self.coOp:
if self.player.isVocal:
if self.instrument.isVocal:
rockPlusAmt = 500 + (500 * (vScore-2))
self.rock += rockPlusAmt
return

if self.instrument.isDrum:
self.drumStart = True

self.plusRock += _pluGain*self.mult
self.rock += self.plusRock*self.mult
self.plusRock = min(self.plusRock + _pluGain*self.mult, _pluMax)
self.rock += self.plusRock

self.minusRock = _minBase

Expand All @@ -375,7 +376,7 @@ def decreaseRock(self, more = False, less = False, vScore = 0):
rockMinusAmount = 0

if not self.coOp:
if self.player.isVocal:
if self.instrument.isVocal:
rockMinusAmount = 500 * (3 - vScore)
self.rock -= rockMinusAmount
return
Expand Down Expand Up @@ -413,7 +414,7 @@ def run(self):

if not self.coOp:
multMax = _multHi
if self.player.isBassGuitar:
if self.instrument.isBassGuitar:
multMax = _multBassHi
else:
multMax = _multHi
Expand Down

0 comments on commit 2375c38

Please sign in to comment.