Generic Breakable Exit (#322)(an instance of generic exit made by Deleuze)Go to location of this object, Bakunin. HELP MANUAL:      This is where help for the generic breakable exit should go.            But it isn't done yet. VERB SOURCE CODE: @revert_interval:
if (player != this.owner)
player:tell("You must be the owner of the ", this.name, " to set the revert interval.");
return;
endif
i = tonum(iobjstr);
if ((i == 0) || (i == ""))
player:tell("Please specify a number. Current interval is ", this.revert_interval,
".");
return;
endif
this.revert_interval = i;
player:tell(this.name, " revert interval set to ", this.revert_interval, ".");
.
move:
if (this.broken_state != this.BROKEN)
player:tell($string_utils:pronoun_sub(this.not_broken_msg, player, this));
this.source:announce($string_utils:pronoun_sub(this.onot_broken_msg));
return;
else
pass(@args);
endif
.
@reset:
if (this.owner != player)
player:tell("You have to be the owner to do that.");
return;
endif
this.broken_state = this.INTACT;
player:tell("You reset the ", this.name, " to an intact state.");
if (!valid(this.other_exit))
player:tell(this.name, " has no valid other_exit defined. Please set one with
@other-exit ", tostr(this), " is ", "#exit-number.");
return;
endif
this.other_exit.broken_state = this.INTACT;
.
break_self:
if (this.broken_state == this.BROKEN)
player:tell("The ", this.name, " is already broken.");
return;
endif
if (this.source != player.location)
player:tell("You can't ", verb, " the ", this.name, " from there.");
return;
endif
if (!valid(this.other_exit))
player:tell(this.name, " has no valid other_exit defined. Please set one with
@other-exit ", tostr(this), " is ", "#exit-number.");
return;
endif
this.broken_state = this.BROKEN;
player:tell($string_utils:pronoun_sub(this.break_action_msg));
this.source:announce($string_utils:pronoun_sub(this.obreak_action_msg));
this.other_exit.broken_state = this.BROKEN;
this.other_exit.source:announce_all($string_utils:pronoun_sub(this.other_exit.obreak_action_msg));
suspend(this.revert_interval);
this.broken_state = this.INTACT;
this.other_exit.broken_state = this.INTACT;
this.source:announce_all($string_utils:pronoun_sub(this.orevert_action_msg));
this.other_exit.source:announce_all($string_utils:pronoun_sub(this.other_exit.orevert_action_msg));
.
@other-exit:
if (!valid(iobj))
player:tell(iobjstr, " isn't a valid object.");
return;
endif
if ((this.owner != player) || (iobj.owner != player))
player:tell("You aren't the owner of the exit.");
return;
endif
if (!($exit in $object_utils:ancestors(iobj)))
player:tell(iobj.name, " (", tostr(iobj), ") doesn't appear to be an exit.");
return;
endif
if (parent(this) != parent(iobj))
player:tell(iobj.name, " isn't a child of ", parent(this).name, ". Please change
its parent first, by typing:");
player:tell(" @chparent ", iobj, " to ", parent(this));
return;
endif
this.other_exit = iobj;
player:tell(this.name, "'s other exit has been set to ", iobj.name, "(", tostr(iobj),
").");
.
look_msg:
"Copied from generic exit (#7):look_msg by Dredful (#96) Sun Feb 13 23:13:51 1994
EST";
"returns .look_msg with this additional substitutions besides regular pronouns:";
" %dest - substituted for the exit's destination name";
" %source - substituted for the exit's source name";
"stupid hack to get around look_msg always being +c in kids";
if (this.broken_state == this.BROKEN)
look_msg = this.broken_msg;
else
look_msg = this.intact_msg;
endif
return $string_utils:pronoun_sub($string_utils:substitute(look_msg, {{"%source",
this.source:title()}, {"%dest", this.dest:title()}}));
.
PROPERTY DATA:       intact_msg       broken_msg       broken_state       revert_interval       BROKEN       INTACT       break_action_msg       obreak_action_msg       orevert_action_msg       not_broken_msg       onot_broken_msg       other_exit       help_msg CHILDREN: window window window window |