Can receive elixir.
Justin Armstrong justinmeister@gmail.com
Tue, 06 May 2014 19:54:07 -0700
3 files changed,
14 insertions(+),
7 deletions(-)
M
data/battlegui.py
→
data/battlegui.py
@@ -65,8 +65,8 @@ allowed_item_list = ['Healing Potion', 'Ether Potion']
title = 'SELECT ITEM' item_text_list = [title] - for item in inventory: - if item in allowed_item_list: + for item in allowed_item_list: + if item in inventory: text = item + ": " + str(inventory[item]['quantity']) item_text_list.append(text)
M
data/components/textbox.py
→
data/components/textbox.py
@@ -190,7 +190,7 @@ self.game_data['player inventory'][item]['quantity'] += 1
else: self.add_new_item_to_inventory(item) - self.update_game_items_info(self.talking_sprite.id) + self.update_game_items_info(self.talking_sprite) self.talking_sprite.item = None if self.talking_sprite.name == 'king':@@ -202,14 +202,20 @@ self.talking_sprite.dialogue = ['Empty.']
def add_new_item_to_inventory(self, item): inventory = self.game_data['player inventory'] - if item == 'Healing Potion': - inventory[item] = dict([('quantity',5), + potions = ['Healing Potion', 'Ether Potion'] + if item in potions: + inventory[item] = dict([('quantity',1), ('value',15)]) + elif item == 'ELIXIR': + inventory[item] = dict([('quantity',1)]) else: pass - def update_game_items_info(self, id): - self.game_data['treasure{}'.format(id)] = False + def update_game_items_info(self, sprite): + if sprite.name == 'treasurechest': + self.game_data['treasure{}'.format(sprite.id)] = False + elif sprite.name == 'oldmanbrother': + self.game_data['brother elixir'] = False def reset_sprite_direction(self): """Reset sprite to default direction"""
M
resources/tmx/brotherhouse.tmx
→
resources/tmx/brotherhouse.tmx
@@ -82,6 +82,7 @@ <property name="dialogue length" value="3"/>
<property name="dialogue0" value="My brother is sick?!?"/> <property name="dialogue1" value="I haven't seen him in years. I had no idea he was not well."/> <property name="dialogue2" value="Quick, take this ELIXIR to him immediately."/> + <property name="item" value="ELIXIR"/> </properties> </object> <object name="start point" gid="123" x="192" y="224">