!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! ! STARTER1 (A basis for an IF work) ! ! ! ! starter1.inf ! ! ! ! Prepared by Nick Montfort ! ! First version written 5 May 2002 ! ! -19 Dec 2005 ! ! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Constant Story "Our Awesome Thing That Doesn't Actually Involve Jumping"; Constant Headline "^By Xiaochang and Josh with help from Ginsburg and Burroughs^"; Constant DEBUG; Constant DIALECT_US; Release 0; Constant TASKS_PROVIDED; Constant NUMBER_TASKS = 3; Constant MAX_SCORE = 3; Global jumpflag = 0; Array task_scores -> 1 1 1; Include "Parser"; [ PrintTaskName achievement; switch(achievement) { 0: "Picking up the widget."; 1: "Getting some money."; 2: "Purchasing the widget."; } ]; ! -------------------------------------------------------------------------- Object Store "Store" has light with description "A pleasing array of consumer goods eases your mind. There is a cash register and an exit to the northwest.", nw_to [; <>; ], out_to [; if (Widget in Player) { if (Widget hasnt general) { deadflag=3; "You sneak furtively out, attempting widget theft. Sirens wail and you are taken down by K-cops. How unfortunate. Perhaps you can be rehabilitited. That's the purpose of our criminal justice system, isn't it?"; } else { deadflag=2; "You walk humming and happy into the street. You have learned to love life."; } } else PlayerTo(Street); rtrue; ], before [; Tell: if ("my good looks") { jumpflag = 1; Achieved(2); "You went into a store and bought what you needed with your good looks."; } ]; Object -> MainCharacter "main character" has animate concealed transparent proper, with description "Yes -- it's you all right.", number 0; Object -> "cash register" has scenery talkable, with name "register" "cash", description "It's just a cash register, like the usually have in stores. The shocking thing would be if they didn't have one here.", before [; Take: "Our culture does not look kindly upon hoisting such things about."; Examine: rfalse; default: "If you want to buy something (like that delicious widget) just say so. Otherwise there's no point in messing with the cash register."; ]; Object -> Widget "widget" with name "object" "widget", description "The widget is the object of your desire.", before [; Buy: if (Widget has general) { "But you've already bought the widget!"; } if (Bill notin Player) { "the register says 'buy it with what?'"; } give Widget general; remove Bill; move Widget to Player; Achieved(2); "You exchange your money for ownership of the widget. Mmmm."; ], after [; Take: Achieved(0); "Ah, the widget that so compels you. You lift it carefully into your possession."; ]; Object Street "Street" has light with description "The street is bustling and desolate, with a store entrance to the south. Your office is up in that building to the north.", s_to Store, in_to Store, n_to Office, u_to Office; Object Office "Office" has light with description "Cubicle sweet cubicle, with its single drawer. Here you are. Home again home again.", d_to Street, s_to Street, e_to Street, out_to Street; Object -> Drawer "drawer" has container openable ~open, with name "single" "drawer", description "After only working here six months you earned a cubicle with a drawer. That's four years in Web-years."; Object -> -> Bill "twenty-dollar bill" with name "twenty" "dollar" "bill", description "Have you forgotten what they look like for some reason? You know. It's what the robot tellers dispense.", before [; Take: if (self hasnt general) { give self general; Achieved(1); print "Yay! It's just enough money to buy that widget you've had your eye on.^^"; } ]; ! -------------------------------------------------------------------------- [ Initialise x; print "^America, why are your libraries full of tears?^^"; @read_char 1 0 0 x; lookmode=2; ChangePlayer(MainCharacter); ]; [ DeathMessage; if (deadflag == 3) { print "You have lost"; } ]; Include "VerbLib"; Include "Grammar"; Verb meta 'about' * -> About; [ AboutSub; print "This work of interactive fiction was ... [built with Nick's starter file! You can add the details of the class where you created this, an author's note, etc. here] ...^"; ];