Armed

version 3 by David Ratliff

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 2 - Rules and Kinds

    Definition: a person is armed if he carries a weapon.

    Persuasion rule (this is the mine is bigger than yours rule):
        if the player is armed begin;
            if a random chance of 8 in 10 succeeds begin;
                if the person asked is armed begin;
                    if a random chance of 8 in 10 succeeds begin;
                        say "[The person asked] says 'I am armed, too, and will not be bullied!'" instead;
                        persuasion fails;
                    end if;
                end if;
            end if;
        persuasion succeeds;
        end if;
    persuasion fails.

    Check taking something (this is the can't take it with you rule):
        if the noun is a thing and the holder of a noun is a person (called corpse) begin;
            if corpse is dead then ignore the can't take people's possessions rule;
        end if.

    A weapon is a kind of thing.
    A projectile is a kind of weapon.
    A blade is a kind of weapon.
    A fire arm is a kind of projectile.
    A bow is a kind of projectile.
    A knife is a kind of blade.
    A sword is a kind of blade.

    A weapon has a number called maximum damage.
    The maximum damage of a projectile is usually 50.
    The maximum damage of a blade is usually 25.

    Before anyone trying doing anything (this is the dead men tell no tales rule):
    if the actor is dead, the rule fails.

    Unsuccessful attempt by anyone trying doing anything (this is the report dead men tell no tales rule):
    if the person asked is dead, say "Dead men tell no tales. And they usually can't do anything else, either!" instead.

    Before doing anything except searching or examining to a person (called the corpse) (this is the respect the dead rule): if the corpse is dead, say "Must you do that to [the corpse]? Have a little respect, please." instead.

    Check searching a person (called corpse) (this is the search a corpse rule):
    if the corpse is dead, say "You search [corpse][if the number of things carried by corpse is 0] but find nothing[otherwise] and find [the list of things carried by corpse][end if]." instead.

    Instead of taking inventory (this is the new inventory listing rule):
    if the number of things enclosed by the player is 0, say "You don[apostrophe]t seem to have anything at the moment.[line break](Health: [present health of the player])[line break]" instead;
    say "You are carrying: [line break]"; list the contents of the player, with newlines, indented; say "(Health: [present health of the player])[line break]".

    Report examining a person (called victim) (this is the check NPC health rule):
        if the person is not dead, say "(Health: [present health of victim])[line break]".

    Check examining a dead person (called corpse) (this is the examining a corpse rule):
        say "[Corpse] is a gruesome sight." instead.

    Check examining the player (this is the report health rule):
        say "You [status of the player]. (Health: [the present health of the player])[line break]" instead.

    To say status of the player:
        let x be the present health of the player;
        if x is 100:
            say "are in perfect health";
        otherwise if x is at most 10:
            say "are near death";
        otherwise if x is at most 20:
            say "are in serious condition";
        otherwise if x is at most 30:
            say "have taken quite a beating";
        otherwise if x is at most 60:
            say "have definately been better, but you could be worse";
        otherwise if x is at most 70:
            say "are a little beaten up";
        otherwise if x is at most 80:
            say "can almost hide the fact that you have been in a fight";
        otherwise if x is at most 90:
            say "have some scrapes and bruises, but you have looked worse";
        otherwise:
            say "are a little banged up, but still good-looking".