-
-
Save Hasimir/c7a637566cb094837fd8 to your computer and use it in GitHub Desktop.
foo = fooClass()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class zhumClass: | |
def __repr__(self): | |
return "zERR: This function accepts one numeric argument in the | |
range 0-10." | |
def __call__(*args): | |
errMsg = "zERR: This function accepts one numeric argument in the range 0-10." | |
if len(args) != 2: | |
print errMsg, | |
return | |
newH = args[1] | |
if (type(newH) != IntType) or newH < 0 or newH > 10: | |
print errMsg, | |
return | |
pc = __main__.FindPlayer() | |
# there's no reliable way to read current humanity level, | |
# so max it out and then subtract as needed | |
pc.HumanityAdd(10) | |
pc.HumanityAdd(newH - 10) | |
print "HUMANITY LEVEL SET", | |
# instantiate class | |
zhum = zhumClass() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment