generic monster #142
Aliases: generic monster
34 verbs · 162 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
suggest_next_action | this none this | rxd | #142 | 15 |
_spawn | this none this | rxd | #142 | 12 |
_spawn_gender | this none this | rxd | #142 | 13 |
_spawn_name | this none this | rxd | #142 | 33 |
_scavenge | this none this | rx | #142 | 16 |
die | this none this | rxd | #142 | 37 |
on_spawn | this none this | rxd | #142 | 29 |
_wander | this none this | rxd | #142 | 14 |
enter_room | this none this | rxd | #142 | 32 |
hear_event_fight | this none this | rxd | #142 | 6 |
is_legal_wander_exit | this none this | rxd | #142 | 24 |
respawn | this none this | rxd | #142 | 8 |
_aggression | this none this | rx | #142 | 19 |
maybe_assist | this none this | rxd | #142 | 8 |
update_lastrooms | this none this | rxd | #142 | 8 |
_feed | this none this | rxd | #142 | 7 |
_track | this none this | rxd | #142 | 12 |
weapon | this none this | rxd | #142 | 5 |
_compile | this none this | rxd | #142 | 31 |
go_home | this none this | rxd | #142 | 4 |
tame | this none none | rxd | #142 | 9 |
slave_to | this none this | rxd | #142 | 8 |
_brainscan | this none this | rxd | #142 | 36 |
killed_by | this none this | rxd | #142 | 8 |
award_species_quest | this none this | rxd | #142 | 34 |
heartbeat | this none this | rxd | #142 | 16 |
tree_tag | this none this | rxd | #142 | 10 |
_enemies | this none this | rx | #142 | 27 |
should_aggro | this none this | rxd | #142 | 35 |
_kill_target | this none this | rxd | #142 | 27 |
kill_target | this none this | rxd | #142 | 3 |
pay transfer | any at/to this | rxd | #142 | 1 |
hear_event_arrive | this none this | rxd | #142 | 9 |
show_sheet | this none this | rxd | #142 | 30 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
species | #142 | rc | #361 | #142 |
scavenge_chance | #142 | rc | #361 | 10 |
nest | #142 | rc | #361 | #-1 |
forbidden_rooms | #142 | rc | #361 | {} |
areas | #142 | rc | #361 | {} |
genders | #142 | rc | #361 | {"neuter"} |
names_adj | #142 | rc | #361 | {"hairy", "hunched", "reeking", "hideous", "scabby"} |
names_base_neuter | #142 | rc | #361 | {"monster", "creature", "thing"} |
recycle_on_die | #142 | rc | #361 | 0 |
treasure | #142 | rc | #361 | {{50, #659, 1, 100}} |
comments | #142 | rc | #361 | {} |
defend_sibs_chance | #142 | rc | #361 | 0 |
aggression_chance | #142 | rc | #361 | 0 |
random_homes | #142 | rc | #361 | {} |
turf_size | #142 | rc | #361 | 0 |
antigang_chance | #142 | rc | #361 | 10 |
food | #142 | rc | #361 | {} |
feed_msg | #142 | rc | #361 | "%DN eats %it." |
tracking | #142 | rc | #361 | #-1 |
track_speed | #142 | rc | #361 | 5 |
friendly_species | #142 | rc | #361 | {} |
nest_container | #142 | rc | #361 | #-1 |
default_alias | #142 | rc | #361 | "" |
extra_aliases | #142 | rc | #361 | {} |
kill_target | #142 | rc | #361 | #-1 |
tactics_chance | #142 | rc | #361 | 75 |
spawned_by | #142 | rc | #361 | #-1 |
contract_value | #142 | rc | #361 | 50 |
suggest_area | #142 | rc | #361 | #-1 |
no_cower | #142 | rc | #361 | 0 |
weapon_drop_chance | #142 | rc | #361 | 0 |
hoard_in_nest | #142 | rc | #361 | 0 |
wields_weapons | #106 | rc | #361 | <clear> |
public_wander_only | #106 | rc | #361 | 1 |
bravery | #106 | rc | #361 | 30 |
enemies | #106 | rc | #361 | <clear> |
lastrooms | #106 | rc | #361 | <clear> |
wander_chance | #106 | rc | #361 | 20 |
last_greet_time | #106 | r | #361 | <clear> |
conversation | #106 | rc | #361 | <clear> |
_conversation | #106 | r | #361 | <clear> |
dunno_msg | #106 | rc | #361 | <clear> |
spawns_with | #106 | rc | #361 | <clear> |
accepted_gifts | #106 | rc | #361 | <clear> |
greet_msg | #106 | rc | #361 | <clear> |
wander_speed | #106 | rc | #361 | <clear> |
reacting_to | #106 | rc | #361 | <clear> |
lastaction | #106 | rw | #361 | <clear> |
comment_chance | #106 | rc | #361 | <clear> |
respawn_time | #106 | rc | #361 | <clear> |
death_time | #106 | rc | #361 | <clear> |
nemeses | #106 | rc | #361 | <clear> |
nemesis_lifetime | #106 | rc | #361 | <clear> |
junk_on_death | #106 | rc | #361 | <clear> |
say_fight_msg | #106 | rc | #361 | <clear> |
wander_last_try | #106 | rc | #361 | <clear> |
destination | #106 | rc | #361 | <clear> |
last_wander_time | #106 | rc | #361 | <clear> |
last_comment_time | #106 | rc | #361 | <clear> |
max_contents | #106 | rc | #361 | <clear> |
beg_health | #106 | rc | #361 | <clear> |
beg_chance | #106 | rc | #361 | <clear> |
beg_msg | #106 | rc | #361 | <clear> |
reload_guns | #106 | rc | #361 | <clear> |
clothing | #106 | rwc | #361 | <clear> |
wardrobe | #106 | rc | #361 | <clear> |
stay_home | #106 | rc | #361 | 0 |
respawn_clothing | #106 | rc | #361 | <clear> |
walk_last_try | #106 | rc | #361 | <clear> |
ignore_next_say | #106 | rc | #361 | <clear> |
did_damage | #106 | rc | #361 | <clear> |
walk_speed | #106 | rc | #361 | <clear> |
here_for_something | #106 | rc | #361 | <clear> |
hands | #107 | rc | #361 | <clear> |
wielding | #107 | rc | #361 | <clear> |
health | #107 | rc | #361 | 20 |
unarmed_weapon | #107 | rc | #361 | <clear> |
size | #107 | rc | #361 | <clear> |
posture | #107 | rc | #361 | <clear> |
gender | #107 | rc | #361 | "male" |
respawn | #107 | rc | #361 | <clear> |
corpse | #107 | rc | #361 | <clear> |
has_proper_name | #107 | rc | #361 | <clear> |
die_msg | #107 | rc | #361 | <clear> |
body_parts | #107 | rc | #361 | <clear> |
wearing | #107 | rc | #361 | <clear> |
armor | #107 | rc | #361 | <clear> |
last_swing_message | #107 | rc | #361 | <clear> |
health_max | #107 | rc | #361 | <clear> |
fighting | #107 | rc | #361 | {} |
last_dodge_time | #107 | rc | #361 | <clear> |
following | #107 | rc | #361 | <clear> |
icon | #107 | rc | #361 | <clear> |
say_msg | #107 | rc | #361 | <clear> |
say_to_msg | #107 | rc | #361 | <clear> |
afterlife | #107 | rc | #361 | <clear> |
get_msg | #107 | rc | #361 | <clear> |
drop_msg | #107 | rc | #361 | <clear> |
blood | #107 | rc | #361 | {} |
squeals | #107 | rc | #361 | <clear> |
prc | #107 | rc | #361 | <clear> |
ppc | #107 | rc | #361 | <clear> |
poc | #107 | rc | #361 | <clear> |
psc | #107 | rc | #361 | <clear> |
pr | #107 | rc | #361 | <clear> |
pp | #107 | rc | #361 | <clear> |
po | #107 | rc | #361 | <clear> |
ps | #107 | rc | #361 | <clear> |
pq | #107 | rc | #361 | <clear> |
pqc | #107 | rc | #361 | <clear> |
brief | #107 | rc | #361 | <clear> |
knockout | #107 | rc | #361 | <clear> |
knockout_msg | #107 | rc | #361 | <clear> |
body | #107 | rc | #361 | <clear> |
wake_msg | #107 | rc | #361 | <clear> |
owake_msg | #107 | rc | #361 | <clear> |
oknockout_msg | #107 | rc | #361 | <clear> |
friends | #107 | rc | #361 | <clear> |
home | #107 | rc | #361 | <clear> |
respawn_msg | #107 | rc | #361 | <clear> |
move_action | #107 | rc | #361 | <clear> |
heart | #107 | rc | #361 | 0 |
last_heartbeat | #107 | rc | #361 | <clear> |
dead | #107 | rc | #361 | <clear> |
_tohit_next | #107 | rc | #361 | <clear> |
last_words_msg | #107 | rc | #361 | <clear> |
attacked | #107 | rc | #361 | <clear> |
opens_doors | #107 | rc | #361 | 0 |
movable_by_explosion | #107 | rc | #361 | <clear> |
obscured | #107 | rc | #361 | <clear> |
obscured_desc_msg | #107 | rc | #361 | <clear> |
cooldowns | #107 | rc | #361 | <clear> |
combat_rounds | #107 | rc | #361 | <clear> |
encumbrance | #107 | rc | #361 | <clear> |
respawn_handler | #107 | rc | #361 | <clear> |
distant_form_msg | #107 | rc | #361 | "creature" |
block_msg | #107 | rc | #361 | <clear> |
attack_on_block | #107 | rc | #361 | <clear> |
last_stunned | #107 | rc | #361 | <clear> |
nude_descs | #107 | rc | #361 | <clear> |
skills | #107 | rc | #361 | <clear> |
explode_msg | #107 | rc | #361 | <clear> |
death_listeners | #107 | rc | #361 | <clear> |
queue | #92 | r | #361 | <clear> |
preemptible | #92 | r | #361 | <clear> |
executing | #92 | r | #361 | <clear> |
process_queue | #92 | r | #361 | <clear> |
help_msg | #92 | rc | #361 | <clear> |
last_action | #92 | r | #361 | <clear> |
article | #92 | rc | #361 | <clear> |
last_last_action | #92 | rc | #361 | <clear> |
action_count | #92 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic monster"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {32188, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #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
Showing 48 of 92 verbs; 44 not shown.
Source
suggest_next_action
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
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
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
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
Referenced by
- #142:suggest_next_action line 6:
this:_scavenge - #143:suggest_next_action line 5:
this:_scavenge
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
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
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
Referenced by
- #142:suggest_next_action line 12:
this:_wander - #143:_wander line 6:
pass(
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
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
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
is_legal_wander_exit
Referenced by
- #142:_track line 6:
this:is_legal_wander_exit
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
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
Referenced by
- #143:suggest_next_action line 3:
this:_aggression
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
Referenced by
- #142:hear_event_fight line 2:
this:maybe_assist
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
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
Referenced by
- #142:suggest_next_action line 3:
this:_feed
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
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
Referenced by
- #142:enter_room line 9:
this:weapon
Source
1if (!this.wields_weapons) 2return (typeof(this.unarmed_weapon) == LIST) ? this.unarmed_weapon[1] | this.unarmed_weapon; 3else 4return pass(@args); 5endif
_compile
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
Referenced by
none
Source
1if (this.recycle_on_die) 2return; 3endif 4return pass(@args);
tame
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
Referenced by
- #142:tame line 9:
this:slave_to
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
Referenced by
- #143:_brainscan line 1:
pass(
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
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
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
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
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
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
Referenced by
- #142:_aggression line 8:
this:should_aggro - #142:hear_event_arrive line 4:
this:should_aggro
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
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
Referenced by
none
Source
1target = args[1]; 2this.kill_target = target; 3this:jumpstart();
pay transfer
Referenced by
none
Source
1player:tell("You just don't feel right handing money to some random monster for no reason.");
hear_event_arrive
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
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)");