home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Select: Games 3
/
cd.iso
/
games
/
dcg303
/
guard.scr
< prev
next >
Wrap
Text File
|
1993-06-27
|
5KB
|
207 lines
!
! Default Guard's script
!
! (c) DC Software, 1992
!
! Pending Enhancements
!
! - I need to create a voice file (.VFL) with voices for this script.
! Look at the 'voice()' entries to see what voices it would play if
! they were available. These voices could even be placed in the
! system's voice file (DCSOUNDS.VFL) in which case the voice command
! should read 'voice( xxxx, 1000 )'.
!
!------------------------------------------------------------------------!
:@TALK ! Talk to the character !
!------------------------------------------------------------------------!
if player.hp = 0 then
writeln( player.name, " is dead!" );
STOP;
endif;
if npc.picture >= 0 then
viewpcx(npc);
endif;
if npc.v1 = 1 then
writeln( "Hello again. How may I help you?" );
GOTO CHAT; ! Once a password is given, just talk !
endif;
if npc.v1 = 2 then
writeln( "Can't you see I'm off duty? Get lost.." );
GOTO CHAT1;
endif;
if npc.v0 = 0 then
writeln( "Halt! Identify yourself!" );
voice( "Halt1" );
else
writeln( "I told you to get lost! What are you doing back here?" );
voice( "Halt2" );
endif;
npc.v0 = 1; ! We've been here !
L0 = 0; ! Count number of bribe attempts !
L1 = 0; ! Count number of password attempts !
:LOOP
L3 = select( "Leave","Fight Guard","Give Money","Give Password","Talk" );
ON L3 GOTO XLEAVE, XFIGHT, BRIBE, PSWRD, TRYCHAT;
:XLEAVE
writeln( "And don't come back!" );
goto XSTOP;
:TRYCHAT
writeln( "No unauthorized person is allowed in this area.." );
writeln( "Please leave." );
goto LOOP;
!
! Fight with the guard..
!
:@ATTACK !- Guards handle their own ATTACK -!
:XFIGHT
writeln( "You asked for it!" );
voice( "Fight" );
npc.type = HOSTILE;
! Don't forget to restore the picture !
if npc.picture >= 0 then
paint(window); ! Assumes the picture fits in the window !
endif;
FIGHT;
!
! Bribe the guard..
!
:BRIBE
if npc.value = 0 GOTO NOBRIBE; ! Can't bribe this guy.. !
writeln( "You try to bribe the guard.." );
L4 = getnum("How much do you give?") * 10; ! Convert GOLD to silver !
if L4 < npc.value then
writeln( "It would take a LOT more than ", $L4, " gold pieces.." );
voice( "More" );
goto LOOP;
endif;
if L4 > group.gold then
writeln( "You don't have enough gold." );
voice( "Broke" );
goto LOOP;
endif;
writeln( "Now that I think about it, it's time for my break.." );
voice( "Bribe" );
dec( group.gold, L4 );
npc.v1 = 2;
goto XSTOP;
:NOBRIBE
if L0 > 0 GOTO XFIGHT;
writeln( "Leave now, before I get really mad.." );
voice( "NoBribe" );
inc( L0 );
goto LOOP;
!
! Give the password
!
:PSWRD
writeln( "What is the password?" );
L3 = getstr(); ! The Password !
if s4 for 8 = s0 then
writeln( "Thank you. You are now authorized to pass." );
voice( "Pass" );
npc.v1 = 1; ! Disactivates guard feature !
goto XSTOP;
endif;
ON L1 GOTO PSWRD1,PSWRD2,PSWRD3;
writeln( "I warned you!" );
voice( "Fight" );
FIGHT;
:PSWRD1
writeln( "You'd better leave now.." );
voice( "NoPass" );
inc(L1);
GOTO LOOP;
:PSWRD2
writeln( "Trying to guess the password is a bad idea.." );
voice( "NoPass" );
inc(L1);
GOTO LOOP;
:PSWRD3
writeln( "This was your last chance. Leave now!" );
voice( "NoPass" );
inc(L1);
GOTO LOOP;
!
! Handle conversations..
!
:CHAT
writeln( "How may I help you?. Please make it brief, I'm on duty." );
:CHAT1
L3 = getstr("Name","Password","Job","Bye");
if L3 = -1 then
writeln( "Ok." );
goto XSTOP;
endif;
! First, see if the keyword typed is in the character's text block !
if dotext( S0 ) then
if L3 = 3 goto XSTOP;
goto CHAT1;
endif;
! It didn't, so try the predefined ones..
on L3 goto CNAME, CPASS, CJOB, CSTOP;
! Nope, try a 'DEFAULT' line
if not dotext( "DEFAULT" ) then
writeln( "I don't know anything about that!" );
endif;
goto CHAT1;
:CNAME
writeln( "My name is ", NPC.name, "." );
GOTO CHAT1;
:CPASS
if npc.v1 = 2 then
writeln( "Can't you see I'm busy?" );
else
writeln( "You only have to give it once." );
endif;
GOTO CHAT1;
:CJOB
writeln( "I am a guard!" );
GOTO CHAT1;
:CSTOP
writeln( "You're welcome.." );
goto XSTOP;
! Feel free to expand on this list.. !
!-----------------------------------------------------------------!
! All STOPs now lead here so the screen can be restored if needed !
!-----------------------------------------------------------------!
:XSTOP
if npc.picture >= 0 then
paint(window); ! Assumes the picture fits in the window !
endif;
STOP;