! ---------------------------------------------------------------------------- ! Game Description and Story Line ! ---------------------------------------------------------------------------- Constant Story "The Demon of Sumaria^"; Constant Headline "An interactive fiction game by Jamal El-Mokadem ^^ ^Story Line:^ -----------^ ^Sumaria is the first civilization known in human history. The Sumarians were people of great wisdom, and magical powers. Their powers grew, and their arrogance grew with them, till the day they summoned the great demon of Kwagaru, an evil and very powerful creature, who was too strong for the Sumarians to control. The demon of Kwagaru destroyed the entire world of Sumaria, and then went into a deep slumber of which he awakes every three hundred years to destroy what humanity has built.^ Two thousand and one hundred years had passed since the sumarians demise. The story of Kwagaru is regarded as a myth from the world of imaginations. Dujaron, a wise and strong sorcerer, is a direct descendant of the Sumarians. He knows the awful truth: Kwagaru is about to awake and reduce to ruins the civilizations that have long forgotten about him. Dujaron has found a way to permanently get rid of the Kwagaru, and that's why he called upon you, the great warrior of Tiburon, to help execute his plan and save the world from a certain doom.^ You have to go to Kwagaru's lair, in the ruins of the Castle of Sansool in the land of Ortaz, and stick Dujaron's magical Z sword in the demon's heart before he awakes from his lengthy rest. Be aware, the Castle of Sansool is a dangerous place full of deadly traps... ^Good Luck brave warrior.^"; Include "parser"; Include "verblib"; !--------------------------------------------------- !--- This object represents the player's intial ---- !--- Position. It's outside the castle, in ---- !--- front of the castle's door: a draw-bridge ---- !--------------------------------------------------- Object Outside_Castle "Outside Castle" has light enterable with name "Outside" "Outside Castle", description "Your only way into the Castle of Sansool is through a draw-bridge, but first you have to find the enchanted key that will bring down the draw-bridge. You look around and you see a rock and a tree. The draw-bridge is to the north.^^", before[; look: if (player in self) "You can see a Rock (and think you might be able to Push it), and a tree (you wonder if you can Climb it)"; climb: !Climb the tree of might if (noun == tree_of_might) { move player to tree_of_might; "You have climbed the tree of might. You see only one Fruit left. All you have to do is Eat it, and you'll become very strong"; } else !Trying to climb somewhere you can't "You can't climb there! You can only climb on the tree of might"; Go: if (player in Castle_Courtyard) ! The player is trying to go if (noun == s_obj) ! South from the courtyard to the ! bridge { move player to Draw_Bridge; "You are on the draw bridge now: South will lead you back to Outside the Castle, North back into the Courtyard."; } if (player in draw_bridge) ! The player is trying to go { ! south from the bridge to outside ! the castle if (noun == s_obj) { move player to Outside_Castle; "You're back outside the castle"; } if (noun == n_obj) ! The player is trying to go north ! into the courtyard { ! the player cannot cross the bridge if he/she ! is carrying both the key and the Z_Sword if (enchanted_key in player && Z_Sword in player) { if (draw_bridge hasnt general) !The general flag is set { !to mark that the player give draw_bridge general; !has been warned "As you take your first step on the draw bridge, you feel it cracking underneath your feet. If you take one more step, the bridge will collapse, and you will fall to your death. You realize that you are carrying the very heavy Enchanted Key. You need to Throw it into the castle's courtyard then continue"; } else { deadflag = 1; !The player tried to cross the !bridge after being warned !The bridge collapses and player dies "You have ignored the warnings, and kept going despite the heavy weight put on you by the Enchanted Key; the bridge has collapsed, and you fell to your doom."; } } else ! The player crosses the bridge with one item { move player to Castle_Courtyard; print "You are in the castle's courtyard^"; if (z_sword in player) !Give appropriate message { print "You have crossed the draw-bridge with the Z Sword^"; if (Enchanted_Key notin Castle_Courtyard) "Now you have to go back outside the castle and get the Enchanted Key to help you open closed doors"; else "You finally made it back into the Castle's Courtyard. Pickup the Enchanted Key and get ready to continue your mission"; } if (Enchanted_Key in player) !Give appropriate message { print "You have crossed the draw-bridge with the Enchanted Key^"; if (Z_Sword notin Castle_Courtyard) "Now you have to go back outside the castle and get the Z_Sword to help you conquer evil"; else "You finally made it back into the Castle's Courtyard. Pickup the Z_Sword and get ready to continue your mission"; } } } } ! player is trying to go north onto the drawbridge ! Check if the drawbridge is open if (noun == n_obj && draw_bridge.isopen && player in self) { move player to draw_bridge; "You are now on the Draw Bridge"; } ! if Drawbridge is not open if ((noun == n_obj) && (~draw_bridge.isOpen) && (player in self)) "You can't go that way, the draw bridge is still lifted... You need to wave the enchanted key at it to bring it down"; ! player is trying to get down from the tree of might if (player in Tree_Of_Might && noun == d_obj) { move player to Outside_Castle; if (Fruit_Of_Might in player) { "You got down from the tree, and now you are much stronger"; } else "You got down from the tree, but you are still weak since you didn't eat the Fruit of Might"; } ! player is outside the castle and heading in an ! undefined direction if (player in self && noun ~= n_obj) "Are you trying to run away~? Well it's too late now, the only direction you can go is north on the Draw Bridge, or climb the tree"; ]; !------------------------------------------------- !--- This object represents the Enchanted Key ---- !--- The player has to pick it up, and wave ---- !--- it to the draw bridge to open it ---- !------------------------------------------------- Object Enchanted_Key "Enchanted Key" has concealed static with name "Enchanted" "Key" "Enchanted Key", description "This is the enchanted key. It will bring the draw bridge down when you pick it up. This key is very heavy, and you can carry only one other object with it", before[; Drop: if (player in Draw_Bridge) ! The player has dropped the key { ! on the bridge move self to Draw_bridge; if (z_sword in player) ! The bridge can't hold the player ! and key and sword at the same time "You have dropped the Enchanted Key on the draw-bridge, but you can still hear the draw bridge cracking under the weight, since it can only hold you and one item!"; else if (z_sword in Draw_Bridge) "You have dropped the Enchanted Key on the draw-bridge, but you have also dropped the Z Sword on the Draw Bridge; you can hear the draw bridge cracking under the weight, since it can only hold you and one item!"; else ! The player doesn't need ! to drop the key if he's not ! carrying the sword "You have dropped the Enchanted Key on the draw-bridge, but it is safe to cross the bridge holding it since you are not carrying the z sword"; } take: if (Rock hasnt general) !The player is trying to take the key !while it's still hidden under the rock "The key is hidden somewhere, and you have to look for it"; if (Fruit_Of_Might in player) { move self to player; !The player can acquire the key if it's !not hidden and he ate the fruit of might "You have acquired the enchanted key"; } else ! the player can only take the key if he ate the fruit of might "Your journey to the land of sansool has weakened you. The key is too heavy for you. If you eat from the trea of might, your strength will be restored"; wave: if (self notin player) "You don't have the enchanted key, and thus can't wave it"; if (player notin Outside_Castle) "You have to be in front of the castle to use the enchanted key"; if (self hasnt general) !player is opening the !bridge by waving the key { give self general; draw_bridge.isOpen = 1; "The magical key has opened the draw-bridge for you. Now you can go North to get on the draw-bridge"; } ]; !------------------------------------------------ !--- This object represents the Z Sword. ---- !--- by default the player carries it with ---- !--- him, but its magical power is low, and ---- !--- not sufficient to kill Kwagaru. The ---- !--- player has to increase its magical ---- !--- power along his search, and before he ---- !--- faces off with Kwagaru ---- !------------------------------------------------ Object Z_Sword "Z Sword" has static with name "Z" "Sword" "Z Sword", describtion "The Z Sword is the only weapon that can kill the monster Kwagaru", before[; Take: if (parent(Z_Sword) == player) !player tries to take the Z- "You already have the Z Sword";! Sword while carrying it if (parent(Z_Sword) == parent(player)) ! Take Sword successfully { move Z_Sword to player; "You have picked up the Z Sword"; } else "The Z Sword is not in this room. You dropped it in the ", parent(Z_Sword), " room."; Drop: if (player in Draw_Bridge) { move z_sword to Draw_Bridge; !The player has dropped the sword ! on the bridge ! while carrying the key if (enchanted_key in player) "You have dropped the z_sword on the draw-bridge, but you can still hear the draw bridge cracking under the weight, since it can only hold you and one item!"; else ! while the key is on bridge if (Enchanted_Key in Draw_Bridge) "You have dropped the Z Sword on the draw-bridge, but you have also dropped the Enchanted Key on the Draw Bridge; you can hear the draw bridge cracking under the weight, since it can only hold you and one item!"; else !Player doesn't need to drop sword "You have dropped the z_sword on the draw-bridge, but it safe to cross the bridge holding it since you are not carrying the Enchanted Key"; } if (parent(Z_Sword) == player) { move Z_Sword to parent(player); "You are much lighter now that you have dropped the Z Sword. "; } else "You don't have the Z Sword: You can't drop it..."; ]; !------------------------------------------------ !--- This object represents the draw-bridge. ---- !--- The player has to put the enchanted key ---- !--- in the draw bridge to open it ---- !------------------------------------------------ Object Draw_Bridge "Draw Bridge" has light supporter concealed enterable with name "Draw" "Bridge" "Draw Bridge", isOpen 0, n_to Castle_Courtyard, s_to Outside_Castle, initial "The draw-bridge is lifted, and you need the enchanted Key to lower it", description "The draw-bridge is your only way in to the Castle of Sansool"; !------------------------------------------------ !--- This object represents a Rock. It's ---- !--- Located outside the castle. ---- !--- An enchanted key, used to bring the ---- !--- draw-bridge down, is hidden berneath it ---- !------------------------------------------------ Object Rock "Rock" has light supporter with name "Rock", description "This is a rock. It's heavy, but a great warrior like you can easily Push it^", w_to Outside_Castle, before[; Take: !player can't take the rock "You are a great warrior, but the rock is too heavy for you to carry or lift^"; Push, Pull: if (self hasnt general) ! The player pushes the rock for { ! the first time and uncovers the key give self general; "You have uncovered the enchanted key. Now you can take it, and with it the draw-bridge will come down^"; } else !player pushes the rock a second time "Nothing exciting happens. You have already uncovered the enchanted key"; LookUnder: !player can't look under the rock "The only way you check what's under the rock is by Pushing or Pulling the rock^"; ]; !------------------------------------------------------ !--- This object represents the castle's courtyard ---- !--- The courtyard contains a The Chest of ---- !--- Morpheous, an Earn, and a dome-lik structure ---- !------------------------------------------------------ Object Castle_Courtyard "Castle's Court Yard" has light enterable concealed, with name "Castle" "Castle Yard" "Gate" "Castle Gate", describtion "Now you have entered the castle. You are in the castle's front yard. Right behind you - to the south - is the entrance where you came in from - there is a door that you can Enter.^^", s_to Draw_Bridge, before[; Look: !What the player sees in the castle's courtyard if (player in self) "You see an Earn with an inscription, a locked chest, and big dome with two doors. To the south is draw bridge that led you in"; ]; !-------------------------------------------------- !--- This object represents the Tree of Might ---- !--- The fruits of this tree give the person ---- !--- that eats them an incredible power ---- !-------------------------------------------------- Object Tree_Of_Might "Tree Of Might" has light enterable, with name "Tree Of Might" "Tree", describtion "This is the tree of might. If you eat the fruits of might you become very strong", d_to Outside_Castle, before[; climb, Go: ! Climb while in the tree of might if (noun == nothing || noun == u_obj) { if (player notin self) { move player to self; "You have climbed the tree of might. You see one Fruit left in front of you"; } else { if (fruit_Of_Might in player) "You are already on the tree of might. Since you already ate the Fruit of Might, you need to get down from the tree"; else "You are already on the tree of might. You didn't eat the fruit yet; do so and get down"; } } else if (noun == d_obj) ! Player getting down from tree { if (player in self) { move player to Outside_Castle; if (Fruit_Of_Might in player) { "You got down from the tree, and now you are much stronger"; } else { "You got down from the tree, but you are still weak since you didn't eat the Fruit of Might"; } } else !player not on the tree "That doesn't make sense as you are not on the tree"; } ]; !-------------------------------------------------- !--- This object represents the Fruit of Might ---- !--- It grows on the Tree of Might, and gives ---- !--- whoever eats it an incredible power ---- !-------------------------------------------------- Object Fruit_Of_Might with name "Fruit Of Might" "Fruit", describtion "This is the Fruit of might. If you eat it you will become very strong", before[; eat: if (self notin Tree_Of_Might) ! If the player tries to eat the fruit ! a second time "you already ate the Fruit. Don't be too greedy"; if (noun == Fruit_Of_Might) !The player eats the fruit { move Fruit_Of_Might to player; "You just ate the fruit of might. You feel an overwehlming sensation of power"; } else { "you can't eat anything beside the Fruit of the Tree of Might"; } ]; !------------------------------------------------------ !--- This object represents the chest of morpheous ---- !--- It's locked, and can only open it if you have ---- !--- the Enchanted Key. It contains the Magical ---- !--- Potion of Morpheous ---- !------------------------------------------------------ Object Chest "Chest" with name "Chest", Description "This is the chest that the sorcerer Dujaron told you about. It contains the potion that will increase the Z Sword's strength a thousand times making it powerful enough to kill Kwagaru^", before[; open: if (Enchanted_Key in player)! Player can only open the chest ! while carrying the key if (self hasnt general) { give self general; move magical_potion to parent(self); "You have opened the Chest of Morpheous. You see the Magical Potion inside it. If you Take the Magical Potion, your sword will become a thousand times stronger"; } if (self has general)! Trying to open the chest a second time { print "The Chest of Morpheous is already open ^"; if (Magical_Potion in Chest) "but you haven't taken the magical potion yet. You need it to kill Kwagaru"; else " and you have already taken the magical potion"; } ]; !--------------------------------------------------- !--- This object represents the Magical Potion ---- !--- The player can only take it if he/she is ---- !--- carrying the z sword. It increase the ---- !--- Z Sword's power a thousand times ---- !--------------------------------------------------- Object Magical_Potion "Magical Potion" with name "Magical" "Potion", Description "This is the Magical Potion created by once a great sumarian sorcerer Morpheus. Combined with the Z Sword, it will make the most powerful weapon known in the universe, and it will allow you to kill Kwagaru", before[; Take: if (Z_Sword in player) ! the player can only safely acquire the potion { ! if he/she is carrying the sword move self to player; "You have acquired the Magical Potion; the Z Sword starts glowing; you can feel its enormous power growing beyond you ever imagined"; } else if (self hasnt general) ! Check if a warning has been given { give self general; ! mark that a warning has been given ! and give warning "You're not carrying the Z Sword to shield you from the overwhelming and powerful magic. You start feeling the burn in your veins, you drop it right away. If you take it again without carrying the Z Sword, you will surely die"; } else { deadflag = 1; ! a warning has been given, and player ! chose to ignore it: player dies "You ignored all warnings and tried to take the magical potion without carrying your sword. Your body starts burning from the inside... You are reduced to ashes"; } ]; !-------------------------------------------------------- !--- This object represents the Dome: Kwagaru's Lair ---- !--- The only way to enter this dome is through ---- !--- two locked doors. You need the Enchanted Key ---- !--- to open any of the doors. ---- !-------------------------------------------------------- Object The_Dome "The Dome" has light enterable, with name "Dome" "The Dome", Description "The dome is the only part of the castle that's not in ruins. The dome has two doors: Door 1 and Door2. Both will lead you to Kwagaru, but one of them is booby trapped, and will explode and kill you if you open it", before[; Look: ! In the Dome, player can see kwagaru if (player in self) "You can see Kwagaru Sleeping"; Enter: ! The player can only enter the dome if the safe door is open if (Safe_Door.isOpen) { move player to self; "You have entered the Dome. You see Kwagaru sleeping. All you have to do is Kill him"; } else !warn the player if the safe door to the dome is still closed. "The doors of the dome are still closed. You need to open one of the doors to enter"; Exit: !Player is leaving the dome out to the courtyard move player to castle_courtyard; "You're back in the Castle's Courtyard"; ]; !--------------------------------------------------- !--- This following two objects represent the ---- !--- doors to the Dome. They're both locked, ---- !--- but only one of them is safe to open ---- !--- the other is booby trapped, and will kill ---- !--- the player when opened ---- !--------------------------------------------------- Object Safe_Door "Door 1" with name "Door 1" "Door1" "1", isOpen 0, Description "This is a door that leads to the Dome where Kwagaru sleeps, but you don't know if this is the safe or booby trapped one. This door will only open if you're carrying the Enchanted Key" , before[; Open: ! Player opens the safe door if (Enchanted_Key in player) { self.isOpen = 1; "Congratulations! You have opened the safe door. Now you can Enter the Dome where Kwagaru is about to wake up from his slumber"; } if (self.isOpen) !player is trying to open the safe door again "You have already opened the safe door"; ]; Object Booby_Trap_Door "Door 2" with name "Door 2" "Door2" "2", Description "This is a door that leads to the Dome where Kwagaru sleeps, but you don't know if this is the safe or booby trapped one. This door will only open if you're carrying the Enchanted Key", before[; Open: !player is opening the boobytrapped door if (Potion_Of_Wisdom in player) if (self hasnt general) { ! The player is warned once about give self general;! the door if he/she has drank ! the potion of wisdom "the Fruit of wisdom has allowed you to look into the door first. You are trying to open the booby trapped door. If you try to open this door one more time, you will surely die"; } if (Enchanted_Key in player) { !player has successfully opened the booby trapped door !player dies deadflag = 1; !print appropriate message if (self hasnt general) print "You have decided to try your luck and open the door without eating from the fruit of wisdom.^"; else print "You decided to ignore the warning of the vision given to you by the fruit of wisdom.^"; "You have opened the booby trapped door. A poisonous gas is realesed that turns you into a blob of goo"; } ]; !----------------------------------------------------- !--- This object represents the Potion of Wisdom ---- !--- It is found in an earn, and will give the ---- !--- whoever drinks it the ability to see dangers ---- !----------------------------------------------------- Object Potion_Of_Wisdom "Potion of Wisdom" with name "Potion" "Wisdom" "Potion of Wisdom", description "The fruit of wisdom will give you a vision when you try to open a door. The vision will serve as a warning if you try to open a booby-trapped door", before[; Drop: "Can't drop this, you already drank it"; Take, drink, eat: !The player can only drink the potion !if he/she broke the earn if (parent(Potion_Of_Wisdom) == Castle_Courtyard) { move self to player; "You drank the potion of wisdom. Now you can see hidden dangers"; } else !can't drink it twice "You already drank the Potion of Wisdom"; ]; !----------------------------------------------- !--- This object represents an Earn ---- !--- It is found in the Castle's Courtyard, ---- !--- and contains the potion of wisdom ---- !----------------------------------------------- Object Earn "Earn" has static supporter, with name "Earn", Description "This is an Earn. It has an inscription that says: I contain the drink of the wise and all seeing", before[; break: if (self has general) "You already broke the earn"; !can only break the earn once give self general; !The Earn is broken, the potion is now in the courtyard move Potion_Of_Wisdom to parent(self); "You have uncovered the Potion of Wisdom. If you drink this potion, you will be able to see hidden dangers. This potion will warn you only once about a particular danger.^"; ]; !----------------------------------------------- !--- This object represents Kwagaru ---- !--- He can only be killed with the Z Sword ---- !--- and magical potion combined ---- !----------------------------------------------- Object Kwagaru "Kwagaru" with name "Kwagaru", description "This is the evil and very powerful demon Kwagaru", before[; Kill, Attack: ! The player tries to kill kwagaru whith the powered up sword if (z_sword in Player && magical_potion in Player) { deadflag = 2; ! The player succeeds in killing Kwagaru "Kwagaru is finally dead. You have saved the world from his terrible evil"; } else !The player doesn't have both the sword and !magical potion: he can't kill Kwagaru if (potion_of_wisdom in player) ! Player gets one warning if (Kwagaru hasnt general) ! if drank from the potion of { ! Wisdom give Kwagaru general; "You get a vision from the potion of wisdom: You need both the Z_Sword and the Magical Potion found in the chest of Morpheous to be able to kill Kwagaru"; } else { deadflag = 1; !player ignores warning and dies "You have decided to ignore your vision. You tried to kill Kwagaru without the Z_Sword and Magical Potion. Kwagaru wakes up and kills you"; } else { deadflag = 1; !player never had a warning and dies "You tried to kill Kwagaru without having both the Z Sword and magical potion. You were not warned about this since you didn't drink the potion of wisdom. Kwagaru wakes up and kills you"; } ]; [Initialise; ! Set initial environment give Outside_Castle light; move Z_Sword to player; move Rock to Outside_Castle; move Tree_Of_Might to Outside_Castle; move enchanted_key to rock; move Fruit_Of_Might to Tree_Of_Might; move Potion_Of_Wisdom to Earn; move Earn to Castle_Courtyard; move Chest to Castle_Courtyard; move The_Dome to Castle_Courtyard; move Kwagaru to The_Dome; move Safe_Door to Castle_Courtyard; move Booby_Trap_Door to Castle_Courtyard; ! Set initial location location = Outside_Castle; print "^You are in the Land of Ortaz. You are standing in front of the Castle of Sansool.^^"; ]; Include "grammar"; ! Some verbs that needed to be redefined and ! extended to work within the game's context [breakSub; "This will lead to nothing";]; [killSub; "This will lead to nothing";]; verb "Kill" = "attack"; Extend only "break" replace * noun -> break;