generic monster #259

Parent #7680Owner Flags Source rpg_march_2006/monster.txt

Aliases: generic monster, monster

70 verbs · 39 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
actthis none this#25912
acceptablethis none this#2595
dutythis none nonerxd#25924
look_selfthis none this#25910
armourthis none this#2593
abortthis none nonerxd#25927
recyclethis none this#25911
movetothis none this#25911
procrastinatethis none this#2594
look_gearthis none this#2593
initializethis none this#25914
notify_attack notify_aggression notify_death notify_arrival notify_exit notify_hit notify_miss notify_dodge notify_parry notify_bully notify_salutethis none this#25924
locationthis none this#2591
sub_minethis none this#2594
is_controllable_bythis none this#2592
tell_contentsthis none this#25926
get_body_area_namethis none thisrx#2598
go_homethis none this#25924
equip_minethis none this#25936
prime_minethis none this#2599
rot_corpsethis none thisrx#25915
announce_deaththis none this#25919
corpse_msgthis none this#2593
get_corpse(19Apr2001)this none thisrx#25933
deposit_remainsthis none this#25912
deposit_lootthis none thisrx#25915
set_body set_corpsethis none thisrx#25927
descriptionthis none this#25915
magic_effectthis none thisrx#25911
diethis none this#25954
cancel_rebirththis none this#2595
set_generic_equipmentthis none this#25922
make_generic_equipmentthis none this#25923
set_special_equipmentthis none this#25919
make_special_equipmentthis none thisrx#25931
set_minethis none this#2595
check_minethis none this#2597
look_healththis none this#2591
set_iprop add_ipropthis none this#25927
remove_ipropthis none this#25915
init*ial_levelsthis none this#25915
flatlinethis none this#2594
pick_aggressorthis none this#2591
spell_deflection_msgthis none this#2593
wherearethis none none#25912
receive_damage_poisonthis none this#2599
random_hit_locationthis none this#2591
set_animalthis none this#25918
notify_forgivethis none this#2592
get_ipropthis none this#2597
removalthis none this#2596
get_valuethis none this#2595
set_valuethis none this#2599
reinitializethis none this#25922
birththis none nonerxd#25924
set_last_attackerthis none this#2593
ok_alive_locthis none this#2592
moveto(old)this none this#25917
do_follow do_unfollowthis none this#2596
wealth_minethis none this#25926
make_fertilethis none this#25912
magic_effect(obsolete)this none thisrx#25910
set_homethis none this#2595
hidden_verbsthis none this#25928
notify_iceshellthis none this#2592
get_corpse(old)this none thisrx#25930
quietbirththis none none#2594
get_corpsethis none thisrx#25920
choose_weaponrythis none this#25929
purge_AHaBthis none this#2599

Properties

PropertyDefinerFlagsOwnerValue
locations#259rc{"head", "left arm", "right arm", "chest", "neck", "abdomen", "right hand", "left hand", "right leg", "left leg", "left foot", "right foot"}
doll#259r#-1
alive#259r0
body#259r#-3
animal#259r0
cemetery#259rc#1131
gestate#259rc1000
die_words#259rc0
nat_prot#259rc0
mine#259r{}
mine_quality#259rc100
corpse_msg#259rc"A stinking pile of flesh and bone meal. Worms crawl in and out of the hollow orbits of %p naked skull, squirming in the goo that was once %p mind."
magic_resist#259rc0
generic_equipment#259r{}
special_equipment#259r{}
default_cast_msg#259rc"%N %<waves> %p arms and %<mutters> weird syllables."
spell_deflection_msg#259rc"%N %<deflects> the spell with an occult gesture."
flags#259r{}
initial_props#259not readable (E_PERM)
initial_levels#259not readable (E_PERM)
last_attacker#259r#2
money#259not readable (E_PERM)
spell_immunities#259not readable (E_PERM)
props_to_clear_upon_death#259r
value (216 chars){"wielding", "wearing", "aggressor", "misc_notes", "combat_effects", "magic_effects", "connect_effects", "casting_effects", "freeze_effects", "view_effects", "armour_effects", "schedule", "att_schedule", "paralyzed"}
item_get_msg#259rc"You fill the %[dname] with %[tvial_name] from the %t."
item_oget_msg#259rc"%N fills the %[dname] with %[tvial_name] from the %t."
item_get_empty_msg#259rc"You attempt to fill the %[dname] with %[tvial_name] from %t, but %t holds no more %[tvial_name]."
item_oget_empty_msg#259rc"%N %<attempts> to fill the %[dname] with %[tvial_name] from %t, but %t holds no more %[tvial_name]."
corpse_name#259rc0
vial_item#259rc{#6468}
seek_failed_msg#259"%n bounces off a topographical barrier."
home2#259#175
home#259#175
brief#2591
simulating#2590
listen_actions#259{}
key#259not readable (E_PERM)
aliases#259{"generic monster", "monster"}
object_size#259{61307, 1141286558}

Ancestry

Ancestors (nearest first): #7680 Generic Puppet

Children: #5430 Generic Follower

Call graph

calls n259_0 #259:act n259_8 #259:procrastinate n259_0->n259_8 n259_2 #259:duty n259_36 #259:check_mine n259_2->n259_36 n259_19 #259:prime_mine n259_2->n259_19 n259_18 #259:equip_mine n259_2->n259_18 n259_59 #259:wealth_mine n259_2->n259_59 n259_20 #259:rot_corpse n259_2->n259_20 n259_17 #259:go_home n259_2->n259_17 n259_35 #259:set_mine n259_36->n259_35 n259_32 #259:make_generic_equipment n259_36->n259_32 n259_34 #259:make_special_equipment n259_36->n259_34 n259_49 #259:get_iprop n259_18->n259_49 n259_59->n259_35 n259_26 #259:set_body n259_20->n259_26 n259_7 #259:moveto n259_17->n259_7 n259_3 #259:look_self n7680_7 #7680:look_self n259_3->n7680_7 n259_37 #259:look_health n259_3->n259_37 n259_9 #259:look_gear n259_3->n259_9 n259_15 #259:tell_contents n259_3->n259_15 n259_6 #259:recycle n259_5 #259:abort n259_6->n259_5 n259_7->n259_17 n7680_4 #7680:moveto n259_7->n7680_4 n259_56 #259:ok_alive_loc n259_7->n259_56 n259_10 #259:initialize n7680_24 #7680:initialize n259_10->n7680_24 n259_13 #259:sub_mine n259_13->n259_35 n259_14 #259:is_controllable_by n259_26->n259_14 n259_24 #259:deposit_remains n259_67 #259:get_corpse n259_24->n259_67 n259_25 #259:deposit_loot n259_24->n259_25 n259_29 #259:die n259_29->n259_7 n259_29->n259_24 n259_21 #259:announce_death n259_29->n259_21 n259_31 #259:set_generic_equipment n259_31->n259_14 n259_33 #259:set_special_equipment n259_33->n259_14 n259_38 #259:set_iprop n259_39 #259:remove_iprop n259_38->n259_39 n259_54 #259:birth n259_54->n259_2 n259_30 #259:cancel_rebirth n259_54->n259_30 n259_53 #259:reinitialize n259_54->n259_53 n259_57 #259:moveto(old) n259_57->n259_17 n259_57->n259_56 n259_58 #259:do_follow n7680_22 #7680:do n259_58->n7680_22 n259_63 #259:hidden_verbs n7680_9 #7680:monitor_ok n259_63->n7680_9 n259_65 #259:get_corpse(old) n259_22 #259:corpse_msg n259_65->n259_22 n259_66 #259:quietbirth n259_66->n259_54

