Return to repo list

heart-of-gold

Tactical RPG written in python, using pygame.
Return to HMagellan.com

commit ebf9d1c476922e8f41d85ccec7a207a8fc4ce5a0
parent 6639c20b8d8685a5c297af5d146720656ac014b4
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 26 Apr 2021 23:46:57 -0500

Post-battle summary mode delay

Diffstat:
Msrc/constants.py | 2+-
Msrc/interface.py | 7+++++++
Msrc/turn.py | 9++++++---
3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/constants.py b/src/constants.py @@ -90,7 +90,7 @@ OTHER_STATS = ["HP", "EXP", "LVL", "RNK"] # Enums STATE_MODES = enum.Enum('STATE_MODES', 'Main_Menu_Mode Base_Mode Battle_Mode Still_Scene_Mode') -CTRL_MODES = enum.Enum('CTRL_MODES', 'No_Control Main_Menu_Normal Base_Normal Base_Dialog Turn_Normal Turn_Select_Move Turn_Select_Attack Turn_Choose_Skill Turn_Choose_Item Turn_Select_Push Turn_Watch_Move Turn_Watch_Attack Turn_Display_Stats Turn_Watch_Guard Battle_Dialog Battle_Intro Battle_Resolve Still_Scene_Normal') +CTRL_MODES = enum.Enum('CTRL_MODES', 'No_Control Main_Menu_Normal Base_Normal Base_Dialog Turn_Normal Turn_Select_Move Turn_Select_Attack Turn_Choose_Skill Turn_Choose_Item Turn_Select_Push Turn_Watch_Move Turn_Watch_Attack Turn_Display_Stats Turn_Watch_Guard Battle_Dialog Battle_Intro Battle_Resolve Battle_Summary Still_Scene_Normal') FACE_DIR = enum.Enum('FACE_DIR', 'U D L R') GAME_EFFECTS = enum.Enum('GAME_EFFECTS', 'ef_game_dummy ef_game_quit ef_game_switch_mode ef_game_switch_control') MENU_EFFECTS = enum.Enum('MENU_EFFECTS', 'ef_menu_dummy') diff --git a/src/interface.py b/src/interface.py @@ -169,6 +169,13 @@ class GameInterface(subsystem.GameSubsystem): elif self.game.control_mode == CTRL_MODES.Battle_Dialog: self.bus.perform_click_current_scene() + # Battle summary situation + elif self.game.control_mode == CTRL_MODES.Battle_Summary: + # TODO: This should eventually involve clicking a continue button rather + # than just clicking at all. + self.game.switch_mode(STATE_MODES.Base_Mode, "testbase1") + self.bus.perform_piece_manager_reset_state() + # Still-scene mode behavior elif self.game.state_mode == STATE_MODES.Still_Scene_Mode: diff --git a/src/turn.py b/src/turn.py @@ -49,6 +49,7 @@ class TurnManager(manager.Manager): self.turn_depth = 10 self.board_events = {} self.winning_team = None + self.battle_resolution_timer = 0 # Interval graphics and values self.intro_timer = 0 @@ -89,6 +90,7 @@ class TurnManager(manager.Manager): self.turn_projection = [] self.former_candidates = [] self.current_turn = 1 + self.battle_resolution_timer = 120 # Create action buttons self.action_buttons.append(MoveActionButton(sheets["action_buttons_1"], (0, 0), None, False, self, 0)) @@ -374,9 +376,10 @@ class TurnManager(manager.Manager): surface.blit(self.intro_left_decal, self.intro_left_decal_topleft) surface.blit(self.intro_right_decal, self.intro_right_decal_topleft) elif self.game.control_mode == CTRL_MODES.Battle_Resolve: - # TODO: Should be a delay and animation, plus displaying post battle info like loot - self.game.switch_mode(STATE_MODES.Base_Mode, "testbase1") - self.bus.perform_piece_manager_reset_state() + if self.battle_resolution_timer > 0: + self.battle_resolution_timer -= 1 + else: + self.game.control_mode = CTRL_MODES.Battle_Summary ############################# # Section 2 - Turn Entities #