⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tess.c

📁 焰火演示
💻 C
📖 第 1 页 / 共 4 页
字号:
  }

  else
    not_work();
}

/*----------------------------*/
int stack_say( char *s )
{
  cprintf("Stack: ");
  if (*s) prints( s );
  return( 1 );
}

do_scan()
{
  char *s;
  int flag;

  s = "stack potential non-zero, pushing allowed.";
  flag = 0;

  if (!ObjOnPlayer(o_stack))
    PrintMess( 7 );

  else if (gp)
  {
    prints("Something has rendered the stack inoperative.");
    return;
  }

  else if (cmd.nn==0)
  {
    if (InMirrorWorld( curr_loc ) || InMathWorld( curr_loc ) ||
        InSpectralWorld( curr_loc ))
      flag = stack_say("stack level non-zero, popping allowed.");

    if (curr_loc<=3)
      flag = stack_say( s );

    if (curr_loc==18)
      flag = stack_say("magnetic field present.");

    if (curr_loc==obj[o_plant].loc)
      flag = stack_say("sonic harmony present.");

    if (curr_loc==16)
      flag = stack_say("field certainty probably not stable");

    if (!flag)
      stack_say("nothing special to report.");
  }

  else
  {
    stack_say( "" );
    switch ( cmd.nn )
    {
      case o_mirror:
      case o_crt:
      case o_hole:
        prints( s );
        break;

      case o_plant:
        cprintf("4-D.  ");
        if (!wa)
          prints("dehydrated.  weak audio output.");
        else
          prints("healthy.  strong audio output.");
        break;

      case o_stack:
        prints("Stack operational.");
        break;

      case o_audio:
        if (!af)
          prints("no filter.");
        else
          prints("filter active.");
        break;

      case o_pills:
        prints("edible.  barbiturate.");
        break;

      case o_fluid:
        prints("extremely cold.  superconductive.  superfluid.");
        break;

      case o_prism:
        prints("brittle.  light sensitive.");
        break;

      case o_coil:
        prints("composition = yttrium, barium, copper, oxygen.");
        if (cc)
        {
          cprintf("Stack: properties = ");
          if (cc & 1) cprintf("superconductive.  ");
          if (cc & 2) cprintf("magnetic.  ");
          if ((cc & 3)==3) cprintf("strong magnetic field present.");
          nl();
        }
        break;

      case o_plasma:
        prints("extremely hot.");
        break;

      case o_solid:
        prints("4-D.  solid.");
        break;

      case o_liquid:
        prints("4-D.  liquid.");
        break;

      case o_tetra:
        prints("color sensitive.  omni-stable.");
        break;

      default:
        prints("nothing special to report.");
        break;

    } /* switch */
  } /* else */
}

/*----------------------------*/
do_solve()
{
  int nn;
  v_word noun;

  if (cmd.nn==o_zeta)
  {
    nn = InputNoun("With what? ", noun );
    if (!nn)
      not_work();

    else if (!ObjIsPresent(nn))
      not_yet();

    else if (nn!=o_func)
      prints("Not difficult, although for someone like you it's too still hard.");

    else
    {
      prints("The function and the integral cancel out nicely");
      prints("and everything is reduced to a singularity.");
      ReplaceObj( cmd.nn, o_sing );
      JunkObj( o_func );
    }
  }

  else if (cmd.nn==o_func)
    prints("You are not really into great episodes of frustration.");

  else if (cmd.nn==o_improb)
    prints("It's improbable that you can solve it.");

  else
    not_work();
}

/*----------------------------*/
do_think()
{
  if (!InDreamWorld(curr_loc))
    prints("Therefore you are.");

  else if (curr_loc!=25)
    prints("This is not a good place to think.");

  else if (!ti)
  {
    prints("You thought of an idea.");
    CarryObj( o_idea );
    ti = 1;
  }

  else
    prints("You are out of ideas.");
}

/*----------------------------*/
do_burn()
{
  if (!ObjIsPresent(o_plasma))
    not_yet();

  else
    prints("Don't be a pyromaniac.");
}

/*----------------------------*/
do_evap()
{
  if (!ObjIsPresent(o_plasma))
    not_yet();

  else if (cmd.nn==o_fluid)
  {
    prints("The fluid evaporates.");
    JunkObj( cmd.nn );
  }

  else
    do_burn();
}

/*----------------------------*/
do_climb()
{
  if (cmd.nn==o_plant)
    prints("That isn't very polite, and besides, it's not a beanstalk.");

  else if (cmd.nn==o_mount)
    prints("There are no rivers on the mountain.");

  else
    not_poss();
}

