Heart Of God #150

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

Aliases: Heart Of God

28 verbs · 225 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
registerthis none thisrxd#15034
service_queuethis none thisrxd#15063
unregisterthis none thisrxd#15017
logthis none thisrxd#1508
clear_allthis none thisrxd#1508
register_allthis none thisrxd#15023
validate_queuethis none thisrxd#15024
beatthis none thisrxd#15032
_beatthis none thisrxd#15013
checkthis none thisrxd#15015
tell_logthis none thisrxd#1502
register_longthis none thisrxd#15014
unregister_longthis none thisrxd#1509
register_all_longthis none thisrxd#1508
@h-areasany any anyrxd#15024
@h-checkany none nonerxd#15044
squeeze crushthis none nonerxd#1506
megacheckthis none nonerxd#15022
inspectthis none nonerxd#15021
service_queue_oldthis none thisrxd#15021
stop pausethis none nonerxd#1507
startthis none nonerxd#1507
service_long_queuethis none thisrxd#15035
@analyze-beatnone none nonerxd#15044
@show-analysisnone none nonerxd#15011
@log-beatnone none nonerxd#15011
skip_beatthis none thisrxd#15020
compress_queuesthis none thisrxd#15056

Properties

PropertyDefinerFlagsOwnerValue
all_creatures#150rc#361{#361}
highest_queue#150rc#361175
queue_1#150rc#361{}
queue_2#150r#361{}
queue_3#150r#361{}
queue_4#150r#361{}
queue_5#150r#361{}
queue_6#150r#361{}
queue_7#150r#361{}
queue_8#150r#361{}
queue_9#150r#361{}
queue_10#150r#361{}
queue_11#150r#361{}
queue_12#150r#361{}
queue_13#150r#361{}
queue_14#150r#361{}
queue_15#150r#361{}
queue_16#150r#361{}
queue_17#150r#361{}
queue_18#150r#361{}
errlog#150rc#361{}
log#150rc#361
list of 6{"earth (#194) tried unregister_long, but !in queue_long", "generic classroom (#211) tried unregister_long, but !in queue_long", "The School (#207) tried to register_long, but already in queue_long", "removing non-area <invalid> (#661378) from long queue.", "removing non-area <invalid> (#661377) from long queue.", "removing non-area <invalid> (#661376) from long queue."}
beat_task#150rc#3611970678726
queue_long#150rc#361{#207, #334, #177}
feature_ok#150rc#3611
queue_19#150r#361{}
queue_20#150r#361{}
queue_21#150r#361{}
queue_22#150r#361{}
queue_23#150r#361{}
queue_24#150r#361{}
queue_25#150r#361{}
queue_26#150r#361{}
queue_27#150r#361{}
queue_28#150r#361{}
queue_29#150r#361{}
queue_30#150r#361{}
queue_31#150r#361{}
queue_32#150r#361{}
queue_33#150r#361{}
queue_34#150r#361{}
queue_35#150r#361{}
queue_36#150r#361{}
queue_37#150r#361{}
queue_38#150r#361{}
queue_39#150r#361{}
queue_40#150r#361{}
queue_41#150r#361{}
queue_42#150r#361{}
queue_43#150r#361{}
queue_44#150r#361{}
queue_45#150r#361{}
queue_46#150r#361{}
queue_47#150r#361{}
queue_48#150r#361{}
queue_49#150r#361{}
queue_50#150r#361{}
queue_51#150r#361{}
queue_52#150r#361{}
queue_53#150r#361{}
queue_54#150r#361{}
queue_55#150r#361{}
queue_56#150r#361{}
queue_57#150r#361{}
queue_58#150r#361{}
queue_59#150r#361{}
queue_60#150r#361{}
queue_61#150r#361{}
queue_62#150r#361{}
queue_63#150r#361{}
queue_64#150r#361{}
queue_65#150r#361{}
queue_66#150r#361{}
queue_67#150r#361{}
queue_68#150r#361{}
queue_69#150r#361{}
queue_70#150r#361{}
queue_71#150r#361{}
queue_72#150r#361{}
queue_73#150r#361{}
queue_74#150r#361{}
queue_75#150r#361{}
queue_76#150r#361{}
queue_77#150r#361{}
queue_78#150r#361{}
queue_79#150r#361{}
queue_80#150r#361{}
queue_81#150r#361{}
queue_82#150r#361{}
queue_83#150r#361{}
queue_84#150r#361{}
queue_85#150r#361{}
queue_86#150r#361{}
queue_87#150r#361{}
queue_88#150r#361{}
queue_89#150r#361{}
queue_90#150r#361{}
queue_91#150r#361{}
queue_92#150r#361{}
queue_93#150r#361{}
queue_94#150r#361{}
queue_95#150r#361{}
queue_96#150r#361{}
queue_97#150r#361{}
queue_98#150r#361{}
queue_99#150r#361{}
queue_100#150r#361{}
queue_101#150r#361{}
queue_102#150r#361{}
queue_103#150r#361{}
queue_104#150r#361{}
queue_105#150r#361{}
queue_106#150r#361{}
queue_107#150r#361{}
queue_108#150r#361{}
queue_109#150r#361{}
queue_110#150r#361{}
queue_111#150r#361{}
queue_112#150r#361{}
queue_113#150r#361{}
queue_114#150r#361{}
queue_115#150r#361{}
queue_116#150r#361{}
queue_117#150r#361{}
queue_118#150r#361{}
queue_119#150r#361{}
queue_120#150r#361{}
queue_121#150r#361{}
queue_122#150r#361{}
queue_123#150r#361{}
queue_124#150r#361{}
queue_125#150r#361{}
queue_126#150r#361{}
queue_127#150r#361{}
queue_128#150r#361{}
queue_129#150r#361{}
queue_130#150r#361{}
queue_131#150r#361{}
queue_132#150r#361{}
queue_133#150r#361{}
queue_134#150r#361{}
queue_135#150r#361{}
queue_136#150r#361{}
queue_137#150r#361{}
queue_138#150r#361{}
queue_139#150r#361{}
queue_140#150r#361{}
queue_141#150r#361{}
queue_142#150r#361{}
queue_143#150r#361{}
queue_144#150r#361{}
queue_145#150r#361{}
queue_146#150r#361{}
queue_147#150r#361{}
queue_148#150r#361{}
queue_149#150r#361{}
queue_150#150r#361{}
queue_151#150r#361{}
queue_152#150r#361{}
queue_153#150r#361{}
stopped#150rc#3610
last_beat#150rc#3611337755489
stopped_areas#150rc#3610
hearts_this_beat#150rc#3611
heartnet#150rc#361#141109
creature_beats#150rc#3611
monitor_beat#150rc#3610
pending_monitor#150rc#3610
beat_details#150rc#361{{#362, #366}, {#362, #56}, {#361, #366}, {#361, #56}}
analyzed_normal#150rc#361
list of 12{{"powered", 1}, {"FO", 1}, {"weapon", 1}, {"decal", 3}, {"garbage", 12}, {"security", 21}, {"player", 80}, {"powerplant", 118}, {"other", 161}, {"creature", 176}, {"NPC", 491}, {"monster", 1175}}
analyzed_creature#150rc#361
list of 17{{"kitsch", 1}, {"NPC", 2}, {"powerplant", 3}, {"dispenser", 3}, {"note", 5}, {"vend", 10}, {"garbage", 14}, {"clothing", 19}, {"exit", 28}, {"container", 129}, {"food", 133}, {"smokable", 214}, {"decal", 320}, {"powered", 320}, {"camera", 337}, {"other", 383}, {"room", 2103}}
log_monitors#150r#361{#362}
beat_interval#150rc#36130
queue_154#150r#361{}
queue_155#150r#361{}
queue_156#150r#361{}
queue_157#150r#361{}
queue_158#150r#361{}
queue_159#150r#361{}
queue_160#150r#361{}
queue_161#150r#361{}
queue_162#150r#361{}
queue_163#150r#361{}
queue_164#150r#361{}
queue_165#150r#361{}
queue_166#150r#361{}
queue_167#150r#361{}
queue_168#150r#361{}
queue_169#150r#361{}
queue_170#150r#361{}
queue_171#150r#361{}
queue_172#150r#361{}
queue_173#150r#361{}
queue_174#150r#361{}
queue_175#150r#361{#361}
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361"The Heart of God throbs inside its holding tank."
value#5rc#361400000
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"the"
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{"Heart Of God"}
description#1rc#361"The heart looks human enough, but huge, bigger even than a cow heart. It sits on a pedestal tank, immersed in a pale green fluid that sloshes viscously out the open top along with the gentle throb of the great muscle."
object_size#1r#29{106765, 1298433835}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361-1
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n150_0 #150:register n107_43 #107:tell n150_0->n107_43 n20_59 #20:name_and_number n150_0->n20_59 n150_1 #150:service_queue n150_1->n20_59 n150_6 #150:validate_queue n150_1->n150_6 n103_35 #103:handle_broken_heart n150_1->n103_35 n150_6->n20_59 n150_3 #150:log n150_6->n150_3 n150_2 #150:unregister n150_2->n20_59 n45_0 #45:has_property n150_2->n45_0 n150_2->n150_3 n150_4 #150:clear_all n45_26 #45:leaves_suspended n150_4->n45_26 n150_5 #150:register_all n150_5->n150_0 n150_5->n107_43 n150_5->n20_59 n150_5->n45_26 n48_8 #48:suspend_if_needed n150_5->n48_8 n150_27 #150:compress_queues n150_5->n150_27 n150_27->n107_43 n150_7 #150:beat n150_7->n150_1 n150_7->n150_3 n1_39 #1:dnamec n150_7->n1_39 n150_22 #150:service_long_queue n150_7->n150_22 n150_22->n20_59 n150_22->n103_35 n150_22->n150_3 n35_18 #35:abbrev_ctime n150_22->n35_18 n103_38 #103:handle_broken_area n150_22->n103_38 n150_8 #150:_beat n150_8->n150_7 n150_8->n150_8 n150_26 #150:skip_beat n150_8->n150_26 n150_9 #150:check n150_9->n150_6 n150_9->n150_3 n20_5 #20:from_list n150_9->n20_5 n150_10 #150:tell_log n150_9->n150_10 n47_11 #47:reverse n150_10->n47_11 n1_11 #1:tell_lines n150_10->n1_11 n150_11 #150:register_long n150_11->n20_59 n150_11->n150_3 n150_12 #150:unregister_long n150_12->n20_59 n150_12->n150_3 n150_13 #150:register_all_long n150_13->n45_26 n150_13->n48_8 n150_13->n150_11 n150_14 #150:@h-areas n150_14->n107_43 n150_14->n45_26 n150_14->n48_8 n20_17 #20:match n150_14->n20_17 n20_1 #20:left n150_14->n20_1 n47_14 #47:sort n150_14->n47_14 n150_15 #150:@h-check n150_15->n150_0 n150_15->n107_43 n150_15->n20_59 n150_15->n45_0 n150_16 #150:squeeze n150_16->n107_43 n150_16->n48_8 n1_31 #1:dname n150_16->n1_31 n6_169 #6:dnamec n150_16->n6_169 n150_17 #150:megacheck n150_17->n150_0 n150_17->n107_43 n150_17->n20_59 n150_17->n45_26 n150_17->n48_8 n1_33 #1:area n150_17->n1_33 n150_18 #150:inspect n150_18->n107_43 n150_18->n20_59 n150_18->n48_8 n150_18->n1_31 n150_18->n6_169 n150_18->n1_33 n1_66 #1:announce_action_text n150_18->n1_66 n150_19 #150:service_queue_old n150_19->n150_6 n150_19->n48_8 n150_20 #150:stop n150_20->n107_43 n150_20->n1_31 n150_20->n6_169 n150_20->n1_33 n150_20->n1_66 n150_21 #150:start n150_21->n107_43 n150_21->n1_31 n150_21->n6_169 n150_21->n1_33 n150_21->n1_66 n150_23 #150:@analyze-beat n150_23->n107_43 n150_23->n48_8 n317_6 #317:extypeof n150_23->n317_6 n317_2 #317:typeof n150_23->n317_2 n47_19 #47:iassoc_suspended n150_23->n47_19

