generic NPC #106
Aliases: generic NPC
67 verbs · 130 properties · 3 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
wield_best | this none this | rxd | #106 | 28 |
get_gift | this none this | rxd | #106 | 8 |
_wander | this none this | rxd | #106 | 42 |
_fight | this none this | rxd | #106 | 45 |
is_legal_wander_exit | this none this | rxd | #106 | 8 |
die | this none this | rxd | #106 | 15 |
moveto | this none this | rxd | #106 | 2 |
start_fighting | this none this | rxd | #106 | 20 |
say_idea | this none this | rxd | #106 | 9 |
hear_event_arrive | this none this | rx | #106 | 10 |
hear_say_to | this none this | rxd | #106 | 29 |
hear_event_say | this none this | rxd | #106 | 11 |
hear_event_shake | this none this | rx | #106 | 4 |
hear_event_nod | this none this | rx | #106 | 4 |
_step_toward | this none this | rxd | #106 | 4 |
heartbeat | this none this | rxd | #106 | 31 |
update_lastrooms | this none this | rxd | #106 | 6 |
@compile | this none none | rxd | #106 | 5 |
hear_event_die | this none this | rxd | #106 | 2 |
respawn | this none this | rxd | #106 | 5 |
cant_take | this none this | rxd | #106 | 17 |
greet | this none this | rxd | #106 | 6 |
_reload | this none this | rxd | #106 | 17 |
_wield_best | this none this | rxd | #106 | 13 |
_home | this none this | rx | #106 | 7 |
suggest_next_action | this none this | rxd | #106 | 13 |
_comment | this none this | rxd | #106 | 17 |
_allows | this none this | rxd | #106 | 4 |
hear_event_fight | this none this | rxd | #106 | 2 |
_notice_nude | this none this | rxd | #106 | 12 |
_flee | this none this | rxd | #106 | 15 |
_suggest_next_action | this none this | rxd | #106 | 7 |
spawn_with | this none this | rxd | #106 | 23 |
on_spawn | this none this | rxd | #106 | 4 |
add_nemesis | this none this | rxd | #106 | 11 |
reap_nemeses | this none this | rxd | #106 | 7 |
_walk | this none this | rxd | #106 | 47 |
go_home | this none this | rxd | #106 | 5 |
_aggression | this none this | rxd | #106 | 0 |
_pee | this none this | rxd | #106 | 43 |
forget_enemies | this none this | rxd | #106 | 15 |
take_damage | this none this | rxd | #106 | 16 |
beg_check | this none this | rxd | #106 | 8 |
spare_old | this none this | rxd | #106 | 10 |
spared_by | this none this | rxd | #106 | 14 |
beg_msg | this none this | rxd | #106 | 1 |
_brainscan | this none this | rxd | #106 | 8 |
random_comment | this none this | rxd | #106 | 1 |
random_rumor | this none this | rxd | #106 | 7 |
encumbrance | this none this | rxd | #106 | 0 |
_is_nude | this none this | rxd | #106 | 12 |
greet_msg | this none this | rxd | #106 | 2 |
com*mand | this at/to any | rxd | #106 | 8 |
wearing_on | this none this | rxd | #106 | 17 |
match_convo | this none this | rxd | #106 | 9 |
none | this none this | rxd | #106 | 0 |
respond_convo | this none this | rxd | #106 | 22 |
convo_words | this none this | rxd | #106 | 7 |
head_to head_for | this none this | rxd | #106 | 33 |
_fight_ari | this none this | rxd | #106 | 40 |
_conversation | this none this | rxd | #106 | 1 |
is_nemesis | this none this | rxd | #106 | 2 |
remove_nemesis | this none this | rxd | #106 | 7 |
clear_nemeses | this none this | rxd | #106 | 1 |
afterlife | this none this | rxd | #106 | 1 |
_compile | this none this | rxd | #106 | 35 |
suggest_teacher | this none this | rxd | #106 | 16 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
wields_weapons | #106 | rc | #361 | 1 |
public_wander_only | #106 | rc | #361 | 0 |
bravery | #106 | rc | #361 | 15 |
enemies | #106 | rw | #361 | {} |
lastrooms | #106 | r | #361 | {} |
wander_chance | #106 | rc | #361 | 0 |
last_greet_time | #106 | r | #361 | 0 |
conversation | #106 | rc | #361 | {} |
_conversation | #106 | r | #361 | {} |
dunno_msg | #106 | rc | #361 | "Huh?" |
spawns_with | #106 | rc | #361 | {} |
accepted_gifts | #106 | rc | #361 | {} |
greet_msg | #106 | rc | #361 | "" |
wander_speed | #106 | rc | #361 | 20 |
reacting_to | #106 | rc | #361 | #-1 |
lastaction | #106 | rw | #361 | "" |
comment_chance | #106 | rc | #361 | 35 |
respawn_time | #106 | rc | #361 | 600 |
death_time | #106 | rc | #361 | 0 |
nemeses | #106 | rc | #361 | {} |
nemesis_lifetime | #106 | rc | #361 | 120 |
junk_on_death | #106 | rc | #361 | {} |
say_fight_msg | #106 | rc | #361 | {} |
wander_last_try | #106 | rc | #361 | #-1 |
destination | #106 | rc | #361 | #-1 |
last_wander_time | #106 | rc | #361 | 0 |
last_comment_time | #106 | rc | #361 | 0 |
max_contents | #106 | rc | #361 | 10 |
beg_health | #106 | rc | #361 | -1 |
beg_chance | #106 | rc | #361 | 0 |
beg_msg | #106 | rc | #361 | "%DN drops to %p knees and begs you, \"Oh god don't kill me! Take whatever you want!\"" |
reload_guns | #106 | rc | #361 | 1 |
clothing | #106 | rc | #361 | {} |
wardrobe | #106 | rc | #361 | #-1 |
stay_home | #106 | rc | #361 | 1 |
respawn_clothing | #106 | rwc | #361 | {} |
walk_last_try | #106 | rc | #361 | #-1 |
ignore_next_say | #106 | rc | #361 | 0 |
did_damage | #106 | rc | #361 | 0 |
walk_speed | #106 | rc | #361 | 1 |
here_for_something | #106 | rc | #361 | 0 |
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 | <clear> |
respawn | #107 | rc | #361 | #2800 |
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 | <clear> |
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 | r | #362 | <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 | <clear> |
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 | <clear> |
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 | <clear> |
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 | 1 |
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 NPC"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {45233, 1298433815} |
hidden_verbs | #1 | rc | #361 | {"command", "@behaviors", "@possess", "@setup", "@compile", "heartstart", "strip", "tame"} |
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): #154 generic living creature → #107 generic creature → #92 generic actor → #1 root
Children: #142 generic monster, #155 generic genius, #233 generic critter
Call graph
Showing 48 of 106 verbs; 58 not shown.
Source
wield_best
Referenced by
- #106:get_gift line 5:
this:wield_best - #106:start_fighting line 8:
this:wield_best - #142:enter_room line 7:
this:wield_best
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
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
Referenced by
- #106:_fight line 32:
this:_wander - #106:suggest_next_action line 11:
this:_wander - #106:_suggest_next_action line 2:
this:_wander - #106:_fight_ari line 31:
this:_wander - #142:_wander line 13:
pass( - #155:_wander line 1:
pass(
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
Referenced by
- #106:suggest_next_action line 3:
this:_fight - #143:suggest_next_action line 1:
this:_fight - #155:suggest_next_action line 1:
this:_fight
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
is_legal_wander_exit
Referenced by
- #106:_wander line 15:
this:is_legal_wander_exit - #106:_flee line 3:
this:is_legal_wander_exit
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
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
Referenced by
- #142:on_spawn line 20:
this:moveto - #142:on_spawn line 22:
this:moveto
Source
1this:update_lastrooms(); 2return pass(@args);
start_fighting
Referenced by
- #106:_fight line 28:
this:start_fighting - #106:_fight_ari line 27:
this:start_fighting - #142:enter_room line 26:
this:start_fighting - #142:hear_event_fight line 4:
this:start_fighting - #142:_aggression line 13:
this:start_fighting - #142:_kill_target line 24:
this:start_fighting - #142:hear_event_arrive line 5:
this:start_fighting - #143:hear_event_pick line 6:
this:start_fighting - #155:p_defend line 13:
this:start_fighting - #155:p_defend line 17:
this:start_fighting - #341:call_police line 16:
this:start_fighting
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
Referenced by
- #106:_fight line 31:
this:say_idea - #106:start_fighting line 10:
this:say_idea - #106:_fight_ari line 30:
this:say_idea
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
Referenced by
- #142:hear_event_arrive line 9:
pass(
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
Referenced by
- #106:hear_event_say line 8:
this:hear_say_to - #155:hear_say_to line 2:
pass(
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
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
Referenced by
none
Source
1if (args[4][1] == this) 2who = args[3]; 3this:heard_no_from(who); 4endif
hear_event_nod
Referenced by
none
Source
1if (args[4][1] == this) 2who = args[3]; 3this:heard_yes_from(who); 4endif
_step_toward
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
Referenced by
- #142:heartbeat line 15:
pass( - #155:heartbeat line 1:
pass( - #233:heartbeat line 1:
pass(
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
Referenced by
- #106:moveto line 1:
this:update_lastrooms - #142:update_lastrooms line 7:
pass(
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
Referenced by
none
Source
1if (!player.programmer) 2player:tell($huh_text); 3else 4this:_compile(player); 5endif
hear_event_die
Referenced by
none
Source
1victim = args[3]; 2this.enemies = setremove(this.enemies, victim);
respawn
Referenced by
- #106:heartbeat line 5:
this:respawn - #142:respawn line 8:
pass(
Source
1this:on_spawn(); 2if (this.respawn_clothing) 3this.clothing = this.respawn_clothing; 4endif 5return pass(@args);
cant_take
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
Referenced by
- #106:hear_event_arrive line 5:
this:greet
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
Referenced by
- #106:suggest_next_action line 1:
this:_reload
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
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
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
Referenced by
- #106:_suggest_next_action line 6:
this:suggest_next_action - #142:suggest_next_action line 1:
pass(
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
Referenced by
- #106:suggest_next_action line 7:
this:_comment - #143:suggest_next_action line 11:
this:_comment
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
Referenced by
none
Source
1if (this:is_doing($actions.struggle) || this:is_doing($actions.beg)) 2return 1; 3endif 4return 0;
hear_event_fight
Referenced by
- #142:hear_event_fight line 1:
pass(
Source
1this.reacting_to = $actions.fight; 2return pass(@args);
_notice_nude
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
Referenced by
- #106:_fight line 20:
this:_flee - #106:_fight_ari line 19:
this:_flee
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
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
Referenced by
- #106:on_spawn line 3:
this:spawn_with
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
Referenced by
- #106:respawn line 1:
this:on_spawn - #142:on_spawn line 23:
pass(
Source
1$heart:register(this); 2$cu:sin(); 3this:spawn_with(); 4this:go_home();
add_nemesis
Referenced by
- #106:start_fighting line 6:
this:add_nemesis
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
Referenced by
- #106:heartbeat line 19:
this:reap_nemeses
Source
1nn = {}; 2for x in (this.nemeses) 3if ((time() - x[2]) < (this.nemesis_lifetime * 60)) 4nn = {@nn, x}; 5endif 6endfor 7this.nemeses = nn;
_walk
Referenced by
- #106:suggest_next_action line 9:
this:_walk - #142:suggest_next_action line 9:
this:_walk
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
Referenced by
- #106:on_spawn line 4:
this:go_home - #142:go_home line 4:
pass(
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
Referenced by
- #106:suggest_next_action line 5:
this:_aggression
Source
No program (verb defined but unprogrammed).
_pee
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
Referenced by
- #106:heartbeat line 20:
this:forget_enemies
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
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
Referenced by
- #106:take_damage line 8:
this:beg_check
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
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
Referenced by
- #106:spare_old line 5:
this:spared_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
Referenced by
none
Source
1return this.beg_msg;
_brainscan
Referenced by
- #142:_brainscan line 1:
pass(
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
Referenced by
- #106:_comment line 7:
this:random_comment - #106:_comment line 9:
this:random_comment
Source
1return `this.comments[random(length(this.comments))] ! ANY => ""';
random_rumor
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
Referenced by
- #142:_wander line 5:
this:encumbrance
Source
No program (verb defined but unprogrammed).
_is_nude
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
Referenced by
- #106:greet line 3:
this:greet_msg
Source
1m = this.(verb); 2return (typeof(m) == STR) ? m | $su:msg(m);
com*mand
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
Referenced by
- #106:_pee line 13:
this:wearing_on - #106:_is_nude line 5:
this:wearing_on
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
Referenced by
- #106:hear_say_to line 14:
this:match_convo
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
Referenced by
none
Source
No program (verb defined but unprogrammed).
respond_convo
Referenced by
- #106:hear_say_to line 21:
this:respond_convo
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
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
Referenced by
- #106:_walk line 13:
this:head_to
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
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
Referenced by
- #106:hear_say_to line 13:
this:_conversation
Source
1return this.(verb);
is_nemesis
Referenced by
- #106:hear_say_to line 6:
this:is_nemesis
Source
1{who} = args; 2return who in $lu:slice(this.nemeses, 1);
remove_nemesis
Referenced by
- #106:spared_by line 8:
this:remove_nemesis
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
Referenced by
none
Source
1this.nemeses = {};
afterlife
Referenced by
none
Source
1return this.afterlife;
_compile
Referenced by
- #106:@compile line 4:
this:_compile - #142:_compile line 1:
pass(
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
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