/*----------------------------*/
do_cut()
{
  switch( cmd.nn )
  {
    case o_prism:
      prints("It's already pre-cut.");
      break;

    case o_tetra:
      prints("It is easily cut, but the cuts immediately reseal themselves.");
      break;

    case o_strip:
      prints("With some tricky cuts, you end up with a mobius strip again.");
      break;

    case o_bottle:
      prints("The bottle breaks into a mobius strip.");
      ReplaceObj( cmd.nn, o_strip );
      if (obj[o_liquid].loc==-8)
      {
        prints("The liquid in the bottle falls to the ground.");
        DropObj( o_liquid );
        if (curr_loc==obj[o_plant].loc)
        {
          cmd.nn=o_plant;
          do_water();
        }
      }
      break;

    case o_plant:
    case o_solid:
    case o_liquid:
      prints("Such low dimension cuts has no effect.");
      break;

    default:
      not_work();
  }
}

/*----------------------------*/
do_join()
{
  if (cmd.nn==o_group)
    prints("You're too finite.");
  else
    not_poss();
}

/*----------------------------*/
do_sing()
{
  if (curr_loc==obj[o_plant].loc)
    prints("Your singing can't possible compete with the hyper-melody.");

  else
    not_happen();
}

/*----------------------------*/
/*
*/
DoCommand()
{
  if (cmd.vn<=6
      || (cmd.vn>=39 && cmd.vn<=48) || cmd.vn==50 || cmd.vn==52
      || cmd.vn==58 )
    goto branch; /* noun-less verbs */

  if (cmd.nn==0)     /* no noun given */
  {
    if (cmd.vn==11)  /* special case for cmd="look" */
      goto branch;
    else
    {
      cprintf("%s what?", cmd.verb ); nl();
      return;
    }
  }

  if (obj[cmd.nn].loc==-9)
  {
    prints("Be more specific in naming the object");
    return;
  }

  if (!ObjIsPresent(cmd.nn))
  {
    prints("That object is not here.");
    return;
  }

branch:
  switch ( cmd.vn )
  {
    case 1:
    case 2:
    case 3:
    case 4: do_dir(); break;
    case 5: do_inv(); break;
    case 6: do_go(); break;
    case 7: do_get(); break;
    case 8: do_drop(); break;
    case 9: do_throw(); break;
    case 10: do_break(); break;
    case 11: do_look(); break;
    case 12: do_read(); break;
    case 13: do_use(); break;
    case 14: do_touch(); break;
    case 15: do_swing(); break;
    case 16: do_rub(); break;
    case 17: do_push(); break;
    case 18: do_pop(); break;
    case 19: do_spin(); break;
    case 20: do_roll(); break;
    case 21: do_wear(); break;
    case 22: do_eat(); break;
    case 23: do_taste(); break;
    case 24: do_drink(); break;
    case 25: do_remove(); break;
    case 26: do_water(); break;
    case 27: do_fill(); break;
    case 28: do_pour(); break;
    case 29: do_freeze(); break;
    case 30: do_melt(); break;
    case 31: do_play(); break;
    case 32: do_insert(); break;
    case 33: do__y_(); break;
    case 34: do_prove(); break;
    case 35: do_fix(); break;
    case 36: do_smell(); break;
    case 37: do_close(); break;
    case 38: do_open();break;
    case 39: do_stop(); break;
    case 40: do_say(); break;
    case 41: do_quit(); break;
    case 42: do_help(); break;
    case 43: do_listen(); break;
    case 44: do_save(); break;
    case 45: do_load(); break;
    case 46: do_score(); break;
    case 47: do_sleep(); break;
    case 48: do_wake(); break;
    case 49: do_give(); break;
    case 50: do_scan(); break;
    case 51: do_solve(); break;
    case 52: do_think(); break;
    case 53: do_burn(); break;
    case 54: do_evap(); break;
    case 55: do_climb(); break;
    case 56: do_cut(); break;
    case 57: do_join(); break;
    case 58: do_sing(); break;
    default: cprintf( "I don't know how to %s.", cmd.verb );  nl();
  }
}

