def goblinshot(dmg): # An action whereby a goblin attacks the "player," reducing global health and printing out its new value. global health health = health - dmg print "You're now down to", health,"health!"
def goblinheal(healing): # An action whereby a goblin heals the "player," increasing global health and printing out its new value. global health health = health + healing print "You now have", health,"health! Hooray!"
class Character:
def addPop(self): global population population = population + 1
def howMany(self): global population if population == 1: print "'It's just me and you!' he exclaims." else: print "'I'm here with", population - 1,"other characters.'"
def regattack(self): print "The goblin punches you!" goblinshot(1)
class GoodGoblin(Goblin): money = 5
def _init_(self): self.hitPoints = 3 print "I have",money,"money!"
def healsyou(self): print "The goblin heals you a little bit!" goblinheal(1) def giveMoney(self): print "The goblin drops a dollar!" self.money = self.money - 1 print "He now has", print self.money, "dollars!" global money money = money + 1 print "You pick up the dollar!" print "You now have", money,"dollars!"
class NigerianGoblin(Goblin):
def goChoppa(self): print "The goblin go choppa your dolla!" global money money = money - 1 print "You now have", money,"dollars!"
Joshua: lolololol me: holy shit lol Joshua: there's your nightclub Joshua: make it better Joshua: !!!! Joshua: Thuggy McPicklephile! me: where'd you find that? Joshua: old emails - apparently you emailed it to me Joshua: you should make it a google doc so you won't lose it me: I'm at Spiderhouse lol me: I will Joshua: lol Joshua: fag Joshua: lol Joshua: i'm jealous me: already downloaded python, etc