Improving player menu.
Justin Armstrong justinmeister@gmail.com
Sat, 24 May 2014 14:29:20 -0700
6 files changed,
59 insertions(+),
59 deletions(-)
M
data/battlegui.py
→
data/battlegui.py
@@ -408,7 +408,7 @@ Basic health meter for player.
""" def __init__(self, select_box_rect, game_data): self.health_stats = game_data['player stats']['health'] - self.magic_stats = game_data['player stats']['magic points'] + self.magic_stats = game_data['player stats']['magic'] self.title_font = pg.font.Font(setup.FONTS[c.MAIN_FONT], 22) self.posx = select_box_rect.centerx self.posy = select_box_rect.y - 5
M
data/constants.py
→
data/constants.py
@@ -35,9 +35,7 @@ RED = 255, 0, 0
GREEN = 0, 255, 0 PINK = 208, 32, 144 - MAIN_FONT = 'DroidSans' - #BATTLE STATES
M
data/shopgui.py
→
data/shopgui.py
@@ -298,7 +298,7 @@ power = item['power']
magic_list = ['Cure', 'Fire Blast'] player_items = self.level.game_data['player inventory'] player_health = self.level.game_data['player stats']['health'] - player_magic = self.level.game_data['player stats']['magic points'] + player_magic = self.level.game_data['player stats']['magic'] item_to_add = {'quantity': quantity, 'value': value,
M
data/states/battle.py
→
data/states/battle.py
@@ -194,11 +194,11 @@ elif self.state == c.SELECT_MAGIC:
if self.arrow.index == (len(self.arrow.pos_list) - 1): self.enter_select_action_state() elif self.info_box.magic_text_list[self.arrow.index] == 'Cure': - if self.game_data['player stats']['magic points']['current'] >= 25: + if self.game_data['player stats']['magic']['current'] >= 25: self.player_actions.append(c.CURE_SPELL) self.action_selected = True elif self.info_box.magic_text_list[self.arrow.index] == 'Fire Blast': - if self.game_data['player stats']['magic points']['current'] >= 25: + if self.game_data['player stats']['magic']['current'] >= 25: self.player_actions.append(c.FIRE_SPELL) self.action_selected = True@@ -280,7 +280,7 @@ player_stats['experience to next level'] -= self.experience_points
if player_stats['experience to next level'] <= 0: player_stats['Level'] += 1 player_stats['health']['maximum'] += int(player_stats['health']['maximum']*.25) - player_stats['magic points']['maximum'] += int(player_stats['magic points']['maximum']*.20) + player_stats['magic']['maximum'] += int(player_stats['magic']['maximum']*.20) new_experience = int((player_stats['Level'] * 100) * .75) player_stats['experience to next level'] = new_experience self.enter_level_up_state()@@ -373,13 +373,13 @@ self.game_data['player inventory']['Healing Potion']['quantity'] -= 1
if self.game_data['player inventory']['Healing Potion']['quantity'] == 0: del self.game_data['player inventory']['Healing Potion'] elif self.state == c.CURE_SPELL: - self.game_data['player stats']['magic points']['current'] -= magic_points + self.game_data['player stats']['magic']['current'] -= magic_points def magic_boost(self, magic_points): """ Add magic from ether to game data. """ - magic = self.game_data['player stats']['magic points'] + magic = self.game_data['player stats']['magic'] magic['current'] += magic_points if magic['current'] > magic['maximum']: magic['current'] = magic['maximum']@@ -398,8 +398,8 @@ Cast fire blast on all enemies.
""" self.state = self.info_box.state = c.FIRE_SPELL POWER = self.inventory['Fire Blast']['power'] - MAGIC_POINTS = self.inventory['Fire Blast']['magic points'] - self.game_data['player stats']['magic points']['current'] -= MAGIC_POINTS + MAGIC_POINTS = self.inventory['Fire Blast']['magic'] + self.game_data['player stats']['magic']['current'] -= MAGIC_POINTS for enemy in self.enemy_list: DAMAGE = random.randint(POWER//2, POWER) self.damage_points.add(
M
data/tools.py
→
data/tools.py
@@ -194,7 +194,7 @@
player_stats = {'health': player_health, 'Level': 2, 'experience to next level': 20, - 'magic points': player_magic, + 'magic': player_magic, 'attack points': 10, 'Defense Points': 10}