generic holding tank #345

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

Aliases: generic holding tank

5 verbs · 11 properties · 3 children

Verbs

VerbSpecFlagsDefinerLines
_cleanthis none thisrxd#34517
_clean_startthis none thisrxd#3457
@cleanthis none nonerxd#3451
maybe_cleanthis none thisrxd#34519
look_selfthis none thisrxd#34554

Properties

PropertyDefinerFlagsOwnerValue
clean_task#345rc#3610
aliases#1rc#361{"generic holding tank"}
description#1rc#361<clear>
object_size#1r#29{3815, 1298434510}
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: #185 womb, #186 tomb, #229 lostnfound

Call graph

calls n345_0 #345:_clean n103_2 #103:junk n345_0->n103_2 n20_59 #20:name_and_number n345_0->n20_59 n48_8 #48:suspend_if_needed n345_0->n48_8 n345_1 #345:_clean_start n345_1->n345_0 n345_2 #345:@clean n345_2->n345_1 n345_3 #345:maybe_clean n345_3->n103_2 n345_3->n345_1 n345_4 #345:look_self n254_5 #254:plurals n345_4->n254_5 n254_6 #254:group_by_type n345_4->n254_6 n107_43 #107:tell n345_4->n107_43 n6_54 #6:check_pref n345_4->n6_54 n20_85 #20:english_weight_short n345_4->n20_85 n47_18 #47:iassoc n345_4->n47_18 n20_80 #20:aggregate_number n345_4->n20_80 n6_121 #6:tell_item_list n345_4->n6_121

Source

_clean

Spec this none thisFlags rxdOwner #361Definer #345

Referenced by

Source

1who = args[1];
2who:tell("Starting $", this.name, " cleaner.");
3goats = this.contents;
4kills = 0;
5while (goats)
6goat = goats[1];
7`goat.junk_ok = 1 ! ANY => 0';
8`$rpg:junk(goat) ! ANY => 0';
9if (!is_a(goat, $garbage))
10who:tell($ansi.cyan, "  Couldn't junk ", $su:nn(goat), "!", $ansi.reset);
11else
12kills = kills + 1;
13endif
14goats = setremove(goats, goat);
15$cu:sin(2) && who:tell($ansi.cyan, "  Killed ", kills, "...", $ansi.reset);
16endwhile
17who:tell("Done cleaning ", $su:nn(this), ".");

_clean_start

Spec this none thisFlags rxdOwner #361Definer #345

Referenced by

Source

1if (task_valid(this.clean_task))
2return E_INVARG;
3endif
4fork task_id (1)
5this:_clean(player);
6endfork
7this.clean_task = task_id;

@clean

Spec this none noneFlags rxdOwner #361Definer #345

Referenced by

none

Source

1this:_clean_start();

maybe_clean

Spec this none thisFlags rxdOwner #361Definer #345

Referenced by

none

Source

1return;
2if (random(100) < 10)
3clear = 1;
4for x in (connected_players())
5if ((!x.programmer) && (idle_seconds(x) < 600))
6clear = 0;
7endif
8endfor
9if ((clear && (!task_valid(this.clean_task))) && (length(this.contents) > 50))
10this:_clean_start();
11endif
12endif
13count = 0;
14while (this.contents && (count < 2))
15goat = this.contents[random(length(this.contents))];
16$rpg:junk(goat);
17count = count + 1;
18suspend(1);
19endwhile

look_self

Spec this none thisFlags rxdOwner #361Definer #345

Referenced by

none

Source

1names = {@$iu:pluralsc(), "Misc", "Non-things"};
2nonthings = {};
3things = {};
4total_weight = 0;
5for x in (this.contents)
6if (!is_a(x, $thing))
7nonthings = {@nonthings, x};
8else
9things = {@things, x};
10endif
11endfor
12buckets = $iu:group_by_type(things);
13buckets = {@buckets, nonthings};
14for x in [1..length(buckets)]
15if (buckets[x])
16player:tell($ansi.bold_on, names[x], ":", $ansi.reset);
17things = buckets[x];
18msg_db = {};
19names = {};
20weights = player:check_pref("weights");
21for x in (things)
22added = 0;
23iname = x:iname();
24if (weights)
25iname = ((((iname + $ansi.cyan) + " [") + $su:english_weight_short(weight = x:weight())) + "]") + $ansi.reset;
26endif
27if (i = $lu:iassoc(iname, msg_db, 2))
28msg_db[i][3] = msg_db[i][3] + 1;
29msg_db[i][1] = setadd(msg_db[i][1], x);
30added = 1;
31else
32msg_db = {@msg_db, {{x}, iname, 1}};
33endif
34yield;
35endfor
36for x in (msg_db)
37if (x[3] > 1)
38name = ($string_utils:aggregate_number(x[3]) + " ") + x[1][1]:plural_name();
39if (weights)
40wt = 0;
41for z in (x[1])
42wt = wt + z:weight();
43endfor
44name = ((((name + $ansi.cyan) + " [") + $su:english_weight_short(wt)) + "]") + $ansi.reset;
45endif
46else
47name = x[2];
48endif
49names = {@names, name};
50yield;
51endfor
52player:tell_item_list(names);
53endif
54endfor