intfiction.org

The Interactive Fiction Community Forum
It is currently Sat May 18, 2013 6:11 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Death And Resurrection.
PostPosted: Fri Nov 18, 2011 4:24 pm 
Offline

Joined: Sun Nov 06, 2011 12:17 pm
Posts: 156
Location: Toledo, Ohio, USA
You can tell by the number of topics I've posted that I have a long way to go with TADS3. In this one, I would like a person to die (from various means) and then be resurrected if he says yes to a question asking if he would like to be resurrected. The resurrection should put him in a special room and will also subtract points from his score.

Any ideas :?:

RonG


Top
 Profile Send private message  
 
PostPosted: Fri Nov 18, 2011 5:06 pm 
Offline

Joined: Tue Apr 27, 2010 1:02 pm
Posts: 797
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');
   }
;


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Eric Eve and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group