generic trap #267

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

Aliases: generic trap, gtrap

17 verbs · 62 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
hatesthis none thisrxd#2675
is_activethis none thisrxd#26716
do_springthis none thisrxd#26717
do_strikethis none thisrxd#2679
do_touchthis none thisrxd#2679
do_noticethis none thisrxd#2679
strike_personthis none thisrxd#2670
installthis none nonerxd#26722
look_place_msgthis none thisrxd#2674
hear_event_arrivethis none thisrxd#2672
auto_connectthis none thisrxd#26725
system_triggerthis none thisrxd#2679
visible_targetsthis none thisrxd#2677
uninstallthis none nonerxd#26712
disarmthis none nonerxd#26712
do_disarmthis none thisrxd#2676
auto_disconnectthis none thisrxd#2679

Properties

PropertyDefinerFlagsOwnerValue
evade_skill#267rc#361#139
avoid_skill#267rc#361#4540
avoid_difficulty#267rc#361-6
evade_difficulty#267rc#361-8
notice_skill#267rc#361#121
notice_difficulty#267rc#361-4
notice_msg#267rc#361"You notice %it installed here!"
avoid_msg#267rc#361"You carefully step around the trap."
avoid_fail_msg#267rc#361"You try to carefully step around the trap..."
spring_msg#267rc#361"%DT activates itself at %dn!"
evade_msg#267rc#361"%DN leaps away from %dt in the nick of time."
strike_msg#267rc#361"%DT douses %dn in horrific death of some kind."
install_msg#267rc#361"%DN pulls out a screwdriver and installs %it here."
recycle_on_spring#267rc#3610
rearm_time#267rc#36190
armed#267r#3610
strike_all#267rc#3610
last_spring_time#267r#3610
system#267rc#361#-1
disarm_start_msg#267rc#361"%DN pokes and fiddles at %dt, doing something vaguely technical."
disarm_msg#267rc#361"Something clicks softly inside %dt."
disarm_skill#267rc#361#332
disarm_difficulty#267rc#361-5
break_msg#255rc#361<clear>
repair_difficulty#255rc#361<clear>
junk_on_break#255rc#361<clear>
rename_on_break#255rc#361<clear>
smashable#255rc#361<clear>
repairable#255rc#361<clear>
armor#255rc#361<clear>
held_break_msg#255rc#361<clear>
oheld_break_msg#255rc#361<clear>
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361"%IT is installed here."
value#5rc#36110000
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#361<clear>
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic trap", "gtrap"}
description#1rc#361"A compact but complicated contraption of wires, levers and sensors."
object_size#1r#29{11210, 1298434514}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rwc#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): #255 generic smashable thing#5 generic thing#1 root

Children: none

Call graph

calls n267_2 #267:do_spring n20_34 #20:pronoun_sub n267_2->n20_34 n20_81 #20:msg n267_2->n20_81 n267_3 #267:do_strike n267_2->n267_3 n1_31 #1:dname n267_2->n1_31 n1_46 #1:room n267_2->n1_46 n103_2 #103:junk n267_2->n103_2 n267_3->n20_34 n267_3->n20_81 n267_6 #267:strike_person n267_3->n267_6 n267_4 #267:do_touch n267_4->n267_2 n267_1 #267:is_active n267_4->n267_1 n267_0 #267:hates n267_4->n267_0 n267_5 #267:do_notice n267_4->n267_5 n267_5->n267_2 n267_5->n20_34 n267_5->n20_81 n267_7 #267:install n267_7->n20_34 n267_7->n20_81 n107_43 #107:tell n267_7->n107_43 n267_10 #267:auto_connect n267_7->n267_10 n1_66 #1:announce_action_text n267_7->n1_66 n1_13 #1:moveto n267_7->n1_13 n267_10->n107_43 n1_33 #1:area n267_10->n1_33 n1_39 #1:dnamec n267_10->n1_39 n267_8 #267:look_place_msg n267_8->n20_34 n267_9 #267:hear_event_arrive n267_9->n267_4 n267_11 #267:system_trigger n267_11->n267_2 n267_12 #267:visible_targets n267_11->n267_12 n267_12->n267_0 n267_13 #267:uninstall n267_13->n1_31 n267_13->n107_43 n267_13->n1_66 n267_13->n1_13 n267_13->n1_39 n6_169 #6:dnamec n267_13->n6_169 n267_16 #267:auto_disconnect n267_13->n267_16 n267_16->n107_43 n267_16->n1_39 n267_14 #267:disarm n267_14->n267_1 n267_14->n267_0 n267_14->n107_43 n267_14->n1_39 n92_2 #92:queue_action n267_14->n92_2 n267_15 #267:do_disarm n267_15->n20_34

Source

hates

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1who = args[1];
2if (valid(this.system))
3return this.system:hates(who);
4endif
5return is_player(who);

