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

  1. !
  2. ! Default Healer's Script
  3. !
  4. ! (c) DC Software, 1992
  5. !
  6.  
  7. !------------------------------------------------------------------------!
  8. :@TALK ! Talk to the character !
  9. !------------------------------------------------------------------------!
  10.  
  11.   if player.hp = 0 then
  12.     writeln( player.name, " is dead!" );
  13.     STOP;
  14.   endif;
  15.  
  16.   if npc.picture >= 0 then
  17.     viewpcx(npc);
  18.   endif;
  19.  
  20. ! First, say hello.. !
  21.   if NPC.V0 > 0 then
  22.     writeln( "Hello ", player.name, ". What brings you back?" );
  23.   else
  24.     writeln( "Welcome to ", npc.name, ". How may I help you?" );
  25.   endif;
  26.  
  27. ! Now, set some variables..
  28.   NPC.V0 = 1; ! From know on, remember we've been here
  29.  
  30.   L0 = group.current;        ! Current spokesperson !
  31.   L4 = npc.value;            ! Cost of healing !
  32.   L5 = npc.value * 2;        ! Cost of Cures !
  33.   L6 = npc.value * 5;        ! Cost of resurections !
  34.   L7 = npc.value / 2 + 1;    ! Cost of removing cursed items !
  35.  
  36. :LOOP
  37.   group.current = L0;
  38.   L3 = select$( "Heal",          L4,
  39.                 "Cure",          L5,
  40.                 "Resurrect",     L6,
  41.                 "Remove Curse",  L7,
  42.                 "Talk",          -1  ! (talking is free)
  43.                );
  44.  
  45.   ON L3 GOTO DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CHAT;
  46.  
  47. :CSTOP
  48.   writeln( "'Till we meet again.." );
  49.   goto XSTOP;
  50.  
  51. !
  52. ! Heal Wounds..
  53. !
  54. :DO_HEAL
  55.   writeln( "Heal who?" );
  56.   L3 = select( group );
  57.   IF L3 < 0 GOTO LOOP;
  58.  
  59.   if player.hp >= player.mhp then
  60.     writeln( player.name, " is not hurt.  You waste my time." );
  61.     goto LOOP;
  62.   endif;
  63.  
  64.   if player.hp = 0   GOTO DEADGUY;
  65.   if group.gold < L4 GOTO NOMONEY;
  66.  
  67.   writeln( player.name, " is now healed." );
  68.   voice( "OkSpell", 1000 );
  69.   dec( group.gold, L4 );
  70.   player.hp = player.mhp;  ! Reset the hit points to maximum hit points !
  71.   goto LOOP;
  72.  
  73.  
  74. !
  75. ! Cure poisoning...
  76. !
  77. :DO_CURE
  78.   writeln( "Cure whom?" );
  79.   L3 = select( group );
  80.   IF L3 < 0 GOTO LOOP;
  81.  
  82.   if player.hp = 0           GOTO DEADGUY;
  83.  
  84.   if NOT player.poisoned then
  85.     writeln( player.name, " is not poisoned.  You waste my time." );
  86.     goto LOOP;
  87.   endif;
  88.  
  89.   if group.gold < L5         GOTO NOMONEY;
  90.  
  91.   writeln( player.name, " is now cured." );
  92.   voice( "OkSpell", 1000 );
  93.   dec( group.gold, L5 );
  94.   player.poisoned = 0;
  95.   goto LOOP;
  96.  
  97. !
  98. ! Remove Cursed Item..
  99. !
  100. :CURSE
  101.   writeln( "Who has the cursed item?" );
  102.   L3 = select( group );
  103.   IF L3 < 0 GOTO LOOP;
  104.  
  105.   writeln( "Remove what item?" );
  106.   L3 = select( player.body );
  107.   if L3 < 0 goto LOOP;
  108.  
  109.   if curritem.cursed then
  110.     if group.gold <  L6 GOTO NOMONEY;
  111.     dec( group.gold, L6 );
  112.     writeln( "The ", curritem.type, " has been removed." );
  113.     voice( "OkSpell", 1000 );
  114.     move( curritem, player );
  115.   else
  116.     writeln( "The ", curritem.name, " is not cursed." );
  117.   endif;
  118.  
  119.   goto LOOP;
  120. !
  121. ! or, if you so wish, you can handle each type separately..
  122. !
  123. !  on L3 goto :Weapon, :Armor, :Shield, :Ring, :Amulet, :Staff;
  124. !  goto LOOP;
  125. !  :Weapon move( player.weapon, player ); goto LOOP;
  126. !  :Armor  move( player.armor , player ); goto LOOP;
  127. !  :Shield move( player.shield, player ); goto LOOP;
  128. !  :Ring   move( player.ring  , player ); goto LOOP;
  129. !  :Amulet move( player.amulet, player ); goto LOOP;
  130. !  :Staff  move( player.staff , player ); goto LOOP;
  131.  
  132. !
  133. ! Resurect the dead..
  134. !
  135. :DO_RESTORE
  136.   writeln( "Resurrect who?" );
  137.   L3 = select( group );
  138.   IF L3 < 0 GOTO LOOP;
  139.  
  140.   if player.hp <> 0 then
  141.     writeln( player.name, " is not dead.  You waste my time." );
  142.     goto LOOP;
  143.   endif;
  144.  
  145.   if group.gold < L7 GOTO NOMONEY;
  146.  
  147.   voice( "HighWind", 1000 );
  148.   writeln( "First, the healer treats the dead body of ", player.name );
  149.   writeln( "treating every wound.  Then he replaces the blood in the body" );
  150.   writeln( "with a clear substance.  Finally a resurrection spell brings" );
  151.   writeln( "your friend to life." );
  152.   voice( "Thunder", 1000 );
  153.   voice( "WakeCall", 1000 );
  154.  
  155.   player.poisoned = 0;
  156.   player.hp       = player.mhp;
  157.   dec( group.gold, L7 );
  158.   goto LOOP;
  159.  
  160. :DEADGUY
  161.   voice( "Dead" );
  162.   writeln( "Dr McCoy: He's dead Jim.." );
  163.   goto LOOP;
  164.  
  165. :NOMONEY
  166.   voice( "Broke" );
  167.   writeln( "Sorry, you can't afford it." );
  168.   goto LOOP;
  169.  
  170. !
  171. ! Handle conversation..
  172. !
  173. :CHAT
  174.   writeln( "What would you like to talk about?" );
  175.  
  176. :CHAT1
  177.   L3 = getstr("Name","Heal","Cure","Resurrec","Remove","Curse","Join","Bye");
  178.   if L3 = -1 then 
  179.     writeln( "Ok." );
  180.     goto LOOP; ! Pressed ESCape !
  181.   endif;
  182.  
  183. ! First, see if the keyword typed is in the character's text block !
  184.   if dotext( S0 ) then
  185.     if L3 = 7 goto XSTOP;
  186.     goto CHAT1;
  187.   endif;
  188.  
  189. ! It didn't, so try the predefined ones..
  190.   on L3 goto CName, DO_HEAL, DO_CURE, DO_RESTORE, CURSE, CURSE, JOINP, CSTOP;
  191.  
  192. ! Nope, try a 'DEFAULT' line
  193.   if not dotext( "DEFAULT" ) then
  194.     writeln( "I don't know anything about that!" );
  195.   endif;
  196.   goto CHAT1;
  197.  
  198. :CName
  199.   writeln( "My name is ", npc.name, "."        );
  200.   goto CHAT1;
  201.  
  202. :JOINP
  203.   writeln( "Sorry.  I'm dedicated to my patients.." );
  204.   goto CHAT1;
  205.  
  206. !-----------------------------------------------------------------!
  207. ! All STOPs now lead here so the screen can be restored if needed !
  208. !-----------------------------------------------------------------!
  209. :XSTOP
  210.   if npc.picture >= 0 then
  211.     paint(window); ! Assumes the picture fits in the window !
  212.   endif;
  213.   STOP;
  214.  
  215.