!John Gaffrey !CIS 487 !Assignment 3: Interactive Fiction Constant Story "Lost Space Colony: Infestation"; Constant Headline "^by: John Gaffrey^October 2006^CIS 487^"; !Constant DEBUG; Include "parser"; Include "verblib"; !---------------------------------------------------- ! Start Initialize !---------------------------------------------------- [ Initialise; location = Living_Quarters; print"^^^You awake quite groggy and disheveled. You look around in utter shock as the living quarters are torn apart. You cannot quite remember what has happened nor how to exactly ended up here. You also wonder where all your other fellow scientists and the soldiers that are suppose to protect are. You look over yourself and notice you still have your lab coat on, so maybe you should check the lab where you probably were last. There is only a eerie quiet, with intermittent soft echos coming from somewhere... ^^^"; ]; [DeathMessage; print "You have died, now no one will learn what has happened here."; ]; global player_life = 3; global laser_rifle_energy = 0; global scarab_life = true; global scarab_small_life = true; global mantis_near_fuel = false; !----------------------------------------------------- ! Grammar !----------------------------------------------------- Include "grammar"; verb 'use' 'lay' * noun -> use; verb 'shoot' * noun -> attack; [useSub; "There is nothing you can use."; ]; !---------------------------------------------------- ! the rooms !---------------------------------------------------- Object Living_Quarters "Living Quarters" with description "Beds and cabinets are are in disarray, either upside down or broken apart. Various pieces of gear are also littered across the floor and broken. A door to the north labeled 'Mess Hall' is also heavily dented and gently swinging back and forth. Surprisingly the lights still work.", n_to Mess_Hall, has light; Object Mess_Hall "Mess Hall" with description "Long meeting tables are torn apart and turned over. Viewing Screens and other recreational objects are shattered and sparking with loose wires. There is also some kind of low chirping sound from the western rooms of the Head Quarters. Large and long flat tables also lay about. You remember the labs are to the east. And there is only darkness coming from the large doorway which leads to the northern halls as well as a shilling wind Surprisingly the lights still work.", before[; if(noun == w_to && key_card notin player) "You notice a card scanner next to the door, it must take a card key."; ], n_to South_Hall, e_to Lab, w_to Head_Quarters, s_to Living_Quarters, has light; Object South_Hall "South Hall" with description "Mostly darkness covers this long hall. The lighting up above flickers and sparks. As your eyes adjust you notice holes all over the metal floors, walls and ceiling. There also seems to be some sort of low screeching up ahead", n_to North_Hall, s_to Mess_Hall, has light; Object North_Hall "North Hall" with description "Moving forward you nearly fall into a huge hole in the floor. Stepping back aghast, you notice the entire floor is covered in large holes and you cannot pass unless you think of something. Pass the holes in the floor you see the door to the armory, and the sound which seems like metal being slowly stripped apart.", before[; if(noun== n_to && holes in North_Hall) "You cannot pass beyond the large gaping holes in the floor"; ], n_to Armory, s_to South_Hall, has light; Object Armory "Armory" with description "Numerous weapon and ammo containers are empty and thrown about. There is some sort of notice posted next to you. More holes appear everywhere. The northern wall is completely gone, with some sort of dark gaping hole beyond it", s_to North_Hall, has light; Object Lab "Lab" with description "Lights flicker everywhere. Large glass containers that held large fossils of insect-like creatures are shattered, with the fossils broken and lying about. There is also a desk with some important looking items.", w_to Mess_Hall, has light; Object Head_Quarters "Head Quarters" with description[; if(flame_thrower notin player) "You slide the key card through the scanner and enter. Control panels are torn apart. Loose wires give off sparks and the Lights are flickering. You cannot see much else however"; if(scarab_small_life == false) "From the flames caused by the flame thrower, you can now see that the passage to the air docks is cleared."; ], before[; if(noun == e_to && key_card notin player) "You notice a card scanner next to the door, it must take a card key."; if(noun == n_to && scarab_small_life == true) "You cannot get through all the tiny metallic scarabs."; ], e_to Mess_Hall, n_to Air_Dock, has light; Object Air_Dock "Air Dock Supply" with description "Everything is calm upon entry. Forklifts as well as barrels of fuel lie around. Moving forward you begin to hear hissing from above. Thats when you notice a hole in the ceiling up ahead, and all your fellow colonists laying around killed by something horrible, you are the last survivor.... A horrifying 8 foot bipedal mantis creature falls from a large gaping hole in the ceiling up ahard...", s_to Head_Quarters has light; !----------------------------------------------------------------- ! Objects Weapons Aliens !----------------------------------------------------------------- Object laser_rifle "laser rifle" Living_Quarters with name "laser" "rifle" "gun" "weapon", initial "A lone laser rifle is leaning up against the wall", description "One of the soldiers rifles. Its energy level is low.", before[; take: if((key_card in player && children(player) == 2) || (key_card notin player && children(player) == 1)) "It is too hard for you to carry more than one weapon."; ]; Object table "table top" Mess_hall with name "table" "top" "tables", description "This table top is still intact and sturdy", before[; take: if((key_card in player && children(player) == 2) || (key_card notin player && children(player) == 1)) "This table top is too heavy for you to be carrying much of anything else."; use: if(player in North_Hall && table in player) { remove holes; remove table; "placing the table top across the large holes, you can safely pass."; } ]; Object holes "holes" North_Hall has concealed static with name "hole" "ground" "holes" "tunnel" "tunnels", description "What a horrible thing to fall into one of those holes"; Object key_card "key card" with name "key" "card", description "This shiny key card has the label: Head Quarters", before[; use: if(player in Mess_Hall || player in Head_Quarters) "you slip the card through the scanner and the door slides open."; ]; Object mining_laser "mining laser" with name "mining" "laser" "cannon" "weapon" "gun", description "This large cannon-like laser sure looks strong", before[; take: if((key_card in player && children(player) == 2) || (key_card notin player && children(player) == 1)) "It is too hard for you to carry more than one weapon."; ]; Object lab_desk "lab desk" Lab has static supporter concealed enterable with name "desk", description "The sturdy looking desk has some urgent looking papers on it.", before[; examine: if(self hasnt general){ give self general; move key_card to player; "You have found a card key with the label HQ, and some other urgent papers"; } ]; Object glass_case "glass case" Lab has concealed static with name "glass" "case" "tube" "window", description "The glass case up high is holding some sort of weapon.", before[; attack: if(player notin lab_desk) "The glass case is too high up."; if(sledge_hammer notin player) "The glass is too hard for you to break."; move mining_laser to Lab; "The glass breaks and a weapon falls to the ground."; ]; Object sledge_hammer "sledge hammer" Lab with name "hammer" "sledge" "blunt" "weapon", initial "A lone sledge hammer is leaning against the wall.", description "This looks like it could break something.", before[; take: if((key_card in player && children(player) == 2) || (key_card notin player && children(player) == 1)) "It is too hard for you to carry more than one weapon."; ]; Object urgent_papers "urgent papers" Lab has concealed static with name "papers" "urgent" "report" "notes" "book", description "There are a number of hastily written notes in poor handwriting. The notes mention that the mining laser up above in the glass case is the only thing thats been effective on those large beetle-types which first tunneled into the complex. Everyone is going to hold up in the air dock to await help... The people injured from the initial explosion will have to be left in the living quarters......", before[; take: "There are too many papers to take."; ]; Object scarab "scarab alien" Armory has static with name "scarab" "beetle" "alien" "monster" "insect" "bug", initial[; if(scarab_life == true) "A gigantic scarab-like silvery creature is munching away at the armory room"; if(scarab_life == false) "Pieces of the scarab are splattered everywhere, and a powerful stench fills the armory."; ], description [; if(scarab_life == true) "The huge beetle-like creature resembles a scarab, and is quite shiny and silvery almost like metal. This must have created the holes and caused the explosions."; if(scarab_life == false) "The scarab is already dead, and theres quite a mess and smell."; ], before[; attack: if(mining_laser in player&& scarab_life == true) { move flame_thrower to Armory; remove mining_laser; scarab_life = false; "You turn on the mining laser cannon, as it charges up, the scarab notices you and begins to charge you. Just in time its charged and sends a beam of high energy into the scarab blasting it into the wall and smashing it apart. The mining laser is out of energy so you toss it aside. You then notice some sort of weapon is revealed near where the scarab was"; } if(mining_laser notin player && scarab_life == true) { if(player_life == 1) deadflag = 3; player_life = player_life - 1; if(sledge_hammer in player) "Your sledge hammer bounces off the scarab's metallic carapace. Angered it charges you, knocking you against the wall hurting you quite badly."; if(laser_rifle in player && laser_rifle_energy > 0) { laser_rifle_energy = laser_rifle_energy - 1; "Your laser shots bounce off the scarab's metallic carapace. Angered it charges you, knocking you against the wall hurting you quite badly."; } if(laser_rifle_energy <= 0) "Your laser rifle is out of energy"; "You charge the scarab with your bare hands. Angered it charges you, knocking you against the wall hurting you quite badly."; } "Why would you want to get near the mess and smell?"; ]; Object flame_thrower "flame thrower" with name "flame" "thrower" "torch" "weapon" "gun", description "This flame thrower looks like it can sure do alot of damage.", before[; take: if((key_card in player && children(player) == 2) || (key_card notin player && children(player) == 1)) "It is too hard for you to carry more than one weapon."; ]; Object scarab_small "small scarabs" Head_Quarters has static with name "small" "beetles" "swarm" "scarabs" "beetle" "aliens" "insects" "bugs" "babies" "baby" "swarm", initial[; if(scarab_small_life == true && flame_thrower notin player) "you can hear something crawling all over the room, better find some light."; if(scarab_small_life == true && flame_thrower in player) "A swarm of foot size scarabs like the one in the armory swarm the doorway to the air dock"; if(scarab_small_life == false) "The small scarabs are still burning and litter the entire room."; ], description[; if(scarab_small_life == true && flame_thrower in player) "many small versions of that big scarab are swarming the door to the air docks..."; if(scarab_small_life == true && flame_thrower notin player) "looking closer, you can see a swarm of tiny metallic scarabs covering the door to the air dock"; if(scarab_small_life == false) "all the small scarabs litter the Head Quarters and are still burning."; ], before[; attack: if(flame_thrower in player && scarab_small_life == true) { remove flame_thrower; scarab_small_life = false; "You blast the swarm of tiny scarabs with the flame thrower. A loud shrill fills the room as the scarabs scamper around and burn away"; } if(flame_thrower notin player && scarab_small_life == true) { if(player_life == 1) deadflag = 3; player_life = player_life - 1; if(sledge_hammer in player) "You attempt to swing the sledge hammer into the tiny metallic scarabs. Angered, they swarm you biting you all over before returning to the door."; if(laser_rifle in player && laser_rifle_energy > 0) { laser_rifle_energy = laser_rifle_energy - 1; "You blast the tiny metallic scarabs with your laser rifle. Angered, they swarm you biting you all over before returning to the door."; } if(mining_laser in player) "You attempt to charge the mining laser. Angered, they swarm you biting you all over before returning to the door."; if(laser_rifle_energy <= 0) "Your laser rifle is out of energy"; "You try to pull the tiny metallic scarabs away with your bare hands. Angered, they swarm you biting you all over before returning to the door."; } "Don't waste your time with the tiny burning scarabs?"; ]; Object mantis "mantis alien" Air_Dock has static with name "mantis" "alien" "monster" "creature" "bug" "insect", initial[; mantis_near_fuel = false; switch(random(3)) { 1: "A horrifying mantis creature is crawling along the ceiling."; 2: "A horrifying mantis is slowly circling you waiting to pounce."; 3: mantis_near_fuel = true; "A horrifying mantis is directly above some fuel canisters."; } ], description[; mantis_near_fuel = false; switch(random(3)) { 1: "A horrifying mantis creature is crawling along the ceiling."; 2: "A horrifying mantis is slowly circling you waiting to pounce."; 3: mantis_near_fuel = true; "A horrifying mantis is directly above some fuel canisters."; } ], before[; attack: if(player_life == 1) deadflag = 3; player_life = player_life - 1; "Before even beginning your attack, the mantis senses what is coming and dives towards you and slashes you with a swipe of its claw arm."; ]; Object fuel_can "fuel canister" Air_Dock has static concealed with name "cans" "can" "fuel" "gas" "canister" "barrels" "barrel", description "A group of fuel cans stand against the wall...", before[; attack: if(laser_rifle in player) { if(laser_rifle_energy == 0 && laser_rifle in player) "Your rifle is out of energy."; if(mantis_near_fuel == false && laser_rifle in player) "You sense that its not the right time to waste your ammo on that."; "The mantis senses what your doing, and begins to run away from the fuel. With careful aim, you blast the fuel cans, creating an explosion that engulfs the mantis. The path is clear to the docking bay, you can now warn others what has happened here.", deadflag = 2; } "Why would you want to blow up the cans while you stand next to them?"; ]; Object ammo "laser rifle ammo" South_Hall has concealed with name "ammo" "energy", description "some laser rifle ammo/energy is scattered around in the corner", before[; take: if(laser_rifle notin player) "You have no use for this now"; laser_rifle_energy = 2; "you have re-energized your laser rifle, with only 2 shots...."; ]; Object ammo_notice "ammo notice" Armory has static concealed with name "paper" "papers" "notice" "notes" "note" "report", description "In our haste to quickly supply the Head Quarters defense, some ammo I fear was dropped in the South Hall..... Something is coming through the wal....";