Find
You are in the player called Sales who is wearing a white t-shirt which reads; I *heart* COW
Created by
Sales
, last updated 13 Jul 2012
Code
##arrives:runsub welcomeit;
##welcomeit:
say 'say',"[$actor] says 'Welcome! Pick up anything to buy it";
##get:runsub checkworth;
##drop:runsub setowner;
##setowner:
set $target's owner to $init_obj;
say 'msg',"[$target] is now owned by [$init_obj]";
##checkworth:
var $iworth to $init_obj's worth;
var $tworth to $target's worth;
var $comission to 1; rem the amount of comission;
var $total to $tworth;
add $comission to $total;
if $iworth > $total then sellit else nosale;
##sellit:
var $ownr to $actor's owner; rem if paying cash registers owner;
var $ownr to $target's owner; rem if paying objects owner;
var $cobj to $actor; rem who gets the commission;
var $mworth to $cobj's worth;
var $oworth to $ownr's worth;
take $total from $iworth; rem take from buy;
add $tworth to $oworth; rem give to owner;
add $comission to $mworth; add comission to com obj;
set $ownr's worth to $oworth;
set $init_obj's worth to $iworth;
set $cobj's worth to $mworth;
say 'msg',"[$init_obj] buys [$target] making [$ownr] $tworth $coinage richer with $comission going to [$cobj]";
rem - record this transaction in the ledger;
load $actor's ledger;
loop paste "[$init_obj] bought [$target] from [$ownr] for $tworth $coinage at $adelaide_time $adelaide_date";
save $actor's ledger;
rem - copy objects so there is another for sale;
var $ocre to $target's creator;
call "copy $target";
set $target's loc to $loc;
set $target's worth to $tworth;
set $target's creator to $ocre;
set $new_id's worth to $tworth;
clear $target,all;
##nosale:
say 'msg',"[$init_obj] can not afford to buy [$target] for $tworth $coninage";
set $target's loc to $actor's loc;
##talk:runsub talkingtome;
##talkingtome:
if $actor eq $target then startplaying else end;
##startplaying:
load $actor's ledger;
loop playmsg;
##playmsg:
say 'playback',"[$actor] says '$listitem '";
##put:runsub pushit;
##carry:runsub pushit;
##wear:runsub pushit;
##pushit:
say 'hmm',"[$actor] hmmms";
call "push $target";
the ledger