generic trap #267
Aliases: generic trap, gtrap
17 verbs · 62 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
hates | this none this | rxd | #267 | 5 |
is_active | this none this | rxd | #267 | 16 |
do_spring | this none this | rxd | #267 | 17 |
do_strike | this none this | rxd | #267 | 9 |
do_touch | this none this | rxd | #267 | 9 |
do_notice | this none this | rxd | #267 | 9 |
strike_person | this none this | rxd | #267 | 0 |
install | this none none | rxd | #267 | 22 |
look_place_msg | this none this | rxd | #267 | 4 |
hear_event_arrive | this none this | rxd | #267 | 2 |
auto_connect | this none this | rxd | #267 | 25 |
system_trigger | this none this | rxd | #267 | 9 |
visible_targets | this none this | rxd | #267 | 7 |
uninstall | this none none | rxd | #267 | 12 |
disarm | this none none | rxd | #267 | 12 |
do_disarm | this none this | rxd | #267 | 6 |
auto_disconnect | this none this | rxd | #267 | 9 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
evade_skill | #267 | rc | #361 | #139 |
avoid_skill | #267 | rc | #361 | #4540 |
avoid_difficulty | #267 | rc | #361 | -6 |
evade_difficulty | #267 | rc | #361 | -8 |
notice_skill | #267 | rc | #361 | #121 |
notice_difficulty | #267 | rc | #361 | -4 |
notice_msg | #267 | rc | #361 | "You notice %it installed here!" |
avoid_msg | #267 | rc | #361 | "You carefully step around the trap." |
avoid_fail_msg | #267 | rc | #361 | "You try to carefully step around the trap..." |
spring_msg | #267 | rc | #361 | "%DT activates itself at %dn!" |
evade_msg | #267 | rc | #361 | "%DN leaps away from %dt in the nick of time." |
strike_msg | #267 | rc | #361 | "%DT douses %dn in horrific death of some kind." |
install_msg | #267 | rc | #361 | "%DN pulls out a screwdriver and installs %it here." |
recycle_on_spring | #267 | rc | #361 | 0 |
rearm_time | #267 | rc | #361 | 90 |
armed | #267 | r | #361 | 0 |
strike_all | #267 | rc | #361 | 0 |
last_spring_time | #267 | r | #361 | 0 |
system | #267 | rc | #361 | #-1 |
disarm_start_msg | #267 | rc | #361 | "%DN pokes and fiddles at %dt, doing something vaguely technical." |
disarm_msg | #267 | rc | #361 | "Something clicks softly inside %dt." |
disarm_skill | #267 | rc | #361 | #332 |
disarm_difficulty | #267 | rc | #361 | -5 |
break_msg | #255 | rc | #361 | <clear> |
repair_difficulty | #255 | rc | #361 | <clear> |
junk_on_break | #255 | rc | #361 | <clear> |
rename_on_break | #255 | rc | #361 | <clear> |
smashable | #255 | rc | #361 | <clear> |
repairable | #255 | rc | #361 | <clear> |
armor | #255 | rc | #361 | <clear> |
held_break_msg | #255 | rc | #361 | <clear> |
oheld_break_msg | #255 | rc | #361 | <clear> |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | "%IT is installed here." |
value | #5 | rc | #361 | 10000 |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic trap", "gtrap"} |
description | #1 | rc | #361 | "A compact but complicated contraption of wires, levers and sensors." |
object_size | #1 | r | #29 | {11210, 1298434514} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rwc | #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): #255 generic smashable thing → #5 generic thing → #1 root
Children: none
Call graph
Source
hates
Referenced by
- #267:do_touch line 2:
this:hates - #267:visible_targets line 3:
this:hates - #267:disarm line 7:
this:hates
Source
1who = args[1]; 2if (valid(this.system)) 3return this.system:hates(who); 4endif 5return is_player(who);
is_active
Referenced by
- #267:do_touch line 2:
this:is_active - #267:disarm line 4:
this:is_active
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
Referenced by
- #267:do_touch line 7:
this:do_spring - #267:do_notice line 8:
this:do_spring - #267:system_trigger line 8:
this:do_spring
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
Referenced by
- #267:do_spring line 9:
this:do_strike
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
Referenced by
- #267:hear_event_arrive line 2:
this:do_touch
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
Referenced by
- #267:do_touch line 5:
this:do_notice
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
Referenced by
- #267:do_strike line 5:
this:strike_person - #267:do_strike line 8:
this:strike_person
Source
No program (verb defined but unprogrammed).
install
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
Referenced by
none
Source
1if (this.weight < 0) 2return $su:ps(this.(verb), this, this); 3endif 4return "";
hear_event_arrive
Referenced by
none
Source
1who = args[3]; 2this:do_touch(who);
auto_connect
Referenced by
- #267:install line 15:
this:auto_connect
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
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
Referenced by
- #267:system_trigger line 1:
this:visible_targets
Source
1t = {}; 2for x in (this.location:occupants($living)) 3if (this:hates(x)) 4t = {@t, x}; 5endif 6endfor 7return t;
uninstall
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
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
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
Referenced by
- #267:uninstall line 11:
this:auto_disconnect
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