!-------------------------------- !- Craig Foucher - !- CIS 487 - !- Professor Maxim - !- Interactive Fiction Game - !- Due 10-16-02 - !-------------------------------- !-------------------------------------------- ! Immortal Majesty - "Trails of the Emperors" ! Copyright 2002 by Craig Foucher ! Computer and Information Science ! University of Michigan - Dearborn !-------------------------------------------- !- The name of this game/story Constant Story "Immortal Majesty"; !- The headline of the game Constant Headline "^~Trials of the Emperors~^ Version 1.0^ By Craig Foucher (2002)^"; !- Max Score Constant MAX_SCORE 0; !- Global Variables Global PROTECTED = 0; Global ALTER_SET = 0; Global SHIELD_EQUIPPED = 0; !- Last compile date Serial "021014"; Release 1; !- Include libraries Include "Parser"; Include "VerbLib"; !- Extra attributes Attribute legible; !-------------------------------------------------- !- Initialise function !-------------------------------------------------- [ Initialise; location = Forest; ]; !-------------------------------------------------- !- Blackdagger Forest !This is the start of the game !-------------------------------------------------- Object Forest "Black Dagger Forest" with description "You are in the forest. It has been a long journey, but you feel you are near to your destination. You are headed to the ancient catacombs, the resting place of the Emperors of old. Legend says that a sword of power is hidden there and that he who finds the sword shall be worthy of the title ~Emperor.~ It has been centuries since your land, Eltane, has had an Emperor. The Empire is divided by power hungry rulers who wish only to exploit the people. You feel that it is time to rid your lands of this misfortune and seek out the sacred treasure of legends.^^You are in the Black Dagger Forest. You see a figure in the distance to the north.", n_to Northern_Forest, e_to Eastern_Forest, w_to Western_Forest, has light; !-------------------------------------------------- !- Northern Forest !This is where the statue of Prometheus is located. !-------------------------------------------------- Object Northern_Forest "North Forest" with description "You see a stone statue here.", w_to NW_Forest, e_to NE_Forest, s_to Forest, n_to Entrance_to_Catacombs, has light; !-------------------------------------------------- !- Statue of Prometheus !This is the statue that contains the black stone !-------------------------------------------------- Object -> Prometheus "Statue of Prometheus" with name "statue" "Prometheus", description "You stand before a statue of the Eltanian god Prometheus, the god of fire and demise. The statue holds a black stone in its hands.", has scenery static container open; !--------------------------------------------------- !- Black Stone !This stone is useless !--------------------------------------------------- Object -> -> black_stone "black stone" with name "black" "stone", description "This stone is as black as coal.",; !--------------------------------------------------- !-Eastern Forest !This is where the dagger is !--------------------------------------------------- Object Eastern_Forest "Eastern Forest" with description "You are in the eastern part of Black Dagger Forest. You see a figure in the distance, to the north", w_to Forest, n_to NE_Forest, has light; !-------------------------------------------------- !- Dagger !This is a rusty dagger. It is useless. !-------------------------------------------------- Object -> Dagger "dagger" with name "dagger", description "This is a crude looking dagger. It is rusty from being exposed to the elements.",; !-------------------------------------------------- !-Western Forest !This is where the tree limb is located. !--------------------------------------------------- Object Western_Forest "Western Forest" with description "You are in the western part of Black Dagger Forest. You see a fairly large spider web in a tree. You also see a figure in the distance, to the north.", e_to Forest, n_to NW_Forest, has light; !-------------------------------------------------- !- Tree Limb !This item is useless. !-------------------------------------------------- Object -> Tree_Limb "fallen tree limb" with name "tree" "limb", description "A fallen tree limb.",; !-------------------------------------------------- !- Spider Web !This is some nice scenery !-------------------------------------------------- Object -> Spider_Web "spider web" with name "spider" "web", description "An intricately constructed web. I would hate to meet the spider that made it though!", has scenery static; !-------------------------------------------------- !- North Eastern Forest !This is where the statue of Tyranous is located. !-------------------------------------------------- Object NE_Forest "North Eastern Forest" with description "You are in the north eastern part of Black Dagger Forest. There is a stone statue here.", s_to Eastern_Forest, w_to Northern_Forest, has light; !--------------------------------------------------- !- Tyranous !This is where the greenish blue marble rock is located. !--------------------------------------------------- Object -> Tyranous "statue of Tyranous" with name "statue" "Tyranous", description "This is a stone statue of the dreaded Tyranous. The most wicked Emperor in the history of Eltane. There is a rock in the right hand of the statue.", has scenery static container open; !-------------------------------------------------- !- Green Blue Marble Rock !This rock is needed in order to get the sword !-------------------------------------------------- Object -> -> greenish_blue_stone "greenish blue rock" with name "greenish" "blue" "rock", description "This piece of marble seems to pierce your mind as you gaze upon it's beauty. It is a perfectedly polished greenish blue rock.", before [; Insert: if (second == Alter_Hole) { move greenish_blue_stone to Alter; ALTER_SET = 1; print "The rock fits! The rock now glows with the same radiance as the sword!"; rtrue; }]; !-------------------------------------------------- !- Northwestern Forest !This is where the statue of Samoth is located. !-------------------------------------------------- Object NW_Forest "North Western Forest" with description "You are in the north western part of Black Dagger Forest. There is a stone statue here.", s_to Western_Forest, e_to Northern_Forest, has light; !-------------------------------------------------- !- Samoth !This is where the gold jewel is located. !-------------------------------------------------- Object -> Samoth "statue of Samoth" with name "statue" "Samoth", description "This is a stone statue of the great wizard Samoth. You have an eerie feeling that this statue is watching your every move. There is a jewel in the left hand of the statue.", has scenery static container open; !------------------------------------------------- !- Gold Jewel !This is the jewel that opens the entrance to the catacombs !------------------------------------------------- Object -> -> gold_stone "gold jewel" with name "gold" "jewel", description "This jewel glitters like gold. Such a jewel must be worth something!", before [; Insert: if (second==Dragon_Eye) { move gold_stone to Dragon_Eye; give Dragon_Eye ~open; give Entrance_Door ~locked; give Entrance_Door open; print "CLANK! The door opens! The gold jewel was the dragon eye and the key to the door!"; rtrue; }]; !-------------------------------------------------- !- Entrance to Catacombs !This is the entrance to the catatcombs !-------------------------------------------------- Object Entrance_to_Catacombs "Entrance to Catacombs" with description "At last! You have found the entrance to the ancient catacombs. This is the resting place of the Emperors of Eltane and the legendary sword of power.", n_to Entrance_Door, s_to Northern_Forest, in_to Entrance_Door, has light; !--------------------------------------------------------------- !- Entrance Door !--------------------------------------------------------------- Object Entrance_Door "Entrance Door" with name "Entrance" "Door", description "The entrance door to the catacombs is made of finely crafted gold. There is a golden dragon head mounted to the door. There is a whole where the dragon's left eye should be. An inscription is carved in the stone above the door. It's some form of ancient Etanian that you do not understand.", when_open "The entrance door is open.", when_closed "The entrance door is closed.", door_to [; if (location == Entrance_to_Catacombs) return Main_Chamber; return Entrance_to_Catacombs;], door_dir [; if (location == Entrance_to_Catacombs) return s_to; return n_to; ], found_in Entrance_to_Catacombs Main_Chamber, with_key gold_stone, has static door openable lockable locked supporter; !------------------------------------------------------------------ !- Dragon Head !A dragon head on the entrance door. !------------------------------------------------------------------- Object -> Dragon_Head "dragon head" with name "head", description "A finely crafted gold dragon head. It's missing an eye.", has scenery static supporter; !----------------------------------------------------------------- !- Dragon Eye !One of the dragon's eyes is missing. Put the gold jewel here to ! unlock the door. !----------------------------------------------------------------- Object -> -> Dragon_Eye "eye" with name "dragon" "eye", description "The dragon's eye.", has scenery static open openable container; !------------------------------------------------------------------ !- Main Chamber !First room you enter in the catacombs !------------------------------------------------------------------ Object Main_Chamber "Main Chamber" with description "The damp, musty, rotting smell of this room makes you want to vomit. It is very dark in here only a small amount of light intrudes into the chamber. As you enter you are startled to hear many voices whispering in your mind. They are saying, ~I am the Black Wizards. Their ancient spirit is me. I am the cosmic keys to creation and time. They unlock my essence. I am the Emperors of old. Their ancient wisdom guides me. Who so ever endures these trials, shall become me.~", s_to Entrance_Door, w_to Crypt_of_the_Black_Wizards, e_to Crypt_of_the_Emperors, n_to Crypt_Door, has light; !------------------------------------------------------------------- ! Crypt of the Black Wizards !This room contains both useless and usefull items. ! Scepter, three books, scroll !------------------------------------------------------------------- Object Crypt_of_the_Black_Wizards "Crypt of the Black Wizards" with description "This is the burial place of the Black Wizards. As the keepers of the sacred magic of Eltane, they were the first in command to the Emperor. This elite sect of magi are thought to be no longer in existance. You feel the spirits of the Black Wizards gazing upon you, watching your every move. ^^There is a shelf carved into the north wall containing many mage corpses.", e_to Main_Chamber, has light; !------------------------------------------------------------------ !- Black Book !------------------------------------------------------------------ Object -> Black_Book "black book" with name "black" "book", description "The book is entitled ~Prophecies of Mortiis~", before [; Consult, Read: print "~Prophecies of Mortiis~^It reads, ~I have seen a vision of things to come. There shall come a plague upon the land. Though not a plague of disease or famine, yet one of chaos and war. The Empire will fall by the hands of many. Many are the hands of our own. Time will destroy us all.~"; rtrue;], has legible; !------------------------------------------------------------------ !- Red Book !------------------------------------------------------------------ Object -> Red_Book "red book" with name "red" "book", description "The book is entitled ~Prophcies of Ihsan.~", before [; Consult, Read: print "~Prophecies of Ihsan~^I have seen a vision of things to come. There shall be much chaos and war. The Empire shall rot for centuries, until the chosen one arrives to take his place in destiny. He who is born with the spirit of the emperors and the essence of the wizards shall wield the sword of power and return the Empire to glory."; rtrue;], has legible; !------------------------------------------------------------------ !- Green Book !------------------------------------------------------------------ Object -> Green_Book "green book" with name "green" "book", description "This book looks like it will turn to dust at any moment. The title is written in an ancient form of Eltanian which you can not read.", before [; Consult, Read, Take: print "You do not want to disturb the book for fear that it will crumble to the touch."; rtrue;], has static; !------------------------------------------------------------------ !- Scepter ! This item is a trap. Player dies if they try to take it. !------------------------------------------------------------------ Object -> Scepter "scepter" with name "scepter", description "A hideous looking scepter. It has a ruby fused to the top. The shaft has entwined snakes sculpted in it.", before [; Take: deadflag = 1; print "As you take the scepter bolts of energy eminate from the floor, electricuting you and killing you in a matter of seconds! Even in death, the Black Wizards will not easily part with their most precious possession."; rtrue;]; !------------------------------------------------------------------ !- Corpses ! This is a shelf of corpses where the corpse holding a scroll is ! located. !------------------------------------------------------------------ Object -> Shelf_of_Mage_Corpses "shelf of mage corpses" with name "shelf" "corpses", description "The corpses of the Black Wizards of Eltane are laid to rest here, though you feel that the spirits of these corpses are not very restfull. One of the corpses appears to be clasping on to a leather scroll.", has scenery static supporter; Object -> -> Corpse_Holding_Scroll "corpse holding a scroll" with name "mage" "corpse", description "This corpse took a scroll with him to the grave.", has scenery static container open; !------------------------------------------------------------------- !- Scroll ! This is a scroll of magic protection. You need to read this in ! order to take the sword. !------------------------------------------------------------------- Object -> -> -> Scroll "scroll" with name "scroll", description "The scroll is made of leather.", before [; Consult, Read: remove Scroll; PROTECTED = 1; "The scroll contains a spell of magic protection. It reads ~Bevilg meg kraften passere.~ Poof! The scroll disappears. You are now protected from magic spells!"; Tear: move Scroll to Corpse_Holding_Scroll; "As you try to tear the scroll, it disappears from your hands. Apparently, that was not a good idea!"; ] has legible; !------------------------------------------------------------------ !- Crypt of the Emperors ! This is where the key to the crypt door is located and also a ! shield and some armor. The shield is needed to get to a secret ! chamber. !------------------------------------------------------------------ Object Crypt_of_the_Emperors "Crypt of the Emperors" with description "This is the resting place of the great emperors of Eltane. You are humbled to be in the presence of such ancient wisdom and nobility.", w_to Main_Chamber, has light; !------------------------------------------------------------------ !- Hauberk ! You can wear it, but it's useless. !------------------------------------------------------------------ Object -> Hauberk "chain mail hauberk" with name "hauberk", description "It's a chain mail hauberk. This suit of armor is made of a gold metal.", before [; Take: print "You pick up the armor surprised at how light it is.^"; rfalse; PutOn, Wear: print "You put the armor on."; rtrue;], has worn; !------------------------------------------------------------------ !- Shield ! You need this item to gain entrance to the secret chamber. !------------------------------------------------------------------ Object -> Shield "shield" with name "shield", description "The shield looks very sturdy. It has the royal symbol of Eltane engraved on it.", before [; PutOn, Wear: print "You put the shield on."; SHIELD_EQUIPPED = 1; rtrue;], has worn; !------------------------------------------------------------------- !- Torch ! Open the torch, there is a key inside! !------------------------------------------------------------------- Object -> Torch "torch" with name "torch", description "The torch is very old. You're not even sure if it works anymore. As you look at it closer you notice that it is hinged at the top. You find this extremely odd and curious.", when_open "There is a torch on the north wall here.", when_closed "There is a torch on the north wall here.", has static container openable; Object -> -> ancient_key "ancient key" with name "ancient" "key", description "The key is very ancient. It was crafted of a very fine silver, but has since been tarnished by the heat and flame of the torch. You notice an inscription on the key. It reads ~Jeg er Keiser Eltane for all tid.~",; !------------------------------------------------------------------ !- Crypt of Tyranous ! This is the crypt of Tyranous. There is a throne that moves here. !------------------------------------------------------------------ Object Crypt_of_Tyranous "Crypt of Tyranous" with description "An eerie reddish dim light fills this room, but from where you cannot tell. Thousands of human bones line the floor, walls, and ceiling of this crypt. You realize that you are in the legendary resting place of the dreaded Tyranous. The most evil and merciless emperor in all of Eltane's history. You are startled by the sight of this crypt. Tyranous' evil corpse sits on a throne against the north wall.", s_to Crypt_Door, n_to Throne, has light; !------------------------------------------------------------------ !- Crypt Door ! Door to Tyranous' crypt. It needs a key. !------------------------------------------------------------------ Object Crypt_Door "crypt door" with name "crypt" "door", description "The door seems to lead to a very ancient crypt. You can tell by the very ancient symbols that line the door. You experience Deja Vu as if you've seen this door in a dream or a history book or something, but you can't quite place where.", when_open "You have opened door to the crypt.", when_closed "The door to the crypt is closed.", door_to [; if (location == Main_Chamber) return Crypt_of_Tyranous; return Main_Chamber;], door_dir [; if (location == Main_Chamber) return s_to; return n_to; ], found_in Main_Chamber Crypt_of_Tyranous, with_key ancient_key, has static door openable lockable locked; !------------------------------------------------------------------ !- Throne ! The throne moves. Try 'pull' or 'push.' !------------------------------------------------------------------ Object Throne "throne" with name "throne", description "This is the throne of the dreaded Tyranous. His decayed corpse glares at you with empty eyes.", door_to [; if (location == Crypt_of_Tyranous) return Secret_Chamber; return Crypt_of_Tyranous;], door_dir [; if (location == Crypt_of_Tyranous) return s_to; return n_to;], found_in Crypt_of_Tyranous Secret_Chamber, before [; Push, Pull: if (SHIELD_EQUIPPED == 0) { deadflag = 1; print "As you try to move the throne Tyranous' corpse spews forth a fireball at you, killing you instantly."; rtrue; } else { give Throne ~locked; give Throne open; print "Tyranous' corpse spews forth a fireball at you. You quickly use your shield to protect yourself. The corpse must have been magically enchanted to prevent intruders from entering. The throne moves revealing a secret passage to the north."; rtrue; }], has scenery static door openable locked; !------------------------------------------------------------------ !- Secret Chamber ! This secret chamber contains the sword. !------------------------------------------------------------------ Object Secret_Chamber "Secret Chamber" with description "Behind the throne of Tyranous you find a secret chamber! This chamber is lit by a radiant greenish blue light that eminates from an alter in the center of the room.", s_to Throne, has light; !----------------------------------------------------------------- !- Alter ! Alter that holds the sword. There is a hole in it that you must ! put the greenish blue rock in, in order to get the sword. ! Otherwise you die. !----------------------------------------------------------------- Object -> Alter "alter" with name "alter", description "This is a marble alter. A beautiful sword is mounted to it. The alter seems to have been constructed for this sole purpose. There is a small hole in the front face of the alter.", has scenery static supporter; !----------------------------------------------------------------- !- Alter Hole ! Put the rock in this hole. !----------------------------------------------------------------- Object -> -> Alter_Hole "hole" with name "hole", description "The hole is about the size of your fist.", has scenery static container open; !------------------------------------------------------------------ !- The Sword of Eltane ! You must read the scroll and put the rock in the alter before ! you take this item. Otherwise you die. If you get this item, ! you win the game. !------------------------------------------------------------------ Object -> -> Sword_of_Eltane "sword" with name "sword", description "This is the legendary Sword of Eltane. It radiates an awesome greenish-blue light. It is mounted on a small alter. The alter has a small round hole in it, as if something used to be mounted there.", before [; Take: if (PROTECTED == 0 || ALTER_SET == 0) { deadflag = 1; print "As you touch the sword it kills you instantly with a powerful magical energy."; rtrue; } else { print "You have the legendary Sword of Eltane! With this sacred treasure you are destined to bring peace to Eltane. You take the sword back to your lands and become the new Emperor.^^GAME OVER^^"; quit; }],; !------------------------------------------------------------------- !- Functions !------------------------------------------------------------------- [ ReadSub; <>; ]; [ TearSub; <>; ]; !------------------------------------------------------------------ !- Grammar !------------------------------------------------------------------ Include "Grammar"; Extend "read" first * legible -> Read; Verb "tear" * noun -> Tear;