wristpad #130
Aliases: wristpad
24 verbs · 42 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
init | this none none | rxd | #130 | 10 |
_page | this none this | rxd | #130 | 34 |
_receive | this none this | rxd | #130 | 34 |
match_wristpad | this none this | rxd | #130 | 14 |
throw toss | this any any | rxd | #130 | 1 |
stash | this none none | rxd | #130 | 1 |
switch | this at/to any | rxd | #130 | 10 |
ignore unignore | any on top of/on/onto/upon this | rxd | #130 | 27 |
ignored | none on top of/on/onto/upon this | rxd | #130 | 9 |
moveto | this none this | rxd | #130 | 5 |
look_self | this none this | rxd | #130 | 20 |
alarm | this is any | rxd | #130 | 15 |
alarm_check | this none this | rxd | #130 | 13 |
radio | any any any | rxd | #130 | 48 |
radio_receive | this none this | rxd | #130 | 6 |
give | this at/to any | rxd | #130 | 1 |
add_transaction | this none this | rxd | #130 | 12 |
check*book | this none none | rxd | #130 | 2 |
history | any any any | rxd | #130 | 45 |
can_send_long_message | this none this | rxd | #130 | 13 |
_init | this none this | rxd | #130 | 3 |
_do_check | this none this | rxd | #130 | 16 |
check*book | this for/about any | rxd | #130 | 7 |
on_spawn | this none this | rxd | #130 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
page_msg | #130 | rc | #361 | "%N taps on %p %t." |
page_receive_msg | #130 | rc | #361 | "From your %t: %n pages, '%message'" |
registered_user | #130 | rc | #361 | #-1 |
page_send_msg | #130 | rc | #361 | "You tap your text message to %dn into your %t." |
mode | #130 | rc | #361 | 0 |
ignore | #130 | rc | #361 | {} |
toggle_msg | #130 | rc | #361 | "%N toggles a switch on %p %t." |
transactions | #130 | rc | #361 | {} |
history_on | #130 | rc | #361 | 0 |
history_max | #130 | rc | #361 | 10 |
history | #130 | c | #361 | {} |
max_transactions | #130 | rc | #361 | 100 |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | "%DN extends %p wrist to look at %p %t." |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | 0 |
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 | {"wristpad"} |
description | #1 | rc | #361 | "A thick wristwatch with an integrated keyboard, speaker, and mini-LCD. A Freedom City credit chip is attached to the left side of the watch, with a few wires leading into your bare skin. You've had it your whole life, so you never really noticed until just now how disturbing and occasionally itchy that is." |
object_size | #1 | r | #29 | {20772, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | list of 5{"This wristpad is what you use to page messages to other players and talk on comm nets such as chatnet. It's not foolproof -- in some areas (like prison) the signal is blocked.", "", "To page another player, simply: 'page <person> <some text>'", "", "See also: 'help radio', 'help communication'"} |
weight | #1 | rc | #361 | 10 |
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
init
Referenced by
none
Source
1"Lock this wristpad to yourself, if it's not already."; 2if (this.location != player) 3player:tell("You're not holding ", this:dname(), "."); 4elseif ((this.registered_user == player) && (player.wristpad == this)) 5player:tell(this:dnamec(), " is already initialized to you."); 6else 7player:tell("You run the initialization sequence on ", this:dname(), " and set it up as your primary comm device."); 8this.registered_user = player; 9player.wristpad = this; 10endif
_page
Referenced by
none
Source
1who = args[1]; 2user = this.registered_user; 3if (length(args) > 1) 4msg = $su:from_list(args[2..$], " "); 5else 6msg = "BEEP"; 7endif 8msg = $su:escape(msg); 9if (is_a(who, $wristpad)) 10who:_receive(player, msg); 11return; 12endif 13if (is_player(who) && (!valid(who.wristpad))) 14user:tell("Your ", this:name(), " responds: 'Cannot connect to user.'"); 15else 16if (is_player(who)) 17if (is_a(who.wristpad, $wristpad)) 18if ((length(msg) > 250) && (!this:can_send_long_message(user, who))) 19msg = msg[1..250]; 20user:tell("Your page exceeded safety limits and has been downsized."); 21endif 22who.wristpad:_receive(user, msg); 23else 24user:tell("Hmmm. ", who:dnamec(), " seems completely absent from the comm network."); 25endif 26else 27`who:page_receive(user, msg) ! E_VERBNF => 0'; 28endif 29user:tell(((("You text '" + $ansi.bold_on) + msg) + $ansi.reset) + "' to ", who.name, " on your ", this.name, "."); 30if ((this.page_msg && (!who.programmer)) && (random(100) < 10)) 31argstr = "naughty naughty"; 32user.location:announce($su:ps(this.page_msg, user, this)); 33endif 34endif
_receive
Referenced by
none
Source
1{sender, text} = args; 2if ((this.mode > 0) || (player in this.ignore)) 3"Filtering is on"; 4if (!player.programmer) 5fork (1) 6player:tell("Your wristpad beeps. ", this.registered_user.name, " must be busy."); 7endfork 8return; 9endif 10endif 11m = this.page_receive_msg; 12m = strsub(m, "%t", this.name); 13if (is_a(sender, #109)) 14m = strsub(m, "%n", sender:real_name()); 15else 16m = strsub(m, "%n", sender:dname()); 17endif 18m = strsub(m, "%message", ($ansi.bold_on + text) + $ansi.reset); 19if (valid(this.location)) 20this.location:tell(m); 21if (this.history_on) 22this.history = {{sender, text, time()}, @this.history}; 23if (length(this.history) > this.history_max) 24this.history = this.history[1..this.history_max]; 25endif 26endif 27if (is_player(this.location) && (!(this.location in connected_players()))) 28if (is_a(sender, $player)) 29sender:tell("Your wristpad buzzes: Target is asleep. Please try another time."); 30endif 31elseif ((!is_a(sender, $immortal)) && is_a(this.location, $immortal)) 32sender:tell("Your wristpad buzzes: Target is asleep. Please try another time."); 33endif 34endif
match_wristpad
Referenced by
none
Source
1name = args[1]; 2if (name == "help") 3return $rpg.help_wristpad; 4endif 5if (name == "fcpd") 6return $rpg.fcpd_wristpad; 7endif 8if (valid(who = $su:match_player(name))) 9return who; 10elseif (valid(who = $rpg:match_wristpad(name, player))) 11return who; 12else 13return #-1; 14endif
throw toss
Referenced by
none
Source
1player:tell("You can't throw your wristpad. Sorry.");
stash
Referenced by
none
Source
1player:tell("You can't stash your wristpad. Sorry.");
switch
Referenced by
none
Source
1"Switch between 'normal' and 'filter'"; 2modenumber = iobjstr in {"normal", "filter"}; 3if (!modenumber) 4player:tell("Valid options are 'normal' and 'filter"); 5return; 6endif 7"I am dumb and made the modes zero-indexed."; 8modenumber = modenumber - 1; 9this.mode = modenumber; 10player:aat($su:ps(this.toggle_msg));
ignore unignore
Referenced by
none
Source
1"Add or remove a specific player from your wristpad's ignore list."; 2who = $su:match_player(dobjstr); 3if (!valid(who)) 4player:tell(verb, " who?"); 5return; 6endif 7if (who.programmer) 8player:tell("You cannot ignore ", who.name, "."); 9return; 10endif 11if (verb == "ignore") 12if (who in this.ignore) 13player:tell("You are already ignoring pages from ", who.name, "."); 14return; 15else 16this.ignore = setadd(this.ignore, who); 17player:tell(who:dnamec(), " added to ignore list."); 18endif 19else 20if (!(who in this.ignore)) 21player:tell("You are not ignoring pages from ", who.name, "."); 22return; 23else 24this.ignore = setremove(this.ignore, who); 25player:tell(who:dnamec(), " removed from ignore list."); 26endif 27endif
ignored
Referenced by
none
Source
1"List currently ignored players."; 2if (length(this.ignore) > 0) 3player:tell("Your wristpad lists the following ignored people:"); 4for p in (this.ignore) 5player:tell(p.name); 6endfor 7else 8player:tell("You are not ignoring anyone."); 9endif
moveto
Referenced by
none
Source
1where = args[1]; 2if (is_a(this.registered_user, $player) && (where != this.registered_user)) 3return 0; 4endif 5return pass(@args);
look_self
Referenced by
none
Source
1pass(@args); 2player:tell("A small glyph on the LCD shows the time: ", $ansi.bold_on, $time:ctime(), $ansi.bold_off, ". It is ", $time.day_segments[$time:day_segment()], "."); 3player:tell("In a corner of the clock readout, a tiny meter shows ", $ansi.bold_on, "lag: ", $ansi.reset, $flywheel:lagstr(), "."); 4if (this.alarm_time) 5player:tell("The alarm is set for ", $ansi.bold_on, $ansi.red, this.alarm_time, $ansi.reset, "."); 6endif 7if (this.radio_on) 8player:tell("The radio is on, tuned to code channel #", this.frequency, "."); 9else 10player:tell("The radio is off."); 11endif 12if (this.history_on) 13player:tell("The page history is on."); 14else 15player:tell("The page history is off."); 16endif 17if (valid(hol = $time:holiday_today())) 18player:tell("Oh hey -- it's ", hol.name, ". ", hol.description); 19endif 20player:tell("The credit chip's tiny display reads: ", $ansi.green, "$", $su:group_number(this.registered_user.credit), $ansi.reset, ".");
alarm
Referenced by
none
Source
1"Set an alarm in hh:mm 24-hour format."; 2ctim = iobjstr; 3if (((i = index(ctim, ":")) && (i > 1)) && (length(ctim) > i)) 4hh = toint(ctim[1..i - 1]); 5mm = toint(ctim[i + 1..$]); 6ctim = (hh > 9) ? "" | "0"; 7ctim = (ctim + tostr(hh)) + ":"; 8ctim = ctim + ((mm > 9) ? "" | "0"); 9ctim = ctim + tostr(mm); 10this.alarm_time = ctim; 11player:tell("You set your wristpad's alarm for ", $ansi.bold_on, $ansi.red, ctim, $ansi.reset, "."); 12player:aat(player:dnamec(), " taps a button on ", player.pp, " wristpad."); 13return; 14endif 15player:tell("Huh? Try giving a time in hh:mm 24-hour format (like 16:00 for 4pm).");
alarm_check
Referenced by
none
Source
1hhmm = $time:ctime()[12..15]; 2if (hhmm == this.alarm_time[1..$ - 1]) 3if (valid(this.location)) 4this.registered_user:tell(""); 5this.registered_user:tell($ansi.bold_on, "Your wristpad vibrates and beeps loudly. It's ", $ansi.red, this.alarm_time, $ansi.white, ".", $ansi.reset); 6endif 7who = this.registered_user; 8if (is_a(who.body, $body)) 9who = who.body; 10endif 11valid(who.location) && who.location:announce_all_but({who}, ((who:dnamec() + "'s ") + this.name) + " beeps loudly."); 12this.alarm_time = ""; 13endif
radio
Referenced by
none
Source
1"Configure the radio, eg. 'radio on', 'radio off', 'radio <frequency>', or 'radio key=mysecretkey'."; 2if (prepstr == "on") 3if (this.radio_on) 4player:tell("It's already on."); 5else 6this.radio_on = 1; 7player:tell("You turn on the radio on your wristpad."); 8endif 9elseif (prepstr == "off") 10if (!this.radio_on) 11player:tell("It's already off."); 12else 13this.radio_on = 0; 14player:tell("You turn off your wristpad radio."); 15endif 16elseif ((channel = toint(dobjstr)) > 0) 17if (!this.radio_on) 18player:tell("Your wristpad radio isn't turned on."); 19return; 20endif 21player:tell("You tune your wristpad radio to channel #", channel, "."); 22$radio:tune_out(this, this.frequency); 23this.frequency = channel; 24$radio:tune_in(this, channel); 25elseif ((length(argstr) >= 4) && (argstr[1..4] == "key=")) 26key = argstr[5..$]; 27if (!key) 28player:tell($su:ps("You remove the decryption key configuration from your %t.")); 29else 30player:tell($su:ps("You set the decryption key on your %t to '"), key, "'."); 31endif 32this.key = key; 33elseif (!dobjstr) 34if (!this.radio_on) 35player:tell("Your wristpad radio is off. Use 'radio on' to turn it on."); 36else 37player:tell("Your wristpad radio is tuned to frequency ", this.frequency, "."); 38if (this.key) 39player:tell("The decryption key is set to '", this.key, "'."); 40else 41player:tell("No decryption key is set."); 42endif 43endif 44else 45player:tell("Usage: radio <on|off> Turn the radio on or off."); 46player:tell(" radio <freq> Tune the radio to a specific frequency."); 47player:tell(" radio key=<key> Tune the radio to a specific encryption key."); 48endif
radio_receive
Referenced by
none
Source
1{freq, msg} = args; 2if (this.radio_on && valid(this.location)) 3if (freq == this.frequency) 4this.registered_user:tell("On your ", this:name(), " radio: ", $ansi.cyan, $su:decrypt(msg, this.key), $ansi.reset); 5endif 6endif
give
Referenced by
none
Source
1return player:tell("You can't give your ", this:name(), " away.");
add_transaction
Referenced by
none
Source
1{amount, target} = args; 2if (!gamevalid(target)) 3target_name = "unknown"; 4"return;"; 5else 6target_name = strsub(target:iname(), "generic ", ""); 7endif 8this.transactions = {@this.transactions, {amount, target_name, time()}}; 9n = this.max_transactions; 10if (length(this.transactions) > n) 11this.transactions = this.transactions[$ - (n - 1)..$]; 12endif
check*book
Referenced by
none
Source
1"List your 10 most recent credit transactions. Use 'check wrist for <number>' for more than 10."; 2this:_do_check(10);
history
Referenced by
none
Source
1"Toggle or view the page history, eg. 'history on', 'history off', 'history clear', or 'history'."; 2if (prepstr == "on") 3if (this.history_on) 4player:tell("Page history is already on."); 5else 6this.history_on = 1; 7player:tell("You turn on the page history on your wristpad."); 8endif 9elseif (prepstr == "off") 10if (!this.history_on) 11player:tell("Page history is already off."); 12else 13this.history_on = 0; 14player:tell("You turn off the page history on your wristpad."); 15endif 16elseif (dobjstr == "clear") 17if (!this.history) 18player:tell("Your wristpad page history is already empty."); 19return; 20endif 21this.history = {}; 22player:tell("You clear the page history on your wristpad."); 23elseif (!dobjstr) 24if (!this.history_on) 25player:tell("Your wristpad page history is off. Use 'history on' to turn it on."); 26endif 27if (!this.history) 28player:tell("Your wristpad page history is empty."); 29else 30player:tell("You check the page history on your wristpad."); 31for h in (this.history) 32if (length(h) > 2) 33ts = tostr($time_utils:longdate(h[3]), " ", $time_utils:ampm(h[3])); 34ts = tostr($ansi.cyan, ts, $ansi.reset); 35else 36ts = " unknown "; 37endif 38player:tell("[", ts, "] ", h[1].name, ": ", $ansi.bold_on, h[2], $ansi.reset); 39endfor 40endif 41else 42player:tell("Usage: history <on|off> Turn the page history on or off."); 43player:tell(" history clear Erase all saved pages."); 44player:tell(" history View your page history."); 45endif
can_send_long_message
Referenced by
- #130:_page line 18:
this:can_send_long_message
Source
1{from, to} = args; 2if ((!is_player(from)) || (!is_player(to))) 3return 1; 4elseif (from.programmer || to.programmer) 5return 1; 6elseif (from in to.friends) 7return 1; 8elseif ((is_a(from.party, $party) && is_a(to.party, $party)) && (from.party == to.party)) 9return 1; 10elseif ((is_a(from.employer, $biz) && is_a(to.employer, $biz)) && (from.employer == to.employer)) 11return 1; 12endif 13return 0;
_init
Referenced by
none
Source
1{who} = args; 2this.registered_user = who; 3who.wristpad = this;
_do_check
Referenced by
- #130:check*book line 2:
this:_do_check - #130:check*book line 7:
this:_do_check
Source
1{n} = args; 2player:tell($ansi.bold_on, "Most recent ", n, " credit transactions:", $ansi.reset); 3player:tell($ansi.bg_blue, $ansi.white, $ansi.bold_on, $ansi.underline_on, "Amount To When ", $ansi.reset); 4txns = this.transactions[max(1, $ - (n - 1))..$]; 5for x in (txns) 6{amt, who, t} = x; 7if (amt < 0) 8amt = ((($ansi.red + $ansi.bold_on) + "$") + $su:left(tostr(amt), -10)) + $ansi.reset; 9else 10amt = ((($ansi.green + $ansi.bold_on) + "$") + $su:left(tostr(amt), -10)) + $ansi.reset; 11endif 12who = (typeof(who) == OBJ) ? who:iname() | who; 13who = ($ansi.bold_on + $su:left(who, -30)) + $ansi.reset; 14t = $time:duration((time() - t) * 8) + " ago"; 15player:tell(amt, who, t); 16endfor
check*book
Referenced by
none
Source
1"List a specific number of transactions."; 2n = toint(iobjstr); 3if ((n < 1) || (n > this.max_transactions)) 4player:tell("Usage: check [<n>] -- n, if present, must be a number between 1 and ", this.max_transactions, "."); 5return; 6endif 7this:_do_check(n);
on_spawn
Referenced by
none
Source
1"lol";