generic NPC #106

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

Aliases: generic NPC

67 verbs · 130 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
wield_bestthis none thisrxd#10628
get_giftthis none thisrxd#1068
_wanderthis none thisrxd#10642
_fightthis none thisrxd#10645
is_legal_wander_exitthis none thisrxd#1068
diethis none thisrxd#10615
movetothis none thisrxd#1062
start_fightingthis none thisrxd#10620
say_ideathis none thisrxd#1069
hear_event_arrivethis none thisrx#10610
hear_say_tothis none thisrxd#10629
hear_event_saythis none thisrxd#10611
hear_event_shakethis none thisrx#1064
hear_event_nodthis none thisrx#1064
_step_towardthis none thisrxd#1064
heartbeatthis none thisrxd#10631
update_lastroomsthis none thisrxd#1066
@compilethis none nonerxd#1065
hear_event_diethis none thisrxd#1062
respawnthis none thisrxd#1065
cant_takethis none thisrxd#10617
greetthis none thisrxd#1066
_reloadthis none thisrxd#10617
_wield_bestthis none thisrxd#10613
_homethis none thisrx#1067
suggest_next_actionthis none thisrxd#10613
_commentthis none thisrxd#10617
_allowsthis none thisrxd#1064
hear_event_fightthis none thisrxd#1062
_notice_nudethis none thisrxd#10612
_fleethis none thisrxd#10615
_suggest_next_actionthis none thisrxd#1067
spawn_withthis none thisrxd#10623
on_spawnthis none thisrxd#1064
add_nemesisthis none thisrxd#10611
reap_nemesesthis none thisrxd#1067
_walkthis none thisrxd#10647
go_homethis none thisrxd#1065
_aggressionthis none thisrxd#1060
_peethis none thisrxd#10643
forget_enemiesthis none thisrxd#10615
take_damagethis none thisrxd#10616
beg_checkthis none thisrxd#1068
spare_oldthis none thisrxd#10610
spared_bythis none thisrxd#10614
beg_msgthis none thisrxd#1061
_brainscanthis none thisrxd#1068
random_commentthis none thisrxd#1061
random_rumorthis none thisrxd#1067
encumbrancethis none thisrxd#1060
_is_nudethis none thisrxd#10612
greet_msgthis none thisrxd#1062
com*mandthis at/to anyrxd#1068
wearing_onthis none thisrxd#10617
match_convothis none thisrxd#1069
nonethis none thisrxd#1060
respond_convothis none thisrxd#10622
convo_wordsthis none thisrxd#1067
head_to head_forthis none thisrxd#10633
_fight_arithis none thisrxd#10640
_conversationthis none thisrxd#1061
is_nemesisthis none thisrxd#1062
remove_nemesisthis none thisrxd#1067
clear_nemesesthis none thisrxd#1061
afterlifethis none thisrxd#1061
_compilethis none thisrxd#10635
suggest_teacherthis none thisrxd#10616

Properties

PropertyDefinerFlagsOwnerValue
wields_weapons#106rc#3611
public_wander_only#106rc#3610
bravery#106rc#36115
enemies#106rw#361{}
lastrooms#106r#361{}
wander_chance#106rc#3610
last_greet_time#106r#3610
conversation#106rc#361{}
_conversation#106r#361{}
dunno_msg#106rc#361"Huh?"
spawns_with#106rc#361{}
accepted_gifts#106rc#361{}
greet_msg#106rc#361""
wander_speed#106rc#36120
reacting_to#106rc#361#-1
lastaction#106rw#361""
comment_chance#106rc#36135
respawn_time#106rc#361600
death_time#106rc#3610
nemeses#106rc#361{}
nemesis_lifetime#106rc#361120
junk_on_death#106rc#361{}
say_fight_msg#106rc#361{}
wander_last_try#106rc#361#-1
destination#106rc#361#-1
last_wander_time#106rc#3610
last_comment_time#106rc#3610
max_contents#106rc#36110
beg_health#106rc#361-1
beg_chance#106rc#3610
beg_msg#106rc#361"%DN drops to %p knees and begs you, \"Oh god don't kill me! Take whatever you want!\""
reload_guns#106rc#3611
clothing#106rc#361{}
wardrobe#106rc#361#-1
stay_home#106rc#3611
respawn_clothing#106rwc#361{}
walk_last_try#106rc#361#-1
ignore_next_say#106rc#3610
did_damage#106rc#3610
walk_speed#106rc#3611
here_for_something#106rc#3610
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<clear>
respawn#107rc#361#2800
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<clear>
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#107r#362<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#361<clear>
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#361<clear>
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<clear>
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#3611
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 NPC"}
description#1rc#361<clear>
object_size#1r#29{45233, 1298433815}
hidden_verbs#1rc#361{"command", "@behaviors", "@possess", "@setup", "@compile", "heartstart", "strip", "tame"}
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): #154 generic living creature#107 generic creature#92 generic actor#1 root

