Chapter - Generic Island Scenery
[To save time iterating through objects in a room, we combine all the default scenery into one object, then use parsing to see which object the player meant. ]
Some background-scenery is a backdrop. It is in Outdoors.
[1]Understand "dense/vegetation/plants/leafy/green/greenery/profusion/ferns/fern" as background-scenery.
[2]Understand "moss/mosses/mossy" as background-scenery.
[3]Understand "earth/ground/carpet/soil/rock/rocks/land/floor" as background-scenery.
[4]Understand "grass/green/tuft/tufts/grasses/grassy" as background-scenery.
[5]Understand "lighting/glow/shadow/shadows/haze/sunlight" as background-scenery.
Does the player mean doing something to background-scenery: it is very unlikely.
[An inelegant but computationally quick way to solve this problem; otherwise we might have to compare dozens of text strings before finding the one we want.]
To decide what number is scenery-referred-to:
let cmd be indexed text;
now cmd is the player's command;
replace the regular expression "\b(the|a|some|my)\b " in cmd with "";
replace the regular expression "\b(take|x|examine|get|touch|attack|hit|pull|push|enter|go in|climb)\b " in cmd with "";
if character number 1 in cmd is "c":
decide on 3; [carpet]
else if character number 1 in cmd is "d":
decide on 1;
else if character number 1 in cmd is "e":
decide on 3;
else if character number 1 in cmd is "f":
if cmd matches the text "fern", decide on 1;
decide on 3; [floor]
else if character number 1 in cmd is "g":
if cmd matches the text "green", decide on 1;
if cmd matches the text "ground", decide on 3;
if cmd matches the text "grass", decide on 4;
decide on 5; [glow]
else if character number 1 in cmd is "h":
decide on 5; [haze]
else if character number 1 in cmd is "l":
if cmd matches the text "leafy", decide on 1;
if cmd matches the text "land", decide on 3;
decide on 5; [lighting]
else if character number 1 in cmd is "m":
decide on 2; [moss]
else if character number 1 in cmd is "p":
decide on 1; [plant/plants/profusion]
else if character number 1 in cmd is "r":
decide on 3; [rock]
else if character number 1 in cmd is "s":
if cmd matches the text "soil", decide on 3;
decide on 5; [shadow]
else if character number 1 in cmd is "t":
if cmd matches the text "trees", decide on 1;
decide on 4; [tuft]
else if character number 1 in cmd is "v":
decide on 1; [vegetation]
else:
decide on 1.
To decide which number is first noun word: (- MyNounWord(); -).
Include (-
[ MyNounWord myword nw;
wn = 1;
myword = 0;
nw = -1;
while (myword ~= -1) {
myword = NextWordStopped();
if (NounWord() >= 128) return wn-1;
}
return -1;
];
-).
The printed name of background-scenery is "[bgscnpn]". To say bgscnpn:
if scenery-referred-to is:
-- 1: say "vegetation";
-- 2: say "moss";
-- 3: say "ground";
-- 4: say "grass";
-- 5: say "lighting";
-- otherwise: say "background scenery".
Instead of touching or taking or pushing or pulling background-scenery:
if scenery-referred-to is:
-- 1: say "It feels moist, vibrant, and alive.";
-- 2: say "It's soft and springy, but also gripping quite tightly to its base.";
-- 3: say "You feel just [surface-material] beneath your feet.";
-- 4: say "[if we are taking]You pluck a long pale-green blade and twirl it between your fingers for a reflective moment, before letting it fall back and vanish into the green at your feet.[else]The blades are warm and moist as you run your hand through them.";
-- 5: say "Would that you could.";
-- otherwise: continue the action.
Instead of attacking background-scenery:
if scenery-referred-to is:
-- 1: say "You couldn't even begin to make a dent in the thick vegetation.";
-- otherwise: continue the action.
Instead of entering background-scenery:
if scenery-referred-to is:
-- 1: say "The vegetation is too dense to make much progress through without a machete.";
-- 3: say "You sit down on the [surface-material] and rest for a moment, reflecting, but eventually grow restless and rise to your feet again.";
-- 4: say "You sit down on the grass and rest for a moment, reflecting, but eventually grow restless and rise to your feet again.";
-- otherwise: continue the action.
The basic-walls are a backdrop. Understand "wall/walls/roof/ceiling" as basic-walls. They are in Hut, Back Room, Studio, Center Beach, Chairlift Base, Jumble, Chasm Edge, Chasm Floor, Volcano Floor, Steam Vents, Cinder Cone, Secret Cave, Egg Interior, Prison, Overhang, Mossy Ledge, Echo Chamber. The printed name is "walls[if location is indoorsy] and roof[end if]". Instead of climbing basic-walls, say "[if location is Steam Vents]The scree here is far too unstable; it looks like it would collapse into a rockslide if you put any weight on it[otherwise if location is regionally in Frozen Hell]The sides of the volcano are alternatively smooth and razor-sharp, and in neither case are they suitable for climbing[otherwise]There's not really a good spot to climb here[end if].". Does the player mean doing anything to basic-walls: it is very unlikely.