flywheel #227

Parent #92Owner #361Flags readSource hellcore/hellcore.db

Aliases: flywheel, fly, wheel

9 verbs · 37 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
startthis none nonerxd#22710
squealthis none thisrxd#22722
_wwwthis none thisrxd#2271
look_selfthis none thisrxd#2272
lagstrthis none thisrxd#2273
beepwatchthis none thisrxd#22710
@unhearthis none nonerxd#22710
@hearthis none nonerxd#22710
server_startedthis none thisrxd#2275

Properties

PropertyDefinerFlagsOwnerValue
look_place_msg#227rc#361"An enormous flywheel is mounted vertically between two steel beams."
last_tick#227rc#3611337755516
action#227rc#361#180
cycle#227rc#3613
cycle_max#227rc#36130
blue#227rc#3610.2
yellow#227rc#3610.55
orange#227rc#3610.825
red#227rc#3611.5
ema#227rc#3612.918056650962856e-07
window_size#227rc#36130
prev_values#227rc#361
list of 30{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
valid_ema#227rc#3611
smoothing#227rc#3610.0645
made_noise#227rc#3610
current_reading#227rc#361"0.000"
beep_receivers#227rc#361{#361}
no_action_warn#227rc#3611
queue#92r#361{{#180, {}, 1, ""}}
preemptible#92r#3610
executing#92r#361{}
process_queue#92r#361243733785
help_msg#92rc#361<clear>
last_action#92r#361{#180, {}, 1, ""}
article#92rc#361<clear>
last_last_action#92rc#361{#180, {}, 1, ""}
action_count#92rc#361948002748
aliases#1r#362{"flywheel", "fly", "wheel"}
description#1rc#361"A huge ten-foot flywheel of some dark gray composite, suspended between two thick vertical steel beams. A gridwork of blue lasers shoots into the flywheel from various angles, bouncing beams off it in complex flickering patterns through small ampules of swirling gas."
object_size#1r#29{7250, 1298434471}
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): #92 generic actor#1 root

Children: none

Call graph

calls n227_0 #227:start n92_11 #92:is_doing n227_0->n92_11 n107_43 #107:tell n227_0->n107_43 n1_66 #1:announce_action_text n227_0->n1_66 n6_169 #6:dnamec n227_0->n6_169 n1_31 #1:dname n227_0->n1_31 n92_2 #92:queue_action n227_0->n92_2 n227_1 #227:squeal n227_1->n1_66 n227_5 #227:beepwatch n227_1->n227_5 n227_4 #227:lagstr n227_5->n227_4 n227_3 #227:look_self n227_3->n107_43 n1_9 #1:look_self n227_3->n1_9 n227_3->n227_4 n227_6 #227:@unhear n227_6->n107_43 n227_7 #227:@hear n227_7->n107_43

Source

start

Spec this none noneFlags rxdOwner #361Definer #227

Referenced by

none

Source

1if (!task_valid(this.process_queue))
2this.executing = {};
3endif
4if (this:is_doing(this.action))
5player:tell("It's already spinning -- you don't dare touch it.");
6return;
7endif
8player:aat(player:dnamec(), " throws the 'START' switch on ", this:dname(), ".");
9this.valid_ema = 0;
10this:queue_action(this.action, {});

squeal

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

none

Source

1if (this.ema < this.yellow)
2return;
3endif
4if (this.made_noise >= 2)
5return;
6endif
7if (this.ema >= this.red)
8this.location:broadcast_noise("You hear a %vol screech of metallic friction from %dir.", 7);
9this:beepwatch(2);
10this:aat("The flywheel spins and screeches madly, vibrating against the wall.");
11this.made_noise = 2;
12elseif ((this.ema >= this.orange) && (this.made_noise < 1))
13this.location:broadcast_noise("You hear a %vol metallic whine from %dir.", 5);
14this:beepwatch(1);
15this:aat("The flywheel whines.");
16this.made_noise = 1;
17elseif (this.made_noise < 1)
18this.location:broadcast_noise("A %vol high-pitched hum comes from %dir.", 3);
19this:beepwatch(1);
20this:aat("The flywheel hums at high speed.");
21this.made_noise = 1;
22endif

_www

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

none

Source

1return {"lag:" + floatstr(this.ema, 3)};

look_self

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

none

Source

1pass(@args);
2player:tell("A meter on one of the beams reads: ", $ansi.bold_on, this:lagstr(), $ansi.reset);

lagstr

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

Source

1lag = this.ema;
2color = (lag >= this.red) ? "red" | ((lag >= this.orange) ? "orange" | ((lag >= this.yellow) ? "yellow" | ((lag >= this.blue) ? "brightblue" | "green")));
3return tostr($ansi.(color), floatstr(lag, 3, 0), "s", $ansi.reset);

beepwatch

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

Source

1severe = args && (args[1] >= 2);
2for p in (this.beep_receivers)
3if (p.location != this.location)
4if (severe)
5p:tell($ansi.red, "Lag ", this:lagstr(), $ansi.red, ".", $ansi.reset);
6else
7p:tell($ansi.yellow, "Lag ", this:lagstr(), $ansi.yellow, ".", $ansi.reset);
8endif
9endif
10endfor

@unhear

Spec this none noneFlags rxdOwner #361Definer #227

Referenced by

none

Source

1if (!player.programmer)
2player:tell("Away with you!");
3return;
4endif
5if (player in this.beep_receivers)
6this.beep_receivers = setremove(this.beep_receivers, player);
7player:tell("You will no longer receive lag alerts.");
8else
9player:tell("You already weren't receiving lag alerts.");
10endif

@hear

Spec this none noneFlags rxdOwner #361Definer #227

Referenced by

none

Source

1if (!player.programmer)
2player:tell("Away with you!");
3return;
4endif
5if (player in this.beep_receivers)
6player:tell("You were already receiving lag alerts.");
7else
8this.beep_receivers = setadd(this.beep_receivers, player);
9player:tell("You will now receive lag alerts.");
10endif

server_started

Spec this none thisFlags rxdOwner #361Definer #227

Referenced by

none

Source

1if (caller != #0)
2raise(E_PERM);
3endif
4this.ema = 0.0;
5this.last_tick = time();