Code:
import random
INTRO = 'Your challenge is to roll a'
RACE = ['human', 'troll', 'high elf', 'gray elf', 'dark elf', 'dwarf', 'gnome', 'hurthling', 'orc', 'drakeling']
CLASS1 = ['wizard.', 'fighter.', 'paladin.', 'priest.', 'monk.', 'archer.', 'barbarian.', 'druid.', 'necromancer.', 'elementalist.', 'beastfighter.']
CLASS2 = ['assassin.', 'ranger.', 'bard.', 'healer.', 'weaponsmith.']
CLASS3 = ['merchant.', 'thief.', 'mindcrafter.', 'farmer.']
QUEST_TYPE = ['return the cute puppy to the tiny girl ', 'kill ', 'find ', 'commit suicide in ']
QUEST_MONSTER = ['a mimic ', 'a rust monster ', 'a master swordsman ', 'a ratling duelist ']
QUEST_ITEM = ['an amulet of willpower ', 'a mithril shield ', 'a mithril sword' , 'pair of mithril boots ']
LOCATION = ['the pyramid, \ndungeon level 3, ', 'GriffYard, \ndungeon level 2, ', ' the tomb of the high kings, \ndungeon level 6, ', 'caverns of chaos, \ndungeon level 15, ']
TURN_COUNT = ['5000', '6000', '8000', '10000']
CRUEL_RESTRICTION = ['cruel restriction, you must drop all your \nitems in the wilderness on turn 1.', 'cruel restriction, you must pray until your \ninventory is cursed upon game start.', 'cruel restriction, you must pray until you are doomed upon game start.', 'cruel restriction, you must forego all armor \nfor 5000 turns, starting on game turn 1.', 'cruel restriction, you must forego melee attacks \nfor 5000 turns, starting on game turn 1.']
RESTRICTION = ['restriction, you must drop all your \nfood in the wilderness upon game start.', 'restriction, you must kick the air until \nyour HPs are under 5 upon game start.', 'restriction, you must forego all armor for 2000 turns.', 'restriction, you must forego melee attacks \nfor 2000 turns, starting on game turn 1.', 'restriction, you must not intentionally acquire the detect traps skill.']
def Choose_Quest():
RNG = random.randrange(0, 4, 1)
if RNG == 0:
a = QUEST_TYPE[0]
b = 'by turn count '
c = Choose_Turns()
d = '.'
return a+b+c+d
if RNG == 1:
a = QUEST_TYPE[1]
b = Choose_Monster()
c = 'by turn count '
d = Choose_Turns()
e = '.'
return a+b+c+d+e
if RNG == 2:
a = QUEST_TYPE[2]
b = Choose_Item()
c = 'by turn count '
d = Choose_Turns()
e = '.'
return a+b+c+d+e
if RNG == 3:
a = QUEST_TYPE[3]
b = Choose_Location()
c = 'by turn count '
d = Choose_Turns()
e = '.'
return a+b+c+d+e
def Choose_Turns():
RNG = random.randrange(0, 4, 1)
if RNG == 0:
return TURN_COUNT[0]
if RNG == 1:
return TURN_COUNT[1]
if RNG == 2:
return TURN_COUNT[2]
if RNG == 3:
return TURN_COUNT[3]
def Choose_Monster():
RNG = random.randrange(0, 4, 1)
if RNG == 0:
return QUEST_MONSTER[0]
if RNG == 1:
return QUEST_MONSTER[1]
if RNG == 2:
return QUEST_MONSTER[2]
if RNG == 3:
return QUEST_MONSTER[3]
def Choose_Item():
RNG = random.randrange(0, 4, 1)
if RNG == 0:
return QUEST_ITEM[0]
if RNG == 1:
return QUEST_ITEM[1]
if RNG == 2:
return QUEST_ITEM[2]
if RNG == 3:
return QUEST_ITEM[3]
def Choose_Location():
RNG = random.randrange(0, 4, 1)
if RNG == 0:
return LOCATION[0]
if RNG == 1:
return LOCATION[1]
if RNG == 2:
return LOCATION[2]
if RNG == 3:
return LOCATION[3]
def Choose_Race():
RNG = random.randrange(0, 10, 1)
if RNG == 0:
return RACE[0]
if RNG == 1:
return RACE[1]
if RNG == 2:
return RACE[2]
if RNG == 3:
return RACE[3]
if RNG == 4:
return RACE[4]
if RNG == 5:
return RACE[5]
if RNG == 6:
return RACE[6]
if RNG == 7:
return RACE[7]
if RNG == 8:
return RACE[8]
if RNG == 9:
return RACE[9]
def Choose_Class():
RNG = random.randrange(0, 20, 1)
if RNG == 0:
return CLASS1[0]
if RNG == 1:
return CLASS1[1]
if RNG == 2:
return CLASS1[2]
if RNG == 3:
return CLASS1[3]
if RNG == 4:
return CLASS1[4]
if RNG == 5:
return CLASS1[5]
if RNG == 6:
return CLASS1[6]
if RNG == 7:
return CLASS1[7]
if RNG == 8:
return CLASS1[8]
if RNG == 9:
return CLASS1[9]
if RNG == 10:
return CLASS1[10]
if RNG == 11:
return CLASS2[0]
if RNG == 12:
return CLASS2[1]
if RNG == 13:
return CLASS2[2]
if RNG == 14:
return CLASS2[3]
if RNG == 15:
return CLASS2[4]
if RNG == 16:
return CLASS3[0]
if RNG == 17:
return CLASS3[1]
if RNG == 18:
return CLASS3[2]
if RNG == 19:
return CLASS3[3]
def Choose_Restriction():
RNG = random.randrange(0, 5, 1)
if RNG == 0:
RNG = random.randrange(0, 5, 1)
if RNG == 0:
return CRUEL_RESTRICTION[0]
if RNG == 1:
return CRUEL_RESTRICTION[1]
if RNG == 2:
return CRUEL_RESTRICTION[2]
if RNG == 3:
return CRUEL_RESTRICTION[3]
if RNG == 4:
return CRUEL_RESTRICTION[4]
else:
RNG = random.randrange(0, 5, 1)
if RNG == 0:
return RESTRICTION[0]
if RNG == 1:
return RESTRICTION[1]
if RNG == 2:
return RESTRICTION[2]
if RNG == 3:
return RESTRICTION[3]
if RNG == 4:
return RESTRICTION[4]
def Challenge():
print INTRO, Choose_Race(), Choose_Class()
print 'You must', Choose_Quest()
print 'As a', Choose_Restriction(), '\n'
Challenge()
P.S.