Find
You are looking at an action called consume
Created by
Rixel
, last updated 04 Feb 2012
Code
get $text,$target in $actor;
if $target > 0 then eatfrom else checkloc;
##checkloc:
get $text,$target in $loc;
if $target > 0 then eatfrom else checkone;
##eatfrom:
$ac = (takes,has);
$how = (delicate,large,wholesom,healthy,hearty,megre,small,large,great);
$bit = (bite,mouthful,morsel,portion);
say 'eat',"[$actor] $ac $how $bit of [$target]";
##checkone:
get $target in $loc;
if $target > 0 then chklock else fail;
##chklock:
if $pw like $target's pwd then moveobj else moveobj;
##moveobj:
unhost $target;
clear $target,all;
set $target's loc to $actor;
set $target's pose to "hidden";
say 'get',"[$actor] eats [$target]";
msg $actor,0,0,0,'arrives',"[$target] appears from nowhere";
relook $loc;
relook $actor;
##fail:
if $counter > 0 then exit else listall;
##listall:
var $click_cmd to 'consume';
var $desc_intro to 'Click on the object you want to eat:
';
look $loc,list;
msg $loc,$actor,$actor,0,'force',"force:look $loc,list";
##itslocked:
say 'getfailed',"[$actor] could not eat [$target] because it's locked";
##sample_full_msg:
msg $loc,$actor,$target,$second,'getfailed',"[$actor] could not eat [$target]";