Skip to content

Instantly share code, notes, and snippets.

@JPLeBreton
Created September 1, 2015 23:52
Show Gist options
  • Save JPLeBreton/2eaa4db0feb9688dcae6 to your computer and use it in GitHub Desktop.
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
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