Children: #142 generic monster, #155 generic genius, #233 generic critter

Call graph

calls n106_0 #106:wield_best n107_2 #107:_unwield n106_0->n107_2 n107_0 #107:_wield n106_0->n107_0 n106_1 #106:get_gift n106_1->n106_0 n107_49 #107:get_gift n106_1->n107_49 n106_2 #106:_wander n106_4 #106:is_legal_wander_exit n106_2->n106_4 n106_3 #106:_fight n106_3->n106_2 n107_104 #107:threat_rating n106_3->n107_104 n106_30 #106:_flee n106_3->n106_30 n107_45 #107:_fight n106_3->n107_45 n106_7 #106:start_fighting n106_3->n106_7 n106_8 #106:say_idea n106_3->n106_8 n107_151 #107:sanitize_fighting n106_3->n107_151 n106_30->n106_4 n107_34 #107:say n106_30->n107_34 n20_81 #20:msg n106_30->n20_81 n106_7->n106_0 n106_7->n106_8 n107_126 #107:reachable_by n106_7->n107_126 n1_33 #1:area n106_7->n1_33 n106_34 #106:add_nemesis n106_7->n106_34 n107_27 #107:start_fighting n106_7->n107_27 n106_8->n107_34 n106_5 #106:die n107_162 #107:is_in_afterlife n106_5->n107_162 n103_2 #103:junk n106_5->n103_2 n107_7 #107:die n106_5->n107_7 n106_6 #106:moveto n106_16 #106:update_lastrooms n106_6->n106_16 n107_24 #107:moveto n106_6->n107_24 n106_9 #106:hear_event_arrive n92_6 #92:clear_queue n106_9->n92_6 n106_21 #106:greet n106_9->n106_21 n92_8 #92:jumpstart n106_9->n92_8 n106_21->n107_34 n20_34 #20:pronoun_sub n106_21->n20_34 n106_10 #106:hear_say_to n106_10->n107_34 n20_12 #20:strip_chars n106_10->n20_12 n20_39 #20:words n106_10->n20_39 n106_61 #106:is_nemesis n106_10->n106_61 n106_10->n20_34 n106_10->n20_81 n106_60 #106:_conversation n106_10->n106_60 n106_54 #106:match_convo n106_10->n106_54 n106_56 #106:respond_convo n106_10->n106_56 n106_56->n107_34 n106_11 #106:hear_event_say n106_11->n106_10 n106_15 #106:heartbeat n106_15->n107_162 n106_15->n103_2 n106_19 #106:respawn n106_15->n106_19 n106_35 #106:reap_nemeses n106_15->n106_35 n106_40 #106:forget_enemies n106_15->n106_40 n150_2 #150:unregister n106_15->n150_2 n1_42 #1:occupants n106_15->n1_42 n107_5 #107:heartbeat n106_15->n107_5 n106_17 #106:@compile

Showing 48 of 106 verbs; 58 not shown.

Source

wield_best

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1best = #-1;
2for x in (this.contents)
3if (is_a(x, $weapon))
4if ((!valid(best)) || (x.value > best.value))
5best = x;
6endif
7endif
8endfor
9if (valid(best))
10uw = #-1;
11if (typeof(this.unarmed_weapon) == LIST)
12uw = this.unarmed_weapon[1];
13else
14uw = this.unarmed_weapon;
15endif
16if (best:damage()[1][3] < uw:damage()[1][3])
17for x in (this.wielding)
18this:_unwield(x);
19endfor
20else
21if (!(best in this.wielding))
22for x in (this.wielding)
23this:_unwield(x);
24endfor
25this:_wield(best);
26endif
27endif
28endif

get_gift

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1r = pass(@args);
2what = args[1];
3if (this.wields_weapons)
4if (is_a(what, $weapon))
5this:wield_best();
6endif
7endif
8return r;

