! This section defines actions and conditions. Both will be passed three ! arguments, the first of which is the actor. ! Actions do something to get closer to the current goal; ! if a value is returned then it is ignored. [ rapBegDown actor unused1 unused2; if (TestScope (player, actor)) print "^", (The) actor, " whines and struggles to get free.^"; ]; [ rapBegUp actor unused1 unused2; if (TestScope (player, actor)) print "^", (The) actor, " whines and begs pleadingly.^"; ]; [ rapGoTo actor room unused; if (TestScope (player, actor)) print "^", (the) actor, " heads off to ", (the) room, ".^"; unused = room; move actor to room; if (TestScope (player, actor)) print "^", (the) actor, " arrives from ", (the) unused, ".^"; ]; [ rapPickUp actor object unused; move object to actor; if (TestScope (player, actor)) print "^", (The) actor, " picks up ", (the) " object."; ]; [ rapPutDown actor object unused; move object to parent(actor); if (TestScope (player, actor)) print "^", (The) actor, " puts down ", (the) " object."; ]; [ rapPlayWith actor toy unused; if (TestScope (player, actor)) print "^", (The) actor, " plays with ", (the) toy, ".^"; ]; [ rapNullAction actor param1 param2 ; rtrue; ]; ! Conditions shouldn't do anything except return true or false. [ rapCarried actor object person; !print "^Is ", (the) object, " carried by ", (the) person, "? "; !if (object in person) print "Yes.^"; else print "No.^"; return object in person; ]; %% goal rapPuppyFun(actor, unused1, unused2) done never, ! rfalse plan is be rapSamePlace(ball, 0), do rapPlayWith(ball, 0) ; goal rapInRoom(actor, room, unused) done when (actor in room), plan is multiple(room.#come_from/2), be rapInRoom(room.&come_from-->plan, 0), do rapGoTo(room, 0) ; goal rapSamePlace(actor, object, unused) done when (actor in parent(object)), plan is if rapCarried(actor, player), do rapBegDown(0, 0) or else if rapCarried(object, player), be rapSamePlace(player, 0), do rapBegUp(0, 0) or else be rapInRoom(parent(object), 0) ;