#include <cstdlib>
#include <iostream>



using namespace std;

int main(int argc, char *argv[])
{
    system("PAUSE");
const char* const story [] = {
     "'0001 \r",
     "'THE STORY SO FAR \r" ,
     "'You're a marine, one of Earth's \r" ,
     "'toughest, hardened in combat and \r" ,
     "'trained for action. Three years  \r" ,
     "'ago, you assaulted a superior  \r" ,
     "'officer for ordering his  \r" ,
     "'soldiers to fire upon civilians. \r" ,
     "'He and his body cast were shipped \r" 
     "'to Pearl Harbor, while you were \r" ,
     "'transferred to Mars, home of the \r" ,
     "'Union Aerospace Corporation.  \r" ,
     "  < \r",
     "'The UAC is a multi-planetary \r" ,
     "'conglomerate with radioactive \r" ,
     "'waste facilities on Mars and \r" ,
     "'its two moons, Phobos and Deimos. \r" ,
     "'With no action for fifty million \r" ,
     "'miles, your day consisted of suckin' \r" ,
     "'dust and watchin' restricted \r" 
     "'flicks in the rec room. \r"
     "   < \r" ,
     "'For the last four years the  \r" ,
     "'military, UAC's biggest supplier, \r" ,
     "'has used the remote facilities  \r" ,
     "'on Phobos and Deimos to conduct \r" ,
     "'various secret projects,including \r" ,
     "'research on inter-dimensional  \r" ,
     "'space travel. So far they have \r" , 
     "'been able to open gateways between \r" ,
     "'Phobosand Deimos, throwing a few \r" ,
     "'gadgets into one and watching them \r" ,
     "'come out the other. Recently however, \r" ,
     "'the Gateways have grown dangerously \r" ,
     "'unstable. Military 'volunteers' \r" ,
     "'entering them have either disappeared \r" ,
     "'or been stricken with a strange form \r" ,
     "'of insanity--babbling vulgarities, \r" ,
     "'bludgeoning anything that breathes, \r" ,
     "'and finally suffering an untimely \r" ,
     "'death of full-body explosion.  \r" ,
     "'Matching heads with torsos to send \r" ,
     "'home to the folks became a full-time \r" ,
     "'job. Latest military reports state \r" ,
     "'that the research is suffering a  \r" , 
     "'small set-back, but everything is  \r" ,
     "'under control.  \r" ,
     "  < \r",
     "'A few hours ago, Mars received a \r" ,
     "'garbled message from Phobos. \r" ,
     "''We require immediate military  \r" ,
     "'support. Something fraggin' evil \r" ,
     "'is coming out of the Gateways!  \r" ,
     "'Computer systems have gone berserk!' \r" ,
     "'The rest was incoherent.  \r" ,
     "'Soon afterwards,Deimos simply  \r" ,
     "'vanished from the sky. Since then, \r" ,
     "'attempts to establish contact with \r" ,
     "'either moon have been unsuccessful. \r",
     "  < \r",
     "'You and your buddies, the only combat \r" ,
     "'troop for fifty million miles were  \r" ,
     "'sent up pronto to Phobos. You were  \r" ,
     "'ordered to secure the perimeter of  \r" ,
     "'the base while the rest of the team \r" ,
     "'went inside. For several hours, your \r" ,
     "'radio picked up the sounds of combat: \r" ,
     "'guns firing, men yelling orders,  \r" ,
     "'screams, bones cracking, then finally, \r" ,
     "'silence. Seems your buddies are dead. \r" ,
     "  < \r",
     "'IT'S UP TO YOU \r" ,
     "'Things aren't looking too good. \r" ,
     "'You'll never navigate off the  \r" ,
     "'planet on your own. Plus, all the  \r" ,
     "'heavy weapons have been taken by the \r" ,
     "'assault team leaving you with only a \r" ,
     "'pistol. If only you could get your  \r" ,
     "'hands around a railgun rifle or even \r" ,
     "'a shotgun you could take a few down on \r" ,
     "'your way out. Whatever killed your \r" ,
     "'buddies deserves a couple of pellets \r",
     "'in the forehead. Securing your helmet, \r" ,
     "'you exit the landing pod. Hopefully you \r" ,
     "'can find more substantial firepower \r" ,
     "'somewhere within the station. \r" ,
     "  < \r" ,
     "'As you walk through the main entrance \r" ,
     "'of the base, you hear animal-like \r" ,
     "'growls echoing throughout the distant \r" ,
     "'corridors.They know you're here. \r" ,
     "'There's no turning back now. \r" ,
     "'% \r"  
};

const char* const lvl2[] = {
      "'0002 \r",
      "'After blasting through a few undead  \r",
      "'skulls you begin to wonder how many  \r",
      "'of these creeps there are in this  \r",
      "'place.  \r",
      "' < \r",
      "'Furthermore, you begin to wonder  \r",
      "'who, or what, is controlling them  \r",
      "'and why?  \r",
      "'% \r"
};

const char* const lvl3[] = {
      "'0003 \r",
      "'You soon realize that every where \r",
      "'you go, these creatures seem to know \r",
      "'that you are coming \r",
      "' < \r"
      "'Perhaps killing all the enemies in \r",
      "'this particular sector will trip them \r",
      "'up enough for you to get the upper \r",
      "'hand... \r",
      "'% \r"      
};

const char* const lvl4[] = {
      "'0004 \r",
      "'You look around yourself as you enter \r",
      "'the next room. On the wall you see \r",
      "'the instructions for the sector's bay \r",
      "'door. \r",
      "' < \r",
      "'Turns out you must disable all of \r",
      "'the manual override switches in case \r",
      "'of emergency. I guess this would \r",
      "'be one of those times... \r",
      "'% \r" 
};  
    
const char* const lvl5[] = {
      "'0005 \r",
      "'As you step into the corridor \r",
      "'in front of you, the first thing \r",
      "'you notice is the humming, buzzing \r",
      "'and clanking resonating through the \r",
      "'walls. \r",
      "' < \r",
      "'This must be the Turbine Room, all \r",
      "'the power to the previous sector's \r",
      "'air handlers comes from here. \r",
      "' < \r",
      "'You grin as you recognize the sound \r",
      "'how about you just bust up these \r",
      "'turbines something feirce? Those \r",
      "'creeps shouldnt be sucking up your \r",
      "'air anyways! \r",
      "'% \r" 
};

const char* const lvl6[] = {
      "'0006 \r",
      "'After finding all kinds of useful \r",
      "'items in some of the sectors of the \r",
      "'complex, you begin to wonder if there \r",
      "'might be something here to help you \r",
      "'close the gateway. \r",
      "' < \r",
      "'As you walk through the doors of the \r",
      "'next sector you find a blueprint on \r",
      "'a desk to your right. It looks like \r",
      "'plans for a bomb of some sort... \r",
      "'% \r"
};

const char* const lvl7[] = {
      "'0007 \r",
      "'As you step off the elevator your feet \r",
      "'splash in water. Everything is dark. \r",
      "'It appears that you are in one of the \r",
      "'service corridors of the complex \r",
      "' < \r",
      "'Who knows what kind of evil could be \r",
      "'lurking in these dank, damp halls? \r",
      "'% \r"
      
};

const char* const lvl8[] = {
      "'0008 \r",
      "'When the door to the elevator opens, \r",
      "'the first thing you hear is the  \r",
      "'rattling of chains. Underneath that \r",
      "' sound you hear a swishing sound... \r",
      "' < \r",
      "'As you've been progressing through the \r",
      "'base, you've been noticing how it's \r",
      "'becoming more like a dungeon than a \r",
      "'base  \r",
      "' < \r",
      "'Maby the gateway is becoming more  \r",
      "'unstable, and the world beyond the  \r",
      "'gateway is starting to meld with  \r",
      "'your own... \r",
      "'% \r"  
};

const char* const lvl9[] = {
      "'0000@ \r",
      "'After trudging through what seemed \r",
      "'like an eternity of dark, tunnels \r",
      "'and dripping pipes, you breathe a \r",
      "'sigh of relief to see the familiar\r",
      "'two foot thick plexiglass of the \r",
      "'complex's roof.\r",
      "' < \r",
      "'Hmm... Weird, you just went through\r",
      "'the service tunnel leading up to the\r",
      "'simulation room and this room looks \r",
      "'a lot like the first room of the\r",
      "'complex...\r",
      " < \r", 
      "'Wait, now it looks nothing like any\r",
      "'other room in the base! And what's \r",
      "'with the lights? \r",
      " < \r",
      "'The virtual reality system must be on \r",
      "'the fritz. In order to find your way \r",
      "'in the other sectors you have to shut\r",
      "'the damn thing down. \r",
      "' < \r",
      "'The easiest way to do this is just \r",
      "'like they do it in the movies... \r",
      "'Just smash the controls. Namely, the\r",
      "'computer terminals you'll find around\r",
      "'this floor",
      "'% \r"
      
};

const char* const lvl10[] = {
      "'0000# \r",
      "'Someone shouts 'Please anybody, \r",
      "'help me!' as you step off of the \r",
      "'elevator. Apparantly not all of the \r",
      "'inhabitants of the base have been \r",
      "'killed. \r",
      "' < \r",
      "'Your prime directive is to close \r",
      "'the gateway, but your secondary \r",
      "'orders were to help free all of \r",
      "'the hostages you may find \r",
      "' < \r",
      "'Good thing your helmet is equpped \r",
      "'with a holographic navigation \r",
      "'system. \r",
      "' < \r",
      "'You set your navigation system to \r",
      "'help direct you towards the escape \r",
      "'pods located on this level. You \r",
      "'must get the disoriented hostages \r",
      "'to follow you to the escape pods. \r",
      "' < \r",
      "'Your navigation system will indicate \r",
      "'the location of an escape pod with \r",
      "'a ring of arrows with a circle in \r",
      "'the center. \r",
      "' < \r",
      "'You must be on your guard, it is \r",
      "'very likely that these creatures \r",
      "'have set up sentries to watch the \r",
      "'prisoners. And they will not give \r",
      "'up their captives without a fight. \r",
      "' % \r"   
};

const char* const lvl11[] = {
      "'0000* \r",
      "'You notice something is strange \r",
      "'about the floor in front of you \r",
      "'as you enter the next sector of \r",
      "'the base.",
      "' < \r",
      "'It takes you a minute or two to \r",
      "'realize what it is... \r",
      "' < \r",
      "'Its quiet in here, too quiet...\r",
      "'What are these things up to? \r",
      "' % \r"
};

const char* const lvl12[] = {
      "'0000^ \r",
      "'While the growling and shreiking \r",
      "'of the otherworldly monsters has \r",
      "'been a constant throughout the other \r",
      "'rooms of this sector, you hear a new \r",
      "'sound as you step off the elevator \r",
      "'this time... \r ",
      "'  < \r ",
      "'A zapping and hissing sound of \r",
      "'electricity floats to you on a \r",
      "'slight breeze from the air handlers. \r",
      "' < \r",
      "'It seems you are in one of the testing \r",
      "'rooms for the interdimensional gateways. \r",
      "'There have been rumors that the other \r",
      "'passageways out of these floors have \r",
      "'been shut down to make full use of the \r",
      "'gateways. \r",
      "' < \r",
      "'Let's just hope that they work...",
      "' % \r"
      
}; 
// ( indicator
const char* const lvl13[] = {
      "'0000( \r",
      "'You notice that these monsters \r",
      "'have been acting quite strange \r",
      "'ever since the portals sector \r",
      "' < \r",
      "'Perhaps you are getting close to \r",
      "'whatever or whomever is controling \r",
      "'these things...",
      " % \r"
};

const char* const lvl14[] = {
      "'0000) \r",
      "'CLOSING THE GATE: \r",
      "' < \r",
      "'After nearly getting your head \r",
      "'ripped off, blown off, and torn \r",
      "'off by the spawn of hell for the \r",
      "'past eight hours, you have finally \r",
      "'found your way to the base's Reactor \r",
      "'Core. \r",
      "' < \r",
      "'This must be what they were trying \r",
      "'to protect. They knew that if you \r",
      "'survived long enough, you'd be able \r",
      "'to start a reactor meltdown and \r",
      "'destroy the gates. Permanently \r",
      "'sealing their world off from ours \r",
      "' < \r",
      "'You chuckle a little as you set the \r",
      "'bomb you found earlier in your tour \r",
      "'of the wonderful rock named Phobos. \r",
      "' < \r",
      "'Alright, twenty five minutes should\r",
      "'be plenty of time to escape safely.\r",
      "'Blue wire to green wire... Okay,\r",
      "'...flip the switch \r", 
      "' < \r",
      "'What the hell? fifteen minutes? \r",
      "' < \r",
      "'Wait,five minuets? \r",
      "' < \r",
      "'six-h minuets!? \r",
      "' < \r",
      "'OH CRAP! I put the timer on up side \r",
      "'down! That wasn't twenty five minuets!\r",
      "'It was Fifty Two Seconds!!! \r",
      "' < \r",
      "'To avoid being vaporized in a highly \r",
      "'dramatic ball of flame, you break into \r",
      "'a mad dash for the escape pod on this \r",
      "'floor. \r",
      "' < \r",
      "'Just as you reach full sprint, the \r",
      "'chain reaction starts... You hear a \r",
      "'whooshing sound behind you and feel \r",
      "'the heat of the reactor, but don't \r",
      "'look back... \r",
      "' < \r",
      "'You reach the escape pod and blast \r",
      "'off. You just barely escaped total \r",
      "'disaster! \r",
      "' < \r",
      "'You watch the fading afterglow of \r",
      "'Phobos's explosion and rest your \r",
      "'head against the cool glass of the \r",
      "'escape pod's porthole as you make \r",
      "'your slow trip back to earth...",
      "' % \r"
};

int i;

FILE *fp;

if (fp = fopen("doomtext.bin" ,"wb" ))
{
      for (i = 0; i < sizeof(story) / sizeof(story[0]); i++)
      {
          fputs(story[i], fp);
      }
      for (i = 0; i < sizeof(lvl2) / sizeof(lvl2[0]); i++)
      {
          fputs(lvl2[i], fp);
      }
      for (i = 0; i < sizeof(lvl3) / sizeof(lvl3[0]); i++)
      {
          fputs(lvl3[i], fp);
      }
      for (i = 0; i < sizeof(lvl4) / sizeof(lvl4[0]); i++)
      {
          fputs(lvl4[i], fp);
      }
      for (i = 0; i < sizeof(lvl5) / sizeof(lvl5[0]); i++)
      {
          fputs(lvl5[i], fp);
      }
      for (i = 0; i < sizeof(lvl6) / sizeof(lvl6[0]); i++)
      {
          fputs(lvl6[i], fp);
      }
      for (i = 0; i < sizeof(lvl7) / sizeof(lvl7[0]); i++)
      {
          fputs(lvl7[i], fp);
      }
      for (i = 0; i < sizeof(lvl8) / sizeof(lvl8[0]); i++)
      {
          fputs(lvl8[i], fp);
      }
      for (i = 0; i < sizeof(lvl9) / sizeof(lvl9[0]); i++)
      {
          fputs(lvl9[i], fp);
      }
      for (i = 0; i < sizeof(lvl10) / sizeof(lvl10[0]); i++)
      {
          fputs(lvl10[i], fp);
      }
      for (i = 0; i < sizeof(lvl11) / sizeof(lvl11[0]); i++)
      {
          fputs(lvl11[i], fp);
      }
      for (i = 0; i < sizeof(lvl12) / sizeof(lvl12[0]); i++)
      {
          fputs(lvl12[i], fp);
      }
      for (i = 0; i < sizeof(lvl13) / sizeof(lvl13[0]); i++)
      {
          fputs(lvl13[i], fp);
      }
      for (i = 0; i < sizeof(lvl14) / sizeof(lvl14[0]); i++)
      {
          fputs(lvl14[i], fp);
      }
}

    return EXIT_SUCCESS;
}
