@create #517 named generic dispenser:dispenser,generic dispenser,generic
@prop #1387."dispenses" {} rc
@prop #1387."takers" {} r
;;#1387.("takers") = {#-1, #-1}
;;#1387.("unique") = 1
;;#1387.("worth") = -1
;;#1387.("condition") = E_NONE
;;#1387.("odrop_failed_msg") = "%<tries> to drop %t but fails!"
;;#1387.("odrop_succeeded_msg") = "%<drops> %t."
;;#1387.("otake_succeeded_msg") = "%<picks> up %t."
"#1387.("key") => E_PERM (Permission denied)
;;#1387.("aliases") = {"dispenser", "generic dispenser", "generic"}
;;#1387.("description") = "A tangible object for use in the LambdaMOO RPG."
;;#1387.("object_size") = {4213, 1141286558}

@verb #1387:"take get remove" any from this rxd
@program #1387:take
if (player.location != this.location)
  return player:tell("I don't understand that");
endif
rpg = $local.rpg;
what = $string_utils:match(dobjstr, this.dispenses, "aliases", this.dispenses, "name");
if (what == $failed_match)
  player:tell("There are no ", dobjstr, "s in the ", this.name, ".");
  return;
elseif (what == $ambiguous_match)
  player:tell("I don't know which one you mean.");
elseif ((length($list_utils:remove_duplicates(this.takers)) == 1) && (player == this.takers[1]))
  player:tell("Greedy, aren't we? I think you've had enough for now.");
elseif (valid(this.location))
  new = rpg.recycler:_create(what);
  if (typeof(new) == ERR)
    player:tell(this.name, " is unable to produce ", $string_utils:a_or_an(what.name), " ", what.name, ".  A GM should be advised.");
    this.location:announce(player.name, " scrabbles around ", this.name, " but comes away empty-handed.");
    return;
  endif
  new.name = what.name;
  new.aliases = what.aliases;
  player:tell("You take a ", new.name, " from the ", this.name, ".");
  new:moveto(player);
  this.location:announce(player.name, " takes a ", new.name, " from the ", this.name, ".");
  this.takers = {player, this.takers[1]};
endif
"DR 25-AUG-94 -- Added short-circuit if recycler messes up.";
"StarDancer Nov-19-95 -- Added location checks, at Bradley's suggestion";
"Profane 14-DEC-96 1725PST -- added 5 item limit type thing";
.

@verb #1387:"put place insert" any in this rxd
@program #1387:put
what = dobj;
if ((what == $failed_match) || (what == $nothing))
  player:tell("Put what in the ", this.name, "?");
  return;
elseif (what == $ambiguous_match)
  what = $string_utils:match(dobjstr, player.contents, "name", player.contents, "aliases");
  if (what <= $sysobj)
    player:tell("Sorry, I don't know which ", dobjstr, " you mean.");
    return;
  endif
endif
if (what.location != player)
  player:tell("You don't have the ", what.name, ".");
elseif ((player.location != this.location) && (!(player in $local.rpg.gms)))
  player:tell("My, what long arms you have.");
elseif (parent(what) in this.dispenses)
  player:tell("You put the ", what.name, " in the ", this.name, ".");
  if (player.location == this.location)
    this.location:announce(player.name, " puts a ", what.name, " in the ", this.name, ".");
  endif
  what:moveto($local.rpg.cemetery);
else
  player:tell("That doesn't fit.");
endif
.

@verb #1387:"look_self" none none none rxd
@program #1387:look_self
pass(@args);
names = {};
for thing in (this.dispenses)
  names = listappend(names, thing.name);
endfor
player:tell("The ", this.name, " contains ", $string_utils:english_list(names), ".");
.

@verb #1387:"make_fertile" this none this
@program #1387:make_fertile
player:tell("Contact Grand_Master about adopting your generic gear.");
return E_PERM;
.

"***finished***