Return to repo list

tzed

Simple story-driven open world 2D CRPG.
Return to HMagellan.com

commit 2aaa231a63e251673919c0cdfa67eefb30697ed5
parent bc8cd0d1d19ad46521c3aecc581f58fecc0aaf07
Author: Erik Letson <hmagellan@hmagellan.com>
Date:   Mon, 30 Aug 2021 22:24:44 -0500

displaying stat strings

Diffstat:
Msrc/game.py | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/src/game.py b/src/game.py @@ -333,6 +333,30 @@ class Game(object): xpsq.fill((205, 205, 0)) surface.blit(xpsq, (122 + (x_mod * 137), 587 + (38 - xpyr))) + # Character name + surface.blit(self.ui_font.render(self.party[c]["name"][0:min(len(self.party[c]["name"]), 14)], False, (0, 0, 0)), (15 + (x_mod * 137), 529)) + + # Character stats + x3 = 0 + y3 = 0 + for statpair in (("phs", "mag"), ("agi", "chr"), ["luk"]): + for st in statpair: + statmod = self.party[c][st + "_mod"] + if statmod > 0: + statstring = str(self.party[c][st]) + " (-" + str(statmod) + ")" + elif statmod < 0: + statstring = str(self.party[c][st]) + " (+" + str(statmod) + ")" + else: + statstring = str(self.party[c][st]) + rs = self.small_ui_font.render(statstring, False, (175, 20, 20) if statmod > 0 else (20, 235, 20) if statmod < 0 else (0, 0, 0)) + rsr = rs.get_rect() + rsr.topright = (64 + (x_mod * 137) + (62 * x3), 633 + (24 * y3)) + surface.blit(rs, rsr) + x3 += 1 + x3 = 0 + y3 += 1 + + # Move right to next character x_mod += 1 def collect_game_data(self):