generic gatekeeper #143

Parent #142Owner #29Flags read, fertileSource hellcore/hellcore.db

Aliases: generic gatekeeper

9 verbs · 169 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
_check_doorthis none thisrxd#14333
_check_for_guarded_doorsthis none thisrxd#1436
suggest_next_actionthis none thisrxd#14317
give_keys_tothis none thisrxd#1437
hear_event_pickthis none thisrxd#1438
hear_event_knockthis none thisrxd#14316
answer_door_forthis none thisrxd#1432
_wanderthis none thisrxd#1437
_brainscanthis none thisrxd#14312

Properties

PropertyDefinerFlagsOwnerValue
guarded_doors#143rc#29{}
lockpick_msg#143rc#29"%T sees you picking the lock and springs into action!"
olockpick_msg#143rc#29"%T sees %dn picking the lock and springs into action!"
attack_lockpickers_chance#143rc#2950
answer_doors#143rc#290
last_answer_time#143rc#290
wait_threshhold#143rc#2910
species#142rc#29<clear>
scavenge_chance#142rc#29<clear>
nest#142rc#29<clear>
forbidden_rooms#142rc#29<clear>
areas#142rc#29<clear>
genders#142rc#29<clear>
names_adj#142rc#29<clear>
names_base_neuter#142rc#29<clear>
recycle_on_die#142rc#290
treasure#142rc#29{}
comments#142rc#29<clear>
defend_sibs_chance#142rc#29<clear>
aggression_chance#142rc#29<clear>
random_homes#142rc#29<clear>
turf_size#142rc#29<clear>
antigang_chance#142rc#29<clear>
food#142rc#29<clear>
feed_msg#142rc#29<clear>
tracking#142rc#29<clear>
track_speed#142rc#29<clear>
friendly_species#142rc#29<clear>
nest_container#142rc#29<clear>
default_alias#142rc#29<clear>
extra_aliases#142rc#29<clear>
kill_target#142rc#29<clear>
tactics_chance#142rc#29<clear>
spawned_by#142rc#29<clear>
contract_value#142rc#2950
suggest_area#142rc#29<clear>
no_cower#142rc#29<clear>
weapon_drop_chance#142rc#29<clear>
hoard_in_nest#142rc#29<clear>
wields_weapons#106rc#29<clear>
public_wander_only#106rc#29<clear>
bravery#106rc#29500
enemies#106rc#29{}
lastrooms#106rc#29<clear>
wander_chance#106rc#29<clear>
last_greet_time#106r#361<clear>
conversation#106rc#29<clear>
_conversation#106r#361<clear>
dunno_msg#106rc#29<clear>
spawns_with#106rc#29<clear>
accepted_gifts#106rc#29<clear>
greet_msg#106rc#29<clear>
wander_speed#106rc#29<clear>
reacting_to#106rc#29<clear>
lastaction#106rw#361<clear>
comment_chance#106rc#29<clear>
respawn_time#106rc#29<clear>
death_time#106rc#291237677662
nemeses#106rc#29<clear>
nemesis_lifetime#106rc#29<clear>
junk_on_death#106rc#29<clear>
say_fight_msg#106rc#29<clear>
wander_last_try#106rc#29<clear>
destination#106rc#29<clear>
last_wander_time#106rc#29<clear>
last_comment_time#106rc#29<clear>
max_contents#106rc#29<clear>
beg_health#106rc#29<clear>
beg_chance#106rc#29<clear>
beg_msg#106rc#29<clear>
reload_guns#106rc#29<clear>
clothing#106rwc#29<clear>
wardrobe#106rc#29<clear>
stay_home#106rc#29<clear>
respawn_clothing#106rc#29<clear>
walk_last_try#106rc#29<clear>
ignore_next_say#106rc#29<clear>
did_damage#106rc#29<clear>
walk_speed#106rc#29<clear>
here_for_something#106rc#29<clear>
hands#107rc#29<clear>
wielding#107rc#29<clear>
health#107rc#290
unarmed_weapon#107rc#29<clear>
size#107rc#29<clear>
posture#107rc#29<clear>
gender#107rc#29<clear>
respawn#107rc#29<clear>
corpse#107rc#29<clear>
has_proper_name#107rc#29<clear>
die_msg#107rc#29<clear>
body_parts#107rc#29<clear>
wearing#107rc#29<clear>
armor#107rc#29<clear>
last_swing_message#107rc#29<clear>
health_max#107rc#29<clear>
fighting#107rc#29{}
last_dodge_time#107rc#29<clear>
following#107rc#29<clear>
icon#107rc#29<clear>
say_msg#107rc#29<clear>
say_to_msg#107rc#29<clear>
afterlife#107rc#29<clear>
get_msg#107rc#29<clear>
drop_msg#107rc#29<clear>
blood#107rc#29<clear>
squeals#107rc#29<clear>
prc#107rc#29<clear>
ppc#107rc#29<clear>
poc#107rc#29<clear>
psc#107rc#29<clear>
pr#107rc#29<clear>
pp#107rc#29<clear>
po#107rc#29<clear>
ps#107rc#29<clear>
pq#107rc#29<clear>
pqc#107rc#29<clear>
brief#107rc#29<clear>
knockout#107rc#29<clear>
knockout_msg#107rc#29<clear>
body#107rc#29<clear>
wake_msg#107rc#29<clear>
owake_msg#107rc#29<clear>
oknockout_msg#107rc#29<clear>
friends#107rc#29<clear>
home#107rc#29<clear>
respawn_msg#107rc#29<clear>
move_action#107rc#29<clear>
heart#107rc#290
last_heartbeat#107rc#29<clear>
dead#107rc#291237677662
_tohit_next#107rc#29<clear>
last_words_msg#107rc#29<clear>
attacked#107rc#29<clear>
opens_doors#107rc#291
movable_by_explosion#107rc#29<clear>
obscured#107rc#29<clear>
obscured_desc_msg#107rc#29<clear>
cooldowns#107rc#29<clear>
combat_rounds#107rc#29<clear>
encumbrance#107rc#29<clear>
respawn_handler#107rc#29<clear>
distant_form_msg#107rc#29<clear>
block_msg#107rc#29<clear>
attack_on_block#107rc#29<clear>
last_stunned#107rc#29<clear>
nude_descs#107rc#29<clear>
skills#107rc#29<clear>
explode_msg#107rc#29<clear>
death_listeners#107rc#29<clear>
queue#92r#361{}
preemptible#92r#3611
executing#92r#361<clear>
process_queue#92r#361<clear>
help_msg#92rc#29
list of 15{"A generic creature which does all the shit $monster does, and also looks after any $door. The $gatekeeper will open/close lock/unlock doors in the same room as it if their state varies from the desired state in .guarded_doors.", "", "$gatekeeper.guarded_doors ", " => {{OBJ door_objnum, BOOL open/closed state, BOOL locked/unlocked state}, ...}", "\t1 = open | 0 = closed", "\t1 = locked | 0 = unlocked", "", "$gatekeeper:_check_door($door) ", " - Makes sure a door is in the desired state.", "", "$gatekeeper:_check_for_guarded_doors() ", " - Checks for guarded doors in the .location to possibly rectify.", "", "$gatekeeper:suggest_next_action()", " - Makes a call to :_check_for_guarded_doors."}
last_action#92r#361<clear>
article#92rc#29<clear>
last_last_action#92rc#29<clear>
action_count#92rc#29<clear>
aliases#1rc#29{"generic gatekeeper"}
description#1rc#29<clear>
object_size#1r#29{12078, 1298433821}
hidden_verbs#1rc#29<clear>
phelp_msg#1rc#29<clear>
weight#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

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

