A first quick look revealed a number of things. Give attention to my comments marked with "!!!!". Here is code that should work, so you can improve on it:
# this is supposed to be simple
# I am trying to simulate combat
# As easy as I can
# "Untitled"
# By Franki
# You find the crystals to destroy the Solomon Terminal
import random # needed for random.randrange(2) or other random thingies
crystals = 0
"""
# declare global variables inside functions only!!!!
global gotCrystal_1
global gotCrystal_2
global gotCrystal_3
global gotCrystal_4
global gotGold_1
global gotGold_2
global gotGold_3
global gotGold_4
"""
# use False, later set to True, is more readable
gotCrystal_area1 = False
gotCrystal_area2 = False
gotCrystal_area3 = False
gotCrystal_area4 = False
gotGold_area1 = False
gotGold_area2 = False
gotGold_area3 = False
gotgold_area4 = False
gold = 0
# I am using Classes to make monsters (I don't know why)
# so you can later refer to as bad_warrior.level, should be 3
# or bad_hunter.name which is 'Cavernian Hunter'
# you can also define some action within the class
class Monster(object):
"""Monster"""
def __init__(self,name,level):
self.name = name
self.level = level
# The Monsters
bad_hunter = Monster("Cavernian Hunter","1")
bad_scout = Monster("Cavernian Scout","2")
bad_warrior = Monster("Cavernian Warrior","3")
bad_commander = Monster("Cavernian Troop Commander","4")
def place_monster():
# the integer 1 places Monster, all others place nothing
Monster_in = random.randrange(2) # replaced MOnster_in with Monster_in spelling!!!!!
if Monster_in == (0 or 2):
return 0
Monster = random.randrange(4)
if Monster == 0:
Monster = bad_hunter
elif Monster == 1:
Monster = bad_scout
elif Monster == 2:
Monster = bad_warrior
elif Monster == 3:
Monster = bad_commander
return Monster
# THE AREAS
# Only four rooms (areas) in first mission
#
#------Mission One Map--------
#===============================
#| 4 | 2 | Room 3 has stairs going to upstairs study
#| | | Room 1 has exit house/enter town
#|-----------|--------------| Room 2 is start point. Has chest full of gold
#| 3 | 1 | needed to begin game and buy weapons.
#| | |
#==============================
#
# Framework:
# room# = Room(name,description,enemies_y_n?)
# Next add the coordinates below the room creators
# Keep organized
# This is the beginning of the game
# It might be too long
# I don't know how to give a back story
# that gives enough information and isn't tediously long
def help(location):
print '''Here is a list of commands. This is not exclusive, new commands
will come into availablitly as you progress through the game.
Actions: open (object) look at (object), survey, tell (target), go (direction; N,E, S, W,)
take (object), drop (object), throw (object), attack (target), avoid (target).
EXAMPLES: look at (tree), tell (Mr. Rogers), go (E), take (gold), drop (sword),
throw (knife), attack (hunter), avoid (hunter) open (chest).
REMEMBER: Enter all commands in lower case letters.'''
print
# help() should return to the area you used last!!!!
location()
def start():
print '''It is the year 2115, over 100 years since the team of scientists
discovered advanced foriegn schematics for an alternative energy source.
Though the attempt to compress and harness the energy of fledging stars
seemed to work rather well, slow and deadly atmospheric changes began to occur,
until finally, mere years before the Sun lost 48% of it's energy, along with
an estimated 5 out of 7 stars in our solar system losing 26.8% of their's,
a great earthquake shook the Earth apart, revealing an underground civilization
only 50 years behind Mankind in their technology.
These underground dwellers, soon recognized as the long lost ancient man, the
Neandrothal, weren't to pleased to have their world destroyed, along with their
energy sources. Now, the Earth is a primitive world, and the time became known
as The Second Dark Age. The sun no longer provided enough light to give us daytime,
so we live in perpetual night.'''
print
def area1():
global gold
global crystals
print " You have = ", gold, "gold" # added a , after gold!!!!
print " You have = ", crystals, "crystals" # dito with crystal !!!!
print ''' You are in your house, in the upstairs study. You hear shouts
coming from the village outside. In the study there are STAIRS going down,
there is a DESK against the far wall, and a CHEST.
Type 'help' for a full list of commands. Your only available exit is DOWN.'''
print
prompt_ar1()
def ar1_desc():
print ''' The walls are made of logs fastened together with rope. Your DESK
is cluttered with papers and books. The STAIRS going DOWN are your only exit. '''
print
prompt_ar1()
def prompt_ar1():
global gold
global gotGold_area1
global gold_found1
prompt_a = raw_input("What will you do? ").lower()
try:
if prompt_a == "go down":
area2()
elif prompt_a == "look at stairs":
print "These stairs lead DOWN"
elif prompt_a == "look at desk":
print "Their is a DIARY on the desk"
elif prompt_a == "take diary":
print "You have taken the DIARY"
elif prompt_a == "look at diary":
print '''June 05, 2096,
I have failed miserably. My project may very well be the end of the world.
The creatures that we awoke from underground are attacking now, and some
people started their own armies in an attempt to control what they see as
as the best means to gain world power. But I fear there may not be a world to control
very soon. I have seen odd Seismic activity in '
-The entry is not finished. Their is blood stained on the page.'''
elif prompt_a == "look at chest":
print " There is an inscription on it. EMERG. EQUIP."
# once the gold is taken, there should be no more gold in the chest!!!!
# dito for the dagger and the shotgun
elif prompt_a == "open chest":
if gotGold_area1 == False:
print "There are 500 GOLD. There is 1 DAGGER. There is 1 SHOTGUN."
else:
print "There is 1 DAGGER. There is 1 SHOTGUN."
# after the gold is taken set gotGold_area1 = True !!!!
elif prompt_a == "take gold" and gotGold_area1 == False:
gold = gold + 500
print " You have = ", gold, "gold" # may want to inform player
gotGold_area1 = True
elif prompt_a == "take dagger":
print "You have 1 dagger."
elif prompt_a == "take shotgun":
print "You have 1 shotgun."
elif prompt_a == "survey":
ar1_desc()
elif prompt_a == "help":
help(area1) # added location to return to from help!!!!
else:
print "You cannot do that."
except: # try: has to have matching except: !!!!!!!!!!
pass # pass for right now
# you need to return to the "What will you do? " for more action
# unless you are leaving the room
prompt_ar1() # added this !!!!
# get the action going ...
start()
area1()