Showing 48 of 49 verbs; 1 not shown.

Source

act

Spec this none thisDefiner #259

Referenced by

none

Source

1if (this.alive)
2  $local.rpg:secure();
3  doll = this.doll;
4  if ((typeof(doll.aggressor) == LIST) && doll.aggressor)
5    return (!doll:cannot_attack()) && doll:hit_aggressor();
6  else
7    return (!doll:cannot_move()) && this:procrastinate();
8  endif
9endif
10return $nothing;
11"THX1138 15-Apr-1997 -- Upgraded security and saved a few ticks.";
12"Profane (#30788) - Tue Mar  9, 1999 - added paralysis checks.";

acceptable

Spec this none thisDefiner #259

Referenced by

none

Source

1{what} = args;
2rpg = $local.rpg;
3return (what in this.mine) || ((caller_perms() in rpg.gms) && rpg.object_db:is_thing(what));
4"return (args[1] in this.mine) || ((caller_perms() in $local.rpg.gms) && $object_utils:isa(args[1], $local.rpg.thing));";
5"THX (#105941) - Fri Apr 20, 2001 - Upgrade.";

duty

Spec this none noneFlags rxdDefiner #259

Referenced by

Source

1"Duty the monster.";
2"- check objects in minelist, returning unique ones and replacing others.";
3"- set condition of all weapons in the minelist.";
4"- wield any weapons and/or armour in the minelist.";
5"- dispose of the corpse (if any).";
6"- send the monster to its home.";
7(rpg = $local.rpg):secure_x();
8if (valid(doll = this.doll) && (parent(doll) != $garbage))
9  doll.aggressor = doll.wielding = doll.wearing = {};
10  rpg:s_i_n();
11  this:check_mine();
12  this:prime_mine();
13  rpg:s_i_n();
14  this:equip_mine();
15  this:wealth_mine();
16  this:rot_corpse();
17  this.alive = 1;
18  this:go_home();
19  if (!callers())
20    player:tell($string_utils:nn(this), " on duty in ", $string_utils:nn(this.location), ".");
21  endif
22else
23  return E_NONE;
24endif

look_self

Spec this none thisDefiner #259

Referenced by

none

Source

1pass(@args);
2if (this.animal)
3  this:look_health();
4  this:look_gear();
5else
6  this:tell_contents(this:contents());
7  this:look_health();
8  this:look_gear();
9endif
10"DR 04-AUG-94 -- Change in order to make NPCs look more like players.";

armour

Spec this none thisDefiner #259

Referenced by

none

Source

1":armour(penetration, hit-location[, attacker, weapon-used, damage])";
2return (this.nat_prot * args[1]) + this.doll:protection(@args);
3"THX1138 15-Apr-1997 -- Copied old verb to armour(old) and sped the thing up.";

abort

Spec this none noneFlags rxdDefiner #259

Referenced by

Source

1"abort <monster> -- Kill the monster's doll.";
2rpg = $local.rpg;
3who = callers() ? caller_perms() | player;
4if (caller == this)
5elseif (!(who in {@rpg.grand_masters, this.owner}))
6  return E_PERM;
7endif
8s_u = $string_utils;
9if (valid(doll = rpg:get_doll(this)))
10  rpg.recycler:_recycle(doll);
11  msg = s_u:nn(this) + " is no longer alive.";
12else
13  msg = s_u:nn(this) + " is not alive.";
14endif
15if (!callers())
16  who:tell(msg);
17  check = $object_utils:all_contents(this);
18  for t in ({@this.mine, @this.special_equipment})
19    check = setadd(check, t);
20  endfor
21  for t in (check)
22    `t.unique ! ANY => 0' || (check = setremove(check, t));
23  endfor
24  check && who:tell(s_u:nn(this), " has unique items in its possession.  Please check the following carefully: ", s_u:nn(check));
25endif
26this.doll = $nothing;
27this.alive = 0;

recycle

Spec this none thisDefiner #259

Referenced by

none

Source

1"Abort a rebirth and recalculate list of monsters.";
2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
3  return E_PERM;
4endif
5this:abort();
6if (this.owner in $local.rpg.gms)
7  fork (0)
8    $local.rpg.vacuum:update_monsters();
9  endfork
10endif
11return pass(@args);

moveto

Spec this none thisDefiner #259

Referenced by

Source

1if ((rpg = $local.rpg):trusted(caller_perms()))
2elseif ((caller == this) || $perm_utils:controls(caller_perms(), this))
3elseif (rpg:trusted(caller.owner) && (((typeof(source = `caller.source ! E_PROPNF, E_PERM => 0') == OBJ) && valid(source)) ? source == this.location | 1))
4else
5  return E_PERM;
6endif
7p = pass(@args);
8if (this.alive)
9  this:ok_alive_loc(this.location) || this:go_home();
10endif
11return p;

procrastinate

Spec this none thisDefiner #259

Referenced by

Source

1if ($local.rpg:trusted(caller_perms()) && valid(doll = this.doll))
2  doll.act = 0;
3endif
4return $nothing;

look_gear

Spec this none thisDefiner #259

Referenced by

Source

1if ((this.animal in {"phantom", "corpse"}) || (!this.animal))
2  $local.rpg:look_gear(this, @args);
3endif

initialize

Spec this none thisDefiner #259

Referenced by

none

Source

1":initialize() -- Update the monster population in ~vacuum.";
2if ((caller != this) && (!$perm_utils:controls(caller_perms(), this)))
3  return E_PERM;
4endif
5rpg = $local.rpg;
6if (this.owner in rpg.gms)
7  fork (0)
8    rpg.vacuum:update_monsters();
9  endfork
10endif
11this.doll = $nothing;
12"this.rebirth_task = 0;";
13return pass(@args);
14"Profane 17-APR-97 -- ensure .doll is invalid";

notify_attack notify_aggression notify_death notify_arrival notify_exit notify_hit notify_miss notify_dodge notify_parry notify_bully notify_salute

Spec this none thisDefiner #259

Referenced by

Source

1":notify_attack(OBJ attacker, OBJ defender[, OBJ weapon])";
2"-- Whenever someone is attacked.";
3":notify_aggression(OBJ attacker, OBJ defender[, OBJ weapon])";
4"-- The first time someone is attacked.";
5":notify_death(OBJ victim[, OBJ killer])";
6"-- When someone is killed.";
7"";
8":notify_arrival(OBJ who, OBJ exit)";
9":notify_exit(OBJ who, OBJ exit)";
10"-- When someone enters or leaves the room.  If they teleported, `exit' will be $nothing.";
11"";
12":notify_payment(OBJ from, NUM amount, STR denomination, NUM worth)";
13"-- When someone gives money to your monster.  `worth' is the unit worth of the given denomination.  Multiple that value by `amount' to get the full worth of the transaction.";
14"";
15"notify_hit(OBJ attacker, OBJ defender, OBJ weapon, STR location, NUM|STR severity, NUM damage)";
16"notify_miss(OBJ attacker, OBJ defender[, OBJ weapon])";
17"notify_dodge(OBJ attacker, OBJ defender[, OBJ weapon])";
18"notify_parry(OBJ attacker, OBJ defender[, OBJ weapon])";
19"notify this monster that one of the above has occurred.";
20"notify_bully(OBJ bully, OBJ bully-ee, OBJ weapon)";
21"-- When someone uses `bully monster with <weapon>'";
22"notify_salute(OBJ saluter, OBJ salutee, OBJ armour)";
23"-- When someone salutes this in some way with their headgear.  For practical application, an example might be checking for the default salute_msg, which a monster might recognize as courtesy and react in kind.";
24return;

