2
! WhoWhat.H - Modified from WhatIs.H by A.C. Murie, by David A. Cornelson
4
! Note: I felt I abused it enough so that I would call it another name and add different
5
! instructions. WhatIs.H ambiguously answered who and what questions and I wanted
6
! them to be answered appropriately. So, I 'fixed' it.
10
! Include this file after "parser.h".
12
! Add the attribute 'queryable' to your object to allow for WHO am/is/are or WHAT is/am/are
15
! Add the whatisit property with a string or function to describe what the object is.
17
! Add whoisit property to describe who the object is.
19
! Additionally, objects that do not appear in the game may be stored in the object
20
! 'QueryObjs'. They will be in scope all the time, and may be used for general game
23
! As a final option, the actions WhoIs and WhatIs may be used in an objects 'before' code
24
! to print the whoisit or whatisit text.
28
! If you intend to allow the player to change to different player objects using ChangePlayer,
29
! then make sure you write functions to determine which response is appropriate for whatisit
32
! The WhoIs routine check's if the object is animate before answering.
34
! I put smartass comments in for defaults.
41
[ IsAmAre w; w=NextWord(); if (w=='is' or 'am' or 'are') return 0; return -1; ];
42
[ WhatIsWhatSub; "What is what?"; ];
43
[ QueryTopic; while( NextWordStopped() ~= -1 ) ; return 1; ];
44
[ WhatisQSub; "Good question."; ];
47
if( ZRegion(player.whoisit) == 2 or 3 )
49
PrintOrRun(player,whoisit);
52
"A serious question, to which you have no answer.";
56
if( ZRegion(player.whatisit) == 2 or 3 )
58
PrintOrRun(player,whatisit);
61
"You're probably human, but one can never tell these days.";
65
if( noun hasnt queryable ) "Good question.";
66
if( ZRegion(noun.whatisit) == 2 or 3 )
68
PrintOrRun(noun,whatisit);
75
if( noun hasnt animate) "That's not a 'who', it's a 'what'!";
76
if( noun hasnt queryable ) "Good question.";
77
if( ZRegion(noun.whoisit) == 2 or 3 )
79
PrintOrRun(noun,whoisit);
86
if( scope_stage == 1 ) rfalse;
87
if( scope_stage == 2 )
89
ScopeWithin( QueryObjs );
94
Object QueryObjs "Queryable objects";
97
* IsAmAre -> WhatIsWhat
98
* IsAmAre "I" -> WhoAmI
99
* IsAmAre "I?" -> WhoAmI
100
* IsAmAre "I" "?" -> WhoAmI
101
* IsAmAre scope=QueryScope -> WhoIs
102
* IsAmAre scope=QueryScope "?" -> WhoIs
103
* QueryTopic -> WhatisQ;
106
* IsAmAre -> WhatIsWhat
107
* IsAmAre "I" -> WhatAmI
108
* IsAmAre "I?" -> WhatAmI
109
* IsAmAre "I" "?" -> WhatAmI
110
* IsAmAre scope=QueryScope -> WhatIs
111
* IsAmAre scope=QueryScope "?" -> WhatIs
112
* QueryTopic -> WhatisQ;