Dump #10898 (Generic Thrown Weapon)

@create #82 named Generic Thrown Weapon:Generic Thrown Weapon
"#10898.("dodgable_mis") => E_PERM (Permission denied)
"#10898.("dodgable_mel") => E_PERM (Permission denied)
"#10898.("parryable_mis") => E_PERM (Permission denied)
"#10898.("parryable_mel") => E_PERM (Permission denied)
@prop #10898."oswing_mis" "throws" r
"#10898.("oswing_mel") => E_PERM (Permission denied)
@prop #10898."swing_mis" "throw" r
@prop #10898."swing_mel" "swing" r
"#10898.("slowness_mis") => E_PERM (Permission denied)
"#10898.("slowness_mel") => E_PERM (Permission denied)
"#10898.("attack_mis") => E_PERM (Permission denied)
"#10898.("attack_mel") => E_PERM (Permission denied)
"#10898.("pen_mis") => E_PERM (Permission denied)
"#10898.("pen_mel") => E_PERM (Permission denied)
"#10898.("dam_mis") => E_PERM (Permission denied)
"#10898.("dam_mel") => E_PERM (Permission denied)
"#10898.("skill_mis") => E_PERM (Permission denied)
"#10898.("skill_mel") => E_PERM (Permission denied)
"#10898.("hands_mis") => E_PERM (Permission denied)
"#10898.("hands_mel") => E_PERM (Permission denied)
"#10898.("pierce_mis") => E_PERM (Permission denied)
"#10898.("pierce_mel") => E_PERM (Permission denied)
"#10898.("missile") => E_PERM (Permission denied)
@prop #10898."retrieve_msg" "%N %<dives> to the ground and deftly %<retrieves> %p %t." rc
@prop #10898."retrievable" 0 rc
@prop #10898."failed_retrieve_msg" "%N %<dives> to the ground, but %<fumbles> and %<is> unable to retrieve %p %t before getting to %p feet." rc
@prop #10898."mounted_failed_retrieve_msg" "%N %<is> too far from the ground to retrieve %p %t." rc
"#10898.("dodgable") => E_PERM (Permission denied)
"#10898.("parryable") => E_PERM (Permission denied)
;;#10898.("oswing") = "fires"
;;#10898.("swing") = "fire"
"#10898.("slowness") => E_PERM (Permission denied)
"#10898.("parry") => E_PERM (Permission denied)
"#10898.("attack") => E_PERM (Permission denied)
"#10898.("pen") => E_PERM (Permission denied)
"#10898.("dam") => E_PERM (Permission denied)
"#10898.("skill") => E_PERM (Permission denied)
;;#10898.("hands") = 2
;;#10898.("pierce") = 0
"#10898.("max_str_bonus") => E_PERM (Permission denied)
"#10898.("can_degrade") => E_PERM (Permission denied)
"#10898.("track_usage") => E_PERM (Permission denied)
;;#10898.("encumbrance") = 5
;;#10898.("worth") = -1
;;#10898.("condition") = 100
;;#10898.("odrop_failed_msg") = "%<tries> to drop %t but fails!"
;;#10898.("odrop_succeeded_msg") = "%<drops> %t."
;;#10898.("otake_succeeded_msg") = "%<picks> up %t."
"#10898.("key") => E_PERM (Permission denied)
;;#10898.("aliases") = {"Generic Thrown Weapon"}
;;#10898.("description") = "A generic implement of destruction."
;;#10898.("object_size") = {5738, 1141286561}

@verb #10898:"become_melee become_missile" this none this
@program #10898:become_melee
$local.rpg:secure();
flag = verb[y = index(verb, "_")..y + 3];
for prop in ($object_utils:findable_properties(this))
  if (pos = rindex(prop, flag))
    newprop = prop[1..pos - 1];
    this.(newprop) = this.(prop);
  endif
endfor
.

@verb #10898:"th*row" this to any rxd
@program #10898:throw
if (!valid(doll = (rpg = $local.rpg):get_doll(player)))
  player:tell("You don't know how. The Bovine Illuminati may be able to help you.");
  return;
elseif (!(this in doll.wielding))
  player:tell("You're not wielding your ", this.name, ".");
  return;
elseif (iobj == $nothing)
  player:tell("You have to throw <weapon> at <target>.");
  return;
elseif (iobj == $ambiguous_match)
  player:tell("Which ", iobjstr, " do you want to throw ", this.name, " at?");
  return;
elseif (iobj == $failed_match)
  player:tell("Who do you want to throw ", this.name, " at?");
  return;
endif
this:set_value("missile", 1);
doll:attack(iobj, dobj);
.

@verb #10898:"used" this none this
@program #10898:used
(rpg = $local.rpg):secure();
r = pass(@args);
if ((m = this:get_value("missile")) > 0)
  this:set_value("missile", -1);
  this:become_missile();
  `this:moveto(new = (old = this.location).location) ! ANY';
  if (this.location == new)
    this:maybe_retrieve(old);
  else
    `this:moveto(rpg.cemetery) ! ANY => move(this, rpg.cemetery)';
    old:tell("Your ", this:title(), " breaks.");
  endif
elseif (m)
  this:set_value("missile", 0);
  this:become_melee();
endif
return r;
"Mooshie (#106469) - Sun Jan  4, 1998 - New version that's a lot faster.";
.

@verb #10898:"maybe_retrieve" this none this
@program #10898:maybe_retrieve
{who} = args;
(rpg = $local.rpg):secure();
if ((((valid(doll = rpg:get_doll(who)) && this.retrievable) && (this.location == who.location)) && (rpg:resolve(who, "retrieve", -33) > 0)) && (!valid(doll.mounted)))
  fork (0)
    if (this.location != who.location)
      return;
    elseif (valid(this) && (parent(this) != $garbage))
      `this:moveto(who) ! ANY => move(this, who)';
      if (this.location == who)
        rpg:say_action(this.retrieve_msg, who, this);
        this:set_value("missile", 0);
        this:become_melee();
        this:wield();
      endif
    endif
  endfork
elseif (valid(this) && (parent(this) != $garbage))
  fork (0)
    if (!valid(doll.mounted))
      rpg:say_action(this.failed_retrieve_msg, who, this);
    else
      rpg:say_action(this.mounted_failed_retrieve_msg, who, this);
    endif
  endfork
endif
"Mooshie (#106469) - Mon Jan  5, 1998 - Added";
"THX (#105941) - Tue Feb 15, 2000 - Added Hydros' failed_retrieve_msg announcement and double-checked thrown object location before retrieval.";
"Hannibal (#104762) - Sat Oct 28, 2000 - Added checks and message for mounted players.";
.

"***finished***