generic monster #142

Parent #106Owner #361Flags read, fertileSource hellcore/hellcore.db

Aliases: generic monster

34 verbs · 162 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
suggest_next_actionthis none thisrxd#14215
_spawnthis none thisrxd#14212
_spawn_genderthis none thisrxd#14213
_spawn_namethis none thisrxd#14233
_scavengethis none thisrx#14216
diethis none thisrxd#14237
on_spawnthis none thisrxd#14229
_wanderthis none thisrxd#14214
enter_roomthis none thisrxd#14232
hear_event_fightthis none thisrxd#1426
is_legal_wander_exitthis none thisrxd#14224
respawnthis none thisrxd#1428
_aggressionthis none thisrx#14219
maybe_assistthis none thisrxd#1428
update_lastroomsthis none thisrxd#1428
_feedthis none thisrxd#1427
_trackthis none thisrxd#14212
weaponthis none thisrxd#1425
_compilethis none thisrxd#14231
go_homethis none thisrxd#1424
tamethis none nonerxd#1429
slave_tothis none thisrxd#1428
_brainscanthis none thisrxd#14236
killed_bythis none thisrxd#1428
award_species_questthis none thisrxd#14234
heartbeatthis none thisrxd#14216
tree_tagthis none thisrxd#14210
_enemiesthis none thisrx#14227
should_aggrothis none thisrxd#14235
_kill_targetthis none thisrxd#14227
kill_targetthis none thisrxd#1423
pay transferany at/to thisrxd#1421
hear_event_arrivethis none thisrxd#1429
show_sheetthis none thisrxd#14230

Properties

