I'm trying to re-author the giving action. I want an NPC to have a mood that goes up or down, depending on whether you give it something it likes or dislikes, but it will only accept things that interest it.
I can't get to seem the liking/disliking relation to work with kinds of things, i.e. snacks, but I need the apples and kiwis to be kinds of snacks because the player gets them from a vending machine, which can only be coded to bring kinds of things from off-stage.
I'm guessing this is why I can't get the Instead rule to fire?
The block giving rule is not listed in the check giving it to rulebook.
A snack is a kind of thing. A snack is always edible.
An apple is a kind of snack.
A kiwi is a kind of snack.
Mood is a kind of value. The moods are hostile, suspicious, indifferent, friendly, and adoring. A person has a mood. A person is usually indifferent.
To improve the mood of (character - a person):
if the mood of character is less than adoring:
now the mood of the character is the mood after the mood of the character.
To worsen the mood of (character - a person):
if the mood of character is not hostile:
now the mood of the character is the mood before the mood of the character.
To decide whether (item - a thing) interests (character - a person):
if the character likes the item, yes;
if the item is edible, yes;
no.
Liking relates one person to various things. The verb to like means the liking relation.
Disliking relates one person to various things. The verb to dislike means the disliking relation.
Instead of giving something to someone:
if the second noun dislikes the noun:
worsen the mood of the second noun;
say "[The second noun] appears to hate that! [The second noun] is [mood of the second noun]." instead;
otherwise:
continue the action.
Check giving something to someone:
unless the noun interests the second noun:
say "[The second noun] disdainfully refuses [the noun]. [The second noun] is still [mood of the second noun]." instead;
otherwise if the second noun dislikes the noun:
worsen the mood of the second noun;
say "[The second noun] appears to hate that! [The second noun] is [mood of the second noun]." instead;
otherwise if the second noun likes the noun:
improve the mood of the second noun;
say "[The second noun] looks happy to receive that. [The second noun] is [mood of the second noun].".
The Testing Room is A Room. The pawn broker is a person in the testing room. The player holds a rare coin and a straw dog and an apple and a kiwi.
The pawn broker likes the straw dog.
The pawn broker dislikes the kiwi.
Test me with "give dog to broker / give coin to broker / give apple to broker / give kiwi to broker".