Return to repo list

heart-of-gold

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

commit 689cd18e5920f4f8aa1087b1387b2738847a87b3
parent 322282348065f6283419ed2884cd1a0a2ffd270c
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Wed,  2 Dec 2020 22:47:00 -0600

Added Jisella stat screen portrait

Diffstat:
Adata/img/pictures/jisella_1/battle_portrait.png | 0
Adata/img/pictures/jisella_2/battle_portrait.png | 0
Adata/img/pictures/jisella_3/battle_portrait.png | 0
Adata/img/pictures/jisella_4/battle_portrait.png | 0
Mdata/img/stat_screen_1.png | 0
Mdata/json/sheets.json | 24++++++++++++++++++++++++
Msrc/piece.py | 6++++--
Msrc/status.py | 10++++++++--
8 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/data/img/pictures/jisella_1/battle_portrait.png b/data/img/pictures/jisella_1/battle_portrait.png Binary files differ. diff --git a/data/img/pictures/jisella_2/battle_portrait.png b/data/img/pictures/jisella_2/battle_portrait.png Binary files differ. diff --git a/data/img/pictures/jisella_3/battle_portrait.png b/data/img/pictures/jisella_3/battle_portrait.png Binary files differ. diff --git a/data/img/pictures/jisella_4/battle_portrait.png b/data/img/pictures/jisella_4/battle_portrait.png Binary files differ. diff --git a/data/img/stat_screen_1.png b/data/img/stat_screen_1.png Binary files differ. diff --git a/data/json/sheets.json b/data/json/sheets.json @@ -89,6 +89,30 @@ "total_sprites" : 2, "anim_class" : null }, + "jisella_pictures_1_battle_portrait" : { + "filename" : "pictures/jisella_1/battle_portrait.png", + "dimensions" : [294, 651], + "total_sprites" : 1, + "anim_class" : null + }, + "jisella_pictures_2_battle_portrait" : { + "filename" : "pictures/jisella_2/battle_portrait.png", + "dimensions" : [294, 651], + "total_sprites" : 1, + "anim_class" : null + }, + "jisella_pictures_3_battle_portrait" : { + "filename" : "pictures/jisella_3/battle_portrait.png", + "dimensions" : [294, 651], + "total_sprites" : 1, + "anim_class" : null + }, + "jisella_pictures_4_battle_portrait" : { + "filename" : "pictures/jisella_4/battle_portrait.png", + "dimensions" : [294, 651], + "total_sprites" : 1, + "anim_class" : null + }, "cursor1" : { "filename" : "cursor1.png", "dimensions" : [64, 64], diff --git a/src/piece.py b/src/piece.py @@ -360,9 +360,10 @@ class Piece(entity.Entity): def load_pictures(self, pictures): """ Load universal pictures from a given pictures - directory. + directory. These are just strings, not images. """ self.pictures["icons_small"] = pictures + "_icons_small" + self.pictures["battle_portrait"] = pictures + "_battle_portrait" def equip(self, equipment): """ @@ -567,7 +568,8 @@ class Piece(entity.Entity): "expertise" : self.expertise, "normal_stats" : self.normal_stats, "active_stats" : self.active_stats, - "equipment" : self.equipment + "equipment" : self.equipment, + "pictures" : self.pictures } else: return None diff --git a/src/status.py b/src/status.py @@ -33,6 +33,7 @@ class StatusDisplay(entity.Entity): self.font = pygame.font.Font(os.path.join(FONT_PATH, UI_FONT), SCREEN_HEIGHT // 36) self.big_font = pygame.font.Font(os.path.join(FONT_PATH, UI_FONT), SCREEN_HEIGHT // 24) self.affinity_icon = None + self.battle_portrait = None self.name_surface = None self.name_surface_rect = None self.class_surface = None @@ -57,6 +58,7 @@ class StatusDisplay(entity.Entity): # Surface base positions # TODO: hardcoded self.affinity_icon_position = (504, 84) + self.battle_portrait_position = (674, 58) self.name_surface_position = (94, 95) self.class_surface_position = (94, 152) self.level_surface_rect_position = (800, 620) @@ -80,6 +82,8 @@ class StatusDisplay(entity.Entity): af = { i : j for i, j in zip(AFFINITIES, [ (y, x) for x in range(0, 3) for y in (0, 1) ]) } self.affinity_icon = entity.Entity(sh["affinity_icons_named_1"], af[self.stat_def["affinity"]], None, False) self.affinity_icon.set_position(self.affinity_icon_position) + self.battle_portrait = entity.Entity(sh[self.stat_def["pictures"]["battle_portrait"]], (0, 0), None, False) + self.battle_portrait.set_position(self.battle_portrait_position) def load_text(self): """ @@ -91,10 +95,10 @@ class StatusDisplay(entity.Entity): self.class_surface = self.font.render(self.stat_def["class"], False, (0, 0, 0)).convert() self.class_surface_rect = self.class_surface.get_rect() self.class_surface_rect.topleft = self.class_surface_position - self.level_surface = self.font.render("LVL: " + str(self.stat_def["level"]), False, (0, 0, 0)).convert() + self.level_surface = self.font.render("LVL: " + str(self.stat_def["level"]), False, (255, 255, 255)).convert() self.level_surface_rect = self.level_surface.get_rect() self.level_surface_rect.topleft = self.level_surface_rect_position - self.exp_surface = self.font.render("EXP: " + str(self.stat_def["exp"]), False, (0, 0, 0)).convert() + self.exp_surface = self.font.render("EXP: " + str(self.stat_def["exp"]), False, (255, 255, 255)).convert() self.exp_surface_rect = self.exp_surface.get_rect() self.exp_surface_rect.topleft = self.exp_surface_rect_position self.stat_surfaces["ATK"] = self.font.render(str(self.stat_def["active_stats"]["ATK"]), False, (0, 0, 0)).convert() @@ -184,6 +188,8 @@ class StatusDisplay(entity.Entity): """ if self.affinity_icon != None: self.affinity_icon.update(surface) + if self.battle_portrait != None: + self.battle_portrait.update(surface) super().update(surface) surface.blit(self.name_surface, self.name_surface_rect) surface.blit(self.class_surface, self.class_surface_rect)