home *** CD-ROM | disk | FTP | other *** search
/ The Best of Select: Games 3 / cd.iso / games / dcg303xa / guard.scr < prev    next >
Text File  |  1993-06-27  |  5KB  |  207 lines

  1. !
  2. ! Default Guard's script
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - I need to create a voice file (.VFL) with voices for this script.
  9. !   Look at the 'voice()' entries to see what voices it would play if
  10. !   they were available.  These voices could even be placed in the
  11. !   system's voice file (DCSOUNDS.VFL) in which case the voice command
  12. !   should read 'voice( xxxx, 1000 )'.
  13. !
  14.  
  15. !------------------------------------------------------------------------!
  16. :@TALK ! Talk to the character !
  17. !------------------------------------------------------------------------!
  18.  
  19.   if player.hp = 0 then
  20.     writeln( player.name, " is dead!" );
  21.     STOP;
  22.   endif;
  23.  
  24.   if npc.picture >= 0 then
  25.     viewpcx(npc);
  26.   endif;
  27.  
  28.   if npc.v1 = 1 then
  29.     writeln( "Hello again.  How may I help you?" );
  30.     GOTO CHAT;    ! Once a password is given, just talk !
  31.   endif;
  32.  
  33.   if npc.v1 = 2 then
  34.     writeln( "Can't you see I'm off duty?  Get lost.." );
  35.     GOTO CHAT1;
  36.   endif;
  37.  
  38.   if npc.v0 = 0 then
  39.     writeln( "Halt!  Identify yourself!" );
  40.     voice( "Halt1" );
  41.   else
  42.     writeln( "I told you to get lost!  What are you doing back here?" );
  43.     voice( "Halt2" );
  44.   endif;
  45.  
  46.   npc.v0 = 1;   ! We've been here !
  47.   L0 = 0;       ! Count number of bribe attempts !
  48.   L1 = 0;       ! Count number of password attempts !
  49.  
  50. :LOOP
  51.   L3 = select( "Leave","Fight Guard","Give Money","Give Password","Talk" );
  52.   ON L3 GOTO XLEAVE, XFIGHT, BRIBE, PSWRD, TRYCHAT;
  53.  
  54. :XLEAVE
  55.   writeln( "And don't come back!" );
  56.   goto XSTOP;
  57.  
  58. :TRYCHAT
  59.   writeln( "No unauthorized person is allowed in this area.." );
  60.   writeln( "Please leave." );
  61.   goto LOOP;
  62.  
  63. !
  64. ! Fight with the guard..
  65. !
  66. :@ATTACK   !- Guards handle their own ATTACK -!
  67. :XFIGHT
  68.   writeln( "You asked for it!" );
  69.   voice( "Fight" );
  70.   npc.type = HOSTILE;
  71.   ! Don't forget to restore the picture !
  72.   if npc.picture >= 0 then
  73.     paint(window); ! Assumes the picture fits in the window !
  74.   endif;
  75.   FIGHT;
  76.  
  77. !
  78. ! Bribe the guard..
  79. !
  80. :BRIBE
  81.   if npc.value = 0 GOTO NOBRIBE; ! Can't bribe this guy.. !
  82.  
  83.   writeln( "You try to bribe the guard.." );
  84.   L4 = getnum("How much do you give?") * 10; ! Convert GOLD to silver !
  85.  
  86.   if L4 < npc.value then
  87.     writeln( "It would take a LOT more than ", $L4, " gold pieces.." );
  88.     voice( "More" );
  89.     goto LOOP;
  90.   endif;
  91.  
  92.   if L4 > group.gold then
  93.     writeln( "You don't have enough gold." );
  94.     voice( "Broke" );
  95.     goto LOOP;
  96.   endif;
  97.  
  98.   writeln( "Now that I think about it, it's time for my break.." );
  99.   voice( "Bribe" );
  100.   dec( group.gold, L4 );
  101.   npc.v1 = 2;
  102.   goto XSTOP;
  103.  
  104. :NOBRIBE
  105.   if L0 > 0 GOTO XFIGHT;
  106.   writeln( "Leave now, before I get really mad.." );
  107.   voice( "NoBribe" );
  108.   inc( L0 );
  109.   goto LOOP;
  110.  
  111. !
  112. ! Give the password
  113. !
  114. :PSWRD
  115.  
  116.   writeln( "What is the password?" );
  117.   L3 = getstr(); ! The Password !
  118.   if s4 for 8 = s0 then
  119.     writeln( "Thank you. You are now authorized to pass." );
  120.     voice( "Pass" );
  121.     npc.v1 = 1;              ! Disactivates guard feature !
  122.     goto XSTOP;
  123.   endif;
  124.  
  125.   ON L1 GOTO PSWRD1,PSWRD2,PSWRD3;
  126.   writeln( "I warned you!" );
  127.   voice( "Fight" );
  128.   FIGHT;
  129.  
  130. :PSWRD1
  131.   writeln( "You'd better leave now.." );
  132.   voice( "NoPass" );
  133.   inc(L1);
  134.   GOTO LOOP;
  135.  
  136. :PSWRD2
  137.   writeln( "Trying to guess the password is a bad idea.." );
  138.   voice( "NoPass" );
  139.   inc(L1);
  140.   GOTO LOOP;
  141.  
  142. :PSWRD3
  143.   writeln( "This was your last chance.  Leave now!" );
  144.   voice( "NoPass" );
  145.   inc(L1);
  146.   GOTO LOOP;
  147.  
  148. !
  149. ! Handle conversations..
  150. !
  151. :CHAT
  152.   writeln( "How may I help you?.  Please make it brief, I'm on duty." );
  153.  
  154. :CHAT1
  155.   L3 = getstr("Name","Password","Job","Bye");
  156.   if L3 = -1 then 
  157.     writeln( "Ok." );
  158.     goto XSTOP;
  159.   endif;
  160.  
  161. ! First, see if the keyword typed is in the character's text block !
  162.   if dotext( S0 ) then
  163.     if L3 = 3 goto XSTOP;
  164.     goto CHAT1;
  165.   endif;
  166.  
  167. ! It didn't, so try the predefined ones..
  168.   on L3 goto CNAME, CPASS, CJOB, CSTOP;
  169.  
  170. ! Nope, try a 'DEFAULT' line
  171.   if not dotext( "DEFAULT" ) then
  172.     writeln( "I don't know anything about that!" );
  173.   endif;
  174.   goto CHAT1;
  175.  
  176. :CNAME
  177.    writeln( "My name is ", NPC.name, "."     );
  178.    GOTO CHAT1;
  179.  
  180. :CPASS
  181.    if npc.v1 = 2 then
  182.      writeln( "Can't you see I'm busy?" );
  183.    else
  184.      writeln( "You only have to give it once." );
  185.    endif;
  186.    GOTO CHAT1;
  187.  
  188. :CJOB
  189.    writeln( "I am a guard!"                  );
  190.    GOTO CHAT1;
  191.  
  192. :CSTOP
  193.    writeln( "You're welcome.."               );
  194.    goto XSTOP;
  195.  
  196. ! Feel free to expand on this list.. !
  197.  
  198. !-----------------------------------------------------------------!
  199. ! All STOPs now lead here so the screen can be restored if needed !
  200. !-----------------------------------------------------------------!
  201. :XSTOP
  202.   if npc.picture >= 0 then
  203.     paint(window); ! Assumes the picture fits in the window !
  204.   endif;
  205.   STOP;
  206.  
  207.