Find
You are looking at a command called paint
paint {object} as|to|with {colour}
You can change the colour of objects you have created.
eg
paint the table to orange
.
paint the cat with black
.
paint location
You can change the colour of your location, if it is not locked.
Created by
wolis
, last updated 02 Dec 2014
Code
if $cmd_text eq 'location' then paintloc else findobj;
##paintloc:
var $target to $loc;
runsub checkpw;
##findobj:
get $target,$rel,$lastword in $loc;
if $target > 0 then checkpw else chkoneword;
##chkoneword:
get $target in $loc;
runsub paintobj;
##paintobj:
var $lastword to '';
if $target > 0 then checkpw else fail;
##checkpw:
if $pw like $target's pwd then chkpaint else itslocked;
##chkpaint:
if $lastword eq '' then pickcolour else chkrandom;
##pickcolour:
rem colour $target;
msg $loc,$actor,$actor,0,'force',"force:colour $target";
##chkrandom:
if $lastword like "random" then randomcolour else paintit;
##randomcolour:
var $lastword to (white,pink,gold,limegreen,powderblue,tomato,chocolate,peru);
runsub paintit;
##paintit:
var $old_colour to $target's colour;
set $target's colour to $lastword;
var $new_class to $target's class;
swap $new_class so $old_colour is $lastword;
set $target's class to "$new_class";
say 'paint',"[$actor] paints [$target] $lastword";
rem look $loc;
msg $loc,$actor,0,0,'force',"force:look $loc";
if $target's link > 0 then paintlink else end;
##paintlink:
var $linked to $target's link;
var $new_class to $linked's class;
swap $new_class so $old_colour is $lastword;
set $linked's class to "$new_class";
set $linked's colour to $lastword;
runsub noisy;
##fail:
if $counter > 0 then exit else listall;
##listall:
var $click_cmd to 'paint';
var $desc_intro to 'Click on the object you want to paint:
';
rem look $loc,list;
msg $loc,$actor,$actor,0,'force',"force:look $loc,list";
##itslocked:
say 'paintfail',"[$actor] could not paint [$target] because it is locked";
##end:
runsub noisy/3;
##noisy:
msg 0,$actor,0,0,"paintsmell","You can smell fresh paint";