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

  1. !
  2. ! Default civilian script..
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6. ! Pending Enhancements
  7. !
  8. ! - This script has no voices.  For an example of voices, look at
  9. !   MERCHANT.SCR and HEALER.SCR
  10. !   
  11.  
  12. !------------------------------------------------------------------------!
  13. :@TALK ! Talk to the character !
  14. !------------------------------------------------------------------------!
  15.  
  16.   if player.hp = 0 then
  17.     writeln( player.name, " is dead!" );
  18.     STOP;
  19.   endif;
  20.  
  21.   if npc.picture >= 0 then
  22.     viewpcx(npc);
  23.   endif;
  24.  
  25. ! First, say hello.. !
  26.   if NPC.V0 > 0 then
  27.     writeln( "Hello ", player.name, ". What brings you back?" );
  28.   else
  29.     writeln( "Hello. I am ", npc.name, ". How may I help you?" );
  30.   endif;
  31.  
  32. ! Now, set some variables..
  33.   NPC.V0 = 1; ! From know on, remember we've been here
  34.  
  35. :LOOP
  36.   L3 = getstr("Name","Job","Join","Bye");
  37.   if L3 = -1 then 
  38.     writeln( "Ok." );
  39.     goto XSTOP;
  40.   endif;
  41.  
  42. ! First, see if the keyword typed is in the character's text block !
  43.   if dotext( S0 ) then
  44.     if L3 = 3 goto XSTOP;
  45.     goto LOOP;
  46.   endif;
  47.  
  48. ! It didn't, so try the predefined ones..
  49.   on L3 goto CNAME, CJOB, CJOIN, CSTOP;
  50.  
  51. ! Nope, try a 'DEFAULT' line
  52.   if not dotext( "DEFAULT" ) then
  53.     writeln( "I don't know anything about that!" );
  54.   endif;
  55.   goto LOOP;
  56.  
  57. :CNAME
  58.   writeln( "My name is ", NPC.name, "." );
  59.   GOTO LOOP;
  60.  
  61. :CJOB
  62.   writeln( "I am a ", npc.type );
  63.   GOTO LOOP;
  64.  
  65. :CJOIN
  66.   writeln( "I'm too busy.  Sorry." );
  67.   GOTO LOOP;
  68.  
  69. :CSTOP
  70.   writeln( "Nice talking to you.." );
  71.   goto XSTOP;
  72.  
  73. ! Feel free to expand on this list.. !
  74.  
  75. !-----------------------------------------------------------------!
  76. ! All STOPs now lead here so the screen can be restored if needed !
  77. !-----------------------------------------------------------------!
  78. :XSTOP
  79.   if npc.picture >= 0 then
  80.     paint(window); ! Assumes the picture fits in the window !
  81.   endif;
  82.   STOP;
  83.