robot (#555)(an instance of Generic Wandering Automaton made by Zon)     You see a perfect copy of Rotwang's art-deco robot from _Metropolis_.      [ hit ] hits the robot. It frowns.      [ kick ] kicks the robot. It frowns.      [ hug ] hugs the robot. It smiles.      [ kiss ] kisss the robot. It smiles. Go to location of this object, Z. VERB SOURCE CODE: find_exits:
"find_exits() -- return a list of exit object numbers that are valid for the bot
to take from the current room. If the bot doesn't set ways_out, those exits are
the obvious_exits() - 'banned exits'. Otherwise, they are the exits named by ways_out
- 'banned exits'. ";
exits = {};
room = this:this_room();
if (this.ways_out != {})
for name in (this.ways_out)
exit = room:match_exit(name);
if ((valid(exit) && (!(exit in exits))) && (!this:banned(exit.dest)))
exits = listappend(exits, exit);
endif
endfor
else
obvious_exits = room:obvious_exits();
for exit in (obvious_exits)
if (valid(exit) && (!this:banned(exit.dest)))
exits = listappend(exits, exit);
endif
endfor
endif
return exits;
.
act:
"act(): the repeating action of the automaton goes here. It can be a movement, as
here, or be overridden to do some other repeating action";
if (this.should_act && ($object_utils:has_property(this.location, "exits") || is_player(this.location)))
exits = this:find_exits();
if (length(exits))
destination = exits[random(length(exits))];
destination:move(this);
endif
else
this.should_act = 1;
endif
.
PROPERTY DATA: |