Fixed a bug with the kings dialogue
Justin Armstrong justinmeister@gmail.com
Mon, 16 Jun 2014 13:04:09 -0700
4 files changed,
32 insertions(+),
27 deletions(-)
M
data/components/textbox.py
→
data/components/textbox.py
@@ -155,7 +155,7 @@ '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'] + elif (self.game_data['crown quest'] and not self.game_data['delivered crown']): retrieved_crown_dialogue = ['My crown! You recovered my stolen crown!!!', 'I can not believe what I see before my eyes.',@@ -163,6 +163,7 @@ '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.'] + self.game_data['talked to king'] = True self.talking_sprite.dialogue = retrieved_crown_dialogue self.game_data['delivered crown'] = True self.end_dialogue(current_time)
M
data/states/battle.py
→
data/states/battle.py
@@ -384,6 +384,7 @@ End battle and flip back to previous state.
""" if self.game_data['battle type'] == 'evilwizard': self.game_data['crown quest'] = True + self.game_data['talked to king'] = True self.game_data['last state'] = self.name self.game_data['battle counter'] = random.randint(50, 255) self.game_data['battle type'] = None
M
data/states/levels.py
→
data/states/levels.py
@@ -28,38 +28,16 @@ self.tmx_map = setup.TMX[name]
self.allow_battles = battles self.music_title = None self.previous_music = None - self.music, self.volume = self.set_music() + self.music = None + self.volume = None self.portal = None - - def set_music(self): - """ - Set music based on name. - """ - music_dict = {c.TOWN: ('town_theme', .4), - c.OVERWORLD: ('overworld', .4), - c.CASTLE: ('kings_theme', .4), - c.DUNGEON: ('dungeon_theme', .4), - c.DUNGEON2: ('dungeon_theme', .4), - c.DUNGEON3: ('dungeon_theme', .4), - c.DUNGEON4: ('dungeon_theme', .4), - c.DUNGEON5: ('dungeon_theme', .4), - c.HOUSE: ('pleasant_creek', .1), - c.BROTHER_HOUSE: ('pleasant_creek', .1)} - - - if self.name in music_dict: - music = music_dict[self.name][0] - volume = music_dict[self.name][1] - self.music_title = music - return setup.MUSIC[music], volume - else: - return None, None def startup(self, current_time, game_data): """ Call when the State object is flipped to. """ self.game_data = game_data + self.music, self.volume = self.set_music() self.current_time = current_time self.state = 'transition_in' self.reset_dialogue = ()@@ -88,6 +66,32 @@ self.state_dict = self.make_state_dict()
self.menu_screen = player_menu.Player_Menu(game_data, self) self.transition_rect = setup.SCREEN.get_rect() self.transition_alpha = 255 + + def set_music(self): + """ + Set music based on name. + """ + music_dict = {c.TOWN: ('town_theme', .4), + c.OVERWORLD: ('overworld', .4), + c.CASTLE: ('kings_theme', .4), + c.DUNGEON: ('dungeon_theme', .4), + c.DUNGEON2: ('dungeon_theme', .4), + c.DUNGEON3: ('dungeon_theme', .4), + c.DUNGEON4: ('dungeon_theme', .4), + c.DUNGEON5: ('dungeon_theme', .4), + c.HOUSE: ('pleasant_creek', .1), + c.BROTHER_HOUSE: ('pleasant_creek', .1)} + + if self.game_data['crown quest'] and self.name == c.TOWN: + self.music_title = 'kings_theme' + return setup.MUSIC['kings_theme'], .4 + elif self.name in music_dict: + music = music_dict[self.name][0] + volume = music_dict[self.name][1] + self.music_title = music + return setup.MUSIC[music], volume + else: + return None, None def make_viewport(self, map_image): """
M
resources/tmx/overworld.tmx
→
resources/tmx/overworld.tmx
@@ -187,7 +187,6 @@ <object name="blocker" gid="120" x="336" y="592"/>
<object name="blocker" gid="120" x="368" y="592"/> <object name="blocker" gid="120" x="384" y="592"/> <object name="blocker" gid="120" x="368" y="496"/> - <object name="blocker" gid="120" x="384" y="496"/> <object name="blocker" gid="120" x="400" y="464"/> <object name="blocker" gid="120" x="416" y="464"/> <object name="blocker" gid="120" x="432" y="464"/>