Created
September 1, 2015 23:52
-
-
Save JPLeBreton/2eaa4db0feb9688dcae6 to your computer and use it in GitHub Desktop.
First bit of Python code I wrote, December 2nd 2004: calculate "steal chance" in Phantom Brave
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
charsteal = 93.0 | |
charlev = 260.0 | |
tarsteal = 70.0 | |
tarlev = 477.0 | |
if __name__ == "__main__": | |
newlev = raw_input("Character Level? ") # raw_input doesn't squawk at empty strings! | |
if newlev != "": | |
charlev = float(newlev) | |
newsteal = raw_input("Character Steal? ") | |
if newsteal != "": | |
charsteal = float(newsteal) | |
stealsuccess = (charsteal/10) * (10 + charlev) - (tarsteal/10) * (10 + tarlev) + 40 | |
print "Steal success rate: %.0f%%" % stealsuccess | |
duh = raw_input("Press any key to exit.") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment