Constant Story "The Genie in the Throne Room";
Constant Headline "^A Test of That Blasted Scope Property^
where orders are given with a switch function^^";
CONSTANT DEBUG;
Include "Parser";
Include "verblib";
Class NPC
with life
has animate
;
Class PalRm
has light
;
[Initialise;
Banner();
location = ThroneRm;
lookmode = 2;
print
"^You find yourself in the Main Throne room of the Sultan's
palace. You have killed him per the orders of your client the
Shah and you discover a Genie here who is waiting to do your bidding.^^";
return 2;];
PalRm ThroneRm "Throne Room"
with description
"You are in the Throne Room of the palace.
The sultan has been killed as per the orders
of the Shah and you are now at liberty to command
the Genie who dwells within here. He has told you of a
storeroom that contains many things.",
cant_go "You are stuck here with the Genie.",
;
NPC Genie "Magic Genie" ThroneRm
with name 'magical' 'magic' 'genie' 'man' 'himself',
description
"The genie is a shriveled up mouse-type man and you REALLY
KNOW that you can only trust him 50% of the time for his advice.",
before [;
talk: "Hello Master I am here to do your bidding. There is a
store room here in the palace that has a bottle of wine, a camel,
a bunch of gold coins and a very beautiful dancing girl in it.
To have me obtain any item for you ,all you need do is say:
~GENIE, FETCH (OBJECT)~.";],
orders [;
fetch:
switch(noun){
winebottle: move winebottle to location;
"The genie fetches the wine bottle and it is now here.";
camel:move camel to location;
"The genie fetches the camel and it is now here.";
gcoins: move gcoins to location;
"The genie fetches the gold coins and they are now here.";
DGirl: move dgirl to location;
"The Genie fetches the Dancing Girl and she is now here.";
default: "The genie is unable to fetch that for you.";};],
;
PalRm Storeroom "Store Room"
with description
"This is where the Sultan stores many
unusual and unrelated objects.",
;
Object -> WineBottle "Bottle of Wine"
with name 'bottle' 'wine',
description "A bottle of awful tasting wine!",
has general
;
Object -> Camel "Camel"
with name 'camel' 'dromedary',
description "A ship of the desert.",
has general
;
Object -> Gcoins "Gold Coins"
with name 'coins' 'gold' 'money',
description "A bunch of oldie moldy goldie coins.",
has general
;
NPC -> DGirl "Dancing Girl"
with name 'dancer' 'dancing' 'girl' 'harlot',
description "One of the sultans more beautiful
dancing harlots she looks like a brunette Britney Spears.",
before [;
talk: "She ignores your advances.";],
has animate female
;
Include "grammar";
[FetchSub;
move noun to location;
"The genie fetches " ,(the)noun, " and it is now here in the room with you.";];
[TalkSub;
"Talking to that makes no sense.";];
[Anything i;
if (scope_stage == 1) rfalse;
if (scope_stage == 2)
{objectloop (i ofclass Object) PlaceInScope(i); rtrue;}
"No such in game.";];