help with killing zombies

so i want to have a zombie in the zombie lair.

attack zombie with knife yeilds a failure message of some kind, such that zombies are immune to knives.

if you attack with candlesticks it is a success and the zombie is killed.

halp? please?

There are several ways you could do this… if it’s a simple matter of knives and candlesticks only, and you just want the player to type “kill zombie”, you could get away with some instead statements.

Note: I’m a newbie myself so others might have better advice.

A person can be alive or dead. People are usually alive.

Instead of doing something to a person when the person is dead:
  say "He doesn't respond."

Instead of attacking the zombie when the player is not carrying the knives and the player is not carrying the candlesticks:
  Say "Attacking the zombie with your bare hands would be futile." [assuming there aren't some other weapon-like items you want to check for]

Instead of attacking the zombie when the player is carrying the knives and the player is not carrying the candlesticks:
  say "You stab the zombie, but he seems to be immune to knives and just keeps going."

Instead of attacking the zombie when the player is carrying the candlesticks:
  say "You hurl the candlesticks at the zombie and kill him.";
  now the zombie is dead;
  now the candlesticks are in the location.

If you want the player to use constructions like “Kill zombie with candlesticks” you could define a verb and put in some check statements.

[code]Zombiekilling is an action applying to one visible thing and one carried thing.
Understand “attack [thing] with [thing]” as zombiekilling.
Understand “kill[thing] with [thing]” as zombiekilling.

Instead of attacking the zombie:
say “Specify what you’d like to kill the zombie with.”

Check zombiekilling:
If the first noun is not the zombie,
say “Violence is not the answer to this one.” instead.

Check zombiekilling:
If the second noun is the knives,
say “Zombies are immune to knives.” instead.

Check zombiekilling:
If the second noun is not the candlesticks,
say “That doesn’t seem to have any effect.” instead.

Carry out zombiekilling:
now the zombie is dead;
now the candlesticks are in the location.

Report zombiekilling:
say “You hurl the candlesticks at the zombie and kill him.”[/code]

[code]zombieLair: Room
‘Zombie Lair’
;

  • knife: Thing
    ‘knife’
    ‘knife’

    iobjFor(AttackWith)
    {
    verify() { }
    }
    ;

  • candlestick: Thing
    ‘candle stick/candlestick’
    ‘candlestick’

    iobjFor(AttackWith)
    {
    verify() { }
    }
    ;

  • zombie: Person
    ‘zombie’
    ‘zombie’

    dobjFor(Attack)
    {
    check()
    {
    failCheck('Attacking the zombie with your bare hands might not be such a good idea. ');
    }
    }

    dobjFor(AttackWith)
    {
    check()
    {
    if (gIobj == knife)
    failCheck('Zombies are immune to knives. ');
    }

      action()
      {
          moveIntoForTravel(nil);
          "You beat the zombie over the head with a candlestick until it collapses into a
          pile of dust, which blows away. ";
      }
    

    }
    ;[/code]

Depending on what you actually want to happen to the zombie (does its body stay in the zombie lair after it has been killed?), you’ll have to change the “moveIntoForTravel(nil)” bit.

Oh duh, sorry. Obviously I didn’t realize what forum I was in.