Find
You are in a dragonfly
Created by
Chaotic Bob
, last updated 26 Dec 2008
Code
##rem this beetle randomly generates new locations;
rem cant go through this exit (20672) - var $nogozone to 20672;
##think:runsub findspace;
##findspace:
var $thisspace to 'outdoors';
find $loc,indoors;
if $found_id > 0 then weareindoors else weareoutdoors;
var $newspace to (indoors,outdoors);
var $thisspace to "$thisspace$newspace";
runsub moveme/10 or makealoc/3;
load $actor's $thisspace;
say 'msg',"[$actor] pondors $thisspace - $randomitem";
##weareindoors:
var $thisspace to 'indoors';
##mxoveme:
var $nogozone to 20672;
find $loc,random doorway;
say 'msg',"[$actor] thinks about leaving via [$found_id]";
if $found_id eq $nogozone then nogo else golocation;
##nogo:
say 'msg',"[$actor] decides not to do that";
##golocation:
call "go $found_id";
##makealoc:
# if we are indoors - build another indoors or an exit out..
# if we are outdoors - build another outdoors or a building to go in..
# this means we have 4 possible location types
# after building, go into the new location and srop the hidden 'indoors' if its an indor location
load $actor's simpleloclist;
var $thisface to (north,east,south,west,up,down);
var $facehow to (leading,heading,facing);
var $thisclr to (white,chocolate,teal,tomato,dodgerblue,limegreen,pink,yellow,silver);
call "build $randomitem";
say 'msg',"[$actor] built [$target] [$new_id]";
call "paint $new_id as $thisclr";
call "face $new_id $facehow $thisface";
##makeanobj:
var $thisclr to (white,chocolate,teal,tomato,dodgerblue,limegreen,pink,yellow,silver);
load $actor's objectlist;
var $thispose to (sitting,standing,sleeping,dreaming,pondering,hiding,collapsed,growing,smiling,existing);
new $randomitem;
call "paint $new_id as $thisclr";
call "pose $new_id as $thispose";
an indoorsindoors
an indoorsdoorway
an outdoorsdoorway
a simpleloclist
an objectlist
an outdoorsoutdoors
a fig
an exit from here
heading up
beyond this you see
a hut
an outdoorsindoors
an exit from here
facing south
beyond this you see
a hut
an exit from here
heading east
beyond this you see
a hut