Added stats to menu screen
Justin Armstrong justinmeister@gmail.com
Tue, 01 Apr 2014 10:25:45 -0700
7 files changed,
60 insertions(+),
13 deletions(-)
M
data/constants.py
→
data/constants.py
@@ -25,7 +25,7 @@ LIGHT_BLUE = (0, 153, 204)
DARK_RED = (118, 27, 12) -MAIN_FONT = 'DroidSerif' +MAIN_FONT = 'DroidSans'
M
data/shopgui.py
→
data/shopgui.py
@@ -289,6 +289,8 @@ item_type = item['type']
quantity = item['quantity'] value = item['price'] 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'] item_to_add = {'quantity': quantity, 'value': value}@@ -297,6 +299,9 @@ if item_type in player_items:
player_items[item_type]['quantity'] += quantity elif quantity > 0: player_items[item_type] = item_to_add + elif item_type == 'room': + player_health['current'] = player_health['maximum'] + player_magic['current'] = player_magic['maximum'] def confirm_sell(self, keys, current_time):
M
data/states/town/town.py
→
data/states/town/town.py
@@ -18,11 +18,12 @@ def set_sprite_dialogue(self):
"""Sets unique dialogue for each sprite""" for sprite in self.sprites: if sprite.location == [9, 46]: - sprite.dialogue = ['Welcome to our town, Mr. Traveller!', - 'The King is loved by all!', - 'You should go visit him in his castle.'] + sprite.dialogue = ['Welcome to our town, traveller!', + 'Our King protects us against the evil forces of the outside world.', + 'As long as we never leave, we have nothing to fear!'] elif sprite.location == [15, 41]: - sprite.dialogue = ['You seem tired, why not rest at our Inn?'] + sprite.dialogue = ['You seem tired from your travels.', + 'Why not rest at our Inn and stay awhile?'] sprite.begin_auto_resting() elif sprite.location == [13, 13]: sprite.dialogue = ['Be careful. There are monsters surrounding our town.',@@ -34,7 +35,8 @@ 'Perhaps you should pay him a visit.']
elif sprite.location == [10, 7]: sprite.dialogue = ['Welcome to the castle, citizen.'] elif sprite.location == [13, 7]: - sprite.dialogue = ['Move along.'] + sprite.dialogue = ['Only those given special permission by the King can leave this town.', + 'It is for our own good, as few could survive in the outside world.'] elif sprite.location == [18, 27]: sprite.dialogue = ["Don't be frightened. I'm a friendly Demon.", "My brothers and sisters, however, are not so nice.",
M
data/tools.py
→
data/tools.py
@@ -154,6 +154,19 @@ """Create a dictionary of persistant values the player
carries between states""" player_items = {'gold': 100} + player_health = {'current': 100, + 'maximum': 100} + + player_magic = {'current': 100, + 'maximum': 100} + + player_stats = {'Health': player_health, + 'Level': 1, + 'Experience to next level': 100, + 'Magic Points': player_magic, + 'Attack Points': 10, + 'Defense Points': 10} + data_dict = {'last location': None, 'last state': None,@@ -162,7 +175,8 @@ 'town start pos': [12, 49],
'castle start pos': [12, 26], 'house start pos': [12, 13], 'king item': {'gold': 500}, - 'player inventory': player_items + 'player inventory': player_items, + 'player stats': player_stats } return data_dict