Return to repo list

heart-of-gold

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

commit 8e94cb26b3ced79925b5c31bfec7ad48681f415f
parent b0ff63037da59e5f5ee27cee1c5f06d6d367356d
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Sun, 29 Nov 2020 23:44:15 -0600

Colored attack notations

Diffstat:
Msrc/images.py | 1+
Msrc/piece.py | 12++++++------
2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/images.py b/src/images.py @@ -54,6 +54,7 @@ class SheetManager(manager.Manager): that sheets must be loaded AFTER animations. """ with open(os.path.join(JSON_PATH, sheet_json)) as df: self.sheets_def = json.load(df) + for j in self.sheets_def: an = {} if self.sheets_def[j]["anim_class"] != None: diff --git a/src/piece.py b/src/piece.py @@ -429,7 +429,7 @@ class Piece(entity.Entity): self.damage_number_rect = self.damage_number_surface.get_rect() self.damage_number_outline_rect = self.damage_number_outline.get_rect() for n in self.damage_notations: - ns = self.damage_notation_font.render(n, False, (255, 255, 255)).convert() + ns = self.damage_notation_font.render(n[0], False, n[1]).convert() nr = ns.get_rect() self.damage_notation_surfaces.append(ns) self.damage_notation_rects.append(nr) @@ -531,15 +531,15 @@ class Piece(entity.Entity): # Next, notation handling for n in notations: if n == ATTACK_NOTATIONS.backattack: - self.damage_notations.append("Back Attack!") + self.damage_notations.append(("Back Attack!", (200, 0, 30))) elif n == ATTACK_NOTATIONS.critical: - self.damage_notations.append("Critical!") + self.damage_notations.append(("Critical!", (230, 230, 0))) elif n == ATTACK_NOTATIONS.opposite: - self.damage_notations.append("Conflict!") + self.damage_notations.append(("Conflict!", (255, 255, 255))) elif n == ATTACK_NOTATIONS.weakness: - self.damage_notations.append("Weak!") + self.damage_notations.append(("Weak!", (200, 0, 240))) elif n == ATTACK_NOTATIONS.resist: - self.damage_notations.append("Resist!") + self.damage_notations.append(("Resist!", (50, 50, 50))) # Lastly, go through with the damage if raw_damage <= 0: