Find
You are looking at a rat
This rat is quite active. It likes to stay fight fit!
Created by
Ken
, last updated 17 Jul 2012
Code
##base:
##tickloc:runsub checkstate;
##wish:checkstate;
##push:runsub someonehit;
##someonehit:
set $actor's slot1 to "battle";
rem - say 'msg',"[$actor] looks angry";
##checkstate:
if $actor's worth < 3 then stopfighting else checkslot;
##stopfighting:
set $actor's slot1 to "";
var $how to (faints,collapses onto the floor,stops for a breather);
say 'msg',"[$actor] $how";
set $actor's worth to 4;
##checkslot:
if $actor's slot1 eq "battle" then whattodo else healme;
##healme:
$lastworth = $actor's worth;
runsub morepennies/5;
##morepennies:
if $actor's worth > 50 then fullyrecovered else recovermore;
##fullyrecovered:
if $actor's worth > $lastworth sayfit;
##sayfit:
rem say 'msg',"[$actor] seems fighting fit";
##recovermore:
var $mny to $actor's worth;
add 10 to $mny;
set $actor's worth 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";