!********************************************/ !File: hanzo.info */ !Inform-engine game, CIS 487, Fall 2005 */ !Brian Clark */ !********************************************/ Constant Story "HATTORI HANZO'S ESCAPE (A Fictional Telling of Japanese History)"; Constant Headline "^A game by Brian Clark^"; !********************************************/ ! constants */ !********************************************/ Constant PUNCH = 0; Constant KATANA = 1; Constant KUSARIGAMA = 2; Constant MAX_HEALTH = 100; !********************************************/ ! Libraries */ !********************************************/ Include "Parser"; Include "Verblib"; Include "Grammar"; !********************************************/ ! Globals */ !********************************************/ Global PlayerHealth = MAX_HEALTH; Global PlayerWeapon = PUNCH; Global FirstMemory = false; Global SecondMemory = false; Global ThirdMemory = false; Global KatanaUnlock = false; Global HasKatana = false; Global FujitaSeen = false; Global FujitaSeen2 = false; !********************************************/ ! Initialize */ !********************************************/ [Initialise; location = Dungeon; print "The birth of Ninjutsu in Japan created two main counterpart ninja clans: The Iga and the Koga. You are the legendary Iga ninja Hattori Hanzo. As you awaken, you realize that you most certainly have been captured. This is not something that you are accustomed to, as you are amongst the greatest ninjas in existence. You have never before been captured. As you search your memories for clues as to how this could have happened, the last thing you remember is a surprise attack by Oda Nobunaga upon your clan. Shaking your head as if to clear it, you know that there must be more to what happened then what you can remember...^^"; ]; !********************************************/ ! Dungeon */ !********************************************/ Object Dungeon "Dungeon" has light with name "dungeon", with describe [; print "This room is faintly lit by the light of a single torch, and it smells extremely dank and musty. The air here is a little cold as well, meaning that you're probably somewhere underground. The room's only exit is a sturdy looking iron door, not but a few paces to the north.^"; ], n_to IronDoor; !*********************************************/ ! Hallway */ !*********************************************/ Object Hallway "Hallway" has light with name "hallway" "hall", with describe [; print "The long hallway outside of the dungeon door is more brightly lit, as several torches light the way down it. The walls are constructed from very old, but sturdy looking stones. The ceiling extends considerably high above you. There is a musty smell present out here as well, though it isn't nearly as powerful as it was in the dungeon. A wooden door lies to the west, and a long stone staircase to the north. You can smell that the air is fresher up wherever this staircase leads to...^^"; if(FirstMemory == false) { FirstMemory = true; "You remember well the feeling of putting your katana through a countless number of Nobunaga's soldiers. As you ripped your blade from one of their throats, you looked around in anticipation of more. To your left you saw one of your fellow Iga clan members nod to you. You ran up ahead into the closest throng of soliders, anticipating the feel of your blade biting into the flesh of the next unlucky soldier."; } if(KatanaUnlock == true) "There seems to be a door that was not previously present along the eastern wall.^"; ], s_to IronDoor, w_to WoodenDoor, n_to Staircase, before [; Go: if(noun == n_obj && NinjaGuard notin Hallway && NinjaGuard.health > 0) { move NinjaGuard to Hallway; StartDaemon(NinjaGuard); "A black clad and masked ninja suddenly appears before you, blocking your path to the staircase. He is about your height and weight, with a fierce look in his eyes. On the front of his hood is the clan emblem of the Koga ninja. He wields a deadly chained weapon with a sickle on the end of it."; } else if(NinjaGuard in Hallway && NinjaGuard.health > 0) "The ninja is blocking your path."; else rfalse; ]; !*********************************************/ ! Anteroom */ !*********************************************/ Object Anteroom "anteroom" has light with name "anter" "anteroom" "stairs" "staircase", s_to Staircase, d_to Trapdoor, describe [choice; print "This is an extremely large room, well lit with many torches, and with high ceilings. Various candle fixtures adorn the walls, some containing lit candles. Various scrolls are also mounted on the walls, most depicting the beautiful landscape of Japan.^^"; if(FujitaSeen == False) { FujitaSeen = true; print "Standing on the opposite side of the room from the entrance is an unhooded ninja with slightly graying hair and a small mustache. He has a wide grin on his face as he sees you enter the room. He briefly applaudes, as his grin widens even further. ~Welcome, Hattori Hanzo of the Iga Ninja!~, the man says. ~I am Fujita Seiko, the head of the Koga clan. It is my pleasure to have you here with us today!~. Fujita's grin somewhat diminishes. ~I'm sure that you're wondering what you're doing here, and possibly even where here is.~. Fujita pauses for a moment, and then continues, ~Well, there will be time for the details later. Let us just say that it was necessary that the Koga brought you here. You see...your clan was completely eliminated in the battle with Nobunaga. You are the last...~ You suddenly feel an icy feeling in your stomach, certain that this man is right, but not wanting to believe it. Fujita pauses, and then his previous grin returns to his face, ~Won't you join us Hanzo? It would be an esteemed honor for the Koga to have you among us! What say you?~"; print "^^Will you join the Koga clan?^"; print "^Yes or No>"; choice = YesOrNo(); if(choice) { deadflag = 2; "You accept Fujita's offer, and you are now a Koga ninja. You continue living your life as one of the greatest ninja of all time. However, you can never shake the feeling that there is more to the demise of your clan than you know..."; } else { print "Fujita shakes his head, with a frown on his face. ~I'm sorry to hear that Hanzo. You truly would have been a great addition the Koga.~ Fujita grins, ~But surely you couldn't blame me for asking, right? I'm sure you still have reservations, being that you still don't know how your entire clan was defeated by a bunch of worthless soldiers, correct? Well unfortunately...I cannot address those reservations at the moment. Goodbye Hanzo...~. And with this, a trapdoor falls open beneath Fujita, and he disappears from the room."; if(ThirdMemory == false) { ThirdMemory = true; "^^You remember well the feeling of triumph you had as your band of Iga ninjas tore through the larger band of Nobunaga's soliders that had appeared over the hilltop. There were still many left, but their sheer numbers had not proven to be the advantage that Nobunaga had obviously thought they would be. After putting your katana through what the solider thought was a well armored chest, you looked around for your clan. To your left you noticed a ninja, but there was something odd about it. He wasn't one of the Iga ninja that had come here with you. You were sure of it, just judging from his posture. He turned to see you and waved. He came walking toward you, and you raised your katana at the ready..."; } } } ], before [; Go: if(noun == s_obj && NinjaWarrior notin Anteroom && NinjaWarrior.health > 0) { move NinjaWarrior to Anteroom; StartDaemon(NinjaWarrior); "As you approach the stairway, you see a black clad ninja ascending it, blocking your path. He is several inches taller than you, and more muscular. As he ascends the stairs, he draws two katanas from their sheaths on his back. In a gruff voice the ninja says, ~Hattori Hanzo, I cannot let you leave this place alive.~"; } else if (NinjaWarrior in Anteroom && NinjaWarrior.health > 0) "The ninja is blocking your path."; else rfalse; ]; !*********************************************/ ! UndergroundChamber */ !*********************************************/ Object UndergroundChamber "underground chamber" has light with name "underground" "chamber", u_to TrapDoor, describe [choice2; print "If your vision wasn't better than the average mans, you probably would not be able to see much of anything in this chamber that smells much like the dungeon that you awoke in. You are standing on solid stone, but you hear the sound of running water not far from where you are.^^"; if(FujitaSeen2 == false) { FujitaSeen2 = true; print "Standing about four feet from where you stand, is Fujita Seiko. He nods to you, ~I see that you have solved all of my puzzles. No matter, I expected as much from the legendary Hattori Hanzo. Well...this leaves us with few choices. The fact that you're here, and have turned down my previous offer, tells me that you wish to know more about the fate of your clan. However...~, Fujita's previous grin returns to his face, ~There is only one way that you can obtain this information: on my terms. And my terms are that we must dual. If you lose, and you still have life left in you, you will join the Koga. If I lose, then I will tell you the true fate of your clan before I die. Your other option, Hanzo, is to walk away. At this point, I am willing to let you roam the land clanless, undisturbed, if that is what you so desire. So make the choice Hanzo...~^^"; print "You think for a moment, and realize that Fujita may be one of the only ninjas alive that would consider to be even close to your equal in battle..."; print "^^Will you dual with Fujita Seiko?^"; print "^Yes or No>"; choice2 = YesOrNo(); if(choice2) { move Fujita to UndergroundChamber; StartDaemon(Fujita); } else { deadflag = 2; "You leave the Koga compound without problems, but still with the looming suspicion that something more happened to your clan than what you were told. You roam the land for the rest of your days, never encountering a Koga or Iga ninja again..."; } } ]; !*********************************************/ ! SmallRoom */ !*********************************************/ Object SmallRoom "small room" has light with name "small" "room", with describe [; print "This room is quite small, made from the same stone as the hallway. The ceiling is much lower in here than it was in the hallway, only a couple of feet above your head. There are no torches lighting this room, the only light being from the torch just outside in the hallway. It is practically empty. Not but a couple of feet to your left, you see a small hole in the ceiling.^"; ], e_to WoodenDoor, u_to Hole; !*********************************************/ ! CrawlSpace */ !*********************************************/ Object CrawlSpace "crawl space" has light with name "crawl" "space", with describe [; print "This extremely cramped crawl space is lit by the light of a single torch that looks like it's going to go out at any minute now. The entire crawl space is made out of stone. You can barely stand, but notice that whoever laid down the stonework for the floors seems to have done a rather poor job.^^"; if(SecondMemory == false) { SecondMemory = true; "You remember well the feeling of thinking that you must have at least vanquished most of Nobunaga's men. There had seemed to be a shortage of them as of the past several minutes. Looking up to the horizon, atop a hill in the distance, you saw something that briefly turned your stomach. The standard of Nobunaga raised high into the air, as an army at least twice the size of the one that initially attacked your clan marched toward the battle field."; } ], d_to Hole; !*********************************************/ ! SecretRoom */ !*********************************************/ Object SecretRoom "secret room" has light with name "secret" "room", with describe [; print "This room is barely big enough to accomodate you. It was most likely constructed for storage purposes.^"; ], e_to SecretDoor; !*********************************************/ ! Shackles */ !*********************************************/ Object Shackles "set of shackles" Dungeon has static with name "shackles", with descrption "A set of slightly rusted metal shackles that are bolted to the dungeon walls.", before [; pull: if (self hasnt general) { give self general; move LargeKey to Dungeon; "You pull on the set of shackles, and a large key seems to fall out from the top of them."; } else { "You pull on the set of shackles, but they only rattle."; } ]; !*********************************************/ ! LargeKey */ !*********************************************/ Object LargeKey "large key" with name "largekey" "key" "large", with description "A very worn looking and large golden key."; !*********************************************/ ! LooseStone */ !*********************************************/ Object LooseStone "loose stone" CrawlSpace has static with name "loose" "stone", with description "A stone that looks the same as the rest of the stones used in the construction of this place.", before [; pull: if (self hasnt general) { give self general; move SmallKey to CrawlSpace; "You pull up the loose stone, to find a small key underneath."; } else { "You pull up the loose stone, to find nothing but dirt underneath."; } push: if (self hasnt general) { give self general; move SmallKey to CrawlSpace; "You push up the loose stone, to find a small key underneath."; } else { "You push up the loose stone, to find nothing but dirt underneath."; } ]; !*********************************************/ ! SmallKey */ !*********************************************/ Object SmallKey "small key" with name "smallkey" "key" "small", with description "A very worn looking and small golden key."; !*********************************************/ ! MetalBox */ !*********************************************/ Object MetalBox "metal box" SmallRoom with name "metal" "box", with description "A small silver box, made of steel.", before [; open: if (KatanaUnlock == false) { KatanaUnlock = true; move SecretDoor to Hallway; "You open up the box to find nothing inside, but you hear a faint clicking sound from somewhere outside of the room."; } else { "You open up the metal box, but nothing seems to happen."; } close: "You close the lid to the metal box."; ]; !*********************************************/ ! Katana */ !*********************************************/ Object katana_sword "katana" with name "katana", damage 8, description "This katana appears to be quite old, but still razor sharp.", before [; take: if(PlayerWeapon ~= PUNCH) { print "You can't carry more than one weapon.^"; rtrue; } PlayerWeapon = KATANA; drop: PlayerWeapon = PUNCH; ]; !*********************************************/ ! Kusarigama */ !*********************************************/ Object kusarigama_weapon "kusarigama" with name "kusarigama", damage 6, description "This is a chained weapon, with a weight at one end, and the shaft of a razor sharp sickle at the other.", before [; take: if(PlayerWeapon ~= PUNCH) { print "You can't carry more than one weapon.^"; rtrue; } PlayerWeapon = KUSARIGAMA; drop: PlayerWeapon = PUNCH; ]; !*********************************************/ ! IronDoor */ !*********************************************/ Object IronDoor "iron door" has static door openable lockable locked, with name "iron" "door", description "A very solid looking door constructed completely from iron. On the right side is a large key hole.", when_closed "The iron door is closed.", when_open "The iron door is open.", door_to [; if(self in Dungeon) return Hallway; return Dungeon; ], door_dir [; if(self in Dungeon) return n_to; return s_to; ], with_key LargeKey, found_in Dungeon Hallway; !*********************************************/ ! WoodenDoor */ !*********************************************/ Object WoodenDoor "wooden door" has static door openable open, with name "wood" "wooden" "door" "western" "west", description "An old looking, but fairly well constructed wooden door.", when_closed "The wooden door is closed.", when_open "The wooden door is open.", door_to [; if(self in SmallRoom) return Hallway; return SmallRoom; ], door_dir [; if(self in SmallRoom) return e_to; return w_to; ], found_in SmallRoom Hallway; !*********************************************/ ! Hole */ !*********************************************/ Object Hole "hole" has static door open scenery, with name "ceiling" "hole" "up", description "A dark hole, just barely able to fit a person through it.", door_to [; if(self in CrawlSpace) return SmallRoom; return CrawlSpace; ], door_dir [; if(self in CrawlSpace) return d_to; return u_to; ], found_in CrawlSpace SmallRoom; !*********************************************/ ! SecretDoor */ !*********************************************/ Object SecretDoor "secret door" has static door openable lockable locked, with name "secret" "door", description "A small door that doesn't look quite large enough to fit a person through it. A keyhole is on the right side.", after [; open: if (self hasnt general) { give self general; HasKatana = true; move katana_sword to Hallway; "The room that you see inside has a very low ceiling, and is clearly not large enough to hold a man. It would appear, however, that it is used for storage, as a katana blade falls out as you open the door."; } else { "The room that you see inside has a very low ceiling, and is clearly not large enough to hold a man."; } ], when_closed "The secret door is closed.", when_open "The secret door is open.", with_key SmallKey; !*********************************************/ ! Staircase */ !*********************************************/ Object Staircase "staircase" has static door open scenery with name "staircase" "stairs", description "A long stone staircase, with light coming from the top of it.", before [; Go: if(NinjaGuard notin Hallway && NinjaGuard.health > 0 && player in Hallway) { move NinjaGuard to Hallway; StartDaemon(NinjaGuard); "A black clad and masked ninja suddenly appears before you, blocking your path to the staircase. He is about your height and weight, with a fierce look in his eyes. On the front of his hood is the clan emblem of the Koga ninja. He wields a deadly chained weapon with a sickle on the end of it."; } else if(NinjaGuard in Hallway && NinjaGuard.health > 0 && player in Hallway) "The ninja is blocking your path."; else if(NinjaWarrior notin Anteroom && NinjaWarrior.health > 0 && player in Anteroom) { move NinjaWarrior to Anteroom; StartDaemon(NinjaWarrior); "As you approach the stairway, you see a black clad ninja ascending it, blocking your path. He is several inches taller than you, and more muscular. As he ascends the stairs, he draws two katanas from their sheaths on his back. In a gruff voice the ninja says, ~Hattori Hanzo, I cannot let you leave this place alive.~"; } else if(NinjaWarrior in Anteroom && NinjaWarrior.health > 0 && player in Anteroom) "The ninja is blocking your path."; else rfalse; ], door_to [; if(self in Anteroom) return Hallway; return Anteroom; ], door_dir [; if(self in Anteroom) return s_to; return n_to; ], found_in Anteroom Hallway; !*********************************************/ ! TrapDoor */ !*********************************************/ Object TrapDoor "trap door" has static door openable lockable locked scenery, with name "trap" "door", description "An iron trap door in the floor. It has a small keyhole on the upper portion.", when_closed "The trap door is closed.", when_open "The trap door is open.", door_to [; if(self in Anteroom) return UndergroundChamber; ], door_dir [; if(self in Anteroom) return d_to; ], with_key SmallKey, found_in Anteroom; !*********************************************/ ! NinjaGuard */ !*********************************************/ Object NinjaGuard "ninja guard" has animate with name "ninja" "guard", health 20, describe [; if(self.health <= 0) { "The ", (name) self," lies on the ground, blood oozing from his wounds."; } if(self.health >=1 && self.health <= 5) { "The ", (name) self, " is staggering and slightly hunched, but continues to look focused."; } if(self.health <= 20 && self.health >5) { "This black clad ninja's eyes burn with anger."; } ], life [hit; hit = false; Attack: if(self.health <= 0) "You kick the ninja's corpse, but get no reaction."; if(PlayerWeapon == PUNCH) print "You fire off a fast but deadly punch..."; else print "You take an efficient and deadly swipe with your katana..."; if(PlayerWeapon == PUNCH) { if(random(100) >= 30) { hit = true; self.health = self.health - (random(3)+1); } } else { if(random(100) >= 20) { hit = true; self.health = self.health - (random(katana_sword.damage)+1); } } if(hit == true) { if(PlayerWeapon == PUNCH) print "and make contact with the ninjas face!^"; else print "and make contact with the ninjas body!^"; } if(self.health <= 0) { StopDaemon(self); move kusarigama_weapon to Hallway; "The ninja looks down at his wounds with amazement in amazement, and collapses to the ground."; } if(self.health >= 1 && self.health < 6) "The ninja staggers, but continues to persist in attacking."; if(self.health >= 6 && self.health <= 20) "The ninja receives the attack with barely a flinch."; else "and the ninja dodges your attempted attack!"; ], daemon [ hit; if(player notin Hallway) rtrue; hit = false; if(self.health >= 1 && self.health <= 5) { if(random(100) > 60) hit = true; } else { if(random(100) > 50) hit = true; } if(hit == true) { PlayerHealth = PlayerHealth - (random(6) + 1); print "The ninja strikes you with the sickle of his weapon! It leaves a wound which begins to bleed.^"; if(PlayerHealth < 5 && PlayerHealth > 0) "You begin to feel unsteady on your feet, and your vision begins to blur.^"; if(PlayerHealth <= 0) deadflag = true; } ]; !*********************************************/ ! NinjaWarrior */ !*********************************************/ Object NinjaWarrior "Ninja Warrior" has animate with name "ninja" "warrior", health 35, describe [; if(self.health <= 0) { "The ", (name) self," lies on the ground, blood oozing from his wounds."; } if(self.health >=1 && self.health <= 10) { "The ", (name) self, " is staggering and slightly hunched, but continues to look focused."; } if(self.health <= 35 && self.health > 10) { "This black clad ninja's eyes burn with anger."; } ], life [hit; hit = false; Attack: if(self.health <= 0) "You kick the ninja's corpse, but get no reaction."; if(PlayerWeapon == PUNCH) { print "You fire off a fast but deadly punch..."; if(random(100) >= 30) hit = true; } else if(PlayerWeapon == KUSARIGAMA) { print "You send out the sickle of your kusarigama..."; if(random(100) >= 25) hit = true; } else { print "You take an efficient and deadly swipe with your katana..."; if(random(100) >= 20) hit = true; } if(hit == true) { switch(PlayerWeapon) { PUNCH: self.health = self.health - (random(3)+1); print "and make contact with the ninja's face!^"; KUSARIGAMA: self.health = self.health - (random(kusarigama_weapon.damage)+1); print "and make contact with the ninja's body!^"; KATANA: self.health = self.health - (random(katana_sword.damage)+1); print "and make contact with the ninja's body!^"; } } else "and the ninja dodges your attack!"; if(self.health <= 0) { StopDaemon(self); "The ninja looks down at his wounds with amazement in amazement, and collapses to the ground."; } else if(self.health >=1 && self.health <= 10) "The ninja staggers, but continues to persist in attacking."; else if(self.health <= 35 && self.health > 10) "The ninja receives the attack with barely a flinch."; ], daemon [ hit; if(player notin Hallway) rtrue; hit = false; if(self.health <= 35 && self.health > 10) { if(random(100) >= 35) hit = true; } else { if(random(100) >= 45) hit = true; } if(hit == true) { PlayerHealth = PlayerHealth - (random(16) + 1); print "The ninja strikes you with the blades of his katanas, and your wound begins to bleed.^"; if(PlayerHealth < 5 && PlayerHealth > 0) "You begin to feel unsteady on your feet, and your vision begins to blur.^"; if(PlayerHealth <= 0) deadflag = true; } ]; !*********************************************/ ! Fujita */ !*********************************************/ Object Fujita "Fujita Seiko" has animate with name "fujita" "seiko", health 75, describe [; if(self.health > 0 && self.health <= 25) "Fujita is hunched over and short on breath, but continues to fight."; if(self.health > 10 && self.health <= 75) "Fujita has a determined look on his face, as if you were just an obstacle in his path to be removed."; ], life [hit; hit = false; Attack: if(PlayerWeapon == PUNCH) { print "You fire off a fast but deadly punch..."; if(random(100) >= 30) hit = true; } else if(PlayerWeapon == KUSARIGAMA) { print "You send out the sickle of your kusarigama..."; if(random(100) >= 25) hit = true; } else { print "You take an efficient and deadly swipe with your katana..."; if(random(100) >= 20) hit = true; } if(hit == true) { switch(PlayerWeapon) { PUNCH: self.health = self.health - (random(3)+1); print "and make contact with Fujita's face!^"; KUSARIGAMA: self.health = self.health - (random(kusarigama_weapon.damage)+1); print "and make contact with Fujita's body!^"; KATANA: self.health = self.health - (random(katana_sword.damage)+1); print "and make contact with Fujita's body!^"; } } else "and Fujita dodges your attack!"; if(self.health <= 0) { StopDaemon(self); print "^Fujita falls to the ground, bleeding from multiple wounds and gasping for breath. He appears to have a small amount of life left in him, however. You crouch down over him, and he looks up at you with a pained shadow of his former broad grin. ~Very well Hanzo...you win. So now...I will tell you the fate of your clan. What I told you before...is not really a lie. There is simply...more to the story. You see...Nobunaga's forces were massive. Even together...our clans would not have been able to withstand them...and still remain anywhere close to whole. For some reason... Nobunaga sent a messenger to me. The messenger said that Nobunaga was willing to make a deal...a deal that would spare...the fate of the Koga clan. That deal was to... help exterminate the Iga clan.~ Your eyes widen, and then narrow, in pure spite for this man. He is a fellow ninja, yet he betrayed an entire clan for the sake of perseverance of his own clan. ~That is the truth Hanzo...now...end my life...~. You do just that, as you drive the blade of your katana through his heart."; deadflag = 2; "^^You leave the Koga compound with feelings of both rage and satisfaction. However you may feel though, these events have all already taken place. Little would the Koga know, however, that soon enough, Japan would have no more use for the Ninja. They would either go into hiding to practice their arts in secret, or they would be assimilated into public life."; } else if(self.health >= 1 && self.health < 25) "Fujita staggers and is visibly short on breath, but continues the duel."; else if(self.health >= 10 && self.health < 75) "Fujita receives the attack with barely a flinch."; ], daemon [ hit; if(player notin UndergroundChamber) rtrue; hit = false; if(self.health <= 75 && self.health > 25) { if(random(100) >= 25) hit = true; } else { if(random(100) >= 40) hit = true; } if(hit == true) { PlayerHealth = PlayerHealth - (random(8) + 1); print "Fujita strikes you with the blade of his katana, and your wound begins to bleed.^"; if(PlayerHealth < 5 && PlayerHealth > 0) "You begin to feel unsteady on your feet, and your vision begins to blur.^"; if(PlayerHealth <= 0) { deadflag = true; "^Fujita leans over your body grinning, but before you can hear any of his words, your vision blurs, and all goes black. It looks like you don't have to worry about joining the Koga after all..."; } } ];