RPG Utilities #103
Aliases: RPG Utilities
51 verbs · 64 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
random_treasure | this none this | rxd | #103 | 56 |
spawn | this none this | rxd | #103 | 25 |
junk | this none this | rxd | #103 | 5 |
_ihm | this none this | rxd | #103 | 5 |
health_bar | this none this | rxd | #103 | 27 |
angel_of_death | this none this | rx | #103 | 19 |
notify_death | this none this | rxd | #103 | 14 |
do_setup | this none this | rxd | #103 | 28 |
meat_reaper | this none this | rxd | #103 | 20 |
_meat_reaper | this none this | rxd | #103 | 11 |
_ihmthing | this none this | rxd | #103 | 5 |
draw_map | this none this | rxd | #103 | 19 |
graphical_meter | none none none | rxd | #103 | 19 |
string_shade | this none this | rxd | #103 | 20 |
_old_draw_map | this none this | rxd | #103 | 51 |
color_code_meter | this none this | rxd | #103 | 10 |
describe_dir | this none this | rxd | #103 | 19 |
match_wristpad | this none this | rxd | #103 | 2 |
bar | this none this | rxd | #103 | 29 |
describe_difficulty | this none this | rxd | #103 | 15 |
clear_signs_for | this none this | rxd | #103 | 4 |
percent_of | this none this | rxd | #103 | 5 |
describe_result | this none this | rxd | #103 | 11 |
gbar | this none this | rxd | #103 | 28 |
report_error | this none this | rxd | #103 | 52 |
health_meter | this none this | rxd | #103 | 28 |
draw_map_www | this none this | rxd | #103 | 90 |
get_html_icon | this none this | rxd | #103 | 9 |
gbar_for | this none this | rxd | #103 | 8 |
numbar | this none this | rxd | #103 | 15 |
tell_contents_sub | this none this | rxd | #103 | 51 |
render_error | this none this | rxd | #103 | 54 |
fill_bottle | this none this | rxd | #103 | 37 |
handle_aborted_task | this none this | rxd | #103 | 66 |
describe_coord_dir | this none this | rxd | #103 | 50 |
handle_broken_heart | this none this | rxd | #103 | 5 |
damage_to_desc | this none this | rxd | #103 | 14 |
log_callers | this none this | rxd | #103 | 16 |
handle_broken_area | this none this | rxd | #103 | 6 |
find_path | this none this | rxd | #103 | 18 |
describe_temperature | this none this | rxd | #103 | 24 |
random_password | this none this | rxd | #103 | 9 |
direction_vector | this none this | rxd | #103 | 8 |
set_recipes | this none this | rxd | #103 | 6 |
opposite_dir | this none this | rxd | #103 | 5 |
reach | this none this | rxd | #103 | 26 |
steps_between | this none this | rxd | #103 | 18 |
valid | this none this | rxd | #103 | 13 |
meat_raper | this none this | rxd | #103 | 14 |
_scrub_stack | this none this | rxd | #103 | 12 |
mini_damage | this none this | rxd | #103 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
help_msg | #103 | rc | #361 | {"Useful verbs:", "", ":random_treasure(OBJ parent, INT min_val, INT max_val)", " Spawn a random treasure item."} |
map_keys | #103 | rc | #361 | {{#505, "outdoors"}, {#490, "street"}, {#489, "indoors"}} |
heartbeat_interval | #103 | rc | #361 | 30 |
allowable_actions | #103 | rc | #361 | list of 9{"cocoon", "gifts", "medical", "rape", "sex", "suck", "tattoo", "teach", "visit"} |
paramedic_interval | #103 | rc | #361 | 60 |
stat | #103 | rc | #361 | #389 |
skill_improve_interval | #103 | rc | #361 | 15 |
meat_reaper_time | #103 | rc | #361 | 900 |
meat_reaper_task | #103 | rc | #361 | 981992793 |
repeatable_actions | #103 | rc | #361 | {#108, #721, #12442, #322} |
nomap_rooms | #103 | rc | #361 | {#47, #48, #130435} |
exhaustion_threshold | #103 | rc | #361 | 100 |
combat_speed | #103 | rc | #361 | 1.3 |
hunger_chance | #103 | rc | #361 | 35 |
difficulty_descs | #103 | rc | #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 | #103 | rc | #361 | list of 12{"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "up", "down", "in", "out"} |
mini_damage_meters | #103 | rc | #361 | list of 9{"'", "*", "# ", "#'", "#*", "##", "##'", "##*", "###"} |
weather_ceiling | #103 | rc | #361 | 1500 |
thirst_per_move | #103 | rc | #361 | 2.0 |
thirst | #103 | rc | #361 | #1065 |
result_descs | #103 | rc | #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 | #103 | rc | #361 | #17323 |
nutrition | #103 | rc | #361 | #895 |
bugnet | #103 | rc | #361 | #356 |
lag | #103 | rc | #361 | 1.0 |
allowable_area_settings | #103 | rc | #361 | {"blink", "blink_to", "phase", "phase_to", "combat", "sex"} |
optimize_next_hops | #103 | rc | #361 | 0 |
bots | #103 | rc | #361 | {#44969, #93227, #288702, #350199, #359878, #532697} |
news | #103 | rc | #361 | #221210 |
shutdown_messages | #103 | rc | #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 | #103 | rc | #361 | {"It's all over."} |
inactive_player_time | #103 | rc | #361 | 2592000 |
heartnet | #103 | rc | #361 | #330 |
item_damage_descs | #103 | rc | #361 | {"in perfect condition", "a little dinged up", "slightly damaged", "seriously damaged", "completely destroyed"} |
connected_players | #103 | rc | #361 | {#171054} |
info_start | #103 | rc | #361 | "~1b[36m~1b[1m[ " |
info_end | #103 | rc | #361 | " ]~1b[0m" |
evil_msg | #103 | rc | #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 | #103 | rc | #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 | #103 | rc | #361 | list of 11{#21740, #10261, #54442, #19073, #201072, #310169, #26001, #131025, #2730, #5578, #272282} |
error_nets | #103 | rc | #361 | {{#305220, {#315620, #142689, #216326}}} |
err_subs | #103 | rc | #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 | #103 | rc | #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 | #103 | rc | #361 | 1311760926 |
checkpoint_announces | #103 | rc | #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 | #103 | rc | #361 | 8651227 |
last_db_delta | #103 | rc | #361 | -360884 |
last_reap_time | #103 | rc | #361 | 1337755278 |
do_call_logs | #103 | rc | #361 | 0 |
debug | #103 | rc | #361 | 1 |
chargen | #103 | rc | #361 | #1438 |
features_for_everyone | #103 | rc | #361 | {#217820, #418728, #2473} |
features_for_programmers | #103 | rc | #361 | {#65222} |
world_start | #103 | rc | #361 | 1301961600 |
aliases | #1 | rc | #361 | {"RPG Utilities"} |
description | #1 | rc | #361 | <clear> |
object_size | #1 | r | #29 | {81768, 1298433815} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | <clear> |
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): #1 root
Children: none
Call graph
Showing 48 of 60 verbs; 12 not shown.
Source
random_treasure
Referenced by
- #142:on_spawn line 7:
$rpg:random_treasure
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
Referenced by
- #2:@spawn line 36:
$rpg:spawn - #2:@spawn line 40:
$rpg:spawn - #2:@spawn line 45:
$rpg:spawn - #103:random_treasure line 47:
$rpg:spawn - #104:sever_meat line 8:
$rpg:spawn - #106:_reload line 13:
$rpg:spawn - #106:spawn_with line 14:
$rpg:spawn - #107:_knockout line 19:
$rpg:spawn - #119:become_adoor line 33:
$rpg:spawn - #127:remove_from line 30:
$rpg:spawn - #128:light line 25:
$rpg:spawn - #129:make_spawn line 1:
$rpg:spawn - #138:_rot line 16:
$rpg:spawn - #138:burn_up line 3:
$rpg:spawn - #141:add_to line 37:
$rpg:spawn - #142:die line 9:
$rpg:spawn - #142:die line 18:
$rpg:spawn - #147:make_product line 5:
$rpg:spawn - #148:explode line 12:
$rpg:spawn - #156:spawn line 4:
$rpg:spawn - #166:award_to line 21:
$rpg:spawn - #187:_pop line 3:
$rpg:spawn - #187:_push line 5:
$rpg:spawn - #187:moveto line 7:
$rpg:spawn - #214:drift_clouds line 37:
$rpg:spawn - #214:drift_clouds line 42:
$rpg:spawn - #214:create_cloud line 3:
$rpg:spawn - #256:add_to line 17:
$rpg:spawn - #305:on_reset line 6:
$rpg:spawn - #334:dig line 49:
$rpg:spawn - #334:instantiate line 7:
$rpg:spawn - #334:instantiate line 14:
$rpg:spawn - #334:instantiate line 29:
$rpg:spawn - #334:instantiate line 31:
$rpg:spawn - #334:instantiate line 51:
$rpg:spawn - #334:furnish line 13:
$rpg:spawn - #334:instantiate_new line 7:
$rpg:spawn - #334:instantiate_new line 13:
$rpg:spawn - #334:instantiate_new line 28:
$rpg:spawn - #334:instantiate_new line 29:
$rpg:spawn - #334:instantiate_old line 11:
$rpg:spawn - #334:instantiate_old line 17:
$rpg:spawn - #334:instantiate_old line 32:
$rpg:spawn - #334:instantiate_old line 33:
$rpg:spawn - #335:do_use_finish line 13:
$rpg:spawn
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
Referenced by
- #3:auto_clean line 9:
$rpg:junk - #3:auto_clean line 20:
$rpg:junk - #5:_eat line 11:
$rpg:junk - #54:clean line 22:
$rpg:junk - #54:_break line 26:
$rpg:junk - #104:rot line 11:
$rpg:junk - #104:rot line 18:
$rpg:junk - #106:die line 7:
$rpg:junk - #106:heartbeat line 16:
$rpg:junk - #107:die line 193:
$rpg:junk - #119:look_self line 23:
$rpg:junk - #128:light line 30:
$rpg:junk - #129:do_get line 4:
$rpg:junk - #129:do_put line 11:
$rpg:junk - #129:reduce_by line 4:
$rpg:junk - #133:read line 36:
$rpg:junk - #135:_explode line 24:
$rpg:junk - #135:on_munch line 8:
$rpg:junk - #138:burn_up line 6:
$rpg:junk - #141:tell_person line 3:
$rpg:junk - #141:creature_heartbeat line 23:
$rpg:junk - #141:moveto line 19:
$rpg:junk - #141:moveto line 32:
$rpg:junk - #142:heartbeat line 4:
$rpg:junk - #147:skill_check_failed line 16:
$rpg:junk - #154:popmon line 21:
$rpg:junk - #156:dissolve line 4:
$rpg:junk - #186:_clean line 26:
$rpg:junk - #198:_eat line 7:
$rpg:junk - #208:_break line 5:
$rpg:junk - #215:moveto line 8:
$rpg:junk - #215:moveto line 11:
$rpg:junk - #215:moveto line 23:
$rpg:junk - #215:moveto line 38:
$rpg:junk - #215:decrease_accumulation line 8:
$rpg:junk - #255:_break line 14:
$rpg:junk - #256:moveto line 14:
$rpg:junk - #256:_decrease line 30:
$rpg:junk - #267:do_spring line 16:
$rpg:junk - #334:uninstantiate line 13:
$rpg:junk - #334:bury_room line 10:
$rpg:junk - #335:do_use_finish line 16:
$rpg:junk - #335:spend_charge line 8:
$rpg:junk - #338:fill_from line 14:
$rpg:junk - #338:fill_from line 27:
$rpg:junk - #338:lose_unit line 6:
$rpg:junk - #338:_finish_drink line 5:
$rpg:junk - #345:_clean line 8:
$rpg:junk - #345:maybe_clean line 16:
$rpg:junk - #347:burn_up line 14:
$rpg:junk
Source
1{what, ?fake = 0} = args; 2if (`what:junk_ok() ! E_VERBNF') 3fake || move(what, $tomb); 4return 1; 5endif
_ihm
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
Referenced by
- #6:su*m line 1:
$rpg:health_bar - #103:graphical_meter line 13:
$rpg:health_bar - #107:tell_health line 17:
$rpg:health_bar
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
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
Referenced by
- #107:die line 132:
$rpg:notify_death
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
Referenced by
- #5:@setup line 9:
$rpg:do_setup
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
Referenced by
- #103:_meat_reaper line 10:
this:meat_reaper
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
Referenced by
- #50:paramedic line 64:
$rpg:_meat_reaper - #103:_meat_reaper line 7:
this:_meat_reaper
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
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
Referenced by
- #6:bigmap line 30:
$rpg:draw_map - #114:look_self line 2:
$rpg:draw_map
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
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
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
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
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
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
Referenced by
- #130:match_wristpad line 10:
$rpg:match_wristpad
Source
1name = args[1]; 2return $match_utils:match(name, children(#9343));
bar
Referenced by
- #103:graphical_meter line 15:
$rpg:bar
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
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
Referenced by
none
Source
1who = args[1]; 2for x in ($ou:leaves_suspended($sign)) 3x.seen = setremove(x.seen, who); 4endfor
percent_of
Referenced by
- #102:stun line 2:
$rpg:percent_of
Source
1part = args[1]; 2total = args[2]; 3pct = tofloat(part) / tofloat(total); 4pct = toint(pct * 100.0); 5return pct;
describe_result
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
Referenced by
- #48:tell_eta line 12:
$rpg:gbar - #103:gbar_for line 3:
this:gbar - #103:gbar_for line 5:
this:gbar
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
Referenced by
- #0:user_created line 9:
$rpg:report_error - #0:user_created line 14:
$rpg:report_error - #0:user_created line 21:
$rpg:report_error - #0:user_disconnected line 12:
$rpg:report_error - #0:user_disconnected line 17:
$rpg:report_error - #0:user_disconnected line 28:
$rpg:report_error - #0:user_reconnected line 8:
$rpg:report_error - #0:do_out_of_band_command line 4:
$rpg:report_error - #1:recycle line 9:
$rpg:report_error - #3:broadcast_event line 13:
$rpg:report_error - #3:make_noise line 23:
$rpg:report_error - #3:make_noise line 43:
$rpg:report_error - #4:MSSP-REQUEST line 26:
$rpg:report_error - #17:set_verb_code line 14:
$rpg:report_error - #17:set_verb_code line 29:
$rpg:report_error - #17:grab_next_objnum line 8:
$rpg:report_error - #21:recreate line 20:
$rpg:report_error - #57:_recreate line 25:
$rpg:report_error - #57:_create line 7:
$rpg:report_error - #57:watch_tell line 7:
$rpg:report_error - #57:setup_new_object_as line 11:
$rpg:report_error - #57:enterfunc line 8:
$rpg:report_error - #92:process_queue line 50:
$rpg:report_error - #92:process_queue line 98:
$rpg:report_error - #93:doing_msg line 11:
$rpg:report_error - #103:spawn line 21:
$rpg:report_error - #103:handle_broken_heart line 3:
$rpg:report_error - #103:handle_broken_area line 4:
$rpg:report_error - #107:die line 113:
$rpg:report_error - #107:die line 122:
$rpg:report_error - #107:moveto line 10:
$rpg:report_error - #107:moveto line 15:
$rpg:report_error - #114:do_reset line 8:
$rpg:report_error - #155:change_plan line 14:
$rpg:report_error - #186:accept line 3:
$rpg:report_error - #186:_new_clean line 54:
$rpg:report_error - #223:calculate line 16:
$rpg:report_error - #301:user_created line 9:
$rpg:report_error - #301:user_created line 14:
$rpg:report_error - #301:user_disconnected line 8:
$rpg:report_error - #318:_who line 59:
$rpg:report_error - #334:del*ete line 46:
$rpg:report_error - #364:doing_msg line 11:
$rpg:report_error
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
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
Referenced by
- #114:_www line 47:
$rpg:draw_map_www
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
Referenced by
- #103:draw_map_www line 80:
$rpg:get_html_icon - #103:draw_map_www line 82:
$rpg:get_html_icon
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
Referenced by
- #6:_gain_stress line 20:
$rpg:gbar_for - #6:_lose_stress line 6:
$rpg:gbar_for - #6:tell_standings line 16:
$rpg:gbar_for - #103:color_code_meter line 10:
$rpg:gbar_for - #107:_show_status line 3:
$rpg:gbar_for - #107:_show_status line 10:
$rpg:gbar_for - #107:_show_status line 16:
$rpg:gbar_for - #107:_show_status line 30:
$rpg:gbar_for
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
Referenced by
- #103:gbar_for line 3:
this:numbar - #103:gbar_for line 7:
this:numbar
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
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
Referenced by
- #50:@task*s line 122:
$rpg:render_error - #50:@task*s line 221:
$rpg:render_error - #103:handle_aborted_task line 28:
$rpg:render_error - #103:log_callers line 12:
$rpg:render_error - #107:@qp line 22:
$rpg:render_error - #296:_handle_error line 13:
$rpg:render_error - #317:@actor-check line 12:
$rpg:render_error
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
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
Referenced by
- #0:handle_uncaught_error line 2:
$rpg:handle_aborted_task - #0:handle_task_timeout line 3:
$rpg:handle_aborted_task
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
Referenced by
- #114:announce_low_sky line 15:
$rpg:describe_coord_dir
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
Referenced by
- #150:service_queue line 27:
$rpg:handle_broken_heart - #150:service_queue line 49:
$rpg:handle_broken_heart - #150:service_long_queue line 26:
$rpg:handle_broken_heart
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
Referenced by
- #119:tell_health line 3:
$rpg:damage_to_desc - #137:look_self line 10:
$rpg:damage_to_desc - #255:tell_health line 2:
$rpg:damage_to_desc
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
Referenced by
- #1:announce*_all_but line 9:
$rpg:log_callers - #1:occupants_suspended line 8:
$rpg:log_callers
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
Referenced by
- #150:service_long_queue line 19:
$rpg:handle_broken_area
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
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
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
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
Referenced by
- #6:lm*ap line 37:
$rpg:direction_vector
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
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
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
Referenced by
- #222:_start line 20:
$rpg:reach
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
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
Referenced by
- #107:take_damage line 57:
$rpg:valid - #107:die line 9:
$rpg:valid - #107:die line 185:
$rpg:valid - #135:grenade line 12:
$rpg:valid - #148:heartbeat line 2:
$rpg:valid - #247:affect_thing line 6:
$rpg:valid - #255:take_damage line 15:
$rpg:valid - #338:fill_from line 23:
$rpg:valid
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
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
Referenced by
- #103:report_error line 13:
this:_scrub_stack - #103:handle_aborted_task line 19:
this:_scrub_stack
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
Referenced by
- #222:_finish line 43:
$rpg:mini_damage
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;