PropertyDefinerFlagsOwnerValue
species#142rc#361#142
scavenge_chance#142rc#36110
nest#142rc#361#-1
forbidden_rooms#142rc#361{}
areas#142rc#361{}
genders#142rc#361{"neuter"}
names_adj#142rc#361{"hairy", "hunched", "reeking", "hideous", "scabby"}
names_base_neuter#142rc#361{"monster", "creature", "thing"}
recycle_on_die#142rc#3610
treasure#142rc#361{{50, #659, 1, 100}}
comments#142rc#361{}
defend_sibs_chance#142rc#3610
aggression_chance#142rc#3610
random_homes#142rc#361{}
turf_size#142rc#3610
antigang_chance#142rc#36110
food#142rc#361{}
feed_msg#142rc#361"%DN eats %it."
tracking#142rc#361#-1
track_speed#142rc#3615
friendly_species#142rc#361{}
nest_container#142rc#361#-1
default_alias#142rc#361""
extra_aliases#142rc#361{}
kill_target#142rc#361#-1
tactics_chance#142rc#36175
spawned_by#142rc#361#-1
contract_value#142rc#36150
suggest_area#142rc#361#-1
no_cower#142rc#3610
weapon_drop_chance#142rc#3610
hoard_in_nest#142rc#3610
wields_weapons#106rc#361<clear>
public_wander_only#106rc#3611
bravery#106rc#36130
enemies#106rc#361<clear>
lastrooms#106rc#361<clear>
wander_chance#106rc#36120
last_greet_time#106r#361<clear>
conversation#106rc#361<clear>
_conversation#106r#361<clear>
dunno_msg#106rc#361<clear>
spawns_with#106rc#361<clear>
accepted_gifts#106rc#361<clear>
greet_msg#106rc#361<clear>
wander_speed#106rc#361<clear>
reacting_to#106rc#361<clear>
lastaction#106rw#361<clear>
comment_chance#106rc#361<clear>
respawn_time#106rc#361<clear>
death_time#106rc#361<clear>
nemeses#106rc#361<clear>
nemesis_lifetime#106rc#361<clear>
junk_on_death#106rc#361<clear>
say_fight_msg#106rc#361<clear>
wander_last_try#106rc#361<clear>
destination#106rc#361<clear>
last_wander_time#106rc#361<clear>
last_comment_time#106rc#361<clear>
max_contents#106rc#361<clear>
beg_health#106rc#361<clear>
beg_chance#106rc#361<clear>
beg_msg#106rc#361<clear>
reload_guns#106rc#361<clear>
clothing#106rwc#361<clear>
wardrobe#106rc#361<clear>
stay_home#106rc#3610
respawn_clothing#106rc#361<clear>
walk_last_try#106rc#361<clear>
ignore_next_say#106rc#361<clear>
did_damage#106rc#361<clear>
walk_speed#106rc#361<clear>
here_for_something#106rc#361<clear>
hands#107rc#361<clear>
wielding#107rc#361<clear>
health#107rc#36120
unarmed_weapon#107rc#361<clear>
size#107rc#361<clear>
posture#107rc#361<clear>
gender#107rc#361"male"
respawn#107rc#361<clear>
corpse#107rc#361<clear>
has_proper_name#107rc#361<clear>
die_msg#107rc#361<clear>
body_parts#107rc#361<clear>
wearing#107rc#361<clear>
armor#107rc#361<clear>
last_swing_message#107rc#361<clear>
health_max#107rc#361<clear>
fighting#107rc#361{}
last_dodge_time#107rc#361<clear>
following#107rc#361<clear>
icon#107rc#361<clear>
say_msg#107rc#361<clear>
say_to_msg#107rc#361<clear>
afterlife#107rc#361<clear>
get_msg#107rc#361<clear>
drop_msg#107rc#361<clear>
blood#107rc#361{}
squeals#107rc#361<clear>
prc#107rc#361<clear>
ppc#107rc#361<clear>
poc#107rc#361<clear>
psc#107rc#361<clear>
pr#107rc#361<clear>
pp#107rc#361<clear>
po#107rc#361<clear>
ps#107rc#361<clear>
pq#107rc#361<clear>
pqc#107rc#361<clear>
brief#107rc#361<clear>
knockout#107rc#361<clear>
knockout_msg#107rc#361<clear>
body#107rc#361<clear>
wake_msg#107rc#361<clear>
owake_msg#107rc#361<clear>
oknockout_msg#107rc#361<clear>
friends#107rc#361<clear>
home#107rc#361<clear>
respawn_msg#107rc#361<clear>
move_action#107rc#361<clear>
heart#107rc#3610
last_heartbeat#107rc#361<clear>
dead#107rc#361<clear>
_tohit_next#107rc#361<clear>
last_words_msg#107rc#361<clear>
attacked#107rc#361<clear>
opens_doors#107rc#3610
movable_by_explosion#107rc#361<clear>
obscured#107rc#361<clear>
obscured_desc_msg#107rc#361<clear>
cooldowns#107rc#361<clear>
combat_rounds#107rc#361<clear>
encumbrance#107rc#361<clear>
respawn_handler#107rc#361<clear>
distant_form_msg#107rc#361"creature"
block_msg#107rc#361<clear>
attack_on_block#107rc#361<clear>
last_stunned#107rc#361<clear>
nude_descs#107rc#361<clear>
skills#107rc#361<clear>
explode_msg#107rc#361<clear>
death_listeners#107rc#361<clear>
queue#92r#361<clear>
preemptible#92r#361<clear>
executing#92r#361<clear>
process_queue#92r#361<clear>
help_msg#92rc#361<clear>
last_action#92r#361<clear>
article#92rc#361<clear>
last_last_action#92rc#361<clear>
action_count#92rc#361<clear>
aliases#1rc#361{"generic monster"}
description#1rc#361<clear>
object_size#1r#29{32188, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #106 generic NPC#154 generic living creature#107 generic creature#92 generic actor#1 root

Children: #143 generic gatekeeper, #341 generic human monster

Call graph