is_active

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1if (this.weight > 0)
2return 0;
3endif
4if (is_a(this.system, #291057) && (!this.system.on))
5return 0;
6endif
7if (is_a(this.system, #291057) && (!this.system.active))
8return 0;
9endif
10if (!this.armed)
11if ((time() - this.last_spring_time) > this.rearm_time)
12return this.armed = 1;
13endif
14else
15return 1;
16endif

do_spring

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1who = args[1];
2this.location:announce_all($su:ps($su:msg(this.spring_msg), who, this));
3check = this.evade_skill:check(who, this.evade_difficulty);
4this.armed = 0;
5this.last_spring_time = time();
6if (check > 0)
7who:aat($su:ps($su:msg(this.evade_msg), who, this));
8else
9this:do_strike(who);
10endif
11if (valid(this.system))
12this.system.biz.channel:announce(area(this), ((this:dname() + "@") + this:room():dname()) + ": **SPRUNG**");
13endif
14if (this.recycle_on_spring)
15this.junk_ok = 1;
16$rpg:junk(this);
17endif

do_strike

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1who = args[1];
2this.location:announce_all($su:ps($su:msg(this.strike_msg), who, this));
3if (this.strike_all)
4for x in (this.location:occupants($living))
5this:strike_person(x);
6endfor
7else
8this:strike_person(who);
9endif

do_touch

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1who = args[1];
2if (this:is_active() && this:hates(who))
3check = this.notice_skill:check(who, this.notice_difficulty, 1);
4if (check > 0)
5this:do_notice(who);
6else
7this:do_spring(who);
8endif
9endif

do_notice

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1who = args[1];
2who:tell($su:ps($su:msg(this.notice_msg), who, this));
3check = this.avoid_skill:check(who, this.avoid_difficulty);
4if (check > 0)
5who:tell($su:ps($su:msg(this.avoid_msg), who, this));
6else
7who:tell($su:ps($su:msg(this.avoid_fail_msg), who, this));
8this:do_spring(who);
9endif

strike_person

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

No program (verb defined but unprogrammed).

install

Spec this none noneFlags rxdOwner #361Definer #267

Referenced by

none

Source

1if (this.weight < 0)
2player:tell("It's already installed.");
3return;
4endif
5for x in (player.location:occupants($trap))
6if (x.weight < 0)
7player:tell("There's already a trap installed here.");
8return;
9endif
10endfor
11if (!player.location:controlled_by(player))
12player:tell("You can't install a trap here.");
13return;
14endif
15if (this:auto_connect())
16player:aat($su:ps($su:msg(this.install_msg), player, this));
17this:moveto(player.location);
18this.weight = -1;
19this.armed = 1;
20else
21player:tell("There's no security system here to monitor the trap.");
22endif

look_place_msg

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

none

Source

1if (this.weight < 0)
2return $su:ps(this.(verb), this, this);
3endif
4return "";

hear_event_arrive

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

none

Source

1who = args[3];
2this:do_touch(who);

auto_connect

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1found = #-1;
2for room in (this:area().contents)
3if (con = room:occupants(#291057))
4found = con[1];
5break;
6elseif (con = room:occupants(#9348))
7if (valid(con[1].system))
8found = con[1].system;
9break;
10endif
11endif
12endfor
13if (valid(found))
14if (((!is_a(found, #281081)) || (!valid(biz = found.biz))) || (!(area(this) in biz.controlled_areas)))
15this.location:announce_all(this:dnamec(), " INVALID LOCATION. NOT CONNECTING.");
16return;
17endif
18this.location:announce_all(this:dnamec(), " beeps: FOUND SYSTEM ", found.name, ".  CONNECTING.");
19this.system = found;
20`found:connect(this) ! ANY';
21return 1;
22else
23return 0;
24player:tell("No system found!");
25endif

system_trigger

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

none

Source

1if (targ = this:visible_targets())
2targ = targ[random($)];
3elseif (targ = this.location:occupants($living))
4targ = targ[random($)];
5else
6return E_NONE;
7endif
8this:do_spring(targ);
9return 1;

visible_targets

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1t = {};
2for x in (this.location:occupants($living))
3if (this:hates(x))
4t = {@t, x};
5endif
6endfor
7return t;

uninstall

Spec this none noneFlags rxdOwner #361Definer #267

Referenced by

none

Source

1if (this.weight > 0)
2player:tell(this:dnamec(), " isn't installed.");
3return;
4endif
5if (!this.location:controlled_by(player))
6player:tell("You can't figure out how to uninstall ", this:dname(), " from here.");
7return;
8endif
9player:aat(player:dnamec(), " whips out a screwdriver and uninstalls ", this:dname(), ".");
10clear_property(this, "weight");
11this:auto_disconnect();
12this:moveto(player);

disarm

Spec this none noneFlags rxdOwner #361Definer #267

Referenced by

none

Source

1if (this.weight > 0)
2player:tell(this:dnamec(), " isn't even installed.");
3return;
4elseif (!this:is_active())
5player:tell(this:dnamec(), " doesn't appear to be armed.");
6return;
7elseif (!this:hates(player))
8player:tell("You can't disarm your own traps!");
9return;
10else
11player:queue_action($actions.disarm, {this}, 1, "disarm " + this.name);
12endif

do_disarm

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

none

Source

1who = args ? args[1] | #-1;
2this.armed = 0;
3this.last_spring_time = time();
4if (this.disarm_msg)
5this.location:announce_all($su:ps(this.disarm_msg, who, this));
6endif

auto_disconnect

Spec this none thisFlags rxdOwner #361Definer #267

Referenced by

Source

1if (valid(this.system))
2this.location:announce_all(this:dnamec(), " beeps: DISCONNECTING FROM SYSTEM ", this.system.name, ".");
3this.system:disconnect(this);
4clear_property(this, "system");
5return 1;
6else
7return 0;
8player:tell("No system found!");
9endif