Department of Environmental Protection #10161

Parent #258Owner Flags Source rpg_march_2006/vacuum.txt

Aliases: Department of Environmental Protection, vacuum

21 verbs · 50 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
killablethis none this#1016128
cyclethis none this#1016122
cull_playersnone none nonerxd#1016137
cull_weaponsnone none nonerx#1016132
is_named_weaponthis none this#101614
reapthis none this#10161111
clean_upthis none this#1016169
in_usethis none this#1016130
uniquethis none this#1016110
doll_reapablethis none this#1016142
reap_dollthis none this#1016130
descriptionthis none this#1016114
tell_contentsthis none this#101616
clean_susathis none this#1016129
update_monstersthis none this#101617
back_in_playthis none this#1016111
disposenone none nonerxd#1016119
thresholdthis none this#101613
cycle(old)this none this#1016120
call_reapthis none this#101618
orphansthis none this#101612

Properties

PropertyDefinerFlagsOwnerValue
hah#10161rc{#155, #4038}
armour#10161rc{#457, #1247, #2138, #20864, #20865}
thrown#10161rc{#10902, #3089, #8833, #8909}
missiles#10161rc{#8833, #8909}
weapons#10161rc{#76, #159, #243, #1394, #1454, #1660, #2231, #3791, #8751, #283, #20769, #20868}
monsters#10161rc
value (3372 chars){#1381, #3730, #3777, #4002, #4048, #1214, #8077, #17777, #19044, #4418, #13573, #4981, #10249, #16104, #21598, #15458, #7057, #5632, #26608, #35896, #52165, #40259, #2955, #42381, #53178, #53798, #45991, #31020, #45622, #40379, #40890, #51765, #51082, #44015, #55272, #6527, #8953, #50841, #36198, #20474, #48474, #22224, #7686, #39500, #16410, #53941, #53978, #22055, #51809, #57159, #56543, #61004, #9096, #102, #62858, #56299, #33020, #73468, #73054, #71798, #73373, #72883, #32401, #79574, #79214, #4142, #8954, #8952, #85990, #4677, #29929, #4375, #4186, #74798, #77819, #83797, #33931, #1383, #93374, #67730, #7151, #94799, #41501, #26450, #21252, #97587, #95558, #90796, #61620, #63670, #66635, #365, #819, #820, #1453, #2805, #2992, #3048, #3094, #3098, #3764, #3032, #3760, #3956, #4049, #4050, #7965, #10441, #11966, #2230, #15844, #15907, #15908, #15990, #12689, #86696, #103632, #73404, #58625, #87886, #88892, #83242, #8891, #1112, #20800, #1092, #69439, #66341, #104015, #98531, #1285, #1298, #1355, #1338, #1348, #1091, #1011, #76667, #87453, #1798, #1251, #9799, #9365, #7744, #75947, #52869, #4713, #1742, #6113, #5003, #4688, #12763, #1178, #1179, #79322, #1987, #2705, #2605, #41330, #15884, #63530, #52868, #61023, #1233, #1354, #71462, #15974, #40223, #6310, #5606, #5925, #79797, #5496, #12619, #92075, #34301, #7137, #7582, #2775, #3530, #5532, #6333, #6334, #10134, #54413, #2615, #5245, #48732, #43198, #110176, #2110, #2125, #2167, #2130, #2100, #2106, #2120, #2134, #2161, #2123, #2168, #3366, #85968, #15130, #13694, #13685, #13695, #13693, #11494, #26388, #222, #7666, #8887, #3007, #3511, #72141, #1654, #1877, #1864, #1875, #16595, #1978, #1974, #1966, #1902, #11500, #111994, #1263, #1264, #2009, #4777, #12098, #72796, #80113, #111613, #72018, #53628, #31745, #52484, #52304, #78224, #94515, #102680, #76481, #106254, #6330, #1157, #5141, #114923, #61225, #27745, #96256, #80660, #87390, #2081, #7416, #89468, #96286, #13692, #2248, #4785, #8365, #5488, #3592, #94167, #26263, #70900, #4946, #63454, #1698, #2089, #8651, #72739, #50011, #8942, #1377, #14523, #13545, #60384, #5236, #4849, #7794, #112666, #1975, #7366, #4122, #5619, #5690, #5916, #4448, #1599, #1633, #1677, #1844, #9477, #1753, #3646, #90644, #14297, #51060, #108282, #116088, #40495, #18039, #74774, #5067, #113666, #5485, #13761, #95522, #111919, #105896, #97427, #31400, #2275, #75602, #47746, #101666, #107666, #66752, #85317, #58057, #4104, #90719, #1952, #3176, #7990, #8721, #3083, #2025, #3156, #7064, #78972, #7661, #7993, #4696, #116667, #59892, #9595, #116602, #95336, #114031, #3614, #84448, #85888, #86888, #89888, #88444, #65556, #4293, #2011, #28361, #108264, #61905, #2461, #106729, #103138, #23080, #55525, #47845, #88315, #8920, #77919, #52904, #79012, #97164, #21175, #74293, #92603, #40122, #62049, #76525, #4746, #1635, #1694, #3455, #11968, #51097, #116671, #6941, #60404, #70505, #1201, #78878, #88288, #51946, #10469, #65245, #88223, #62009, #8718, #6713, #3659, #10573, #10826, #7430, #93545, #10911, #6876, #7890, #66601, #55035, #37403, #119167, #8262, #5145, #115078, #7537, #9020, #1725, #9456, #9590, #4385, #2188, #97553, #60277, #43789, #2109, #3606, #9330, #67090, #69605, #3439, #62126, #102692, #26264, #63686, #62395, #82643, #107799, #62803, #112302, #115533, #115544, #115577, #115599, #45301, #8229, #4370, #60066, #109758, #85246}
threshold#10161rc7776000
targets#10161rc{}
objects#10161rc
value (1291 chars){#52828, #52833, #51553, #46232, #22361, #37163, #35734, #39717, #40354, #32208, #47882, #42808, #38110, #33838, #39280, #34604, #29924, #25313, #20788, #54004, #31156, #36484, #55345, #21094, #26848, #55546, #41748, #55486, #29881, #55839, #55804, #55825, #55926, #55942, #56127, #56166, #51624, #42092, #48046, #13133, #1389, #1397, #307, #168, #2078, #2244, #4039, #8844, #9358, #12446, #11485, #50619, #39313, #38059, #51768, #48233, #53888, #49779, #45021, #20132, #52737, #45259, #41567, #5618, #28806, #55360, #55451, #55550, #55495, #38567, #55501, #55580, #52435, #40975, #55544, #55588, #54282, #48800, #54076, #39223, #55596, #48172, #21714, #36854, #55239, #55484, #55760, #55759, #29200, #55821, #55849, #55774, #53115, #55883, #55956, #55799, #53713, #55952, #55992, #56018, #42813, #52974, #51364, #40070, #42977, #9730, #55909, #26275, #21129, #39253, #51985, #43852, #28513, #56188, #33329, #56233, #56218, #56236, #56220, #56219, #35025, #36299, #55373, #37351, #34364, #54710, #28400, #52147, #39441, #55618, #37240, #33968, #30138, #31573, #40021, #31016, #24200, #28401, #33417, #23388, #43121, #55431, #15753, #52073, #24353, #37750, #35439, #50219, #53366, #41759, #11352, #30680, #25842, #42246, #35867, #41701, #36160, #46030, #55561, #17530, #48946, #54045, #52267}
cycle#10161rc9000
protected#10161rc{}
doomed#10161r{#108604, #114536, #9066, #62224, #109758, #10611, #70749, #91457, #86723, #101508}
cemetery#10161rc#1131
cycle_task#10161r1653831457
reap_in_progress#10161r0
rotten#10161r{#70597}
sweep_log#10161rc
value (3536 chars){{1141624947, 1141624947, 4225, 9, 16, {{"morphic armour (#100597)", 0, {}}, {"Scroll of Adamantite (#114488)", 0, {#1131}}, {"red ribbons (#11036)", 5, {#65545}}, {"red ribbons (#28281)", 5, {#53781}}, {"red ribbons (#115960)", 5, {#24164}}, {"red ribbons (#117665)", 5, {#1048}}, {"red ribbons (#101461)", 5, {#17239, #8928, #22047}}, {"red ribbons (#70093)", 5, {#46025}}, {"red ribbons (#61208)", 5, {#24102, #8928, #22047}}}, 2, 1, {{"recycled", #114571, "Cairo's Voodoo Doll", #117278}, {"doomed", #114571, "Cairo's Voodoo Doll", #117278}, {"doomed", #7262, "Uriel's Voodoo Doll", #121946}}, 582}, {1141513767, 1141513768, 4215, 7, 22, {{"steel miner's pick (#69391)", 5, {#77440, #66133, #85872}}, {"grey cowled robe (#104492)", 5, {#100806, #96119}}, {"sandals (#111534)", 5, {#100806, #96119}}, {"red ribbons (#18586)", 5, {#38226}}, {"red ribbons (#90121)", 5, {#12757}}, {"red ribbons (#69087)", 5, {#49586}}, {"red ribbons (#74619)", 5, {#116688}}}, 1, 2, {{"recycled", #114571, "Cairo's Voodoo Doll", #117278}, {"recycled", #85486, "Gideon's Voodoo Doll", #109600}, {"doomed", #114571, "Cairo's Voodoo Doll", #117278}}, 582}, {1141394746, 1141394748, 4194, 12, 12, {{"giant club (#10711)", 0, {}}, {"collar (#7415)", 5, {#972, #8399}}, {"gauntlets (#116262)", 0, {#1131}}, {"o-yoroi (#94668)", 0, {}}, {"mint green potion (#43095)", 0, {}}, {"red ribbons (#17748)", 5, {#1048}}, {"red ribbons (#1782)", 5, {#2743, #854, #45765}}, {"red ribbons (#67353)", 5, {#9459}}, {"red ribbons (#117326)", 5, {#46025}}, {"red ribbons (#17976)", 5, {#24102, #8928, #22047}}, {"red ribbons (#77662)", 5, {#24164}}, {"red ribbons (#17574)", 5, {#46670}}}, 2, 2, {{"recycled", #114571, "Cairo's Voodoo Doll", #117278}, {"recycled", #102534, "Darkson's Voodoo Doll", #100806}, {"doomed", #114571, "Cairo's Voodoo Doll", #117278}, {"doomed", #85486, "Gideon's Voodoo Doll", #109600}}, 582}, {1141281477, 1141281478, 4218, 15, 391, {{"vambraces (#53458)", 0, {#1131}}, {"broadsword (#94873)", 0, {}}, {"giant club (#116621)", 0, {}}, {"vial of essence of water weird (#31421)", 5, {#101247}}, {"vial of essence of water weird (#12936)", 5, {#101247}}, {"vial of essence of water weird (#1730)", 5, {#101247}}, {"o-yoroi (#31014)", 0, {}}, {"grey cowled robe (#105134)", 5, {#24319}}, {"red ribbons (#46144)", 5, {#12757}}, {"red ribbons (#76794)", 5, {#49586}}, {"red ribbons (#91013)", 5, {#38226}}, {"red ribbons (#68151)", 5, {#53781}}, {"red ribbons (#107889)", 5, {#17239, #8928, #22047}}, {"red ribbons (#106196)", 5, {#11675}}, {"red ribbons (#84715)", 5, {#116688}}}, 2, 2, {{"recycled", #114571, "Cairo's Voodoo Doll", #117278}, {"recycled", #56356, "Rama's Voodoo Doll", #120283}, {"doomed", #114571, "Cairo's Voodoo Doll", #117278}, {"doomed", #102534, "Darkson's Voodoo Doll", #100806}}, 583}, {1141180108, 1141180109, 4220, 11, 18, {{"scythe (#119490)", 5, {}}, {"morphic armour (#87123)", 0, {}}, {"collar (#59973)", 5, {#972, #8399}}, {"steel miner's pick (#70520)", 5, {#77440, #66133, #85872}}, {"red ribbons (#111314)", 5, {#24164}}, {"red ribbons (#59815)", 5, {#1048}}, {"red ribbons (#52423)", 5, {#2743, #854, #45765}}, {"red ribbons (#53455)", 5, {#33644}}, {"red ribbons (#116181)", 5, {#46670}}, {"red ribbons (#82528)", 5, {#46025}}, {"red ribbons (#120790)", 5, {#24102, #8928, #22047}}}, 2, 2, {{"recycled", #114571, "Cairo's Voodoo Doll", #117278}, {"recycled", #107011, "Snowy's Voodoo Doll", #87867}, {"doomed", #114571, "Cairo's Voodoo Doll", #117278}, {"doomed", #56356, "Rama's Voodoo Doll", #120283}}, 584}}
dumps#10161r{}
dumpers#10161r{}
warehouses#10161r{#175, #1138, #93337, #44938, #11561, #40553, #63560, #45309, #77404}
doomed_dolls#10161r{#114571, #7262}
monster_stash_update_int#10161rc86400
vault#10161rc#377
orphans#10161not readable (E_PERM)
restart#10161rc#77
immortal#10161rc{{#86050, 0}, {#106488, 0}, {#93228, 0}, {#117004, 0}, {#100337, 0}, {#63635, 0}, {#110586, 0}, {#116995, 0}, {#1449, 0}, {#55619, 0}, {#88395, 0}, {#104202, 0}, {#115397, 0}}
backpack#10161rc#9350
next_reap#10161r1141724900
blessed_exit#10161{#2011, 2071541878}
misc_notes#10161not readable (E_PERM)
magic_effects#10161not readable (E_PERM)
combat_effects#10161not readable (E_PERM)
unannounced#10161not readable (E_PERM)
teleport_object#10161#2011
teleport_task#101612128548115
allowed_exits#10161not readable (E_PERM)
room_data#10161{"structure"}
dawn_msg#10161""
night_msg#10161""
dusk_msg#10161""
day_msg#10161""
delay#101617200
entrances#10161not readable (E_PERM)
blessed_task#101611406396582
exits#10161not readable (E_PERM)
ctype#101615
key#10161not readable (E_PERM)
aliases#10161{"Department of Environmental Protection", "vacuum"}
description#10161
value (226 chars){"A pleasant room painted a deep forest green. Potted plants abound, and you believe you hear monkeys chattering in the rafters. A poster on the wall shows a cat dangling from a branch with the words \"Hang on!\" below it."}
object_size#10161{45013, 1141286561}

Ancestry

Ancestors (nearest first): #258 Generic Dungeon Room#1610 RPG RDB room#364 outside room#6792 Generic Integrating Description Room#3879 Matching Room#27777 Self-Cleaning Room

Children: none

Call graph

calls n10161_0 #10161:killable n10161_8 #10161:unique n10161_0->n10161_8 n10161_7 #10161:in_use n10161_0->n10161_7 n10161_5 #10161:reap n10161_5->n10161_0 n10161_9 #10161:doll_reapable n10161_5->n10161_9 n10161_10 #10161:reap_doll n10161_5->n10161_10 n10161_13 #10161:clean_susa n10161_5->n10161_13 n10161_17 #10161:threshold n10161_9->n10161_17 n10161_6 #10161:clean_up n10161_14 #10161:update_monsters n10161_6->n10161_14 n10161_11 #10161:description n1610_6 #1610:description n10161_11->n1610_6 n10161_12 #10161:tell_contents n258_5 #258:tell_contents n10161_12->n258_5 n10161_16 #10161:dispose n10161_16->n10161_0 n10161_18 #10161:cycle(old) n10161_18->n10161_5 n10161_1 #10161:cycle n10161_18->n10161_1 n10161_19 #10161:call_reap n10161_19->n10161_5

Source

killable

Spec this none thisDefiner #10161

Referenced by

Source

1":killable(object) => True if object may be recycled.";
2{what} = args;
3if ((!valid(what)) || (parent(what) == $garbage))
4  "... let GMs recycle invalid objects";
5  return valid(what) ? what.owner == this.owner | 0;
6elseif (what.owner != this.owner)
7  return 0;
8elseif (!valid(parent(what)))
9  "... If an child of $nothing is recycled it will probably break some exitfuncs.  Just add it to the 'rotten' list for now.";
10  this.rotten = setadd(this.rotten, what);
11  return 0;
12elseif (this:unique(what))
13  "... Hey this is somethin' special.";
14  return 0;
15elseif (this:in_use(what))
16  "... Somebody's using it.";
17  return 0;
18elseif (what.location in this.warehouses)
19  "elseif ($object_utils:isa(what.location, #25476))";
20  "... In an RPG-shop storeroom. Maybe add a .warehouses property later, but this'll do for now.";
21  return 0;
22else
23  return 1;
24endif
25"DR 06-MAY-1995 -- Using in_use_test, a more correct (and hopefully bug free) version of the old, nasty in_use";
26"Profane 15-MAR-95 13:06EST - Dunno what #25476 was supposed to be, but it's nothing now. Added warehouses stuff.";
27"Slither 6/15/95 -- Got rid of the old in_use, and replaced it with what used to be in_use_test, so changed the reference here.";
28"Profane 6-JAN-97 2017PST -- added valid() check, line 5, so truly invalid objects won't bomb out with tb";

cycle

Spec this none thisDefiner #10161

Referenced by

Source

1if (((time() < this.next_reap) || $login.checkpoint_in_progress) || $code_utils:task_valid(this.cycle_task))
2  return E_NONE;
3elseif ($list_utils:iassoc("read_lines_escape", queued_tasks(), 7))
4  return E_QUOTA;
5elseif (caller_perms() == this.owner)
6  force_input(this.owner, tostr("eval ", this, ":call_reap()"));
7  "fork tid (0)";
8  "  this.reap_in_progress = {time(), task_id()};";
9  "  this:reap();";
10  "  this.reap_in_progress = 0;";
11  "  this.next_reap = (time() + 99999) - random(999);";
12  "endfork";
13  fork (5)
14    $local.rpg.clock:check_cycles();
15  endfork
16  this.cycle_task = tid;
17else
18  return E_PERM;
19endif
20"Profane (#30788) - Sat Apr 14, 2001 - New paradigm. Called by enterfunc in the academy.";
21"THX (#105941) - Sat Apr 14, 2001 - Just added a thingie to prevent this from going off during checkpoint.  Changed to .next_reap to speed up the intial check too.";
22"THX (#105941) - Tue May 22, 2001 - Changed to force_input a call_reap() instead of forking the reap process.  This way G_M will be 'player' and will stop muchos complaints.  Check for read_lines_escape in queued_tasks() before forcing input too.";

cull_players

Spec none none noneFlags rxdDefiner #10161

Referenced by

none

Source

1{?nn = 0} = args;
2rpg = $local.rpg;
3if (rpg:is_grandmaster(caller_perms()))
4  player:tell("Length: ", len = length(rpg.pcs));
5  t = time();
6  for k in [1..len]
7    n = (len + 1) - k;
8    who = rpg.pcs[n];
9    doll = rpg.dolls[n];
10    if ((!valid(doll)) || (!$object_utils:isa(doll, rpg.doll)))
11      rpg.dolls = listdelete(rpg.dolls, n);
12      rpg.pcs = listdelete(rpg.pcs, n);
13    elseif (doll.character != who)
14      player:tell("Inconsistent: ", n);
15      nn = nn - 1;
16      if (nn < 0)
17        return;
18      endif
19    elseif ((!valid(who)) || ((!is_player(who)) && (!$object_utils:has_callable_verb(who, "die"))))
20      rpg.dolls = listdelete(rpg.dolls, n);
21      rpg.pcs = listdelete(rpg.pcs, n);
22      rpg.recycler:_recycle(doll);
23    elseif (is_player(who) && ((doll.last_action + this.threshold) < t))
24      rpg.dolls = listdelete(rpg.dolls, n);
25      rpg.pcs = listdelete(rpg.pcs, n);
26      rpg.recycler:_recycle(doll);
27      player:tell("> ", who.name, " (", who, ")");
28    elseif ((doll.last_action + this.threshold) < t)
29      player:tell("* ", who.name, " (", who, ")");
30    endif
31    rpg:time_stop();
32  endfor
33endif
34player:tell("Length: ", length(rpg.pcs));
35"DR 30-NOV-94 -- Now test doll.last_action, not the player's last_connect.";
36"If the person hasn't done any RPG stuff in .threshold time, they die.";
37"Profane 13-MAY-96 515EST - change perms so only Grandmasters my cull players.";

cull_weapons

Spec none none noneFlags rxDefiner #10161

Referenced by

none

Source

1"Disarm players who are dead and who haven't connected in a long time.  Out of paranoia, make sure the weapon is owned by Grand_Master.";
2(rpg = $local.rpg):secure();
3{G_M, threshold, o_u, now, thing, backpack} = {rpg.owner, this.threshold, $object_utils, time(), rpg.thing, this.backpack};
4culls = {};
5for p in (players())
6  rpg:s_i_f_i_n();
7  if (((p.last_connect_time + threshold) < now) && (!(p in rpg.pcs)))
8    for target in (p.contents)
9      if (o_u:isa(target, thing) && (target.owner == G_M))
10        rpg:s_i_f_i_n();
11        do_cull = 1;
12        if (o_u:isa(target, backpack))
13          "descend into it if it's a backpack in case its contents aren't RPG items.  If so, don't flush the pack either.";
14          for item in (target.contents)
15            if ((item.owner != G_M) || (!o_u:isa(item, thing)))
16              do_cull = 0;
17            endif
18          endfor
19        endif
20        if (do_cull)
21          culls = {target, @culls};
22        endif
23      endif
24    endfor
25  endif
26endfor
27for item in (culls)
28  "move it somewhere random, let the regular vacuum cleaner sweep it up.";
29  player:tell("Moving ", item:title(), "(", item, ") from ", item.location.name, "(", item.location, ")");
30  item:moveto($nothing);
31  rpg:s_i_f_i_n();
32endfor

is_named_weapon

Spec this none thisDefiner #10161

Referenced by

none

Source

1"return 1 if this object is a 'named' weapon, 0 if it is not.";
2"Called by cull_weapons.";
3target = args[1];
4return ($object_utils:has_property(target, "title") ? target.title | 0) || ($object_utils:has_property(target, "crest") ? target.crest | 0);

reap

Spec this none thisDefiner #10161

Referenced by

Source

1":reap() -- Recycle all those damned weapons lying around.";
2if (caller_perms() != this.owner)
3  return E_PERM;
4endif
5start_time = time();
6this.owner:tell(tostr(this, "> ", task_id(), " Beginning RPG Sweep ..."));
7"Run the following scatter to prep a few variables that run inside the for loop.  This'll save a surprising number of ticks. - THX";
8{rpg, o_u, c_u, s_u, rpg_doll, nothing} = {$local.rpg, $object_utils, $command_utils, $string_utils, $local.rpg.doll, $nothing};
9scythe = rpg.recycler;
10cemetery = this.cemetery;
11owner = this.owner;
12recycled = 0;
13msg = {};
14if (random(12) == 1)
15  leaves = o_u:leaves_suspended(rpg.thing);
16  leaves = {@leaves, @children(rpg.stat_sheet)};
17  for t in (this.doomed)
18    if (valid(t) && (t.owner == owner))
19      "... do nothing ... ";
20      rpg:s_i_n(1);
21    else
22      this.doomed = setremove(this.doomed, t);
23    endif
24  endfor
25else
26  leaves = {};
27  for t in (rpg.dispenser.dispenses)
28    leaves = {@leaves, @children(t)};
29    rpg:s_i_n(1);
30  endfor
31endif
32doomed = this.doomed;
33for thing in (leaves)
34  "...loop through all kids of adventure gear.";
35  "...if killable and already doomed, recycle.";
36  "...else, add to the doomed list.";
37  rpg:s_i_f_i_n();
38  if (this:killable(thing))
39    if ((thing in doomed) || (thing.location in {nothing, cemetery}))
40      locs = {};
41      where = thing;
42      while (valid(where = where.location))
43        locs = {@locs, where};
44      endwhile
45      msg = {@msg, {s_u:nn(thing), thing in doomed, locs}};
46      "Dump out the contents. Can't do this inna :recycle verb, since the";
47      "thing is moved to $nowhere BEFORE :recycle is called.";
48      for junk in (thing.contents)
49        `junk:moveto(thing.location) ! ANY';
50        rpg:s_i_f_i_n();
51      endfor
52      if (thing.owner == owner)
53        `scythe:_recycle(thing) ! ANY';
54      endif
55      recycled = recycled + 1;
56      doomed = setremove(doomed, thing);
57      leaves = setremove(leaves, thing);
58    else
59      doomed = setadd(doomed, thing);
60    endif
61  else
62    doomed = setremove(doomed, thing);
63    if (`thing.last_action ! E_PROPNF => 0' && (thing.last_action < time()))
64      (valid(loc = thing.location) && (loc.owner in rpg.gms)) && (thing.last_action = 0);
65      thing.last_action && `((typeof(cond = thing.condition) == NUM) && ((thing.condition = cond - random(3)) < 1)) && thing:("break")() ! ANY';
66    endif
67  endif
68endfor
69this.doomed = doomed;
70"this.rpg_things = leaves";
71"Now, destroy all the doomed dolls that are still there";
72doomed_dolls = this.doomed_dolls;
73"Reset the doomed dolls list, to avoid race conditions";
74this.doomed_dolls = {};
75dollmsg = {};
76dollsrecycled = 0;
77for doll in (doomed_dolls)
78  rpg:s_i_f_i_n();
79  "make sure that the thing is still a doll, and still not on the dolls list";
80  if (($recycler:valid(doll) && o_u:isa(doll, rpg_doll)) && (!(doll in rpg.dolls)))
81    dollmsg = {@dollmsg, {"recycled", doll, doll.name, doll.character}};
82    scythe:_recycle(doll);
83    dollsrecycled = dollsrecycled + 1;
84  endif
85endfor
86"Go through dolls list, seeing which ones can be doomed";
87for doll in (o_u:descendants_suspended(rpg_doll))
88  rpg:s_i_f_i_n();
89  if (this:doll_reapable(doll))
90    dollmsg = {@dollmsg, {"doomed", doll, doll.name, doll.character}};
91    this:reap_doll(doll);
92  endif
93endfor
94rpg:s_i_n();
95this:clean_susa();
96rpg:s_i_n();
97info = {start_time, time(), length(leaves), recycled, length(doomed), msg, length(this.doomed_dolls), dollsrecycled, dollmsg, length(rpg.dolls)};
98this.sweep_log = log = {info, @this.sweep_log};
99this.sweep_log = log[1..min(5, length(log))];
100this.owner:tell(tostr(this, "> ", task_id(), " Finished RPG Sweep.  Elapsed time: ", $time_utils:english_time(time() - start_time)));
101"Profane 14-APR-95 20:45EST - Added contents dumping.";
102"   (People were having their unclaimed packs reaped, thus dumping their nice";
103"    claimed stuff in $nowhere, where it got rapidly auto-unclaimed and reaped.)";
104"Slither July 5, 1995 -- removed check of .protected";
105"                     -- added storage of .rpg_things";
106"                     -- added destruction of doomed dolls, and doll reaping.";
107"Irin Fri Nov  8 17:53:38 1996 PST -- Minor change to reap saved dolls.  We'll keep em for 3 months...";
108"Irin Sat Mar 22 09:24:11 1997 PST -- Lets reap all dolls now.";
109"THX 3-Dec-1997  -- Added code to clean Susa's stuff from doll-less players and $nowhere.  Added code to clean out this.doomed occasionally too ... doomed stuff sometimes gets smoked and rebuilt and is thus never doublechecked.";
110"Profane (#30788) - Tue Dec 30, 1997 - add stat sheet sweeping to full reap check";
111"THX1138 (#105941) - Tue Jun 16, 1998 - Added idle equipment (.last_action) code to break stuff that never gets used.";

clean_up

Spec this none thisDefiner #10161

Referenced by

none

Source

1":clean_up() => remove invalid stuff from various lists.";
2if (!(caller_perms() in (rpg = $local.rpg).grand_masters))
3  return E_PERM;
4endif
5len = length(rpg.gms);
6for dude in (rpg.gms)
7  if ((!$recycler:valid(dude)) || (!is_player(dude)))
8    rpg.gms = setremove(rpg.gms, dude);
9  endif
10  $command_utils:suspend_if_needed(5, "Checking validity of all GMs. . .");
11endfor
12player:tell("Eliminated ", tostr(len - length(rpg.GMs)), " bad GMs.");
13player:tell("Number of dolls before: ", tostr(len = length(rpg.dolls)));
14for k in [1..len]
15  n = (len + 1) - k;
16  doll = rpg.dolls[n];
17  if (((!$object_utils:isa(doll, rpg.doll)) || (!$recycler:valid(dude = doll.character))) || ((!is_player(dude)) && (!rpg:trusted_verb(dude, "die"))))
18    rpg.dolls = listdelete(rpg.dolls, n);
19    rpg.pcs = listdelete(rpg.pcs, n);
20  endif
21  $command_utils:suspend_if_needed(5, ("Checked " + tostr(k)) + " dolls. . .");
22endfor
23player:tell("Number of dolls after: ", tostr(length(rpg.dolls)));
24this:update_monsters();
25player:tell("Reset #10161.monsters");
26rpg.spell_skill_object:update();
27player:tell("Updated the subspells of the Forms and Techniques.");
28len = length(this.protected);
29for thing in (this.protected)
30  if (!$object_utils:isa(thing, rpg.thing))
31    this.protected = setremove(this.protected, thing);
32  endif
33  $command_utils:suspend_if_needed(5, "Checking validity of ~vacuum.protected objects. . .");
34endfor
35player:tell("Eliminated ", tostr(len - length(this.protected)), " bad .protected objects.");
36len = length(this.doomed);
37for thing in (this.doomed)
38  if (!$object_utils:isa(thing, rpg.thing))
39    this.doomed = setremove(this.doomed, thing);
40  endif
41  $command_utils:suspend_if_needed(5, "Checking validity of ~vacuum.doomed objects. . .");
42endfor
43player:tell("Eliminated ", tostr(len - length(this.doomed)), " bad .doomed objects.");
44player:tell("Number of dumpers before: ", tostr(len = length(this.dumpers)));
45for k in [1..len]
46  n = (len + 1) - k;
47  if (((!$recycler:valid(dude = this.dumpers[n])) || (!is_player(dude))) || (!$recycler:valid(this.dumps[n])))
48    this.dumps = listdelete(this.dumps, n);
49    this.dumpers = listdelete(this.dumpers, n);
50  endif
51  $command_utils:suspend_if_needed(5, ("Checked " + tostr(k)) + " dumpers. . .");
52endfor
53player:tell("Number of dumpers after: ", tostr(length(this.dumpers)));
54for item in (k = rpg.recycler.rotten)
55  if (!(item in rpg.owner.owned_objects))
56    rpg.recycler.rotten = setremove(rpg.recycler.rotten, item);
57  endif
58endfor
59player:tell("Removed ", tostr(length(k) - length(rpg.recycler.rotten)), " no-longer `rotten' objects from ~recycler.rotten.");
60rpg.puzzle_log:clean_up();
61for doll in (rpg.saved_dolls)
62  if ((valid(doll) && (parent(doll) == rpg.doll)) && is_player(doll.character))
63    "... do nothing ...";
64  else
65    rpg.saved_dolls = setremove(rpg.saved_dolls, doll);
66    player:tell($string_utils:nn(doll), " removed from $local.rpg.saved_dolls.");
67  endif
68endfor
69"Profane 6-APR-95 16:24EST -- Added.";

in_use

Spec this none thisDefiner #10161

Referenced by

Source

1":in_use(OBJ thing, [OBJ deadly location, ... ]) => 0 if not in use, ";
2"                                       or a positive value otherwise.";
3"If an object is in a deadly location, it is always considered";
4"not to be in use.";
5{thing, ?ok_to_destroy_here = {$nothing}} = args;
6" ... if the location is $nothing, axe it.  Thanks, Slither ... ";
7if (valid(where = thing.location))
8  pcs = (rpg = $local.rpg).pcs;
9  if (valid(claimant = `thing:claimed_by() ! ANY => $nothing'))
10    " ... if the thing is claimed and the person is still in the RPG ... ";
11    if (claimant in pcs)
12      " ... let it be considered in_use ... ";
13      return 3;
14    else
15      thing:unclaim_for(claimant);
16    endif
17  endif
18  while (valid(where))
19    " ... if the thing is in a place the caller said was a `lethal zone' ... ";
20    if (where in ok_to_destroy_here)
21      " ... give it the kiss of death ... ";
22      return 0;
23    elseif (where in pcs)
24      return is_player(where) ? 2 | 1;
25    endif
26    where = where.location;
27  endwhile
28else
29  return 0;
30endif

unique

Spec this none thisDefiner #10161

Referenced by

Source

1{y} = args;
2rpg = $local.rpg;
3if ((((valid(y) && (y.owner == rpg.owner)) && rpg.recycler:ok_to_recycle(y)) && (!`y.unique ! ANY => 0')) && (!(y in rpg.dispenser.dispenses)))
4  return 0;
5else
6  return 1;
7endif
8"Quinn 08-OCT-93 0438: Added check for object being dispensed.";
9"Slither 6/22/95 removed check that y.name == parent(y).name";
10"THX (#105941) - Tue Apr 17, 2001 - made this more readable and used error-trapping instead of has_property.";

doll_reapable

Spec this none thisDefiner #10161

Referenced by

Source

1":doll_reapable(OBJ doll) => true if doll can be reaped";
2{thing} = args;
3rpg = $local.rpg;
4"If doesn't exist, or isn't a G_M owned doll, forget about it";
5if ((!$recycler:valid(thing)) || (!$object_utils:isa(thing, rpg.doll)))
6  return 0;
7elseif (thing.owner != this.owner)
8  return 0;
9endif
10{threshold, time} = {this:threshold(thing), time()};
11try
12  "If the doll.character has a $garbage parent, nuke it.  - THX";
13  "If character isn't a player or a monster, then reap!";
14  if ((!valid(character = thing.character)) || (parent(character) == $garbage))
15    return 1;
16  elseif (!(thing in {@rpg.dolls, @rpg.saved_dolls}))
17    return 1;
18  elseif (is_player(character))
19    if ((character in rpg.gms) && ((time - character.last_disconnect_time) < 10368000))
20      thing.last_action = (time + 999) - threshold;
21    elseif ((set = $list_utils:assoc(character, this.immortal)) && ((!set[2]) || (set[2] > time)))
22      "... a 0 means permanent immortalization ...";
23      "... otherwise, it's a time limit        ...";
24      return 0;
25    endif
26    activity = thing.last_action + threshold;
27    if ((thing in rpg.dolls) && ("notifyreap" in thing.rpg_options))
28      if ((time > (activity - 610000)) && (time < (activity - 480000)))
29        (caller == this) && $mail_agent:send_message(this, {thing.character}, "Imminent Doll Reap Alert", {"The LambdaRPG core has determined that your voodoo doll will be reaped due to inactivity at the end of one week."});
30      endif
31    endif
32    return (activity < time) || ((!(thing in rpg.dolls)) && (!(thing in rpg.saved_dolls)));
33  else
34    return (`character.doll ! ANY => $nothing' != thing) || (!(character in rpg.pcs));
35  endif
36except (ANY)
37  return 0;
38endtry
39"July 3, 1995  Slither -- first version";
40"THX 30-Mar-1997 -- Added a check that keeps gm dolls alive if they've logged in within the past 4 months.";
41"Mooshie (#106469) - Fri May 28, 1999 - Added check for Immortalized players.";
42"THX (#105941) - Thu Sep 28, 2000 - Use this:threshold(doll) rather than this.threshold to allow longer idle times if the player has put a lot of work into the doll.";

reap_doll

Spec this none thisDefiner #10161

Referenced by

Source

1":reap_doll(OBJ doll) => true if successful   may suspend";
2"Removes a doll from the database, and prepares it to be recycled.";
3{doll} = args;
4if (caller_perms() != this.owner)
5  return E_PERM;
6elseif (!$object_utils:isa(doll, (rpg = $local.rpg).doll))
7  return E_INVARG;
8endif
9rpg:s_i_n(0);
10for t in (doll.armour_effects)
11  if (parent(t) == rpg.doll)
12    doll:remove_teammate(t);
13    t:remove_teammate(doll);
14  endif
15endfor
16"remove any claims";
17for item in (doll.claimed_objects)
18  rpg:s_i_f_i_n();
19  (valid(claimant = `item.claimed_by ! ANY => $nothing') && (claimant == doll.character)) && item:unclaim_for(claimant);
20endfor
21"remove from database";
22result = rpg:rm_doll(doll);
23if (typeof(result) != ERR)
24  this.doomed_dolls = {@this.doomed_dolls, doll};
25  return 1;
26else
27  return 0;
28endif
29"July 3, 1995  Slither -- first version";
30"THX (#105941) - Wed May 10, 2000 - Added teammate removal.";

description

Spec this none thisDefiner #10161

Referenced by

none

Source

1base = pass(@args);
2base = (typeof(base) == LIST) ? base | {base};
3books = {};
4for thingy in (this.contents)
5  if ($object_utils:isa(thingy, $note))
6    books = {@books, thingy};
7  endif
8endfor
9if (books)
10  munge = ($string_utils:title_list(books) + ((length(books) == 1) ? " lies" | " lie")) + " on Harvey's desk.";
11  return {@base, $string_utils:capitalise(munge)};
12else
13  return base;
14endif

tell_contents

Spec this none thisDefiner #10161

Referenced by

none

Source

1for thingy in (args[1])
2  if ($object_utils:isa(thingy, $note))
3    args[1] = setremove(args[1], thingy);
4  endif
5endfor
6return pass(@args);

clean_susa

Spec this none thisDefiner #10161

Referenced by

Source

1"Swiped from THX_utils (99799):clean_susa by THX (105941) Wed Dec  3 10:42:48 1997 PST";
2(rpg = $local.rpg):secure();
3ok = {@rpg.gms, @rpg.pcs};
4moolah = $object_utils:descendants(rpg.money);
5{c_u, s_u} = {$command_utils, $string_utils};
6{turf, dispenser, vault} = {rpg.cemetery.turf[1], rpg.gem_dispenser, this.vault};
7relax = 2 + rpg.gm_lag;
8for t in (children(rpg.gem))
9  if (valid(loc = t.location) && (loc.owner in ok))
10    "... do nothing ...";
11  else
12    if (((value = t:get_true_value()) > 0) && (value < 200))
13      t:moveto(vault);
14    else
15      t:moveto(dispenser);
16    endif
17  endif
18  c_u:suspend_if_needed(relax);
19endfor
20relax = 2 + rpg.gm_lag;
21for s in (moolah)
22  if (valid(loc = s.location) && (loc.owner in ok))
23    "... do nothing ...";
24  else
25    s:set_quantity(min(s.quantity, 100));
26    s:moveto(s.quantity ? vault | turf);
27  endif
28  c_u:suspend_if_needed(relax);
29endfor

update_monsters

Spec this none thisDefiner #10161

Referenced by

Source

1(rpg = $local.rpg):secure();
2possible = $object_utils:descendents_suspended(rpg.monster);
3monsters = {};
4for t in (rpg.pcs)
5  (t in possible) && (monsters = {@monsters, t});
6endfor
7this.monsters = monsters;

back_in_play

Spec this none thisDefiner #10161

Referenced by

none

Source

1(rpg = $local.rpg):secure();
2gms = rpg.gms;
3for t in (this.orphans)
4  if (valid(t) && (t.owner in gms))
5    valid(t.location) || t:moveto(this.restart);
6  endif
7  this.orphans = setremove(this.orphans, t);
8endfor
9for stuff in (args)
10  (valid(stuff) && (stuff.owner in gms)) && (this.orphans = {@this.orphans, stuff});
11endfor

dispose

Spec none none noneFlags rxdDefiner #10161

Referenced by

none

Source

1":dis*pose -- Recycle all those weapons lying useless in the Cemetery.";
2(rpg = $local.rpg):secure_x();
3n = 0;
4c_u = $command_utils;
5recycler = rpg.recycler;
6cemetery = this.cemetery;
7gm = player in rpg.gms;
8if (howmany = length(doomed = cemetery:contents()))
9  for k in (doomed)
10    if (this:killable(k))
11      c_u:suspend_if_needed(rpg.gm_lag, gm ? tostr("...~vacuum:dispose Suspending after checking ", n, "/", howmany, " objects.") | "");
12      n = n + 1;
13      recycler:_recycle(k);
14    endif
15  endfor
16  gm && player:tell("[", n, "] objects cleared from ", $string_utils:nn(cemetery), ".");
17else
18  gm && player:tell("There isn't any RPG equipment in ", $string_utils:nn(cemetery), " waiting to be destroyed.");
19endif

threshold

Spec this none thisDefiner #10161

Referenced by

Source

1{doll} = args;
2$local.rpg:secure();
3return max(this.(verb), ((doll.total - 350) + max(doll.melee, doll.magic_theory)) * 99999);

cycle(old)

Spec this none thisDefiner #10161

Referenced by

none

Source

1"Fork once a day, this.cycle seconds past midnight.";
2"Fork off the actual :reap, in case something messes it up.";
3if (caller_perms() == this.owner)
4  fork tid (#2487:time_til_midnite() + this.cycle)
5    fork (0)
6      this.reap_in_progress = {time(), task_id()};
7      this:reap();
8      this.reap_in_progress = 0;
9    endfork
10    fork (5)
11      $local.rpg.clock:check_cycles();
12    endfork
13    this:cycle();
14  endfork
15  this.cycle_task = tid;
16else
17  return E_PERM;
18endif
19"DR 30-NOV-94 -- Modified to reap just once a day, at a low-lag time.";
20"Profane 5-AUG-96 1558PDT -- Added call to :check_cycles.";

call_reap

Spec this none thisDefiner #10161

Referenced by

none

Source

1if (caller_perms() == this.owner)
2  fork tid (0)
3    this.reap_in_progress = {time(), task_id()};
4    this:reap();
5    this.reap_in_progress = 0;
6    this.next_reap = (time() + 99999) - random(999);
7  endfork
8endif

orphans

Spec this none thisDefiner #10161

Referenced by

none

Source

1$local.rpg:secure();
2return this.orphans;