Find
You are looking at a metaphorical shadow
Created by
Chaotic Bob
, last updated 14 Apr 2008
Code
##tickloc:runsub ticked;
##ticked:
$cnt = $actor's counter;
$fromhit = $actor's slot1;
$tohit = $actor's slot2;
$weapon = $actor's slot3;
case $cnt do doinit,dodamage,dodamage,dodamage,dodamage,alldone;
##doinit:
say 'msg',"[$actor] appears on [$tohit]'s face!";
clear $actor,all;
update $actor = "counter=1,host='$tohit',hosthow='on'";
relook $loc;
##dodamage:
$hlth = $tohit's health;
take 5 from $hlth;
if $hlth < 0 then zeroit;
set $tohit's health to $hlth;
$mani = $tohit's mana;
take 20 from $mani;
if $mani < 0 then zeroit2;
set $tohit's mana to $mani;
$t = $target;
$target = $tohit;
say 'poison',"[$tohit] is looking steadily weaker!";
$target = $t;
add 1 to $cnt;
set $actor's counter to $cnt;
if $hlth < 1 then saydead;
##zeroit:
$hlth = 0;
##zeroit2:
$mani = 0;
##saydead:
say 'msg',"[$tohit] collapses dead!";
set $actor's counter to 6;
##alldone:
say 'msg',"[$actor] vanishes.";
set $actor's loc to $weapon;
unhost $actor;
clear $actor,all;
update $actor = "host=0,hosthow='',counter=0";
relook $loc;
switch $actor off;