@verb #16:"@extend" any any any rdo #789 @program #16:"@extend" any any any if (dobj == $failed_match) dobj = $string_utils:match_local_player(dobjstr) endif if (this != player) return $msg:mtell("huh") elseif (!(prepstr in {"", "to", "for"})) return player:tell("Usage: @extend <object> [for|to <interval>]") elseif ($command_utils:object_match_failed(dobj, dobjstr)) return elseif (!prepstr) interval = dobj.extend_expiry_time iobjstr = $time_utils:english_time(interval) prepstr = "to" elseif (!(interval = $time_utils:parse_english_time_interval(iobjstr))) return player:tell(iobjstr, " is not a valid time interval.") endif if (is_player(dobj)) count = 0 for object in (dobj.owned_objects) $command_utils:suspend_if_needed() ext = (prepstr == "to" ? time() | object.best_before) + interval if (!object:has_property("best_before")) continue endif if (object.best_before && (prepstr == "for" || object.best_before < ext)) $building_utils:set_best_before(object, ext) count = count + 1 endif endfor return player:tell(count, " objects belonging to ", $string_utils:nn(dobj), " have been extended ", prepstr, " ", iobjstr, ".") elseif (!dobj.best_before) player:tell($string_utils:nn(dobj), " is already permanent.") if (!$command_utils:yes_or_no(tostr("Make temporary with shelf-life ", iobjstr, "?"))) return player:tell("Aborted.") endif endif ext = (prepstr == "to" ? time() | dobj.best_before) + interval if (prepstr == "to" && ext < dobj.best_before && !$command_utils:yes_or_no(tostr($string_utils:nn(dobj), " is currently extended beyond ", iobjstr, ". Do you wish to REDUCE its time to live?"))) return player:sub_tell("%D (#%D~#) is unchanged.") endif if (!(e = $building_utils:set_best_before(dobj, ext))) player:tell(e) else player:tell($string_utils:nn(dobj), " extended ", prepstr == "to" ? "till " + iobjstr + "." | "for " + iobjstr + ". Will expire " + ctime(ext) + ".") endif "Last modified by Dax (#789) on Thu Nov 8 11:38:30 2001 MST." .