/*----------------------------*/
Ending( int n )
{
  switch ( n )
  {
    case 1:
      prints("Game Over");
      break;

    case 2:
      prints("Incorrect password.");
      prints("Self-destruct aborted.  Resuming Doomsday countdown.");
      prints("5\n4\n3\n2\n1\n\nEarth destro...");
      break;

    case 3:
      prints("Correct password.");
      prints("Self-destruct sequence completed.  Overriding Doomsday countdown.");
      prints("5\n4\n3\n2\n1\n\nKaboom...");

      if (!ObjIsPresent(24))
      {
        prints("The Doomsday complex is destroyed.\n");
        prints("You have given your life to save Earth.  Thank you.");
      }
      else
      {
        prints(
        "As the complex disintegrates around you, the stack, sensing your\n"
        "danger, overloads all it's circuits to regain a moment's control.\n"
        "With a final burst of energy, the stack implodes, projecting a\n"
        "stasis field around you that protects you from the destruction.\n"
        "...\n"
        "From the smoldering debris of the Doomsday complex you pick up the\n"
        "pieces of the stack and reflect on how as you risked your life to\n"
        "save Earth, the stack has given its own to save yours.  As you walk\n"
        "away, you solemnly swear to repair the stack, for the adventures that\n"
        "lie ahead.\n"
        );
      }
      break;
  }
}

/*----------------------------*/
/*
*/
intro1()
{
  prints("               /*--------------/*       ------------------------------------");
  prints("             /  '            /  '        Beyond The Tesseract         V2.03 ");
  prints("           /   '|          /   '|                                           ");
  prints("        */----'---------*/    ' |        An abstract text adventure         ");
  prints("       '|    '  |      '|    '  |       ------------------------------------");
  prints("      ' |   '   |     ' |   '   |        This adventure is free software.   ");
  prints("     '  |  '   /*----'--|--'---/*        If you like this program, hate it, ");
  prints("    '   | '  /  '   '   | '  /  '        or really don't care at all, then  ");
  prints("   '    |' /   '   '    |' /   '         I would be happy to hear from you. ");
  prints("  '    /*/----'---'----/*/    '                                             ");
  prints(" '   /  '    '   '   /  '    '             David Lo                         ");
  prints("'  /   '|   '   '  /   '|   '              4516 Albert St.                  ");
  prints("*/----'----'----*/    ' |  '               Burnaby, B.C., Canada            ");
  prints("|    '  | '     |    '  | '                V5C 2G5                          ");
  prints("|   '   |'      |   '   |                  email c/o: dlo@idacom.cs.ubc.ca  ");
  prints("|  '   /*-------|--'---/*'                                                  ");
  prints("| '  /          | '  /                   Please share unmodified copies of  ");
  prints("|' /            |' /                     this adventure with everyone.      ");
  prints("*/--------------*/                      ------------------------------------");
  prints("                                         (C) 1990 David Lo                  ");
}

intro()
{
  int i,j,k;

  clrscr();
  intro1();
  prints("Press <Enter> to continue");
  i=get_enter();
  clrscr();

  prints("Scenario:");
  prints("  You have reached the final part of your mission.  You have gained access");
  prints("  to the complex, and all but the last procedure has been performed.  Now");
  prints("  comes a time of waiting, in which you must search for the hidden 12-word");
  prints("  message that will aid you at the final step.  But what choice will you");
  prints("  make when that time comes?");

  prints("");
  prints("Instructions:");
  prints("  This adventure recognizes the standard commands for moving (N,E,S,W),");
  prints("  taking inventory (I), maninpulating objects (GET, DROP, LOOK), and");
  prints("  saving games (SAVE, LOAD), as well as many others.  Use 2-word 'verb noun'");
  prints("  commands, such as 'use stack' or 'get all'.  Only the first four letters");
  prints("  of each word are significant.  The adventure recognizes about 200 words,");
  prints("  so if one word doesn't work, try another.");

  prints("");
  prints("Happy adventuring!");
  prints("");

  prints("Press <Enter> to begin");
  j=get_enter();
  clrscr();
  srand( i*i + j + k );
}

/*------------------------------------------------------------*/
main()
{
  int i, keep_playing;

  intro();

  do
  {
    InitAdv();
    clrscr(); gotoxy( 1,25 );

    do
    {
      gp = InComplex(curr_loc) && (mi==15);

#ifdef tty
      if (print_room)
      {
        PrintCurrRoom();
        print_room=0;
      }
#endif

      if (gp)
        prints("A voice echoes: audio link complete.  Enter password.");

#ifndef tty
      PrintCurrRoom();
#endif

      if (InDreamWorld( curr_loc ))
        printf("(sleeping) ");
      else if (InBookWorld( curr_loc ))
        printf("(reading) ");

      cprintf("Enter command: ");
      gets( cmd.cm );
      if (cmd.cm[0])
      {
        AnalyseCommand( &cmd );
        DoCommand();
        nl();
      }
    }
    while ( !zap );

    Ending( zap );
    nl();
    cprintf("Play again (y/n)? ");
    gets( cmd.cm );
    keep_playing = (tolower(cmd.cm[0])!='n');
    nl();
  }
  while ( keep_playing );
  clrscr();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -