#include <stdio.h>

#define MAXOBJ 28

char *locations[] = {
  "at the end of a coridor leading to the engineering offices", 
  "in the engineering corridor", 
  "at the beginning of a corridor leading to the engineering offices", 
  "at the north west corner of the hanger",
  "at the north side of the hanger", 
  "in the middle of the northern edge of the hanger", 
  "near the middle of the northern edge of the hanger", 
  "at the northern side of the hanger near the end of the craft", 
  "at the north east corner of the hanger",
  "in the main engineering office  There are a number of desks here littered with paper with scribbles and doodles on them.  A large mirror is on the eastern wall", 
  "in the engineering managers office.  It is a tidy, well looked after room and totally opposite of the room you can see next door through the glass partition", 
  "looking at what was the engineering store room.  It is now a scrap heap of twisted metal", 
  "standing at the western end of the hanger looking up at the fat rump of the craft", 
  "in the engineering room of the small landing ship.  There are controls every where and like the rest of the vessel, is totally wrecked", 
  "in the cargo compartment of the ship.  What was left here is now just a mess of rags and broken machinery on the deck", 
  "in the of the large spacious passenger compartment, just made for those long interstellar flights", 
  "in the cockpit of the craft.  There is a light blinking on the instrument panel.  Your keen mind and years of experience tell you that it must be the back box recorder", 
  "at the eastern end of the hanger looking up at the sleek curves of the pleasure craft.  It must be a total pleasure to fly",
  "in the north west corner of the bunker", 
  "in the north east corner of the bunker", 
  "in the hanger store room where the fuel and spares are kept.  What ever happened did not get in here", 
  "at the south west corner of the hanger", 
  "walking along the southern side of the hanger", 
  "near the middle of the hanger", 
  "standing in one of the biggest places you have ever seen.  The hanger is vast.  Right in the middle is a large and very luxurious interstellar pleasure craft", 
  "at the southern side of the hanger near the end of the pleasure craft", 
  "walking along the nose of the pleasure craft",  
  "in the south west corner of the bunker", 
  "in the south west corner of the bunker", 
  "at the end of the long corridor", 
  "near the end of the long corridor", 
  "in the middle of the long corridor", 
  "at the start of the hidden corridor.   To be hidden this well, it must be important", 
  "before the entrance to the hanger", 
  "in the main office.  There is a large chair here that the base commander would sit at", 
  "in the secretaries office.  There is a vido-com unit on the desk but it is not working",
  "in one of the crews quarters.  like the others, it is basic, but with a bit of luxury", 
  "at the end of the personnel passage.  The sign to the west says Carter", 
  "the main bath room.  It is a unisex facility with stalls to separate individuals to give some form of privacy", 
  "in the shower area.  Like the toilet there are stalls as well as a communal shower area!", 
  "in the northern security cell.  Nothing seems wrong at first glance but then you notice that a panel on the eastern wall seems slightly out of shape", 
  "in a secret room next to the security cell.  There is a door to the north but it appears to be locked", 
  "In the administration corridor", 
  " in one of the offices", 
  "in the administration center.  There are a number of desks with various bits of paper on them",
  "inside a room that looks like bomb hit it.  It has a double bed with 2 of everything.  Whoever used to sleep here is going to have a nice time cleaning up", 
  "in the personnel corridor.  the sign on the western door reads C&J Schwarz, and the one on the east reads\n        Antonios!  Keep out", 
  "in antonios quarters.  Perhaps you should have headed the warning.  This place stinks", 
  "in the western security cell", 
  "in the heart of the security centre.  There are 3 cells here but none of them are in use at the moment.  At the desk you can see a port with which to plug in a computer terminal", 
  "within the eastern security cell", 
  "at the beginning of the administration corridor",
  "inside the computer room.  This place is the centre of the computer network that is found on most bases.  Controlled by a Datacom 2400 xls network station, it is as state of the art as they come.  The terminal to the station is missing however, but a cable is still there that one can fit into",
  "in the command centre.  There is a door to the west proclaiming Computer Network Control",
  "in Bazas room.  It is a neat, clean quarter with everything in its place.  There are still clothes on the bed ready to be put on",
  "at the beginning a passage with doors to either side.  The one on the left has a sign which reads Baza",
  "inside the main store room.  The place is a mess with every thing upturned and broken",
  "at the end of the main store room",
  "at the end of a short north south passage.  The door to the left says Communications and the one to the north says security",
  "inside the communications center.  There are printouts all over the floor and a half drunk cup of coffee next to one of the units",
  "where the main and hanger corridor meet up", 
  "outside the number 3 lab", 
  "at the end of the corridor outside the number 4 lab",
  "at the end of the main corridor.  The galley is to the south", 
  "at a junction for the main and personnel corridor", 
  "outside the mess hall", 
  "in the main corridor",
  "standing before the air lock inside the complex.  There is an eery silence as the atmospheric controls do not seem to be functioning.  Infact, the whole power seems to be off.  Switching on your helmets portable flood light you can see a little better.  The main corridor stretches east and west with a room to the north",
  "going along the main corridor",
  "where the main corridor meets the lab passage",
  "inside the number 3 lab.  This appears to be a biological test lab.  There are cages with dead animals, test tubes and beakers full of various coloured liquids",
  "inside the number 4 lab.  Full of computers you are unsure what kind of work goes on here.  There are many ports here that a computer terminal can plug into",
  "at the north end of the galley.  There are cupboards full of food packets",
  "at the north west corner of the mess hall.  Looking up you can see a particularly nasty looking splodge of mash potato on the verge of dropping from the ceiling onto your head", 
  "at the north east corner of the mess hall.  At first impressions you would say that a bomb had gone off in this room.  The tables and chairs are strewn about and food is still dripping off the walls",
  "",
  "inside the airlock.  Pressure suits can be seen hanging in the lockers complete with gloves, helmets and respiratory systems.  There are a few spare places where you could hang yours",
  "",
  "at the beginning of the main lab corridor",
  "inside number 1 lab.  This appears to be a electronics lab.  Circuit boards and components are all over the floor and desk tops.  the door to the west is open and you can see the other lab",
  "inside number 2 lab.  ",
  "at the south end of the galley.  The main cookers are here with large pots still full of some sort of stew",
  "at the south west end of the mess hall",
  "at the south east corner of the mess hall",
  "",
  "A short path leading North to the air lock and south to the landing pad.  There are boulders to either side of the path which would make the going hard", 
  "", 
  "at a corner of the passage",
  "outside the number 1 lab.  A sign reads electronics lab 1",
  "outside the number 2 lab.  A sign reads electronics lab 2", 
  "", "", "",
  "North West corner of the landing Pad", 
  "The very northern part of the Landing Pad", 
  "The North East corner of the landing pad",
  "", "",
  "inside the secondary generator house",
  "outside a building with a sign next to the door proclaiming Environmental control area", "walking along a path leading to one of the compounds main buildings", "on a path that leads from the landing pad to the west",
  "on the Western side of the Landing pad.  The land as far as the eye can see is desolate and hostile.  An electric storm can be seen in the far distance over some very large mountains", 
  "inside your surface lander craft", 
  "The eastern side of the Landing Pad",
  "in a path leading to the landing pad and a large grey building to the east",
  "outside the large building you saw on landing.  There is a large sign to the right of the door",
  "inside the power plant",
  "inside the environmental control building.  A huge array of air filters and large machinery fill the room", "", "",
  "The south west corner of the Landing Pad", 
  "The southern side of the Landing Pad", 
  "The South east corner of the landing pad",
  "", "",
  "inside the primary generator room",
};

