RPG Utilities #103

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

Aliases: RPG Utilities

51 verbs · 64 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
random_treasurethis none thisrxd#10356
spawnthis none thisrxd#10325
junkthis none thisrxd#1035
_ihmthis none thisrxd#1035
health_barthis none thisrxd#10327
angel_of_deaththis none thisrx#10319
notify_deaththis none thisrxd#10314
do_setupthis none thisrxd#10328
meat_reaperthis none thisrxd#10320
_meat_reaperthis none thisrxd#10311
_ihmthingthis none thisrxd#1035
draw_mapthis none thisrxd#10319
graphical_meternone none nonerxd#10319
string_shadethis none thisrxd#10320
_old_draw_mapthis none thisrxd#10351
color_code_meterthis none thisrxd#10310
describe_dirthis none thisrxd#10319
match_wristpadthis none thisrxd#1032
barthis none thisrxd#10329
describe_difficultythis none thisrxd#10315
clear_signs_forthis none thisrxd#1034
percent_ofthis none thisrxd#1035
describe_resultthis none thisrxd#10311
gbarthis none thisrxd#10328
report_errorthis none thisrxd#10352
health_meterthis none thisrxd#10328
draw_map_wwwthis none thisrxd#10390
get_html_iconthis none thisrxd#1039
gbar_forthis none thisrxd#1038
numbarthis none thisrxd#10315
tell_contents_subthis none thisrxd#10351
render_errorthis none thisrxd#10354
fill_bottlethis none thisrxd#10337
handle_aborted_taskthis none thisrxd#10366
describe_coord_dirthis none thisrxd#10350
handle_broken_heartthis none thisrxd#1035
damage_to_descthis none thisrxd#10314
log_callersthis none thisrxd#10316
handle_broken_areathis none thisrxd#1036
find_paththis none thisrxd#10318
describe_temperaturethis none thisrxd#10324
random_passwordthis none thisrxd#1039
direction_vectorthis none thisrxd#1038
set_recipesthis none thisrxd#1036
opposite_dirthis none thisrxd#1035
reachthis none thisrxd#10326
steps_betweenthis none thisrxd#10318
validthis none thisrxd#10313
meat_raperthis none thisrxd#10314
_scrub_stackthis none thisrxd#10312
mini_damagethis none thisrxd#1035

Properties

