>>
|
64f780.jpg
Peach Bringer
64f780
>>87431
The way you would accomplish that is by making the character strip twice when they reach that stage. Let's say that there are 7 states of undress, and therefore 8 images (including the sitting down image), and therefore 9 lines of stripping dialogue (8+1 for the victory line). If they sit down after taking off an article of clothing for the 3rd time, that would be when the onTry variable is set to 3 (it starts at 0).
imageMessages would look like this:
imageMessages = ["1st article","2nd","3rd","sitting down now","4th","5th","6th","7th","you win"]
And you would replace checkImage() with this:
def checkImage(self,isChar,onTry,tries,winner,playerName,setMoney):
msgs = False
if self.money <= 0 and winner != -1:
onTry += 1
if isChar or self.name != playerName:
msgs = [Message(self.name,self.imageMessages[onTry-1],["strip"],{},"strip",["strip"])]
if onTry == 3:
msgs.append(Message(self.name,self.imageMessages[onTry-1],["strip"],{},"strip",["strip"]))
else:
msgs = "player"
if onTry == tries:
if isChar or self.name != playerName:
msgs.append(Message(self.name,self.imageMessages[onTry],["game_over"],{},"game_over",["game_over"]))
print(self.name+" lost. PROMOTIONS!")
else:
self.money = setMoney+self.owed
print(self.name+" defaulted and had to take out a loan. "+str(setMoney)+"-"+str(math.fabs(self.owed))+"="+str(self.money))
self.owed = 0
return msgs
However, you'll have to change __init__.py to set maxTries to 7, otherwise the player will get 8 chances, and the character will only get 7, because one of them is skipped.
No worries about breaking the bank -- the game will only lend them money once even though they're technically losing twice, because it's tied purely to how much money they have and not what image they're on.
You can do this as many times as you like, just so long as you reference the right number for onTry. Remember that after they sit down, they'll be on try #5, rather than #4, even though they were on #3 before they lost.
|