I have some health and mana stat bars which goes up and down during battles.
At the end of the battle, I'd like to restore them to their initial values (i.e. 100). Now, I did just +100 points to each characters HP/MP, but, unless I get my maths right every time, they are sometimes a few numbers out.
To make my life much easier (because of multiple outcomes, routes etc), I'm wondering if there's a way to reset any points/ stats to their initial values OR an earlier state? It would be much more accurate and save me a lot of time.
Here's my characters stat bars:
Code: Select all
class player_character:
def __init__ (self, avatar, name, hp, hpmax, mp, mpmax):
self.avatar = avatar
self.name = name
self.hp = hp
self.hpmax = hpmax
self.mp = mp
self.mpmax = mpmax
#CHARACTERS
female = player_character("profile.png", "Female", 100, 100, 100, 100)
nightshade = player_character("party_nightshade.png", "Nightshade", 100, 100, 100, 100)
watto = player_character("party_watto.png", "Watto", 100, 100, 100, 100)
emarin = player_character("party_emarin.png", "Emarin", 100, 100, 100, 100)
celes = player_character("party_celes.png", "Celes", 100, 100, 100, 100)
profile = female
player1 = nightshade
player2 = watto
player3 = emarin
player4 = celes
Code: Select all
"We rest up and restore our health and mana."
$ profile.hp+=100
$ profile.mp+=100
$ player1.hp+=100
$ player1.mp+=100
$ player2.hp+=100
$ player2.mp+=100
$ player3.hp+=100
$ player3.mp+=100
$ player4.hp+=100
$ player4.mp+=100