char *exits[] = {
  "ES" , "ESW",  "ESW", "ESW",  "EW",   "EW",  "EW",   "EW",  "SW",
  "N",  "N",    "N",   "NS",   "E",    "EW",  "ESW",  "W",   "NS",
  "SE", "SW",   "E",   "NEW",  "EW",   "EW",  "NESW", "EW",  "NW",
  "NE", "NEW",  "EW",  "EW",   "EW",   "SW",  "NES",  "EW",  "WS",
  "E",  "ES",    "EW",  "W",    "S",    "W",   "NES",  "W",   "NS",
  "E",  "NESW", "W",   "E",    "ESW",  "W",   "NS",   "E",   "NW",
  "E",  "NSW",  "SE",  "W",    "S",    "W",   "NES",  "EW",  "SW",
  "SE", "NEW",  "NESW","EW",   "NESW", "EW",  "NSW",  "NES", "NS",
  "NS", "ES",   "NSW", "",     "NS",   "",    "NS",   "ES",  "NSW",
  "N",  "NE",   "NW",  "",     "NS",   "",    "NE",   "NEW", "NW",
  "",   "",     "",    "ES",   "NESW", "SW",  "",     "",    "S",
  "E",  "WE",   "WE",  "NSW",   "N",   "NES", "EW",    "W",   "NW",
  "N",  "",     "",    "NE",   "EW",  "NW",  "",     "",    "N",
};

