!**************************************************************************** !****(OBJECT CLASSES)******************************************************** !**************************************************************************** class game_character { !Make sure NPC doesn't get "taken" exclude_from_all { return true } long_desc { if (self.type = component) { PrintMessage(8,self.part_of,self) !Char Component Descriptions. } else { PrintMessage(8,self,1) !Character Descriptions. } } order_response { ! If we try to say something "directly to" the NPC using the ! "order" method (i.e., "woman, go south" then do this. Some ! day I should write a game where that works. It'd be fun! if (verbroutine = &DoHello) { perform(&DoHello, self) !Attempt to nod "hello" to the NPC. } else { perform(&DoAsk, self, object) !The NPC won't comprehend us. } } before { object DoHello { PrintMessage(3,3,3) !Greeting an NPC, identified as Object. } object DoTalk { !Trying to start a conversation, but not saying !anything in particular (otherwise it's DoTell). PrintMessage(3,3,4) !Random messages, meaning you can't. } object DoTell { PrintMessage(3,3,11) !The NPC can't comprehend you. } object DoAsk { !Be careful changing what's printed here, because it's also !the order_response default text (i.e., "woman, go south"). PrintMessage(3,3,11) !Object can't comprehend you. } object DoGet { !I don't like the default "wouldn't be too big on that idea." rnd = random(5) select rnd case 1: PrintMessage(3,2,6) !Better Not. case 2: PrintMessage(3,2,1) !You can't do that. case 3: PrintMessage(3,2,13) !Nothing gained by trying that. case 4: PrintMessage(3,2,22) !You're not a barbarian. case 5: PrintMessage(3,2,23) !That's not your way. } object DoSearch { !I'm also not really fond of the "doesn't let you search" msg. !Well, I guess it would be okay in certain situations. if (self is distant) { PrintMessage(3,1,self) !NPC is too far away. } else { PrintMessage(3,4,3) !New default for trying to search an NPC. } } } } !---------------------------------------------------------------------------- ! Things done to a component of an obj should redirect to the obj itself, ! in most cases. That's what the purpose of this class is. ! class obj_component { before { object { if (verbroutine = &DoLook) { return false !Default handling. } else { !Everything done to component goes to the obj. perform(verbroutine, self.part_of, xobject) !Redirect } } xobject { !Everything done to component goes to the obj. perform(verbroutine, object, self.part_of) !Redirect } } } !---------------------------------------------------------------------------- ! The only reason I need this is because I have a distant_captain in Part 2 ! that should share the same descriptive words. ! class barge_captain { inherits character !Assigns pronoun, living status, etc. nouns "man", "guy", "captain" adjectives "pale", "barge's", "thin", "tall" article "the" !In order to keep the lib from seeing *this* class instead of the !actual captain object, when the captain isn't around, give it a !lower parse_rank. parse_rank -2 } !**************************************************************************** !****(PLAYER_CHARACTER OBJECT)*********************************************** !**************************************************************************** !---------------------------------------------------------------------------- player_character swordsman "you" { !MISC #1 = true, if the player had burlap sack when starting Part 3. !MISC #2 = true, if the player had the pipe when starting Part 3. !MISC #3 = number of times player has tried "talking" to an NPC. !This is incremented in the PrintMessage at the section !where the result would otherwise be really generic. !MISC #4 = true, if the player has already looked at the WT once. misc false, false, 0, false nouns "me", "myself", "self" capacity 500 !To be sure player can always carry all things. long_desc { PrintMessage(8,self,1) } before { actor DoThrowAt { ! First, work around the oddities in the identical_class ! handling, by seeing if there is a single object that ! should be the target of the action, instead. if (object.type = identical_class) and (xobject ~= nothing) { if GetSingleFromPlural(object,xobject): return true } ! A very specific condition, when the swordsman is going to ! throw something at the plate... but didn't specify xobject. ! We can reasonably assume that this is what they intended, ! if they have pushed the plate at least one time already. if (object is not always_held) and \ (location = west_tunnel) and \ (xobject = nothing) and \ (plate.misc #1) { print "(at "; The(plate); ")" Perform(&DoThrowAt,object,plate) !Redirect the intention. } else { return false !Allow whatever the default is. } } actor DoGetFrom, DoPutIn { if (object.type = identical_class) and (xobject ~= nothing) { if GetSingleFromPlural(object,xobject) { return true !Don't need to process for plural itself. } else { return false !Not detected, so allow default. } } else { return false! Let the default action continue as normal. } } actor DoSleep { if (object = nothing) { select location case quarters { !Let the player know that we assume the bed. print "(on "; The(simple_bed); ")" !Implied Perform(&DoSleep, simple_bed) !Re-route. } case campsite { !Let the player know that we assume it. print "(in "; The(clearing); ")" !Implied Perform(&DoSleep, clearing) !Re-route. } case else: return false !Default for anything else. } else { return false !Allow default handler for it. } } object DoCut, DoStab { PrintMessage(5,1) !You can't cut or stab yourself. } actor DoGet { ! This can handle "down" from the cargo crates. if (object = d_obj) and (player in cargo) { Perform(&DoExit, cargo) !We get down from it. } else { return false !Default handling. } } actor DoGo { ! This can handle "down" from the cargo crates. if (object = d_obj) and (player in cargo) { Perform(&DoExit, cargo) !We get down from it. } else { return false !Default handling. } } actor DoStand { ! This is to handle "get off" or "step down" if (object = nothing,d_obj) and (player in cargo) and \ (IsWord("off") or IsWord("down")) { Perform(&DoExit, cargo) !We get down from it. } else { return false !Default handling. } } actor DoJump { if (location = hall) and (object = nothing) and IsWord("off") { Perform(&DoJump, ledge) !Redirect it to the ledge. } elseif (location = barn) and (object = nothing) and \ (not loft_ladder.misc #1) { Perform(&DoJump, loft_ladder) !Redirect it to the ladder. } else { return false !Default handling. } } ! We can trap at this level any attempts by the player to ! talk to any of the characters in the game. We don't need ! to trap for DoTell, because I've implemented it simply as ! a front-end to perform DoSay. So we'll capture both then. ! Also, DoTalk is only called now when the player is trying ! to talk to nobody, or talk "to" somebody without saying ! anything (to start a conversation). Otherwise, I have ! implemented "talking" about anything as a DoSay handler. ! ! Why did I make all these changes, when the player never ! actually talks at all? Well, this way I can react in ! different ways based strictly on the verb routine. ! ! DoHello - player is attempting to greet somebody. ! DoTalk - player is trying to start a conversation. ! DoTell - player is saying something to somebody. ! DoAsk - player is trying to ask a question to an NPC. ! ! Also: (it'll try re-routing itself to proper NPC). ! DoAskQuestion - player is asking, but no NPC is specified. ! ! Note that talking in the form of "NPC, do something" is handled ! in the NPC "order_response" and re-routed to verbs accordingly. ! actor DoHello { if (object = nothing): object = CheckForNPC() if (object = nothing,player) { PrintMessage(3,3,2) !Nod a greeting to nobody in particular. } else { return false !Let the NPC routines handle it. } } actor DoTalk { if (object = nothing): object = CheckForNPC() if (object = self) { PrintMessage(3,3,1) !You conduct a brief inner monologue. } elseif (object = nothing) { PrintMessage(3,3,1) !You conduct a brief inner monologue. } else { return false !Let the NPC routines handle it. } } actor DoTell { if (object = nothing): object = CheckForNPC() if (object = nothing, self) { PrintMessage(3,3,1) !You conduct a brief inner monologue. } else { return false !Let the NPC routines handle it. } } actor DoAsk { if ((object = nothing) and (xobject = nothing)) { !Used the "ask" verb alone, without any objects. PrintMessage(3,3,1) !You conduct a brief inner monologue. } elseif (object = self) { PrintMessage(3,3,1) !You conduct a brief inner monologue. } else { return false !Let the NPC routines handle it. } } actor DoAskQuestion { if (xobject = nothing): xobject = CheckForNPC() if (xobject ~= nothing) { Perform(&DoAsk,xobject,object) } elseif (speaking ~= nothing) { Perform(&DoAsk,speaking,object) } else { PrintMessage(3,3,1) !You conduct a brief inner monologue. } } actor SpeakTo { !Does this ever get called in any cases? Nope. "Trapped SpeakTo" } } } !---------------------------------------------------------------------------- player_character maiden "you" { nouns "me", "myself", "self" capacity 500 !To be sure player can always carry all things. long_desc { PrintMessage(8,self,1) } before { actor DoListen { PrintMessage(8,self,2) !Describe what she can hear. } } } !**************************************************************************** !****(NPC OBJECT)************************************************************ !**************************************************************************** !---------------------------------------------------------------------------- female_character widow "elderly woman" { inherits game_character !Gives us our long_desc handling. nouns "woman", "widow", "lady" adjectives "elderly", "old" article "an" in house !Otherwise "get all" may try to get her. exclude_from_all { return true } short_desc { PrintMessage(8,self,2) !Short description when listing in room. if (girl in location) and (bees.found_in = location) { !The woman leaves if the girl is here with bees. PrintMessage(8,self,5) !The old woman gets up and leaves. remove self !She's now gone... into the house, whatever. girl_moving.misc #3 = true !Allow girl to stay for one turn. } elseif (pendant.misc #1) { !She's already pointed at least once. PrintMessage(8,self,4) !She continues to point to the south. } else { !This is the first time she has pointed. if Contains(player,pendant) { PrintMessage(8,self,3) !She notices the "sheath" and points. pendant.misc #1 = true !Flag that she noticed it and points. } else { print newline !Just end line. We need to get pendant first. } } } before { xobject DoShow { if (object = s_obj,distant_orchard) and (girl in orchard) { PrintMessage(17,self,orchard) !Girl is in the orchard. } elseif (object = n_obj,north_gate,north_fence) and (girl in hill) { PrintMessage(17,self,hill) !Girl is on the hill. } elseif (object = e_obj,big_barn,barn_doors) and (girl in barn) { PrintMessage(17,self,barn) !Girl is in the barn. } elseif (object = pendant,pendant_chain) { PrintMessage(17,self,pendant) !Yes, she's interested in that. pendant.misc #2 = true !And flag that we showed it to her. } elseif ((object = self) or (object.part_of = self)) and \ (VerbWord ~= "show") { !Ie, she can't tell the diff. !...from player pointing at her, versus a component of her. PrintMessage(17,self,widow) !Point at the widow. } elseif (object = sword,sheath,apple,sack,harness,rope,\ wheel,gate_key,parchment) { PrintMessage(17,self,object) !Handles based on the object. } else { PrintMessage(17,self,0) !Shakes her head. } } xobject DoGive { if (object = pendant) { PrintMessage(17,1,2) !Trying to give pendant to the woman. pendant.misc #3 = true !And flag that we tried giving it. } else { PrintMessage(17,1,1) !Just shakes her head at the offer. } } } } !---------------------------------------------------------------------------- ! We have to include this due to the old woman's description. Just in case. component widow_eyes "old woman's eyes" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "eyes", "eye" adjectives "spurious", "gray", "glassy", "widow's", "widows", "her", \ "womans", "woman's", "old", "elderly", "grey" article "the" part_of widow is unholdable, plural } !---------------------------------------------------------------------------- ! We have to include this due to the old woman's description. Just in case. component widow_hair "old woman's hair" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "hair" adjectives "long", "gray", "widow's", "widows", "her", "elderly", \ "womans", "woman's", "old", "thinning", "thin", \ "thinned", "grey" article "the" part_of widow is unholdable before { object { if (verbroutine = &DoLook) { return false !Default handling. } elseif (verbroutine = &DoPull, &DoGet) { PrintMessage(10,self,1) !Pulling her hair? } else { !Everything done to her hair goes to the widow. perform(verbroutine, widow, xobject) !Redirect } } } } !---------------------------------------------------------------------------- ! We have to include this due to the old woman's description. Just in case. component widow_skin "old woman's skin" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "skin" adjectives "pale", "wrinkled", "wrinkley", "wrinkly", "elderly", \ "widow's", "widows", "her", "womans", "woman's", "old" article "the" part_of widow is unholdable } !---------------------------------------------------------------------------- female_character girl "girl" { inherits game_character !Gives us our long_desc handling. ! MISC #1 = has the girl noticed the swordsman yet? ! MISC #2 = how many times player has tried aggression, when trapped. ! MISC #3 = how many times player has given something she doesn't want. ! MISC #4 = the location the girl was in last, before she left room. ! MISC #5 = counter of how many times we've been eligible to see clue. misc false, 0, 0, orchard, 0 nouns "girl", "daughter" adjectives "widow's", "young", "little" article "a" in orchard !Otherwise "get all" may try to get her. exclude_from_all { return true } short_desc { if (self.misc #1) { PrintMessage(8,self,4) !When she's here and already seen us. } else { PrintMessage(8,self,2) !She's here, but not yet seen us. } } before { object DoTrap { if (self.misc #1) { !Girl is on the move. PrintMessage(8,self,9) !Explanation when trying to trap her. } else { !She's not yet on the move, so give appropriate message. PrintMessage(3,2,5) !You see no good way to do that. } } object DoChase { if (self.misc #1) { rnd = get_follow_girl(parent(girl), false) if (rnd ~= nothing) { !Show the player what we're doing. PrintMessage(15,3,rnd) !Following her to.... perform(&DoGo, rnd) !rnd will now equal dir_object. return true !Because we don't want default message. } } return false !Allow default message to apply. } object DoHello, DoTalk, DoTell, DoAsk, DoAskQuestion { if (self.misc #1) { return false !Girl already noticed us. } else { !The girl hasn't noticed the player yet. PrintMessage(15,1,1) !She doesn't see you. } } object DoSearch { if not (girl_forced_movement) { PrintMessage(3,4,self) !Can't search or touch her. } } object DoTouch { if not (girl_forced_movement) { PrintMessage(3,4,self) !Can't search or touch her. } } object DoApproach { if not (girl_forced_movement) { return false !We can "approach" the girl. } } object DoGet { if not (girl_forced_movement) { self.misc #2 ++ !Increment aggression counter. PrintMessage(8,self,7) !Aggressive act. } } object DoCut, DoStab { if not (girl_forced_movement) { MakeReadySword !Draw the sword self.misc #2 ++ !Increment aggression counter. PrintMessage(8,self,7) !Aggressive act. } } object DoShake, DoHit, DoKick, DoMove, DoPush, DoPull { if (xobject is sharp) { !Redirect hitting to cutting. Perform(&DoCut, self, xobject) } else { if not (girl_forced_movement) { self.misc #2 ++ !Increment aggression counter. PrintMessage(8,self,7) !Aggressive act. } } } object DoLookBehind { if (girl.misc #1) { return false !Default message if she already saw us. } else { PrintMessage(8,self,5) !You see the apple tree. } } xobject DoGive { if not (girl_forced_movement) { if (object = pendant) { !We've completed the mission. Here comes a cutscene. Chapter_End_Part1 !End part1 and start part2. } else { self.misc #3 ++ !Increment "show something" counter. PrintMessage(8,self,8) !Girl backs away. Doesn't want it. } } } xobject DoShow { if (girl.misc #1) { PrintMessage(8,self,8) !Showing something to the girl. } else { PrintMessage(15,1,1) !She takes no notice and keeps tapping. } } xobject DoThrowAt { !If not too heavy, she can dodge (else we can't throw). !But this will be treated as interaction. If not misc #1, then !we need slight change to the initial "leaving" text. Otherwise !if she's not trapped, she'll run out. Otherwise, she dodges. if (object.size <= 50) and (object is not always_held) { move object to location if not (girl_forced_movement) { if (object = pendant) { !We've completed the mission. Here comes a cutscene. Chapter_End_Part1 !End part1 and start part2. } else { self.misc #2 ++ !Increment aggression counter. PrintMessage(8,self,7) !Aggressive act. She dodges. } } } else { return false !Too big, or it's always held. } } } } !---------------------------------------------------------------------------- component girl_hair "girl's hair" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "hair", "bangs" adjectives "long", "limp", "black", "dark", "girl's" article "the" part_of girl is unholdable } !---------------------------------------------------------------------------- component girl_face "girl's face" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "features", "face", "eyes" adjectives "girl's", "featureless", "artificial", "dark" article "the" part_of girl is unholdable } !---------------------------------------------------------------------------- component girl_dress "girl's dress" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "clothes", "dress", "gown" adjectives "girl's", "yellow", "long" article "the" part_of girl is unholdable } !---------------------------------------------------------------------------- character captain "captain" { inherits game_character !Gives us our long_desc handling. inherits barge_captain !Gives us nouns, adjectives, etc. !MISC #1 = true, when we've "examined" him once while fighting spiders. !MISC #2 = true, when we've seen the captain tell us to lower rails. !MISC #3 = true, when we've seen the captain looking at the wing. !MISC #4 = true, when the captain has pointed at the windmill. !MISC #5 = true, when the captain has read the maiden's parchment. !MISC #6 = true, when we have revealed the captain to be a ghost. !MISC #7 = true, when we have seen the captain direct us to the helm. misc false, false, false, false, false, false, false !Otherwise "get all" may try to get him. exclude_from_all { return true } parse_rank 0 !Default parse rank is above barge_captain class. !Initially he's not on the deck, to avoid additional room intro text. in nothing !Gets moved to deck after first turn, in "deck.each_turn". short_desc { if (location = deck) { PrintMessage(8,self,2) !Short description when listing on deck. } elseif (location = cabin) { PrintMessage(8,self,3) !Short description when listing in cabin. } } before { ! Anything that's physical contact won't work. Don't include ! aggressive actions, though, until we reveal him as ghost. object DoPush, DoPull, DoShake, DoMove, DoTouch { if not CheckReach(self): return true !Cancels the action PrintMessage(8,self,6) !That just can't work. } object DoHit, DoCut, DoKill, DoAttack { if not CheckReach(self): return true !Cancels the action if (self.misc #6) { PrintMessage(8,self,6) !That just can't work. } else { return false !Default aggressive action handling. } } object DoChase { rnd = nothing !Because it's a blank flag at first. if (location = deck) and (captain in cabin) { rnd = barge_aft_dir } elseif (location = cabin) and (captain in deck) { rnd = barge_fore_dir } if (rnd = nothing) { return false !Allow default message to apply. } else { !Show the player what we're doing. PrintMessage(15,3,rnd) !Following him to.... perform(&DoGo, rnd) !rnd will now equal dir_object. return true !Because we don't want default message. } } xobject DoShow { if (self in deck) and (self.misc #6) { if (parchment in deck) { !The captain is standing here, looking at the parchment. if (object = parchment) { PrintMessage(17,self,3) !He sees it, already. } else { PrintMessage(17,self,2) !He's looking at parchment. } } else { PrintMessage(17,self,1) !He pays no attention. } } elseif (object = spiders, spider_legs, spider_eyes, \ mandibles, red_spider, black_spider, \ gray_spider) { PrintMessage(17,self,spiders) !Pointing at the spiders. } elseif (object = sword) { !Things that we can show him, during or after the battle. PrintMessage(17,self,object) !The object can be passed in. !**** Everything that should be possible while spiders are here !****** should be part of the else conditions above this point. } elseif (deck.misc #1 = 0) { !There's no time... the spiders are attacking. PrintMessage(17,self,4) !No time. Spiders attacking! } elseif ((object = self) or (object.part_of = self)) and \ (VerbWord ~= "show") { !Ie, he can't tell the diff. !...from player pointing at him, versus a component of him. PrintMessage(17,self,captain) !Point at the captain. } elseif (object = parchment) { PrintMessage(17,self,parchment) !Show him the parchment. self.misc #5 = true !Flag that the captain has now seen it. } elseif (object = mast) or (object.part_of = mast) { ! The captain isn't here in state 1, when spiders approach ! and we need to raise the rails. So we just need to check ! for things to happen after that point. if (deck.misc #1 = 2) and (mast.misc #1) { !The rails are up. We need to lower them. !No more params, so use "RND" as a special flag. rnd = 1 : PrintMessage(17,self,mast) !We should lower. } elseif (mast_handles is broken) { rnd = 2 : PrintMessage(17,self,mast) !Broken handles. } elseif (sail_arm in mast) { rnd = 3 : PrintMessage(17,self,mast) !Retrieve the arm. } else { !In other cases, the mast isn't really important. PrintMessage(17,self,0) !He's not interested in that. } } elseif (object = sail_arm) and (sail_arm in mast) { ! The only time he's (a) on the deck and (b) not ignoring ! us, is when the sail arm is hanging from the mast. But, ! I'll check for it, just to be on the safe side. PrintMessage(17,self,sail_arm) !He'll give us a hint. } elseif (object = helm) or (object.part_of = helm) { ! The message itself will determine whether or not we're ! in state 4, at which time we're supposed to use it. PrintMessage(17,self,helm) !Yep, we pointed at the helm. } else { PrintMessage(17,self,0) !He's not interested in that. } } xobject DoGive { if not CheckReach(self): return true !Cancels the action if (object = parchment) { word[1] = "show" !For the printmessage to work. PrintMessage(6,2,"it to him") !assume show it to him. Perform(&DoShow,object,xobject) !Re-route to DoShow. } elseif (self.misc #6) { if (self in deck) { if (parchment in deck) { PrintMessage(17,self,2) !No, looking at parchment. } else { PrintMessage(17,self,1) !Lost in thought. No notice. } } else { !At the end, back in the cabin. Revealed as ghost. PrintMessage(17,1,5) !Nope. Has no way to hold it. } } else { !Otherwise, the normal, general result of trying to give. PrintMessage(17,1,4) !Nope. Doesn't want it or can't take. } } } } !---------------------------------------------------------------------------- component captain_hair "captain's hair" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "hair" adjectives "pale", "white", "gray", "grey", "gray-white", \ "thinning", "captain's", "grey-white" article "the" part_of captain is unholdable } !---------------------------------------------------------------------------- component captain_beard "captain's beard" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "beard" adjectives "pale", "white", "gray", "grey", "full", "captain's" article "the" part_of captain is unholdable } !---------------------------------------------------------------------------- component captain_clothes "captain's clothing" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "clothes", "clothing" adjectives "pale", "white", "near-white", "light", \ "gray", "grey", "faded", "captain's" article "the" part_of captain is unholdable } !---------------------------------------------------------------------------- character tyrant "tyrant" { inherits game_character !Gives us our long_desc handling. !MISC #1 = number of times the tyrant has blasted player with water. !MISC #2 = have we defeated the tyrant in combat yet? misc 0, false nouns "tyrant" adjectives "tiniest", "tinyest", "knee-tall", "short", "tiny", \ "furry", "hairy", "old", "evil" article "the" is unfriendly in nothing !Gets moved to Chamber when the time is right. short_desc { if (location = chamber) { if (self.misc #2) { ! We've already defeated the tyrant, so he just runs. PrintMessage(8,self,8) !Let the player know about it. move tyrant to riverbed !And he repeats the cycle. } else { ! The tyrant is here, and on the attack. PrintMessage(8,self,2) !Short desc when he's in chamber. } } elseif (location = riverbed) { PrintMessage(8,self,5) !Let the player know what happens. move tyrant to village } elseif (location = village) { PrintMessage(8,self,6) !Let the player know what happens. move tyrant to east_tunnel } elseif (location = east_tunnel) { PrintMessage(8,self,7) !Let the player know what happens. move tyrant to chamber } } before { object DoHello, DoTalk, DoTell, DoAsk, DoAskQuestion { !The girl hasn't noticed the player yet. PrintMessage(15,10,1) !Random message. } object DoChase { if (self in location) or (not self.misc #2) { ! Either he's here, or he's not defeated. return false !Can't chase him from here. } else { !Show the player what we're doing. rnd = nothing if (location = chamber): rnd = n_obj if (location = riverbed): rnd = u_obj if (location = wharf): rnd = e_obj if (location = village): rnd = d_obj if (location = east_tunnel): rnd = w_obj if (location = west_tunnel): rnd = w_obj if (rnd = nothing) { return false !Default handling elsewhere. } else { PrintMessage(15,3,rnd) !Following her to.... perform(&DoGo, rnd) !rnd will now equal dir_object. return true !Because we don't want default message. } } } object DoTrap { if (self.misc #2) { ! There should be no way to hit this, because the tyrant ! is never in the same room with us after being defeated. return true !Default message handling. } else { PrintMessage(8,self,10) !Message about trapping. } } object DoDodge { if (tyrant_battle.misc #1 = 1) { ! The player dodged out of the way. PrintMessage(5,20,7) !Message it. } elseif (tyrant_battle.misc #1 = 2) { ! The tyrant was attacking, not charging. PrintMessage(5,20,10) !Message it. } else { ! The tyrant was retreating, not charging. PrintMessage(5,20,11) !Message it. } tyrant_battle.misc #2 = 1 !The player dodged. } object DoBlock { if (MakeReadySword) { if (tyrant_battle.misc #1 = 2) { ! The player blocked the attack PrintMessage(5,20,8) !Message it. } elseif (tyrant_battle.misc #1 = 1) { ! The tyrant was charging, not attacking. PrintMessage(5,20,12) !Message it. } else { ! The tyrant was retreating, not attacking. PrintMessage(5,20,13) !Message it. } tyrant_battle.misc #2 = 2 !The player blocked. } } object DoHit, DoCut, DoStab, DoKill, DoAttack { if (xobject = nothing, sword) { if (MakeReadySword) { if (tyrant_battle.misc #1 = 3) { ! The player successfully attacks. PrintMessage(5,20,9) !Message it. } elseif (tyrant_battle.misc #1 = 1) { ! The tyrant was charging, not retreating. PrintMessage(5,20,14) !Message it. } else { ! The tyrant was attacking, not retreating. PrintMessage(5,20,15) !Message it. } tyrant_battle.misc #2 = 3 !The player attacked. } } else { ! The player needs to use something sharper. PrintMessage(5,20,17) !Use your sword instead. } } object DoSearch { PrintMessage(3,4,self) !Can't search him. } object DoShake, DoKick, DoPunch, DoTouch, DoPull, DoPush, DoLift { ! The tyrant is too fast for this to work. PrintMessage(5,20,16) !The tyrant is too fast. } xobject DoThrowAt { if (object.size <= 50) and (object is not always_held) { PrintMessage(8,self,9) !We throw at tyrant. move object to location !It falls to the ground } else { return false !Default handling. } } xobject DoGive { PrintMessage(17,1,6) !He doesn't want it, whatever it is. } xobject DoShow { if (object = fishnet,sword,parchment) { PrintMessage(17,self,object) !Handle based on object. } else { PrintMessage(17,self,0) !The tyrant doesn't care about it. } } } } !---------------------------------------------------------------------------- component tyrant_eyes "tyrant's eyes" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "eye", "eyes" adjectives "cold", "inhuman", "yellow", "intelligent", "tyrant's" article "the" part_of tyrant is unholdable, plural } !---------------------------------------------------------------------------- component tyrant_ears "tyrant's ears" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "ear", "ears" adjectives "furry", "pointed", "gray", "grey", "tyrant's" article "the" part_of tyrant is unholdable, plural } !---------------------------------------------------------------------------- component tyrant_hands "tyrant's hands" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "hand", "hands", "claw", "claws" adjectives "claw-like", "sharp", "tyrant's" article "the" part_of tyrant is unholdable, plural } !---------------------------------------------------------------------------- component tyrant_fur "tyrant's fur" { inherits game_character !Gives us our long_desc handling. inherits obj_component !Handles redirection for obj/xobj. nouns "fur", "furr", "hair" adjectives "gray", "grey", "tyrant's" article "the" part_of tyrant is unholdable } !---------------------------------------------------------------------------- component tyrant_sword "tyrant's sword" { inherits game_character !Gives us our long_desc handling. ! Not giving it npc_component, since this isn't clothing or body part. nouns "sword" adjectives "short", "tyrant's" article "the" part_of tyrant is unholdable parse_rank { if (verbroutine = &DoGet, &DoGetFrom) { return 1 !Elevate - player probably means this one. } else { return -1 !Assume other actions are to our own sword. } } before { object DoGet { !The player might try to do this, so trap for it. PrintMessage(10,self,1) !We can't take the tyrant's sword. } } }