Find
You are looking at a battle mouse
Created by
wolis
, last updated 18 Feb 2007
Code
##tickloc:runsub checkstate;
if reacting to wish then checkstate;
if reacting to arrives then switchmeon;
if target of push then someonehit;
##switchmeon: switch $actor on;
##someonehit:
store $actor's slot1 to "battle";
##checkstate:
if $actor's health < 3 then stopfighting else checkslot;
##stopfighting:
store $actor's slot1 to "";
$how to (faints,collapses onto the floor,stops for a breather);
print "[$actor] $how";
set $actor's health to 4; rem - just more than fainting value;
##checkslot:
if $actor's slot1 eq "battle" then whattodo else healme;
##healme:
unhost $actor;
rem call "roam"; rem - run away to gain health;
runsub morehealth;
##morehealth:
if $actor's health > 20 then fullyrecovered else recovermore;
##fullyrecovered:
say 'msg',"[$actor] seems fighting fit";
switch $actor off;
##recovermore:
var $mny to $actor's health;
add 10 to $mny;
set $actor's health to $mny;
say 'msg',"[$actor] seems to recover somewhat";
##whattodo: runsub findum or getum;
##findum:
find $loc, random not me not doorway;
if $found_id's class eq "action, rat" then end else bashum;
##bashum:
call "hit $found_id";
##getum:
find $loc, random not locked not me not doorway;
if $found_id > 0 then absorbit else panicnow;
##absorbit:
call "absorb $found_id";
##panicnow:
var $act to (looks,searches,pines,yearns,longs);
var $how to (frantically,desperately,quickly,casually,happily);
var $for to (assistance,health,pennies,support);
say 'msg',"[$actor] $act $how for some $for";