Here's a way to use a
FinishOption object for this.
Code:
#charset "us-ascii"
#include <adv3.h>
#include <en_us.h>
versionInfo: GameID
name = 'The Deadly Dungeon'
byline = 'by Anonymous Bard'
version = '1'
;
gameMain: GameMainDef
initialPlayerChar = me
;
me: Actor
vocabWords = 'self'
location = dungeon
;
dungeon: Room 'DUNGEON'
"Monsters lurk in every shadow. You could DIE at any time. "
;
hospital: Room 'HOSPITAL'
"Doctors lurk in every shadow. You could CHECK OUT at any time. "
;
DefineIAction(Die);
DefineIAction(CheckOut);
VerbRule(Die)
'die'
: DieAction
verbPhrase = 'die/dying'
;
VerbRule(CheckOut)
'check' 'out'
: CheckOutAction
verbPhrase = 'check/checking out'
;
modify DieAction
execAction() {
finishGameMsg(ftDeath, [finishOptionResurrect]);
}
;
modify CheckOutAction
execAction() {
gPlayerChar.moveInto(dungeon);
cls();
gPlayerChar.lookAround(true);
}
;
finishOptionResurrect: FinishOption
desc = "PRAY for mercy"
responseKeyword = 'pray'
responseChar = 'p'
doOption() {
cls();
gPlayerChar.moveInto(hospital);
gPlayerChar.lookAround(true);
addToScore(-2, 'dying');
}
;