commit 4ed06e6fc8b3465f0dc946b7df0aca7c9a00191a
parent 03abaa0a5dc0bcf4ef97fc80f436ecaecac53a5f
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Tue, 29 Dec 2020 20:39:26 -0600
added teams enum with more icons and pass on enemy turn
Diffstat:
5 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/data/img/team_indicator_small_1.png b/data/img/team_indicator_small_1.png
Binary files differ.
diff --git a/data/json/sheets.json b/data/json/sheets.json
@@ -233,7 +233,7 @@
"team_indicator_small_1" : {
"filename" : "team_indicator_small_1.png",
"dimensions" : [12, 12],
- "total_sprites" : 2,
+ "total_sprites" : 6,
"anim_class" : null,
"alpha" : false
},
diff --git a/src/constants.py b/src/constants.py
@@ -92,6 +92,7 @@ STATE_MODES = enum.Enum('STATE_MODES', 'Main_Menu_Mode Battle_Mode Still_Scene_M
CTRL_MODES = enum.Enum('CTRL_MODES', 'No_Control Main_Menu_Normal Turn_Normal Turn_Select_Move Turn_Select_Attack Turn_Watch_Move Turn_Watch_Attack Turn_Display_Stats Turn_Watch_Guard Battle_Dialog Battle_Intro Still_Scene_Normal')
FACE_DIR = enum.Enum('FACE_DIR', 'U D L R')
GAME_EFFECTS = enum.Enum('GAME_EFFECTS', 'ef_game_quit ef_game_switch_mode ef_game_switch_control')
+TEAMS = enum.Enum('TEAMS', 'Player Ally Neutral Enemy Other')
ATTACK_NOTATIONS = enum.Enum('ATTACK_NOTATIONS', 'backattack critical counter opposite weakness resist riposte ignoredef parry block sweep miss onetwo stun')
# Error types
diff --git a/src/piece.py b/src/piece.py
@@ -313,7 +313,7 @@ class Piece(entity.Entity):
self.dist_mod = { i : stat_dist[i] if i in stat_dist else 0 for i in self.normal_stats }
self.other_mod = { i : stat_mod[i] if i in stat_mod else 0 for i in self.normal_stats }
self.hp_damage_mod = 0
- self.team = team
+ self.team = TEAMS[team]
self.equipment = {
"weapon" : None,
"armor" : None,
diff --git a/src/turn.py b/src/turn.py
@@ -138,6 +138,10 @@ class TurnManager(manager.Manager):
if not b.clickable:
b.toggle_activation()
+ # TODO: NOT THIS, OBVIOUSLY
+ if self.current_active_piece.team != TEAMS.Player:
+ self.shift_turns()
+
def project_turn_order(self):
"""
Make a projection of the upcoming turn order.
@@ -424,10 +428,16 @@ class TurnIcon(entity.Entity):
Create a small indicator to show what team
this icon's piece is on.
"""
- if self.piece.team == "Player":
+ if self.piece.team == TEAMS.Player:
sp = (0, 0)
- elif self.piece.team == "Enemy":
+ elif self.piece.team == TEAMS.Enemy:
sp = (0, 1)
+ elif self.piece.team == TEAMS.Ally:
+ sp = (1, 0)
+ elif self.piece.team == TEAMS.Neutral:
+ sp = (1, 1)
+ else:
+ sp = (0, 2)
self.team_indicator = entity.Entity(self.manager.bus.fetch("sheet_manager", "sheets")["team_indicator_small_1"], sp)
self.team_indicator.set_position((self.rect.width - self.team_indicator.rect.width, 0))