!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!                                     !
!  STARTER3 (A basis for an IF work)  !
!                                     !
!  starter3.inf                       !
!                                     !
!  Prepared by Nick Montfort          !
!  First version written 5 May 2002   !
!                      -19 Dec 2005   !
!                                     !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Constant Story "ZOMBIE APOCALYPSE";
Constant Headline "^By YOUR NAME HERE^";

Constant DEBUG;
Constant DIALECT_US;
Release 0;

Constant TASKS_PROVIDED;
Constant NUMBER_TASKS = 3;
Constant MAX_SCORE = 3;
Array task_scores -> 1 1 1;

Include "Parser";

[ PrintTaskName achievement;
  switch(achievement)
  {
    0: "Picking up the gun.";
    1: "Getting some money.";
    2: "Purchasing the gun.";
  }
];

! --------------------------------------------------------------------------

Object  Store "Store"
 has    light
 with   description "The pub smells of beer and rotting meat.
          There is a zombie and an exit to the northwest.",
        nw_to
          [;
          <<Exit>>;
          ],
        out_to
          [;
          if (Gun in Player) 
            {
            if (Gun hasnt general) 
              {
                deadflag=3;
                "You sneak furtively out, attempting firearm 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 and cheat death.";
              }
            }
            else PlayerTo(Street);
            rtrue;
          ];

Object -> MainCharacter "main character"
  has animate concealed transparent proper,
  with description "Yes -- it's you all right.",
  number 0;

Object -> "zombie"
  has scenery,
  with name "zombie",
       description "It's just a zombie, like the usually have in
         movies. 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 shiny gun)
             just say so. Otherwise there's no point in messing with the
             zombie.";
         ];

Object -> Gun "gun"
 with   name "object" "gun",
        description "The gun is a Remington 870 twelve gauge shotgun.",
        before
          [;
            Buy:
              if (Gun has general)
                {
                "But you've already bought the gun!";
                }
              if (Bill notin Player)
                {
                "But you have insufficent funds!";
                }
              give Gun general;
              remove Bill;
              move Gun to Player; 
              Achieved(2);
              "You exchange your money for ownership of the gun.
              Mmmm. You turn to the zombie. Bang! Brains on wall";
          ], 
        after
          [;
          Take:
            Achieved(0);
            "Ah, the shotgun that you so need. You lift it carefully
            into your possession and rack it once.";
          ];

Object  Street "Street"
 has    light
 with   description "The street is desolate, with a pub
          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. You hear groans outside.",
        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 gun
                  you've had your eye on.^^";
                } 
          ];

! --------------------------------------------------------------------------

[ Initialise x;
  print "^America, why are your streets full of dead people?^^";
  @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] ...^";
];
