object npcbrain; method className() { return $npcbrain; } method superClass() { } method canPutIn() { return 1; } method canTakeFrom() { return 1; } method canTake() { } method canDrop() { } method canPut() { } method receiveDescripton(d) { if (arrayp(d)) action(d[0], d, *$body); } method init(b) { *$body = b; addConnection(b, me); } method actSpeak(who, what) { if (who != *$body && random(2)) command(*$body, "say Why are you saying \"" + what + "\", "+ title(who)+"?"); else if (who == *$body && !(random(4))) command(*$body, "say Is there an echo in here?"); } method goGet(dir, what) { command(*$body, list(dir)); command(*$body, list($get, what)); command(*$body, list(backDirection(exitlist(parent(*$body)), dir))); } method actMove(actor, what, where) { if (distance(caller) == 1 && !actor) { goGet(me, dir(caller), what); } if (!actor) return; if (!what) return; if (*$body != actor) { if (where == parent(*$body)) /* pretend to typo a 'get' of the object */ command(*$body, "say get " + title(what)); else if (where == actor) command(*$body, "say Why are you taking "+title(what)+"?"); else if (where == *$body) { command(*$body, "say I thank you, "+title(actor)+"!!"); command(*$body, list($hug, actor)); } else if (isActor(where)) { command(*$body, "say You don't like "+def(*$body)+"?"); command(*$body, list($pout)); } else if (!random(10)) command(*$body, "say Why are you messing with stuff, "+title(actor)+"?"); } } method actArrive(actor, d) { if (*$body != actor) { if (!distance(caller)) { command(*$body, "say Howdy, "+title(actor)+"!"); command(*$body, list($hug, actor)); } else { if (!random(3)) command(*$body, "say Yo, "+title(actor)+"!"); command(*$body, list(dir(caller))); } } } method actLeave(actor, d) { if (*$body != actor) command(*$body, list(dir(caller) || d)); } method actBlock(blocker, blockee, dir) { } method actEmote(who, style, atmos, target1, target2) { if (distance(caller)) { return; } if (who != *$body) { if (!style) command(*$body, "say Why are you doing that?"); else if (style == $friendly && target1 == *$body) command(*$body, list($hug, who)); else if (style == $unfriendly && target1 == *$body) command(*$body, "say " + capDef(*$body) + " doesn't like that!"); else if (style == $friendly && target1) command(*$body, "say Hey, " + def(who) + ", I guess you like " + def(target1) + "!"); else if (style == $unfriendly) command(*$body, "say Hey, " + def(who) + ", I guess you don't like " + def(target1) + " either!"); } else if (style == $friendly && random(2)) command(*$body, "say You like when I do that?"); } method actDo(who, action, arg1, arg2) { if (distance(caller)) return; if (who != *$body) { if (action == $light) command(*$body, "say It sure is bright in here!"); else if (action == $extinguish && innerLight(parent(*$body)) >= 0 && innerLight(parent(*$body)) <= outerLight(arg1)) command(*$body, "say Hey, " + (who ? title(who) + ", why'd you turn out the light?" : "who turned out the light?")); else if (action == $open || action == $close) return; else if (action == $offer) { if (arg2 == *$body) { command(*$body, list($get, arg1, $from, who)); command(*$body, "say I thank you, "+title(who)+"!"); } else if (arg1 == *$body) { command(*$body, "say Lemmee alone!"); } } } }