Inform7: Can actions be made to default to the player if no noun is provided?

Viewed 79

I have a heal [someone] action that restores an hp value I have given all people in my story. When I enter the command heal on it's own it defaults to healing anyone else in the same room before it does the player.

Is there a way I can make that action default to the player if no noun is specified?

2 Answers

You can create another action ("healing oneself" in this example), understand the phrase "heal" as that action, and convert the action to the healing action applied to the player in a Check rule:

A person has a number called current hit points.
A person has a number called maximum hit points.

Healing is an action applying to one thing.
Healing oneself is an action applying to nothing.

Understand "heal [someone]" as healing.
Understand "heal" as healing oneself.
To appear is a verb.
To feel is a verb.

Check healing oneself:
    convert to the healing action on the player.

Carry out healing:
    now the current hit points of the noun is the maximum hit points of the noun.

Report healing:
    if the noun is the player:
        say "[We] [feel] completely healed!";
    otherwise:
        say "[The noun] [appear] completely healed!".
Related