all repos — Legends-RPG @ 8a2cd71823b2d268cca5ad5b0a908c0474c17d52

A fantasy mini-RPG built with Python and Pygame.

Brothers sidequest officially done and fully operational.
Justin Armstrong justinmeister@gmail.com
Mon, 19 May 2014 22:11:21 -0700
commit

8a2cd71823b2d268cca5ad5b0a908c0474c17d52

parent

05d9e3d3d1f5fd253dc04a612313eac3b634def0

M data/components/textbox.pydata/components/textbox.py

@@ -151,6 +151,12 @@ self.level.switch_to_battle = True

self.textbox = None self.last_textbox_timer = current_time self.reset_sprite_direction() + elif self.talking_sprite.name == 'oldmanbrother' and \ + self.game_data['talked to sick brother'] and \ + not self.game_data['has brother elixir']: + self.talking_sprite.item = 'ELIXIR' + self.game_data['has brother elixir'] = True + self.check_for_item() else: self.dialogue_reset() self.talking_sprite = None
M data/constants.pydata/constants.py

@@ -1,8 +1,8 @@

-"""Constants used throughout the game""" +#Constants used throughout the game SCREEN_SIZE = (800, 608) -##GAME STATES""" +##GAME STATES TOWN = 'town' MAIN_MENU = 'main menu'
M data/states/levels.pydata/states/levels.py

@@ -202,6 +202,9 @@ dialogue_list.append(property_dict['dialogue'+str(i)])

sprite.dialogue = dialogue_list if sprite.name == 'oldman': + quest_in_process_dialogue = ['Hurry to the NorthEast Shores!', + 'I do not have much time left.'] + if self.game_data['has brother elixir']: if self.game_data['elixir received']: sprite.dialogue = ['My good health is thanks to you.',

@@ -217,13 +220,40 @@ self.game_data['elixir received'] = True

dialogue = ['My good health is thanks to you.', 'I will be forever in your debt.'] self.reset_dialogue = sprite, dialogue + + elif self.game_data['talked to sick brother']: + sprite.dialogue = quest_in_process_dialogue + + elif not self.game_data['talked to sick brother']: + self.game_data['talked to sick brother'] = True + self.reset_dialogue = (sprite, quest_in_process_dialogue) elif sprite.name == 'oldmanbrother': if self.game_data['has brother elixir']: if self.game_data['elixir received']: sprite.dialogue = ['I am glad my brother is doing well.', - 'You have wise and generous spirit.'] + 'You have a wise and generous spirit.'] else: sprite.dialogue = ['Hurry! There is precious little time.'] + elif self.game_data['talked to sick brother']: + sprite.dialogue = ['My brother is sick?!?', + 'I have not seen him in years. I had no idea he was not well.', + 'Quick, take this ELIXIR to him immediately.'] + elif sprite.name == 'king': + retrieved_crown_dialogue = ['My crown! You recovered my stolen crown!!!', + 'I can not believe what I see before my eyes.', + 'You are truly a brave and noble warrior.', + 'Henceforth, I name thee Grand Protector of this Town!', + 'Go forth and be recognized.', + 'You are the greatest warrior this world has ever known.'] + thank_you_dialogue = ['Thank you for retrieving my crown.', + 'My kingdom is forever in you debt.'] + + if self.game_data['crown quest'] and not self.game_data['delivered crown']: + sprite.dialogue = retrieved_crown_dialogue + self.game_data['delivered crown'] = True + self.reset_dialogue = (sprite, thank_you_dialogue) + elif self.game_data['delivered crown']: + sprite.dialogue = thank_you_dialogue def check_for_opened_chest(self, sprite):
M data/tools.pydata/tools.py

@@ -210,11 +210,14 @@ 'treasure3': True,

'treasure4': True, 'treasure5': True, 'brother quest complete': False, + 'talked to sick brother': False, 'has brother elixir': False, 'elixir received': False, 'old man gift': '', 'battle type': '', - 'crown quest': False + 'crown quest': False, + 'delivered crown': False, + 'brother item': 'ELIXIR' } return data_dict
M resources/tmx/brotherhouse.tmxresources/tmx/brotherhouse.tmx

@@ -78,11 +78,11 @@ <object name="blocker" gid="120" x="240" y="112"/>

<object name="blocker" gid="120" x="256" y="112"/> <object name="sprite" type="oldmanbrother" gid="115" x="128" y="128"> <properties> - <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"/> + <property name="dialogue length" value="4"/> + <property name="dialogue0" value="Welcome to the NorthEast shores."/> + <property name="dialogue1" value="I spend my days in peaceful solitude brewing potions."/> + <property name="dialogue2" value="I have a brother in the town to the south who is quite the wizard."/> + <property name="dialogue3" value="You should tell him I said hello."/> </properties> </object> <object name="start point" gid="123" x="192" y="224">