Mercurial > sypikslang
changeset 109:5bb711cdc569
Display strings for reputation (needs more levels)
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Wed, 09 May 2012 22:37:02 +0200 |
parents | 4a44d133ad2e |
children | bb76ce231ff9 |
files | gamelib/gamegui.py |
diffstat | 1 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/gamelib/gamegui.py Wed May 09 22:31:49 2012 +0200 +++ b/gamelib/gamegui.py Wed May 09 22:37:02 2012 +0200 @@ -22,6 +22,18 @@ from gamelib.gamestate import Game +def _lookup_reputation(rep): + """Turn reputation in a nice string""" + + if rep < 0: + return 'Mindless Thug' + if rep < 10: + return 'Fringe Lunatic' + if rep < 100: + return 'Mad Scientist' + return 'Major Threat to World Peace' + + class ExitGameButton(BigButton): def __init__(self): @@ -338,7 +350,7 @@ self.points.set_value(self.game.get_available_points()) self.money.set_value(self.game.money) self.milestone.set_value(self.game.milestone) - self.reputation.set_value(self.game.reputation) + self.reputation.set_value(_lookup_reputation(self.game.reputation)) class ActivityWindow(GameStateWindow):