Find
You are looking at the method called nipat
Created by
Chaotic Bob
, last updated 15 Jan 2007
Code
get $target in $loc;
if $target > 0 then checkdoorway else fail;
##checkdoorway:
if $target's link > 0 then fail else blastit;
##blastit:
clear $target,all;
rem set $target's host to '';
var $how to (lunges, jumps, snarls);
var $hit to (nips, bite);
say 'hit',"[$actor] $how at [$target] and $hit them";
rem - take of health;
var $mny to 1;
var $omny to $target's health;
take $mny from $omny;
if $omny > 0 then reduce else blackout;
##reduce:
set $target's health to $omny;
$nob = "blood fleck";
new "$nob";
var $nmny to $mny; rem a smaller amount than the amount hit off;
set $new_id's worth to $nmny;
set $new_id's colour to "red";
msg $loc,$actor,0,0,'force',"force:look $loc";
percentbar $omny of $actor's health;
var $clr to 'chartreuse';
msg $loc,$actor,0,0,'force',"force:look $loc";
say 'msg',"[$target] is
$pct%
ok
$percentbar
having lost [$new_id]";
##blackout:
set $target's health to 1;
set $target's slot1 to "";
say 'blackout',"[$target] slumps to the ground just barely alive....";
runsub old_moveit_code;
##old_moveit_code:
rem - this is just the beach ball bouncing away code for now;
find $loc,random doorway;
var $tlink to $found_id's link;
var $tloc to $tlink's loc;
say 'leaves',"[$target] stumbles away via [$found_id]";
clear $actor,all;
msg $loc,$target,0,0,'force',"force:look $loc";
set $target's loc to $tloc;
var $loc to $tloc;
msg $tloc,$target,0,0,'arrives',"[$target] stumbles in from [$tlink] and collapses on the ground";
msg $tloc,$actor,0,0,'force',"force:look $tloc";
##fail:
say 'blastfail',"[$actor] tried to hit $cmd_text but missed";