commit ca8e8b9b5b59e535f038ffad1e0acf73fdaae609
parent 075ecfdc2406014e96468fa0e9cfcf4fa9b6e689
Author: Erik Letson <hmagellan@hmagellan.com>
Date: Tue, 24 Nov 2020 14:58:39 -0600
added expertise to stat display
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/status.py b/src/status.py
@@ -42,6 +42,8 @@ class StatusDisplay(entity.Entity):
self.level_surface_rect = None
self.exp_surface = None
self.exp_surface_rect = None
+ self.expertise_surfaces = []
+ self.expertise_surface_rects = []
self.stat_surfaces = { i: None for i in self.stat_def["normal_stats"].keys() }
self.stat_surface_rects = { i: None for i in self.stat_def["normal_stats"].keys() }
self.equipment_surfaces = { i: None for i in self.stat_def["equipment"].keys() }
@@ -63,6 +65,7 @@ class StatusDisplay(entity.Entity):
self.level_surface_rect_position = (800, 620)
self.exp_surface_rect_position = (790, 640)
self.stat_surfaces_position = (140, 218)
+ self.expertise_surface_position = (110, 430)
self.equipment_surfaces_position = (510, 224)
self.health_bar_position = (750, 560)
@@ -139,6 +142,14 @@ class StatusDisplay(entity.Entity):
self.stat_surfaces["CNTR"] = self.font.render(str(self.stat_def["active_stats"]["CNTR"]), False, (0, 0, 0)).convert()
self.stat_surface_rects["CNTR"] = self.stat_surfaces["CNTR"].get_rect()
self.stat_surface_rects["CNTR"].topleft = (self.stat_surfaces_position[0] + 18, self.stat_surfaces_position[1] + 154)
+ for x in range(0, 3):
+ if len(self.stat_def["expertise"]) >= x + 1:
+ self.expertise_surfaces.append(self.font.render(self.stat_def["expertise"][x], False, (0, 0, 0)).convert())
+ else:
+ self.expertise_surfaces.append(self.font.render("-----", False, (0, 0, 0)).convert())
+ self.expertise_surface_rects.append(self.expertise_surfaces[x].get_rect())
+ self.expertise_surface_rects[x].topleft = (self.expertise_surface_position[0] + (102 * x), self.expertise_surface_position[1])
+
for e in self.equipment_surfaces:
if self.stat_def["equipment"][e] != None:
@@ -185,6 +196,9 @@ class StatusDisplay(entity.Entity):
surface.blit(self.class_surface, self.class_surface_rect)
surface.blit(self.level_surface, self.level_surface_rect)
surface.blit(self.exp_surface, self.exp_surface_rect)
+ for x in range(0, len(self.expertise_surfaces)):
+ if self.expertise_surfaces[x] != None:
+ surface.blit(self.expertise_surfaces[x], self.expertise_surface_rects[x])
for s in self.stat_surfaces:
if self.stat_surfaces[s] != None:
surface.blit(self.stat_surfaces[s], self.stat_surface_rects[s])