All pastes #2064242 Raw Edit

First PY RPG

public python v1 · immutable
#2064242 ·published 2011-05-19 08:37 UTC
rendered paste body
global levelimport timeimport randomglobal expglobal streglobal agiglobal long_swordglobal long_sword_strglobal goldglobal exp_cglobal nameglobal fistglobal healthhealth = 10fist = 1level = 1exp = 0stre = 1agi = 1long_sword = 0long_sword_str = 5gold = 5exp_c = 10name = "Rahovart"def intro():    global name    print "Ultima Story"    name = raw_input("Your name: ")    print "Welcome", name," to Ultima Story"    print "If you need any help during the game, type help."def room_A_1():    global level    global exp    global stre    global agi    global long_sword    global long_sword_str    global gold    global exp_c    global name    description = "Welcome to the land of Eltricia"    option = raw_input("Command:")    if option=="fight":        room_A_1_fight()def room_A_1_fight():    global level    global exp    global stre    global agi    global long_sword    global long_sword_str    global gold    global exp_c    global name    global time    global fist    global health    gob_str = 1    gob_level = 1    print "You're searching for something to kill."    time.sleep(1)    print "You've found something!"    for gob_health in range(5, 0, -1):                choice = raw_input("Would you like to fight the goblin? Y/N:")        if choice == "Y":            choice = raw_input("Pick your weapon:")            if fist > 0:                print "You engage the goblin."                print "The goblin has", gob_health,"health."                time.sleep(1)                dynamic = random.random()                if dynamic > 0.5:                    print "You hit the goblin!"                    print "He lost 1 health!"                    gob_health = gob_health - 1                                    else:                    print "You missed!"                    if dynamic < 0.5:                       random_hit = random.random()                       if random_hit > 0.7:                           print "You lost 2 health!"                           health = health - 2                                                  else:                           print "You lost 1 health!"                           health = health - 1                                   else:            print "You ran away!"            room_A_1()    intro()room_A_1()