PropertyDefinerFlagsOwnerValue
help_msg#103rc#361{"Useful verbs:", "", ":random_treasure(OBJ parent, INT min_val, INT max_val)", " Spawn a random treasure item."}
map_keys#103rc#361{{#505, "outdoors"}, {#490, "street"}, {#489, "indoors"}}
heartbeat_interval#103rc#36130
allowable_actions#103rc#361
list of 9{"cocoon", "gifts", "medical", "rape", "sex", "suck", "tattoo", "teach", "visit"}
paramedic_interval#103rc#36160
stat#103rc#361#389
skill_improve_interval#103rc#36115
meat_reaper_time#103rc#361900
meat_reaper_task#103rc#361981992793
repeatable_actions#103rc#361{#108, #721, #12442, #322}
nomap_rooms#103rc#361{#47, #48, #130435}
exhaustion_threshold#103rc#361100
combat_speed#103rc#3611.3
hunger_chance#103rc#36135
difficulty_descs#103rc#361
list of 13{{0, "average"}, {-1, "tricky"}, {-2, "rough"}, {-3, "hard"}, {-4, "very hard"}, {-5, "daunting"}, {-6, "impossible"}, {-7, "absurd"}, {1, "routine"}, {2, "easy"}, {3, "very easy"}, {4, "trivial"}, {5, "a sure thing"}}
cardinals#103rc#361
list of 12{"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "up", "down", "in", "out"}
mini_damage_meters#103rc#361
list of 9{"'", "*", "# ", "#'", "#*", "##", "##'", "##*", "###"}
weather_ceiling#103rc#3611500
thirst_per_move#103rc#3612.0
thirst#103rc#361#1065
result_descs#103rc#361
list of 11{{0, "decent"}, {-1, "subpar"}, {-2, "shoddy"}, {-3, "piss-poor"}, {-4, "shit"}, {1, "fair"}, {2, "good"}, {3, "very good"}, {4, "great"}, {5, "sweet"}, {6, "kickass"}}
hunger#103rc#361#17323
nutrition#103rc#361#895
bugnet#103rc#361#356
lag#103rc#3611.0
allowable_area_settings#103rc#361{"blink", "blink_to", "phase", "phase_to", "combat", "sex"}
optimize_next_hops#103rc#3610
bots#103rc#361{#44969, #93227, #288702, #350199, #359878, #532697}
news#103rc#361#221210
shutdown_messages#103rc#361
list of 2{{"The air feels cold and prickly. What's happening?", "The world grows dim, and the wind picks up. You feel the crackle of eletricity on your fingertips.", ""}, {"", "The ground beneath you shakes and quivers, suddenly you notice your surroundings crackling into static and reforming themselves.", "You open your mouth to scream, but your throat and face are numb and distant. Is this the end...?"}}
final_shutdown_message#103rc#361{"It's all over."}
inactive_player_time#103rc#3612592000
heartnet#103rc#361#330
item_damage_descs#103rc#361{"in perfect condition", "a little dinged up", "slightly damaged", "seriously damaged", "completely destroyed"}
connected_players#103rc#361{#171054}
info_start#103rc#361"~1b[36m~1b[1m[ "
info_end#103rc#361" ]~1b[0m"
evil_msg#103rc#361
list of 15{"a mischief-maker", "a little naughty", "an anti-hero", "a troublemaker", "a mean bastard", "a vicious bastard", "a criminal", "a brutal killer", "a sociopath", "a monster", "an infamous monster", "Hitler", "worse than Hitler", "worse than a Hitler robot made of Stalins", "History's Greatest Monster"}
good_msg#103rc#361
list of 11{"okay", "kinda nice", "pretty cool", "good-hearted", "great-hearted", "noble", "a good samaritan", "a hero", "a legendary hero", "a savior", "the Greatest American Hero"}
always_clean_these#103rc#361
list of 11{#21740, #10261, #54442, #19073, #201072, #310169, #26001, #131025, #2730, #5578, #272282}
error_nets#103rc#361{{#305220, {#315620, #142689, #216326}}}
err_subs#103rc#361
list of 2{{E_VARNF, {"Variable has left town", "Variable lost in couch", "Variable is on vacation", "Variable has gone walkabout", "Variable decided shopping would be more fun", "Variable went to get its nails done"}}, {E_DIV, {"Black hole created"}}}
errors#103rc#361
list of 16{{"E_NONE", E_NONE}, {"E_TYPE", E_TYPE}, {"E_DIV", E_DIV}, {"E_PERM", E_PERM}, {"E_PROPNF", E_PROPNF}, {"E_VERBNF", E_VERBNF}, {"E_VARNF", E_VARNF}, {"E_INVIND", E_INVIND}, {"E_RECMOVE", E_RECMOVE}, {"E_MAXREC", E_MAXREC}, {"E_RANGE", E_RANGE}, {"E_ARGS", E_ARGS}, {"E_NACC", E_NACC}, {"E_INVARG", E_INVARG}, {"E_QUOTA", E_QUOTA}, {"E_FLOAT", E_FLOAT}}
last_best_time#103rc#3611311760926
checkpoint_announces#103rc#361
list of 31{"The world pauses in place for a split-second ... or did it?", "You blink. It takes a moment longer than usual.", "You swear the frame rate dropped just then... wait, what?", "Sixty seconds added to the clock. Go go go!", "Saving. Please do not turn off the MOO.", "Everything begins to glow around you, as you realize you have discovered the key to the meani-- oh wait, it was just the drugs again--", "The server bites! The server bites! The server bites! You checkpoint...", "You get a strange feeling of deja vu.", "The world grows dim, you feel your heart stop in your chest, and noises grow distant... and then you burp.", "Error reading disk in drive A:", "LOAD \"*\",8", "A horrible stench permeates your nostrils.", "How... how could this have happened?!", "Grab a beer every time you see this message.", "Buhhhh durrrrr.", "You sneeze. That feeling of relief seems to come half a second later.", "Your genitals swell for a fraction of a second.", "Did everything just freeze in place for a moment? That was odd.", "You could swear your surroundings flipped upside-down for just a moment.", "You get your left hand confused with your right. Ha, weird.", "You yawn, seized by a sudden lethargy.", "You get the curious feeling that you've never been here before.", "Your immersion breaks for a second...", "You hear a high pitched whine of disk platters spinning, far in the distance.", "Everything goes...pixelated? for a brief moment, then snaps back to reality.", "Things get all... FUNNY.", "It's dangerous outside. Take this.", "I have a bad feeling about this...", "You're, like... freakin' out, man.", "Oh.. oh god. They're everywhere! Crawling all over you! In your hair!", "They're coming up the god damn walls!"}
last_db_size#103rc#3618651227
last_db_delta#103rc#361-360884
last_reap_time#103rc#3611337755278
do_call_logs#103rc#3610
debug#103rc#3611
chargen#103rc#361#1438
features_for_everyone#103rc#361{#217820, #418728, #2473}
features_for_programmers#103rc#361{#65222}
world_start#103rc#3611301961600
aliases#1rc#361{"RPG Utilities"}
description#1rc#361<clear>
object_size#1r#29{81768, 1298433815}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rc#361<clear>
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #1 root

Children: none

Call graph

calls n103_0 #103:random_treasure n45_32 #45:fertile_branches n103_0->n45_32 n103_1 #103:spawn n103_0->n103_1 n57_2 #57:_create n103_1->n57_2 n103_24 #103:report_error n103_1->n103_24 n20_59 #20:name_and_number n103_1->n20_59 n103_24->n20_59 n47_17 #47:assoc n103_24->n47_17 n2_31 #2:tell n103_24->n2_31 n103_49 #103:_scrub_stack n103_24->n103_49 n103_4 #103:health_bar n20_0 #20:space n103_4->n20_0 n103_5 #103:angel_of_death n45_26 #45:leaves_suspended n103_5->n45_26 n107_43 #107:tell n103_5->n107_43 n103_7 #103:do_setup n103_7->n20_59 n103_7->n107_43 n20_38 #20:explode n103_7->n20_38 n48_2 #48:read n103_7->n48_2 n103_8 #103:meat_reaper n103_8->n20_59 n35_7 #35:english_time n103_8->n35_7 n103_9 #103:_meat_reaper n103_9->n103_8 n103_9->n103_9 n103_12 #103:graphical_meter n103_12->n103_4 n103_18 #103:bar n103_12->n103_18 n103_18->n20_0 n103_14 #103:_old_draw_map n45_2 #45:has_verb n103_14->n45_2 n48_8 #48:suspend_if_needed n103_14->n48_8 n103_15 #103:color_code_meter n103_28 #103:gbar_for n103_15->n103_28 n103_23 #103:gbar n103_28->n103_23 n103_29 #103:numbar n103_28->n103_29 n103_17 #103:match_wristpad n44_0 #44:match n103_17->n44_0 n103_20 #103:clear_signs_for n103_20->n45_26 n18_42 #18:rint n103_23->n18_42 n103_25 #103:health_meter n103_25->n20_0 n103_26 #103:draw_map_www n103_26->n45_2 n103_26->n48_8 n103_27 #103:get_html_icon n103_26->n103_27 n103_27->n48_8 n20_50 #20:char_list n103_27->n20_50 n18_27 #18:base_conversion n103_27->n18_27 n20_65 #20:to_ASCII n103_27->n20_65 n103_30 #103:tell_contents_sub n103_30->n45_2 n20_85 #20:english_weight_short n103_30->n20_85 n20_80 #20:aggregate_number n103_30->n20_80 n6_121 #6:tell_item_list n103_30->n6_121 n103_31 #103:render_error n103_31->n20_59 n20_1 #20:left n103_31->n20_1 n20_2 #20:right n103_31->n20_2 n103_32 #103:fill_bottle n103_32->n45_2 n103_32->n48_8 n103_33 #103:handle_aborted_task n103_33->n20_59 n103_33->n48_8 n103_33->n103_49 n103_33->n103_31 n103_33->n20_1

Showing 48 of 60 verbs; 12 not shown.

Source

random_treasure

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":random_treasure(OBJ parent, INT min_value, INT max_value)";
2"Find an appropriate treasure object, spawn a child, and return it.";
3"Return #-1 if we couldn't find an appropriate parent.";
4{parent, min_val, max_val} = args;
5p = {};
6special_drop = 0;
7dont_care = is_a(parent, #664);
8if ((parent == $treasure) && this.special_event_treasure)
9if ((min_val <= 101) && (max_val >= 101))
10if (random(100) <= this.special_event_drop_chance)
11special_drop = 1;
12endif
13endif
14endif
15if (special_drop)
16o = this.special_event_treasure[random($)];
17if (o.f && children(o))
18branches = {o, @$ou:fertile_branches(o)};
19else
20p = {o};
21endif
22elseif (parent == $treasure)
23branches = $rpg.treasure_cache;
24else
25branches = {parent, @$ou:fertile_branches(parent)};
26endif
27if (!p)
28for x in (branches)
29yield;
30if ((length(x.name) > 8) && (x.name[1..8] == "generic "))
31continue;
32elseif (special_drop)
33p = setadd(p, x);
34elseif (`x.no_random_spawn ! ANY' && (x != parent))
35continue;
36else
37val = x.value;
38if ((val < min_val) || (val > max_val))
39continue;
40endif
41p = setadd(p, x);
42endif
43endfor
44endif
45if (p)
46p = p[random($)];
47child = $rpg:spawn(p);
48if ((typeof(child) == OBJ) && valid(child))
49return child;
50else
51$nets.heartnet:sys_announce("-- $rpg:spawn returned a fucked value in random_treasure: " + tostr(child));
52return #-1;
53endif
54else
55return #-1;
56endif

spawn

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1what = args[1];
2who = #29;
3if (!valid(what))
4raise(E_INVARG);
5elseif (!what.f)
6raise(E_INVARG, tostr(what, " is not +f"));
7endif
8spawn = $recycler:_create(what, who);
9if (valid(spawn))
10$recycler.stat_spawn = $recycler.stat_spawn + 1;
11"  $wiz_utils:set_owner(spawn, #984)";
12spawn:set_name(strsub(what.name, "generic ", ""));
13spawn:set_aliases({spawn.name, @what.aliases});
14if (spawn.name in what.aliases)
15clear_property(spawn, "aliases");
16endif
17if (has_callable_verb(spawn, "on_spawn"))
18try
19spawn:on_spawn();
20except e (ANY)
21$rpg:report_error(e, {"Error in :on_spawn for " + $su:nn(what)});
22endtry
23endif
24endif
25return spawn;

junk

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1{what, ?fake = 0} = args;
2if (`what:junk_ok() ! E_VERBNF')
3fake || move(what, $tomb);
4return 1;
5endif

_ihm

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1m = args[1];
2who = args[2];
3m = strsub(m, "%dd's", who.pp);
4m = strsub(m, "%dd", who.po);
5return m;

health_bar

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":health_bar(INT health, INT health_max, INT damage, STR health_color, STR damage_color)";
2"Draw and return a health bar showing the given damage, or just the health if damage = 0.";
3health = args[1];
4health_max = args[2];
5maxlen = health_max / 2;
6r = args[3];
7health_color = (length(args) > 3) ? args[4] | $ansi.green;
8damage_color = (length(args) > 4) ? args[5] | $ansi.red;
9if (health < 1)
10meter = (((((($ansi.bold_on + "[") + damage_color) + $su:space(min(health_max, 80) / 2, "*")) + $ansi.reset) + $ansi.bold_on) + "]") + $ansi.reset;
11else
12if (r < 0)
13remain = min(80, health + r);
14adamage = -r;
15dstr = ((health_color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
16else
17remain = min(80, health);
18adamage = r;
19dstr = ((damage_color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
20endif
21empty = min(80, (health_max - remain) - adamage);
22if ((((empty / 2) + (remain / 2)) + (adamage / 2)) < maxlen)
23empty = empty + 2;
24endif
25meter = ((((((($ansi.bold_on + "[") + health_color) + $su:space(remain / 2, "|")) + dstr) + $su:space(empty / 2, " ")) + $ansi.bold_on) + "]") + $ansi.reset;
26endif
27return meter;

angel_of_death

Spec this none thisFlags rxOwner #361Definer #103

Referenced by

none

Source

1patients_per_slice = 50;
2seconds_per_slice = 2;
3num_patients = length(patients = $ou:leaves_suspended($creature));
4patients_this_slice = 0;
5for x in (patients)
6if (!x.f)
7x:_heartbeat_stop();
8endif
9patients_this_slice = patients_this_slice + 1;
10if (patients_this_slice == patients_per_slice)
11suspend(seconds_per_slice);
12endif
13endfor
14for x in (queued_tasks())
15if (x[7] == "_heartbeat")
16kill_task(x[1]);
17endif
18endfor
19player:tell("DONE");

notify_death

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1who = args[1];
2killer = args[2];
3"fork (0)";
4"  for x in ($ou:leaves(#291057))";
5"    `x:notify_death(who, killer) ! ANY => 0';";
6"  endfor";
7"  if (is_a(killer, $player) && is_a(who, $creature))";
8"    for faction in (who.factions)";
9"      if (typeof(faction) == LIST)";
10"        `faction[1]:change_reputation(killer, faction[2]) ! ANY => 0';";
11"      endif";
12"    endfor";
13"  endif";
14"endfork";

do_setup

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":do_setup(WHAT obj)";
2"Run GM interactive setup on an object, based on its .setup_list.";
3what = args[1];
4player:tell($ansi.cyan + $ansi.bold_on, "[ Setting up ", $su:nn(what), ". Hit enter to keep old values. ]", $ansi.reset);
5for x in (what.setup_list)
6x = $su:explode(x, ",");
7prop = x[1];
8desc = x[2];
9default = what.(prop);
10type = {"integer", "object", "string", "", "list", "", "", "", "", "", "float"}[typeof(default) + 1];
11val = $cu:read(tostr("Enter ", desc, " (now: ", default, ") (type: ", type, ")"));
12if (val == "")
13val = default;
14endif
15if (typeof(default) == INT)
16val = toint(val);
17elseif (typeof(default) == FLOAT)
18val = tofloat(val);
19elseif (typeof(default) == OBJ)
20val = toobj(val);
21if (val == #0)
22val = #-1;
23endif
24endif
25what.(prop) = (val == "") ? default | val;
26player:tell(" ", $ansi.cyan, tostr(what), ".", prop, " = ", toliteral(what.(prop)), $ansi.reset);
27endfor
28player:tell($ansi.cyan + $ansi.bold_on, "[ Setup complete. ]", $ansi.reset);

meat_reaper

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1$nets.tasknet:_announce(#-1, ("meat reaper starting -- last run " + $tu:english_time(time() - this.last_reap_time)) + " ago", 1);
2this.last_reap_time = rt = time();
3foods = {$food};
4while (foods)
5{food, @foods} = foods;
6if (kids = children(food))
7foods = {@kids, @foods};
8else
9if (food.f)
10if (food.rot)
11$nets.tasknet:_announce(#-1, ("fixing " + $su:nn(food)) + " that had rotted", 1);
12food.rot = 0;
13endif
14else
15(gamevalid(food) && food.rot_chance) && food:rot_check();
16endif
17endif
18yield 3;
19endwhile
20$nets.tasknet:_announce(#-1, "meat reaper finished: run time was " + $tu:english_time(time() - rt), 1);

_meat_reaper

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1if ($stop_everything)
2return;
3endif
4if (!task_valid(this.meat_reaper_task))
5fork taskid (this.meat_reaper_time)
6this.meat_reaper_task = 0;
7this:_meat_reaper();
8endfork
9this.meat_reaper_task = taskid;
10this:meat_reaper();
11endif

_ihmthing

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1m = args[1];
2who = args[2];
3m = strsub(m, "%dd's", "its");
4m = strsub(m, "%dd", "it");
5return m;

draw_map

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1where = args[1];
2width = args[2];
3height = args[3];
4iconverb = (length(args) > 3) ? args[4] | "";
5blankicon = (length(args) > 4) ? args[5] | 0;
6includeposition = (length(args) > 5) ? args[6] | 1;
7includelinks = (length(args) > 6) ? args[7] | 1;
8{normal_map, client_map} = where:_render_map(width, height, iconverb, blankicon, includeposition, includelinks);
9lines = {};
10for y in (normal_map)
11line = "";
12for x in (y)
13line = line + x;
14yield;
15endfor
16lines = listappend(lines, line);
17yield;
18endfor
19return lines;

graphical_meter

Spec none none noneFlags rxdOwner #29Definer #103

Referenced by

none

Source

1"$rpg:graphical_meter(int LEVEL, int MAX, int BAR LENGTH[, INT delta, STR color1, STR color2, INT type]) this none this";
2"DO NOT CALL THIS VERB DIRECTLY. Use $rpg:gbar_for or $meter_utils:bar_for instead. Using this alone will ignore the player's meters pref.";
3level = args[1];
4max = args[2];
5bar_length = args[3];
6dmg = (length(args) > 3) ? args[4] | 0;
7c1 = (length(args) > 4) ? args[5] | $ansi.green;
8c2 = (length(args) > 5) ? args[6] | $ansi.red;
9type = (length(args) > 6) ? args[7] | 0;
10if (max)
11value = (bar_length * level) / max;
12if (type == 0)
13return $rpg:health_bar(value, bar_length, dmg, c1, c2);
14else
15return $rpg:bar(value, bar_length, dmg, c1, c2);
16endif
17else
18return (($ansi.red + $ansi.bold_on) + "[ERROR]") + $ansi.reset;
19endif

string_shade

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1string = args[1];
2boldend = args[2];
3len = length(string);
4val = args[3];
5maxval = args[4];
6color1 = args[5];
7color2 = args[6];
8o = $ansi.bold_on + color1;
9valperchar = tofloat(maxval) / tofloat(len);
10for x in [1..len]
11if ((tofloat(x) * valperchar) > tofloat(val))
12o = o + color2;
13endif
14o = o + string[x];
15if (x >= boldend)
16o = o + $ansi.bold_off;
17endif
18endfor
19o = o + $ansi.reset;
20return o;

_old_draw_map

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1"Copied from RPG Utilities (#272):draw_map by Gilmore (#98) Sat Mar  5 22:35:58 2005 PST";
2if (length(args) == 3)
3{where, maxx, maxy} = args;
4iconverb = "";
5else
6{where, maxx, maxy, iconverb} = args;
7endif
8midx = (maxx / 2) + 1;
9midy = (maxy / 2) + 1;
10blankrow = {};
11rows = {};
12blankicon = where:area().blank_icon;
13for x in [1..maxx]
14blankrow = {@blankrow, blankicon};
15endfor
16for x in [1..maxy]
17rows = {@rows, blankrow};
18endfor
19homex = where.x;
20homey = where.y;
21homez = where.z;
22for area in ({a1 = where:area(), @a1.contiguous_map})
23offset = (area == a1) ? {0, 0, 0} | a1.contiguous_map_offsets[area in a1.contiguous_map];
24for room in (area.contents)
25relx = ((room.x - homex) + midx) + offset[1];
26rely = ((room.y - homey) + midy) + offset[2];
27if (room.z == (homez + offset[3]))
28if ((relx > 0) && (relx <= maxx))
29if ((rely > 0) && (rely <= maxy))
30if (iconverb)
31result = $ou:has_verb(room, iconverb) ? room:(iconverb)() | room:_icon();
32else
33result = room:_icon();
34endif
35rows[rely][relx] = result;
36endif
37endif
38endif
39$cu:sin(0);
40endfor
41endfor
42rows[midy][midx] = ((($ansi.bg_blue + $ansi.cyan) + $ansi.bold_on) + "()") + $ansi.reset;
43strs = {};
44for row in (rows)
45s = "";
46for x in (row)
47s = s + x;
48endfor
49strs = {@strs, s};
50endfor
51return strs;

color_code_meter

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1{who, val, max, len} = args;
2if (val <= (max / 3))
3c = $ansi.red;
4elseif (val <= ((max / 3) * 2))
5c = $ansi.yellow;
6else
7c = $ansi.green;
8endif
9"return $rpg:graphical_meter(val, max, len, 0, c, c);";
10return $rpg:gbar_for(who, val, max, len, 0, c, c);

describe_dir

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1{l1, l2} = args;
2if (typeof(l1) == OBJ)
3x1 = l1.x;
4y1 = l1.y;
5else
6x1 = l1[1];
7y1 = l1[2];
8endif
9if (typeof(l2) == OBJ)
10x2 = l2.x;
11y2 = l2.y;
12else
13x2 = l2[1];
14y2 = l2[2];
15endif
16xdif = x2 - x1;
17ydif = y2 - y1;
18ratio = tofloat(ydif) / tofloat(xdif);
19return {xdif, ydif, ratio};

match_wristpad

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1name = args[1];
2return $match_utils:match(name, children(#9343));

bar

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1"This is a simpler version of $rpg:health_bar";
2":bar(INT value, INT mmax, INT delta, STR color, STR delta_color)";
3"Draw and return a bar showing the given values";
4"DO NOT USE. THIS VERB DOES NOT RESPECT THE METERS PREF. USE $meter_utils:bar_for OR $rpg:gbar_for INSTEAD.";
5value = args[1];
6mmax = args[2];
7maxlen = mmax / 2;
8delta = args[3];
9color = (length(args) > 3) ? args[4] | $ansi.green;
10delta_color = (length(args) > 4) ? args[5] | $ansi.red;
11if (value < 1)
12meter = (((((($ansi.bold_on + "[") + delta_color) + $su:space(min(mmax, 80) / 2, " ")) + $ansi.reset) + $ansi.bold_on) + "]") + $ansi.reset;
13else
14if (delta < 0)
15remain = min(80, value + delta);
16adamage = -delta;
17dstr = ((color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
18else
19remain = min(80, value);
20adamage = delta;
21dstr = ((delta_color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
22endif
23empty = min(80, (mmax - remain) - adamage);
24if ((((empty / 2) + (remain / 2)) + (adamage / 2)) < maxlen)
25empty = empty + 2;
26endif
27meter = ((((((($ansi.bold_on + "[") + color) + $su:space(remain / 2, "|")) + dstr) + $su:space(empty / 2, " ")) + $ansi.bold_on) + "]") + $ansi.reset;
28endif
29return meter;

describe_difficulty

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1d = args[1];
2if (length(args) > 1)
3skill = args[2];
4d = d + (skill - 10);
5endif
6for x in (this.difficulty_descs)
7if (x[1] == d)
8return x[2];
9endif
10endfor
11if (d < -1)
12return "ludicrous";
13else
14return "guaranteed";
15endif

clear_signs_for

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1who = args[1];
2for x in ($ou:leaves_suspended($sign))
3x.seen = setremove(x.seen, who);
4endfor

percent_of

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1part = args[1];
2total = args[2];
3pct = tofloat(part) / tofloat(total);
4pct = toint(pct * 100.0);
5return pct;

describe_result

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1d = args[1];
2for x in (this.result_descs)
3if (x[1] == d)
4return x[2];
5endif
6endfor
7if (d < -1)
8return "horrendous";
9else
10return "perfect";
11endif

gbar

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1"DO NOT CALL THIS VERB DIRECTLY. Use $rpg:gbar_for or $meter_utils:bar_for instead. Using this alone will ignore the player's meters pref.";
2max = args[2];
3level = min(max, args[1]);
4length = args[3];
5delta = (length(args) > 3) ? args[4] | 0;
6delta = abs(delta);
7c1 = (length(args) > 4) ? args[5] | $ansi.green;
8c2 = (length(args) > 5) ? args[6] | $ansi.red;
9s = ($ansi.bold_on + $ansi.white) + "[";
10gs = tofloat(length) * (tofloat(level) / tofloat(max));
11gs = toint($math_utils:rint(gs));
12ds = tofloat(length) * (tofloat(delta) / tofloat(max));
13ds = toint($math_utils:rint(ds));
14"gs = gs - ds;";
15bs = length - (gs + ds);
16s = s + c1;
17for x in [1..gs]
18s = s + "|";
19endfor
20s = s + c2;
21for x in [1..ds]
22s = s + "*";
23endfor
24for x in [1..bs]
25s = s + " ";
26endfor
27s = (((s + $ansi.white) + $ansi.bold_on) + "]") + $ansi.reset;
28return s;

report_error

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1"$rpg:report_error(exception, [furtherinfo], [net])";
2"When you catch an exception using try-except-endtry, you can send the caught exception variable directly to this function, which will send a traceback to bugnet (a broadcast object). If there is further info you'd like to go with the traceback, you can also provide 'furtherinfo', which can be a string or a list of strings.";
3"For more information, read #115646, a note.";
4{e, ?further = {}, ?net = this.bugnet} = args;
5{errcode, msg, value, traceback} = e;
6try
7if (errsub = $lu:assoc(errcode, this.err_subs))
8msg = errsub[2][random($)];
9endif
10except e (ANY)
11$archwiz:tell("errsub: ", e[1]);
12endtry
13traceback = this:_scrub_stack(traceback);
14top = traceback[1];
15line = tostr($su:nn(top[4]), ":", top[2], @(top[1] != top[4]) ? {" (this == ", $su:nn(top[1]), ")"} | {}, ", line ", top[6], ": ", msg);
16net:announce(#-1, line, 1);
17if (value)
18line = "  thrown error value: " + toliteral(value);
19if (length(line) > 60)
20line = line[1..57] + "...";
21endif
22net:announce(#-1, line, 1);
23endif
24brokencode = `verb_code(top[4], top[2])[top[6]] ! ANY => ""';
25vloc = top[4];
26for redirect in (this.error_nets)
27{rnet, rtrees} = redirect;
28for parent in (rtrees)
29if (is_a(vloc, parent))
30net = rnet;
31break;
32endif
33endfor
34yield;
35endfor
36if (brokencode)
37net:announce(#-1, tostr("  ", brokencode), 1);
38endif
39for fr in (traceback[2..$])
40line = tostr("... called from ", $su:nn(fr[4]), ":", fr[2], @(fr[1] != fr[4]) ? {" (this == ", $su:nn(fr[1]), ")"} | {}, ", line ", fr[6]);
41net:announce(#-1, line, 1);
42endfor
43if (further)
44if (typeof(further) == LIST)
45for l in (args[2])
46net:announce(#-1, l, 1);
47endfor
48else
49net:announce(#-1, args[2], 1);
50endif
51endif
52`net:cleanup() ! ANY => 0';

health_meter

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1"Copied from RPG Utilities (#272):health_bar by Gilmore (#98) Fri Jan 19 11:21:42 2007 PST";
2":health_meter(INT health, INT health_max, INT damage, OBJ who, [STR health_color], [STR damage_color])";
3"Draw and return a health bar showing the given damage, or just the health if damage = 0.";
4health = args[1];
5health_max = args[2];
6maxlen = health_max / 2;
7r = args[3];
8health_color = (length(args) > 3) ? args[4] | $ansi.green;
9damage_color = (length(args) > 4) ? args[5] | $ansi.red;
10if (health < 1)
11meter = (((((($ansi.bold_on + "[") + damage_color) + $su:space(min(health_max, 80) / 2, "*")) + $ansi.reset) + $ansi.bold_on) + "]") + $ansi.reset;
12else
13if (r < 0)
14remain = min(80, health + r);
15adamage = -r;
16dstr = ((health_color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
17else
18remain = min(80, health);
19adamage = r;
20dstr = ((damage_color + $ansi.bold_on) + $su:space(adamage / 2, "*")) + $ansi.reset;
21endif
22empty = min(80, (health_max - remain) - adamage);
23if ((((empty / 2) + (remain / 2)) + (adamage / 2)) < maxlen)
24empty = empty + 2;
25endif
26meter = ((((((($ansi.bold_on + "[") + health_color) + $su:space(remain / 2, "|")) + dstr) + $su:space(empty / 2, " ")) + $ansi.bold_on) + "]") + $ansi.reset;
27endif
28return meter;

draw_map_www

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1"Copied from RPG Utilities (#272):draw_map by Satan (#2) Thu Feb 15 02:54:23 2007 CST";
2if (length(args) == 3)
3{where, maxx, maxy} = args;
4iconverb = "";
5else
6{where, maxx, maxy, iconverb} = args;
7endif
8midx = (maxx / 2) + 1;
9midy = (maxy / 2) + 1;
10blankrow = {};
11blanklink = {};
12rows = {};
13links = {};
14homex = where.x;
15homey = where.y;
16homez = where.z;
17for y in [1..maxy]
18blankrow = {};
19for x in [1..maxx]
20thisx = (homex + x) - midx;
21thisy = (homey + y) - midy;
22blankicon = where:area().blank_icon;
23for b in (where:area().icon_blocks)
24$cu:sin();
25if (b[1] == homez)
26if ((((b[2] <= thisx) && (b[4] >= thisx)) && (b[3] <= thisy)) && (b[5] >= thisy))
27blankicon = b[6];
28endif
29endif
30endfor
31blankrow = {@blankrow, blankicon};
32blanklink = {@blanklink, ""};
33endfor
34rows = {@rows, blankrow};
35links = {@links, blanklink};
36endfor
37for x in (where:area().area_link_icons)
38if (x[1].icon)
39relx = (x[2] - homex) + midx;
40rely = (x[3] - homey) + midy;
41if (x[4] == homez)
42if ((relx > 0) && (relx <= maxx))
43if ((rely > 0) && (rely <= maxy))
44rows[rely][relx] = x[1].icon;
45endif
46endif
47endif
48endif
49endfor
50for area in ({a1 = where:area(), @a1.contiguous_map})
51offset = (area == a1) ? {0, 0, 0} | a1.contiguous_map_offsets[area in a1.contiguous_map];
52for room in (area.contents)
53relx = ((room.x - homex) + midx) + offset[1];
54rely = ((room.y - homey) + midy) + offset[2];
55if (room.z == (homez + offset[3]))
56if ((relx > 0) && (relx <= maxx))
57if ((rely > 0) && (rely <= maxy))
58if (iconverb)
59result = $ou:has_verb(room, iconverb) ? room:(iconverb)() | room:_icon();
60else
61result = room:_icon();
62endif
63rows[rely][relx] = result;
64links[rely][relx] = tostr(tonum(room));
65endif
66endif
67endif
68$cu:sin(0);
69endfor
70endfor
71strs = {};
72row_i = 0;
73for row in (rows)
74x_i = 0;
75row_i = row_i + 1;
76s = "";
77for x in (row)
78x_i = x_i + 1;
79if (links[row_i][x_i])
80x_icon = ((("<a href=\"/" + links[row_i][x_i]) + "\">") + $rpg:get_html_icon(x)) + "</a>";
81else
82x_icon = $rpg:get_html_icon(x);
83endif
84s = s + x_icon;
85endfor
86s = s + "<br>";
87strs = {@strs, s};
88endfor
89$cu:sin(0);
90return strs;

get_html_icon

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1icon = args[1];
2retval = "";
3icon_chars = $su:char_list(icon);
4for c in (icon_chars)
5$cu:sin();
6retval = retval + tostr("%" + tostr($math_utils:base_conversion($su:to_ASCII(c), 16, 10)));
7endfor
8"retval = (\"<img src=\\\"http://pipboy.us/~rick/icon.php?icon=\" + retval) + \"\\\" border=\\\"0\\\">\";";
9return retval;

gbar_for

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1who = args[1];
2if (who:check_pref("meterboth"))
3return (this:gbar(@args[2..$]) + " ") + this:numbar(@args[2..$]);
4elseif (who:check_pref("meters"))
5return this:gbar(@args[2..$]);
6else
7return this:numbar(@args[2..$]);
8endif

numbar

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1level = args[1];
2max = args[2];
3length = args[3];
4delta = (length(args) > 3) ? args[4] | 0;
5delta = -delta;
6c1 = (length(args) > 4) ? args[5] | $ansi.green;
7c2 = (length(args) > 5) ? args[6] | $ansi.red;
8s = ($ansi.bold_on + $ansi.white) + "[ ";
9if (delta > 0)
10s = ((((s + c1) + "+") + tostr(delta)) + " ") + $ansi.reset;
11elseif (delta < 0)
12s = (((s + c2) + tostr(delta)) + " ") + $ansi.reset;
13endif
14s = ((((((s + $ansi.bold_on) + tostr(level)) + "/") + tostr(max)) + " ") + "]") + $ansi.reset;
15return s;

tell_contents_sub

Spec this none thisFlags rxdOwner #29Definer #103

Referenced by

none

Source

1items = {};
2names = {};
3who = args[1];
4things = args[2];
5title = (length(args) > 2) ? args[3] | "";
6showweight = who:check_pref("weights");
7for what in (things)
8if (is_a(what, $decal))
9things = setremove(things, what);
10endif
11endfor
12total_weight = 0;
13if (things)
14for what in (things)
15added = 0;
16iname = what:iname();
17tag = $ou:has_verb(who, "inventory_tag") ? who:inventory_tag(what) | "";
18if (showweight)
19iname = ((((iname + $ansi.cyan) + " [") + $su:english_weight_short(weight = x:weight())) + "]") + $ansi.reset;
20total_weight = total_weight + weight;
21endif
22if (msg_db)
23for y in [1..length(msg_db)]
24if (msg_db[y][2] == iname)
25msg_db[y][3] = msg_db[y][3] + 1;
26msg_db[y][1] = setadd(msg_db[y][1], x);
27added = 1;
28endif
29endfor
30endif
31if (!added)
32msg_db = setadd(msg_db, {{x}, iname, 1});
33endif
34endfor
35for x in (msg_db)
36if (x[3] > 1)
37name = ($string_utils:aggregate_number(x[3]) + " ") + x[1][1]:plural_name();
38if (weights)
39wt = 0;
40for z in (x[1])
41wt = wt + z:weight();
42endfor
43name = ((((name + $ansi.cyan) + " [") + $su:english_weight_short(wt)) + "]") + $ansi.reset;
44endif
45else
46name = x[2];
47endif
48names = {@names, name};
49endfor
50player:tell_item_list(names);
51endif

render_error

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1lines = {};
2{msg, stack, ?suppress_codeline = 0} = args;
3top = stack[1];
4if (msg)
5msg = ((($ansi.white + $ansi.bold_on) + msg) + $ansi.bold_off) + $ansi.yellow;
6endif
7if (!suppress_codeline)
8if (valid(top[4]) && (length(top) == 6))
9line = `verb_code(top[4], top[2])[top[6]] ! E_RANGE => "*** UNREADABLE ***"';
10line = (((($ansi.reset + " ..") + $ansi.bold_on) + $ansi.white) + line) + $ansi.reset;
11lines = listappend(lines, line);
12endif
13endif
14count = 0;
15max_vlen = 1;
16max_olen = 1;
17max_nlen = 1;
18for frame in (stack)
19vlen = length(frame[2]);
20max_vlen = max(vlen, max_vlen);
21olen = length(tostr(frame[4]));
22max_olen = max(olen, max_olen);
23nlen = `length(frame[4].name) ! ANY => 1';
24max_nlen = max(nlen, max_nlen);
25endfor
26for frame in (stack)
27subj = frame[4];
28if (valid(subj))
29vname = tostr(frame[2]);
30vname = $su:left(vname, max_vlen) + " ";
31if (vname)
32verbstr = ($su:right(tostr(subj), 0 - (max_olen + 2)) + ":") + vname;
33count = count + 1;
34if (count == length(stack))
35verbstr = ($ansi.bold_on + verbstr) + $ansi.bold_off;
36endif
37verbstr = ($su:left(`subj.name ! ANY => "invalid"', max_nlen) + " ") + verbstr;
38line = verbstr;
39if (length(frame) >= 6)
40line = (line + " line ") + $su:right(frame[6], 3);
41endif
42if ((length(frame) >= 7) && (frame[7] > 0))
43line = ((line + " [") + tostr(frame[7])) + "ms]";
44endif
45if (frame[1] != frame[4])
46line = ((((line + $ansi.reset) + " (this == ") + $su:nn(frame[1])) + ")") + $ansi.yellow;
47endif
48line = ($ansi.yellow + line) + $ansi.reset;
49line = " .." + line;
50lines = listappend(lines, line);
51endif
52endif
53endfor
54return lines;

fill_bottle

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1":fill_bottle(OBJ to, OBJ from[, INT removefromsource])";
2"Move some liquid out of source to destination.";
3dst = args[1];
4src = args[2];
5removefrom = (length(args) > 2) ? args[3] | 1;
6if (!src.filled_with)
7return {};
8endif
9added = {};
10if (!removefrom)
11doses = dst.capacity - dst:holding();
12else
13doses = min(dst.capacity - dst:holding(), src:holding());
14endif
15while (doses)
16for i in [1..length(src.filled_with)]
17if (src.filled_with[i][2] > 0)
18if (dst:add_fluid(src.filled_with[i][1], 1) == 0)
19doses = 0;
20break;
21endif
22added = setadd(added, src.filled_with[i][1]);
23if (removefrom && (src.filled_with[i][2] < $maxint))
24src.filled_with[i][2] = src.filled_with[i][2] - 1;
25endif
26endif
27doses = doses - 1;
28if (!doses)
29break;
30endif
31endfor
32$cu:sin(0);
33endwhile
34if (removefrom && $ou:has_verb(src, "cleanup_fluids"))
35src:cleanup_fluids();
36endif
37return added;

handle_aborted_task

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1{player, msg, stack} = args;
2who = {};
3dev_tb = 1;
4if (valid(player) && is_player(player))
5if (!player.programmer)
6player:notify("");
7player:notify("A loud mechanical buzz rattles your ears.");
8this.boiler_room:clunk(msg, stack);
9player:notify((($ansi.cyan + $ansi.bold_on) + "[ The world's fabric was ruptured.  Someone (or something) has been told... ]") + $ansi.reset);
10#273956:award_to(player);
11dev_tb = 0;
12else
13who = {player};
14endif
15else
16player = #2;
17who = {};
18endif
19stack = this:_scrub_stack(stack);
20if (valid(prog = stack[1][3]))
21if (is_connected(prog))
22who = setadd(who, prog);
23endif
24endif
25if ((!who) && (#2 in connected_players()))
26who = {#2};
27endif
28bettertb = $rpg:render_error(msg, stack);
29output = {};
30name = $su:nn(stack[1][5]);
31host_vanished = (!valid(stack[1][5])) && (!valid(stack[$][1]));
32if (host_vanished && (#98 in who))
33return;
34endif
35line = $su:left(tostr("'", msg, "' by ", name, " from ", $su:nn(stack[$][1]), " at ", $su:nn(valid(stack[$][1]) ? stack[$][1].location | #-1)), 79);
36line = tostr($ansi.debugbold, line, $ansi.reset);
37output = {@output, line};
38output = {@output, @bettertb};
39for x in (who)
40x:tell_lines(output);
41endfor
42$cu:sin(0);
43if ((length(who) == 1) && (who[1] == player))
44"Player was on the notification list (therefore is a programmer) and no one else saw the problem. No mail.";
45elseif ((stack[$][2] == "eval") || (stack[$][2] == "eval-d"))
46"It's an eval, don't mail.";
47else
48"Send tb mail.";
49mailtarget = dev_tb ? #46684 | #5460;
50stripped = $lu:map_arg($ansi, "strip", output);
51subj = "";
52{verbthis, verbname, verbprog, verbloc} = stack[1][1..4];
53if (valid(verbloc))
54subj = tostr(verbloc, ":", verbname) + (valid(verbprog) ? tostr(" (", verbprog.name, ")") | "");
55endif
56if (is_a(verbthis, $garbage))
57rhistory = verbthis.previous_state;
58if (rhistory)
59how = tostr("Object was '", rhistory[4], "', recycled by ", rhistory[3][4], ":", rhistory[3][2], " (", rhistory[3][6], ").");
60stripped = {@stripped, "", how};
61endif
62endif
63$cu:sin(0);
64$mail_agent:send_message(#0, mailtarget, subj, stripped);
65endif
66return 1;

describe_coord_dir

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":describe_coord_dir(OBJ sourceroom, OBJ destroom)";
2"Return something like 'southwest'.";
3"This is as-the-crow-flies, not pathed.";
4if (typeof(args[1]) == OBJ)
5source = args[1];
6sourcex = source.x;
7sourcey = source.y;
8else
9sourcex = args[1][1];
10sourcey = args[1][2];
11endif
12if (typeof(args[2]) == OBJ)
13dest = args[2];
14destx = dest.x;
15desty = dest.y;
16else
17destx = args[2][1];
18desty = args[2][2];
19endif
20dx = tofloat(destx - sourcex);
21dy = tofloat(desty - sourcey);
22adx = abs(dx);
23ady = abs(dy);
24if (ady > 0.0)
25dx_to_dy = adx / ady;
26else
27dx_to_dy = 100.0;
28endif
29if (dx_to_dy > 2.0)
30if (dx > 0.0)
31dir = "east";
32else
33dir = "west";
34endif
35elseif (dx_to_dy < 0.5)
36if (dy > 0.0)
37dir = "south";
38else
39dir = "north";
40endif
41elseif ((dx > 0.0) && (dy > 0.0))
42dir = "southeast";
43elseif ((dx > 0.0) && (dy < 0.0))
44dir = "northeast";
45elseif ((dx < 0.0) && (dy > 0.0))
46dir = "southwest";
47else
48dir = "northwest";
49endif
50return dir;

handle_broken_heart

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1fork (0)
2{what, error, ?via = #-1} = args;
3$rpg:report_error(error, valid(via) ? tostr("via ", $su:nn(via)) | {}, $nets.heartnet);
4endfork
5return 1;

damage_to_desc

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1{h, hmax} = args;
2pct = toint((tofloat(h) / tofloat(hmax)) * 100.0);
3if (pct >= 100)
4i = 1;
5elseif (pct >= 75)
6i = 2;
7elseif (pct >= 50)
8i = 3;
9elseif (pct >= 25)
10i = 4;
11else
12i = 5;
13endif
14return this.item_damage_descs[i];

log_callers

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":log_callers(OBJ who to notify, [LIST extra_to_pass, LIST extra_to_notify])";
2"Log the callstack for the verb this function is called from.";
3if (!this.do_call_logs)
4return;
5endif
6callstack = callers(1);
7fork (0)
8{who, ?pass = {}, ?others = {}} = args;
9{verbthis, verbname, verbprog, verbloc} = callstack[1][1..4];
10alt_this = (verbloc == verbthis) ? "" | tostr(" (this = ", verbthis, ")");
11topline = tostr($ansi.bg_cyan, "  ", $ansi.reset, " ", $ansi.cyan, " ", verbloc, ":", verbname, alt_this, pass ? tostr(" ", $su:from_value(pass, 0, 10)) | "", $ansi.reset);
12rendered = $rpg:render_error("monitored verb", callstack[2..$]);
13for x in ({who, @others})
14x:tell_lines({topline, @rendered});
15endfor
16endfork

handle_broken_area

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1fork (0)
2{what, error} = args;
3from = tostr("AREA BROKEN: ", $su:nn(what));
4$rpg:report_error(error, from, $nets.prognet);
5endfork
6return 1;

find_path

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1start = args[1];
2end = args[2];
3path = {};
4pathrooms = {start};
5cursor = start;
6while (cursor != end)
7next = cursor:next_hop_to(end);
8if (!valid(next))
9return E_NONE;
10elseif ((nextroom = next.otherside.location) in pathrooms)
11return E_MAXREC;
12else
13path = {@path, next};
14pathrooms = {@pathrooms, nextroom};
15cursor = nextroom;
16endif
17endwhile
18return path;

describe_temperature

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1t = args[1];
2if (t < -20)
3return "arctic";
4elseif (t < 0)
5return "freezing";
6elseif (t < 20)
7return "frigid";
8elseif (t < 40)
9return "cold";
10elseif (t < 50)
11return "cool";
12elseif (t < 60)
13return "tepid";
14elseif (t < 75)
15return "lukewarm";
16elseif (t < 85)
17return "warm";
18elseif (t < 95)
19return "hot";
20elseif (t < 105)
21return "steamy hot";
22else
23return "boiling hot";
24endif

random_password

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1poss = {@#86710.rka, @#86710.rkb};
2acceptable = 0;
3while (!acceptable)
4cand = poss[random(length(poss))];
5if (!index(cand, " "))
6acceptable = 1;
7endif
8endwhile
9return cand;

direction_vector

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1dir = args[1];
2dt = {"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"};
3dt2 = {"n", "ne", "e", "se", "s", "sw", "w", "nw"};
4if ((!(dtype = dir in dt)) && (!(dtype = dir in dt2)))
5return E_INVARG;
6endif
7da = {{0, -1}, {1, -1}, {1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}};
8return da[dtype];

set_recipes

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1for x in ($ou:fertile_descendants_suspended($recipe))
2if (is_a(x.makes, $thing))
3x.makes.recipe_for = x;
4endif
5$cu:sin();
6endfor

opposite_dir

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1dir = args[1];
2d1n = (dir in $exit_utils.cardinal_names) || (dir in $exit_utils.cardinal_letters);
3d1n = d1n + 4;
4d1n = (d1n > 8) ? d1n - 8 | d1n;
5return $exit_utils.cardinal_names[d1n];

reach

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1":reach(from, to[, frommsg, tomsg]) => FROM must be able to reach TO.  Only call this function from actions.  Not guaranteed to return a value.  A true return value means that FROM has reached TO.  FROM and TO are assumed to be in the same room.";
2{from, to, ?frommsg = "You come out from behind cover to reach %dt.", ?tomsg = "%DT drives you out of your hiding place."} = args;
3fromcover = from in from.location.covering;
4tocover = to in to.location.covering;
5if (fromcover)
6from:tell($su:ps(frommsg, from, to));
7from.location.covering = setremove(from.location.covering, from);
8from.posture = "standing";
9from.executing[5] = 1;
10suspend(3 + (from.location.size / 3));
11from.executing[5] = 0;
12endif
13if (tocover)
14from:aat($su:capitalize(from:dname()), " rushes toward ", to:dname(), "'s cover!");
15from.executing[5] = 1;
16suspend(3 + (to.location.size / 3));
17from.executing[5] = 0;
18if (from.location == to.location)
19from.location.covering = setremove(from.location.covering, to);
20to:tell($su:ps(tomsg, from, to));
21to.posture = "standing";
22else
23return E_INVARG;
24endif
25endif
26return to:reachable_by(from);

steps_between

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1"Return a list of exits between room1 and room2.";
2steps = {};
3start = args[1];
4end = args[2];
5visited = {};
6pos = start;
7while (pos != end)
8visited = {@visited, pos};
9next = pos:next_hop_to(end);
10if (!valid(next))
11return {};
12elseif (next.otherside.location in visited)
13return {};
14endif
15steps = {@steps, next};
16pos = next.otherside.location;
17endwhile
18return steps;

valid

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1return gamevalid(@args);
2what = args[1];
3if (!is_a(what, #1))
4return 0;
5endif
6r = what.location;
7while (valid(r))
8if (r == $tomb)
9return 0;
10endif
11r = r.location;
12endwhile
13return 1;

meat_raper

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

none

Source

1for x in ($ou:leaves_suspended($food))
2if (!is_a(x, $food))
3continue;
4endif
5if ((!x.f) && x.rot_chance)
6x:rot_check();
7else
8if (x.rot > 0)
9$nets.tasknet:_announce(#-1, tostr("meat reaper: fixed ", x.name, " (", x.rot, ")"), 1);
10x.rot = 0;
11endif
12endif
13$cu:sin(3);
14endfor

_scrub_stack

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1{stack} = args;
2top = stack[1];
3{o, v, lnum} = {top[4], top[2], top[6]};
4try
5line = verb_code(o, v, 0, 0)[lnum];
6if (line[1..6] == "raise(")
7stack = stack[2..$];
8endif
9except e (ANY)
10"oh well";
11endtry
12return stack;

mini_damage

Spec this none thisFlags rxdOwner #361Definer #103

Referenced by

Source

1{damage, max} = args;
2max = max(max / 2, 1);
3pos = (damage * length(this.mini_damage_meters)) / max;
4pos = min(max(pos, 1), length(this.mini_damage_meters));
5return (($ansi.red + $ansi.bold_on) + this.mini_damage_meters[pos]) + $ansi.reset;