Heart Of God #150
Aliases: Heart Of God
28 verbs · 225 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
register | this none this | rxd | #150 | 34 |
service_queue | this none this | rxd | #150 | 63 |
unregister | this none this | rxd | #150 | 17 |
log | this none this | rxd | #150 | 8 |
clear_all | this none this | rxd | #150 | 8 |
register_all | this none this | rxd | #150 | 23 |
validate_queue | this none this | rxd | #150 | 24 |
beat | this none this | rxd | #150 | 32 |
_beat | this none this | rxd | #150 | 13 |
check | this none this | rxd | #150 | 15 |
tell_log | this none this | rxd | #150 | 2 |
register_long | this none this | rxd | #150 | 14 |
unregister_long | this none this | rxd | #150 | 9 |
register_all_long | this none this | rxd | #150 | 8 |
@h-areas | any any any | rxd | #150 | 24 |
@h-check | any none none | rxd | #150 | 44 |
squeeze crush | this none none | rxd | #150 | 6 |
megacheck | this none none | rxd | #150 | 22 |
inspect | this none none | rxd | #150 | 21 |
service_queue_old | this none this | rxd | #150 | 21 |
stop pause | this none none | rxd | #150 | 7 |
start | this none none | rxd | #150 | 7 |
service_long_queue | this none this | rxd | #150 | 35 |
@analyze-beat | none none none | rxd | #150 | 44 |
@show-analysis | none none none | rxd | #150 | 11 |
@log-beat | none none none | rxd | #150 | 11 |
skip_beat | this none this | rxd | #150 | 20 |
compress_queues | this none this | rxd | #150 | 56 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
all_creatures | #150 | rc | #361 | {#361} |
highest_queue | #150 | rc | #361 | 175 |
queue_1 | #150 | rc | #361 | {} |
queue_2 | #150 | r | #361 | {} |
queue_3 | #150 | r | #361 | {} |
queue_4 | #150 | r | #361 | {} |
queue_5 | #150 | r | #361 | {} |
queue_6 | #150 | r | #361 | {} |
queue_7 | #150 | r | #361 | {} |
queue_8 | #150 | r | #361 | {} |
queue_9 | #150 | r | #361 | {} |
queue_10 | #150 | r | #361 | {} |
queue_11 | #150 | r | #361 | {} |
queue_12 | #150 | r | #361 | {} |
queue_13 | #150 | r | #361 | {} |
queue_14 | #150 | r | #361 | {} |
queue_15 | #150 | r | #361 | {} |
queue_16 | #150 | r | #361 | {} |
queue_17 | #150 | r | #361 | {} |
queue_18 | #150 | r | #361 | {} |
errlog | #150 | rc | #361 | {} |
log | #150 | rc | #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 | #150 | rc | #361 | 1970678726 |
queue_long | #150 | rc | #361 | {#207, #334, #177} |
feature_ok | #150 | rc | #361 | 1 |
queue_19 | #150 | r | #361 | {} |
queue_20 | #150 | r | #361 | {} |
queue_21 | #150 | r | #361 | {} |
queue_22 | #150 | r | #361 | {} |
queue_23 | #150 | r | #361 | {} |
queue_24 | #150 | r | #361 | {} |
queue_25 | #150 | r | #361 | {} |
queue_26 | #150 | r | #361 | {} |
queue_27 | #150 | r | #361 | {} |
queue_28 | #150 | r | #361 | {} |
queue_29 | #150 | r | #361 | {} |
queue_30 | #150 | r | #361 | {} |
queue_31 | #150 | r | #361 | {} |
queue_32 | #150 | r | #361 | {} |
queue_33 | #150 | r | #361 | {} |
queue_34 | #150 | r | #361 | {} |
queue_35 | #150 | r | #361 | {} |
queue_36 | #150 | r | #361 | {} |
queue_37 | #150 | r | #361 | {} |
queue_38 | #150 | r | #361 | {} |
queue_39 | #150 | r | #361 | {} |
queue_40 | #150 | r | #361 | {} |
queue_41 | #150 | r | #361 | {} |
queue_42 | #150 | r | #361 | {} |
queue_43 | #150 | r | #361 | {} |
queue_44 | #150 | r | #361 | {} |
queue_45 | #150 | r | #361 | {} |
queue_46 | #150 | r | #361 | {} |
queue_47 | #150 | r | #361 | {} |
queue_48 | #150 | r | #361 | {} |
queue_49 | #150 | r | #361 | {} |
queue_50 | #150 | r | #361 | {} |
queue_51 | #150 | r | #361 | {} |
queue_52 | #150 | r | #361 | {} |
queue_53 | #150 | r | #361 | {} |
queue_54 | #150 | r | #361 | {} |
queue_55 | #150 | r | #361 | {} |
queue_56 | #150 | r | #361 | {} |
queue_57 | #150 | r | #361 | {} |
queue_58 | #150 | r | #361 | {} |
queue_59 | #150 | r | #361 | {} |
queue_60 | #150 | r | #361 | {} |
queue_61 | #150 | r | #361 | {} |
queue_62 | #150 | r | #361 | {} |
queue_63 | #150 | r | #361 | {} |
queue_64 | #150 | r | #361 | {} |
queue_65 | #150 | r | #361 | {} |
queue_66 | #150 | r | #361 | {} |
queue_67 | #150 | r | #361 | {} |
queue_68 | #150 | r | #361 | {} |
queue_69 | #150 | r | #361 | {} |
queue_70 | #150 | r | #361 | {} |
queue_71 | #150 | r | #361 | {} |
queue_72 | #150 | r | #361 | {} |
queue_73 | #150 | r | #361 | {} |
queue_74 | #150 | r | #361 | {} |
queue_75 | #150 | r | #361 | {} |
queue_76 | #150 | r | #361 | {} |
queue_77 | #150 | r | #361 | {} |
queue_78 | #150 | r | #361 | {} |
queue_79 | #150 | r | #361 | {} |
queue_80 | #150 | r | #361 | {} |
queue_81 | #150 | r | #361 | {} |
queue_82 | #150 | r | #361 | {} |
queue_83 | #150 | r | #361 | {} |
queue_84 | #150 | r | #361 | {} |
queue_85 | #150 | r | #361 | {} |
queue_86 | #150 | r | #361 | {} |
queue_87 | #150 | r | #361 | {} |
queue_88 | #150 | r | #361 | {} |
queue_89 | #150 | r | #361 | {} |
queue_90 | #150 | r | #361 | {} |
queue_91 | #150 | r | #361 | {} |
queue_92 | #150 | r | #361 | {} |
queue_93 | #150 | r | #361 | {} |
queue_94 | #150 | r | #361 | {} |
queue_95 | #150 | r | #361 | {} |
queue_96 | #150 | r | #361 | {} |
queue_97 | #150 | r | #361 | {} |
queue_98 | #150 | r | #361 | {} |
queue_99 | #150 | r | #361 | {} |
queue_100 | #150 | r | #361 | {} |
queue_101 | #150 | r | #361 | {} |
queue_102 | #150 | r | #361 | {} |
queue_103 | #150 | r | #361 | {} |
queue_104 | #150 | r | #361 | {} |
queue_105 | #150 | r | #361 | {} |
queue_106 | #150 | r | #361 | {} |
queue_107 | #150 | r | #361 | {} |
queue_108 | #150 | r | #361 | {} |
queue_109 | #150 | r | #361 | {} |
queue_110 | #150 | r | #361 | {} |
queue_111 | #150 | r | #361 | {} |
queue_112 | #150 | r | #361 | {} |
queue_113 | #150 | r | #361 | {} |
queue_114 | #150 | r | #361 | {} |
queue_115 | #150 | r | #361 | {} |
queue_116 | #150 | r | #361 | {} |
queue_117 | #150 | r | #361 | {} |
queue_118 | #150 | r | #361 | {} |
queue_119 | #150 | r | #361 | {} |
queue_120 | #150 | r | #361 | {} |
queue_121 | #150 | r | #361 | {} |
queue_122 | #150 | r | #361 | {} |
queue_123 | #150 | r | #361 | {} |
queue_124 | #150 | r | #361 | {} |
queue_125 | #150 | r | #361 | {} |
queue_126 | #150 | r | #361 | {} |
queue_127 | #150 | r | #361 | {} |
queue_128 | #150 | r | #361 | {} |
queue_129 | #150 | r | #361 | {} |
queue_130 | #150 | r | #361 | {} |
queue_131 | #150 | r | #361 | {} |
queue_132 | #150 | r | #361 | {} |
queue_133 | #150 | r | #361 | {} |
queue_134 | #150 | r | #361 | {} |
queue_135 | #150 | r | #361 | {} |
queue_136 | #150 | r | #361 | {} |
queue_137 | #150 | r | #361 | {} |
queue_138 | #150 | r | #361 | {} |
queue_139 | #150 | r | #361 | {} |
queue_140 | #150 | r | #361 | {} |
queue_141 | #150 | r | #361 | {} |
queue_142 | #150 | r | #361 | {} |
queue_143 | #150 | r | #361 | {} |
queue_144 | #150 | r | #361 | {} |
queue_145 | #150 | r | #361 | {} |
queue_146 | #150 | r | #361 | {} |
queue_147 | #150 | r | #361 | {} |
queue_148 | #150 | r | #361 | {} |
queue_149 | #150 | r | #361 | {} |
queue_150 | #150 | r | #361 | {} |
queue_151 | #150 | r | #361 | {} |
queue_152 | #150 | r | #361 | {} |
queue_153 | #150 | r | #361 | {} |
stopped | #150 | rc | #361 | 0 |
last_beat | #150 | rc | #361 | 1337755489 |
stopped_areas | #150 | rc | #361 | 0 |
hearts_this_beat | #150 | rc | #361 | 1 |
heartnet | #150 | rc | #361 | #141109 |
creature_beats | #150 | rc | #361 | 1 |
monitor_beat | #150 | rc | #361 | 0 |
pending_monitor | #150 | rc | #361 | 0 |
beat_details | #150 | rc | #361 | {{#362, #366}, {#362, #56}, {#361, #366}, {#361, #56}} |
analyzed_normal | #150 | rc | #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 | #150 | rc | #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 | #150 | r | #361 | {#362} |
beat_interval | #150 | rc | #361 | 30 |
queue_154 | #150 | r | #361 | {} |
queue_155 | #150 | r | #361 | {} |
queue_156 | #150 | r | #361 | {} |
queue_157 | #150 | r | #361 | {} |
queue_158 | #150 | r | #361 | {} |
queue_159 | #150 | r | #361 | {} |
queue_160 | #150 | r | #361 | {} |
queue_161 | #150 | r | #361 | {} |
queue_162 | #150 | r | #361 | {} |
queue_163 | #150 | r | #361 | {} |
queue_164 | #150 | r | #361 | {} |
queue_165 | #150 | r | #361 | {} |
queue_166 | #150 | r | #361 | {} |
queue_167 | #150 | r | #361 | {} |
queue_168 | #150 | r | #361 | {} |
queue_169 | #150 | r | #361 | {} |
queue_170 | #150 | r | #361 | {} |
queue_171 | #150 | r | #361 | {} |
queue_172 | #150 | r | #361 | {} |
queue_173 | #150 | r | #361 | {} |
queue_174 | #150 | r | #361 | {} |
queue_175 | #150 | r | #361 | {#361} |
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 | "The Heart of God throbs inside its holding tank." |
value | #5 | rc | #361 | 400000 |
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 | "the" |
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 | {"Heart Of God"} |
description | #1 | rc | #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 | #1 | r | #29 | {106765, 1298433835} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | -1 |
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): #5 generic thing → #1 root
Children: none
Call graph
Showing 48 of 52 verbs; 4 not shown.
Source
register
Referenced by
- #6:confunc line 10:
$heart:register - #92:process_queue line 154:
$heart:register - #106:on_spawn line 1:
$heart:register - #107:initialize line 2:
$heart:register - #114:unhibernate line 6:
$heart:register - #134:_turn_on line 11:
$heart:register - #134:initialize line 1:
$heart:register - #150:register_all line 18:
this:register - #150:@h-check line 39:
this:register - #150:megacheck line 18:
this:register - #173:initialize line 2:
$heart:register - #209:initialize line 1:
$heart:register - #256:on_spawn line 1:
$heart:register - #306:setup line 5:
$heart:register
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
Referenced by
- #150:beat line 20:
this:service_queue
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
Referenced by
- #6:heartbeat line 17:
$heart:unregister - #105:creature_heartbeat line 4:
$heart:unregister - #106:heartbeat line 25:
$heart:unregister - #107:_wake line 20:
$heart:unregister - #107:recycle line 1:
$heart:unregister - #107:entomb line 2:
$heart:unregister - #114:hibernate line 6:
$heart:unregister - #134:_turn_off line 6:
$heart:unregister - #134:recycle line 1:
$heart:unregister - #134:entomb line 2:
$heart:unregister - #142:heartbeat line 11:
$heart:unregister - #173:recycle line 1:
$heart:unregister - #173:entomb line 2:
$heart:unregister - #186:enterfunc line 16:
$heart:unregister - #256:recycle line 1:
$heart:unregister - #256:entomb line 2:
$heart:unregister - #306:heartbeat line 2:
$heart:unregister - #306:recycle line 1:
$heart:unregister - #306:entomb line 2:
$heart:unregister - #366:creature_heartbeat line 4:
$heart:unregister
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
Referenced by
- #150:unregister line 8:
this:log - #150:unregister line 11:
this:log - #150:validate_queue line 7:
this:log - #150:validate_queue line 14:
this:log - #150:beat line 30:
this:log - #150:check line 1:
this:log - #150:check line 3:
this:log - #150:check line 14:
this:log - #150:register_long line 4:
this:log - #150:register_long line 7:
this:log - #150:unregister_long line 3:
this:log - #150:unregister_long line 5:
this:log - #150:service_long_queue line 5:
this:log - #150:service_long_queue line 34:
this:log
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
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
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
Referenced by
- #150:service_queue line 2:
this:validate_queue - #150:check line 12:
this:validate_queue - #150:service_queue_old line 3:
this:validate_queue
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
Referenced by
- #150:_beat line 11:
this:beat
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
Referenced by
- #150:_beat line 7:
this:_beat
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
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
Referenced by
- #150:check line 15:
this:tell_log
Source
1log = $lu:reverse(this.log); 2player:tell_lines(log[1..min(length(log), 40)]);
register_long
Referenced by
- #114:initialize line 2:
$heart:register_long - #150:register_all_long line 5:
this:register_long
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
Referenced by
- #114:recycle line 1:
$heart:unregister_long
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
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
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
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
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
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
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
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
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
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
Referenced by
- #150:beat line 32:
this:service_long_queue
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
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
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
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
Referenced by
- #150:_beat line 10:
this:skip_beat
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
Referenced by
- #150:register_all line 22:
this:compress_queues
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