Children: none

Call graph

calls n143_1 #143:_check_for_guarded_doors n143_0 #143:_check_door n143_1->n143_0 n143_2 #143:suggest_next_action n143_2->n143_1 n106_3 #106:_fight n143_2->n106_3 n142_12 #142:_aggression n143_2->n142_12 n142_4 #142:_scavenge n143_2->n142_4 n106_26 #106:_comment n143_2->n106_26 n143_7 #143:_wander n143_2->n143_7 n92_8 #92:jumpstart n143_7->n92_8 n142_7 #142:_wander n143_7->n142_7 n143_3 #143:give_keys_to n45_5 #45:isa n143_3->n45_5 n107_31 #107:give_to n143_3->n107_31 n143_4 #143:hear_event_pick n20_34 #20:pronoun_sub n143_4->n20_34 n106_7 #106:start_fighting n143_4->n106_7 n143_5 #143:hear_event_knock n143_6 #143:answer_door_for n143_5->n143_6 n92_2 #92:queue_action n143_5->n92_2 n143_8 #143:_brainscan n142_22 #142:_brainscan n143_8->n142_22 n107_107 #107:_whisper n143_8->n107_107 n20_6 #20:english_list n143_8->n20_6 n47_3 #47:map_verb n143_8->n47_3

Source

