Beispiel #1
1
int main()
{
   initscr();
   keypad(stdscr, TRUE);
   noecho();
   start_color();
   init_pair(1, COLOR_GREEN,   COLOR_BLACK);
   init_pair(2, COLOR_MAGENTA, COLOR_BLACK);
   finit(9,9,0,2);
   clear();
   printw(
   "      Etherial Void   \n\n"
   "Is it that all exists only in the\n"
   "etherial landscape of the mind?\n\n"
   "The past is uncertian,\n\n"
   "The present is now the past,\n\n"
   "The future might only be thought of.\n\n"
   "Is then not our mind's eye\n"
   "the root of reality?\n\n"
   "But should that eye be blind,\n"
   "where then would rest the soul?"
   "\n\n"
   "(press any key to continue)\n");
   getch();
   clear();
   printw(
   "   I look,\n"
   "but I see nothing.");
   getch();
   clear();
   getch();
   printw(
   "   Perhaps,\n"
   "there is nothing to see.");
   getch();
   helpmsg="Use the arrow keys or WASD to move the charecter.";
   clear();
   while(loop)
   {  
      switch(z)
      {  
         case 0:
            nroom=1;
            eroom=2;
            sroom=3;
            wroom=4;
            uroom=5;
            light=2;
            wall=
            "Some sort of wall mesage should be displayed here,\n"
            "It should inform the player of the solidity of this wall,\n"
            "and it should warn that attempts to surpass this fact are admonishable.";
            
            msg(9,6,
            "   I <do> see something:\n"
            "There seem to be dimly glowing etchings on the ground which signify,\n"
            "'There is naught to the north.'");

            msg(12,9,
            "   There is <something> here:\n"
            "In the ground there are shallow grooves filled with a\n"
            "faintly luminescent material. I cannot comprehend them.");
            if(sw[0]&&sw[1]&&sw[2]&&sw[3])
            {
               map[0][9][9]='^';
               smsg(9,9,
               "This is a new stairwell.");
            }
            break;
         case 1:
            sroom=0;
            lvr(9,9,0);
            break;
         case 2:
            wroom=0;
            wall=
            "There are some large deep grooves on the wall";
            lvr(9,9,1);
            break;
         case 3:
            nroom=0;
            lvr(9,9,2);
            break;
         case 4:
            eroom=0;
            lvr(9,9,3);
            break;
         case 5:
            eroom=6;
            droom=1;
            break;
         case 6:
            wroom=5;
            break;
         default:
            endwin();
            printf("Error: 42\n");
            loop=0;
            exit(42);
      }
      unmove();
      uncover(0);
      showmap();
      input();
   }
   endwin();
   return 0;
}
Beispiel #2
0
int main(void)
{
printf(	
   "\n   I am now awake,\n"
   "I know this because when my eyes where closed "
   "I saw nothing but black darkness,\n"
   "and now that my eyes are open I see nothing...\n"
   "...but white fog.\n\n"

   "   I get up,\n"
   "I feel sturdy ground beneath my feet,\n"
   "but an infernal abyss inside my mind.\n");
   while(loop==1)
   {
      
      if(z == 0)
      {
         /*-input,cls&roommsg-*/
         
         takeinp();
         int i; for(i=0; i != 60; i++) printf("\n"); // clear screen
         rmsg("type w a s or d to move.\n");
         
         /*-walls&objects-*/
         
         room(0,8,0,8,
         "   I see a great white wall forever rising to infinity...\n"
         "...How bland.");
         
         elev(6,2,4,13,1,
         "   An elegant glass box materializes out of the mist,\n"
         "it has a height twice its length and width,\n"
         ">>I wonder if I should go inside, Yes or No : ",
         "I decide not to enter the box.");
         
         /*switches&effects*/
         
         lvr(0,2,6,"I have found a lever. Do I pull it? ",
         "",
         "I have already pulled this lever.");
         
         /*-map&coordinates-*/
         
         showmap(9,9,2,map0);
         printf("%i,%i,%i\n",x,y,z);
      
      }
      if(z == 1)
      {
         /*-input,cls&roommsg-*/
         
         takeinp();
         int i; for(i=0; i != 60; i++) printf("\n"); // clear screen
         rmsg(
         "   I step into the elevator and the machine begins to hum\n" 
         "as the doors close behind me.\n"
         "I notice the elevator has no buttons inside as it starts to move.\n"
         "The elevator continues for a time.\n\n"

         "   The doors open with a hiss.\n"
         "I step outside and look at the space where I have been deposited,\n"
         "The white mist is still there, but I can see the ceiling now.\n" 
         "There is a three dimensional network of pipes on the aforementioned ceiling.\n");
         
         /*-walls&objects-*/

         char wall[] =
         {"   I see a network of pipes barring my way in that direction,\n"
          "some of the tubes rising to the ceiling are warm "
          "and others are very cold."};
         char pillar[] =
         {"   There is an unstable pillar before me.\n"
          "It reminds me of the foundation to all logic and reason."};
         
         block(2,2,11,14,wall);
         block(6,6,11,14,wall);
         block(3,5,14,14,wall);
         block(1,3,8, 10,"you hit a tube");
         block(5,7,8, 10,"you hit a tube");
         block(0,0,0, 8 ,wall);
         block(8,8,0, 8 ,wall);
         block(0,8,0, 0 ,wall);
         block(4,4,6, 6 ,pillar);
         block(6,6,4, 4 ,pillar);
         block(4,4,2, 2 ,pillar);
         block(2,2,4, 4 ,pillar);
         
         elev(4,12,6,3,0,"I see an elevator, enter? ","I don\'t enter.");

         /*switches&effects*/
         
         if(sw[0])
         {
	        map1[4][4]='E';elev(4,4,9,9,2,
            "I see an elevator, enter? ",
            "I don\'t enter.");
         }
         else 
         {
		    msg(4,4,4,4,
            "   My foot scrapes against a rough spot on the ground,\n"
            "I look down and see a complex geometric design,\n"
            "surrounded by an inscription:\n\n"
         
            "      2,6,0");
         }

         /*-map&coordinates-*/

         showmap(15,9,2,map1);
         printf("%i,%i,%i\n",x,y,z);
      
      }
      if( z== 2)
      {
	      /*-input,cls&roommsg-*/
	      takeinp();
         int i; for(i=0; i != 60; i++) printf("\n"); // clear screen
         rmsg(
         "A voice echoes throught the room;\n\n"

         "\"Welcome to the Infinite Cube,\n"
         "The Cube is a prototype in alternate-reality technology.\n"
		 "You may ask how we know this space is a cube if it is, as has been previously stated, infinite.\n"
		 "Don\'t.\n\n"
         "It consists of several levels,\n"
         "designed to test your mental abilities,\n"
         "which are being enhanced by experiments in the real world.\n"
         "You are perfectly safe...\n\n" 
         "... as far as we know.\"");
         
         /*-walls&objects-*/
         char cube[]=
         {"   You see a large cube.\n"
          "It is inscribed with strange symbols.\n"
          "They seem to indicate the turning of a lever...\n"
          "...this is giving me second thoughts about turning that lever."};
                  
         block(4 ,6 ,8 ,10,cube);
         block(8 ,10,4 ,6 ,cube);
         block(12,14,8 ,10,cube);
         
         char wall[]=
         {""};
         
         block(7 ,11,0 ,0, wall);
         block(5 ,7 ,0 ,5 ,wall);
         block(0 ,5, 5, 7 ,wall);
         block(0 ,0 ,7 ,11,wall);
         block(0 ,5 ,11,13,wall);
         block(5 ,7 ,13,18,wall);
         block(7 ,11,18,18,wall);
         block(11,13,13,18,wall);
         block(13,18,11,13,wall);
         block(18,18,7 ,11,wall);
         block(13,19,5 ,7 ,wall);
         block(11,13,0 ,5 ,wall);

         //...cont. in book
         
         /*switches&effects*/
         lvr(1,9,11,"I see a lever, do I pull it? ",
         "",
         "I already pulled the lever");
         
         if(sw[1])
         {
	        map2[13][9]=' ';
	        msg(8 ,10,12,14,
	        "I see the cube around me,\n"
	        "but I can't touch it.");
		 }
         else
         {block(8 ,10,12,14,cube);}
         
         /*-map&coordinates-*/
         showmap(19,19,4,map2);
         printf("%i,%i,%i\n",x,y,z);
         
	  }
   
   
   }
  return 0 ;
}
Beispiel #3
0
int main()
{  finit( 9, 9, 0, 3);
   int n; /* having a spare int is useful. */
   time_t t;
   printw(
   "   This game is so interesting and meaningfull\n"
   "and the reasons why are explained in this message...\n"
   "...which may or may not be complete\n"
   "\n"
   "(press any 3 keys to continue)\n");
   getch();
   getch();
   getch();
   clear();

   #include "objects.h"

   while(loop)
   {  
      switch(z)
      {  
         case 0:
            uroom[0]=5;
            wroom[0]=1;
 
            wall=
            "Some sort of wall mesage should be displayed here,\n"
            "It should inform the player of the solidity of this wall,\n"
            "and it should warn that attempts to surpass this fact are admonishable.";

            event(11,11,30,"hello");
            event(11,11,31,"hello again");
            event(11,11,32,"hello a third time");

            mesage[0][0].x  =12;
            mesage[0][0].y  =12;
            mesage[0][0].ch='*';
            mesage[0][0].hit="Hello sir, this is a structure mesage";
 
            msg(8,9,
            "THIS SPOT IS IMPORTANT FOR THIS REASON");
            smsg(2,9,
               "   This spot is UBER important :)\n"
               "It clears the screen to show you something!!!! \n");
            smsg(2,9,
               "   And it can do it twice!!!\n");
            smsg(2,9,
               "\n"
               "And thrice as well!!! :)");
            if(sw[0])
            {
               smsg(9,9,
               "This is a new stairwell.");
            }
            break;
         case 1:
            wall=
            "this is a wall in room 1";
            droom[1]=2;
            eroom[1]=0;
            sroom[1]=4;
            break;
         case 2:
            wall=
            "this is a more interesting wall in room 2";
            sroom[2]=3;
            uroom[2]=1;
            break;
         case 3:
            wall=
            "in room 3, the wall is so interesting, it's unsurpassable...";
            nroom[3]=2;
            break;
         case 4:
            wall=
            "...when it's not compared to these walls in room 4\n"
            "(see room 3's walls)";
            
            smsg(6,14,
            "   this is an object of\n"
            "INSURMOUNTABLE POWER...\n"
            "It will somehow help you on your\n"
            "QUEST,\n"
            "(which has neither been defined nor\n"
            "ACCEPTED)...\n"
            "\n"
            "...once the master programmer imbues\n"
            "it with the power to do such.\n"
            "\n"
            "Until then, walk from here back to\n"
            "THE BEGINING,\n"
            "and from there to here 9 times 7.\n"
            "\n");
             
            smsg(6,14,
            "+-----------------------------------+"
            "|                                   |"
            "|                                   |"
            "|            ????                   |"
            "|          ??  ? ???                |"
            "|            ??     ??              |"
            "|             ####    ?   ####      |"
            "|          ###    ##   ? ##  ##     |"
            "|        ##     ?   #  ?     ##     |"
            "|      ##     ?   o   ?     ##      |"
            "|     ##     ?  #   ?     ##        |"
            "|     ##  ## ?   ##    ###          |"
            "|      ####   ?    ####             |"
            "|              ??     ??            |"
            "|                ??? ?  ??          |"
            "|                   ????            |"
            "|                                   |"
            "|                                   |"
            "+-----------------------------------+");

            smsg(6,14,
            "   The Master Programmer hath spoken."
            "He hath declared that the way forth  "
            "shall become clear if you retrace    "
            "your steps to your point of origin.  ");

            lvr(6,14,0);
            if(sw[0]==1)
            {
               map[0][9][9]='^';
               sw[0]==2;
            }
            nroom[4]=1;
            break;
         case 5:
            wall=
            "there is nothing extra-ordinary about these walls";
            droom[5]=0;
            nroom[5]=6;
            smsg(9,8,
            "\n\n\n   Time:\n"
            "all encompasing,\n"
            "inescapable...\n");
            
            smsg(9,1,
            "\n\n\n...incorporeal.\n\n"
            "   In Time\n" /* "Time" which refers to the clock, is a proper noun in this case*/
            "The Trinity will point forward...");

            lvr(9 , 4,1);
            lvr(13, 5,2);
            lvr(14,9 ,3);
            lvr(13,13,4);
            lvr(9 ,14,5);
            lvr(5 ,13,6);
            lvr(4 , 9,7);
            lvr(5 , 5,8);

            if(sw[1]&&sw[3]&&sw[5]&&sw[7]||sw[2]&&sw[4]&&sw[6]&&sw[8])
            {
               sw[1]=0;
               sw[2]=0;
               sw[3]=0;
               sw[4]=0;
               sw[5]=0;
               sw[6]=0;
               sw[7]=0;
               sw[8]=0;
            }
            if(sw[1]&&sw[4]&&sw[6]||sw[2]&&sw[5]&&sw[7]||sw[8]&&sw[5]&&sw[3])
            {
               map[5][0][ 8]=' ';
               map[5][0][ 9]=' ';
               map[5][0][10]=' ';
            }
            else
            {
               map[5][0][ 8]='-';
               map[5][0][ 9]='-';
               map[5][0][10]='-';
            }
            
            if(time(NULL)>t)
            {
            int a,b,c,d,e,f,g,h;
            a=sw[1]; //rotate lvrs
            b=sw[2];
            c=sw[3];
            d=sw[4];
            e=sw[5];
            f=sw[6];
            g=sw[7];
            h=sw[8];
            sw[1]=h;
            sw[2]=a;
            sw[3]=b;
            sw[4]=c;
            sw[5]=d;
            sw[6]=e;
            sw[7]=f;
            sw[8]=g;
            }
            t=time(NULL);
            break;
         case 6:
            sroom[6]=5;
            uroom[6]=7;

            map[5][0][ 8]=' ';
            map[5][0][ 9]=' ';
            map[5][0][10]=' ';

            msg( 9, 9,
            "...all will be of one substance...");

            lvr( 6, 6, 9);
            lvr(12, 6,10);
            lvr( 9, 7,11);
            lvr( 7, 9,12);
            lvr(11, 9,13);
            lvr( 9,11,14);
            lvr( 6,12,15);
            lvr(12,12,16);

            if(sw[ 9]==1)
            {
               flip(13);
               flip(14);
               sw[ 9]=2;
            }
            if(sw[10]==1)
            {
               flip(12);
               flip(14);
               sw[10]=2;
            }
            if(sw[11]==1)
            {
               flip(15);
               flip(16);
               sw[11]=2;
            }
            if(sw[12]==1)
            {
               flip(10);
               flip(16);
               sw[12]=2;
            } 
            if(sw[13]==1)
            {
               flip( 9);
               flip(15);
               sw[13]=2;
            }
            if(sw[14]==1)
            {
               flip( 9);
               flip(10);
               sw[14]=2;
            }
            if(sw[15]==1)
            {
               flip(13);
               flip(11);
               sw[15]=2;
            }
            if(sw[16]==1)
            {
               flip(11);
               flip(12);
               sw[16]=2;
            }
            lvr( 6, 6, 9);
            lvr(12, 6,10);
            lvr( 9, 7,11);
            lvr( 7, 9,12);
            lvr(11, 9,13);
            lvr( 9,11,14);
            lvr( 6,12,15);
            lvr(12,12,16);
            if(sw[9]&&sw[10]&&sw[11]&&sw[12]&&sw[13]&&sw[14]&&sw[15]&&sw[16])
              {map[6][9][9]='^';}
            
            break;
         case 7:
            uroom[7]=8;
            droom[7]=6;
            lvr( 5, 5,17);
            lvr(13, 5,18);
            lvr(13,13,19);
            lvr(5 ,13,20);
            
            for(n=17;n<20;n++)
            {
               if(sw[n]==1)
               {
                  flip(n+4);
                  flip(n+1);
                  flip(n);
               }
            }
            if(sw[20]==1)
            {
               flip(17);
               flip(24);
               flip(20);
            }
            mlvr( 5, 5,17);
            mlvr(13, 5,18);
            mlvr(13,13,19);
            mlvr(5 ,13,20);

            break;
         case 8:
            uroom[8]=9;
            droom[8]=7;

            lvr( 9, 9,30);

            lvr( 5, 5,21);
            lvr(13, 5,22);
            lvr(13,13,23);
            lvr(5 ,13,24);
            
            for(n=22;n<=24;n++)
            {
               if(sw[n]==1)
               {
                  flip(n-1);
                  flip(n+4);
                  flip(n-4);
                  flip(n);
               }
            }
            if(sw[21]==1)
            {
               flip(24);
               flip(25);
               flip(17);
               flip(21);
            }
            if(sw[30]==1)
            {
               int a,b,c,d;
               a=sw[21];
               b=sw[22];
               c=sw[23];
               d=sw[24];
               sw[21]=b;
               sw[22]=c;
               sw[23]=d;
               sw[24]=a;
               flip(30);
            }

            mlvr( 9, 9,30);
            mlvr( 5, 5,21);
            mlvr(13, 5,22);
            mlvr(13,13,23);
            mlvr(5 ,13,24);
            break;
         case 9:
            droom[9]=8;
            uroom[9]=10;
            lvr( 9, 9,29);

            lvr( 5, 5,25);
            lvr(13, 5,26);
            lvr(13,13,27);
            lvr(5 ,13,28);
            
            for(n=25;n<28;n++)
            {
               if(sw[n]==1)
               {
                  flip(n+1);
                  flip(n-4);
                  flip(n);
               }
            }
            if(sw[28]==1)
            {
               flip(25);
               flip(24);
               flip(28);
            }
            if(sw[29]==1)
            {
               int a,b,c,d;
               a=sw[25];
               b=sw[26];
               c=sw[27];
               d=sw[28];
               sw[25]=d;
               sw[26]=a;
               sw[27]=b;
               sw[28]=c;
               flip(29);
            }
            mlvr( 5, 5,25);
            mlvr(13, 5,26);
            mlvr(13,13,27);
            mlvr(5 ,13,28);

            break;
         default:
            endwin();
            printf("ERROR THE PROGGRAMMER HAS YET TO MAKE THIS LEVEL!!!\n");
            loop=0;
            return 1;
      }
      mesages();
      levers();
      BlockMessage();
      uncover(1);
      showmap();
      input();
   }

   endwin();
   return 0;
}