calls n142_0 #142:suggest_next_action n106_25 #106:suggest_next_action n142_0->n106_25 n142_15 #142:_feed n142_0->n142_15 n142_4 #142:_scavenge n142_0->n142_4 n106_36 #106:_walk n142_0->n106_36 n142_7 #142:_wander n142_0->n142_7 n107_21 #107:max_carry n142_4->n107_21 n1_37 #1:weight n142_4->n1_37 n106_49 #106:encumbrance n142_7->n106_49 n106_2 #106:_wander n142_7->n106_2 n142_1 #142:_spawn n107_43 #107:tell n142_1->n107_43 n48_8 #48:suspend_if_needed n142_1->n48_8 n17_2 #17:set_owner n142_1->n17_2 n142_2 #142:_spawn_gender n34_0 #34:set n142_2->n34_0 n142_3 #142:_spawn_name n20_39 #20:words n142_3->n20_39 n1_2 #1:set_name n142_3->n1_2 n1_4 #1:set_aliases n142_3->n1_4 n142_5 #142:die n107_162 #107:is_in_afterlife n142_5->n107_162 n106_5 #106:die n142_5->n106_5 n103_1 #103:spawn n142_5->n103_1 n92_6 #92:clear_queue n142_5->n92_6 n142_6 #142:on_spawn n103_0 #103:random_treasure n142_6->n103_0 n107_32 #107:got_gift n142_6->n107_32 n106_6 #106:moveto n142_6->n106_6 n106_33 #106:on_spawn n142_6->n106_33 n142_8 #142:enter_room n107_28 #107:enter_room n142_8->n107_28 n106_0 #106:wield_best n142_8->n106_0 n142_17 #142:weapon n142_8->n142_17 n107_36 #107:_drop n142_8->n107_36 n92_2 #92:queue_action n142_8->n92_2 n45_5 #45:isa n142_8->n45_5 n106_7 #106:start_fighting n142_8->n106_7 n142_9 #142:hear_event_fight n142_9->n106_7 n106_28 #106:hear_event_fight n142_9->n106_28 n142_13 #142:maybe_assist n142_9->n142_13 n142_13->n45_5 n142_11 #142:respawn n57_1 #57:_recycle n142_11->n57_1 n106_19 #106:respawn n142_11->n106_19 n142_12 #142:_aggression n142_12->n106_7 n142_28 #142:should_aggro n142_12->n142_28 n107_104 #107:threat_rating n142_12->n107_104 n92_7 #92:cancel_current_action n142_12->n92_7

Showing 48 of 92 verbs; 44 not shown.

Source

suggest_next_action

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (x = pass(@args))
2return x;
3elseif (r = this:_feed())
4this.lastaction = "f";
5return {r, 1};
6elseif (r = this:_scavenge())
7this.lastaction = "s";
8return {r, 2};
9elseif (r = this:_walk())
10return {r, 2};
11endif
12if (r = this:_wander())
13this.lastaction = "w";
14return {r, this.wander_speed};
15endif

_spawn

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (!this.f)
2player:tell("Sorry; you need to run _spawn on the generic to create a child.");
3return;
4endif
5child = this.owner:_create(this);
6$cu:sin();
7$wiz_utils:set_owner(child, this.owner);
8child:_spawn_gender();
9child:_spawn_name();
10child.recycle_on_die = 1;
11child:on_spawn(@args);
12return child;

_spawn_gender

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1$gender_utils:set(this, this.genders[random($)]);
2if (this.gender in {"male", "female"})
3if ($bodyparts.groin in this.body_parts)
4if (this.gender == "male")
5$bodyparts.penis:add_to(this);
6elseif (this.gender == "female")
7$bodyparts.vagina:add_to(this);
8endif
9endif
10if ((this.gender == "female") && ($bodyparts.chest in this.body_parts))
11$bodyparts.breasts:add_to(this);
12endif
13endif

_spawn_name

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1"Generate a random name for this monster when spawned.";
2suffix = this.("names_base_" + this.gender)[random($)];
3if (typeof(suffix) == LIST)
4{suffix, plural_suffix} = suffix;
5else
6plural_suffix = "";
7endif
8aliases = {suffix};
9if (this.default_alias)
10aliases = setadd(aliases, this.default_alias);
11endif
12for word in ($su:words(suffix))
13aliases = setadd(aliases, word);
14endfor
15if (this.names_adj)
16prefix = this.names_adj[random($)];
17else
18prefix = "";
19endif
20if (prefix)
21combined = (prefix + " ") + suffix;
22this:set_name(combined);
23aliases = setadd(aliases, combined);
24if (plural_suffix)
25this.plural_name = (prefix + " ") + plural_suffix;
26endif
27else
28this:set_name(suffix);
29if (plural_suffix)
30this.plural_name = plural_suffix;
31endif
32endif
33this:set_aliases(aliases);

_scavenge

Spec this none thisFlags rxOwner #361Definer #142

Referenced by

Source