char *objects[] = {
  "standard issue Mk III Psionic hand gun" ,
  "standard issue Mk II area scanner",
  "standard issue EVA pressure suit", 
  "piece of reflective metal",
  "small strip of wire",
  "pool of oil",
  "blade of grass",
  "computer terminal",
  "philips screw-driver",
  "red key card",
  "green Key card",
  "blue key card",
  "yellow key card",
  "orange key card",
  "piece of crumpled paper",
  "a badly neglected auxiliary generator",
  "the main reactor core",
  "the environmental control",
  "a console",
  "highly charged energy bars activated on the north cell",
  "crow bar",
  "squeagy bottle",
  "navcom",
  "group of people",
  "group of people",
  "group of people",
  "group of people",
  "Steve",
  "a sign",
};

char *sim_obj[]={
  "GUN" , "SCANNER", "SUIT", "METAL", "WIRE", "OIL", "GRASS", "COMPUTER", "PHILIPS", "RED", "GREEN", "BLUE", "YELLOW", "ORANGE", "PAPER", "GENERATOR", "REACTOR", "CONTROL", "CONSOLE", "BARS", "CROW", "BOTTLE", "NAVCOM", "PEOPLE", "PEOPLE", "PEOPLE", "PEOPLE",  "STEVE", "SIGN", "KEY",
};