_wander

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1e = {};
2er = {};
3if ((time() - this.last_wander_time) < this.wander_speed)
4return 0;
5endif
6if (`this.here_for_something ! ANY')
7return 0;
8endif
9if ((random(100) < this.wander_chance) || is_a(this.location, #2180))
10if (random(100) < 10)
11this.lastrooms = {};
12endif
13if (is_a(this.location, $room))
14for x in (this.location.exits)
15if (this:is_legal_wander_exit(x))
16if (!(x.otherside.location in this.lastrooms))
17e = setadd(e, x);
18endif
19er = setadd(er, x);
20endif
21endfor
22if (e)
23ex = e[random(length(e))];
24elseif (er)
25ex = er[random(length(er))];
26this.lastrooms = {};
27else
28ex = #-1;
29this.lastrooms = {};
30endif
31if (valid(ex))
32if (ex == this.wander_last_try)
33this.lastrooms = {};
34this.wander_last_try = #-1;
35return {};
36endif
37this.wander_last_try = ex;
38this.last_wander_time = time();
39return {this.move_action, {ex}, 1, ex.name};
40endif
41endif
42endif

_fight

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1"Copied from generic NPC (#138):_fight_ari by Gilmore (#98) Fri Mar  6 20:52:24 2009 CST";
2"Copied from generic NPC (#138):_fight by Gilmore (#98) Fri Mar  6 10:36:30 2009 CST";
3if (random(100) < 20)
4if (`this.location.no_combat ! ANY => 0')
5return;
6endif
7"do a bravery check";
8if (this.fighting)
9vs = 0;
10me = this:threat_rating() + this.bravery;
11for x in (this.location:occupants($creature))
12if (this in x.fighting)
13vs = vs + x:threat_rating();
14endif
15if (x in this.friends)
16me = me + x:threat_rating();
17endif
18endfor
19if (vs > me)
20return this:_flee();
21else
22return pass(@args);
23endif
24else
25for x in (setremove(this.location:occupants($creature), this))
26if (x in this.enemies)
27if (x:threat_rating() < (this:threat_rating() + this.bravery))
28this:start_fighting(x);
29return pass(@args);
30else
31this:say_idea("flee");
32return this:_wander();
33endif
34endif
35endfor
36endif
37else
38this:sanitize_fighting();
39"tactics = `this.tactics ! E_PROPNF => $tactics.default';";
40"tactic = (typeof(tactics) == LIST) ? tactics[random($)] | tactics;";
41"if ((chance = `this.tactics_chance ! ANY') && (random(100) <= chance))";
42"  return tactic:decide_on_action(this) || pass(@args);";
43"endif";
44return pass(@args);
45endif

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1"Is the given exit legal for us to wander into?";
2x = args[1];
3if (valid(x.otherside) && valid(d = x.otherside.location))
4if ((!this.public_wander_only) || d.public)
5return x:allows(this) ? 1 | 0;
6endif
7endif
8return 0;

die

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (!this:is_in_afterlife())
2this.death_time = time();
3endif
4for x in (this.contents)
5for y in (this.junk_on_death)
6if (is_a(x, y))
7$rpg:junk(x);
8endif
9endfor
10endfor
11this.enemies = {};
12pass(@args);
13if (is_a(this.body, $body))
14`this.body.clothing = this.clothing ! ANY';
15endif

moveto

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1this:update_lastrooms();
2return pass(@args);

start_fighting

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (!this:reachable_by(args[1]))
2return 0;
3endif
4if (is_a(this:area(), $real_area))
5this.enemies = setadd(this.enemies, args[1]);
6this:add_nemesis(args[1]);
7if (this.wields_weapons)
8this:wield_best();
9endif
10this:say_idea("fight");
11this.did_damage = 0;
12return pass(@args);
13"elseif (is_a(this:area(), #2488) && this.can_fight_in_dream)";
14"  if (this.wields_weapons)";
15"    this:wield_best();";
16"  endif";
17"  this:say_idea(\"fight\");";
18"  this.did_damage = 0;";
19"  return pass(@args);";
20endif

say_idea

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1i = args[1];
2m = this.(("say_" + i) + "_msg");
3if (m)
4if (typeof(m) == STR)
5this:say(m);
6else
7this:say(m[random(length(m))]);
8endif
9endif

hear_event_arrive

Spec this none thisFlags rxOwner #361Definer #106

Referenced by

Source

1if ((!this.fighting) && this.preemptible)
2if (is_a(args[3], $player))
3fork (1)
4this:clear_queue();
5this:greet(args[3], args[4][1]);
6this.reacting_to = $actions.arrive;
7this:jumpstart();
8endfork
9endif
10endif

hear_say_to

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (this._conversation)
2text = args[2];
3stripped = $su:strip_chars(text, "?!.,");
4words = $su:words(stripped);
5who = args[1];
6if (this:is_nemesis(who))
7fork (1)
8this:say($su:ps($su:msg(this.fuck_off_msg), who), who);
9endfork
10return;
11endif
12allhits = {};
13for x in (this:_conversation(who))
14if (this:match_convo(who, words, x))
15allhits = {@allhits, x[2..$]};
16endif
17endfor
18if (allhits)
19res = allhits[random(length(allhits))];
20fork (1)
21this:respond_convo(who, res, text);
22endfork
23else
24fork (1)
25m = `this.comments ! ANY' ? this.comments | this.dunno_msg;
26this:say($su:msg(m), who);
27endfork
28endif
29endif

hear_event_say

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (!this.fighting)
2if (is_player(args[3]))
3if ((length(args[4]) > 1) && (args[4][2] == this))
4if (this.ignore_next_say && ((time() - this.ignore_next_say) < 5))
5this.ignore_next_say = 0;
6return;
7endif
8this:hear_say_to(args[3], args[4][1]);
9endif
10endif
11endif

hear_event_shake

Spec this none thisFlags rxOwner #361Definer #106

Referenced by

none

Source

1if (args[4][1] == this)
2who = args[3];
3this:heard_no_from(who);
4endif

hear_event_nod

Spec this none thisFlags rxOwner #361Definer #106

Referenced by

none

Source

1if (args[4][1] == this)
2who = args[3];
3this:heard_yes_from(who);
4endif

_step_toward

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1where = args[1];
2if (valid(nh = this.location:next_hop_to(where)))
3return {$actions.move, {nh}, 1, nh.name};
4endif

heartbeat

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (this:is_in_afterlife() && (this.location != this.respawn))
2"Either respawn or don't.  Do nothing else.";
3if ((time() - this.death_time) > this.respawn_time)
4if ((this.respawn != this.home) || (!this.respawn:occupants($player)))
5return this:respawn();
6endif
7endif
8raise(E_NONE, "Can't respawn yet.");
9endif
10if (heresince = `this.here_for_something ! ANY')
11if (time() > heresince)
12this.here_for_something = 0;
13endif
14endif
15if (length(this.contents) > this.max_contents)
16`$rpg:junk(this.contents[random(length(this.contents))]) ! ANY => 0';
17endif
18if (random(10) == 1)
19this:reap_nemeses();
20this:forget_enemies();
21endif
22this.reacting_to = $actions.heartbeat;
23if (random(100) < 25)
24if (area(this).hibernating && (!this.dont_hibernate))
25$heart:unregister(this);
26endif
27if (decal = this:occupants($decal))
28decal[random($)]:reduce_by(1);
29endif
30endif
31return pass(@args);

update_lastrooms

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (is_a(this.location, $room))
2this.lastrooms = {this.location, @this.lastrooms};
3if (length(this.lastrooms) > 10)
4this.lastrooms = this.lastrooms[1..10];
5endif
6endif

@compile

Spec this none noneFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (!player.programmer)
2player:tell($huh_text);
3else
4this:_compile(player);
5endif

hear_event_die

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1victim = args[3];
2this.enemies = setremove(this.enemies, victim);

respawn

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1this:on_spawn();
2if (this.respawn_clothing)
3this.clothing = this.respawn_clothing;
4endif
5return pass(@args);

cant_take

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1what = args[1];
2if (what:weight() < 0)
3return "it's attached to the " + this.location:floor_msg();
4endif
5if (is_a(what, #3167) || is_a(what, #156864))
6if (what.to == this)
7return 0;
8else
9return "that package isn't for " + this.po;
10endif
11endif
12for x in (this.accepted_gifts)
13if (is_a(what, x))
14return 0;
15endif
16endfor
17return pass(@args);

greet

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2from = args[2];
3if (((m = this:greet_msg(who)) && ((time() - this.last_greet_time) > 12)) && (who.location == this.location))
4this:say($su:ps(m, who), who);
5this.last_greet_time = time();
6endif

_reload

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (is_a(w = this:weapon(), #285))
2if (w.jammed)
3return {$actions.verb, {w, "clear", {}, 2.0, 0}};
4endif
5if ((!w.contents) && ((this.reload_guns || (w == this.unarmed_weapon)) || ((typeof(this.unarmed_weapon) == LIST) && (w in this.unarmed_weapon))))
6type = valid(w.ammo_type) ? w.ammo_type | w.default_ammo;
7ammo = #-1;
8for x in (this.contents)
9if (is_a(x, type))
10ammo = x;
11endif
12endfor
13ammo = valid(ammo) ? ammo | $rpg:spawn(type);
14ammo:moveto(this);
15return {$actions.verb, {w, "_load", {ammo, this}, 1.0, 0}, 1, "load"};
16endif
17endif

_wield_best

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1best = #-1;
2bestval = 0;
3for x in (this.contents)
4if (is_a(x, $weapon))
5if (x.value > bestval)
6best = x;
7bestval = x.value;
8endif
9endif
10endfor
11if (valid(best) && (!(best in this.wielding)))
12return {$actions.verb, {this, "_wield", {best}, 1.0, 0}, 1, "wield best weapon"};
13endif

_home

Spec this none thisFlags rxOwner #361Definer #106

Referenced by

none

Source

1if (valid(this.home) && is_a(this.home, $room))
2if (this.location != this.home)
3if (valid(exit = this.location:next_hop_to(this.home)))
4return {this.move_action, {exit}, 1, "walk home"};
5endif
6endif
7endif

suggest_next_action

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if (r = this:_reload())
2return {r, 0};
3elseif (r = this:_fight())
4return {r, 0};
5elseif (r = this:_aggression())
6return {r, 0};
7elseif (r = this:_comment())
8return {r, 5};
9elseif (r = this:_walk())
10return {r, this.walk_speed};
11elseif (r = this:_wander())
12return {r, this.wander_speed};
13endif

_comment

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1"Don't comment inside clone vats.";
2if (!is_a(this.location, #2180))
3if ((time() - this.last_comment_time) > 20)
4if (this.lastaction != "c")
5if (random(100) <= this.comment_chance)
6if (people = this.location:occupants($player))
7if (comment = this:random_comment())
8who = people[random(length(people))];
9comment = this:random_comment();
10this.last_comment_time = time();
11return {$actions.verb, {this, "say", {comment, who}, 0.0}, 1, ""};
12endif
13endif
14endif
15endif
16endif
17endif

_allows

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (this:is_doing($actions.struggle) || this:is_doing($actions.beg))
2return 1;
3endif
4return 0;

hear_event_fight

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1this.reacting_to = $actions.fight;
2return pass(@args);

_notice_nude

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (this.notice_nude_msg && (length(this.notice_nude_msg) > 0))
2if (!(this.lastaction in {"nn", "c"}))
3if (random(100) < this.comment_chance)
4for x in (this.location:occupants($player))
5if (!x:wearing_on(#305))
6this.lastaction = "nn";
7return {$actions.verb, {this, "say", {$su:msg(this.notice_nude_msg), x}, 1.0, 1}, 1, ""};
8endif
9endfor
10endif
11endif
12endif

_flee

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1c = {};
2for x in (this.location.exits)
3if (this:is_legal_wander_exit(x))
4if (!is_a(x, $door))
5c = {@c, x};
6endif
7endif
8endfor
9if (c)
10c = c[random(length(c))];
11if (msg = $su:msg(this.say_flee_msg))
12this:say(msg);
13endif
14return {$actions.move, {c}, 1, c.name};
15endif

_suggest_next_action

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (is_a(this.location, #2180))
2if (r = this:_wander())
3return {r, this.wander_speed};
4endif
5else
6return this:suggest_next_action();
7endif

spawn_with

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1fork (0)
2for x in (this.spawns_with)
3if (typeof(x) == LIST)
4if (typeof(x[2]) == NUM)
5if (random(100) <= x[2])
6x = x[1];
7else
8x = #-1;
9endif
10else
11x = x[random(length(x))];
12endif
13endif
14if (valid(x) && valid(what = $rpg:spawn(x)))
15what:moveto(this);
16if (is_a(what, $weapon) && this.wields_weapons)
17this.wielding = setadd(this.wielding, what);
18elseif (is_a(what, $clothing))
19this.wearing = setadd(this.wearing, what);
20endif
21endif
22endfor
23endfork

on_spawn

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1$heart:register(this);
2$cu:sin();
3this:spawn_with();
4this:go_home();

add_nemesis

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2updated = 0;
3for x in [1..length(this.nemeses)]
4if (this.nemeses[x][1] == who)
5this.nemeses[x][2] = time();
6updated = 1;
7endif
8endfor
9if (!updated)
10this.nemeses = {@this.nemeses, {who, time()}};
11endif

reap_nemeses

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1nn = {};
2for x in (this.nemeses)
3if ((time() - x[2]) < (this.nemesis_lifetime * 60))
4nn = {@nn, x};
5endif
6endfor
7this.nemeses = nn;

_walk

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if ((time() - this.here_for_something) < 0)
2return;
3endif
4if (gamevalid(this.body))
5"we're dreaming, we don't have anywhere to be.";
6return;
7endif
8if (is_a(this.location, #31584))
9return;
10endif
11if ((((!this.wander_chance) && (this.location != this.home)) && (!valid(this.destination))) && this.stay_home)
12if (valid(this.home))
13this:head_to(this.home);
14endif
15endif
16if (gamevalid(this.destination) && gamevalid(room = this.destination:room()))
17if ($drugs.neurophage:doses_for(this) && (random(100) < 75))
18return;
19endif
20if (this.location != room)
21exit = this.location:next_hop_to(room);
22if (!valid(exit))
230 && $nets.pathnet:announce(this, ((("I gave up trying to reach " + $su:nn(this.destination)) + " from ") + $su:nn(this.location)) + ".");
24this.walk_last_try = #-1;
25this.destination = #-1;
26elseif (exit == this.walk_last_try)
270 && $nets.pathnet:announce(this, tostr("I can't get through this exit, ", $su:nn(exit), ", to get to ", $su:nn(this.destination), " from ", $su:nn(this.location), ". I give up."));
28this.walk_last_try = #-1;
29this.destination = #-1;
30else
31if ((!(exit.otherside.location in this.lastrooms)) || (random(100) > 20))
32this.walk_last_try = exit;
33return {this.move_action, {exit}, 1, "walk to destination"};
34else
350 && $nets.pathnet:announce(#-1, (($su:nn(this) + " was in a loop going to ") + $su:nn(this.destination)) + "!", 1);
36this.destination = #-1;
37this.walk_last_try = #-1;
38this.lastrooms = {};
39endif
40endif
41else
42this.destination = #-1;
43this.walk_last_try = #-1;
44this.here_for_something = time() + 120;
45`this:show_up() ! E_VERBNF => 0';
46endif
47endif

go_home

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1if ((is_a(this.respawn, #2180) && valid(this.home)) && (!is_a(this.home:area(), $area)))
2this.destination = #317;
3elseif (valid(this.home) && (this.home != this.respawn))
4this.destination = this.home;
5endif

_aggression

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

No program (verb defined but unprogrammed).

_pee

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (this:has_penis() && (#8811:doses_for(this) > 2))
2return;
3endif
4if (#25493:doses_for(this) < 1)
5return;
6endif
7if (args == {})
8dobj = this.location;
9else
10dobj = args[1];
11endif
12stillsuit = #-1;
13for x in (this:wearing_on(#305))
14if (is_a(x, #26285))
15stillsuit = x;
16endif
17endfor
18if (valid(stillsuit))
19stillsuit:receive_pee(1);
20else
21if (is_a(dobj, #82393))
22if (this:has_vagina())
23if ((this.posture != "standing") && (!(this in dobj.sitting)))
24this:queue_action($actions.stand, {dobj}, 1, "stand");
25endif
26if (!(this in dobj.sitting))
27this:queue_action($actions.sit, {dobj}, 1, "sit " + argstr);
28endif
29endif
30endif
31length = #25493:doses_for(this);
32for a in [1..length]
33this:queue_action($actions.verb, {#160, "_do_social", {this, dobj, "pee"}, 1.0, 1}, 1, "");
34endfor
35fork (#25493:doses_for(this) + random(3))
36`dobj:post_pee(this) ! ANY => 0';
37endfork
38endif
39fork (#25493:doses_for(this) + random(3))
40#25493:remove_from(this, #25493:doses_for(player));
41exit = this.location.exits[random(length(this.location.exits))];
42this:queue_action($actions.move, {exit.name}, 1, exit.name);
43endfork

forget_enemies

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1forget_list = {};
2for x in (this.enemies)
3$cu:sin(0);
4if (!is_a(x, $creature))
5forget_list = setadd(forget_list, x);
6continue;
7endif
8if (#114:check(this, 5) > 0)
9forget_list = setadd(forget_list, x);
10endif
11endfor
12for x in (forget_list)
13this.enemies = setremove(this.enemies, x);
14$cu:sin(0);
15endfor

take_damage

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1amount = pass(@args);
2attacker = (length(args) > 3) ? args[4] | #-1;
3if (amount > 0)
4if (valid(attacker))
5if (attacker.location == this.location)
6fork (1)
7if (this.health)
8if (this:beg_check(attacker))
9this:queue_action($actions.npcbeg, {attacker});
10endif
11endif
12endfork
13endif
14endif
15endif
16return amount;

beg_check

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2if (this.health <= this.beg_health)
3if (this.health > 0)
4if (random(100) <= this.beg_chance)
5return 1;
6endif
7endif
8endif

spare_old

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1#365733:tell($ansi.yellow, $ansi.bold_on, $su:nn(player), $ansi.bold_off, " called the old spare verb on ", $ansi.bold_on, $su:nn(this), $ansi.reset);
2if (this.executing)
3if (this.executing[1] == $actions.npcbeg)
4if (this.executing[2][1] == player)
5this:spared_by(player);
6return;
7endif
8endif
9endif
10player:tell(this:dnamec(), " isn't asking to be spared.");

spared_by

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2this:say("Whew.  I'm glad that's settled.");
3who:stop_fighting(this);
4this:stop_fighting(who);
5this:cancel_current_action();
6this:clear_queue();
7this.health = this.health_max;
8this:remove_nemesis(who);
9this.enemies = setremove(this.enemies, who);
10if (cams = this.location:occupants(#9348))
11if (valid(cams[1].system) && has_callable_verb(cams[1].system, "decrease_wanted_level"))
12cams[1].system:decrease_wanted_level(who, 2);
13endif
14endif

beg_msg

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1return this.beg_msg;

_brainscan

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1pass(who = args[1]);
2if (valid(dest = this.destination))
3if (dest == this.home)
4this:_whisper(who, "I'm headed home.");
5else
6this:_whisper(who, "I'm headed to ", dest.name, ".");
7endif
8endif

random_comment

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1return `this.comments[random(length(this.comments))] ! ANY => ""';

random_rumor

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (valid(this.rumor_db) && (this.rumor_db != $rpg))
2return this.rumor_db:random_rumor();
3elseif (valid(rumor = this:area():random_rumor()))
4return rumor;
5else
6return $rpg:random_rumor();
7endif

encumbrance

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

No program (verb defined but unprogrammed).

_is_nude

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1if (this.is_nude_msg && (length(this.is_nude_msg) > 0))
2if (!(this.lastaction in {"isnude", "c"}))
3if (random(10) < 8)
4for x in (this.location:occupants($player))
5if (this:wearing_on(#305) == {})
6this.lastaction = "isnude";
7this:say($su:msg(this.is_nude_msg));
8endif
9endfor
10endif
11endif
12endif

greet_msg

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1m = this.(verb);
2return (typeof(m) == STR) ? m | $su:msg(m);

com*mand

Spec this at/to anyFlags rxdOwner #361Definer #106

Referenced by

none

Source

1"Copied from generic creature (#109):command by Spunky (#97) Sat Jan  3 13:32:55 2009 CST";
2if (!player.programmer)
3player:tell("You don't see why ", this:dname(), " would listen to you.");
4return;
5endif
6command = iobjstr;
7words = $su:explode(iobjstr);
8this:do_command(iobjstr, words);

wearing_on

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1":wearing_on(OBJ bodypart) => LIST what I'm wearing there.";
2part = args[1];
3s = {};
4for x in (this.clothing)
5if (is_a(x, $clothing))
6for y in (x.covers)
7if (is_a(part, y))
8s = setadd(s, x);
9break;
10endif
11endfor
12endif
13endfor
14if (s)
15return s;
16endif
17return pass(@args);

match_convo

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2words = args[2];
3convoline = args[3];
4wordstring = $su:from_list(words, " ");
5for x in (convoline[1])
6if (match(wordstring, tostr("%(^%|%W%)", x, "%($%|%W%)")))
7return 1;
8endif
9endfor

none

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

No program (verb defined but unprogrammed).

respond_convo

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1who = args[1];
2res = args[2];
3whotxt = args[3];
4resp = res[1];
5respv = res[2];
6if (resp && (resp != "NULL"))
7qname = "";
8if (resp[1] == "*")
9resp = resp[2..$];
10i = index(resp, "*");
11qname = resp[1..i - 1];
12resp = resp[i + 1..$];
13endif
14this:say(resp, who);
15if (qname)
16quest = $quests.(qname);
17quest:add_hint(who, ((this:inamec() + " said, \"") + resp) + "\"");
18endif
19endif
20if (respv && (respv != "NULL"))
21this:(respv)(who, whotxt);
22endif

convo_words

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1cw = {};
2for x in (this._conversation)
3for y in (x[1])
4cw = setadd(cw, y);
5endfor
6endfor
7return cw;

head_to head_for

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1what = args[1];
2where = is_a(what, $room) ? what | what:room();
3if ((where == this.location) || (!$recycler:valid(where)))
4return;
5$nets.pathnet:_announce(#-1, tostr($su:nn(this), " tried to head to ", $su:nn(what), " (where: ", $su:nn(where), ")"), 1);
6return;
7endif
8if (length(args) > 3)
9m = args[4];
10else
11if (m = `$su:msg(this.head_to_msg) ! ANY')
12if (where == this.home)
13m = strsub(m, "%t", "home");
14else
15m = $su:ps(m, this, where);
16endif
17endif
18endif
19if (this.fighting)
20return;
21endif
22stay_for = (length(args) > 1) ? args[2] | 1;
23force = (length(args) > 2) ? args[3] | 0;
24if (valid(this.destination) && (!force))
25return;
26endif
27this.destination = where;
28this.lastrooms = {};
29`this.headed_to_stay_for = stay_for ! ANY';
30`this.headed_to_count = 0 ! ANY';
31this.here_for_something = 0;
32m && this:say(m);
33this:jumpstart();

_fight_ari

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1"Copied from generic NPC (#138):_fight by Gilmore (#98) Fri Mar  6 10:36:30 2009 CST";
2if (random(100) < 20)
3if (`this.location.no_combat ! ANY => 0')
4return;
5endif
6"do a bravery check";
7if (this.fighting)
8vs = 0;
9me = this:threat_rating() + this.bravery;
10for x in (this.location:occupants($creature))
11if (this in x.fighting)
12vs = vs + x:threat_rating();
13endif
14if (x in this.friends)
15me = me + x:threat_rating();
16endif
17endfor
18if (vs > me)
19return this:_flee();
20else
21return pass(@args);
22endif
23else
24for x in (setremove(this.location:occupants($creature), this))
25if (x in this.enemies)
26if (x:threat_rating() < (this:threat_rating() + this.bravery))
27this:start_fighting(x);
28return pass(@args);
29else
30this:say_idea("flee");
31return this:_wander();
32endif
33endif
34endfor
35endif
36else
37this:sanitize_fighting();
38tactics = `this.tactics ! E_PROPNF => $tactics';
39return tactics:decide_on_action(this) || pass(@args);
40endif

_conversation

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1return this.(verb);

is_nemesis

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1{who} = args;
2return who in $lu:slice(this.nemeses, 1);

remove_nemesis

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1{who} = args;
2if (index = $lu:iassoc(who, this.nemeses))
3this.nemeses = listdelete(this.nemeses, index);
4return 1;
5else
6return 0;
7endif

clear_nemeses

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1this.nemeses = {};

afterlife

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1return this.afterlife;

_compile

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

Source

1{who} = args;
2who:tell("Compiling conversation for ", $su:nn(this), ":");
3cc = {};
4allkeys = {};
5for x in (this.conversation)
6xl = $su:explode(x, "|");
7if (length(xl) < 2)
8who:tell("Error - no | in line: ", x);
9return;
10endif
11keys = $su:explode(xl[1], ",");
12v = (length(xl) > 2) ? xl[3] | "";
13extra = (length(xl) > 3) ? xl[4..$] | {};
14text = xl[2];
15cc = {@cc, {keys, text, v, @extra}};
16allkeys = {@allkeys, @keys};
17$cu:sin(0);
18endfor
19cc2 = {};
20for x in (cc)
21newtext = $su:highlight_words(x[2], allkeys);
22who:tell("  ", newtext);
23cc2 = {@cc2, {x[1], newtext, @x[3..$]}};
24endfor
25this._conversation = cc2;
26if (`this.comments ! ANY')
27this.comments = $su:highlight_words(this.comments, allkeys);
28endif
29if (this.greet_msg)
30this.greet_msg = $su:highlight_words(this.greet_msg, allkeys);
31endif
32if (this.dunno_msg)
33this.dunno_msg = $su:highlight_words(this.dunno_msg, allkeys);
34endif
35who:tell("Done!");

suggest_teacher

Spec this none thisFlags rxdOwner #361Definer #106

Referenced by

none

Source

1skill = args[1];
2raw = args[2] + 1;
3t = {};
4for w in (keys(skill.teachers))
5d = skill.teachers[w];
6if ((d[1] <= raw) && (d[2] >= raw))
7if (is_a(w, $living))
8t = {@t, w};
9endif
10endif
11endfor
12if (t)
13t = t[random($)];
14m = $su:ps(this.suggest_teacher_msg, this, t, area(t));
15this:say(m);
16endif