_check_door

Spec this none thisFlags rxdOwner #29Definer #143

Referenced by

Source

1{door} = args;
2here = this.location;
3for doorspec in (this.guarded_doors)
4if (doorspec[1] == door)
5{door, aperturestate, lockstate} = doorspec;
6if ((time() - this.last_answer_time) > this.wait_threshhold)
7if (((aperturestate != door.open) && (!door:_is_locked())) && door.operational)
8verb = aperturestate ? "open" | "close";
9actionspec = {door, {verb}};
10return actionspec;
11endif
12if (((lockstate != door:_is_locked()) && (!door.open)) && door.operational)
13verb = lockstate ? "lock" | "unlock";
14for lock in (door:occupants($lock))
15if ((lock:_can_be_unlocked_by(this) && lock.operational) && (lock:locked() != lockstate))
16actionspec = {door, {verb}};
17return actionspec;
18endif
19endfor
20endif
21if (!door.operational)
22actionspec = {$actions.repair, {door}, 1, "repair " + door.name};
23return actionspec;
24endif
25for lock in (door:occupants($lock))
26if (!lock.operational)
27actionspec = {$actions.repair, {door}, 1, "repair " + door.name};
28return actionspec;
29endif
30endfor
31endif
32endif
33endfor

_check_for_guarded_doors

Spec this none thisFlags rxdOwner #29Definer #143

Referenced by

Source

1for each in (this.guarded_doors)
2door = each[1];
3if (door.location == this.location)
4return this:_check_door(door);
5endif
6endfor

suggest_next_action

Spec this none thisFlags rxdOwner #29Definer #143

Referenced by

none

Source

1if (r = this:_fight())
2return {r, 0};
3elseif (r = this:_aggression())
4return {r, 0};
5elseif (r = this:_scavenge())
6this.lastaction = "s";
7return {r, 2};
8elseif (r = this:_check_for_guarded_doors())
9this.lastaction = "g";
10return {r, 3};
11elseif (r = this:_comment())
12this.lastaction = "c";
13return {r, 10};
14elseif (r = this:_wander())
15this.lastaction = "w";
16return {r, this.wander_speed};
17endif

give_keys_to

Spec this none thisFlags rxdOwner #29Definer #143

Referenced by

none

Source

1actor = args[1];
2for each in (this.contents)
3if ($ou:isa(each, $key))
4this:give_to(each, actor);
5return each;
6endif
7endfor

hear_event_pick

Spec this none thisFlags rxdOwner #29Definer #143

Referenced by

none

Source

1{start_finish, object, actor, cl} = args;
2if ((random() % 100) >= this.attack_lockpickers_chance)
3if (start_finish == 1)
4actor:tell($su:ps(this.lockpick_msg, actor, this, this.location));
5this.location:announce_all_but({actor}, $su:ps(this.olockpick_msg, actor, this, this.location));
6this:start_fighting(actor);
7endif
8endif

hear_event_knock

Spec this none thisFlags rxdOwner #361Definer #143

Referenced by

none

Source

1who = args[3];
2door = args[4][1];
3if (this.answer_doors)
4answer = 0;
5for x in (this.guarded_doors)
6if (x[1] == door)
7answer = 1;
8endif
9endfor
10if (answer)
11if (this:answer_door_for(who))
12this:queue_action(door, {"open"});
13this.last_answer_time = time();
14endif
15endif
16endif

answer_door_for

Spec this none thisFlags rxdOwner #361Definer #143

Referenced by

Source

1who = args[1];
2return 1;

_wander

Spec this none thisFlags rxdOwner #361Definer #143

Referenced by

Source

1door = this.guarded_doors[1][1];
2if (this.location != door.location)
3return {this.move_action, {this.location:next_hop_to(door.location)}, 1, ""};
4this:jumpstart();
5else
6return pass(args);
7endif

_brainscan

Spec this none thisFlags rxdOwner #361Definer #143

Referenced by

none

Source

1pass(who = args[1]);
2if (d = this.guarded_doors)
3nd = {};
4for x in (d)
5if (x[1].location == this.location)
6nd = {@nd, x[1]};
7endif
8endfor
9if (nd)
10this:_whisper(who, "I can't let anyone get through ", $su:english_list($lu:map_verb(nd, "dname")), ".");
11endif
12endif