comparison pytouhou/game/item.py @ 198:13918723d1bc

Modify difficulty when it has to.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 30 Oct 2011 11:31:19 -0700
parents e1bc8c4cbb1a
children d07506a2e16e
comparison
equal deleted inserted replaced
197:e1bc8c4cbb1a 198:13918723d1bc
73 score = (bonus - 17) * 1000 73 score = (bonus - 17) * 1000
74 elif bonus == 30: 74 elif bonus == 30:
75 score = 51200 75 score = 51200
76 player_state.power_bonus = bonus 76 player_state.power_bonus = bonus
77 player_state.score += score 77 player_state.score += score
78 self._game.modify_difficulty(+1)
78 79
79 elif self._type == 1: # point 80 elif self._type == 1: # point
80 player_state.points += 1 81 player_state.points += 1
81 if player_state.y < 128: #TODO: find the exact poc. 82 if player_state.y < 128: #TODO: find the exact poc.
82 score = 100000 83 score = 100000
84 self._game.modify_difficulty(+30)
83 else: 85 else:
84 score = 0 #TODO: find the formula. 86 score = 0 #TODO: find the formula.
87 self._game.modify_difficulty(+3)
85 player_state.score += score 88 player_state.score += score
86 89
87 elif self._type == 3: # bomb 90 elif self._type == 3: # bomb
88 if player_state.bombs < 8: 91 if player_state.bombs < 8:
89 player_state.bombs += 1 92 player_state.bombs += 1
93 self._game.modify_difficulty(+5)
90 94
91 elif self._type == 4: # full power 95 elif self._type == 4: # full power
92 player_state.score += 1000 96 player_state.score += 1000
93 player_state.power = 128 97 player_state.power = 128
94 98
95 elif self._type == 5: # 1up 99 elif self._type == 5: # 1up
96 if player_state.lives < 8: 100 if player_state.lives < 8:
97 player_state.lives += 1 101 player_state.lives += 1
102 self._game.modify_difficulty(+200)
98 103
99 elif self._type == 6: # star 104 elif self._type == 6: # star
100 player_state.score += 500 105 player_state.score += 500
101 106
102 if old_power < 128 and player_state.power >= 128: 107 if old_power < 128 and player_state.power >= 128: