spawn stats tracker #283
Aliases: spawn stats tracker, stats, tracker, sst, plasma, screen
4 verbs · 35 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
watch_tell | this none this | rxd | #283 | 15 |
look_self | this none this | rxd | #283 | 26 |
reset | this none none | rxd | #283 | 30 |
turn | this any none | rxd | #283 | 32 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
show_top | #283 | rc | #361 | 50 |
last_reset | #283 | rc | #361 | 1271750258 |
watching | #283 | rc | #361 | 0 |
resetting | #283 | rc | #361 | 0 |
recycle_tracker | #283 | rc | #361 | #412149 |
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 | "A small plasma screen, tracking spawn counts, is attached to the ceiling on a mounting bracket." |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"spawn stats tracker", "stats", "tracker", "sst", "plasma", "screen"} |
description | #1 | rc | #361 | "A small grey plasma screen, on a mounting bracket attached to the ceiling. A small button is flush with the lower bezel, and a short lever protrudes from the right side." |
object_size | #1 | r | #29 | {5265, 1298434637} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rwc | #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
Source
watch_tell
Referenced by
- #0:bf_chparent line 31:
$sst:watch_tell - #0:bf_chparent line 32:
$sst:watch_tell
Source
1":watch_tell(STR plusorminus, STR name, OBJ parent, [OBJ location])"; 2if (!this.watching) 3return; 4endif 5{plusorminus, name, parent, ?loc = ""} = args; 6if (parent in {#-1, $garbage, $fossil}) 7return; 8endif 9propname = tostr("_", parent); 10tracker = (plusorminus == "-") ? this.recycle_tracker | this; 11if (!`oldval = tracker.(propname) ! E_PROPNF => 0') 12add_property(tracker, propname, 1, {#7195, "r"}); 13else 14tracker.(propname) = oldval + 1; 15endif
look_self
Referenced by
none
Source
1pass(@args); 2player:tell(""); 3player:tell("Counts since ", ctime(this.last_reset), ":"); 4player:tell(""); 5propvals = {}; 6for p in (properties(this)) 7if (p[1] == "_") 8propvals = {@propvals, {toobj(p[2..$]), this.(p)}}; 9endif 10$cu:sin(1, ($ansi.cyan + " [... Calculating ...]") + $ansi.reset); 11endfor 12showtop = min(this.show_top, length(propvals)); 13player:tell(($ansi.cyan + " [ ... sorting sst list ... ] ") + $ansi.reset); 14propvals = $lu:sort_alist_suspended(1, propvals, 2)[$ - (showtop - 1)..$]; 15propvals = $lu:reverse(propvals); 16rank = 0; 17for pv in (propvals) 18{parent, count} = pv; 19rank = rank + 1; 20rcount = `this.recycle_tracker.(tostr("_", parent)) ! E_PROPNF => 0'; 21delta = count - rcount; 22delta = (delta > 0) ? tostr("+", delta) | tostr(delta); 23player:tell(" ", $ansi.yellow, $su:right(tostr(rank, ". "), 5), $su:left($ansi.bold_on + $su:nn(parent), -33), $su:right($ansi.green + tostr("+", count), 8), $su:right($ansi.red + tostr("-", rcount), 8), $su:right($ansi.white + delta, 8), $ansi.reset); 24$cu:sin(); 25endfor 26player:tell("---");
reset
Referenced by
none
Source
1if (!player.wizard) 2player:tell("The lever won't budge."); 3return; 4endif 5if (this.watching) 6player:tell("The lever won't budge while the tracker is on."); 7return; 8endif 9if (this.resetting) 10player:tell("The lever is already down."); 11return; 12endif 13this.resetting = 1; 14this.location:announce_all($su:ps("%N reaches up and pulls down the lever on the side of %dt. Numbers begin to whir on the display.")); 15this.last_reset = time(); 16for p in (properties(this)) 17if (p[1] == "_") 18delete_property(this, p); 19endif 20$cu:sin(); 21endfor 22rtracker = this.recycle_tracker; 23for p in (properties(rtracker)) 24if (p[1] == "_") 25delete_property(rtracker, p); 26endif 27$cu:sin(); 28endfor 29this.location:announce_all($su:ps("The entries on %dt wink out, and the lever protruding from its side returns to its normal position.")); 30this.resetting = 0;
turn
Referenced by
none
Source
1player:tell("The button doesn't work right now."); 2return; 3turn_on = 0; 4if (prepstr == "on") 5turn_on = 1; 6elseif (prepstr != "off") 7player:tell("Try 'turn ", dobjstr, " on' or 'turn ", dobjstr, " off'."); 8return; 9endif 10if (turn_on) 11if (this.watching) 12player:tell("It's already on."); 13return; 14elseif (this.resetting) 15player:tell("It won't turn on while it's resetting itself."); 16return; 17else 18this.watching = 1; 19$recycler.watchers = setadd($recycler.watchers, this); 20this.location:announce_all($su:ps("%N presses the button on the front of %dt. The numbers begin to update.")); 21return; 22endif 23else 24if (!this.watching) 25player:tell("It's already off."); 26return; 27else 28this.watching = 0; 29$recycler.watchers = setremove($recycler.watchers, this); 30this.location:announce_all($su:ps("%N presses the button on the front of %dt, freezing the numbers displayed.")); 31endif 32endif