Skip to content

Commit

Permalink
Mana and stats are now correctly reset after adventure
Browse files Browse the repository at this point in the history
Signed-off-by: Ole Herman Schumacher Elgesem <oleherman93@gmail.com>
  • Loading branch information
olehermanse committed Apr 29, 2018
1 parent 0d05553 commit febb9d8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion mrpg/core/creature.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,18 @@ def restore(self, amount, limit_check=False, source=None):
msg.append(self.limit_check())
return msg

def town_heal(self):
def reset_stats(self):
self.current["str"] = self.base["str"]
self.current["dex"] = self.base["dex"]
self.current["int"] = self.base["int"]

def reset_resources(self):
self.current["hp"] = self.base["hp"]
self.current["mp"] = self.base["mp"]

def full_heal(self):
self.reset_resources()
self.reset_stats()

def limit_check(self):
if self.current["hp"] <= 0 or self.dead:
Expand Down
2 changes: 1 addition & 1 deletion mrpg/core/game.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def progress_adventure(self):
self.put_output(self.adventure.end())
self.adventure = None
self.battle = None
self.player.town_heal()
self.player.full_heal()
self.set_state(State.GAME_MENU)
return
enemy = self.adventure.next_monster()
Expand Down

0 comments on commit febb9d8

Please sign in to comment.