Find
You are looking at a called hit
Created by
Cold Taco
, last updated 27 Dec 2006
Code
get $target in $loc;
rem var $d to 1; rem when $d is 1 then you get debug info;
if $target > 0 then blastit else fail;
var $hitobj to $target; rem - remember this target for later;
find $loc,battle;
if $found_id > 0 then checkplayer else end;
##checkplayer:
var $arethey to $hitobj is logged on;
if $arethey eq no then notlogged else checkdoorway;
##chk2:
rem - if $get_player eq no then notlogged else checkdoorway;
say 'msg',"checkplayer";
##notlogged:
say 'msg',"[$actor] changed their mind as [$hitobj] was distrated";
##checkdoorway:
if $hitobj's link > 0 then end else battleit;
##battleit:
rem - take of money;
var $mny to random 768; rem - how much will be deducted;
add 1 to $mny;
var $omny to $hitobj's worth;
take $mny from $omny;
if $omny > 0 then reduce else blackout;
##reduce:
var $startworth to $hitobj's tmp;
if $startworth > 0 then reduce2 else setstartworth;
##reduce2:
set $hitobj's worth to $omny;
var $nob to (coin,stick,chocolate,mouse,fig);
new "$nob";
var $nmny to random $mny; rem a smaller amount than the amount hit off;
set $new_id's worth to $nmny;
set $new_id's colour to "gold";
percentbar $omny of $startworth;
var $clr to 'chartreuse';
msg $loc,$actor,0,0,'force',"force:look $loc";
say 'msg',"[$hitobj] is
$pct%
ok
$percentbar
having lost [$new_id]";
##setstartworth:
set $hitobj's tmp to $omny;
var $startworth to $omny;
runsub reduce2;
##blackout:
set $target's worth to 1;
set $target's slot1 to "";
say 'msg',"[$target] collapses on the floor after that decisive blow from [$actor]";
##black2:
rem say 'msg',"start";
rem say 'msg',"[$target] collapses on the floor after that decisive blow from [$actor]";
say 'msg',"end";
runsub end;
##blastit:
clear $target,all;
var $how to (lashes out,winds up,leaps,stumbles,sceams,laughs,wobbles);
var $hit to (bashes,hits,punches,kicks,knocks,thumps);
say 'hit',"[$actor] $how and $hit [$target]";
var $how to (flys,staggers,falls,spins);
var $dest to (backwards,away,back);
var $meth to (,,,with force,in slow motion,quickly,in style,clumsily,comically,heroically);
msg $loc,$target,$target,$second,'moves',"[$target] $how $dest $meth!";
##fail:
say 'blastfail',"[$actor] tried to hit $cmd_text but got thrown off balance at the last second!";