all repos — Legends-RPG @ 771a9169fe092728fcd9519c5a9f76f2fd9cb035

A fantasy mini-RPG built with Python and Pygame.

Minor dialogue changes.
Justin Armstrong justinmeister@gmail.com
Mon, 02 Jun 2014 22:21:09 -0700
commit

771a9169fe092728fcd9519c5a9f76f2fd9cb035

parent

46298b7559a64ba4be11d3fb68bc23cae32b124e

5 files changed, 54 insertions(+), 23 deletions(-)

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

@@ -148,6 +148,13 @@ else:

self.end_dialogue(current_time) elif self.talking_sprite.name == 'king': + if not self.game_data['talked to king']: + self.game_data['talked to king'] = True + new_dialogue = ['Hurry to the castle in the NorthWest!', + 'The sorceror who lives there has my crown.', + 'Please retrieve it for me.'] + self.talking_sprite.dialogue = new_dialogue + self.end_dialogue(current_time) if (self.game_data['crown quest'] and not self.game_data['delivered crown']): retrieved_crown_dialogue = ['My crown! You recovered my stolen crown!!!',

@@ -217,7 +224,10 @@

if item: if item in self.game_data['player inventory']: if 'quantity' in self.game_data['player inventory'][item]: - self.game_data['player inventory'][item]['quantity'] += 1 + if item == 'GOLD': + self.game_data['player inventory'][item]['quantity'] += 100 + else: + self.game_data['player inventory'][item]['quantity'] += 1 else: self.add_new_item_to_inventory(item)
M data/menugui.pydata/menugui.py

@@ -14,8 +14,11 @@ #Python 2/3 compatibility.

if sys.version_info[0] == 2: range = xrange + class SmallArrow(pg.sprite.Sprite): - """Small arrow for menu""" + """ + Small arrow for menu. + """ def __init__(self, info_box): super(SmallArrow, self).__init__() self.image = setup.GFX['smallarrow']

@@ -26,7 +29,9 @@ self.slots = info_box.slots

self.pos_list = [] def make_state_dict(self): - """Make state dictionary""" + """ + Make state dictionary. + """ state_dict = {'selectmenu': self.navigate_select_menu, 'itemsubmenu': self.navigate_item_submenu, 'magicsubmenu': self.navigate_magic_submenu}

@@ -34,7 +39,9 @@

return state_dict def navigate_select_menu(self, pos_index): - """Nav the select menu""" + """ + Nav the select menu. + """ self.pos_list = self.make_select_menu_pos_list() self.rect.topleft = self.pos_list[pos_index]

@@ -44,7 +51,9 @@ self.pos_list = self.make_item_menu_pos_list()

self.rect.topleft = self.pos_list[pos_index] def navigate_magic_submenu(self, pos_index): - """Nav the magic submenu""" + """ + Nav the magic submenu. + """ self.pos_list = self.make_magic_menu_pos_list() self.rect.topleft = self.pos_list[pos_index]

@@ -58,7 +67,9 @@

return pos_list def make_select_menu_pos_list(self): - """Make the list of possible arrow positions""" + """ + Make the list of possible arrow positions. + """ pos_list = [] for i in range(3):

@@ -68,7 +79,9 @@

return pos_list def make_item_menu_pos_list(self): - """Make the list of arrow positions in the item submenu""" + """ + Make the list of arrow positions in the item submenu. + """ pos_list = [(300, 173), (300, 223), (300, 323),

@@ -81,12 +94,15 @@

return pos_list def update(self, pos_index): - """Update arrow position""" + """ + Update arrow position. + """ state_function = self.state_dict[self.state] state_function(pos_index) def draw(self, surface): - """Draw to surface""" + """ + Draw to surface""" surface.blit(self.image, self.rect)
M data/states/levels.pydata/states/levels.py

@@ -180,6 +180,11 @@ battle = properties['battle']

else: battle = None + if 'state' in properties: + sprite_state = properties['state'] + else: + sprite_state = None + x = properties['x'] * 2 y = ((properties['y']) * 2) - 32

@@ -204,11 +209,17 @@ 'evilwizard': person.Person('evilwizard', x, y, direction),

'treasurechest': person.Chest(x, y, id)} sprite = sprite_dict[properties['type']] + if sprite_state: + sprite.state = sprite_state + if sprite.name == 'oldman': if self.game_data['old man gift'] and not self.game_data['elixir received']: sprite.item = self.game_data['old man gift'] else: sprite.item = item + elif sprite.name == 'king': + if not self.game_data['talked to king']: + sprite.item = self.game_data['king item'] else: sprite.item = item sprite.battle = battle
M data/tools.pydata/tools.py

@@ -217,8 +217,7 @@

data_dict = {'last location': None, 'last state': None, 'last direction': 'down', - 'king item': {'GOLD': dict([('quantity', 100), - ('value',0)])}, + 'king item': 'GOLD', 'old man item': {'ELIXIR': dict([('value',1000), ('quantity',1)])}, 'player inventory': player_items,

@@ -229,6 +228,7 @@ 'treasure2': True,

'treasure3': True, 'treasure4': True, 'treasure5': True, + 'talked to king': False, 'brother quest complete': False, 'talked to sick brother': False, 'has brother elixir': False,
M resources/tmx/town.tmxresources/tmx/town.tmx

@@ -380,16 +380,16 @@ </object>

<object name="sprite" type="soldier" gid="124" x="160" y="224"> <properties> <property name="dialogue length" value="2"/> - <property name="dialogue0" value="Only those given special permission by the King can leave this town."/> - <property name="dialogue1" value="It is for our own good, as few could survive in the outside world."/> + <property name="dialogue0" value="The castle to the NorthWest is very dangerous."/> + <property name="dialogue1" value="Make sure to buy a Long Sword before attempting to enter it."/> </properties> </object> <object name="sprite" type="soldier" gid="124" x="208" y="224"> <properties> - <property name="dialogue length" value="3"/> - <property name="dialogue0" value="Be careful. There are monsters surrounding our town."/> - <property name="dialogue1" value="Make sure to equip sufficient armor and weapons."/> - <property name="dialogue2" value="Spells and potions are useful too."/> + <property name="" value=""/> + <property name="dialogue length" value="2"/> + <property name="dialogue0" value="Armor is important to protect you from monsters."/> + <property name="dialogue1" value="The Armor Shop sells excellent shields and chain mail."/> </properties> </object> <object name="portal" type="castle" gid="139" x="176" y="112"/>

@@ -416,11 +416,5 @@ <object name="blocker" gid="120" x="144" y="784"/>

<object name="blocker" gid="120" x="128" y="784"/> <object name="blocker" gid="120" x="112" y="768"/> <object name="blocker" gid="120" x="112" y="752"/> - <object name="sprite" type="soldier" gid="124" x="112" y="576"> - <properties> - <property name="dialogue length" value="1"/> - <property name="dialogue0" value="Hey, there."/> - </properties> - </object> </objectgroup> </map>