char *adv_obj[]={
  "A light weight portable weapon that was issued to you on the ship.  Guaranteed to stop a rabbit dead  in its tracks at 3 meters but not much else",
  "With a series of different functions that test atmospheric conditions, life signs and mineral content",
  "A handy piece of clothing that keeps the air in and the vacuum out.  Nice thing to keep you alive",
  "Roughly 4 inches by 2, it has a shiny surface that was at one point well polished",
  "approximately 9 inches long, it is a standard copper affair inside a red plastic sheath.  Might be handy for bridging any gaps",
  "Its black and slippy.  Kind of looks like oil for some reason",
  "It is a blade of grass.  How it got here, no one knows",
  "A small black case that opens out into a keyboard and screen.  There are sockets at the back that allow it to be connected to the network",
  "It has a size 1 cross head that is slightly magnetised with a red and black handle",
  "The key has the word P.Plant on it",
  "The key has the word C.L.3 on it",
  "The key has the word S.Carter on it",
  "The key has the word Security on it",
  "The key has the word Communications on it",
  "The paper is a computer printout and has the words s.carter and wibble written on the bottom",
  "The generator is a bulky piece of equipment.  Used only when the main one is down, it does not appear to have had any maintenance for a long time.  On closer inspection you see that the fuse is missing.  It wont start without it (or something similar)",
  "This is the main reactor core for the entire base.  It uses a mixture of geo-thermal, solar and nuclear fusion to produce power",
  "The environmental control is a complex mass of pipes and electronics that control the humidity, oxygen content, temperature and a host of other functions.  The console appears to be active",
  "Like your palmtop computer it has a screen and a keyboard.  There are a number of extra buttons.  One of which is clearly labelled ON",
  "These highly charged energy beams are a good way of keeping anything in.  They however can be disrupted by a reflected surface",
  "A heavy lump of metal about 2 feet long used to open crates.  Also handy for causing a lump on the head",
  "A frosted plastic bottle used for squirting liquids.  It can also suck them in",
  "This is the heart of the craft.  It controls speed, height, direction and a million other things",
  "These are the scientists, engineers and soldiers that are stationed on the base",
  "These are the scientists, engineers and soldiers that are stationed on the base",
  "These are the scientists, engineers and soldiers that are stationed on the base",
  "These are the scientists, engineers and soldiers that are stationed on the base",
  "Steve is the boss of the entire base.  Any decisions that are made must be passed through him or not at all.  Perhaps he could tell you what is going on in here",
  "It reads  Power Production Facility.  Warning : High Voltage",
};

int obj_location[] = {
  4, 4, 4, 102, 76, 40, 10, 47, 79, 57, 73, 70, 108, 36, 36, 98, 116, 108, 108, 49, 20, 9, 103, 18, 19, 27, 28, 18, 106,
};

int obj_flags[]={
  0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
};

int obj_takeable[]={
  1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0,
};

int status_flags[]={
  0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
};

char *verbs[]={
  "HELP", "CARRYING", "GO", "N", "E", "S", "W", "U", "D", "GET", "TAKE", "LEAVE", 
  "DROP", "EXAMINE", "READ", "USE", "SAVE", "RESTORE", "QUIT", "INV", "INVENTORY",
  "TALK",
};

int date[]={
  1, 2, 3, 4, 5, 6, 7, 8, 9,
};

/*char *times[]={16:42 , 
  "15:23", 
  "16:52", 
  "23:15", 
  "08:21", 
  "17:18", 
  "21:21", 
  "06:32", 
  "06:37",
};*/

/*char *log[]={
  "We have now been working on the project for over 3 months now and we are still no nearer to cracking g the problem.  Im getting worried about steve.  The stress seems to be getting to him harder than the rest of us.  Ill be keeping an eye on him",
  "My concern with Steve is increasing.  Today over lunch he nearly attacked Micheal for fidgeting",
  "Early on this morning we had a real break through.  We are running a series of test to make sure but the results look promising",
  "There have been some funny things happening around here lately.  We have been picking up some transmissions that seem to be originating from somewhere around the third planet.  We have informed the council",
  "We have had to shut down all unnecessary functions now.  There is a Cruger Class Destroyer snooping around the system",
  "The Cruger is still here.  There is something not right.  I have contacted control but they tell me that everything is OK",
  "There are now 2 ships in orbit.  the cruger is still there but now there is a Federal Cruiser.  how did they find out where we were?  We are all preparing to evacuate.  A shame.  We were so close to the end!",
  "At 04:32 this morning, the two ships opened fire on each other.  We are now in trouble.  I have sent out a coded message to control but I dont think they will get here in time",
  "The Cruger has been destroyed.  We are now at the mercy of the Federation if they find us.  May god have mercy on our soles",
};*/

char *comp_op[]={
  "AUXILIARY" , "MAIN", "NETWORK", "ENVIRONMENTAL", "SECURITY", 
};

int dead = 0;

void Split(char *s, char **w, int z);
void computer(void);
void save(int rm);
int use(int obj, int rm);
int load(void);
int getch(void);
extern void set_mode(int);
extern int* get_screen_address(void);

