generic glob #187

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

Aliases: generic glob, glob

14 verbs · 32 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
_popthis none thisrxd#18716
_pushthis none thisrxd#18718
_vanishthis none thisrxd#1875
weightthis none thisrx#1874
valuethis none thisrx#1871
_updatethis none thisrxd#1872
can_pushthis none thisrxd#1878
give_as_giftthis none thisrxd#1871
list_namethis none thisrxd#1875
descriptionthis none thisrxd#1875
list_asthis none thisrxd#1871
can_globthis none thisrxd#1871
movetothis none thisrxd#18728
item_listthis none thisrxd#1875

Properties

PropertyDefinerFlagsOwnerValue
item#187rc#361#-1
amount#187rc#3610
handed#5rc#361<clear>
wield_msg#5rc#361<clear>
unwield_msg#5rc#361<clear>
size#5rc#361<clear>
look_place_msg#5rc#361<clear>
value#5rc#361<clear>
get_msg#5rc#361<clear>
drop_msg#5rc#361<clear>
get_fail_msg#5rc#361<clear>
junk_ok#5rc#3610
floats#5rc#361<clear>
long_name_msg#5rc#361<clear>
article#5rc#361<clear>
setup_list#5rc#361<clear>
health#5rc#361<clear>
health_max#5rc#361<clear>
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic glob", "glob"}
description#1rc#361"A shorthand for a bunch of objects."
object_size#1r#29{6506, 1298434454}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361<clear>
weight#1rwc#3610
owner_verbs#1rc#361<clear>
plural_name#1rc#361<clear>
client_image#1rc#361<clear>
listening#1rc#361<clear>

Ancestry

Ancestors (nearest first): #5 generic thing#1 root

Children: none

Call graph

calls n187_0 #187:_pop n103_1 #103:spawn n187_0->n103_1 n187_2 #187:_vanish n187_0->n187_2 n187_5 #187:_update n187_0->n187_5 n187_12 #187:moveto n187_2->n187_12 n187_1 #187:_push n187_1->n103_1 n187_1->n187_5 n48_8 #48:suspend_if_needed n187_1->n48_8 n187_6 #187:can_push n187_1->n187_6 n187_12->n103_1 n42_4 #42:_chparent n187_12->n42_4 n1_13 #1:moveto n187_12->n1_13 n187_7 #187:give_as_gift n187_7->n187_0 n187_8 #187:list_name n5_9 #5:iname n187_8->n5_9 n20_80 #20:aggregate_number n187_8->n20_80

Source

_pop

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1if (this.amount > 0)
2this.amount = this.amount - 1;
3new = $rpg:spawn(this.item);
4else
5new = #-1;
6endif
7if (this.amount < 1)
8fork (0)
9if (is_a(this, $glob))
10this:_vanish();
11endif
12endfork
13else
14this:_update();
15endif
16return new;

_push

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1what = args[1];
2$cu:sin(0);
3if (this.f)
4location = what.location;
5newglob = $rpg:spawn(this);
6if (newglob:_push(what))
7newglob:moveto(location);
8return newglob;
9endif
10return #-1;
11endif
12if (this:can_push(what))
13this.item = parent(what);
14this.amount = this.amount + 1;
15what:moveto($tomb);
16this:_update();
17return this.amount;
18endif

_vanish

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1if (this.f || (this.amount > 0))
2return E_QUOTA;
3endif
4this.junk_ok = 1;
5this:moveto($tomb);

weight

Spec this none thisFlags rxOwner #361Definer #187

Referenced by

none

Source

1if (this.amount)
2return this.item.weight * this.amount;
3endif
4return 0;

value

Spec this none thisFlags rxOwner #361Definer #187

Referenced by

none

Source

1return this.item.value * this.amount;

_update

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1this.name = this.item.name;
2this.aliases = this.item.aliases;

can_push

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1what = args[1];
2"if (valid(this.item) && (!is_a(what, this.item)))";
3if (valid(this.item) && (parent(what) != this.item))
4return 0;
5elseif (!what:can_glob())
6return 0;
7endif
8return 1;

give_as_gift

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

none

Source

1return this:_pop();

list_name

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

none

Source

1if (this.amount < 2)
2return this:iname();
3else
4return tostr($su:aggregate_number(this.amount), " ", this.item:plural_name());
5endif

description

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

none

Source

1if (valid(this.item))
2return this.item:description();
3else
4return this.description;
5endif

list_as

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

none

Source

1return this.item;

can_glob

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

none

Source

1return 0;

moveto

Spec this none thisFlags rxdOwner #361Definer #187

Referenced by

Source

1dest = args[1];
2if ((!this.f) && is_a(this.location, $globtainer))
3if (dest != this.location)
4if (!is_a(dest, $globtainer))
5this.amount = this.amount - 1;
6if (this.amount > 0)
7newglob = $rpg:spawn($glob);
8newglob.item = this.item;
9newglob.amount = this.amount;
10newglob:_update();
11newglob:moveto(this.location);
12endif
13item = this.item;
14#42:_chparent(this, item);
15this.name = item.name;
16this.aliases = item.aliases;
17else
18for x in (dest.contents)
19if ((parent(x) == $glob) && (x.item == this.item))
20x.amount = x.amount + this.amount;
21move(this, $tomb);
22return x;
23endif
24endfor
25endif
26endif
27endif
28return pass(@args);

item_list

Spec this none thisFlags rxdOwner #29Definer #187

Referenced by

none

Source

1ret = {};
2for count in [1..tonum(this.amount)]
3ret = {@ret, this.item};
4endfor
5return ret;