! Copyright (C) 2021 Jason Self ! ! This file is free software: you may copy, redistribute and/or ! modify it under the terms of the GNU Affero General Public License ! as published by the Free Software Foundation, either version 3 of ! the License, or (at your option) any later version. ! ! This file is distributed in the hope that it will be useful, but ! WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! Affero General Public License for more details. ! ! You should have received a copy of the GNU Affero General Public ! License along with this file. If not, see https://gnu.org/licenses/ Constant DEATH_MENTION_UNDO; Constant Story "Snowed In"; Constant Headline "^A work of interactive fiction. ^If you get stuck try typing HELP. ^Ongoing development: https://jxself.org/git/?p=snowed-in.git ^Send bugs and feedback by email to j@@64jxself.org. ^IFID DE9FA2E5-4EC7-4166-9218-E56EFA1DF40F ^Copyright (C) 2021 Jason Self ^You can change and share this game under the terms of the GNU Affero General Public License as published by the Free Software Foundation (FSF), either version 3 of the License, or (at your option) any later version published by the FSF. See the GNU Affero General Public License for more details.^^You should have received a copy of this game's source code along with a copy of the GNU Affero General Public License so that you can know your rights. If not, contact the place you got it from.^^"; Include "parser"; Include "verblib"; Release 0; Serial "210401"; Object mainroom "Main Room" with description "This room is a total wreck - it looks like a major fight happened in here. There's a ripped up sofa and a broken old coffee table in the middle of the room. A flat-screen TV is mounted against the wall, with the screen dangling out. Tis cabin has three other rooms. There's an office area with a desk and computer to the east. There's a bedroom to the north and a kitchenette to the west. There's a doorway in the south wall leading outside.", e_to office, has light; Object sofa "sofa" mainroom with name 'sofa' 'couch', with description "The sofa is in poor shape. The upholstery is ripped and there are several holes in it.", before [; Take, Pull, Push, PushDir, Turn: print_ret (The) self, " is too heavy for that."; ], has scenery supporter enterable; Object coffeetable "coffee table" mainroom with name 'coffee' 'table', with description "The old coffee table looks as if it's had quite a bit of use. There are burn marks covering it and the paint is worn off in most places.", before [; Take, Pull, Push, PushDir, Turn: print_ret (The) self, " is too heavy for that."; ], has scenery supporter enterable; Object television "flat-screen TV" mainroom with name 'TV' 'television' 'flat' 'screen' 'flat-screen', with description "The flat-screen TV looks fairly modern but it's been broken in a fight and the screen is dangling out.", before [; Take, Pull, Push, PushDir, Turn: print_ret (The) self, " is firmly mounted to the wall."; SwitchOn: if (television hasnt visited) { print "Despite the significant damage, the television comes to life in one last valiant attempt to be useful. Your favorite news program is on: U.S. News And Grue Report. The news anchor is giving a warning of Grue sightings in the area of the forest before the television finally dies.^"; give television visited; } else { print "The flat-screen TV is broken and can't be turned on.^"; } return true; ], has scenery switchable; Object lightsocket "light socket" mainroom with name 'light' 'socket' 'lightsocket', before [; Take, Pull, Push, PushDir, Turn: print_ret "You don't have the tools to remove a light socket."; Receive: if (noun ~= lightbulb) { print "Put "; print (a) noun; print_ret " into the light socket? Maybe you should come with a warning label because you contain more than a trace amount of nut."; } if (noun == lightbulb) { give mainroom light; give office light; } ], has scenery container transparent open; Object lightbulb "light bulb" lightsocket with name 'light' 'bulb' 'lightbulb', after [; Take, Pull, Push, PushDir, Turn: give mainroom ~light; give office ~light; ]; Object office "Office" with description "There seems to have been quite a fight in here. The room is a wreck. Holes are in the walls and the windows are broken, letting in the cold air from outside. Chunks of drywall and insulation cover the floor. The desk has a bullet hole through the middle.", w_to mainroom, has light; Object desk "solid oak desk" office with name 'solid' 'oak' 'desk', with description "The desk is old and made of solid oak. The right side of it has been smashed and all of the drawers have been removed. A bullet hole goes straight through the middle of the desk.", before [; Take, Pull, Push, PushDir, Turn: print_ret (The) self, " is too heavy for that."; ], has scenery supporter enterable; Object businesscard "business card" desk with name 'business' 'card', with description "The business card is white and has blacked edges. It bears the name ~Lasting Solutions~, a local data recovery company, in bold letters on the top. The company's website URL is printed in blue at the bottom."; Object salesreceipt "sales receipt" desk with name 'sales' 'receipt', with description "The sales receipt is for $200, dated three years ago. It's printed on old tractor feed printer paper and bears the name ~Lasting Solutions~, a local data recovery company. A handwritten note is scrawled on the bottom: ~Start working on these hard drives soon.~"; Object computer "computer" desk with name 'computer' 'PC', with description "It's a heavy older model that appears to have been seriously damaged in a fight. It's clearly on its last legs but is perhaps still useful.", before [; Take, Pull, Push, PushDir, Turn: print_ret (The) self, " is too heavy for that."; SwitchOn: if (computer hasnt visited) { print "The computer makes some concerning noises while lights on the front also illuminate. The last file is quickly displayed. ~If anyone else reads this, you're in serious danger. I've been fighting a ferocious grue for the last three days. I'm almost out of supplies and can't last much longer. I'm going to take the last of the supplies and escape through the office window in a last-ditch effort to get away and get back into town. I hope I can make it.~ The computer then makes a sickly sound and finally dies as some smoke comes out of it.^"; give computer visited; } else { print "The display briefly flickers but nothing else happens.^"; } return true; ], has switchable; [ Initialise; Location = mainroom; thedark.description = "It is pitch black. You are likely to be eaten by a grue."; print "You're trapped in a snowstorm while visiting the forest during your vacation to a small rural town. This is the worst snowstorm in more than 40 years. If only you has listened to the news. Well, it's too late for that. The snow has been falling for the past seven hours and shows no signs of stopping anytime soon. You need to get back to your hotel in the town. You finally manage to find an old cabin in the woods and get inside but have no idea where you are. You're not dressed for this weather.^"; ]; [ InScope; if (location == thedark && real_location == mainroom) { PlaceInScope(lightsocket); } return false; ]; Object grue "grue" thedark with article "the", name 'grue' 'monster', each_turn [; StartDaemon(self); ], turns_active, daemon [; if (location ~= thedark) { self.turns_active = 0; StopDaemon(self); rtrue; } switch (++(self.turns_active)) { 1: "^You hear horrible gurgling sounds in the dark."; 2: "^You hear the clink of razor-sharp claws nearby."; 3: deadflag = true; "^Your last memory is of the slavering fangs of the horrible Grue as it claims you for a meal."; } ], has scenery; [ DarkToDark; deadflag = 1; "Oh, no! You have walked into the slavering fangs of a lurking grue!"; ]; [ URL; print "^If you need help try some of the commands from: ^http://pr-if.org/doc/play-if-card/^"; ]; [ XyzzySub; print "Nothing obvious happens.^"; return true; ]; [ HelpSub; URL(); return true; ]; Include "grammar"; Verb 'About' * -> Version; Verb 'Info' * -> Version; Verb 'Help' * -> Help; Verb 'Clue' * -> Help; Verb 'Hint' * -> Help; Verb 'xyzzy' * -> Xyzzy;