Showing 48 of 52 verbs; 4 not shown.

Source

register

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1":register(OBJ creature)  Register a new creature with the heart.";
2who = args[1];
3if (!$api.heart:is_on(who))
4return E_INVARG;
5endif
6if (who.heart < 0)
7return E_INVARG;
8elseif (who.heart > 0)
9if (who.heart <= this.highest_queue)
10if (who in this.("queue_" + tostr(who.heart)))
11return 0;
12endif
13endif
14endif
15qnum = this.highest_queue;
16this.all_creatures = setadd(this.all_creatures, who);
17while (qnum > 0)
18pt = "queue_" + tostr(qnum);
19if (length(this.(pt)) < 20)
20this.(pt) = setadd(this.(pt), who);
21who.heart = qnum;
22return qnum;
23endif
24qnum = qnum - 1;
25yield;
26endwhile
27qnum = this.highest_queue + 1;
28pname = "queue_" + tostr(qnum);
29player:tell("Adding new queue ", qnum, " to $heart!");
30$nets.heartnet:announce(player, tostr("Adding new queue", qnum, " to $heart for ", $su:nn(who)), 1);
31add_property(this, "queue_" + tostr(qnum), {who}, {#2, "r"});
32this.highest_queue = qnum;
33who.heart = qnum;
34return qnum;

service_queue

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1":service_queue(NUM qnum)  Run the heartbeats of everyone in queue qnum once.";
2pn = this:validate_queue(qnum = args[1]);
3c = 1;
4for x in (this.(pn))
5if (`x.heart ! ANY => 0' == qnum)
6if (x.location == $tomb)
7continue;
8endif
9if ((x.location == $womb) && (!is_a(x, $invasion)))
10$nets.prognet:announce(#-1, tostr("Warning: heart beating on ", $su:nn(x), " which is in $womb."), 1);
11$nets.prognet:announce(#-1, tostr("Parent: ", $su:nn(parent(x)), " -- Owner: ", $su:nn(x.owner)), 1);
12continue;
13endif
14heart_ticks = 0;
15try
16start = ticks_left();
17player = x;
18x:heartbeat();
19heart_ticks = start - ticks_left();
20this.hearts_this_beat = this.hearts_this_beat + 1;
21if (this.monitor_beat)
22this.beat_details = listappend(this.beat_details, x);
23endif
24except e (E_NONE)
25"Heartbeat cancelled normally.";
26except e (ANY)
27$rpg:handle_broken_heart(x, e);
28endtry
29`x.last_heartbeat = time() ! ANY => 0';
30creature_ticks = {};
31if (is_a(x.location, $room) && (length(x.location.contents) < 100))
32for y in (listappend(x.location.contents, x.location))
33if (!has_callable_verb(y, "creature_heartbeat"))
34continue;
35endif
36try
37start = ticks_left();
38player = x;
39y:creature_heartbeat(x);
40y_ticks = start - ticks_left();
41creature_ticks = {@creature_ticks, {y, y_ticks}};
42this.creature_beats = this.creature_beats + 1;
43if (this.monitor_beat)
44this.beat_details = listappend(this.beat_details, {x, y});
45endif
46except e (E_VERBNF)
47"Ignore -- a lot of things don't have :creature_heartbeat";
48except e (ANY)
49$rpg:handle_broken_heart(y, e, x);
50endtry
51if ((ticks_left() < 5000) || (seconds_left() < 1))
52suspend(0);
53this.heartnet:announce(this, ("Suspended while doing creature_heartbeats for " + $su:nn(x)) + ".", 1);
54this.heartnet:announce(this, tostr("   ", x, ":heartbeat -- ", heart_ticks, " ticks"), 1);
55for ct in (creature_ticks)
56this.heartnet:announce(this, tostr("   ", ct[1], ":creature_heartbeat -- ", ct[2], " ticks"), 1);
57endfor
58endif
59endfor
60endif
61suspend(1);
62endif
63endfor

unregister

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1who = args[1];
2if (!(heart = `who.heart ! E_PROPNF'))
3elseif (!(who in this.all_creatures))
4else
5pn = "queue_" + tostr(heart);
6if (!$ou:has_property(this, pn))
7if (heart != -1)
8this:log($su:nn(who), " had heart ", tostr(heart), " but there's no such queue!");
9endif
10elseif (!(who in this.(pn)))
11this:log($su:nn(who), " unregistered with heart=", tostr(heart), ", but isn't in that queue");
12else
13this.(pn) = setremove(this.(pn), who);
14this.all_creatures = setremove(this.all_creatures, who);
15who.heart = 0;
16endif
17endif

log

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1line = tostr(@args);
2for ear in (this.log_monitors)
3ear:tell($ansi.yellow, "[ heart ] ", line, $ansi.reset);
4endfor
5this.log = {line, @this.log};
6if (length(this.log) > 100)
7this.log = this.log[1..100];
8endif

clear_all

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

none

Source

1":clear_all()  Delete all creatures from the heart and kill all tasks.";
2for x in [1..this.highest_queue]
3this.("queue_" + tostr(x)) = {};
4endfor
5this.all_creatures = {};
6for x in ($ou:leaves_suspended($creature))
7x.heart = (x.heart == -1) ? -1 | 0;
8endfor

register_all

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

none

Source

1":register_all() => smartly re-register all existing creatures.";
2for x in ($ou:leaves_suspended($creature))
3if (!gamevalid(x))
4"Recycled or dead. Leave it alone.";
5elseif (is_a(l = x.location, $prog))
6"Ignore prog shit.";
7elseif (!valid(l))
8"This is dumb and someone should know.";
9player:tell($su:nn(x), " is in ", $su:nn(l), x.f ? " (+f)" | "");
10(x.f && "May as well do this.") && move(x, $generics);
11elseif (x.f || (x.heart == -1))
12"Don't bother.";
13elseif (!is_a(x, $creature))
14"Just to be sure.";
15elseif (is_player(x) && (!is_connected(x)))
16"Pointless, also spammy.";
17else
18this:register(x);
19endif
20$cu:sin(1);
21endfor
22this:compress_queues();
23player:tell("Finished re-registering!");

validate_queue

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1":validate_queue(NUM qnum)  Prune any errant objects from queue qnum.";
2newq = {};
3pn = "queue_" + tostr(qnum = args[1]);
4changed = 0;
5for x in (this.(pn))
6if (!gamevalid(x))
7this:log("FIXED: non-gamevalid object ", x, " in queue ", qnum);
8changed = 1;
9elseif (!`x.heart + 1 ! ANY => 0')
10changed = 1;
11elseif (x.heart != qnum)
12changed = 1;
13elseif (x.f)
14this:log("FIXED: ", $su:nn(x), " is fertile");
15x.heart = -1;
16changed = 1;
17else
18newq = listappend(newq, x);
19endif
20endfor
21if (changed)
22this.(pn) = newq;
23endif
24return pn;

beat

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1if (!this.stopped)
2this.last_beat = time();
3this.location:announce_all($ansi.red, "The Heart Of God beats. *lubdub* (", $ansi.bold_on, tostr(this.hearts_this_beat, "/", this.creature_beats), $ansi.bold_off, ")", $ansi.reset);
4this.hearts_this_beat = 0;
5this.creature_beats = 0;
6if (this.monitor_beat)
7this.monitor_beat = 0;
8this.location:announce_all(this:dnamec(), " shrugs off the EKG. Log complete.");
9elseif (this.pending_monitor)
10this.monitor_beat = 1;
11this.pending_monitor = 0;
12endif
13forktime = 1;
14c = 1;
15queues_per_slice = this.highest_queue / 15;
16for x in [1..this.highest_queue]
17qprop = "queue_" + tostr(x);
18if (`this.(qprop) ! ANY => 0')
19fork (forktime)
20this:service_queue(x);
21endfork
22endif
23c = c + 1;
24if (c > queues_per_slice)
25forktime = forktime + 1;
26c = 1;
27endif
28endfor
29else
30this:log("$heart not beating because .stopped = 1");
31endif
32this:service_long_queue();

_beat

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1if ($stop_everything)
2return;
3endif
4if (!task_valid(this.beat_task))
5fork task_id (this.beat_interval)
6this.beat_task = 0;
7this:_beat();
8endfork
9this.beat_task = task_id;
10if (!this:skip_beat())
11this:beat();
12endif
13endif

check

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

none

Source

1this:log("Check started.");
2for x in [1..this.highest_queue]
3this:log($su:from_list(this.("queue_" + tostr(x))));
4if (!this.("queue_" + tostr(x)))
5if (this.("queue_" + tostr(x - 1)))
6highest = x - 1;
7endif
8endif
9endfor
10this.highest_queue = highest;
11for x in [1..this.highest_queue]
12this:validate_queue(x);
13endfor
14this:log("Check finished.");
15this:tell_log();

tell_log

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1log = $lu:reverse(this.log);
2player:tell_lines(log[1..min(length(log), 40)]);

register_long

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1":register_log(OBJ area)  Register a new creature with the heart.";
2who = args[1];
3if (who.heart == -1)
4this:log($su:nn(who), " tried to register_long, but heart=" + tostr(who.heart));
5return E_INVARG;
6elseif (who in this.queue_long)
7this:log($su:nn(who), " tried to register_long, but already in queue_long");
8return E_INVARG;
9endif
10qnum = 1;
11this.queue_long = {@this.queue_long, who};
12who.heart = "long";
13who.heart_tick = random(who.reset_interval / 2);
14return "long";

unregister_long

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1who = args[1];
2if ((heart = who.heart) != "long")
3this:log($su:nn(who), " tried unregister_long, but .heart = ", who.heart);
4elseif (!(who in this.queue_long))
5this:log($su:nn(who), " tried unregister_long, but !in queue_long");
6else
7this.queue_long = setremove(this.queue_long, who);
8who.heart = 0;
9endif

register_all_long

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

none

Source

1":register_all_long()  Re-register all existing areas.";
2this.queue_long = {};
3for x in ($ou:leaves_suspended($area))
4if ((!x.f) && (!(x.heart == -1)))
5this:register_long(x);
6$cu:sin(0);
7endif
8endfor

@h-areas

Spec any any anyFlags rxdOwner #361Definer #150

Referenced by

none

Source

1"@h-areas <areaname> : returns a list of area reset information with no args, or area reset information on a named area, if it exists according to $su:match.";
2seed = $ou:leaves_suspended($area);
3if (length(args) > 0)
4x = $su:match(args[1], seed, "name");
5if (valid(x))
6inter = (time() - x.last_reset) / 60;
7player:tell($su:left(x.name, -22), " interval: ", tostr(x.reset_interval), " min   last reset: ", tostr(inter), " min ago");
8else
9player:tell("\"", args[1], "\" is not a valid area name.");
10endif
11return;
12endif
13arealist = {{}, {}};
14for a in (seed)
15arealist = {{@arealist[1], a}, {@arealist[2], a.name}};
16endfor
17areas = $lu:sort(arealist[1], arealist[2]);
18for x in (areas)
19$cu:sin(0);
20if (!(x.heart == -1))
21inter = (time() - x.last_reset) / 60;
22player:tell($su:left(x.name, -22), " interval: ", tostr(x.reset_interval), " min   last reset: ", tostr(inter), " min ago");
23endif
24endfor

@h-check

Spec any none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1if (!valid(dobj))
2player:tell("@h-check who?");
3return;
4endif
5if (!$ou:has_property(dobj, "heart"))
6player:tell($su:nn(dobj), " is not a heartbeating object.");
7return;
8endif
9if (dobj.f)
10player:tell(dobj:dnamec() + " is fertile and should not have a heartbeat!");
11return;
12endif
13player:tell($su:nn(dobj), "'s last heartbeat was ", time() - dobj.last_heartbeat, " seconds ago.");
14if (dobj.heart == -1)
15player:tell($su:nn(dobj), " has .heart == -1, and so has no heartbeat.  To give it a heartbeat, give it .heart = 0 and run this command again.");
16return;
17elseif (dobj.heart == 0)
18player:tell($su:nn(dobj), " has .heart == 0!");
19elseif (dobj.heart > this.highest_queue)
20player:tell($su:nn(dobj), " has .heart == ", dobj.heart, " but there are only ", this.highest_queue, " queues!");
21elseif (!(dobj in this.("queue_" + tostr(dobj.heart))))
22player:tell($su:nn(dobj), " is .heart == ", dobj.heart, ", but isn't in that queue!");
23elseif (!(dobj in this.all_creatures))
24player:tell($su:nn(dobj), " is in queue ", heart, " but isn't in all_creatures!");
25else
26player:tell($ansi.green + $su:nn(dobj), " is properly registered in heartbeat queue ", dobj.heart, "." + $ansi.reset);
27return;
28endif
29player:tell("Attempting to fix...");
30for x in [1..this.highest_queue]
31pn = "queue_" + tostr(x);
32if (dobj in this.(pn))
33player:tell("Found ", dobj.name, " in heartbeat queue ", x, " -- deleting.");
34this.(pn) = setremove(this.(pn), dobj);
35endif
36endfor
37dobj.heart = 0;
38this.all_creatures = setremove(this.all_creatures, dobj);
39h = this:register(dobj);
40if (h)
41player:tell(($ansi.green + "Registered ") + $ansi.reset, dobj.name, " in heartbeat queue ", h, ".");
42else
43player:tell($ansi.red + "Registration failed with error ", h, "!" + $ansi.reset);
44endif

squeeze crush

Spec this none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1player:tell("You squeeze ", this:dname(), " in your hand.");
2player.location:announce_all_but({player}, ((player:dnamec() + " squeezes ") + this:dname()) + ".");
3for x in (connected_players())
4x:tell("AUGH!  You feel a crushing pain in your heart, like someone's squeezing it.");
5$cu:sin(0);
6endfor

megacheck

Spec this none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1this:area():god_check(player, this);
2if (!player.wizard)
3player:tell("Not for you, young one.");
4return;
5endif
6if (0)
7player:tell("Clearing all queues...");
8this.all_creatures = {};
9for x in [1..175]
10this.("queue_" + tostr(x)) = {};
11endfor
12endif
13player:tell("Generating creature list...");
14creatures = $ou:leaves_suspended($npc);
15for x in (creatures)
16if ((x.heart != -1) && (!x.f))
17player:tell("Registering ", $su:nn(x), "...");
18this:register(x);
19endif
20$cu:sin(1);
21endfor
22player:tell("DONE!");

inspect

Spec this none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1this:area():god_check(player, this);
2player:aat(player:dnamec(), " dips his hand in ", this:dname(), "'s tank, feeling it carefully.");
3found = {};
4for i in [1..this.highest_queue]
5player:tell(("You inspect queue #" + tostr(i)) + ".");
6q = this.("queue_" + tostr(i));
7if (!q)
8player:tell("Hmmm, strange.  It's empty.");
9else
10for who in (q)
11if (!`who.heart ! ANY')
12player:tell("  Oops!  ", $su:nn(who), " has no .heart!");
13elseif (who in found)
14player:tell("  Oops!  ", $su:nn(who), " has a dupe entry here!");
15else
16found = listappend(found, who);
17endif
18endfor
19endif
20$cu:sin(1);
21endfor

service_queue_old

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

none

Source

1"Copied from Heart Of God (#5945):service_queue by Satan (#2) Tue Dec  5 02:04:32 2006 PST";
2":service_queue(NUM qnum)  Run the heartbeats of everyone in queue qnum once.";
3pn = this:validate_queue(qnum = args[1]);
4c = 1;
5for x in (this.(pn))
6if (`x.heart ! ANY => 0' == qnum)
7`x:heartbeat() ! ANY => 0';
8`x.last_heartbeat = time() ! ANY => 0';
9if (is_a(x.location, $room))
10for y in (listappend(x.location.contents, x.location))
11`y:creature_heartbeat(x) ! ANY => 0';
12endfor
13endif
14c = c + 1;
15$cu:sin(1);
16if (c > 1)
17c = 1;
18suspend(1);
19endif
20endif
21endfor

stop pause

Spec this none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1this:area():god_check(player, this);
2if (this.stopped)
3player:tell("It's already stopped.");
4else
5player:aat(player:dnamec(), " reaches into ", this:dname(), "'s tank and pinches off a vein.  It stops beating.");
6this.stopped = 1;
7endif

start

Spec this none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1this:area():god_check(player, this);
2if (!this.stopped)
3player:tell("It's already beating.");
4else
5this.stopped = 0;
6player:aat(player:dnamec(), " reaches into ", this:dname(), "'s tank and massages it briefly.  It pulses back to life.");
7endif

service_long_queue

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1if (!this.stopped_areas)
2to_remove = {};
3for x in (this.queue_long)
4if (!is_a(x, $area))
5this:log("removing non-area ", $su:nn(x), " from long queue.");
6to_remove = {@to_remove, x};
7elseif (x.reset_interval)
8if ((x.heart_tick = x.heart_tick + 1) > (x.reset_interval * 2))
9x.heart_tick = 0;
10fork (random(60))
11if (!gamevalid(x))
12return;
13endif
14try
15$nets.areanet:announce(#-1, tostr($tu:abbrev_ctime()[$ - 4..$], " - ", $su:nn(x)), 1);
16x:do_reset();
17x.last_reset = time();
18except e (ANY)
19$rpg:handle_broken_area(x, e);
20endtry
21endfork
22endif
23try
24x:heartbeat();
25except e (ANY)
26$rpg:handle_broken_heart(x, e);
27endtry
28endif
29endfor
30if (to_remove)
31this.queue_long = $set_utils:difference(this.queue_long, to_remove);
32endif
33else
34this:log("area $heart not beating because .stopped_areas = 1");
35endif

@analyze-beat

Spec none none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1if (!player.wizard)
2player:tell("It looks pretty complicated. You should probably ask someone you trust to help you with the Heart of God which controls All Things that has the potential to Horribly Break Everything.");
3return;
4endif
5if (!this.beat_details)
6player:tell("There is no last beat info to look at.");
7return;
8endif
9creature = {};
10normal = {};
11for b in (this.beat_details)
12if (typeof(b) == LIST)
13what = b[2];
14type = $gamecheck:extypeof(what);
15if (type == "???")
16type = $gamecheck:typeof(what);
17endif
18i = $lu:iassoc_suspended(type, creature);
19if (i)
20creature[i][2] = creature[i][2] + 1;
21else
22creature = listappend(creature, {type, 1});
23endif
24else
25what = b;
26type = $gamecheck:extypeof(what);
27if (type == "???")
28type = $gamecheck:typeof(what);
29endif
30i = $lu:iassoc_suspended(type, normal);
31if (i)
32normal[i][2] = normal[i][2] + 1;
33else
34normal = listappend(normal, {type, 1});
35endif
36endif
37$cu:sin(1);
38endfor
39suspend(0);
40normal = $lu:sort_alist_suspended(0, normal, 2);
41creature = $lu:sort_alist_suspended(0, creature, 2);
42this.analyzed_normal = normal;
43this.analyzed_creature = creature;
44player:tell("[ Done! ]");

@show-analysis

Spec none none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1player:tell("- calls to :heartbeat -");
2for x in (this.analyzed_normal)
3player:tell($su:left(x[1], 20), tostr(x[2]));
4$cu:sin(0);
5endfor
6player:tell();
7player:tell("- calls to :creature_heartbeat -");
8for x in (this.analyzed_creature)
9player:tell($su:left(x[1], 20), tostr(x[2]));
10$cu:sin(0);
11endfor

@log-beat

Spec none none noneFlags rxdOwner #361Definer #150

Referenced by

none

Source

1if (!player.wizard)
2player:tell("It looks pretty complicated. You should probably ask someone you trust to help you with the Heart of God which controls All Things that has the potential to Horribly Break Everything.");
3else
4if ($cu:yes_or_no("Logging a heartbeat sucks and takes a lot of time. The lag flywheel will whirr for a while, etc. Are you sure you want to do this?"))
5this.location:announce_all($ansi.bold_on, player.name, " hooks up a nearby EKG to the heart. The next beat will be logged.", $ansi.reset);
6player:tell("Logging will happen at the beginning of the next beat.");
7this.pending_monitor = 1;
8else
9player:tell("Aborted.");
10endif
11endif

skip_beat

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1htasks = 0;
2for t in (queued_tasks())
3if (t[6] == this)
4htasks = htasks + 1;
5endif
6endfor
7queues = 0;
8for qnum in [1..this.highest_queue]
9qprop = tostr("queue_", qnum);
10if (this.(qprop))
11queues = queues + 1;
12endif
13endfor
14pct = floatstr((tofloat(htasks - 1) / tofloat(queues)) * 100.0, 1);
15if (toint(pct) > 70)
16$nets.heartnet:sys_announce("Skipping a beat. Of ", queues, " active queues, ", htasks, " are still running. (", pct, "%)");
17return 1;
18else
19return 0;
20endif

compress_queues

Spec this none thisFlags rxdOwner #361Definer #150

Referenced by

Source

1if (!player.wizard)
2raise(E_PERM);
3endif
4empty = {};
5used = {};
6for qnum in [1..this.highest_queue]
7p = tostr("queue_", qnum);
8if (!this.(p))
9empty = {@empty, qnum};
10else
11used = {qnum, @used};
12endif
13yield;
14endfor
15"used goes high to low, empty goes low to high.";
16while (empty && used)
17next_empty = empty[1];
18next_used = used[1];
19used = used[2..$];
20if (next_empty > next_used)
21break;
22endif
23player:tell("Moving queue ", next_used, " to queue ", next_empty);
24usedprop = tostr("queue_", next_used);
25emptyprop = tostr("queue_", next_empty);
26for c in (this.(usedprop))
27c.heart = next_empty;
28endfor
29this.(emptyprop) = {@this.(emptyprop), @this.(usedprop)};
30this.(usedprop) = {};
31if (length(this.(emptyprop)) >= 20)
32empty = empty[2..$];
33endif
34yield;
35endwhile
36"find new highest";
37qnum = this.highest_queue;
38new_high = 0;
39while (qnum > 0)
40p = tostr("queue_", qnum);
41if (this.(p))
42player:tell("Highest used queue is ", qnum);
43new_high = qnum;
44break;
45endif
46qnum = qnum - 1;
47yield;
48endwhile
49oldhigh = this.highest_queue;
50this.highest_queue = new_high;
51for qnum in [new_high + 1..oldhigh]
52player:tell("Removing old queue ", qnum);
53p = tostr("queue_", qnum);
54delete_property(this, p);
55yield;
56endfor