location

Spec this none thisDefiner #259

Referenced by

none

Source

1return this.location;

sub_mine

Spec this none thisDefiner #259

Referenced by

none

Source

1"HACKED by Quinn (a little too late) 22-APR-93.  No longer needs wizperms.";
2if ((caller_perms() == #259.owner) && (p = args[1] in (mine = this.mine)))
3  this:set_mine(listset(mine, args[2], p));
4endif

is_controllable_by

Spec this none thisDefiner #259

Referenced by

Source

1":is_controllable_by(caller_perms())";
2return $perm_utils:controls(p = args[1], this) || $local.rpg:is_grandmaster(p);

tell_contents

Spec this none thisDefiner #259

Referenced by

Source

1":tell_contents(list)";
2"Called from :look_self()";
3c = args[1];
4if ($recycler:valid(doll = this.doll))
5  "These things have already been shown by 'look_gear'";
6  for each_thing in ({@doll:wielding(), @doll.wearing})
7    c = setremove(c, each_thing);
8  endfor
9endif
10if (c)
11  longear = gear = {};
12  width = player:linelen();
13  half = width / 2;
14  player:tell("Carrying:");
15  for thing in (c)
16    cx = tostr(" ", thing:title());
17    if (length(cx) > half)
18      longear = {@longear, cx};
19    else
20      gear = {@gear, cx};
21    endif
22  endfor
23  player:tell_lines($string_utils:columnize(gear, 2, width));
24  player:tell_lines(longear);
25endif
26"Profane 26-APR-97 1248PDT -- s/valid/$recycler:valid";

get_body_area_name

Spec this none thisFlags rxDefiner #259

Referenced by

none

Source

1":get_body_area_name(OBJ body_area)";
2if ((names = this.locations) == $local.rpg.monster.locations)
3  return E_NONE;
4elseif (i = args[1] in this.doll.body_areas)
5  return names[i];
6else
7  return E_NONE;
8endif

go_home

Spec this none thisDefiner #259

Referenced by

Source

1":go_home() -- Send the monster home.";
2"If the home's an exit, :move it through.  Else just move it into the room.";
3(rpg = $local.rpg):secure();
4if (!valid(home = this.home))
5  this.owner:tell(this.name, " (", this, ") is homeless.");
6elseif (this.location == home)
7  "It's *already* home, no need to do anything.";
8  return;
9elseif ($object_utils:isa(home, $exit))
10  valid(this.location) || this:moveto(rpg.cemetery.turf[1]);
11  (this.location == `home.dest ! E_PERM') || home:move(this);
12else
13  try
14    home:acceptable(this) && this:moveto(home);
15    if (this.location != home)
16      this.owner:tell(this.name, " (", this, "):go_home() fails because its home is not accepting it.  Player: ", #20:nn(player), "  Callers: ", toliteral(callers(1)), "  Current location: ", #20:nn(this.location));
17      this:moveto(rpg.cemetery.turf[1]);
18    endif
19  except e (ANY)
20    this.owner:tell(this.name, " (", this, "):go_home() fails with ", e[2]);
21    this:moveto(rpg.cemetery.turf[1]);
22  endtry
23endif
24"Hannibal 9/9/99 - Added try statement and home:acceptable(this) check";

equip_mine

Spec this none thisDefiner #259

Referenced by

Source

1":equip_mine()";
2"Loop through the monster's mine list, wearing and wielding what it can.";
3(rpg = $local.rpg):secure();
4hands = (doll = this.doll).hands;
5{weapon, armour, hand_and_a_half, natural_weapon, vacuum} = {rpg.weapon, rpg.armour, rpg.hand_and_a_half, rpg.natural_weapon, rpg.vacuum};
6size = doll.size;
7for foo in (this.mine)
8  if (valid(foo) && (parent(foo) != $garbage))
9    if (foo.location != this)
10      foo:moveto(this);
11    endif
12    anc = rpg:parents(foo);
13    if (hand_and_a_half in anc)
14      foo:((hands == 1) ? "one" | "two")();
15    elseif ((natural_weapon in anc) && (this:get_iprop("natural_weapons") == E_PROPNF))
16      doll.natural_weapons = setremove(doll.natural_weapons, rpg.fists);
17      doll.natural_weapons = setadd(doll.natural_weapons, foo);
18    endif
19    if ((weapon in anc) && (hands >= foo:hands(this, $nothing)))
20      hands = hands - foo:hands(this, $nothing);
21      doll.wielding = setadd(doll.wielding, foo);
22      foo:do_wield(this);
23    elseif (armour in anc)
24      doll.wearing = setadd(doll.wearing, foo);
25      foo:do_wear(this);
26      if (size != 10)
27        (vacuum:unique(foo) || ((foo.worn_area in {"necklace", "amulet"}) && (size > 5))) || (foo.size = (foo.size * size) / 10);
28      endif
29    endif
30    rpg:s_i_f_i_n();
31  else
32    this.mine = setremove(this.mine, foo);
33  endif
34endfor
35"Profane (#30788) - Tue Apr 20, 1999 - changed .hands to :hands() line 18-19";
36"THX (#105941) - Tue Apr 25, 2000 - Added a hickety hack to size the monster's armour up/down to its size as needed.";

prime_mine

Spec this none thisDefiner #259

Referenced by

Source

1":prime_mine()";
2"Prepare this monster's equipment to be readied.  Right now, this just means setting the `condition' of everything to `mine_quality'.";
3(rpg = $local.rpg):secure();
4qual = this.mine_quality;
5for foo in (this.mine)
6  if (((typeof(old = `foo.condition ! E_PROPNF => E_PROPNF') == NUM) && (old != qual)) && (!(foo.unique && (foo in this.generic_equipment))))
7    foo:set_condition(qual);
8  endif
9endfor

rot_corpse

Spec this none thisFlags rxDefiner #259

Referenced by

Source

1":rot_corpse() -- Rot this monster's corpse, if it exists and is a child of $local.rpg.corpse.";
2(rpg = $local.rpg):secure();
3body = this.body;
4if (body in rpg.object_db.generic_corpses)
5elseif (!body.is_corpse)
6  this:set_body(valid(body) ? rpg.corpse | $failed_match);
7  return E_NONE;
8else
9  body:rot();
10  this:set_body($recycler:valid(this.body) ? this.body | rpg.corpse);
11endif
12"Quinn 01-DEC-93 0244: Added.";
13"Quinn 03-DEC-93 0114: Added :set_body call so you get a corpse more than just once.";
14"StarDancer 16-DEC-95 added 'nother :set_body call so's a swept corpse 'll get put back too.";
15"THX (#105941) - Thu Apr 19, 2001 - Changed 1's to rpg.corpse";

announce_death

Spec this none thisDefiner #259

Referenced by

Source

1":announce_death([killer])";
2"Announce the die words of this beast to its location.";
3"Sub %N for dead monster and %D for killer (if given).";
4rpg = $local.rpg;
5if ($list_utils:assoc(rpg.magic_db, callers(), 4))
6  "Death occured as a result of a damage-dealing spell. These have their own death messages, therefore the monster doesn't need to spew it's own scene.";
7  return;
8elseif ((elm = $list_utils:assoc("critical_hit", callers(), 2)) && elm[1].handles_death_msg)
9  return;
10endif
11if (msg = this.die_words)
12  {?killer = $nothing} = args;
13  msg = $string_utils:pronoun_sub(msg, this, this, where = this.location, killer);
14  for line in ((typeof(msg) == LIST) ? msg | {msg})
15    rpg:rpg_announce_all_but(where, {this}, line);
16  endfor
17endif
18"THX1138 15-Apr-1997 -- Scatter assignment, and saved a few ticks.";
19"Profane (#30788) - Sun Mar 28, 1999 - just exit if death occurs from spell. So incinerated monsters don't dance around and expire in a pool of blood, they just incinerate.";

corpse_msg

Spec this none thisDefiner #259

Referenced by

Source

1":corpse_msg()";
2"-> What this monster's spawn of generic corpse should look like.";
3return $string_utils:pronoun_sub(this.corpse_msg, this);

get_corpse(19Apr2001)

Spec this none thisFlags rxDefiner #259

Referenced by

none

Source

1":get_corpse([killer])";
2"Get a corpse for this monster, dependant on the value of `body'.";
3"If body == #x and #x is valid and a child of $local.rpg.corpse, use that custom corpse.";
4"If body == 1 (or any true value), create a new corpse and describe it as `corpse_msg'.";
5"If a corpse is found, return {#corpse}.  Else, return false.";
6"`killer' is who killed the beast.  Provided for future customization.";
7{?killer = $nothing} = args;
8(rpg = $local.rpg):secure();
9body = this.body;
10mama_corpse = rpg.corpse;
11if (`body.is_corpse ! E_PROPNF => 0')
12  "body.time_of_death = time();";
13  "return {body};";
14elseif ((body != 1) && (!valid(body)))
15  return E_NONE;
16elseif (typeof(body = rpg.recycler:_create(mama_corpse)) != OBJ)
17  return E_QUOTA;
18endif
19body:prep_corpse(this, killer);
20"body:set_name(name = \"corpse of \" + this.name);";
21"body:set_aliases({name, \"corpse\", this.name, \"body\", \"cadaver\"});";
22"body:set_description(this:corpse_msg());";
23"body.victim = this;";
24"body.time_of_death = time();";
25"body.encumbrance = this.doll.size * 9;";
26"if (((\"demon\" in (aliases = this.aliases)) || (\"avatar\" in aliases)) || (\"devil\" in aliases))";
27"  body.vial_item = this.fluids[2];";
28"  body.vial_name = body.vial_item.name;";
29"elseif (\"golem\" in aliases)";
30"  body.vial_item = $nothing;";
31"endif";
32return {this.body = body};
33"THX (#105941) - Thu Mar 22, 2001 - Moved configuration to body:prep_corpse(this, killer).";

deposit_remains

Spec this none thisDefiner #259

Referenced by

Source

1":deposit_remains([killer])";
2"If a corpse exists; get it, move all our loot inside it, and move it to this location.";
3"If no corpse; move this loot to this location.";
4"`killer' is who killed the beast, passed for the benefit of :deposit_loot.";
5$local.rpg:secure();
6if (corpse = this:get_corpse())
7  corpse = corpse[1];
8  corpse:moveto(this.location);
9  return this:deposit_loot(corpse, @args);
10endif
11return this:deposit_loot(this.location, @args);
12"THX1138 15-Apr-1997 --  Copied old code to #259:deposit_remains(old) and rewrote with faster security and layout.";

deposit_loot

Spec this none thisFlags rxDefiner #259

Referenced by

Source

1":deposit_loot([location[, killer]])";
2"Move all equipment (except those with a false .:keep_at_death) to the given location, which defaults to the monster's location.";
3"`killer' is who killed the beast.  Provided for special occasions where, for example, you may want to deprive a dishonorable killer of the post-mortem prize.  Similiarly passed to :keep_at_death.";
4$local.rpg:secure();
5{?where = this.location, ?killer = $nothing} = args;
6for loot in (this:contents())
7  if (!loot:keep_at_death(killer))
8    loot:moveto(where);
9    if ((!(loot in this.special_equipment)) && `loot.condition != E_NONE ! ANY => 0')
10      loot.condition = (min(loot.condition, 100) * (random(3) + 5)) / 8;
11    endif
12  endif
13endfor
14"THX1138 - 15-Apr-1997 -- Upgraded security.  Scatter assignment.  Copied old verb to #259:deposit_loot(old).";
15"dalton (#116601) - Mon Jul  7, 2003 - Dropped loot will be a little degraded.  Make 'em get it repaired.";

set_body set_corpse

Spec this none thisFlags rxDefiner #259

Referenced by

Source

1":set_body(OBJ corpse)";
2"Set the corpse to be deposited when this creature dies.";
3"#xxxxx -- If a caller-controlled kid of $local.rpg.corpse, use that object.";
4"1      -- Create a generic corpse described as this.corpse_msg.";
5"$failed_match -- No corpse.";
6{corpse} = args;
7rpg = $local.rpg;
8if (corpse == 1)
9  corpse = rpg.corpse;
10elseif (corpse == 0)
11  corpse = $failed_match;
12endif
13cp = caller_perms();
14if ((caller != this) && (!this:is_controllable_by(cp)))
15  return E_PERM;
16elseif (typeof(corpse) != OBJ)
17  return E_TYPE;
18elseif (corpse == $failed_match)
19  return this.body = corpse;
20elseif (!corpse.is_corpse)
21  return E_INVARG;
22elseif ((corpse.owner == cp) || ((corpse.owner in rpg.gms) && (!corpse.is_specific)))
23  return this.body = corpse;
24else
25  return E_NACC;
26endif
27"THX (#105941) - Thu Apr 19, 2001 - Modified to convert old accepted INT arguments to new object-only arguments.";

description

Spec this none thisDefiner #259

Referenced by

none

Source

1"Runs the description through pronoun_sub.";
2rpg = $local.rpg;
3if ((this.alive && (callers()[$][2] in {"@exam", "@examine"})) && (!(player in {@rpg.gms, @rpg.wannabees})))
4  player:tell("Use 'examine' rather than '@examine' to look at LambdaRPG monsters.");
5  kill_task(task_id());
6endif
7name = this:titlec();
8desc = $string_utils:pronoun_sub(this.description, this, this, this.location, player);
9desc = (typeof(desc) == LIST) ? desc | {desc};
10desc = index(desc[1], name) ? desc | listinsert(desc, name, 1);
11(this == #79322) && (desc = desc[1]);
12return desc;
13"Copied from Almost Human Bastard (#6475):description by Quinn (#19845) Wed Mar 16 16:55:06 1994 PST";
14"THX (#105941) - Tue Nov 24, 1998 - Hacked this to prepend the critter's name if it isn't already there.";
15"THX (#105941) - Tue Oct  3, 2000 - Hacked for dirt golem until Bartlebooth can fix it.";

magic_effect

Spec this none thisFlags rxDefiner #259

Referenced by

none

Source

1":magic_effect(OBJ caster doll, OBJ target doll, NUM spell quality, OBJ spell skill) => NUM number directly SUBTRACTED from spell quality. i.e. magic resistance.";
2"A simple hack to replace the old direct property ref..";
3{caster_doll, target_doll, quality, spell} = args;
4this = target_doll.character;
5if ((spell in this.spell_immunities) && (caller_perms() in $local.rpg.gms))
6  return 999;
7elseif (spell.resist)
8  return this.doll.(spell.resist);
9endif
10return this.magic_resist || 0;
11"THX (#105941) - Tue Jan  4, 2000 - Added a spell_immunities property so that individual spells can be resisted easily without coding a whole verb.";

die

Spec this none thisDefiner #259

Referenced by

none

Source

1":die([killer]) -- KILL THE BEAST";
2"- schedule a task to rebirth";
3"- remove monster from aggressors list of all in vicinity";
4"- clear monster's doll's wielding, wearing and aggressor lists";
5"- announce the death to the corpse location";
6"- deposit remains (corpse, loot, burial)";
7(rpg = $local.rpg):secure();
8cemetery = `this.cemetery ! E_PROPNF => rpg.cemetery';
9if ((!this.alive) && (this.location == cemetery))
10  return E_NONE;
11endif
12this.alive = 0;
13if (this.gestate > 0)
14  rpg.clock:add_death(this);
15endif
16for who in (this.location:contents())
17  if (valid(doll = rpg:get_doll(who)))
18    doll.aggressor = setremove(doll.aggressor, this);
19  endif
20endfor
21doll = this.doll;
22for property in (this.props_to_clear_upon_death)
23  clear_property(doll, property);
24endfor
25claimed_stuff = doll.claimed_objects;
26fork (rpg.gm_lag / 2)
27  for item in (claimed_stuff)
28    "Remove claim data from objects.";
29    rpg:s_i_f_i_n();
30    if ((valid(item) && rpg.object_db:is_thing(item)) && (item.claimed_by == this))
31      item:unclaim_for(item.claimed_by);
32      if (item.claimed_by != this)
33        `doll.claimed_objects = setremove(doll.claimed_objects, item) ! ANY';
34      endif
35    endif
36  endfor
37endfork
38{?killer = $nothing} = args;
39rpg:s_i_n();
40this:deposit_remains(killer);
41this:announce_death(killer);
42rpg:s_i_n();
43this:moveto(cemetery);
44fork (0)
45  rpg.death_db.slayer_db:notify_death(killer, this);
46endfork
47"Profane 17-MAR-95 13:28 -- Added (Well, changed from old :die() to use new resurrection queue)";
48"Slither 29-JUN-95 00:16 -- Added erasing of claimed objects.";
49"THX1138 15-Apr-1997 -- Upgraded security, scatter assignment, and saved a few ticks.";
50"Profane (#30788) - Tue May  8, 2001 - Erm clear out them new effect properties, yah?";
51"Profane (#30788) - Sun May 27, 2001 - Move all that resetting props into a for loop with a property reference, what a concept.";
52"Hannibal (#104762) - Monday May 13, 2002 - Only remove items from .claimed_objects that are no longer claimed.";
53"Hydros (#106189) - Sun Aug 28, 2005 - Added a couple :s_i_n() calls to tackle the `zombified' monster problem we've been having--id est, monsters becoming !.alive, without moving to their proper resting place.";
54"Hydros (#106189) - Tue Sep 20, 2005 - Added :notify_death call for Everin's Slayer Quests.";

cancel_rebirth

Spec this none thisDefiner #259

Referenced by

Source

1":cancel_rebirth() -- Kill this monster's rebirth task.";
2(rpg = $local.rpg):secure();
3rpg.clock:remove_death(this);
4"Profane 17-MAR-95 13:30EST - Changed from old :cancel_rebirth to use new resurrection queue";
5"THX1138 (#105941) - Mon Nov 16, 1998 - Rewrote with fewer ticks.  Set the verb +d.";

set_generic_equipment

Spec this none thisDefiner #259

Referenced by

none

Source

1":set_generic_equipment(LIST objects)";
2"Set the generic equipment list to a list of objects";
3"Each object should be a RPG generic";
4"Returns a list of created objects.";
5if (!((caller == this) || this:is_controllable_by(caller_perms())))
6  return E_PERM;
7endif
8newequip = args[1];
9"Rampant paranoia.  But even paranoids get E_TYPE errors.";
10if (typeof(newequip) != LIST)
11  return E_INVARG;
12endif
13for item in (newequip)
14  if (typeof(item) != OBJ)
15    return E_INVARG;
16  endif
17  "Seven's a nice number";
18  $command_utils:suspend_if_needed(7);
19endfor
20this.generic_equipment = newequip;
21return newequip;
22"5/28/95 Slither -- first version";

make_generic_equipment

Spec this none thisDefiner #259

Referenced by

Source

1":make_generic_equipment()";
2"Creates clones of generic items based upon the contents of";
3"this.generic_equipment.  The items are moved into this, and";
4"the list of created items is returned.";
5"See the comments in :set_generic_equipment for the data format";
6(rpg = $local.rpg):secure();
7dispenser = rpg.dispenser;
8stuff = {};
9for parent in (this.generic_equipment)
10  if (valid(parent) && (parent(parent) != $garbage))
11    new = dispenser:grab(parent, $nothing);
12    if ((typeof(new) == OBJ) && valid(new))
13      this.mine = setadd(this.mine, new);
14      new.name = parent.name;
15      new:moveto(this);
16      stuff = {@stuff, new};
17    endif
18  else
19    this.generic_equipment = setremove(this.generic_equipment, parent);
20  endif
21  rpg:s_i_f_i_n();
22endfor
23return stuff;

set_special_equipment

Spec this none thisDefiner #259

Referenced by

none

Source

1":set_special_equipment(LIST objects)";
2"Set the special equipment list to a list of objects";
3if (!((caller == this) || this:is_controllable_by(caller_perms())))
4  return E_PERM;
5endif
6newequip = args[1];
7"make sure its really a list of objects.";
8if (typeof(newequip) != LIST)
9  return E_INVARG;
10endif
11for item in (newequip)
12  if (typeof(item) != OBJ)
13    return E_INVARG;
14  endif
15  $command_utils:suspend_if_needed(5);
16endfor
17this.special_equipment = newequip;
18return newequip;
19"5/28/95 Slither -- first version";

make_special_equipment

Spec this none thisFlags rxDefiner #259

Referenced by

Source

1":make_special_equipment()";
2"Prepares the special equipment that the monster needs, based upon";
3"the content's of the monster's .special_equipment property.";
4"This amounts to making sure that the equipment exists, and moving";
5"it to the monster if necessary.";
6"The verb returns a list of the special equipment that was successfully gotten.";
7(rpg = $local.rpg):secure();
8stuff = {};
9trash = $garbage;
10for item in (this.special_equipment)
11  if (valid(item) && (parent(item) != trash))
12    "Good, still exists";
13    loc = item.location;
14    if ((loc != this) && (!children(item)))
15      "Stupid thing has escaped!";
16      item:moveto(this);
17      (item.location == this) && loc:tell("The ", item.name, " taken from ", this.name, " disappears.");
18    elseif (children(item) && (item.owner == rpg.owner))
19      item = rpg.recycler:_create(item);
20      item:moveto(this);
21    endif
22    if (item.location == this)
23      stuff = {@stuff, item};
24    endif
25  else
26    this.special_equipment = setremove(this.special_equipment, item);
27  endif
28  rpg:s_i_f_i_n();
29endfor
30return stuff;
31"5/28/95 Slither -- first version";

set_mine

Spec this none thisDefiner #259

Referenced by

Source

1":set_mine(LIST objects)";
2"Set the RPG equipment this monster will be dutied with.";
3"In its present form mainly for compatibility with old code.";
4$local.rpg:secure();
5return this.mine = args[1];

check_mine

Spec this none thisDefiner #259

Referenced by

Source

1":check_mine()";
2"Construct the monster's mine list from its components.";
3"Basically, mainly here for compatibility with old code.";
4"Returns new mine list.";
5$local.rpg:secure();
6mine = {@this:make_generic_equipment(), @this:make_special_equipment()};
7return this:set_mine(mine);

look_health

Spec this none thisDefiner #259

Referenced by

Source

1$local.rpg:(verb)(this, @args);

set_iprop add_iprop

Spec this none thisDefiner #259

Referenced by

none

Source

1":add_ivalue(<property>, <value>) => Adds <property> to the list of ivalues on the monster.  These are stored in a list, rather than individual properties, to save db space.  Returns old value, if existed, 0 if none, or E_PROPNF if not on the doll.";
2(rpg = $local.rpg):secure();
3if ((caller == this) || (caller_perms() in {this.owner, rpg.owner}))
4  doll = rpg.doll;
5  {prop, value} = args;
6  if (length(this.initial_levels) != length(this.initial_props))
7    player:tell("Something is amiss.  The .initial_props property is not the same length as the .initial_levels property");
8    return E_INVARG;
9  elseif ($object_utils:defines_property(doll, prop))
10    if (doll.(prop) == value)
11      this:remove_iprop(prop);
12    elseif (x = prop in this.initial_props)
13      old = this.initial_levels[x];
14      this.initial_levels[x] = value;
15      return old;
16    else
17      this.initial_levels = {@this.initial_levels, value};
18      this.initial_props = {@this.initial_props, prop};
19      return 0;
20    endif
21  else
22    return E_PROPNF;
23  endif
24else
25  return E_PERM;
26endif
27"Mooshie (#106469) - Fri Jun 12, 1998 - Made this puppy +d. Plus changed the check for a valid prop from an error trapping check to an $object_utils:defines_property, that way we can avoid stuff that would bomb the birthing task, like trying to set !c properties defined on ancestors.";

remove_iprop

Spec this none thisDefiner #259

Referenced by

Source

1":remove_iprop(<prop>) => removes prop from the list of initial values for the monster's doll.  Returns value of item deleted, or E_PROPNF, if it wasn't found.";
2(rpg = $local.rpg):secure();
3if (caller_perms() in {this.owner, rpg.owner})
4  {prop} = args;
5  if (x = prop in this.initial_props)
6    old = this.initial_levels[x];
7    this.initial_props = listdelete(this.initial_props, x);
8    this.initial_levels = listdelete(this.initial_levels, x);
9    return old;
10  else
11    return E_PROPNF;
12  endif
13else
14  return E_PERM;
15endif

init*ial_levels

Spec this none thisDefiner #259

Referenced by

none

Source

1(rpg = $local.rpg):secure_x();
2{?values_only = 0} = args;
3if (values_only)
4  return {this.initial_props, this.initial_levels};
5endif
6items = {};
7for n in [1..length(this.initial_props)]
8  items = {@items, (this.initial_props[n] + ": ") + $string_utils:from_value(this.initial_levels[n], 1, 10)};
9endfor
10l = $string_utils:columnize(items, 2, 76);
11player:tell($string_utils:center((tostr(this) + "  ") + this.name, 76, "_"));
12for x in (l)
13  player:tell(x);
14endfor
15player:tell($string_utils:space(76, "-"));

flatline

Spec this none thisDefiner #259

Referenced by

none

Source

1{?state = 0} = args;
2$local.rpg:secure();
3this.alive = state;
4"THX1138 - 23-Apr-1997 --  Added so gms can directly kill their critters at the beginning of the monster:die() that they write.";

pick_aggressor

Spec this none thisDefiner #259

Referenced by

none

Source

1return $nothing;

spell_deflection_msg

Spec this none thisDefiner #259

Referenced by

none

Source

1{?targ = this, ?by = player} = args;
2return $string_utils:pronoun_sub(this.(verb), targ, dobj = by);
3"THX (#105941) - Mon Sep 11, 2000 - Pass 'target' to pronoun_sub as first arg and 'by' as second instead of other way around.  Also set dobj = by for messaging purposes.  Altered all <monster>.spell_deflection_msg properties appropriately.";

whereare

Spec this none noneDefiner #259

Referenced by

none

Source

1"Copied from Generic Anklebiter (#8872):whereare by THX1138 (#105941) Wed Apr  9 16:43:57 1997 PDT";
2sorted = {};
3for t in ($set_utils:intersection(children(this), $local.rpg.pcs))
4  sorted = {@sorted, {t, t.name}};
5endfor
6sorted = $list_utils:sort_alist(sorted, 2);
7s_u = $string_utils;
8for t in (sorted)
9  {critnum, critter} = t;
10  player:tell(s_u:left(tostr(critter, " (", critnum, ")"), 32, " "), s_u:left(s_u:nn(critnum.location), 47));
11endfor
12player:tell("Living monsters: ", length(sorted), "  ... ", this.name, ":", verb, " complete.");

receive_damage_poison

Spec this none thisDefiner #259

Referenced by

none

Source

1"Copied from $local.rpg.monster (#1920):receive_damage_poison by Irin (#106049) Wed Mar 11 20:56:27 1998 PST";
2":receive_damage_poison(OBJ source, OBJ poison, INT quality, LIST body areas)";
3$local.rpg:secure();
4{source, poison, qual, areas} = args;
5if (this.animal in {"golem", "corpse", "demon", "phantom", "plant"})
6  return 0;
7else
8  return poison:effect(this.doll, source, qual, areas);
9endif

random_hit_location

Spec this none thisDefiner #259

Referenced by

none

Source

1return 0;

set_animal

Spec this none thisDefiner #259

Referenced by

none

Source

1(rpg = $local.rpg):secure();
2if (caller_perms() in {rpg.owner, this.owner})
3  {?animal = 0} = args;
4  if (animal in rpg.object_db.ok_animals)
5  elseif (!animal)
6    animal = 0;
7  else
8    return E_INVARG;
9  endif
10else
11  return E_PERM;
12endif
13if (parent(this).animal == animal)
14  clear_property(this, "animal");
15else
16  this.animal = animal;
17endif
18return animal;

notify_forgive

Spec this none thisDefiner #259

Referenced by

none

Source

1":notify_forgive(OBJ who) => Who wishes to cease combat with the monster.  If monsters wishes to cease combat with who, it should remove who from it's aggressor list, and remove itself from who's aggressor list, then print an appropriate message.";
2return 0;

get_iprop

Spec this none thisDefiner #259

Referenced by

Source

1(rpg = $local.rpg):secure();
2{prop} = args;
3if (slot = prop in this.initial_props)
4  return this.initial_levels[slot];
5else
6  return `rpg.doll.(prop) ! E_PROPNF => E_PROPNF';
7endif

removal

Spec this none thisDefiner #259

Referenced by

none

Source

1for s in (this.command_ok)
2  if ((s in #46.gms) || (s == #97170))
3  else
4    this.command_ok = setremove(this.command_ok, s);
5  endif
6endfor

get_value

Spec this none thisDefiner #259

Referenced by

none

Source

1if ($local.rpg:trusted(caller_perms()))
2  return this.(args[1]);
3else
4  return E_PERM;
5endif

set_value

Spec this none thisDefiner #259

Referenced by

none

Source

1":set_value(STR property_name, value) -- Sets this.(property_name) to `value'";
2{prop, value} = args;
3rpg = $local.rpg;
4if (rpg:trusted(cp = caller_perms()) && ((cp in {this.owner, rpg.thing.owner}) || (caller == this)))
5  return this.(prop) = value;
6else
7  return E_PERM;
8endif
9"THX1138 22-MAR-1997 -- Scatter assignment and s /db/rpg/g 1-$ for commonality.";

reinitialize

Spec this none thisDefiner #259

Referenced by

Source

1":reinitialize() triggers a reset of the critters stats to the setting in :init(1).";
2if (caller == this)
3  doll = this.doll;
4  rpg_doll = (rpg = $local.rpg).doll;
5  doll_props = setremove(properties(rpg_doll), "character");
6  rpg:s_i_n();
7  initial_props = this.initial_props;
8  initial_levels = this.initial_levels;
9  for slot in [1..length(initial_props)]
10    att = initial_props[slot];
11    stat = initial_levels[slot];
12    if (stat != rpg_doll.(att))
13      doll.(att) = stat;
14      doll_props = setremove(doll_props, att);
15    endif
16  endfor
17  for att in (doll_props)
18    clear_property(doll, att);
19  endfor
20  rpg:s_i_n();
21endif
22"THX (#105941) - Wed Nov  4, 1998 - Added.";

birth

Spec this none noneFlags rxdDefiner #259

Referenced by

Source

1":birth() -- Make it live!";
2"If already alive, reset stats to initial state.";
3rpg = $local.rpg;
4if (!rpg:trusted((c = callers()) ? caller_perms() | player))
5  return E_PERM;
6elseif (this.owner in rpg.gms)
7  this.doll = doll = rpg:create_pc(this);
8  "doll.free_will = 0;";
9  this:cancel_rebirth();
10  this:reinitialize();
11  this:duty();
12  if (!c)
13    player:tell($string_utils:nn(this), " has been reset with ", $string_utils:nn(doll), " as its doll.");
14  endif
15  return doll;
16else
17  return E_NACC;
18endif
19"Quinn 11-OCT-95 1150: Made verb !d, removed $object_util:has_property() check in att reset loop.";
20"Profane 28-JUN-96 2247EDT -- No fork, suspend.";
21"Profane 24-MAR-97 1043PST -- 1.8ify and PUT BACK THE DAMN SUSPEND AND YOU BETTER LEAVE IT THAT WAY GODDAMN YOU.";
22"THX (#105941) - Sun Jun  7, 1998 - Changed code to use initial_props and initial_levels instead of iprops.  Clear all other props afterwards.";
23"THX (#105941) - Tue Nov 3rd, 1998 -- Moved the iprop stuff to :reinitialize().";
24"THX (#105941) - Wed Nov  4, 1998 - Added.  Use call to :reinitialize() instead of doing the iprop stuff in here.";

set_last_attacker

Spec this none thisDefiner #259

Referenced by

none

Source

1":set_last_attacker(attacker OBJ) => this.last_attacker   sets the .last_attacker.";
2$local.rpg:secure();
3return this.last_attacker = args[1];

ok_alive_loc

Spec this none thisDefiner #259

Referenced by

Source

1{where} = args;
2return valid(where) && (where.owner in {@$local.rpg.gms, @$local.rpg.object_db.grandparented});

moveto(old)

Spec this none thisDefiner #259

Referenced by

none

Source

1rpg = $local.rpg;
2(((caller == this) || $perm_utils:controls(caller_perms(), this)) || (rpg:trusted(caller.owner) && (((typeof(source = `caller.source ! E_PROPNF, E_PERM => 0') == OBJ) && valid(source)) ? source == this.location | 1))) || rpg:secure();
3p = pass(@args);
4if (this.alive)
5  this:ok_alive_loc(this.location) || this:go_home();
6endif
7return p;
8"these = {};";
9"what = this;";
10"monster = (rpg = $local.rpg).monster;";
11"while (what != monster)";
12"  these = listappend(these, what.owner);";
13"  what = parent(what);";
14"endwhile";
15"p = rpg:trust(@these) ? pass(@args) | E_PERM;";
16"Mooshie (#106469) - Thu Dec 24, 1998 - I don't think we need the elaborate :trust call, and the :go_home setup was causing infinite loops.";
17"THX1138 (#105941) - Thu Dec 31, 1998 - Re-enabled the :go_home() feature.  Let's fix those infinite loops instead of sweeping them under the carpet.";

do_follow do_unfollow

Spec this none thisDefiner #259

Referenced by

none

Source

1"Copied from Helania (#4777):do_follow by THX1138 (#105941) Wed Sep 29 07:58:24 1999 PDT";
2rpg = $local.rpg;
3if (rpg:is_grandmaster(caller_perms()))
4  {who} = args;
5  this:do((verb[4..$] + " ") + tostr(who));
6endif

wealth_mine

Spec this none thisDefiner #259

Referenced by

Source

1":wealth_mine() => treasure list  This verb takes the contents of the monster's .money property and creates the appropriate amount of wealth.  Examples:  {{0, 0}, {6, 1}} would have the critter start with no copper and random(6) silver.  {{0, 0}, {3, 0}, {1, 0}, {4, 0}} would result in 3 silver, 1 gold, and a gem of value 40 gold.";
2loot = {};
3if (this.money)
4  (rpg = $local.rpg):secure();
5  baseline = rpg.object_db.obj_money;
6  n = 0;
7  for t in (this.money)
8    {amount, randomize} = t;
9    n = n + 1;
10    if (amount)
11      if (n < 4)
12        x = baseline[n]:mint();
13        x:set_quantity(randomize ? random(amount) | amount);
14      else
15        x = rpg.user_utils.thx1138:jewel(amount, $nothing, !randomize);
16      endif
17      loot = {@loot, x};
18    endif
19  endfor
20  loot && this:set_mine({@this.mine, @loot});
21  for t in (loot)
22    t:moveto(this);
23  endfor
24endif
25return loot;
26"THX (#105941) - Mon Oct 18, 1999 - Added.";

make_fertile

Spec this none thisDefiner #259

Referenced by

none

Source

1"Usage: make_fertile()  => Makes this temporarily fertile if permitted.";
2"       make_fertile(1) => Resets this to unfertile.";
3$local.rpg:secure();
4if (args)
5  this.f = 0;
6elseif (this.f)
7else
8  this.f = 1;
9  fork (0)
10    this.f = 0;
11  endfork
12endif

magic_effect(obsolete)

Spec this none thisFlags rxDefiner #259

Referenced by

none

Source

1":magic_effect(OBJ caster doll, OBJ target doll, NUM spell quality, OBJ spell skill) => NUM number directly SUBTRACTED from spell quality. i.e. magic resistance.";
2"A simple hack to replace the old direct property ref..";
3{caster_doll, target_doll, quality, spell} = args;
4this = target_doll.character;
5if ((spell in this.spell_immunities) && (caller_perms() in $local.rpg.gms))
6  return 999;
7endif
8return this.magic_resist || 0;
9return this.doll.(spell.resist) || 0;
10"THX (#105941) - Tue Jan  4, 2000 - Added a spell_immunities property so that individual spells can be resisted easily without coding a whole verb.";

set_home

Spec this none thisDefiner #259

Referenced by

none

Source

1{where} = args;
2if (caller == this)
3  $local.rpg:secure();
4  `this.home = where ! ANY';
5endif

hidden_verbs

Spec this none thisDefiner #259

Referenced by

none

Source

1{who} = args;
2prev = pass(who);
3monster = (rpg = $local.rpg).monster;
4if (!rpg:trusted(who))
5  ancestors = $object_utils:ancestors(this);
6  ancestors = ancestors[1..monster in ancestors];
7  for t in (ancestors)
8    prev = {@prev, {t, "birth", {"this", "none", "none"}}};
9    prev = {@prev, {t, "duty", {"this", "none", "none"}}};
10  endfor
11  prev = {@prev, {monster, "whereare", {"this", "none", "none"}}};
12endif
13if ((who != this.owner) && (!rpg:is_grandmaster(who)))
14  prev = {@prev, {monster, "abort", {"this", "none", "none"}}};
15endif
16if (!this:command_ok(who))
17  prev = {@prev, {$local.puppet, "com*mand", {"this", "at/to", "any"}}};
18endif
19if (!this:monitor_ok(who))
20  prev = {@prev, {$local.puppet, "mon*itor", {"this", "none", "none"}}};
21endif
22if (!(who in this.tell_forward))
23  prev = {@prev, {$local.puppet, "ign*ore", {"this", "none", "none"}}};
24endif
25if (who != this.owner)
26  prev = {@prev, {$gendered_object, "@gen*der", {"this", "is", "any"}}};
27endif
28return prev;

notify_iceshell

Spec this none thisDefiner #259

Referenced by

none

Source

1{type, announce} = args;
2return;

get_corpse(old)

Spec this none thisFlags rxDefiner #259

Referenced by

none

Source

1":get_corpse([killer])";
2"Get a corpse for this monster, dependant on the value of `body'.";
3"If body == #x and #x is valid and a child of $local.rpg.corpse, use that custom corpse.";
4"If body == 1 (or any true value), create a new corpse and describe it as `corpse_msg'.";
5"If a corpse is found, return {#corpse}.  Else, return false.";
6"`killer' is who killed the beast.  Provided for future customization.";
7(rpg = $local.rpg):secure();
8body = this.body;
9mama_corpse = rpg.corpse;
10if (`body.is_corpse ! E_PROPNF => 0')
11  body.time_of_death = time();
12  return {body};
13elseif (!body)
14  return E_NONE;
15elseif (typeof(body = rpg.recycler:_create(mama_corpse)) != OBJ)
16  return E_QUOTA;
17endif
18body:set_name(name = "corpse of " + this.name);
19body:set_aliases({name, "corpse", this.name, "body", "cadaver"});
20body:set_description(this:corpse_msg());
21body.victim = this;
22body.time_of_death = time();
23body.encumbrance = this.doll.size * 10;
24if ((("demon" in (aliases = this.aliases)) || ("avatar" in aliases)) || ("devil" in aliases))
25  body.vial_item = this.fluids[2];
26  body.vial_name = body.vial_item.name;
27elseif ("golem" in aliases)
28  body.vial_item = $nothing;
29endif
30return {this.body = body};

quietbirth

Spec this none noneDefiner #259

Referenced by

none

Source

1if (caller == $local.rpg.owner)
2  this:birth();
3endif
4"THX (#105941) - Sun Apr 15, 2001 - Had to add this so G_M can force_input the births from the cemetery without getting spammed with afterbirth feedback.";

get_corpse

Spec this none thisFlags rxDefiner #259

Referenced by

Source

1":get_corpse([killer])";
2"Get a corpse for this monster, dependant on the value of `body'.";
3"If body == #x and #x is valid and #x.is_specific => TRUE, use that custom corpse.";
4"If valid(body), create a new corpse and describe it as `corpse_msg'.";
5"If a corpse is found, return {#corpse}.  Else, return false.";
6"`killer' is who killed the beast.  Provided for future customization.";
7{?killer = $nothing} = args;
8(rpg = $local.rpg):secure();
9body = this.body;
10if (`body.is_specific ! ANY => 0')
11elseif (valid(body))
12  if (typeof(body = rpg.recycler:_create(body)) != OBJ)
13    return E_QUOTA;
14  endif
15else
16  return E_NONE;
17endif
18body:prep_corpse(this, killer);
19return {this.body = body};
20"THX (#105941) - Thu Mar 22, 2001 - Moved configuration to body:prep_corpse(this, killer).";

choose_weaponry

Spec this none thisDefiner #259

Referenced by

none

Source

1if (caller == this)
2  doll = this.doll;
3  rpg = $local.rpg;
4  rank = weapon = 0;
5  for t in ($object_utils:all_contents(this))
6    temp = rank;
7    rating = `rpg:rate_weapon(t, {this, this}) ! ANY => 0';
8    if (rating && t:may_wield(this))
9      rank = max(rank, rating * doll:total(t.skill));
10    endif
11    weapon = (temp == rank) ? weapon | t;
12  endfor
13  wielded = {rank, weapon};
14  for t in (doll.natural_weapons)
15    temp = rank;
16    rating = `rpg:rate_weapon(t, {this, this}) ! ANY => 0';
17    if (rating)
18      rank = max(rank, rating * doll:total(t.skill));
19    endif
20    weapon = (temp == rank) ? weapon | t;
21  endfor
22  if (rank > wielded[1])
23    for t in (doll.wielding)
24      this:do(strsub(`this.dispose_weapon ! ANY => "unwield %weapon"', "%weapon", tostr(t)));
25    endfor
26  else
27    this:do(tostr("wield ", wielded[2]));
28  endif
29endif

purge_AHaB

Spec this none thisDefiner #259

Referenced by

none

Source

1"this:purge_relationships() => delete useless sets of relationship data.";
2rpg = $local.rpg;
3{doll, o_u, gms} = {rpg.doll, $object_utils, rpg.gms};
4for set in (r = this:get_prop("relationships"))
5  d = set[1];
6  (((o_u:isa(d, doll) && (typeof(char = d.character) == OBJ)) && is_player(char)) && (!(char in gms))) || (r = setremove(r, set));
7  rpg:s_i_f_i_n();
8endfor
9return this:set_prop("relationships", r);