!---------------------------------------------------------------------------- ! ROOM DEFINITIONS - PART 3 !---------------------------------------------------------------------------- !------------------------------------------------------------------------ ! Important status indicators for this chapter. ! ! CHAIN ! MISC #1 = True, when the chain is extended down into the well. ! ! LIGHTS ! MISC #1 = What illusionary form the lights have taken. ! 0 = No form (just lights that fly around). ! 1 = The small fishing village. ! SAPLINGS ! MISC #1 = Number of times player has poured water on the saplings. ! 0 = No water has yet been poured. ! 1 = Water has been poured once. We're half-way there. ! 2 = Water has been poured twice. We now have extra speed. ! TYRANT ! MISC #1 = Number of times tyrant has blasted player with water. !------------------------------------------------------------------------ !---------------------------------------------------------------------------- room wharf "At a Wharf" { inherits game_room !provides initial_desc and long_desc handling. e_to village !Not allowing north, because "south" doesn't bring us back here. !n_to { return wharf_ladder.door_to } d_to { return wharf_ladder.door_to } in_to { return wharf_ladder.door_to } ground_name "wharf" each_turn { !Move things depending on where we are. if (river_ground is not distant): river_ground is distant if (long_wharf is distant): long_wharf is not distant } } !---------------------------------------------------------------------------- room riverbed "At the Bottom of a Dry Riverbed" { inherits game_room !provides initial_desc and long_desc handling. u_to { return wharf_ladder.door_to } out_to { return wharf_ladder.door_to } ! s_to { } ! in_to { } each_turn { !Move things depending on where we are. if (river_ground is distant): river_ground is not distant if (long_wharf is not distant): long_wharf is distant if (river_panel is open) { ! The panel will always close behind you, whenever you ! leave the tyrants chamber. Can't go back inside there. PrintMessage(2,river_panel,2) !It closes behind the player. river_panel is not open } } } !---------------------------------------------------------------------------- room village "In an Abandoned Fishing Village" { inherits game_room !provides initial_desc and long_desc handling. n_to { return huts.door_to } nw_to { return huts.door_to } ne_to { return huts.door_to } w_to { DropTheObject(chain) !Just in case we're still holding it. return wharf !And then let the player go back to the wharf. } d_to { return well.door_to } } !---------------------------------------------------------------------------- room east_tunnel "At the East End of a Tunnel" { inherits game_room !provides initial_desc and long_desc handling. w_to west_tunnel u_to village out_to village nw_to { return simple_door.door_to } each_turn { ! Move things depending on where we are. if (plate is distant): plate is not distant if (ornate_door is not distant): ornate_door is distant ! Give additional adjectives to the ornate door. if (ornate_door.adjectives #4 ~= "far") { ornate_door.adjectives #4 = "far" ornate_door.adjectives #5 = "farther" ornate_door.adjectives #6 = "farthest" } ! Give additional adjectives to the simple door. ! And remove the second noun from its noun list. if (simple_door.nouns #2 = "exit") { simple_door.adjectives #5 = "near" simple_door.adjectives #6 = "nearer" simple_door.adjectives #7 = "nearest" simple_door.nouns #2 = "" } } } !---------------------------------------------------------------------------- room west_tunnel "At the West End of a Tunnel" { inherits game_room !provides initial_desc and long_desc handling. e_to east_tunnel w_to { return ornate_door.door_to } in_to { return ornate_door.door_to } each_turn { ! Move things depending on where we are. if (plate is not distant): plate is distant if (ornate_door is distant): ornate_door is not distant ! From here, the ornate door isn't described as "far". if (ornate_door.adjectives #4 = "far") { ornate_door.adjectives #4 = "" ornate_door.adjectives #5 = "" ornate_door.adjectives #6 = "" } } } !---------------------------------------------------------------------------- room hall "In the Hall of Tapestries" { inherits game_room !provides initial_desc and long_desc handling. se_to { return simple_door.door_to } out_to { return simple_door.door_to } ground_name "floor of the ledge" each_turn { ! Remove the adjectives from the simple door ! And add "exit" as an alternate noun. if (simple_door.nouns #2 ~= "exit") { simple_door.adjectives #5 = "" simple_door.adjectives #6 = "" simple_door.adjectives #7 = "" simple_door.nouns #2 = "exit" } !Make sure the "new" tapestry gets additional adjectives if (tapestry.name ~= "unfinished tapestry") { tapestry.adjectives #4 = "new" tapestry.adjectives #5 = "newer" tapestry.adjectives #6 = "newest" tapestry.adjectives #7 = "village" tapestry.adjectives #8 = "unfinished" tapestry.adjectives #9 = "incomplete" tapestry.adjectives #10 = "last" tapestry.name = "unfinished tapestry" } } } !---------------------------------------------------------------------------- room chamber "In the Tyrant's Chamber" { inherits game_room !provides initial_desc and long_desc handling. n_to { return river_panel.door_to } ground_name "floor" each_turn { if (fishnet in panel_hooks) and (tyrant in riverbed) { !We have defeated him, and he is trapped. Chapter_End_Part3 !Finish, and go to Epilogue. } } } !---------------------------------------------------------------------------- ! DAEMON/FUSE DEFINITIONS !---------------------------------------------------------------------------- fuse doors_down { } event in doors_down { if (self.tick = 0) { PrintMessage(12,self,location) !Message that doors have closed. ornate_door is not open !This door is no longer open now. simple_door is not open !And... yeah, neither is this one. } } !---------------------------------------------------------------------------- fuse illusion_ends { } event in illusion_ends { if (self.tick = 0) { if (location = hall) { print "" !Begin with a blank line. PrintMessage(2,lights,8) !The illusion fades, ends. } lights.misc #1 = 0 !No illusion is currently present. clear_references(lights) !Get rid of nouns and adjectives. storage_crates is not concealed } } !---------------------------------------------------------------------------- ! Pretty much, I'm going to be telling the player exactly what to do, each ! time they fail. Hopefully they'll figure out the pattern, figure out that ! those verbs will work, and plan their attack accordingly. It shouldn't be ! too difficult to figure out, I hope. ! daemon tyrant_battle { !MISC #1 = what did the tyrant just do? ! 1 = Lunged at the player (player must dodge) ! 2 = Attacking the player (player must block) ! 3 = Backing away (player must then attack) !MISC #2 = what did the player just do? ! 1 = Dodged the attack ! 2 = Blocked the attack ! 3 = Attacked the tyrant misc 0, 0 } event in tyrant_battle { if (tyrant is not moved) { move tyrant to location !Now he's actually here. tyrant is moved !Flag so we won't try doing it again. attacker = tyrant !Yep, he's attacking us now. self.misc #1 = 1 !The tyrant has just lunged at player. } else { if (self.misc #1 = self.misc #2) { select (self.misc #1) case 1 { ! Player successfully dodges the attack. self.misc #1 = 2 !And now he attacks. PrintMessage(5,20,5) !Tyrant will attack } case 2 { ! Player successfully blocked the attack. self.misc #1 = 3 !And now he backs away. PrintMessage(5,20,6) !Tyrant will back away } case 3 { ! Player successfully attacked tyrant. Deactivate(self) !The battle has ended. tyrant.misc #2 = true !We defeated him. PrintMessage(7,12,1) !Cutscene, he runs. AddScore(71) !For winning the battling. ! Note that two more points might get added right away, ! if the net is up on the panel_hooks and chapter ends. if (fishnet in panel_hooks) { !We have defeated him, and he is trapped. Chapter_End_Part3 !Finish, and go to Epilogue. } else { !We didn't trap him. He's on the move. move tyrant to riverbed } } } else { select (self.misc #1) case 1 { ! Player failed to dodge the attack. PrintMessage(5,20,1) !Woops, failed. } case 2 { ! Player failed to block the attack. PrintMessage(5,20,2) !Woops, failed. } case 3 { ! Player failed to attack the tyrant PrintMessage(5,20,3) !Woops, failed. } self.misc #1 = 1 !He's going to lunge. PrintMessage(5,20,4) !Tyrant will lunge. } self.misc #2 = 0 !And unset player's action. } } !---------------------------------------------------------------------------- ! SCENERY OBJECT CLASSES !---------------------------------------------------------------------------- !---------------------------------------------------------------------------- ! ROOM OBJECTS, GROUND OBJECTS !---------------------------------------------------------------------------- scenery long_wharf "wharf" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. inherits ground_class !Provides "put-in" drop handling. nouns "wharf", "pier", "staithe" adjectives "long", "wooden" article "the" found_at wharf, riverbed before { object DoEnter, DoGo, DoApproach { if (location = wharf) { return false !Default handling. } else { !Up to the wharf. Perform(&DoGo, u_obj) } } object DoClimb { if (location = wharf) { Perform(&DoGo, d_obj) } else { Perform(&DoGo, u_obj) } } xobject DoGetFrom { if (object = fishnet) and (object is not moved) { Perform(&DoGet, fishnet) !Because it's okay to get it. } else { return false !Assume default handling. Too far. } } } } !---------------------------------------------------------------------------- scenery river_ground "riverbed" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. inherits ground_class !Provides "put-in" drop handling. nouns "ground", "soil", "river", "bed", "riverbed" adjectives "dry", "cracked", "parched", "river" article "the" found_at wharf, riverbed is container capacity 0 before { object DoEnter, DoGo, DoApproach { if (location = riverbed) { return false !Default handling. } else { !Down to the riverbed. Perform(&DoGo, d_obj) } } xobject DoPutIn { if (location = wharf) { !We drop it over the side of the wharf. if (object is always_held) { Perform(&DoDrop, object) !To get the approp. response. } else { PrintMessage(4,23,object) move object to riverbed !Basically, we dropped it down. } } else { return false !Default "drop" handling from ground class. } } } } !---------------------------------------------------------------------------- scenery in_village "village" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. nouns "village" adjectives "fishing", "abandoned", "fishing" article "the" found_at village } !---------------------------------------------------------------------------- scenery village_ground "village" { inherits game_scenery !Provides the long_desc handling. inherits ground_class !Provides "put-in" drop handling. nouns "ground", "floor", "bottom" adjectives "hard", "dry", "cracked" article "the" found_at village } !---------------------------------------------------------------------------- scenery tunnel "tunnel" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. nouns "tunnel" article "the" found_at west_tunnel, east_tunnel } !---------------------------------------------------------------------------- scenery tunnel_floor "ground" { inherits game_scenery !Provides the long_desc handling. inherits ground_class !Provides "put-in" drop handling. nouns "ground", "floor", "bottom" adjectives "hard", "dry" article "the" found_at west_tunnel, east_tunnel } !---------------------------------------------------------------------------- scenery ledge "ledge" { inherits game_scenery !Provides the long_desc handling. inherits ground_class !Provides "put-in" drop handling. nouns "ground", "floor", "ledge" adjectives "long" article "the" found_at hall before { object DoClimb { Perform(&DoGo, d_obj) !Equate this action to going downward. } object DoJump { PrintMessage(9,self,1) !Trying to jump off the ledge. } } } !---------------------------------------------------------------------------- ! SCENERY DEFINITIONS !---------------------------------------------------------------------------- scenery pilings "pilings" { inherits game_scenery !Provides handling for the description. nouns "piling", "pile", "piles", "pilings", "legs", "post", "posts" adjectives "long", "thick", "wooden" article "the" is plural found_at wharf, riverbed } !---------------------------------------------------------------------------- scenery distant_village { inherits game_scenery !Provides handling for the description. nouns "village", "town" adjectives "fishing" article "the" is distant found_at wharf before { object DoGo, DoEnter, DoApproach { Perform(&DoGo, e_obj) !Walk to the village. } } } !---------------------------------------------------------------------------- scenery wharf_ladder "ladder" { inherits game_scenery !Provides handling for the description. nouns "ladder" article "the" found_at wharf, riverbed door_to { SheatheSword !Needs to be sheathed before climbing. if (location = wharf) { if (fishnet is not moved) { ! In case the player thinks they're supposed to go down to ! riverbed and then get the net. Put it here so it'll work. move fishnet to riverbed } return riverbed } else { if (fishnet is not moved) { ! Bring it back here, in case it was moved to riverbed. move fishnet to wharf } return wharf } } before { object DoClimb, DoEnter, DoGo, DoApproach { if (location = wharf) { Perform(&DoGo, d_obj) } else { Perform(&DoGo, u_obj) } } } } !---------------------------------------------------------------------------- scenery river_wall "dried wall" { inherits game_scenery !Provides handling for the description. nouns "wall", "side" adjectives "river", "dried", "dry", "cracked", "sloped", "sloping" article "the" found_at riverbed } !---------------------------------------------------------------------------- scenery river_panel "door-sized panel" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have put notches on it from outside. misc false nouns "panel", "door" adjectives "door-like", "door-sized", "solid", "thick", "sturdy" article "the" is platform, openable, not open, lockable, not locked capacity 1 found_in chamber, riverbed door_to { if (location = chamber) { if (tyrant in chamber) { return false !We can't, while the tyrant is here. } else { if (self is not open) { PrintMessage(6,6,self) !Opening the panel first. self is open } if (fishnet is not moved) { ! In case the player never bothered to get it. move fishnet to riverbed } return riverbed } } } before { object DoPush, DoPull, DoLift, DoMove { if (location = chamber) { !Assume the player is really trying to open/close it. if (self is open) { word[1] = "close" PrintMessage(6,2,"it") Perform(&DoClose, self) !Redirection to the Close. } else { word[1] = "open" PrintMessage(6,2,"it") Perform(&DoOpen, self) !Redirection to the Open. } } else { PrintMessage(12,self,1) !You see no way to open out here. } } object DoOpen { if (location = chamber) { if (tyrant in chamber) { PrintMessage(8,tyrant,3) !Generic "can't with tyrant" } else { PrintMessage(12,self,2) !The player lifts by handle. self is open !But only for this turn and one more. } } else { PrintMessage(12,self,1) !You see no way to open out here. } } object DoLock, DoUnlock { if (self is distant) { return false !Just in case. } else { PrintMessage(15,9,self) !It has no locking mechanism. } } object DoCut, DoStab { if (xobject = nothing, sword) and (location = riverbed) { if (MakeReadySword) { PrintMessage(5,21,3) !Attacking the panel. self.misc #1 = true !We have cut at the panel. } } else { return false !Default handling. } } object DoHit, DoKick, DoPunch { if (location = riverbed) { PrintMessage(12,self,3) !Trying to break it down. } else { return false !Default, when in the chamber. } } } } !---------------------------------------------------------------------------- component panel_handle "handle" { inherits game_scenery !Provides handling for the description. nouns "handle" adjectives "door", "door's", "panel", "panel's" article "the" part_of { if (location = chamber) { return river_panel } else { return nothing } } before { object DoPull, DoMove, DoLift { !These things will cause the door to be opened. Perform(&DoOpen, river_panel) !Redirect to the door. } object DoTurn { !This implies opening the door, but needs to let player know. word[1] = "open" !For the message PrintMessage(6,1,river_panel) !Message the player about it. Perform(&DoOpen, river_panel) !Redirect to the door. } object DoPush { !This assumes the player is trying to close the door. Perform(&DoClose, river_panel) !Redirect to the door. } } } !---------------------------------------------------------------------------- scenery panel_hooks "hooks" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have suspended the fishnet from the hooks, once. misc false nouns "hooks", "hook" adjectives "fishing", "fish", "several", "thick", "metal" article "the" ! The only reason it's "openable" and "open" is so the net doesn't get ! lost after we hang it on the hooks. is plural, platform, container capacity 1 !So we can "put net on hooks" found_at riverbed list_contents { PrintMessage(2,self,2) !Custom contents listing. } before { object DoPull, DoTurn { Perform(&DoGet, self) !This is basically an attempt to get 'em. } object DoGet { PrintMessage(10,self,1) !You can't remove them from the wall. } } } !---------------------------------------------------------------------------- scenery well "well" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have lowered the chain into the well at least once. misc false nouns "well", "water-well", "waterwell", "stone", "opening" adjectives "water", "wide", "round", "brown", "green", \ "stone", "well's", "stone-sided", "sided" article "the" is platform, container !We can put the stone lid on it and chain in it. capacity 1 !But it's not really meant to hold or store things. found_in village parse_rank { if (verbroutine = &DoEmpty, &DoEmptyGround) { return -2 !We probably mean the flask, not the well. } else { return 0 !Default handling. } } door_to { !First, be sure the slab isn't covering the entrance. if InList(slab,found_on,self) { return false !You can't do it. } ! Otherwise we'll automatically solve things for the player. ! But, only if they've removed the chain from the slab, or ! if they've lowered it already, at least once before. I ! originally wanted to always auto-detach it from the slab ! and then lower it, but this may be too much implication. if (chain.misc #1) { if Contains(player,chain) { ! Silently let go of it. When we reach the bottom, we'll ! tell the player that we let go. It won't matter if the ! player was previously "holding" the chain or not. The ! message will make sense in either case. We do it in a ! silent way, though, because "first dropping the chain" ! wouldn't make sense if we're going to grab and climb. move chain to location !We drop it the easy, silent way. } } else { if (AttachedCount(chain)>1) { if (self.misc #1) { !They've lowered it once already, so allow it. SheatheSword !Make sure the player doesn't have it drawn. PrintMessage(6,21,chain.attached_to #2) !Removing first. ObjectDetach(chain,chain.attached_to #2) !And then do it. PrintMessage(6,22,"lowering it into the well") print "" !A blank line before the actual message. } else { return nothing !Cause appropriate "can't go" message. } } else { if Contains(player,chain) { DropTheObject(chain) !Dropping the chain first. SheatheSword !Make sure the player doesn't have it drawn. PrintMessage(6,22,"lowering it into the well") print "" !A blank line before the actual message. } else { SheatheSword !Make sure the player doesn't have it drawn. PrintMessage(6,23,self) !Lowering the chain into the well. } } Perform(&DoTurn, winch) !describe lowering it down. } SheatheSword !Make sure the player doesn't have it drawn. return east_tunnel !Because that's where we'll go. } before { object DoLookIn { PrintMessage(2,self,2) !Appropriate response to looking in. } object DoEnter, DoClimb, DoGo, DoApproach { !This is just a redirection to "down". Perform(&DoGo, d_obj) !Attempt to go down. } xobject DoThrowAt { if IsWord("in") or IsWord("into") { ! Let the existing DoPutIn handler take over. Perform(&DoPutIn, object, self) !Redirection. } else { return false !Default handling } } xobject DoPutIn { !Instead of saying "there's no room" we should say this. !For anything that's not specifically trapped for. !But first, see if the player did "on" instead of "in". if IsWord("on") { !The player may have been trying to put something "on" it. if InList(slab,found_on,well) { print "(on "; The(slab); ")" !Let the player know. Perform(&DoPutIn, object, slab) !And then redirect. return true !Return and avoid default handling. } elseif (object = fishnet) { PrintMessage(12,self,2) !Trying to put the net on it. return true !Return and avoid default handling. } } !Otherwise, it was "put in" or an unhandled "put on" attempt. !In either case, we assume player drops stuff into the well. if InList(slab,found_on,well) { PrintMessage(12,self,1) !You can't. Stone slab covers. } elseif (object = chain) { ! The verb def should be such that we can't put the chain ! in anything if it's not held (DoPutIn), and we can't hold ! it if it's attached to anything else already. So it should ! be safe to not check if the chain is held first, or if its ! already attached to something first. As long as it's true. if (chain.misc #1) { PrintMessage(12,chain,4) !It's already extended into. } else { !Assuming you mean to turn the winch. word[1] = "turn" !Benefit of the message. PrintMessage(6,1,winch) !Print the message. Perform(&DoTurn, winch) !And do the action. } } elseif (object is always_held) { return false !Default handling for all other objects. } else { ! This is okay, because we don't require anything that we ! are holding in order to gain access to the well. And if ! we can gain access to the well, we can go retrieve it. PrintMessage(4,24,object) !You drop the object into. move object to east_tunnel !Basically, it goes away. } } } } !---------------------------------------------------------------------------- scenery slab "stone slab" { inherits game_scenery !Provides handling for the description. nouns "lid", "slab", "stone" adjectives "stone", "heavy", "slab" article "the" is platform capacity 75 !It doesn't really matter, but in theory it'd work. found_on well before { object DoMove, DoPull, DoPush, DoLift { if IsAttached(chain, slab_handle) { !We'll redirect to turning the winch. word[1] = "turn" !Necessary for the print routine. PrintMessage(6,1,winch) !Assuming you mean to turn winch. Perform(&DoTurn, winch) !Re-route it to the DoTurn Winch. } else { PrintMessage(12,self,1) !It almost moves, but not quite. } } object DoGet { PrintMessage(12,self,1) !It almost moves, but not quite. } xobject DoPutIn { !If the player does a "put chain on slab" then we assume this. if (object is always_held) { return false !Default handling for those. } if (object = chain) { word[1] = "wrap" !For the printmessage to work. PrintMessage(6,2,"it around the slab's handle") Perform(&DoAttachObject,chain,slab_handle) !Redirect } elseif (self.found_on ~= well) { !You can't put anything when it's not on the well. PrintMessage(4,25,object) !The appropriate message. } else { return false !Normal handling. It's allowed, or whatever. } } } } !---------------------------------------------------------------------------- component slab_handle "slab's handle" { inherits game_scenery !Provides handling for the description. noun "handle", "metal" adjectives "slab's", "piece", "bent", "rounded", "round" article "the" part_of slab is container, platform !So that we can do "put chain on" and "in" it. capacity 1 !Because we actually can't do either of those things. before { object DoMove, DoPull, DoPush, DoLift { !These verbs should be redirected to the handler on the slab. Perform(verbroutine, slab, xobject) !Redirect it to the slab. } object DoTurn { !The player probably thought the winch was a "handle". PrintMessage(6,1,winch) !Let 'em know what we're doing. Perform(verbroutine, winch) !And then do it. Redirect. } xobject DoPutIn { !If the player does a "put chain on handle" then we assume. if (object = chain) { word[1] = "wrap" !For the printmessage to work. PrintMessage(6,2,"it around the handle") Perform(&DoAttachObject,chain,self) !Redirect } else { return false !Normal handling. It's allowed, or whatever. } } } after { xobject DoDetachObject { if (object = chain) and (slab.found_at = location) { AddScore(60) !Untie chain from the slab gets a point. } return false !We're not overriding the default message. } } } !---------------------------------------------------------------------------- component frame "wooden frame" { inherits game_scenery !Provides handling for the description. noun "frame", "structure" adjectives "wooden", "sturdy", "solid", "well's" article "the" part_of well } !---------------------------------------------------------------------------- component frame_roof "peaked roof" { inherits game_scenery !Provides handling for the description. nouns "roof" adjectives "peaked", "miniature", "wooden" article "the" part_of frame } !---------------------------------------------------------------------------- component windlass "windlass" { inherits game_scenery !Provides handling for the description. nouns "windlass", "barrel", "apparatus" adjectives "cranked", "barrel", "strong" article "the" part_of frame before { object DoTurn, DoMove, DoPush, DoPull, DoLift { !Re-route these to the winch. That's what we can turn. Perform(verbroutine, winch, xobject) !Redirection here. } } } !---------------------------------------------------------------------------- component winch "winch" { inherits game_scenery !Provides handling for the description. nouns "winch", "crank", "lever" adjectives "winch" article "the" part_of windlass before { object DoMove, DoPush, DoPull, DoLift { if (xobject = nothing) { word[1] = "turn" !For the benefit of the PrintMessage. PrintMessage(6,2,"it") !Assuming you mean to turn it. Perform(&DoTurn, self) !Redirect to the DoTurn routine. } else { return false !Default message when we did an xobject. } } object DoTurn { !To keep things from going wonky, we need to drop it first. DropTheObject(chain) !This'll handle it whether held or not. if IsAttached(chain, slab_handle) { if (slab.found_on = well) { slab.found_at = village PrintMessage(12,slab,2) !Move the slab off the well. AddScore(59) !Lifting slab off the well, first time. } else { slab.found_on = well PrintMessage(12,slab,3) !Move it back onto the well. } } else { if (chain.misc #1) { !It's down in the well, so raise it up. PrintMessage(12,chain,1) !We raise up the chain. chain.misc #1 = false !It's no longer lowered. } else { if (slab.found_on = well) { !There isn't really anything to be accomplished. PrintMessage(12,chain,3) !Turn it, then turn back. } else { PrintMessage(12,chain,2) !We lower the chain. chain.misc #1 = true !We lower it into the well. well.misc #1 = true !Flag that we lowered it once. } } } } } } !---------------------------------------------------------------------------- ! I thought about using an "identical_class" here, but it isn't really ! necessary. There is an undefined number of huts, and it isn't really ! necessary to do much interaction with them. Responses can be coded to ! read correctly based on the group of huts. ! scenery huts "abandoned huts" { inherits game_scenery !Provides handling for the description. nouns "huts", "hut", "row", "house", "houses", "tent", "tents", \ "shack", "shacks", "home", "homes" adjectives "small", "row", "abandoned", "several", "line" article "the" is plural found_in village door_to { ! We are attempting to enter one of the huts. Basically, we get ! a random message for a random hut. Some interesthing things may ! be mentioned, and it's a way for us to find the burlap sack. ! Also, we have to drop the chain first, just in case. DropTheObject(chain) return false !Entry is done via PrintMessage(9,x) traps. } before { object DoEnter, DoGo, DoApproach { !Basically, we'll channel "enter" attempts into Go North. Perform(&DoGo, n_obj) !Redirect as an attempt to go north. } } } !---------------------------------------------------------------------------- scenery dry_river "dry river" { inherits game_scenery !Provides handling for the description. nouns "river", "riverbed", "riverside" adjectives "dry", "edge", "near" article "the" is distant !Avoid attempts to interact with it. found_in village } !---------------------------------------------------------------------------- scenery dead_trees "lifeless trees" { inherits game_scenery !Provides handling for the description. nouns "trees", "tree" adjectives "lifeless", "dead", "gray", "grey", "black", \ "bare", "tall", "dark" article "the" is plural found_in village before { object DoCut, DoStab { if (xobject = nothing, sword) { if (MakeReadySword) { PrintMessage(5,21,1) !Attacking the dead trees. } } else { return false !Default handling. } } object DoClimb { PrintMessage(9,self,1) ! Can't climb the dead trees. } xobject DoEmpty { if (object = flask) and (flask.misc #2) { PrintMessage(2,self,2) !Let them know about saplings. } else { return false !The default handling. } } } } !---------------------------------------------------------------------------- component gnarled_limbs "gnarled limbs" { inherits game_scenery !Provides handling for the description. inherits obj_component !Handles redirection for obj/xobj. nouns "limbs", "branches", "limb", "branch" adjectives "lifeless", "dead", "bare", "gnarled", "gray", \ "twisted", "twisting", "bent", "bending", "grey" article "the" is plural part_of dead_trees } !---------------------------------------------------------------------------- scenery saplings "saplings" { inherits game_scenery !Provides handling for the description. !MISC #1 = number of times we've "watered" the saplings (0, 1, or 2). !MISC #2 = how many times we've "looked at" saplings (for some clues). !MISC #3 = if we have seen the saplings looking thirsty. misc 0, 0, false nouns "saplings", "sapling", "plant", "plants" adjectives "newer", "barely", "bearly", "alive", "tallest", \ "shortest", "unusual", "unsually", "thick", \ "tall", "short", "thirsty" article "the" is plural, platform capacity 1 !We can't actually put anything on it. found_at village before { object DoCut, DoStab { if (xobject = nothing, sword) { if (MakeReadySword) { PrintMessage(5,21,2) !Attacking the saplings. } } else { return false !Default handling. } } object DoClimb { PrintMessage(9,self,1) ! Can't climb the dead trees. } xobject DoEmpty { if (object = flask) and (flask.misc #2) { ! It should only be possible to pour water on the ! saplings twice. The first time, we're using the original ! water. The second time, we're using water obtained when ! the tyrant attacks us. But, after the second time, we get ! a speed enchantment that allows us to dodge the tyrant's ! water arrow, so we can't re-fill the flask. if (self.misc #1 = 0) { self.misc #3 = true !We can "imply" saplings next time. PrintMessage(7,11,1) !Cutscene for pouring first time. AddScore(68) !Point for watering saplings first time. } else { ! Pouring for the second time. PrintMessage(7,11,2) !Cutscene AddScore(69) !Point for watering saplings second time. } flask.misc #2 = false !The water is now gone from the flask. self.misc #1 ++ !Increment our "pour on saplings" counter. flask.adjectives #1 = "empty" !Change it to be "empty" flask. } else { return false } } } } !---------------------------------------------------------------------------- ! There are several ways to press the plate down. When near it, you can just ! push it or stand on it. You can also put things on it, as long as all the ! things combined add up to a size of 35 or more. When at the other end, you ! can throw something at it that weights 35 or more (the pipe, or the sack ! full of rocks or stuff). But, you can also put stuff on it first, then go ! west and throw something that is just heavy enough to do the trick, such ! as a rock (rocks only available when the player doesn't have the pipe). ! scenery plate "metal plate" { inherits game_scenery !Provides handling for the description. !MISC #1 = true, when we have pushed the plate down at least once. misc false nouns "plate", "panel", "button" adjectives "rounded", "metal" article "the" is platform capacity 75 !We can put stuff on the plate. holding 0 !Will get auto-calculated found_at east_tunnel, west_tunnel before { object DoHit { if (self is distant) { return false !It's too far away. } else { !Assuming you mean to stand on it. word[1] = "push" !for message PrintMessage(6,2,"it") !Let the player know. Perform(&DoPush, self) !And then redirect. } } object DoKick { if (self is distant) { return false !It's too far away. } else { !Assuming you mean to stand on it. word[1] = "stand" !for message PrintMessage(6,2,"on it") !Let the player know. Perform(&DoStandOn, self) !And then redirect. } } object DoGet, DoPull { if (self is distant) { return false !It's too far away. } elseif plate_is_down(0) { PrintMessage(10,self,1) !Try to pull, but held down. } else { PrintMessage(10,self,2) !Try to pull, not held down. } } object DoStandOn { if (self is distant) { return false !It's too far away. } elseif plate_is_down(0) { !Nothing happens. The plate is already down. PrintMessage(12,self,7) !Nothing else happens. } else { PrintMessage(12,self,1) !We stand on the plate. press_plate !Begin the one-turn door fuse. PrintMessage(12,self,5) !We step off the plate. } } object DoPush { if (self is distant) { return false !It's too far away. } elseif plate_is_down(0) { !Nothing happens. The plate is already down. PrintMessage(12,self,7) !Nothing else happens. } else { PrintMessage(12,self,2) !We push the plate. press_plate !Begin the one-turn door fuse. } } object DoTouch, DoMove { if (self is distant) { return false !It's too far away. } elseif (self.misc #1) { ! If they've pushed it once, assume it again. word[1] = "push" !For the benefit of PrintMessage. PrintMessage(6,2,"it") !Let the player know. Perform(&DoPush, self) !Perform the pushing action. } else { PrintMessage(12,self,11) !Mere touching doesn't work. } } xobject DoPutIn { if (location = west_tunnel) { word[1] = "throw" !For the benefit of the PrintMessage. PrintMessage(6,1,object) !Assuming you mean to throw. Perform(&DoThrowAt,object,self) !Redirect to throwing. } else { ! We can do it, and we'll let the library handle checking ! the capacity of the plate, and moving the object there. ! So, we have to trap for success in an "after" routine. ! This is where we'll say the appropriate message, and ! figure out whether or not the doors should open up. rnd = plate_is_down(0) !Needed by the "after" routine. return false !Allow for the default handling. } } xobject DoThrowAt { if (object is always_held) { return false !We can't throw this thing. } elseif (object.size > 50) { PrintMessage(4,16,1) !It's too large to throw } elseif not plate_is_down(object.size) { if (location = east_tunnel) { PrintMessage(4,16,4) !You throw, but nothing happens. } else { PrintMessage(4,16,7) !Throw at panel in the other room. } if (self.misc #1) { ! Only print this if the player has already pressed it ! down once, another way. Otherwise we might be telling ! them it can't press it down, even though they didn't ! previously suspect that it *could* be pressed down. if not plate_is_down(0) { ! Only say this when the plate is NOT already down, ! otherwise we say "nothing happens" two times. PrintMessage(12,self,6) !Maybe not heavy enough. } } move object to east_tunnel !That's where it's at now. } else { rnd = plate_is_down(0) !Remember it for below. move object to east_tunnel !It doesn't stay on plate. if (location = east_tunnel) { if (rnd) { PrintMessage(12,self,9) !You throw it only. } else { PrintMessage(12,self,3) !Throw, and it sinks. } } else { PrintMessage(12,self,4) !Throw something from away. } if (rnd) { PrintMessage(12,self,7) !Nothing else happens. } else { !We could check for location = west_tunnel here, and !add the point(s) to the score percentage (AddScore). press_plate !Begin the one-turn door fuse. } } } } after { xobject DoPutIn { ! If here, we were able to put something on the plate. So, ! avoid default lib message and print our own. Also, check ! to see if it was heavy enough to press the plate, and if ! the plate wasn't already held down, lower the doors. VMessage(&DoPutIn, 5) !You put the object on the plate. ! The routine that checks the contents of the plate will ! return true here, because the object has been moved. So, ! we have to remember the prior status in the "before" bit, ! so that we can check it here. It's important to not do ! anything else with rnd, between there and here. if (rnd) { ! rnd = plate_is_down(0), from before the object moves. print "" !Need a blank line first. PrintMessage(12,self,7) !Nothing else happens. } elseif plate_is_down(0) { !This'll also print a message saying the plate lowers. print "" !Need a blank line first. press_plate !Begin the one-turn door fuse. PrintMessage(12,self,8) !Continued pressure doesn't work. } else { if (self.misc #1) { PrintMessage(12,self,6) !Maybe not heavy enough. } else { print "" !Need a blank line first. PrintMessage(3,2,3) !Nothing happens. } } } } } !---------------------------------------------------------------------------- scenery upward_chain "chain" { inherits game_scenery !Provides handling for the description. nouns "chain" adjectives "long", "end", "strong", "sturdy" article "the" found_in east_tunnel before { object DoTie, DoStrap { if (xobject = nothing) { return false !default handling. } else { PrintMessage(18,2,xobject) !It won't reach to there. } } object DoClimb { Perform(&DoGo, u_obj) !Redirect to upward. } object DoGet { !Just in case the player tries to do it. PrintMessage(10,self,1) !Don't need to, unless climbing up. } } } !---------------------------------------------------------------------------- scenery ornate_door "ornate door" { inherits game_scenery !Provides handling for the description. nouns "door" !Adjectvies 4,5,6 are removed when we are "at" the door. adjectives "large", "larger", "ornate", "far", "farther", "farthest", \ "west", "western", "wood", "wooden", "hard", "hardwood", \ "hard-wood", "dark", "sinister" article "the" is openable, not open, lockable, not locked found_in chamber, west_tunnel, east_tunnel door_to { if (location = west_tunnel) and (self is open) { return chamber !Where the Tyrant is. } else { return nothing !Can't go that way. } } before { object DoMove, DoPush, DoPull { if (self is open) { Perform(&DoClose, self) !Redirect to closing. } else { Perform(&DoOpen, self) !Redirect to opening. } } object DoOpen, DoLift { if (self is distant) { return false !Just in case. } elseif (location = west_tunnel) { if (plate.misc #1) { ! Player opened the doors at least once already. ! So give a reminder about the plate at other end. PrintMessage(12,plate,10) !Plate is at the other end. } else { !The player hasn't seen the doors open yet. PrintMessage(3,2,5) !You see no good way to do that. } } else { !When inside the chamber... PrintMessage(2,self,2) !You see no way to open it. } } object DoClose { if (self is distant) { return false !Just in case. } else { if (self is open) { !It's closing on its own. PrintMessage(6,3,self) !Let the player know. } else { return false !It's already closed. } } } object DoLock, DoUnlock { if (self is distant) { return false !Just in case. } else { PrintMessage(15,9,self) !It has no locking mechanism. } } } } !---------------------------------------------------------------------------- scenery simple_door "simple door" { inherits game_scenery !Provides handling for the description. !MISC #1 = True, when it has been opened at least once from inside. misc false !The second noun becomes "exit" when inside the hall of tapestries. nouns "door", "" !Adjectives 5, 6, and 7 go away when inside the hall. adjectives "small", "smaller", "simple", "simpler", \ "near", "nearer", "nearest", "plain", "iron", "metal" article "the" is openable, not open, lockable, not locked found_in east_tunnel, hall parse_rank { if (verbroutine = &DoOpen) { !To avoid ambiguity when "open door" is attempted. return 2 !elevate it above the default. } else { return 0 !Default rank } } door_to { if (location = east_tunnel) { if (self is not open) { if (plate.misc #1) { PrintMessage(6,16,plate) !Pushing the plate first. if (not plate_is_down) { press_plate !Activate the plate by pressing it. doors_down.timer -- !But use up a turn, too. } } } if (self is open) { return hall } else { return nothing } } else { if (self is not open) { PrintMessage(6,6,self) !Opening the door first. if (self.misc #1) { ! We've already opened it from inside once, so no need ! to describe this action to the player when we are ! opening it automatically. simple_door is open !So that we can enter the door. if (saplings.misc #1 >= 2) { ! We have the speed enchantment. Activate(doors_down, 2) !We get an extra turn now. } else { ! We do not have the extra speed. Activate(doors_down, 1) !It closes on the next turn. } } else { ! Player may not know that there is a handle to lift ! it open, so be sure they know how it was done. Perform(&DoOpen, self) !Perform the opening action. doors_down.timer -- !Make it will drop on next turn. } } return east_tunnel !We go back out to the east end of tunnel. } } before { object DoPush, DoPull, DoLift, DoMove { if (location = hall) { !Assume the player is really trying to open the door. Perform(&DoOpen, self) !Redirection to the Open routine. } else { return false !Default handling. } } object DoOpen { if (self is distant) { return false !Just in case. } elseif (location = east_tunnel) { if (plate.misc #1) { !Assuming you mean to push the plate. word[1] = "push" !So that the message works. PrintMessage(6,1,plate) !Let the player know. Perform(&DoPush, plate) !And then redirect it. } else { PrintMessage(3,2,5) !You see no good way to do that. } } else { ! The only other place it's currently seen is the hall. self.misc #1 = true !Flag the we opened it once. PrintMessage(12,self,1) !The player lifts by handle. self is open !But only for this turn and one more. if (saplings.misc #1 >= 2) { ! We have the double-speed enchantment. Activate(doors_down, 3) !We get an extra turn now. } else { ! We do not yet have the enchantment. Activate(doors_down, 2) !It closes on the next turn. } } } object DoClose { if (self is distant) { return false !Just in case. } else { if (self is open) { !It's closing on its own. PrintMessage(6,3,self) !Let the player know. } else { return false !It's already closed. } } } object DoLock, DoUnlock { if (self is distant) { return false !Just in case. } else { PrintMessage(15,9,self) !It has no locking mechanism. } } } } !---------------------------------------------------------------------------- component simple_handle "handle" { inherits game_scenery !Provides handling for the description. nouns "handle" adjectives "door", "door's" article "the" part_of { if (location = hall) { return (simple_door) } else { return (nothing) } } before { object DoPull, DoMove, DoLift { !These things will cause the door to be opened. Perform(&DoOpen, simple_door) !Redirect to the door. } object DoTurn { !This implies opening the door, but needs to let player know. word[1] = "open" !For the message PrintMessage(6,1,simple_door) !Message the player about it. Perform(&DoOpen, simple_door) !Redirect to the door. } object DoPush { !This assumes the player is trying to close the door. Perform(&DoClose, simple_door) !Redirect to the door. } } } !---------------------------------------------------------------------------- scenery farm_tapestry "widow's tapestry" { inherits game_scenery !Provides handling for the description. inherits tapestry_class !Provides custom handlers for tapestry. !The fourth and fifth nouns become "ribbon" and "ribbons" later. nouns "tapestry", "painting", "copy", "", "" adjectives "tall", "long", "hanging", "farm", "barn", \ "cellar", "widow's", "widows", "widow", "close" article "the" is readable, not broken, not fixable found_in hall } !---------------------------------------------------------------------------- scenery barge_tapestry "captain's tapestry" { inherits game_scenery !Provides handling for the description. inherits tapestry_class !Provides custom handlers for tapestry. !The fourth and fifth nouns become "ribbon" and "ribbons" later. nouns "tapestry", "painting", "copy", "", "" adjectives "tall", "long", "hanging", "barge", "quarters", \ "cabin", "captain's", "captains", "captain", "close" article "the" is readable, not broken, not fixable found_in hall } !---------------------------------------------------------------------------- scenery other_tapestries "other tapestries" { inherits game_scenery !Provides handling for the description. inherits tapestry_class !Provides custom handlers for tapestry. nouns "tapestries", "tapestry", "paintings", "painting", "tapestires" adjectives "tall", "long", "hanging", "other" article "the" is readable, plural found_in hall } !---------------------------------------------------------------------------- ! I mention a TON of stuff when reading the tapestry, and I need to make ! sure it all ends up here, to avoid "you don't see that" messages. ! component tapestry_markings3 "tapestry's markings" { inherits game_scenery !Provides handling for the description. nouns "glyph", "glyphs", "circle", "circles", "swirl", "map", \ "illustration", "illustrations", "loop", "loops", "symbol", \ "symbols", "writing", "river", "swirls", "dot", "dots", \ "waves", "tyrant", "mark", "enchantment", "point", "points", \ "drawings", "lines", "line", "markings", "gifts", "gift", \ "people", "person", "man", "woman", "men", "women", "marks", \ "tree", "trees" adjectives "crude", "angular", "wavey", "tyrant's", "red", \ "tapestry", "tapestries", "tapestry's", "tapestrys", \ "incomplete", "small", "mighty", "myriad", "wavy" article "the" is unholdable, readable, plural parse_rank -1 !Make sure it's below the real tapestry. part_of { if (location = hall): return tapestry else: return nothing } before { object DoRead { !Just looking at the marks won't read them, though. Perform(&DoLook, tapestry) !Redirect reading to x tapestry. } } } !---------------------------------------------------------------------------- scenery lights "strange lights" { inherits game_scenery !Provides handling for the description. !MISC #1 = what illusionary form the lights have taken. misc 0 nouns "light", "lights", "stars", "sparks", "fireflies" adjectives "strange", "dancing", "swooping", "fading", "brilliant", \ "points" article "the" is plural, distant found_in hall } !---------------------------------------------------------------------------- scenery storage_crates "storage crates" { inherits game_scenery !Provides handling for the description. nouns "crates", "crate", "boxes", "box", "casks", "cask" adjectives "storage", "thousand", "thousands" article "the" is plural, distant, openable, container, not open found_in hall } !---------------------------------------------------------------------------- scenery illusion "illusion" { inherits game_scenery !Provides handling for the description. !Reserve enough room for lots of nouns and adjectives, later. nouns "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" adjectives "", "", "", "", "", "", "", "", "", "", "", "", "", "", \ "", "", "", "", "", "", "", "", "", "", "", "", "", "" article "the" is distant found_in { if (lights.misc #1 > 0) { return hall !The illusion is in the hall. } else { return nothing !The illusion can't be seen. } } } !---------------------------------------------------------------------------- scenery table "table" { inherits game_scenery !Provides handling for the description. nouns "table" adjectives "small", "simple", "wooden", "low", "short" article "the" found_in chamber is platform capacity 50 !Although we don't really need to put stuff on it. } !---------------------------------------------------------------------------- scenery treasure "stacks of treasure" { inherits game_scenery !Provides handling for the description. nouns "treasure", "coins", "cups", "jewels", "chalices", "cup", \ "chalice", "coin", "jewel", "ornament", "ornaments", \ "chain", "chains", "bead", "beads", "trinket", "trinkets" adjectives "stacks", "gold", "silver", "piles", "jeweled", \ "crystal", "purple", "red", "green", "multifaceted", \ "priceless" article "the" found_in chamber is plural before { object DoGet { !A custom message, because we can't get any of the treasure. PrintMessage(10,self,1) !There is a reason we can't take it. } } } !---------------------------------------------------------------------------- scenery bookshelf "bookshelf" { inherits game_scenery !Provides handling for the description. nouns "shelf", "case", "bookshelf", "bookcase", \ "book-shelf", "book-case", "shelves" article "the" found_in chamber before { object DoSearch { if (xobject = nothing) { PrintMessage(2,self,1) !Save as longdesc. There are books. } else { return false !Search for something? Gets the default. } } } } !---------------------------------------------------------------------------- scenery books "books" { inherits game_scenery !Provides handling for the description. nouns "books", "glyphs", "symbols", "material", "materials", \ "folktale", "folktales", "book" adjectives "archaic", "modern", "cryptic", "research", \ "simple", "valuable" article "the" is readable found_in chamber before { object DoGet, DoRead { if (tyrant in location) { PrintMessage(8,tyrant,4) !Tyrant demands full attention. } else { PrintMessage(2,self,3) !Pick out a random book to read. } } object DoSearch { if (tyrant in location) { PrintMessage(8,tyrant,4) !Tyrant demands full attention. } elseif (xobject = nothing) { PrintMessage(2,self,2) !Searching for something? } else { return false !Search for something? Gets the default. } } } } !---------------------------------------------------------------------------- ! ROUTINES SPECIFIC TO PART 3 !---------------------------------------------------------------------------- routine plate_is_down(addsize) { !Instead of having it held down by a single object that's large enough, !allow the player to accumulate objects. It won't work until they put !it all in a bag and throw from the other end, though. Or, just use the !pipe, if the player kept the pipe from the second chapter. In order to !make the bag heavy enough, would have to use sticks (10), rock (10), !and parchment (10). That, plus the sack's size (5) will do the job. if (plate.holding + addsize) >= 35 { return true } else { return false } } !---------------------------------------------------------------------------- ! This gets called whenever we perform an action that pushes down the plate ! and begins the one-turn door fuse. This routine sets both doors open, ! starts the fuse, and prints the appropriate message. ! routine press_plate { PrintMessage(12,plate,0) !Message that the doors raise up. ornate_door is open !So that we can enter the door. simple_door is open !So that we can enter the door. if (saplings.misc #1 >= 2) { ! The player has the speed enchantment now. Activate(doors_down, 3) !We get an additional turn to move in. } else { ! Nope, we're still our same old slower self. Activate(doors_down, 2) !One turn is now, and one more until boom. } if not (plate.misc #1) { ! In all, we can get up to 4 percentage points. One comes the ! first time we push the plate (whether it's near or far), and ! that's this point. But, there is a base point for pushing from ! afar, and two "bonus" points that come either from pushing from ! afar, or by collecting two of the rocks that can be used for it. AddScore(63) !Score percentage when we push the plate, first time. plate.misc #1 = true !Flag that we have pushed plate at least once. } if (location = west_tunnel) { ! These two points come from either getting the rocks (so it's ! more spaced out) *or* from pushing the plate from afar. It's ! safe to award the points, since they'll be flagged as used. AddScore(73) !The base point for pushing the plate from afar. AddScore(64) !First point for remotely pushing the plate. AddScore(65) !Second point for remotely pushing the plate. } } !---------------------------------------------------------------------------- routine touch_tapestry(obj) { local illy if (obj = tapestry) { illy = 1 !Flag that it's the form of the village. } else { illy = lights.misc #1 while (illy = lights.misc #1) { !Keep trying until we get one that's different. illy = random(7) + 1 !Create a random number 2 to 8. } } if (illy = lights.misc #1) { ! The only way this should be possible is if touching the ! unfinished tapestry, since the others will ensure uniqueness. PrintMessage(2,lights,3) !The illusion of a(n) X is already. } else { !First, describe the current illusion as ending. if (lights.misc #1 > 0) { PrintMessage(2,lights,2) !Say that the original version fades. } else { if (illy > 1) { PrintMessage(2,lights,6) !Pick a random one to touch. } else { PrintMessage(2,lights,5) !Say that lights begin to react. } } print "" !And then a blank line, before the next part. lights.misc #1 = illy !Remember the new illusion. storage_crates is concealed !We can't see them. PrintMessage(2,lights,4) !Describe the illusion beginning. print "" !Do a blank line, before the next part. PrintMessage(2,lights,7) !Describe what's here now. clear_references(illusion) !Clear any and all prior nouns, adjs. set_illusion_refs(illy) !Give adjectives and pronouns for current. if (saplings.misc #1 >= 2) { ! We have the speed enchantment, so this lasts longer. Activate(illusion_ends, 7) !Illusion ends in six more turns. } else { ! No speed enchantment. It lasts for just three turns. Activate(illusion_ends, 4) !Illusion ends in three more turns. } if (illy = 1) { ! Just so that the player can "pour water" and assume it's ! on the saplings of the village (the real village), set a ! flag showing that we've seen the saplings thirsty. The ! player can still "pour water on saplings" but this way we ! can assume it if the player reasonbly knows to water them. saplings.misc #3 = true !Flag that we've seen them thirsty. } !Lastly, if the player needs to find the final rock, it's here. if (rock3 in storage_crates) { move rock3 to location !It falls to the ledge by the player. PrintMessage(1,rock3,2) !The rock falls out of the illusion. } } } !---------------------------------------------------------------------------- ! This is used so we can say [the X illusion] and [illusion of a X]]. As ! long as none start with a vowel, I don't have to check for "an" usage. ! routine lightform_name(form) { local retval select form case 1: retval = "fishing village" case 2: retval = "mountain pass" case 3: retval = "snow-covered field" case 4: retval = "seaside village" case 5: retval = "desert oasis" case 6: retval = "jungle stream" case 7: retval = "twilight castle" case 8: retval = "green cavern" case else: retval = "unknown" return retval } !---------------------------------------------------------------------------- ! Set nouns and adjectives, but avoid ones that might conflict with other ! things -- stone, rock, and perhaps things about the tapestry. ! routine set_illusion_refs(num) { !The illusion will always get "illusion" and "image" as nouns. illusion.nouns #1 = "illusion" illusion.nouns #2 = "image" !Based on the illusion number, set our noun and adjective references. select num case 1 { !-- Nouns illusion.nouns #3 = "gash" illusion.nouns #4 = "river" illusion.nouns #5 = "well" illusion.nouns #6 = "lid" illusion.nouns #7 = "trees" illusion.nouns #8 = "limbs" illusion.nouns #9 = "sapling" illusion.nouns #10 = "saplings" illusion.nouns #11 = "sky" illusion.nouns #12 = "ground" illusion.nouns #13 = "breeze" illusion.nouns #14 = "plant" illusion.nouns #15 = "plants" illusion.nouns #16 = "village" illusion.nouns #17 = "huts" !-- Adjectives illusion.adjectives #1 = "fishing" illusion.adjectives #2 = "long" illusion.adjectives #3 = "barren" illusion.adjectives #4 = "dark" illusion.adjectives #5 = "tangled" illusion.adjectives #6 = "dead" illusion.adjectives #7 = "stormy" illusion.adjectives #8 = "dry" illusion.adjectives #9 = "parched" illusion.adjectives #10 = "thirsty" } case 2 { !-- Nouns illusion.nouns #3 = "groups" illusion.nouns #4 = "pines" illusion.nouns #5 = "trees" illusion.nouns #6 = "side" illusion.nouns #7 = "cabin" illusion.nouns #8 = "fence" illusion.nouns #9 = "mountain" illusion.nouns #10 = "pass" !-- Adjectives illusion.adjectives #1 = "thick" illusion.adjectives #2 = "steep" illusion.adjectives #3 = "rocky" illusion.adjectives #4 = "ramshackle" illusion.adjectives #5 = "mountain" } case 3 { !-- Nouns illusion.nouns #3 = "landscape" illusion.nouns #4 = "spikes" illusion.nouns #5 = "smoke" illusion.nouns #6 = "chimney" illusion.nouns #7 = "chimneys" illusion.nouns #8 = "house" illusion.nouns #9 = "houses" illusion.nouns #10 = "haze" illusion.nouns #11 = "snow" illusion.nouns #12 = "field" !-- Adjectives illusion.adjectives #1 = "snow" illusion.adjectives #2 = "covered" illusion.adjectives #3 = "snow-covered" illusion.adjectives #4 = "thin" illusion.adjectives #5 = "collection" illusion.adjectives #6 = "small" illusion.adjectives #7 = "blue" illusion.adjectives #8 = "white" } case 4 { !-- Nouns illusion.nouns #3 = "waves" illusion.nouns #4 = "shore" illusion.nouns #5 = "beach" illusion.nouns #6 = "stilts" illusion.nouns #7 = "waters" illusion.nouns #8 = "boulders" illusion.nouns #9 = "haze" illusion.nouns #10 = "village" illusion.nouns #11 = "ocean" illusion.nouns #12 = "sea" !-- Adjectives illusion.adjectives #1 = "vast" illusion.adjectives #2 = "wide" illusion.adjectives #3 = "wooden" illusion.adjectives #4 = "tall" illusion.adjectives #5 = "boulders" illusion.adjectives #6 = "distant" illusion.adjectives #7 = "seaside" illusion.adjectives #8 = "sea-side" } case 5 { !-- Nouns illusion.nouns #3 = "dunes" illusion.nouns #4 = "wind" illusion.nouns #5 = "waves" illusion.nouns #6 = "land" illusion.nouns #7 = "men" illusion.nouns #8 = "camels" illusion.nouns #9 = "backs" illusion.nouns #10 = "trees" illusion.nouns #11 = "pool" illusion.nouns #12 = "oasis" illusion.nouns #13 = "sand" illusion.nouns #14 = "dune" !-- Adjectives illusion.adjectives #1 = "frozen" illusion.adjectives #2 = "green" illusion.adjectives #3 = "patch" illusion.adjectives #4 = "two" illusion.adjectives #5 = "camel's" illusion.adjectives #6 = "strange" illusion.adjectives #7 = "desert" } case 6 { !-- Nouns illusion.nouns #3 = "vines" illusion.nouns #4 = "stream" illusion.nouns #5 = "underbrush" illusion.nouns #6 = "animals" illusion.nouns #7 = "jungle" illusion.nouns #8 = "house" illusion.nouns #9 = "houses" illusion.nouns #10 = "trees" illusion.nouns #11 = "foliage" !-- Adjectives illusion.adjectives #1 = "bending" illusion.adjectives #2 = "thick" illusion.adjectives #3 = "familiar" illusion.adjectives #4 = "jungle" illusion.adjectives #5 = "two" illusion.adjectives #6 = "wooden" illusion.adjectives #7 = "abandoned" } case 7 { !-- Nouns illusion.nouns #3 = "sun" illusion.nouns #4 = "path" illusion.nouns #5 = "land" illusion.nouns #6 = "tint" illusion.nouns #7 = "twilight" illusion.nouns #8 = "castle" illusion.nouns #9 = "horizon" !-- Adjectives illusion.adjectives #1 = "magnificent" illusion.adjectives #2 = "twilight" illusion.adjectives #3 = "soft" illusion.adjectives #4 = "red" illusion.adjectives #5 = "purple" illusion.adjectives #6 = "long" illusion.adjectives #7 = "meandering" illusion.adjectives #8 = "tint" illusion.adjectives #9 = "twilight" } case 8 { !-- Nouns illusion.nouns #3 = "mist" illusion.nouns #4 = "bottom" illusion.nouns #5 = "ledges" illusion.nouns #6 = "house" illusion.nouns #7 = "houses" illusion.nouns #8 = "wind" illusion.nouns #9 = "cavern" illusion.nouns #10 = "spikes" !-- Adjectives illusion.adjectives #1 = "deep" illusion.adjectives #2 = "green" illusion.adjectives #3 = "black" illusion.adjectives #4 = "gray" illusion.adjectives #5 = "grey" illusion.adjectives #6 = "wooden" illusion.adjectives #7 = "strange" illusion.adjectives #8 = "jagged" illusion.adjectives #9 = "walkway" } } !---------------------------------------------------------------------------- ! When the tyrant attacks with water, some will go into the flask, if the ! flask needs to be filled. ! routine fill_flask { if (flask.misc #2) { ! There is already some water in the flask. PrintMessage(1,flask,2) !There is already water in the flask. } else { PrintMessage(1,flask,3) !Fill the flask with water again. flask.misc #2 = true !There is now some water in the flask. flask.misc #3 = true !Water came from tyrant. Used in desc. flask.adjectives #1 = "water" !Change it back to "water" flask. AddScore(67) !Points for filling the flask up again. } tyrant.misc #1 ++ !Increment number of times we've been blasted. } !---------------------------------------------------------------------------- routine Chapter_End_Part3 { AddScore(72) !For catching him in the net and ending chapter. PrintStatusLine !So the score gets updated. PrintMessage(7,12,2) !The tyrant gets caught up in the net. new_pause PrintMessage(7,12,3) !He tries to get out. Pick up the net. new_pause PrintMessage(7,12,4) !Enter the village, and the rain comes. new_pause PrintMessage(7,12,5) !The people are free, and they celebrate. new_pause PrintMessage(7,12,6) !The motherly maiden is here. Things change. new_pause PrintMessage(7,12,7) !Last part. Very short. The end bit. new_pause StartChapter(4) !Move us to Epilogue }