1if ((this.scavenge_chance && (this.location != this.nest)) && (length(this.contents) < `this.scavenge_threshold ! E_PROPNF => 6'))
2junk = {};
3for x in (this.location:occupants($thing))
4if ((x.weight > -1) && (x.weight < (this:max_carry() - (this:weight() - this.weight))))
5if (random(100) < this.scavenge_chance)
6junk = setadd(junk, x);
7endif
8endif
9endfor
10if (junk)
11junk = junk[random(length(junk))];
12if (!`junk.no_npc_pickup ! ANY => 0')
13return {$actions.get, {{junk}, junk.location, {}}, 1, ""};
14endif
15endif
16endif

die

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (!this:is_in_afterlife())
2if (this.recycle_on_die)
3if (this.f || verbs(this))
4return pass(@args);
5else
6if (this.weapon_drop_chance && (random(100) <= this.weapon_drop_chance))
7body = is_a(this.body, $body) ? this.body | this;
8if (((typeof(weapon = this.unarmed_weapon) == OBJ) && weapon.f) && (!is_a(weapon, #1142)))
9weapon = $rpg:spawn(weapon);
10weapon:moveto(body);
11elseif (typeof(weapons = this.unarmed_weapon) == LIST)
12for x in (weapons)
13if (!x.f)
14weapons = setremove(weapons, x);
15endif
16endfor
17if (weapons)
18weapon = $rpg:spawn(weapons[random($)]);
19weapon:moveto(body);
20endif
21endif
22endif
23r = pass(@args);
24fork (1)
25if (is_a(this, $creature))
26this:clear_queue();
27if (is_a(this.body, $corpse))
28this.body.player = #-1;
29endif
30endif
31endfork
32return r;
33endif
34else
35return pass(@args);
36endif
37endif

on_spawn

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1this.health = this.health_max;
2if (this.treasure)
3fork (0)
4if (is_a(this, $monster))
5for x in (this.treasure)
6if (random(100) <= x[1])
7if (valid(what = $rpg:random_treasure(@x[2..$])))
8what:moveto(this);
9this:got_gift(what, this);
10endif
11endif
12endfor
13endif
14endfork
15endif
16if (this.random_homes)
17this.home = this.random_homes[random(length(this.random_homes))];
18this.respawn = this.home;
19this.nest = this.home;
20this:moveto(this.home);
21endif
22this:moveto(this.respawn);
23pass(@args);
24for x in (this.extra_aliases)
25this.aliases = setadd(this.aliases, x);
26endfor
27if (`this.random_weapons ! ANY' && (typeof(this.random_weapons) == LIST))
28this.unarmed_weapon = this.random_weapons[random($)];
29endif

_wander

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1if (this.executing || (is_a(this.following, $creature) && (this.following.location == this.location)))
2return;
3endif
4next = #-1;
5if ((this.hoard_in_nest && (this:encumbrance() < 0)) && valid(this.nest))
6next = this.location:next_hop_to(this.nest);
7elseif (this.areas && (!(area(this) in this.areas)))
8next = this.location:next_hop_to(this.areas[1]);
9endif
10if (valid(next))
11return {this.move_action, {next}, 1, ""};
12else
13return pass(@args);
14endif

enter_room

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (`this.location.no_actions ! ANY => 0')
2return;
3endif
4r = pass(@args);
5if (this.hoard_in_nest && (this.location == this.nest))
6if (this.wields_weapons)
7this:wield_best();
8endif
9dropping = setremove(occupants(this, $thing), this:weapon());
10if (dropping)
11if ((!gamevalid(this.nest_container)) || (this.nest_container.location != this.location))
12for x in (dropping)
13this:_drop(x);
14suspend(1);
15endfor
16else
17this:queue_action($actions.drop, {dropping, this.nest_container, {}}, 1, "drop stuff");
18endif
19endif
20endif
21if (random(100) <= this.defend_sibs_chance)
22for x in (this.location:occupants($creature))
23if (x.fighting)
24if ($ou:isa(x.fighting[1], this.species))
25fork (1)
26this:start_fighting(x);
27endfork
28return;
29endif
30endif
31endfor
32endif

hear_event_fight

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1pass(@args);
2if (args[1] && this:maybe_assist(args[3], args[4][1]))
3if (!(args[3] in this.fighting))
4this:start_fighting(args[3]);
5endif
6endif

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1"Is the given exit legal for us to wander into?";
2x = args[1];
3if (!x:allows(this))
4return 0;
5elseif ((!valid(o = x.otherside)) || (!valid(d = x.otherside.location)))
6return 0;
7elseif (d in this.forbidden_rooms)
8return 0;
9elseif (!(d:area() in this.areas))
10return 0;
11elseif (this.public_wander_only && (!d.public))
12return 0;
13elseif (d in this.lastrooms)
14return 0;
15elseif (this.antigang_chance && (random(100) <= (length(d:occupants(this.species)) * this.antigang_chance)))
16return 0;
17"elseif ((this.fear_fire && (fires = d:occupants(#35148))) && fires[1].lit)";
18"  return 0;";
19"elseif (is_a(d, #1047) && (!($drugs.suffocation in $lu:slice(this.resists, 1))))";
20"  return 0;";
21"elseif (is_a(d, #1034) && (!$skills.swim:raw(this))";
22"  return 0;";
23endif
24return 1;

respawn

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (is_a(this.body, $corpse))
2this.body.player = #-1;
3endif
4if ((!this.f) && this.recycle_on_die)
5$recycler:_recycle(this);
6return;
7endif
8return pass(@args);

_aggression

Spec this none thisFlags rxOwner #361Definer #142

Referenced by

Source

1if (area(this).combat_ok)
2if ((!this.fighting) && (random(100) <= this.aggression_chance))
3if ($drugs.fear:doses_for(this))
4return;
5endif
6mythreat = 0;
7for x in (this.location:occupants($living))
8kill = this:should_aggro(x);
9if (kill)
10mythreat = mythreat ? mythreat | this:threat_rating();
11if (((mythreat + this.bravery) + random(20)) > x:threat_rating())
12this:cancel_current_action();
13this:start_fighting(x);
14return {$actions.null, {}};
15endif
16endif
17endfor
18endif
19endif

maybe_assist

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1if ($ou:isa(args[2], this.species) && (random(100) <= this.defend_sibs_chance))
2if (!args[1].programmer)
3if (!(args[1] in this.fighting))
4return 1;
5endif
6endif
7endif
8return 0;

update_lastrooms

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (this.turf_size)
2if (length(this.lastrooms) >= this.turf_size)
3return 0;
4endif
5this.lastrooms = setadd(this.lastrooms, this.location);
6else
7return pass(@args);
8endif

_feed

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1for x in (this.food)
2for y in ({@this.contents, @this.location.contents})
3if ((((is_a(y, x) && (!is_a(y, #87534))) && (y.weight > 0)) && (y.weight < 5000)) && `y.junk_ok ! ANY => 0')
4return {$actions.eat, {y}, 1, ""};
5endif
6endfor
7endfor

_track

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (valid(this.tracking))
2if (te = this.location:track_exit(this.tracking))
3if (is_a(te[1], $exit))
4check = $skills.track:check(this, -(te[2] / 5));
5if (check >= 0)
6if (this:is_legal_wander_exit(te[1]))
7return {$actions.move, {te[1]}, 1, ""};
8endif
9endif
10endif
11endif
12endif

weapon

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1if (!this.wields_weapons)
2return (typeof(this.unarmed_weapon) == LIST) ? this.unarmed_weapon[1] | this.unarmed_weapon;
3else
4return pass(@args);
5endif

_compile

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1pass(@args);
2{who} = args;
3who:tell("Highlighting comments for ", $su:nn(this), ":");
4cc = {};
5allkeys = {};
6for x in (this.conversation)
7xl = $su:explode(x, "|");
8keys = $su:explode(xl[1], ",");
9v = (length(xl) > 2) ? xl[3] | "";
10allkeys = {@allkeys, @keys};
11$cu:sin(0);
12endfor
13cc2 = {};
14for x in (this.comments)
15words = $su:explode(x, " ");
16newtext = "";
17for w in (words)
18ws = $su:strip_chars(w, "?!.,");
19if (ws in allkeys)
20newtext = (newtext + ((" " + $ansi.bold_on) + w)) + $ansi.reset;
21else
22newtext = (newtext + " ") + w;
23endif
24endfor
25newtext = newtext[2..$];
26$cu:sin(0);
27who:tell("  ", newtext);
28cc2 = {@cc2, newtext};
29endfor
30this.comments = cc2;
31who:tell("Done!");

go_home

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (this.recycle_on_die)
2return;
3endif
4return pass(@args);

tame

Spec this none noneFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (!this.recycle_on_die)
2player:tell(this:inamec(), " can't be tamed, man!");
3return;
4endif
5if (!player.programmer)
6player:tell("Yeah.  You wish.  Soon enough.");
7return;
8endif
9this:slave_to(player);

slave_to

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1master = args[1];
2this.fighting = setremove(this.fighting, master);
3this.friendly_species = {master};
4this.species = master;
5this.following = master;
6this.defend_sibs_chance = 100;
7this.wander_chance = 0;
8this:aat(this:dnamec(), " heels behind ", master:dname(), ".");

_brainscan

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1pass(who = args[1]);
2if (this.areas)
3this:_whisper(who, "I live in ", $su:english_list($lu:map_verb(this.areas, "dname")), ".");
4endif
5if (!this.recycle_on_die)
6this:_whisper(who, "If I get killed, at least I'll reclone.");
7endif
8species = strsub(this.species:iname(), "generic ", "");
9if (chance = this.defend_sibs_chance)
10if (chance > 90)
11d = "always";
12elseif (chance > 50)
13d = "probably";
14elseif (chance > 15)
15d = "sometimes";
16else
17d = "maybe";
18endif
19this:_whisper(who, "I'll ", d, " defend a fellow ", species, ".");
20endif
21if (valid(this.tracking))
22this:_whisper(who, "I'm tracking ", this.tracking:iname(), ".");
23endif
24if (this.enemy_species)
25this:_whisper(who, "If I see ", $su:english_list($lu:map_verb(this.enemy_species, "iname")), ", they're dead.");
26endif
27if (c = this.aggression_chance)
28if (c > 70)
29m = "I'm crazy!  I'll kill anything I see.";
30elseif (c > 30)
31m = "I'm itching for a fight.";
32else
33m = "I'm a little bit aggressive.";
34endif
35this:_whisper(who, c);
36endif

killed_by

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1pass(@args);
2"if (valid(parent(this)))";
3"  parent(this):award_species_quest(@args);";
4"endif";
5"if (is_a(who = args[1], $player))";
6"  eff = who.xp_total - who:quest_xp();";
7"  $grind_db:record(who, eff, parent(this), this.did_damage);";
8"endif";

award_species_quest

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if ((!this.f) || (this == $monster))
2return;
3endif
4who = args[1];
5if (!this.species_quest)
6"No species quest exists yet.";
7should_create = 1;
8elseif ((is_clear_property(this, "species_quest") && this.species_quest) && (!this.species_quest[2]))
9"A species quest exists, but it isn't our direct parent's species quest (and it isn't overridden).";
10should_create = 1;
11else
12"We have liftoff!";
13should_create = 0;
14endif
15if ((!is_a(who, $builder)) && should_create)
16quest = $recycler:_create(#197494);
17if (!is_a(quest, $quest))
18$nets.questnet:announce(#2, tostr($ansi.bold_on, "Could not create a species killer quest for ", $su:nn(this), "!"), 1);
19quest = #-1;
20else
21quest.species = this;
22quest:setup_name();
23quest.xp_award = quest:calc_value();
24quest:moveto($quests);
25$nets.questnet:announce(#2, tostr($ansi.bold_on, "'", $su:nn(quest), "' species killer quest has been created for ", $su:nn(this), "."), 1);
26$wiz_utils:set_owner(quest, this.owner);
27this.species_quest = {quest, 0};
28endif
29else
30quest = ((!should_create) && this.species_quest) ? this.species_quest[1] | #-1;
31endif
32if (is_a(quest, $quest))
33quest:award_to(who);
34endif

heartbeat

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (length(this.contents) > 10)
2j = $lu:random(this.contents);
3if (!((j in this.wearing) || (j in this.wielding)))
4$rpg:junk(j);
5endif
6endif
7if ((this.recycle_on_die && (this.location in {this.afterlife, #-1})) && (!this:dead()))
8if (this.f || verbs(this))
9$nets.prognet:announce(#-1, tostr($su:nn(this), " is in limbo, fertile or has verbs, and .recycle_on_die = 1. Not recycling."), 1);
10else
11$heart:unregister(this);
12$recycler:_recycle(this);
13endif
14else
15return pass(@args);
16endif

tree_tag

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1r = "";
2r = $su:trim(r);
3if (r)
4r = (pass(@args) + "  ") + r;
5else
6r = pass(@args);
7endif
8rec = this.recycle_on_die ? "" | tostr($ansi.red, "   !recycle_on_die", $ansi.reset);
9r = tostr(r, rec);
10return r;

_enemies

Spec this none thisFlags rxOwner #361Definer #142

Referenced by

none

Source

1{?location = this.location} = args;
2enemies = {};
3for target in (location:occupants(this.enemy_species ? $living | $player))
4if (is_a(target, $immortal))
5continue;
6endif
7if (!this.enemy_species)
8kill = 1;
9else
10kill = 0;
11for foe in (this.enemy_species)
12if (is_a(target, foe) && (kill == 0))
13kill = 1;
14for friend in (this.friendly_species)
15if (is_a(target, friend))
16kill = 0;
17break;
18endif
19endfor
20endif
21endfor
22endif
23if (kill)
24enemies = setadd(enemies, target);
25endif
26endfor
27return enemies;

should_aggro

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

Source

1who = args[1];
2if (is_a(who, $prog))
3return;
4endif
5enemy = 0;
6friend = 0;
7enemies = (typeof(this.enemy_species) == LIST) ? this.enemy_species | {this.enemy_species};
8friends = (typeof(this.friendly_species) == LIST) ? this.friendly_species | {this.friendly_species};
9for e in (enemies)
10if (is_a(who, e))
11enemy = 1;
12endif
13endfor
14if ((!this.enemy_species) && is_a(who, $player))
15enemy = 1;
16endif
17for f in (friends)
18if (is_a(who, f))
19friend = 1;
20endif
21endfor
22if ((enemy && is_player(who)) && (!this.no_cower))
23myval = this:xp_value(who);
24if (myval < 2)
25if (random(100) < (100 - (((typeof(this.xp_value) == LIST) ? this.xp_value[1] | this.xp_value) * 2)))
26if (random(100) < 30)
27this:aat(this:dnamec(), " cowers away from ", who:dname(), ".");
28endif
29return 0;
30endif
31endif
32endif
33if (enemy && (!friend))
34return 1;
35endif

_kill_target

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1if (valid(this.kill_target) && is_a(room = this.kill_target:room(), $room))
2if (this.location != room)
3if (valid(exit = this.location:next_hop_to(room)))
4if ((!(exit.otherside.location in this.lastrooms)) || (random(100) > 20))
5return {this.move_action, {exit}, 1, "walk to destination"};
6else
7$nets.pathnet:announce(#-1, (($su:nn(this) + " was in a loop going to ") + $su:nn(this.destination)) + "!", 1);
8this.destination = #-1;
9this.lastrooms = {};
10endif
11endif
12else
13targ = this.kill_target;
14this.kill_target = #-1;
15if (is_a(targ, $room))
16vic = this.location:occupants($player);
17elseif (targ.location == this.location)
18vic = {targ};
19else
20return;
21endif
22if (vic)
23vic = vic[random($)];
24this:start_fighting(vic);
25endif
26endif
27endif

kill_target

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1target = args[1];
2this.kill_target = target;
3this:jumpstart();

pay transfer

Spec any at/to thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1player:tell("You just don't feel right handing money to some random monster for no reason.");

hear_event_arrive

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1who = args[3];
2if (!this.fighting)
3if (random(100) <= this.aggression_chance)
4if (this:should_aggro(who))
5this:start_fighting(who);
6endif
7endif
8endif
9return pass(@args);

show_sheet

Spec this none thisFlags rxdOwner #361Definer #142

Referenced by

none

Source

1player:tell($ansi.bold_on, this:inamec(), $ansi.bold_off);
2parent = this.f ? this | parent(this);
3alive = length(children(parent));
4player:tell(alive, " alive right now.");
5if (typeof(this.xp_value) == INT)
6player:tell("XP value is OLD FORMAT -- ", this.xp_value, "xp.  FIX THIS.");
7else
8player:tell("XP value is ", $ansi.bold_on, this.xp_value[1], $ansi.bold_off, "xp up to ", this.xp_value[2], " effXP, scaling to 0 at ", this.xp_value[3], " effXP.");
9endif
10if (this.contract_value)
11player:tell("Contract value is ", $ansi.green, "$", this.contract_value, $ansi.reset, ".");
12endif
13areas = [];
14for x in ($ou:leaves($hive))
15if (x.generic_citizen == parent)
16a = area(x);
17t = `areas[a] ! ANY => 0' + x.citizen_population;
18areas[a] = t;
19endif
20endfor
21for x in (keys(areas))
22t = areas[x];
23player:tell(t, " spawn in ", `x:dname() ! ANY => "???"', ".");
24endfor
25a1 = $grind_db:avg_eff_dmg(parent);
26a1t = $grind_db:kills_dmg(parent);
27a2 = $grind_db:avg_eff_nodmg(parent);
28a2t = $grind_db:kills_nodmg(parent);
29player:tell(a1t, " kills by players who took damage    (average eff: ", a1, "xp)");
30player:tell(a2t, " kills by players who took no damage (average eff: ", a2, "xp)");