Bribery
If we want to rewrite the functionality of a command that usually ends with a "block…" rule, we will have to begin by turning the blocking off.
As it happens, correct behavior is built into the GIVE command once "block giving" is turned off, so we do not have to write a replacement report or carry-out rule; the object will be transferred to the possession of the caterpillar. But we do want to adjust the action just a little so that our gift cheers up the recipient:
Now whenever we give something to an animal, the animal will be pleased about the present. Of course, we might also want to add a check rule to giving, to see whether the offering is something the recipient really wants:
There is already a perfectly workable report rule that will describe what happens when we give something to someone, but let's say we want to report on the recipient's changed mood, too:
And the rest is all scenario:
Test me with "forward / give crumb to caterpillar / forward / forward-up / get aphid / get fragment / down / give aphid to caterpillar / drop aphid / forward-up / get fragment / down / give fragment / forward".
You stand on smooth bark dappled by sunlight. The scent-trail runs forward to home.
The branch continues forward and backward from here, and a stem extends forward-up.
The Very Hungry Caterpillar looks hostile.
>(Testing.)
>[1] forward
The Very Hungry Caterpillar moves to block your exit, glaring down at you with all the bristles on its skin extended to full size.
>[2] give crumb to caterpillar
You give the peanut crumb to the Very Hungry Caterpillar, who appears mollified and is now merely suspicious.
>[3] forward
The Very Hungry Caterpillar moves to block your exit, though it might allow you past if you offered further tribute.
>[4] forward-up
Leaf Face
The smooth and shiny surface of the leaf extends forward from here, but you have lost the scent-trail. This is not the way home.
You can see a pear fragment and a dead aphid here.
>[5] get aphid
You lift the dead aphid, though it is nearly your own size.
>[6] get fragment
You're carrying too many things already.
>[7] down
Leafy Branch
You stand on smooth bark dappled by sunlight. The scent-trail runs forward to home.
The branch continues forward and backward from here, and a stem extends forward-up.
The Very Hungry Caterpillar looks suspicious.
>[8] give aphid to caterpillar
The Very Hungry Caterpillar disdainfully refuses the dead aphid.
>[9] drop aphid
Dropped.
>[10] forward-up
Leaf Face
The smooth and shiny surface of the leaf extends forward from here, but you have lost the scent-trail. This is not the way home.
You can see a pear fragment here.
>[11] get fragment
You lift the pear fragment, though it is nearly your own size.
>[12] down
Leafy Branch
You stand on smooth bark dappled by sunlight. The scent-trail runs forward to home.
The branch continues forward and backward from here, and a stem extends forward-up.
The Very Hungry Caterpillar looks suspicious.
You can also see a dead aphid here.
>[13] give fragment
(to the Very Hungry Caterpillar)
You give the pear fragment to the Very Hungry Caterpillar, who appears mollified and is now merely indifferent.
>[14] forward
The scent-trail is weak but not entirely gone, and you pursue it faithfully...
*** The End ***