"A dump of #15623 (Body Area)

@create $root_class named generic body area:generic body area,body part,body area,area,part,appendage
@prop #15623."coverage" 0 rc
@prop #15623."shock_mod" 0 rc
@prop #15623."stun_resistance" 0 rc
@prop #15623."attack_mod" 0 rc
@prop #15623."parry_mod" 0 rc
@prop #15623."nat_prot" 0 rc
"#15623.("key") => E_PERM (Permission denied)
;;#15623.("aliases") = {"generic body area", "body part", "body area", "area", "part", "appendage"}
;;#15623.("description") = "A part of YOUR body.  Guard it well, lest it be sliced and diced by some mad hacker."
;;#15623.("object_size") = {4239, 1141286561}

@verb #15623:"coverage shock_mod stun_resistance attack_mod parry_mod nat_prot" this none this
@program #15623:coverage
":*(character[, attacker[, weapon]])";
"Descriptions for each stat follow.  Bracketed numbers are suggested ranges.";
".coverage";
"-> % of body the part covers, for random area determination.  [1..100]";
".shock_mod";
"-> Modifer when checking shock from wounds to this area.  [-30..0]";
".stun_resistance";
"-> How resistant the area is against being stunned. [0..100]";
".attack_mod";
"-> Attacker's mod when aiming for the area.  [-30..30]";
".parry_mod";
"-> Defender's mod when parrying an attack aimed for the area.  [-30..30]";
".nat_prot";
"-> Natural armor protection added to :armour of defendant. [0-3]";
return this.(verb);
"Quinn 22-OCT-93 0328: Added.";
"Profane 20-JAN-96 0930: Added nat_prot bit.";
.

@verb #15623:"title" this none this rx
@program #15623:title
":title(whose-body) -> The name of this body area, allowing for customisation by characters.";
"Note that, for the moment, due to speed considerations and -wanting- to allow Non-GM PCs to customise their parts, this does not check permissions on the custom verb.";
"If this becomes a problem, a permissions check will be included.  Knowing a few PCs as I do, it probably will.";
{?who = #-1} = args;
if (valid(who) && (typeof(custom = who:get_body_area_name(this)) == STR))
  return custom;
else
  return pass(who);
endif
"Quinn 22-OCT-93 0328: Added.";
.

@verb #15623:"make_fertile" this none this
@program #15623:make_fertile
"Usage: make_fertile()  => Makes this temporarily fertile if permitted.";
"       make_fertile(1) => Resets this to unfertile.";
$local.rpg:secure();
if (args)
  this.f = 0;
elseif (this.f)
else
  this.f = 1;
  fork (0)
    this.f = 0;
  endfork
endif
.

@verb #15623:"moveto" this none this
@program #15623:moveto
if (`caller.dest ! ANY' in {E_PROPNF, E_INVIND})
elseif (caller != this)
  $local.rpg:log_error((((("Attempt to move object via exit " + $string_utils:nn(caller)) + " owned by ") + tostr(`$string_utils:nn(caller.owner) ! ANY')) + "  :  ") + toliteral(callers()));
  return E_PERM;
endif
cp = (caller_perms() in (rpg = $local.rpg).probation) ? $no_one | caller_perms();
{dest} = args;
if (valid(dest) || (cp in rpg.gms))
elseif (caller != this)
  for t in (callers())
    if (index(t[2], "eject") && t[3].wizard)
      rpg.vacuum:back_in_play(this);
    endif
  endfor
endif
doll = rpg:get_doll(place = this.location);
if (((valid(doll) && valid(dest)) && (dest.location == place)) && (!(dest.owner in rpg.gms)))
  return 0;
endif
if (cp in rpg.gms)
  pass(dest);
elseif ((((caller == place) || ((caller == this) && (caller_perms() == place))) && valid(dest)) && ((dest in {place.location, place}) || (dest.location == place)))
  pass(dest);
elseif (cp.wizard)
  (callers()[1][2] == "eject") || rpg:log_error((((("Wizard-permed move via " + $string_utils:nn(caller)) + " owned by ") + tostr(`$string_utils:nn(caller.owner) ! ANY')) + "  :  ") + toliteral(callers()));
  pass(dest);
else
  return 0;
endif
return 0;
.

"***finished***