!---------------------------------------------------------------------------- ! ROOM DEFINITIONS - PART 2 !---------------------------------------------------------------------------- !------------------------------------------------------------------------ ! Important status indicators for this chapter. ! ! DECK ! MISC #1 = Story Status: 0 = Flying forward and infested with spiders. ! 1 = Facing forward, landed, spiders approach. ! 2 = Flying forward again, free of the spiders. ! 3 = Landed at windmill and facing to the west. ! 4 = Final state. Flying again, in forward dir. ! ! Note: During Status-1, we won't see the captain. He's in. We're out. ! He's outside at 0 and again at 4, but he's inside at 1, 2, and 3. ! ! MAST ! MISC #1 = Rails of the barge are raised (true or false). ! ! SPIDER_ATTACK ! MISC #1 = Next round free of spider attack verbage (true or false). ! ! SAIL_ARMS ! MISC #1 = The mill's blades have stopped spinning (true or false). ! ! STARBOARD_WING ! MISC #1 = The wing is up against the mill steps (true or false). ! ! CARGO ! MISC #1..#n = Crates are stacked at various areas around the deck. !------------------------------------------------------------------------ ! NOTE - everything accessible from the deck must have a CheckReach() ! on ALL "before"-trapped verbroutines! This is due to the player ! being able to climb up the crates by the mast. It probably would ! have been easier to mimic or simplify this somehow, so that the ! player climbs up and comes right back down, but I wanted to give ! the "reach" property a try, and make it seem more realistic. !---------------------------------------------------------------------------- room campsite "At a Campsite Clearing" { inherits game_room !provides initial_desc and long_desc handling. u_to { SheatheSword !Because we can't climb with it out. Just in case. return treetop !There's only one way we're allowed to go, from here. } } !---------------------------------------------------------------------------- room treetop "Atop a Maple Tree" { inherits game_room !provides initial_desc and long_desc handling. inherits floorless_room_class !Some actions are limited here. } !---------------------------------------------------------------------------- room trawl "Caught on a Trawl Net" { inherits game_room !provides initial_desc and long_desc handling. inherits floorless_room_class !Some actions are limited here. u_to { SheatheSword !Because we can't climb with it out. Just in case. return deck !There's only one way we're allowed to go, from here. } before { location DoClimb { !Trap for "climb" and "climb up". if (object = nothing,u_obj) { print "("; The(trawl_net); ")" Perform(&DoGo, u_obj) } else { return false !Default handling. } } } } !---------------------------------------------------------------------------- room deck "On the Barge's Deck" { inherits game_room !provides initial_desc and long_desc handling. !MISC #1 = Story Status: 0 = Flying forward and infested with spiders. ! 1 = Facing forward, landed, spiders approach. ! 2 = Flying forward again, free of the spiders. ! 3 = Landed at windmill and facing to the west. ! 4 = Final state. Flying again, in forward dir. misc 0 ground_name "deck" !The crates are nailed shut. I can't implement nail components this !late in the IFComp deadline, so I'll take the cheap and lazy way out. extra_scenery "nails" ! Because the barge can be facing different directions, all ! directional handling will be done by a movement checker. u_to { if (sail_arm in mast) and \ (cargo.misc #1 = mast) and \ (not side_steps.misc #1) { ! Attempt to assume the player's intent. We moved the crates, ! and the sail arm needs to come down, so "up" probably means ! to climb up the crates. We're going to go that route. Perform(&DoClimb, cargo) } else { return deck_movement(u_obj) } } d_to { return deck_movement(d_obj) } n_to { return deck_movement(n_obj) } s_to { return deck_movement(s_obj) } e_to { return deck_movement(e_obj) } w_to { return deck_movement(w_obj) } ne_to { return deck_movement(ne_obj) } se_to { return deck_movement(se_obj) } sw_to { return deck_movement(sw_obj) } nw_to { return deck_movement(nw_obj) } in_to { return deck_movement(in_obj) } each_turn { ! The whole point of doing this is to hide the captain from being ! automatically listed in the initial_desc for the room. Also, we ! can use this as a flag to activate the spider_attack daemon. if (captain is not moved) { move captain to deck captain is moved captain is known } elseif (spider_attack is not active) and (count_spiders > 0) { ! This way, the daemon starts only after one turn has passed, ! because the first turn will move the captain to the deck. ! This helps to avoid text overload, because otherwise the ! spider attack would begin right after the room initial_desc. Activate(spider_attack) } !The door to the upper floor is called "upper door" here. if (quarters_door.name = "door") { quarters_door.name = "upper door" quarters_door.adjectives #1 = "upper" } !The door to the cabin also has a different name. if (cabin_door.name = "cabin's exit") { cabin_door.name = "cabin's entrance" cabin_door.adjectives #1 = "entrance" } !When here, some things aren't distant like when in the cabin. if (mast is distant) { mast is not distant cargo is not distant flat_deck is not distant deck_rails is not distant } !When here, some things are distant, not like when at the mill. if (windmill is not distant) { windmill is distant } !We should unset the flag indicating we meant to climb steps. if (side_steps.misc #1) { side_steps.misc #1 = false !Unflag that we said "up steps". } !Still trying to solve the problem of it disambiguating the !wing_slots based on "levers" noun, when we're not even on deck. if (wing_slots.nouns #1 ~= "slots") { wing_slots.nouns #1 = "slots" wing_slots.nouns #2 = "levers" } } before { location DoGoForward, DoGoBoatFore { Perform(&DoGo, barge_fore_dir) } location DoGoBackward, DoGoBoatAft { Perform(&DoGo, barge_aft_dir) } object DoSniff { PrintMessage(13,self,1) !Slightly like rotten apples. } } } !---------------------------------------------------------------------------- room cabin "In the Cabin" { inherits game_room !provides initial_desc and long_desc handling. u_to { return cabin_movement(u_obj) } n_to { return cabin_movement(n_obj) } s_to { return cabin_movement(s_obj) } e_to { return cabin_movement(e_obj) } w_to { return cabin_movement(w_obj) } ne_to { return cabin_movement(ne_obj) } se_to { return cabin_movement(se_obj) } sw_to { return cabin_movement(sw_obj) } nw_to { return cabin_movement(nw_obj) } in_to { return cabin_movement(in_obj) } out_to { return cabin_movement(out_obj) } ground_name "floor" extra_scenery "wall", "walls" each_turn { !The door to the cabin also has a different name. if (cabin_door.name = "cabin's entrance") { cabin_door.name = "cabin's exit" cabin_door.adjectives #1 = "exit" } !When here, deck stuff is distant. if (mast is not distant) { mast is distant cargo is distant flat_deck is distant deck_rails is distant } ! Still trying to solve the problem of it disambiguating the ! wing_slots based on "levers" noun, when we're not even on deck. ! I'll just remove the nouns. Then it *can't* confuse the object. if (wing_slots.nouns #1 = "slots") { wing_slots.nouns #1 = "" wing_slots.nouns #2 = "" } } before { location DoGoForward, DoGoBoatFore { Perform(&DoGo, barge_fore_dir) } location DoGoBackward, DoGoBoatAft { Perform(&DoGo, barge_aft_dir) } } } !---------------------------------------------------------------------------- room quarters "In the Captain's Quarters" { inherits game_room !provides initial_desc and long_desc handling. n_to { return quarters_movement(n_obj) } s_to { return quarters_movement(s_obj) } e_to { return quarters_movement(e_obj) } w_to { return quarters_movement(w_obj) } ne_to { return quarters_movement(ne_obj) } se_to { return quarters_movement(se_obj) } sw_to { return quarters_movement(sw_obj) } nw_to { return quarters_movement(nw_obj) } d_to { return quarters_movement(d_obj) } out_to { return quarters_movement(out_obj) } ground_name "floor" extra_scenery "wall", "walls" each_turn { !The door to the upper floor is just called "door" here. if (quarters_door.name = "upper door") { quarters_door.name = "door" quarters_door.adjectives #1 = "" } } before { location DoGoForward, DoGoBoatFore { Perform(&DoGo, barge_fore_dir) } location DoGoBackward, DoGoBoatAft { Perform(&DoGo, barge_aft_dir) } } } !---------------------------------------------------------------------------- room mill "At the Windmill" { inherits game_room !provides initial_desc and long_desc handling. !MISC #1 = which object is going to provide our "up" handler misc nothing u_to { if (self.misc #1 = nothing) { return false !Ambiguous. } else { return (self.misc #1).door_to } } s_to { return deck_ladder.door_to } w_to { return mill_door.door_to } in_to { return mill_door.door_to } each_turn { ! We won't need to do this on the deck, because you have to pass ! through here to get from the steps back to the deck. if (sail_arms is not distant) { sail_arms is distant sail_arms.nouns #6 = "" !Remove "wing" as noun. } ! We won't need to do this on the steps, because you have to pass ! through here to get from the deck back up to the mill's steps. if (windmill is distant) { windmill is not distant } ! We must have just came down from the steps. if (big_barge is distant) { big_barge is not distant } } } !---------------------------------------------------------------------------- room in_mill "Inside the Windmill" { inherits game_room !provides initial_desc and long_desc handling. e_to { return mill_door.door_to } out_to { return mill_door.door_to } ground_name "floor" each_turn { ! The main axle is distant when in here. if (main_axle is not distant) { main_axle is distant } } before { object DoSniff { PrintMessage(13,self,1) !The air smells musty } } } !---------------------------------------------------------------------------- room steps "On the Steps of the Windmill" { inherits game_room !provides initial_desc and long_desc handling. inherits floorless_room_class !Some actions are limited here. !MISC #1 = saw the warning about getting hurt by the sail arms. ! the warning is shown if we try to draw the sword ! or make other "physical" actions, while they turn. misc false d_to { return mill_steps.door_to } each_turn { !When we're up here, we're within reach. if (sail_arms is distant) { sail_arms is not distant sail_arms.nouns #6 = "wing" !Add "wing" as noun. } ! We must have just climbed up the steps. if (big_barge is not distant) { big_barge is distant } ! The main axle isn't distant when up here. if (main_axle is distant) { main_axle is not distant } } } !---------------------------------------------------------------------------- ! DAEMON/FUSE DEFINITIONS !---------------------------------------------------------------------------- daemon spider_attack { !MISC #1 = a flag used to skip setting a new attacker for one turn. misc false } event in spider_attack { local which = nothing if (red_spider.found_on = deck): which = red_spider elseif (black_spider.found_on = deck): which = black_spider elseif (gray_spider.found_on = deck): which = gray_spider !This daemon can handle turning itself off. if (which = nothing) or (location ~= deck) { Deactivate(self) : return } if (self.misc #1) { !Check to see if we've flagged not to immediately do new attack. self.misc #1 = false !Unset the flag, so we may pick next time. } elseif (attacker = which) { !Randomly, the attacking spider may take another action. rnd = random(5) !A message is shown three-fifths of the time. if (rnd <= 3) { !Note that "newline" won't work to make blank line. print "" !Begin with a blank line after prior text. if (attacker = gray_spider) and (spider_stunned) { PrintMessage(2,which,6) !The spider stumbles, stunned. } else { PrintMessage(2,which,3) !The spider takes aggressive action. } } } else { rnd = random(10) !50/50 chance that next will attack. !If we're on our first spider, or we hit the random. if (count_spiders = 3) or (rnd <= 5) { attacker = which !Note that "newline" won't work to make blank line. print "" !Begin with a blank line after prior text. PrintMessage(2,which,2) !Message that we are now under attack. } } } !---------------------------------------------------------------------------- ! SCENERY OBJECT CLASSES !---------------------------------------------------------------------------- ! This gets applied to the "spiders" plural class, and each of the three ! named components (legs, eyes, mandibles) for use in fighting against it. ! I originally intended to make "spiders" a plural_class, but then it would ! override this routine unless I paste the whole thing into "spider". ! class fight_spider { before { object DoHit, DoCut, DoStab, DoKick, DoPunch, DoKill, \ DoAttack, DoPush, DoMove, DoRight { local which : which = attacker !Because the spiders are distant and approaching, later. if (self is distant): return false !Distant Obj Handle !Because using anything other than sword won't work. if (xobject ~= nothing, sword) and \ (verbroutine ~= &DoPush, &DoMove, &DoRight) { !Trying to hit the spider with something else. PrintMessage(5,16,4) !Hit spider with xobject won't work. return true !No need to continue any further. } if (which = nothing) { if (red_spider.found_in = location) { which = red_spider } elseif (black_spider.found_in = location) { which = black_spider } elseif (gray_spider.found_in = location) { which = gray_spider } } !Don't do this in an "else" because it might be set above. if (which = nothing) { return false !Just in case. } else { ! Check if we're attacking a component of the gray spider. ! Also check to be sure we are involved in an "attack" verb. if (which = gray_spider) and \ (self ~= spiders) and \ (verbroutine = &DoHit, &DoCut, &DoStab, &DoAttack) { MakeReadySword !So we show what we're hitting with. PrintMessage(5,16,self) !Launch an attack on body part. attacker = which !Just in case it wasn't already. !We set a flag for each component body part attackable. if not (self.misc #1) { self.misc #1 = true !Flag that we attacked there. if (spider_stunned) { ! Let the player know that the spider is stunned, ! and prevent one round of "daemon" messages. spider_attack.misc #1 = true !Flag free round. print "" !Do a blank line before this message. PrintMessage(5,16,3) !Now we have it on edge. } } } else { !Assume that the player means to engage a single one. Perform(verbroutine, which, xobject) !Redirection } } } xobject DoThrowAt { if (object is always_held) { return false !Can't throw an always_held item. } else { ! Default wouldn't allow it since spiders are living. ! So, override by basically running the right code here. PrintMessage(4,16,4) !We throw object at xobject. move object to location !It falls to the ground } } object DoLook, DoGive, DoGiveReverse, DoShow, DoPoint { !Anything that *shouldn't* say "one at a time" goes here. !Since we're returning false anyway, no need for dist check. return false } object { ! For all others, pretend that this is a plural class. if (self = spiders) and (self is not distant) { ! "You'll have to do that one (object) at a time." OMessage(plural_class, 3) } else { return false !Default handling per object. } } } } !---------------------------------------------------------------------------- class single_spider { nouns "spider", "monster", "beast", "arachnid" article "the" is living before { object DoHit, DoCut, DoStab, DoKick, DoPunch, DoKill, \ DoAttack, DoPush, DoMove, DoRight { local picked = false !Because using anything other than sword won't work. if (xobject ~= nothing, sword) and \ (verbroutine ~= &DoPush, &DoMove, &DoRight) { !Trying to hit the spider with something else. PrintMessage(5,16,4) !Hit spider with xobject won't work. return true !No need to continue any further. } if (attacker = nothing) { if (self = red_spider) { !If red spider is here, we can attack it first. attacker = self : picked = true } elseif (self = black_spider) and not \ (red_spider.found_in = location) { !If red spider is gone, we can attack black. attacker = self : picked = true } elseif (self = gray_spider) and not \ (black_spider.found_in = location) { !If black spider is gone, we can attack gray. attacker = self : picked = true } } ! If the player didn't include the color, make it implicit. ! In the case of the gray one, there are two colors. Each ! spider will be given 2 colors (sometimes same) in case. if not IsWord(self.adjectives #1) and \ not IsWord(self.adjectives #2) { print "("; The(self); ")" } if (attacker ~= self) { !The spider we selected isn't attacking us. PrintMessage(2,self,5) !Others are of more concern. } elseif (verbroutine = &DoKick, &DoPunch) { if (picked) { !We say this if we initiated the attack now. PrintMessage(2,attacker,4) !Pick one to target. } PrintMessage(5,16,1) !You kick/punch, but it does no good. } elseif (verbroutine = &DoPush, &DoMove, &DoRight) { if (picked) { !We say this if we initiated the contact now. PrintMessage(2,attacker,4) !Pick one to target. } if (xobject = nothing, flat_deck, deck_lip) { if (spider_stunned) { !Don't need to check for color. We can only stun a !spider when it's the last one (gray spider remains). !So basically, we've finished off the last one. PrintMessage(7,6) !Cutscene: We push it over edge. self.found_on = nothing !This spider is now gone. Deactivate(spider_attack) !It's essentially over. deck.misc #1 = 1 !Spiders are now approaching us. spiders is distant !Because actions = far away. spiders.nouns #5 = "spider" !So we can refer. AddScore(35) !Defeated the gray spider. } else { !It's not close enough to the edge, to work. PrintMessage(12,self,1) !We can't push this one. } } else { return false !Pushing it doesn't get you anywhere. } } else { ! We're going to assume swordplay in all other cases. ! This *might* not be what the player intended, but ! there is a battle going on. This is how it goes. if (MakeReadySword) { ! The player can solve part by simply doing the command ! "ATTACK SPIDER" two times. But there's more fun to ! be had in kicking, blocking, and attempting other ! things so that the spider "aggressive" text happens. if (picked) { !We say this if we initiated the targeting now. PrintMessage(2,attacker,4) !Pick one to attack. } PrintMessage(5,16,2) !We fight back the "attacker". if (self = gray_spider) { ! We can't defeat this one with a normal attack. self.misc #1 ++ !Increment unsuccessful counter. } else { ! We succeed in driving out the first two spiders. self.found_on = nothing !This spider is now gone. ! The "spider_attack" daemon itself will handle ! dealing us our next attacker, and shutting ! itself down when done. But, don't set another ! attacker immediately. Let it be one turn out ! (or at least one turn -- it could be more). spider_attack.misc #1 = true !Flag delayed attack. ! When there is only one spider left, captain leaves. ! Also, we add colors to the "components" as needed. select (count_spiders) case 2 { spider_eyes.adjectives #1 = black_spider.adjectives #1 spider_legs.adjectives #1 = black_spider.adjectives #1 mandibles.adjectives #1 = black_spider.adjectives #1 AddScore(30) !Defeated the red spider. } case 1 { spider_eyes.adjectives #1 = gray_spider.adjectives #1 spider_legs.adjectives #1 = gray_spider.adjectives #1 mandibles.adjectives #1 = gray_spider.adjectives #1 move captain to cabin AddScore(31) !Defeated the black spider. } } } } } xobject DoThrowAt { if (object is always_held) { return false !Can't throw an always_held item. } else { ! Default wouldn't allow it since spiders are living. ! So, override by basically running the right code here. PrintMessage(4,16,4) !We throw object at xobject. move object to location !It falls to the ground } } } } !---------------------------------------------------------------------------- ! Provides some commonality between the two slots - things shared. ! class slot_commons { before { object DoOpen { word[1] = "raise" !The new verb (needed for message) word[2] = "lever" !The new noun (needed for DoLift) PrintMessage(6,2,"the lever") Perform(&DoLift, self) } object DoClose { word[1] = "lower" !The new verb (needed for message) word[2] = "lever" !The new noun (needed for DoLower) PrintMessage(6,2,"the lever") Perform(&DoLower, self) } } } !---------------------------------------------------------------------------- ! Players like to try to "stop blades" and all of that. Need to handle it ! in a generic way, for all the things that can possible be "stopped". ! class mill_switchables { is switchable, switchedon before { object DoSwitchOn { ! This should only ever happen when the blades are moving, ! because we remove the "switchable" ability afterwards. if (self is distant) { return false !It's too far away. } else { PrintMessage(12,mill_switchables,1) !Already on. } } object DoSwitchOff { ! This should only ever happen when the blades are moving, ! because we remove the "switchable" ability afterwards. if (self is distant) and (self ~= gears) { return false !It's too far away. } else { PrintMessage(12,mill_switchables,2) !Exactly how? } } } } !---------------------------------------------------------------------------- ! ROOM OBJECTS, GROUND OBJECTS !---------------------------------------------------------------------------- scenery clearing "clearing" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. nouns "clearing", "camp", "campsite", "site" adjectives "small", "abandoned", "camp", "less", "forested" article "the" found_at campsite is sleepable !i.e., There is a custom response at (15,7,self). } !---------------------------------------------------------------------------- scenery clearing_ground "ground" { inherits game_scenery !Provides the long_desc handling. inherits ground_class !Provides "put-in" drop handling. nouns "ground" adjectives "fertile", "forest" article "the" found_at campsite } !---------------------------------------------------------------------------- ! This is unique in that it covers both the floor *and* the room object. ! scenery flat_deck "flat deck" { !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 "deck", "floor", "barge", "boat", "ship" adjectives "flat", "barge's", "long", "deck" article "the" found_in cabin, deck before { object DoEnter, DoGo, DoApproach { if (location = deck) { return false !Default handling. } else { Perform(&DoGo, barge_fore_dir) } } } } !---------------------------------------------------------------------------- scenery in_cabin "cabin" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. nouns "cabin" article "the" found_in cabin } !---------------------------------------------------------------------------- scenery mill_ground "ground" { inherits game_scenery !Provides the long_desc handling. inherits ground_class !Provides "put-in" drop handling. nouns "ground", "grass", "land" adjectives "soft", "grassy", "short" article "the" found_in mill } !---------------------------------------------------------------------------- scenery mill_inside "windmill" { !Note that this does not inherit game_scenery. inherits roomobject_class !But it does get this. nouns "windmill", "mill" article "the" found_at in_mill } !---------------------------------------------------------------------------- ! SCENERY DEFINITIONS !---------------------------------------------------------------------------- scenery stream "stream" { inherits game_scenery !Provides handling for the description. nouns "stream", "streem", "creek", "creak", "water" adjectives "narrow", "wide", "narrowing", "widening" article "the" is container, unholdable capacity 1 !Although we can't actually store stuff here. found_at campsite, nothing !number two is "trawl" if seen. before { xobject DoThrowAt, DoPutIn { if (object is always_held) { return false !Default handling. } else { !We'll let the player do it. It won't break things. PrintMessage(4,19,object) !Throw it into the stream remove(object) !And then make sure it's gone now. } } } } !---------------------------------------------------------------------------- scenery logs "charred logs" { inherits game_scenery !Provides handling for the description. !We can say "logs of charred firewood" or "abandoned campfire". nouns "fire", "campfire", "log", "logs", "wood", "firewood" adjectives "prior", "traveler's", "abandoned", \ "camp", "charred", "logs" article "the" is plural found_in shallow_pit } !---------------------------------------------------------------------------- scenery shallow_pit "shallow pit" { inherits game_scenery !Provides handling for the description. nouns "pit", "firepit" adjectives "shallow" article "the" found_at campsite } !---------------------------------------------------------------------------- scenery forest "forest" { inherits game_scenery !Provides handling for the description. !So when in trawl net, we can say "tops of trees" and "tree tops". nouns "trees", "forest", "tops", "treetops" adjectives "tall", "towering", "thick", "tree", "tops" article "the" is unholdable found_at campsite, trawl before { !Here are some attempts to redirect actions to the single tree. object DoClimb { !Let the player know we're redirecting their request. print "("; The(maple_tree); ")" Perform(verbroutine, maple_tree, xobject) } } } !---------------------------------------------------------------------------- scenery maple_tree "maple tree" { inherits game_scenery !Provides handling for the description. nouns "tree", "maple" adjectives "towering", "maple", "old" article "the" found_at campsite before { object DoClimb { Perform(&DoGo, u_obj) !Basically, we're going up. } } } !---------------------------------------------------------------------------- component maple_roots "base roots" { inherits game_scenery !Provides handling for the description. nouns "root", "roots", "tops" adjectives "maple", "tree", "exposed", "base", "root" article "the" is plural part_of maple_tree } !---------------------------------------------------------------------------- component maple_limbs "tree limbs" { inherits game_scenery !Provides handling for the description. nouns "branches", "limbs" adjectives "maple", "tree" article "the" is plural part_of maple_tree before { object DoClimb { Perform(&DoGo, u_obj) !Basically, we're going up. } } } !---------------------------------------------------------------------------- component maple_foliage "maple tree foliage" { inherits game_scenery !Provides handling for the description. nouns "foliage", "leaves", "canopy" adjectives "maple", "tree", "star", "star-like", "starlike" article "the" is distant part_of maple_tree before { object DoGet { ! Even though the game_scenery class already covers this, ! the component class would take precedence otherwise. PrintMessage(3,1,self) !They're too far away. } } } !---------------------------------------------------------------------------- scenery shadow "rectangular shadow" { inherits game_scenery !Provides handling for the description. nouns "shadow", "spot" adjectives "small", "rectangular", "creeping", "moving", "strange" article "the" is unholdable parse_rank 2 !Mainly to avoid conflicts on the noun "shadow". found_at campsite } !---------------------------------------------------------------------------- ! This is the version of the barge as it's seen from the ground. ! scenery barge_bottom "rectangular flying thing" { inherits game_scenery !Provides handling for the description. !"shadow" is a noun so we can say "source of the shadow." nouns "thing", "something", "blot", "source", "shadow" adjectives "dark", "rectangular", "moving", "flying", "source" article "the" is distant found_in { if (location = campsite) { return sky !It's found up in the sky. } else { return nothing } } } !---------------------------------------------------------------------------- ! Players are likely to get clever and by referring to it as a barge. ! We'll anticipate that, and kind of stop their attempt in its tracks. :) ! Note that this is given the same name as the "unknown" flying thing. ! scenery distant_barge "rectangular flying thing" { inherits game_scenery !Provides handling for the description. nouns "barge", "boat", "vessel", "ship" adjectives "rectangular", "moving", "flying" article "the" is distant found_in { if (location = campsite) { return sky !It's found up in the sky. } else { return nothing } } before { !Redirect all actions to the barge_bottom (object). object { if (verbroutine = &DoLook) { return false !Default class handling for desc. } else { Perform(verbroutine, barge_bottom, xobject) } } !Redirect all actions to the barge_bottom (xobject). xobject { Perform(verbroutine, object, barge_bottom) } } } !---------------------------------------------------------------------------- ! This is the version of the barge as it's seen from the trawl net. ! scenery below_barge "flying barge" { inherits game_scenery !Provides handling for the description. !"shadow" is a noun so we can say "source of the shadow." nouns "boat", "barge", "bottom", "underside", "hull", "vessel", "ship" adjectives "rectangular", "moving", "flying", "barge" article "the" is distant found_in { if (location = trawl) { return sky !It's found up in the sky. } else { return nothing } } before { object DoEnter, DoGo, DoApproach { word[1] = "climb" !for the PrintMessage itself. PrintMessage(6,2,"up") !Assuming you want to climb up Perform(&DoGo, u_obj) } } } !---------------------------------------------------------------------------- scenery trawl_net "trawl net" { inherits game_scenery !Provides handling for the description. !MISC #1 = already attempted to cut self free? misc false nouns "net", "trawl-net" adjectives "fishing", "trawling", "trawl" article "the" found_at trawl before { object DoEnter, DoGo, DoApproach { Perform(&DoGo, in_obj) !You're already in the trawl net. } object DoClimb { Perform(&DoGo, u_obj) !Basically, we're going up. } object DoShake, DoPull, DoGet { PrintMessage(2,self,3) !Trying to shake or pull the net. } object DoGetFrom { if (xobject = below_barge, deck_edge, net_hooks) { PrintMessage(2,self,3) !Trying to remove the net. } else { return false !You don't see it there. } } object DoHit, DoBreak, DoAttack, DoCut, DoStab { if (verbroutine = &DoCut, &DoStab) and (xobject = nothing) { !Assumes we want to cut with sword. if (not MakeReadySword) { return true } } if (xobject = sword) { !In case the player needs to draw it. if (MakeReadySword) { PrintMessage(5,15,verbroutine) !That's a bad idea. self.misc #1 = true !We attempted to cut ourself free. } } else { PrintMessage(2,self,2) !Hitting the net doesn't really work. } } } } !---------------------------------------------------------------------------- scenery deck_edge "edge of the deck" { inherits game_scenery !Provides handling for the description. inherits obj_component !Things done here are to the barge. nouns "edge", "deck", "side" adjectives "edge", "barge's", "barge", "port", "starboard" article "the" is distant part_of below_barge } !---------------------------------------------------------------------------- scenery net_hooks "hooks" { inherits game_scenery !Provides handling for the description. nouns "hooks", "hook" adjectives "deck", "side", "net", "iron" article "the" is plural, distant part_of below_barge } !---------------------------------------------------------------------------- ! This was originally an instance of "plural_class", but that causes the ! class declaration to take priority over the inherited routines. There ! is conflicting code between plural_class and fight_spiders (some "before" ! trapping) which I wanted to just fall back to the class definition. The ! only way to do this is either to copy the entire fight_spider code here ! (which I didn't want to do, since it's re-used in other objects), or ! else not make the spiders a "plural_class" and just handle it all inside. ! !plural_class spiders "spiders" scenery spiders "spiders" { inherits game_scenery !Provides handling for the description. inherits animal !To trap for attempts to talk, ask, show, give, etc. inherits fight_spider !Action handling for attacking "spiders" plural. ! Note that noun #5 becomes "spider" singular, when they are distant. ! This is because player may try to interact with a spider, and it ! would otherwise assume single spider and say "you don't see it". nouns "spiders", "tarantulas", "arachnids", "horde", "" single_noun "spider" !Not plural_class, but still used in a message. adjectives "large", "red-eyed", "8-legged", \ "eight-legged", "hairy", "huge", "horde" article "the" !!! plural_of red_spider, black_spider, gray_spider is plural, living pronouns "they", "them", "their", "themselves" found_on { ! Now using the MISC counter on the "deck" room, for story, status. ! When it's 0, the spiders are on the deck and attacking (default). ! When it's 1, the barge is down, spiders are distant, but nearing. ! So, just checking the count of spiders is no longer the best way. ! if (count_spiders > 0) { if (deck.misc #1 <= 1) { return deck } else { return nothing } } before { object DoGet { VMessage(&DoGet, 7) ! "You can't take those." } } } !---------------------------------------------------------------------------- component spider_legs "spiders' legs" { inherits game_scenery !Provides handling for the description. inherits fight_spider !Action handling for attacking "legs". !MISC #1 = has the player already attacked gray spider's legs? misc false nouns "legs", "leg" !First two adjectives become gray/grey when it's the last one left. !They become "black/dark" after the red spider has been vanquished. adjectives "red", "red", "8", "eight", "1", "one", "hairy", "multi", \ "joint", "jointed", "multi-jointed", "spider", \ "spiders", "spider's", "spiders'", "thick", "long", \ "back", "front", "side" article "the" is plural part_of { if (spiders is distant): return nothing else: return spiders } } !---------------------------------------------------------------------------- component spider_eyes "spiders' eyes" { inherits game_scenery !Provides handling for the description. inherits fight_spider !Action handling for attacking "eyes". !MISC #1 = has the player already attacked gray spider's eyes? misc false nouns "eyes", "eye" !First two adjectives become gray/grey when it's the last one left. !They become "black/dark" after the red spider has been vanquished. !But, "red" still has to remain as additional one, due to eye color. adjectives "red", "red", "multiple", "many", "red", "glassy", \ "multitude", "spiders", "spider", "spider's", \ "spiders'", "several", "beady", "little" article "the" is plural part_of { if (spiders is distant): return nothing else: return spiders } } !---------------------------------------------------------------------------- component mandibles "spiders' mandibles" { inherits game_scenery !Provides handling for the description. inherits fight_spider !Action handling for attacking "mouth". !MISC #1 = has the player already attacked gray spider's mouth? misc false nouns "mandibles", "mandible", "mouth", "mouths", \ "jaw", "jaws", "pincer", "pincers", "maw", "maws", \ "pincer-like", "mandable", "mandables", \ "mandabal", "mandabals", "mandibal", "mandibals" !First two adjectives become gray/grey when it's the last one left. !They become "black/dark" after the red spider has been vanquished. adjectives "red", "red", "fierce", "deadly", "spiders", "spider", \ "spider's", "spiders'", "hairy", "jagged" article "the" is plural part_of { if (spiders is distant): return nothing else: return spiders } } !---------------------------------------------------------------------------- ! First spider (of three) is red. ! scenery red_spider "red spider" { inherits game_scenery !Provides handling for the description. inherits animal !To trap for attempts to talk, ask, show, give, etc. inherits single_spider !noun, is living, attacks, other commonalities. !Duplicate "red" on purpose. Used for color checking. adjectives "red", "red", "another", "haired", "hair", "one", "1", \ "nearest", "closest" found_on deck !When he's here, he's first. So always get default parse rank. ! parse_rank { ! return 0 ! } } !---------------------------------------------------------------------------- ! Second spider (of three) is black. ! scenery black_spider "black spider" { inherits game_scenery !Provides handling for the description. inherits animal !To trap for attempts to talk, ask, show, give, etc. inherits single_spider !noun, is living, attacks, other commonalities. adjectives "black", "dark", "very", "another", "haired", "hair", \ "one", "1", "nearest", "closest" found_on deck parse_rank { !Rule for the second spider here (if red spider is defeated). if (red_spider.found_on = location): return -2 else: return 0 !Return default if red one is gone. } } !---------------------------------------------------------------------------- ! Third spider (of three) is gray. ! scenery gray_spider "gray spider" { inherits game_scenery !Provides handling for the description. inherits animal !To trap for attempts to talk, ask, show, give, etc. inherits single_spider !noun, is living, attacks, other commonalities. !MISC #1 = how many unsuccessful attacks launched against this Gray. misc 0 adjectives "gray", "grey", "another", "haired", "hair", "one", "1", \ "nearest", "closest" found_on deck parse_rank { !Rule for the third spider here (if black spider is defeated). if (black_spider.found_on = location): return -2 else: return 0 !Return default if black one is gone. } } !---------------------------------------------------------------------------- scenery mast "mast" { inherits game_scenery !Provides handling for the description. !MISC #1 = whether the handle is lowered (false) or raised (true) misc false nouns "mast", "pillar", "post" adjectives "central", "center", "tall", "inner", "mast-like" article "the" found_in cabin, deck before { object DoLift, DoLower, DoMove, DoTurn, DoPush, DoPull { !Raising or lowering the piller is raising or lowering handles. !Let the player know that we're redirecting their attempt. if (self is distant) { return false !Default handling. Too far away. } else { print "("; The(mast_handles); ")" Perform(verbroutine, mast_handles) !Redirection } } object DoClimb { if (player in cargo) { Perform(&DoGo, d_obj) !We will go back down. } elseif InList(cargo,misc,self) { Perform(&DoClimb, cargo) !Climb up the crates. } else { !If there aren't any crates stack by it. PrintMessage(9,self,1) !Trying to climb up. } } object DoShake { if (self is distant) { return false !Default handling. Too far away. } else { PrintMessage(12,self,1) !Result of shaking it. } } } } !---------------------------------------------------------------------------- component mast_grooves "grooves" { inherits game_scenery !Provides handling for the description. nouns "grooves", "groove", "dips", "dip" adjectives "mast", "pillar", "post", "groove", "slight" article "the" is plural part_of { if (location = deck): return mast else: return nothing } } !---------------------------------------------------------------------------- component mast_handles "handles" { inherits game_scenery !Provides handling for the description. !MISC #1 = have we raised the handles at least once? !MISC #2 = have we lowered the handles at least once? misc false, false nouns "handles", "handle" adjectives "mast", "pillar", "post" !For "mast handles", etc. article "the" is plural part_of { if (location = deck): return mast else: return nothing } before { object DoMove, DoPush, DoPull { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (mast.misc #1) { Perform(&DoLower, self) } else { Perform(&DoLift, self) } } object DoLift { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (mast.misc #1) { ! Failure. They're already up. PrintMessage(12,self,3) !You can't raise the handles. } elseif (sail_arm in mast) { ! This part is kind of clever, I think. In order for the ! cargo to spill out at the end, the rails must be down. ! Well, the rails are down if you left the barge, so they ! must still be down when you return, after cutting the ! wing off. The wing blocks the handles, so you can't ! raise the handles. But when you dislodge the wing, it ! breaks the handles, so the rails can't come back up. ! In this way, the carge is free to be dumped, later. ! The player has no way to prevent it, thank goodness. PrintMessage(12,self,7) !The sail arm is in the way. } elseif (self is broken) { ! If the handle is broken, we can't raise the rails. PrintMessage(12,self,8) !When we knock the sail down. } else { !Success. SheatheSword !We have to put it away to free both hands. PrintMessage(12,self,5) !We do raise the handles. mast.misc #1 = true !The fence railing is now raised. deck_ladder is distant !We can no longer reach ladder. port_slot is distant !We can no longer reach port slot. starboard_slot is distant !No longer reach starboard. self.misc #1 = true !Flag that we raised handles once. if (deck.misc #1 = 1) { AddScore(37) !Raise the rails for the first time. } } } object DoLower { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (not mast.misc #1) { !Failure - the handles are already lowered. PrintMessage(12,self,2) !You can't lower the handles. } elseif (deck.misc #1 = 1) { PrintMessage(12,self,6) !Can't with spiders outside. } else { !Success. SheatheSword !We have to put it away to free both hands. PrintMessage(12,self,4) !We do lower the handles. mast.misc #1 = false !The fence railing is now lowered. deck_ladder is not distant !We can now reach the ladder. port_slot is not distant !We can now reach port slot. starboard_slot is not distant !Can now reach starboard. self.misc #2 = true !Flag that we lowered handles once. if (deck.misc #1 = 2) { !Let the player know that they should return to cabin. PrintMessage(8,captain,5) !Captain waves you in. AddScore(41) !Lowering the rails for the first time. } } } object DoTurn { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (mast.misc #1) { Perform(&DoLower, self) } else { PrintMessage(12,self,1) !You can't turn the handles. } } } } !---------------------------------------------------------------------------- scenery deck_rails "rails" { inherits game_scenery !Provides handling for the description. nouns "rails", "rail", "walls", "wall", "fence", "railing", "boards" adjectives "side", "bounding", "fence-like", "rail" is plural article "the" found_on { if (mast.misc #1) and (location = deck, cabin) { return location !We have raised the rails. } else { return nothing !The rails aren't here. } } before { object DoLower { if not CheckReach(self): return true !Cancels the action if (self is distant) { return false !Default handling for distant object. } else { word[1] = "lower" !Just in case. PrintMessage(6,2,"the mast handles") Perform(&DoLower, mast_handles) } } } } !---------------------------------------------------------------------------- plural_class wing_slots "wing slots" { inherits game_scenery !Provides handling for the description. !In order to keep this from tripping on other objects for slots and !levers, I'm going to completely remove the nouns if not on deck. nouns "slots", "levers" !Set and unset in room code. single_noun { if IsWord("levers"): return "lever" else: return "wing slot" } adjectives "both", "wing", "wooden", "grooved", "long", "vice-like" article "the" plural_of starboard_slot, port_slot plural_verbs { !Really, only "look" applies to both objects. ! if verbroutine = &DoLook, &DoGet, &DoDrop, &DoPutin if (verbroutine = &DoLook): return true else: return false } plural_parse_rank { ! The class uses -100 as a flag to calculate the parse_rank based ! on the highest parse_rank of member objects. I keep getting into ! trouble with objects which aren't in a location and shouldn't ! even be in scope tripping on other objects. So, by *not* returning ! -100 if we're in a non-scope room, I should be able to avoid that. if (location = deck) { return -100 !This'll cause it to auto-calculate. } else { return -99 !It should be totally out of scope, being so low. } } found_in { ! The class has it where the player is ALWAYS, which further mucks ! with the recognition of other things with the same name, when- ! ever the plural_class object has been put into scope. My idea of ! changing the parse_rank (above) didn't work, but hopefully this ! will. It'll only ever be in scope on the deck, right? print "test" if (location = deck): return location else: return false } } !---------------------------------------------------------------------------- scenery starboard_slot "starboard slot" { inherits game_scenery !Provides handling for the description. inherits slot_commons !Provides some commonalities between slots. nouns "slot", "vice", "lever", "clamp" adjectives "starboard", "starboard-side", "side", "wing", \ "grooved", "long", "vice-like" article "the" found_on deck plural_is wing_slots is openable, not open, container capacity 1 !Eventually we'll "put sail arm in slot". parse_rank { if (location = deck) { !Unless the player specifically specifies the port slot... return 2 !Elevate this so we always assume the starboard } else { return -99 !But don't interfere with "lever" noun elsewhere. } } distant_response { PrintMessage(18,1,self) } before { object DoPush, DoPull, DoMove, DoRelease { if not CheckReach(self): return true !Cancels the action if InList(starboard_wing,found_in,location) or \ (sail_arm in self) { Perform(&DoLift, self) !Raise the lever, to release. } else { Perform(&DoLower, self) !Lower the handle. } } object DoLift { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (deck.misc #1 = 1) and (not mast.misc #1) { PrintMessage(3,27,2) !No time, with spiders approaching. } elseif (deck.misc #1 ~= 3) { !We shouldn't mess with the wing slot while flying. PrintMessage(12,self,6) !Would be remiss to mess with it. } elseif (self is not distant) and not IsWord("slot") { if InList(starboard_wing,found_in,location) { !Success. We have released the wing! PrintMessage(12,self,2) !The wing falls to the ground. starboard_wing.found_at = mill !The wing is moved. starboard_wing is not distant !We can get to it. starboard_wing.nouns #3 = "exterior" !A new noun. starboard_wing.nouns #4 = "crossbars" !Another noun. starboard_wing.nouns #5 = "crossbar" !Another noun. starboard_wing.adjectives #7 = "exterior" !Adjective. AddScore(42) !Releasing the wing gets score. } elseif (sail_arm in self) { !We can't. The sail arm is good. PrintMessage(12,self,3) !We won't let the player. } else { !It's already lowered. Nothing to release. PrintMessage(12,self,1) !It's already lifted. } } else { return false !Default - we can't do it, or whatever. } } object DoLower { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (self is distant) { return false !We can't do it, probably 'cuz rails are up. } elseif (deck.misc #1 = 1) { PrintMessage(3,27,2) !No time, with spiders approaching. } elseif (deck.misc #1 ~= 3) { !We shouldn't mess with the wing slot while flying. PrintMessage(12,self,6) !Would be remiss to mess with it. } elseif InList(starboard_wing,found_in,location) or \ (sail_arm in self) { PrintMessage(12,self,5) !The lever is already down. } else { PrintMessage(12,self,4) !No need, without replacement wing. } } } } !---------------------------------------------------------------------------- scenery port_slot "port-side slot" { inherits game_scenery !Provides handling for the description. inherits slot_commons !Provides some commonalities between slots. nouns "slot", "vice", "lever", "clamp" adjectives "port", "port-side", "side", "wing", "grooved", \ "long", "vice-like" article "the" found_on deck plural_is wing_slots is broken, not fixable, openable, not open parse_rank { if (location = deck) { !The player would have to reference it as "port slot" to work. return 0 !Default, but it's below the starboard slot. } else { return -99 !But don't interfere with "lever" noun elsewhere. } } distant_response { PrintMessage(18,1,self) } before { object DoLift, DoLower, DoPush, DoPull, DoMove, DoRelease { if not CheckReach(self): return true !Cancels the action if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (deck.misc #1 = 1) and (not mast.misc #1) { PrintMessage(3,27,2) !No time, with spiders approaching. } elseif (deck.misc #1 ~= 3) { !We shouldn't mess with the wing slot while flying. PrintMessage(12,self,2) !Would be remiss to mess with it. } elseif not IsWord("slot") and (self is not distant) { PrintMessage(12,self,1) !We can't. It's broken. } else { return false !Default - we can't do it, or whatever. } } } } !---------------------------------------------------------------------------- plural_class barge_wings "barge's wings" { inherits game_scenery !Provides handling for the description. nouns "wings" single_noun "wing" adjectives "barge", "barge's", "wooden" article "the" is distant ! plural_of #3 becomes "sail_arm" after it's installed. plural_of starboard_wing, port_wing, nothing plural_verbs { !Really, only "look" applies to both objects. ! if verbroutine = &DoLook, &DoGet, &DoDrop, &DoPutin if (verbroutine = &DoLook): return true else: return false } } !---------------------------------------------------------------------------- scenery starboard_wing "starboard wing" { inherits game_scenery !Provides handling for the description. !MISC #1 = whether or not the wing is leaned up against windmill. misc false !Nouns #3 becomes "exterior" after it's dropped off the side. !Nouns #4 becomes "crossbars" after it's dropped off the side. !Nouns #5 becomes "crossbar" after it's dropped off the side. nouns "wing", "structure", "", "", "", "ribcage", "ribs" !Adjectives #7 becomes "exterior" as well ("exterior of wing"). adjectives "starboard", "starboard-side", "side", "wooden", \ "rib-like", "damaged", "", "riblike" article "the" is distant, broken, not fixable !Becomes "not distant" when dropped. !Note that "InList found_on deck" is checked by captain short_desc. found_on deck !Gets found_at mill, once we release it. plural_is barge_wings !Unless the player specifically specifies the port slot... parse_rank { if (location = deck) { return 2 !Elevate this so we always assume the starboard. } elseif (location = mill) and not IsWord("structure") { return 2 !Elevate this so we always assume the starboard. } else { return 0 !Default parse rank elsewhere. } } distant_response { PrintMessage(18,self,1) } before { object DoRelease { if not CheckReach(self): return true !Cancels the action if (location = deck) { word[1] = "raise" !The new verb (needed for message) word[2] = "lever" !The new noun (needed for DoLift) PrintMessage(6,2,"the starboard lever") Perform(&DoLift, starboard_slot) } else { return false !There is no way to "release" it elsewhere. } } object DoGet { if not CheckReach(self): return true !Cancels the action if (location = deck) { return false !Default handling. } else { if (self.misc #1) { PrintMessage(10,self,2) !It's leaning against mill. } else { PrintMessage(10,self,1) !On the ground, can only move. } } } object DoClimb { if not CheckReach(self): return true !Cancels the action if (self.misc #1) { ! Some special conditions when climbing, so rather than ! duplicate it here, simply re-route to the mill_steps. Perform(&DoClimb, mill_steps) !Re-route } else { return false !Can't climb it. } } ! I would really like to support "put wing on steps" but the ! verbroutine only works with something "held". I could change ! it, or have a pre-routine check my condition and reject any ! others when the object isn't held, but it's a "multiheld" verb, ! and since I'm running out of time before IFComp, this one is just ! going to have to be not quite as "robust" as I would have hoped. ! When the player does "get wing" it'll say that it can be moved. ! When the player does "move wing" it'll say "...toward nothing." ! Hopefully, the player will figure out "move wing toward steps." ! I *could* let the player pick up one end of the wing, I guess. ! But that would mean making a psuedo-object, or changing it so ! that the wing isn't always scenery. Too much work, too late now. !!! object DoPutIn { !!! } object DoRight { if (VerbWord = "prop", "stand") and (xobject = nothing) { print "(by "; The(mill_steps); ")" Perform(&DoMove, self, mill_steps) !Move it over. } else { return false !Default handling for all other cases. } } object DoMove, DoPush, DoPull, DoArrange { if not CheckReach(self): return true !Cancels the action if (location = deck) { return false !Default handling.... it's on the deck. } elseif (self.misc #1) { PrintMessage(10,self,2) !Don't need to move it now. } elseif (xobject = nothing) { PrintMessage(12,self,1) !Moved, toward nothing. } elseif (xobject = big_barge, deck_ladder, mill_door) { PrintMessage(12,self,2) !Drag toward an xobject. } elseif (xobject = mill_steps, windmill) { if (xobject = windmill) { ! Previously this wasn't allowed. It would give a ! further clue that just dragging to the side didn't ! help. On beta feedback and further consideration, ! it's now allowed. But, the player should know. if (VerbRoutine = &DoArrange) { print "(by "; } else { print "(toward "; } print The(mill_steps); ")" } PrintMessage(12,self,3) !Success. Moved it to steps. mill_steps is not broken !Well, it's sorta fixed. self.misc #1 = true !We're leaning against the steps. AddScore(45) !For moving the wing over to the steps. } else { !Moving it toward anything else won't work. PrintMessage(3,2,5) !You see no good way to do that. } } } } !---------------------------------------------------------------------------- scenery port_wing "port-side wing" { inherits game_scenery !Provides handling for the description. nouns "wing" adjectives "port", "port-side", "side", "wooden" article "the" is distant found_on deck plural_is barge_wings distant_response { PrintMessage(18,self,1) } before { object DoRelease { if not CheckReach(self): return true !Cancels the action word[1] = "raise" !The new verb (needed for message) word[2] = "lever" !The new noun (needed for DoLift) PrintMessage(6,2,"the port-side lever") Perform(&DoLift, port_slot) } } } !---------------------------------------------------------------------------- scenery aft_cabin "cabin" { inherits game_scenery !Provides handling for the description. nouns "cabin", "house" article "the" found_on deck before { object DoEnter, DoGo, DoApproach { if not CheckReach(self): return true !Cancels the action Perform(&DoGo, barge_aft_dir) } } } !---------------------------------------------------------------------------- scenery side_steps "side steps" { inherits game_scenery !Provides handling for the description. !MISC #1 becomes true for one turn, if we tried to climb the steps. misc false nouns "steps", "stairs" adjectives "side", "cabin", "cabin's", "wooden" article "the" is plural found_on deck door_to { !This doesn't have its own. return (quarters_door.door_to) } before { object DoEnter, DoClimb, DoGo, DoApproach { if not CheckReach(self): return true !Cancels the action self.misc #1 = true !Flag that we tried to go up the steps. Perform(&DoGo, u_obj) !Attempt to go upward. } } } !---------------------------------------------------------------------------- scenery cabin_door "cabin's entrance" { inherits game_scenery !Provides handling for the description. nouns "entrance", "doorway", "opening" adjectives "cabin", "cabin's", "lower" article "the" found_at deck, cabin !Not really, but this allows action traps. is openable, open, lockable, not locked door_to { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (deck.misc #1 > 1) or (mast.misc #1) { DropTheObject(sail_arm) !Too big to carry up with us. GetTheObject(parchment) !If it fell, we pick it up. return cabin } else { return nothing !Can't go that way right now. } } else { return deck !From the cabin, out is always deck. } } before { object DoEnter, DoGo, DoApproach { if not CheckReach(self): return true !Cancels the action if (location = deck) { Perform(&DoGo, barge_aft_dir) } else { return false !We can't. } } object DoExit { if not CheckReach(self): return true !Cancels the action if (location = cabin) { Perform(&DoGo, barge_fore_dir) } else { return false !We can't. } } object DoOpen, DoClose, DoLock, DoUnlock { if not CheckReach(self): return true !Cancels the action PrintMessage(12,self,1) !There is no door. } } } !---------------------------------------------------------------------------- scenery deck_ladder "starboard ladder" { inherits game_scenery !Provides handling for the description. nouns "ladder" adjectives "side", "starboard", "starboard-side" article "the" found_at mill, deck door_to { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (deck.misc #1 = 3) and (not mast.misc #1) { DropTheObject(sail_arm) !Too big to carry up with us. SheatheSword !Needs to be sheathed before climbing. GetTheObject(parchment) !If it fell, we pick it up. return mill } else { return nothing !Can't go that way right now. } } else { SheatheSword !Before we climb, put it away. return deck !We can climb back to the deck. } } before { object DoClimb, DoEnter, DoGo, DoApproach { if not CheckReach(self): return true !Cancels the action if (location = deck) { Perform(&DoGo, d_obj) } else { mill.misc #1 = self !Necessary for "up" to work. Perform(&DoGo, u_obj) !Climb up the deck's ladder. } } object DoMove, DoPull, DoPush, DoGet { if not CheckReach(self): return true !Cancels the action ! The player might get the bright idea to use the ! ladder to reach the top of the mast. if (Count_Spiders > 1) { PrintMessage(3,27,3) !Too many spiders block the way. } elseif (Count_Spiders = 1) { PrintMessage(3,27,1) !No time. Need to fight the spiders. } elseif (sail_arm in mast) { PrintMessage(10,self,2) !We can't use it to get the sail. } else { PrintMessage(10,self,1) !We can't move it or anything. } } } } !---------------------------------------------------------------------------- scenery cabin_ladder "ladder" { inherits game_scenery !Provides handling for the description. nouns "ladder" article "the" found_in cabin, quarters door_to { SheatheSword !Needs to be sheathed before climbing. if (location = cabin) { return quarters } else { return cabin } } before { object DoClimb, DoEnter, DoGo, DoApproach { if (location = cabin) { Perform(&DoGo, u_obj) } else { Perform(&DoGo, d_obj) } } object DoMove, DoPull, DoPush, DoGet { ! The player might get the bright idea to use the ! ladder to reach the top of the mast. if (sail_arm in mast) { PrintMessage(10,self,2) !We can't use it to get the sail. } else { PrintMessage(10,self,1) !We can't move it or anything. } } } } !---------------------------------------------------------------------------- scenery deck_lip "lip of the deck" { inherits game_scenery !Provides handling for the description. nouns "lip", "deck", "edge", "ridge" adjectives "ridged", "lip", "edge", "edges", "deck's", "deck", "short" article "the" found_on deck parse_rank { if IsWord("lip") or IsWord("edge") { return 0 !Normal rank } else { return -2 !So that "deck" doesn't interfere with real deck. } } } !---------------------------------------------------------------------------- scenery cargo "cargo crates" { inherits game_scenery !Provides handling for the description. !MISC #1 = List of places the player has moved or arranged crates. ! 1=Mast, 2=Side_Steps, 3=Cabin_Door, 4=Deck_Rails, ! 5=Deck_Lip, 6=Deck_Ladder, 7=Aft_Cabin, 8=Port_Slot, ! 9=Starboard_Slot, 10=Captain misc nothing, nothing, nothing, nothing, nothing, \ nothing, nothing, nothing, nothing, nothing !After stacking, three adjectives become "three" "stack" "step-like" nouns "cargo", "crates", "crate", "box", "boxes", "containers" adjectives "", "", "", "cargo", "crates", "wooden", "thick" article "the" is plural, container, openable, not open, lockable, not locked found_at deck, cabin prep "on", "off" !Override the default prepositions. capacity 0 !We can't actually put anything on them. !We'll set reach #2 to the sail_arm, when it falls to the mast. !We'll blank out reach #2 after the drop the sail arm off the mast. reach mast, nothing before { object DoSniff { if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (self is distant) { return false !Default distant handling. } else { PrintMessage(13,self,1) !It smells like rotten apples. } } object DoMove, DoPush, DoPull, DoArrange { ! ! I was worried about this puzzle, at first. If I just took ! any attempt to "move" the crates as a solution, the player ! might solve it without really knowing how or why. But, if I ! allow crates to be moved to various areas around the deck, ! it becomes a lot more useful, meaningful, and realistic. The ! solution becomes stacking crates near the post, but it's a ! solution the player should actually arrive at based on clues. ! if (self is distant) { return false !Default "it's too far away" handling. } elseif (player in cargo) { !Not while you're standing on them. PrintMessage(9,self,3) !You can't, while standing on them. } elseif (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } else { if (xobject = nothing) { if (sail_arm in mast) and (self.misc #1 = nothing) { print "(toward "; The(mast); ")" xobject = mast } else { PrintMessage(12,self,1) !Arrange crates at random. } } if (xobject ~= nothing) { !We have to determine which thing the player tried. if (xobject.type = component) and \ (xobject.part_of ~= nothing) { xobject = xobject.part_of } if (xobject = sail_arm) and (sail_arm in mast) { xobject = mast !We're moving toward the mast. } if (xobject is distant) { !We can't move the crates there. Far away. PrintMessage(3,28,xobject) !It's too far away. } else { select xobject case mast { rnd = 1 self.adjectives #1 = "three" self.adjectives #2 = "stack" self.adjectives #3 = "step-like" self is enterable !We can climb up. self is platform !So that "on" works. AddScore(39) !Stacking boxes by mast. } case side_steps: rnd = 2 case cabin_door: rnd = 3 case deck_rails: rnd = 4 case deck_lip: rnd = 5 case deck_ladder: rnd = 6 case aft_cabin: rnd = 7 case port_slot: rnd = 8 case starboard_slot: rnd = 9 case wing_slots { if (self.misc #8 = nothing) { xobject = port_slot : rnd = 8 } elseif (self.misc #9 = nothing) { xobject = starboard_slot : rnd = 9 } else { rnd = 0 } } case captain: rnd = 10 case else: rnd = 0 if (rnd = 0) { PrintMessage(12,self,2) !You can't move there. } else { !Appropriate message shown, if already moved. if not InList(self,misc,xobject) { SheatheSword !We need to put it away. } PrintMessage(12,self,xobject) !We moved it. self.misc #rnd = xobject !Goes into our list. } } } } } object DoGet { if (self is distant) { return false !Default "it's too far away" handling. } elseif (player in cargo) { !Not while you're standing on them. PrintMessage(9,self,3) !You can't, while standing on them. } elseif (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } else { PrintMessage(10,self,1) !The crates are too heavy to get. } } object DoClimb { if (self is distant) { return false !Default "it's too far away" handling. } elseif (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } else { Perform(&DoEnter, self) !We handle climbing via "enter" } } object DoLookIn, DoSearch { if (self is distant) { return false !Default "it's too far away" handling. } else { PrintMessage(2,self,4) !Can't see inside. } } object DoEnter { if (self is distant) { return false !Default "it's too far away" handling. } elseif (VerbWord = "enter") { !We can't really "enter" the crates, so reject it. PrintMessage(3,15,self) !You can't enter the crates. } elseif (self is not enterable) { if (sail_arm in mast) { PrintMessage(9,self,2) !The crates not close enough. } else { PrintMessage(9,self,1) !It seems pointless. } } else { DropTheObject(sail_arm) !Too big to carry up with us. self is open !Temporary, just so the "climb" works. return false !We succeed in climbing up. } } object DoExit { self is open !Temporary, just so we can climb down. return false !Because it'll succeed. } object DoCut { !No need to check "distant" and "checkreach" -- either we'll !re-route to DoBreak (which will) or return false (which will). if (xobject = nothing, sword) { if (MakeReadySword) { Perform(&DoBreak,self,sword) !Re-route to DoBreak. } } else { return false !Default handling. } } object DoHit, DoAttack { !No need to check "distant" and "checkreach" -- either we'll !re-route to DoBreak (which will) or return false (which will). if (xobject = pipe, sword) { Perform(&DoBreak, self, xobject) !Re-route to break it. } else { return false !Let the system tell player that s/he can't. } } object DoPry, DoOpen, DoUnlock, DoBreak { if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (player in cargo) { !Not while you're standing on them. PrintMessage(9,self,3) !You can't, while standing on them. } elseif (self is distant) { return false !It's distant, so give defaults. } else { if (xobject = sword) { if not (MakeReadySword) { return true !can't do it. } } if (xobject = nothing, sword, pipe) { if (verbroutine = &DoBreak) { PrintMessage(12,self,4) !We can't break the crates. } else { PrintMessage(12,self,3) !We can't open the crates. } } else { return false !Default handling } } } } after { object DoEnter { self is not open !Undo its temporary state. PrintMessage(2,self,2) !Climb up the crates. AddScore(40) !Climbing up onto the boxes. } object DoExit { self is not open !Undo its temporary state. PrintMessage(2,self,3) !Climb down the crates. DescribePlace(location) } } } !---------------------------------------------------------------------------- component cabin_windows "cabin windows" { inherits game_scenery !Provides handling for the description. nouns "windows", "window", "cut-outs", "cut-out", "cutouts", "cutout" adjectives "cabin's", "cabin", "forward" article "the" is plural is container, transparent !So "look in windows" will work. capacity 1 !Nothing actually fits in the windows. part_of { if (location = deck): return aft_cabin else: return cabin !TODO - we need wall objects...? !If adding walls to cabin, need to remove extra_scenery. } before { object DoLookThrough, DoLookIn { PrintMessage(2,self,2) !Message about looking through windows. } object DoEnter, DoGo { if not CheckReach(self): return true !Cancels the action printMessage(9,self,1) !You can't fit through them. } } } !---------------------------------------------------------------------------- scenery quarters_door "upper door" { inherits game_scenery !Provides handling for the description. nouns "door" adjectives "upper", "simple" article "the" found_on deck, quarters is lockable, locked, openable, not open door_to { if not CheckReach(self): return nothing if (location = deck) { if (deck.misc #1 > 1) and (self is not locked) { DropTheObject(sail_arm) !Too big to carry up with us. GetTheObject(parchment) !If it fell, we pick it up. if (self is not open) { ! Should we print an (opening it first) message here? ! Not sure, because it'd be a little awkward going up. self is open !because we open it, going up. } return quarters } else { return nothing !Can't go that way right now. } } else { !There is no trick to unlocking the door. if (self is locked) { PrintMessage(6,18,self) !Unlocking the door first. self is not locked PrintMessage(6,19,self) !"(and then opening it)" self is open return self.door_to !Return linked room. } elseif (self is not open) { PrintMessage(6,6,self) !Open the door first. self is open return self.door_to !Return linked room. } else { return deck !The steps lead back down to the deck. } } } before { object DoUnlock { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } elseif (self is not locked) { return false !It's not locked. } else { PrintMessage(9,deck,u_obj) !Captain, or it's locked. } } else { return false !We can unlock it from the inside. } } object DoOpen { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (self is open) { return false !It's already open. } elseif (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } else { PrintMessage(9,deck,u_obj) !Captain, or it's locked. } } else { if (self is locked) { PrintMessage(6,18,self) !Unlocking it first. self is not locked PrintMessage(6,19,self) } return false !So default messages work afterwards. } } object DoClose { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (self is not open) { return false !It's already closed. } elseif (deck.misc #1 = 0) { PrintMessage(3,27,1) !No time. Need to fight spiders! } else { return false !We can close it from the outside. } } else { return false !Nothing needs confirmed, from inside. } } object DoLock { if not CheckReach(self): return true !Cancels the action if (location = deck) { if (self is locked) { return false !It's already locked. } else { PrintMessage(2,self,2) !Can't lock from outside. } } else { if (self is open) { PrintMessage(6,9,self) !Closing the door first. self is not open PrintMessage(6,22,"locking it") } return false ! so default message works afterwards. } } object DoEnter, DoGo, DoApproach { if not CheckReach(self): return true !Cancels the action if (location = deck) { Perform(&DoGo, u_obj) } else { Perform(&DoGo, barge_fore_dir) } } } } !---------------------------------------------------------------------------- ! Here's the power of an IF language -- a command like "slide slide bolt" ! will actually be parsed, understood, and accurately processed. ! component slide_bolt "slide-bolt" { inherits game_scenery !Provides handling for the description. nouns "slide-bolt", "bolt" adjectives "simple", "slide", "locking" article "the" is lockable, openable part_of { if (location = quarters): return quarters_door else: return nothing !It's not there on the other side. } before { object DoMove, DoPush, DoPull { if (xobject = nothing) { if (quarters_door is locked) { word[1] = "unlock" !So message works. PrintMessage(6,1,quarters_door) !Assuming you mean to... Perform(&DoUnlock, quarters_door) } else { word[1] = "lock" !So message works. PrintMessage(6,1,quarters_door) !Assuming you mean to... Perform(&DoLock, quarters_door) } } else { ! Did the player "move bolt toward" something? ! Well, that's not really valid phrasing for this. return false !Default handling } } object DoLock, DoClose { ! Re-route all these attempts to lock the door. Perform(&DoLock, quarters_door) } object DoUnlock, DoOpen { ! Re-route all these attempts to unlock the door. Perform(&DoUnlock, quarters_door) } } } !---------------------------------------------------------------------------- scenery helm "helm" { inherits game_scenery !Provides handling for the description. nouns "helm", "system", "base" adjectives "steering", "base", "barge's" article "the" found_in cabin before { object DoGet { if (VerbWord = "take") and (xobject = nothing) { word[1] = "turn" !For the message PrintMessage(6,1,helm_wheel) !Assuming you mean to turn... Perform(&DoTurn, helm_wheel) !And then re-route intention. } else { return false !Default handling, otherwise. } } } } !---------------------------------------------------------------------------- scenery instruments "instruments" { inherits game_scenery !Provides handling for the description. nouns "levers", "lever", "instruments", "instrument", \ "gauges", "gauge" adjectives "helm", "helm's" article "the" is plural part_of helm ! Hugo's plural_class is cool, but it has the side-effect of being in ! scope at the most inopportune times. So I've really had to manipulate ! the parse_rank of the plural_class members *as well as* objects that ! have the same names in other locations. parse_rank 2 !To avoid conflicts with "wing slots" that aren't even here. before { object DoMove, DoPull, DoPush, DoLift { !It has to be the "lever" else this action means nothing. if IsWord("lever") or IsWord("levers") { if (deck.misc #1 = 4) { !Success, move the lever.. !We've completed the mission. Here comes a cutscene. Chapter_End_Part2 !End part2 and start part3. } elseif (captain in location) { !We're flying if he's here before state 4. PrintMessage(12,self,1) !The captain won't let you. } else { !If were here and no captain, then not flying. PrintMessage(12,self,2) !Nothing happens. } } else { PrintMessage(12,self,3) !You see no good way to.... } } } } !---------------------------------------------------------------------------- ! If I had more time, I'd implement "spokes" and "handles" separately from ! the wheel. But, IFComp is barely two weeks away, and with a whole 'nother ! chapter (not to mention the epilogue) to write, this'll have to do. ! scenery helm_wheel "wheel" { inherits game_scenery !Provides handling for the description. nouns "wheel", "spokes", "handles" adjectives "helm", "helm's", "steering", "eight", "ornate", "wooden" article "the" part_of helm before { object DoTurn, DoMove, DoPull, DoPush { if (deck.misc #1 = 4) { !Success, we turn the wheel. !We've completed the mission. Here comes a cutscene. Chapter_End_Part2 !End part2 and start part3. } elseif (captain in location) { !We're flying if he's here before state 4. PrintMessage(12,self,1) !The captain won't let you. } else { !If were here and no captain, then not flying. PrintMessage(12,self,2) !Nothing happens. } } object DoGet { if (VerbWord = "take") and (xobject = nothing) { word[1] = "turn" PrintMessage(6,2,"it") !Assuming you mean to turn... Perform(&DoTurn, self) !And then re-route intention. } else { return false !Default handling, otherwise. } } } } !---------------------------------------------------------------------------- scenery distant_captain "captain" { inherits game_character !For talk trapping, etc. Before scenery. inherits game_scenery !Provides handling for the description. inherits barge_captain !Gives us nouns, adjectives, char, etc. is distant !The whole point of this object is to be distant. found_in { if (captain in cabin) and \ (location = deck) and \ (deck.misc #1 >= 2) { !(1) The captain must actually be inside the cabin. !(2) The player must be out on the deck. !(3) Before state 2, the captain is ducked out of sight. return deck } else { return nothing } } } !---------------------------------------------------------------------------- scenery windmill "windmill" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. nouns "mill", "windmill", "structure", "stones", \ "tower", "side", "wall", "walls" adjectives "brown", "green", "stone", "side" article "the" is distant !Becomes "not distant" in the "mill" room, and on steps. !found_at #3 becomes "deck" only when we're in state #3. found_at mill, steps, nothing before { object DoEnter, DoGo, DoApproach { if (location = mill) { Perform(&DoGo, w_obj) !We go to the west, to enter it. } elseif (location = steps) { PrintMessage(3,1,mill_door) !The door is too far away. } else { ! I'd say the mill_door on the deck too, but then it opens ! up things the player might try to the door, and the ! door isn't listed at the deck location at all. PrintMessage(3,1,windmill) !The windmill is too far away. } } object DoClimb { if (location = mill) { Perform(&DoClimb, mill_steps) !Redirect to climb steps. } else { Perform(&DoGo, d_obj) !We're basically going down. } } object DoKill, DoAttack { ! We won't handle all verbs. Just the ones that would indicate ! the player is trying for a Don Quixote-esque thing. I would ! be remiss if I didn't give an appropriate response. PrintMessage(5,19,1) !Trying to fight. It's bigger. Might win. } xobject DoGetFrom { if (self is distant) { return false } elseif (object in mill_latch) and (location = mill) { !We're probably trying to get lock from door. Perform(&DoGetFrom,object,mill_latch) !Redirect } else { return false !You don't see it there, or whatever. } } } } !---------------------------------------------------------------------------- scenery mill_door "windmill's door" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have tried cutting/stabbing the door, with the sword. !MISC #2 = we have tried hitting the door with the lead pipe. !MISC #3 = we have tried just knocking it down (hitting with nothing). !MISC #4 = we have tried just kicking it down as well. misc false, false, false, false nouns "door" adjectives "wooden", "single", "mill's", "mill", "windmill's" article "the" is openable, not open, lockable, locked, platform found_at mill, in_mill capacity 1 !Basically, the lock is all that's on/in it. door_to { if (self is locked) { PrintMessage(9,self,1) !A lock is on the door. It won't open. } else { if (self is not open) { PrintMessage(6,6,self) !Opening the door first. self is open } if (location = mill): return in_mill else: return mill !We go back outside } } before { object DoPush { !It hinges outward. if (location = mill) { Perform(&DoClose, self) } else { Perform(&DoOpen, self) } } object DoPull { !It hinges outward. if (location = mill) { Perform(&DoOpen, self) } else { Perform(&DoClose, self) } } object DoPry { if (self is locked) { if (xobject = nothing) and Contains(player,pipe) { xobject = pipe PrintMessage(6,12,xobject) !"(with the lead pipe)" } if (xobject = pipe) { !Success -- we break the latch. PrintMessage(5,17,8) !The lock falls off. mill_latch is broken : move rusty_lock to location self is not locked !But rusty_lock still is. rusty_lock is not hidden !Now we'll see it appear. AddScore(44) !Getting the mill's door unlocked. } elseif (xobject = nothing) { ! Mimic the DoPry verb routine in this instance. ! This sets "LookForAnswer" so that "with x" works. ! If we had the pipe, we'd use it implicitly, so this ! really won't work with any other xobject, but oh well. PrintMessage(3,22,object) !How do you intend to? } else { VMessage(&DoUnlock,1) !Doesn't seem to do the trick. } } else { VMessage(&DoUnlock, 3) !The door is already unlocked. } } object DoUnlock { if (self is locked) { PrintMessage(6,1,rusty_lock) !Assuming you mean... Perform(&DoUnlock, rusty_lock, xobject) !Try the lock. } else { return false !The door isn't locked. } } object DoLock { if (self is locked) { return false !It's already locked. } else { if (xobject = nothing) and Contains(player, rusty_lock) { xobject = rusty_lock PrintMessage(6,12,xobject) !With the rusty lock. } if (xobject = rusty_lock) { if (xobject is locked) or \ (mill_latch is broken) or \ (location ~= mill) { PrintMessage(2,self,2) !Unsuccessful to re-lock. } else { ! There is no reason, but the player re-locks door. PrintMessage(15,6,self) !We lock the door back. move rusty_lock to mill_latch : self is locked rusty_lock is hidden : rusty_lock is locked } } else { PrintMessage(3,2,5) !You see no good way to do that. } } } object DoKick { if (self is locked) { PrintMessage(5,17,1) !You can't kick it down. self.misc #4 = true !We've tried kicking it down. } else { PrintMessage(2,self,3) !You don't need to kick it. } } object DoHit { if (self is not locked) { PrintMessage(2,self,3) !You don't need to hit it. } elseif (xobject = sword) { Perform(&DoCut, self, sword) !Re-route as cutting. } elseif (xobject = pipe) { PrintMessage(5,17,3) !We hit it with the pipe. self.misc #2 = true !We've hit it with the pipe now. } elseif (xobject = nothing) { PrintMessage(5,17,2) !You can't break it down. self.misc #3 = true !We've tried knocking down. } else { !Hitting it with anything else is pretty useless. PrintMessage(3,2,3) !Nothing happens. } } object DoCut, DoStab { ! Here, it doesn't matter if the door is unlocked or not. ! We can always notch it up more, just for the heck of it. if (MakeReadySword) { PrintMessage(5,17,4) !Trying to hit it with sword. self.misc #1 = true !We've hit it with the sword now. } } xobject DoPutIn { if (object = rusty_lock) { !We already have a handler for re-locking the door. Perform(&DoLock, self, object) !Re-route to locking door. } else { return false !Nothing else will go on the door. } } xobject DoGetFrom { if (object in mill_latch) and (location = mill) { !We're probably trying to get lock from door. Perform(&DoGetFrom,object,mill_latch) !Redirect } else { return false !You don't see it there, or whatever. } } } } !---------------------------------------------------------------------------- component mill_latch "door latch" { inherits game_scenery !Provides handling for the description. nouns "latch" adjectives "door", "door's", "mill" article "the" is not broken, not fixable !When it's broken, it can't be fixed. is openable, lockable !But it gets re-routed to the door. is platform !So we can "put lock on latch" if we want. capacity 1 !Basically, for the above reason. part_of { if (location = mill): return mill_door else: return nothing } before { object DoOpen, DoClose, DoLock, DoUnlock, DoPry { !These verbs are all handled by the door itself. PrintMessage(6,1,mill_door) !Assuming you mean... Perform(verbroutine, mill_door, xobject) !Re-route. } object DoHit { if (xobject is sharp) { ! Since we're trapping before verbroutine, must check to ! see if the player is using the sword instead. Perform(&DoCut, self, xobject) !Redirection } elseif (xobject = pipe) { if (rusty_lock in self) { !Success - we break the latch and the lock falls off. PrintMessage(5,17,5) !The lock falls off. self is broken : move rusty_lock to location mill_door is not locked !But rusty_lock still is. rusty_lock is not hidden !Now we'll see it appear. AddScore(44) !Getting the mill's door unlocked. } else { !We break the latch (or it's already broken). PrintMessage(5,17,6) !Break (or re-break) the latch. self is broken } } else { !It won't really help to hit it with anything else. ! But for certain verb words, it might make sense to ! prompt the player to be more specific. if (xobject = nothing) { if (self is broken) { PrintMessage(5,17,6) !It's already broken. } elseif (VerbWord = "break", "damage") { !This'll set the "with xobject" handler too. PrintMessage(3,22,self) !How do you intend to...? } else { PrintMessage(3,2,3) !Nothing happens. } } else { PrintMessage(3,2,3) !Nothing happens. } } } object DoCut, DoStab { if (MakeReadySword) { !The sword clangs against the latch, but nothing happens. PrintMessage(5,17,7) !Attempt to cut the latch. No good. } } xobject DoPutIn { !This'll handle the unlikely attempt to "put lock on door". Perform(&DoPutIn, object, mill_door) !Re-route to the door. } } } !---------------------------------------------------------------------------- scenery sail_arms "sail arms" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. !MISC #1 = true whenever the sail arms have stopped moving. misc false ! Note that they're not referred to as "wings" due to a weird quirk ! in the plural class. Even if I say "barge's wings" it triggers ! on this sail_arms. In the interest of getting done, I have ! stopped trying to figure out why. Just don't use "wings". ! Nouns #6 become "wing" when we're on the steps. nouns "sails", "blades", "arms", "sail", "arm", "" !First adjective becomes "three" when one is cut down. adjectives "four", "sail", "spinning", "turning", "wind-powered" article "the" is plural, distant !Becomes "not distant" when we're on the steps. found_at mill, deck, steps parse_rank { if (location = steps) { return 2 !Elevated parse rank. } else { return 0 !Default parse rank. } } before { object DoHit, DoAttack, DoKick, DoPunch { if (self is distant) { return false } elseif (xobject = sword) { Perform(&DoCut,self,sword) !Redirect to cutting. } elseif (xobject = nothing) and \ (verbroutine = &DoHit, &DoAttack) { PrintMessage(6,12,sword) !"(with your sword)" Perform(&DoCut,self,sword) !Redirect to cutting. } elseif (not sail_arms.misc #1) { !It would be too dangerous to do that with the blades. PrintMessage(2,self,5) !Let the player know that. } else { PrintMessage(3,2,3) !Nothing happens. } } object DoCut, DoStab { if (self is distant) { return false } elseif (MakeReadySword) { if (sail_arm is moved) { PrintMessage(5,18,1) !Notch up a sail arm. } else { !Assuming you mean to cut/stab the cords. PrintMessage(6,1,axle_cords) !Let them know. Perform(verbroutine, axle_cords, sword) } } } object DoGet, DoTouch, DoMove, DoPush, DoPull, DoLift, DoTurn { if (self is distant) { return false } elseif (self.misc #1) { if (verbroutine = &DoGet) { if (sail_arm is moved) { PrintMessage(10,self,2) !You already removed one. } else { PrintMessage(10,self,1) !Need to find a diff. way. } } elseif (verbroutine = &DoPush,&DoPull,&DoMove,&DoTurn) { printMessage(12,self,1) !Jammed. Arms won't turn now. } else { return false !Default handling. } } else { PrintMessage(2,self,5) !You can't while spinning. } } ! We have "DoTakeOff" to support "remove object" object DoGetFrom, DoUnstrap, DoUntie, DoTakeOff { if (self is distant) { return false !It's too far away, or whatever. } elseif (xobject = nothing, main_axle, axle_notches, \ axle_cords, windmill) { word[1] = "untie" PrintMessage(6,1,axle_cords) Perform(&DoUntie, axle_cords) } elseif (verbroutine = &DoUntie, &DoUnstrap) { !The sail arms aren't tied to the xobject. PrintMessage(2,self,4) !Message: They're not attached. } else { return false !You don't see it there, or whatever. } } } } !---------------------------------------------------------------------------- ! Allowing some misspellings, just in case the player is in a hurry. ! plural_class furnishings "furnishings" { inherits game_scenery !Provides handling for the description. nouns "furnishings", "furnashings", "furniture", "furnature", \ "furnishing", "furnashing" adjectives "piece", "sparse" article "the" single_noun "piece of furniture" plural_of simple_bed, chest_of_drawers, fleece_rug !found_in quarters !There is no "found_in". Plural_class handles that. plural_verbs { !Really, only "look" applies to all the objects. ! if verbroutine = &DoLook, &DoGet, &DoDrop, &DoPutin if (verbroutine = &DoLook): return true else: return false } } !---------------------------------------------------------------------------- ! Originally, I had the mattress as a component object. But, for any times ! when the player needs to refer to just the mattress (perhaps when looking ! at it), I'll just do an IsWord("mattress") check. No need for component. ! Same with the "frame" -- it's just part of the bed. scenery simple_bed "simple bed" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have moved the bed at least once. misc false nouns "bed", "mattress", "frame" adjectives "simple", "bed", "bed's", "wooden", "thin", "dingy" article "the" plural_is furnishings is sleepable !I.e., there is a custom response for "sleep on bed". found_in quarters before { ! It's probably less likely that the player would search or look ! under the bed, than it is that they'd look in the chest/drawers. ! But, since I want the pipe to be easy to find, it's here too. ! DoLookBehind auto-routes to DoLookUnder, but by trapping for it ! specifically, I can customize the result message a little bit. object DoSearch, DoLookBehind, DoLookUnder { if (xobject = nothing, pipe) and (pipe is not moved) { PrintMessage(1,pipe,2) !We find the pipe under/behind bed. Acquire(player, pipe) !This'll also set the "moved" flag. } else { !Fix a bug in when we re-route "move" to "look under" if (verbroutine = &DoLookUnder): word[2] = "under" return false !Default -- you don't find it there. } } object DoPush, DoPull, DoMove, DoLift { if IsWord("mattress") { !Moving the mattress isn't the same as moving the bed. Perform(&DoLookUnder, self) !"mattress" is still IsWord. } else { if (pipe is moved) or (self.misc #1) { PrintMessage(12,self,2) !We don't find it. } else { PrintMessage(12,self,1) !We do find it. Acquire(player, pipe) !This'll also set the "moved" flag. } self.misc #1 = true !Flag that we've moved the bed. } } object DoEnter, DoGo, DoApproach { Perform(&DoSleep, self) !Assume we want to sleep on the bed. } } } !---------------------------------------------------------------------------- scenery chest_of_drawers "chest of drawers" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have moved the dresser at least once. misc false nouns "chest", "drawers", "drawer", "dresser" adjectives "aged", "aging", "old", "chest", \ "dresser", "wooden", "captain's" article "the" is container, openable, not open plural_is furnishings found_in quarters before { object DoSearch, DoLookIn, DoOpen { if (xobject = nothing, pipe) and (pipe is not moved) { PrintMessage(1,pipe,4) !We find the pipe in a drawer. Acquire(player, pipe) !This'll also set the "moved" flag. } else { ! Not going to return false, because the default for "open" ! isn't what I want. We're treating this as a search, only. if (xobject = nothing) or (verbroutine ~= &DoSearch) { PrintMessage(2,self,2) !You find that it's empty. } else { return false !So it can say "don't find it there." } } } object DoLookBehind, DoLookUnder { if (xobject = nothing, pipe) and (pipe is not moved) { PrintMessage(1,pipe,3) !We find the pipe under/behind it. Acquire(player, pipe) !This'll also set the "moved" flag. } else { return false !Default -- you don't find it there. } } object DoPush, DoPull, DoMove, DoLift { if (pipe is moved) or (self.misc #1) { PrintMessage(12,self,2) !We don't find it. } else { PrintMessage(12,self,1) !We do find it. Acquire(player, pipe) !This'll also set the "moved" flag. } self.misc #1 = true !Flag that we've moved the dresser. } xobject DoPutIn { if (object is always_held) { return false !You can't leave that behind. } else { PrintMessage(3,2,21) !You haven't the need. } } } } !---------------------------------------------------------------------------- ! The rug currently isn't important. Probably need to trap actions, later. ! scenery fleece_rug "threadbare rug" { inherits game_scenery !Provides handling for the description. nouns "rug", "fleece" adjectives "threadbare", "rug", "green", "beaten", "worn" article "the" plural_is furnishings found_in quarters before { object DoGet, DoMove, DoPull, DoLookUnder { PrintMessage(12,self,1) !It can't be moved. } } } !---------------------------------------------------------------------------- ! 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_markings2 "tapestry's markings" { inherits game_scenery !Provides handling for the description. nouns "glyph", "glyphs", "circle", "circles", "swirl", "marks", \ "illustration", "illustrations", "loop", "loops", "symbol", \ "symbols", "writing", "ocean", "boat", "glow", "swirls", \ "waves", "man", "outline", "tyrant", "mark", "enchantment", \ "drawings", "lines", "line", "wing", "markings", "wings" adjectives "crude", "angular", "ethereal", "tyrant's", "red", \ "wavey", "outline", "enchanted", "other", \ "sideways", "upright", "wavy", \ "tapestry", "tapestries", "tapestry's", "tapestrys" article "the" is unholdable, readable, plural parse_rank -1 !Make sure it's below the real tapestry. part_of { if (location = quarters): 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 big_barge "barge" { inherits game_scenery !Provides handling for the description. nouns "barge", "boat", "hull", "structure", "vessel", "ship" adjectives "flying", "barge", "barge's", "massive", "wooden" article "the" found_at mill, steps !But it's "distant" when on steps. before { object DoEnter, DoClimb, DoGo, DoApproach { if (location = mill) { Perform(&DoClimb, deck_ladder) !We basically go up ladder. } else { return false !It's too far away to enter. } } } } !---------------------------------------------------------------------------- component mill_steps "stone steps" { inherits game_scenery !Provides handling for the description. nouns "steps", "step", "stones", "bricks" adjectives "mill", "mill's", "windmill's", "eroded", "crumbling", \ "lower", "upper", "stone", "brick" article "the" part_of { if (location = deck) { return nothing !Viewed from the deck, it doesn't exist. } else { return windmill !But close up, the steps are here. } } is broken, fixable !We can "fix steps with wing", not just drag wing. is plural, platform !So we can "put wing on steps" as a phrasing. capacity 1 !it can't really hold anything, though. door_to { if (starboard_wing.misc #1) { SheatheSword !Before we climb. if (location = steps) { return mill } else { return steps } } else { return nothing } } before { object DoRepair { ! We only need to check for the successful condition. The ! verbroutine can handle everything else -- the steps being ! fixed already, trying to fix with nothing, and trying to ! fix with something that won't work. Yep. It'll work fine. if (self is broken) and (xobject = starboard_wing) { !The player has the right idea, with alternate verb. Perform(&DoPull, xobject, self) !Move wing to steps. } else { ! Everything else can be handled by the verbroutine. return false !The steps are already fixed, or whatever. } } object DoClimb { if (location = mill) { mill.misc #1 = self !Necessary for "up" to work. Perform(&DoGo, u_obj) !Climb up the steps. } else { Perform(&DoGo, d_obj) !We can climb back down. } } } } !---------------------------------------------------------------------------- scenery mill_hole "hole" { inherits game_scenery !Provides handling for the description. nouns "hole" article "the" found_on steps is unholdable } !---------------------------------------------------------------------------- scenery main_axle "main axle" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. nouns "axle" adjectives "main", "outward" article "the" found_at steps, in_mill before { object DoHit, DoAttack, DoKick, DoPunch, DoCut, DoStab { if (location = in_mill) { return false !It's too far away, or whatever. } else { PrintMessage(6,1,axle_cords) !Assuming you mean... Perform(verbroutine, axle_cords, xobject) } } object DoTurn, DoMove, DoPush, DoPull { if (location = in_mill) { return false !It's too far away, or whatever. } else { PrintMessage(6,1,sail_arms) !Assuming you mean... Perform(verbroutine, sail_arms, xobject) } } } } !---------------------------------------------------------------------------- component axle_cords "cords" { inherits game_scenery !Provides handling for the description. !MISC #1 = we have tried untying the cords at least once. misc false nouns "cord", "cords", "string", "strings", "rope", "ropes", \ "fibers", "fibres", "fiber", "fibre", "wrappings", \ "wire", "wires" adjectives "axle", "axle's", "thick", "strong", "cords", \ "woven", "wrappings" article "the" is plural part_of { if (location = steps): return main_axle else: return nothing } before { object DoGet { word[1] = "untie" PrintMessage(6,1,self) !Assuming you mean to untie the cords. Perform(&DoUntie,self) } ! We have "DoTakeOff" to support "remove object" object DoGetFrom, DoCutOff, DoUnstrap, DoUntie, DoTakeOff { if (xobject = nothing, main_axle, axle_notches, sail_arms) { if (not sail_arms.misc #1) { !Can't, while the axle is still turning. PrintMessage(2,self,3) !Can't, while it's moving. } elseif (sail_arm is moved) { PrintMessage(10,sail_arms,2) !We aleady cut one off. } else { PrintMessage(10,self,1) !They're too thick to untie. self.misc #1 = true !We've tried to untie, once. } } elseif (verbroutine = &DoUntie, &DoUnstrap) { !The cords aren't tied to the xobject. PrintMessage(2,self,2) !Message: Not attached to that. } else { return false !You don't see it there, or whatever. } } object DoHit, DoAttack, DoKick, DoPunch { if (xobject = sword) { Perform(&DoCut,self,sword) !Redirect to cutting. } elseif (xobject = nothing) and \ (verbroutine = &DoHit, &DoAttack) { PrintMessage(6,12,sword) !"(with your sword)" Perform(&DoCut,self,sword) !Redirect to cutting. } elseif (not sail_arms.misc #1) { !It would be too dangerous to do that with the blades. PrintMessage(2,self,4) !Let the player know that. } else { PrintMessage(3,2,3) !Nothing happens. } } object DoCut, DoStab { if (MakeReadySword) { if (sail_arm is moved) { !We've already removed one arm. Can't do another one. PrintMessage(10,sail_arms,2) !No need to cut another. } else { PrintMessage(5,18,2) !It works! Yay! move sail_arm to mast !It's now atop the main mast. sail_arm is moved !Because this flag gets checked. sail_arms.adjectives #1 = "three" !Only three remain. cargo.reach #2 = sail_arm !We can reach it from cargo. RemoveProp(sail_arms,nouns,"sail") !Remove singular RemoveProp(sail_arms,nouns,"arm") !Remove singular AddScore(49) !For cutting off a sail arm. } } } } } !---------------------------------------------------------------------------- component axle_notches "deep notches" { inherits game_scenery !Provides handling for the description. nouns "notch", "notches" adjectives "deep" article "the" is plural, unholdable part_of { if (location = steps): return main_axle else: return nothing } } !---------------------------------------------------------------------------- scenery gears "set of gears" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. nouns "gears", "set", "gear", "system" adjectives "set", "gear" article "the" is plural, distant, container capacity 1 !It can't really hold anything. found_at in_mill before { object DoBreak { ! Note that I'm not trapping for other "hit" verbs, which should ! go ahead and give the default "too far away" message instead. ! We can send the result into "that seems reasonable, but how?" if (xobject) { if Contains(player,xobject) { word[1] = "throw" !For the message to work. if (xobject is plural) { PrintMessage(6,2,"those at the gears") } else { PrintMessage(6,2,"that at the gears") } Perform(&DoThrowAt,xobject,self) !Throw at gears. } else { PrintMessage(3,2,5) !You see no good way to do that. } } else { PrintMessage(12,mill_switchables,2) !Reasonable, but how? } } xobject DoPutIn { word[1] = "throw" !For the message if (object is plural) { PrintMessage(6,2,"that at the gears") } else { PrintMessage(6,2,"it at the gears") } Perform(&DoThrowAt, object, self) !Redirection. } xobject DoThrowAt { if (object is always_held) or (sail_arms.misc #1) { return false !Let the default handler take over. } elseif (object = rusty_lock) { !The rusty lock just falls to the ground. PrintMessage(4,21,object) !It just bangs around. move object to location !It has fallen to the ground. } elseif (object = sack) { ! I thought about allowing the player to put the lock in ! the sack, and then throw it up there to jam the gears. ! That would actually be pretty cool, but this late in ! September, I need to choose my battles, so to speak. It ! would just take too much time to implement that, and all ! the various "checking" that goes along with it. So, no. PrintMessage(4,21,object) !It gets stuck up there. move object to gears !Yep, we've lost it. !But if anything was in it, they all fall down. if Child(sack) { print "" !A blank line, before the listing. while Child(sack) { PrintMessage(4,21,1) !The object falls to ground move Child(sack) to location !It's on the ground. } } } elseif (object = pipe) { !Success... The pipe can jam the gears. PrintMessage(4,21,object) !Describe the pipe sticking. move pipe to gears !It's caught up there in the gears. sail_arms.misc #1 = true !The mill blades are now stopped. AddScore(48) !For stopping the sail arms from moving. stop_mill_switchables !remove all the switchable props. } else { return false !Default message for all others. } } } } !---------------------------------------------------------------------------- scenery basin "stone basin" { inherits game_scenery !Provides handling for the description. nouns "basin", "bin" adjectives "stone", "grain", "large" article "the" found_at in_mill is container capacity 200 !We're able to put the rusty lock in the trough. holding 0 !Will get auto-calculated before { xobject DoThrowAt { if (object = rusty_lock) { !We can put it into the basin by throwing. Perform(&DoPutIn,object,self) !Redirection } else { return false !Default message. } } xobject DoPutIn { if (object is always_held) or (sail_arms.misc #1) { !Either it's a keeper, or basin doesn't turn. return false !Let the default handle it. } elseif (object = bones, apple) { PrintMessage(4,20,object) !It's destroyed. remove object !Yeah, we've lost it now. } elseif (object = sack) { !We have to remove everything from the sack first. !Otherwise it gets weird trying to handle the result. while Child(sack) { print "(removing "; print The(Child(sack)); " from the sack first)" Acquire(player,Child(sack)) !We take it out. } PrintMessage(4,20,object) !It's destroyed. remove object !Yeah, we've lost it now. } elseif (object = pipe) { PrintMessage(4,20,object) !The pipe gets tossed around. move pipe to basin !It will go, but it won't do the job. pipe.misc #1 = true !It's not scratched up by the stone. } elseif (object = rusty_lock) { !Success. We've jammed the thing. PrintMessage(4,20,object) !The lock does the job. move rusty_lock to basin !It's now in the basin. sail_arms.misc #1 = true !Now the blades are stopped. AddScore(48) !For stopping the sail arms from moving. stop_mill_switchables !remove all the switchable props. } else { PrintMessage(4,20,1) !Shouldn't put that there. } } } } !---------------------------------------------------------------------------- scenery basin_dust "dust" { inherits game_scenery !Provides handling for the description. nouns "dirt", "dust" article "the" found_in basin } !---------------------------------------------------------------------------- scenery millstone "millstone" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. nouns "millstone", "grindstone", "stone" adjectives "large", "buhrstone", "burstone", "grind" article "the" found_at in_mill } !---------------------------------------------------------------------------- scenery drive_shaft "drive shaft" { inherits game_scenery !Provides handling for the description. inherits mill_switchables !Handling for trying to "stop" it. nouns "driveshaft", "drive-shaft", "shaft" adjectives "wooden", "central", "drive" article "the" found_at in_mill before { object DoClimb { Perform(&DoGo, u_obj) !Attempt to go upward. } } } !---------------------------------------------------------------------------- ! ROUTINES SPECIFIC TO PART 2 !---------------------------------------------------------------------------- routine count_spiders { local ct = 0 if (red_spider.found_in = deck): ct++ if (gray_spider.found_in = deck): ct++ if (black_spider.found_in = deck): ct++ return ct !Total number of spiders here. } !---------------------------------------------------------------------------- ! Determine if the gray spider has been stunned. It doesn't attack then. ! routine spider_stunned { if (spider_legs.misc #1) and \ (spider_eyes.misc #1) and \ (mandibles.misc #1) { return true } else { return false } } !---------------------------------------------------------------------------- ! Determine which direction is "fore" and "aft" based on orientation. ! routine barge_fore_dir { if (deck.misc #1 = 3) { return w_obj !At this state, the barge is facing west, cabin east. } else { return (game_fore_dir) !Forward is game's general "ahead" dir. } } !---------------------------------------------------------------------------- ! Determine which direction is "fore" and "aft" based on orientation. ! routine barge_aft_dir { if (deck.misc #1 = 3) { return e_obj !At this state, the barge is facing west, cabin east. } else { return (game_back_dir) !Aft is general "back" dir. } } !---------------------------------------------------------------------------- ! Determine which direction is "starboard" and "port" based on orientation ! routine barge_starboard_dir { if (deck.misc #1 = 3) { return n_obj !Starboard is north. } else { select (game_fore_dir) !This is our forward dir case n_obj: return e_obj case ne_obj: return se_obj case e_obj: return s_obj case se_obj: return sw_obj case s_obj: return w_obj case sw_obj: return nw_obj case w_obj: return n_obj else: return ne_obj } } !---------------------------------------------------------------------------- ! Determine which direction is "starboard" and "port" based on orientation ! routine barge_port_dir { if (deck.misc #1 = 3) { return s_obj !Port is south. } else { select (game_fore_dir) !This is our forward dir case n_obj: return w_obj case ne_obj: return nw_obj case e_obj: return n_obj case se_obj: return ne_obj case s_obj: return e_obj case sw_obj: return se_obj case w_obj: return s_obj else: return sw_obj } } !---------------------------------------------------------------------------- ! Because the barge isn't always facing the right direction, we need to ! route directional movement through the proper channels. ! routine deck_movement(dir) { select dir case u_obj: return side_steps.door_to case barge_aft_dir, in_obj: return cabin_door.door_to case barge_starboard_dir, d_obj: return deck_ladder.door_to case else: return false !We can't go that direction. } !---------------------------------------------------------------------------- ! Because the barge isn't always facing the right direction, we need to ! route directional movement through the proper channels. ! routine cabin_movement(dir) { select dir case u_obj, in_obj: return cabin_ladder.door_to case barge_fore_dir, out_obj: return cabin_door.door_to case else: return false !We can't go that direction. } !---------------------------------------------------------------------------- ! Because the barge isn't always facing the right direction, we need to ! route directional movement through the proper channels. ! routine quarters_movement(dir) { select dir case barge_fore_dir, out_obj: return quarters_door.door_to case d_obj: return cabin_ladder.door_to case else: return false !We can't go that direction. } !---------------------------------------------------------------------------- routine stop_mill_switchables { drive_shaft is not switchable drive_shaft is not switchedon main_axle is not switchable main_axle is not switchedon millstone is not switchable millstone is not switchedon sail_arms is not switchable sail_arms is not switchedon windmill is not switchable windmill is not switchedon gears is not switchable gears is not switchedon } !---------------------------------------------------------------------------- routine Chapter_End_Part2 { if Contains(player,sack): player.misc #1 = true if Contains(player,pipe): player.misc #2 = true AddScore(52) !For dumping cargo and ending chapter. PrintStatusLine !So the score gets updated. ! First, print a message that we turn wheel or move lever. PrintMessage(12,object,4) !This is the introductory bit. PrintMessage(7,10,1) !And then begin the cutscene. new_pause PrintMessage(7,10,2) !Cutscene part 2 new_pause PrintMessage(7,10,3) !Cutscene part 3 new_pause PrintMessage(7,10,4) !Cutscene part 4 new_pause PrintMessage(7,10,5) !Cutscene part 5 new_pause StartChapter(3) !Move us to Chapter 3 }