Find
You are looking at a command called hit
hit {object}
Hit another object.
Can be useful in a battle.
hit the battle rat
read the command called absorb
if you need to some health.
Created by
wolis
, last updated 31 Mar 2009
Code
get $target,$ret,$second in $loc;
if $second > 0 then checkwield else justhit;
##checkwield:
$weapon is wielded by $actor;
if $second = $weapon then hitwith else failwield;
##hitwith:
$with = "with [$second]";
runsub blastit;
rem say 'hit',"[$actor] hit [$target] with [$second]";
##justhit:
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,battlerat;
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] changes their mind as [$hitobj] is sleeping";
##checkdoorway:
if $hitobj's link > 0 then end else battleit;
##battleit:
rem - take of money;
var $mny to random 10; 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,screams,laughs,wobbles,ponders,sneezes,hiccups,grimaces);
var $hit to (bashes,hits,punches,kicks,knocks,thumps);
say 'hit',"[$actor] $how and $hit [$target] $with";
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] tries to hit $cmd_text but missed";
##failwield:
say 'blastfail',"[$actor] tries to hit $cmd_text but is not wielding it";