generic dispenser #129

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

Aliases: generic dispenser

12 verbs · 42 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
getany out of/from inside/from thisrxd#12915
do_getthis none thisrxd#12914
putany in/inside/into thisrxd#12927
do_putthis none thisrxd#12911
look_selfthis none thisrxd#1296
weightthis none thisrxd#1294
set_remainingthis none thisrxd#1291
set_heartbeat_taskthis none thisrxd#1291
valuethis none thisrxd#1295
can_globthis none thisrxd#1291
make_spawnthis none thisrxd#1292
reduce_bythis none thisrxd#1295

Properties

PropertyDefinerFlagsOwnerValue
spawn#129rc#361#-1
remaining#129rc#36124
holds#129rc#36124
empty_msg#129rc#361"%DT appears to be empty."
oget_from_msg#129rc#361"%N gets %id from %p %t."
full_msg#129rc#361"%DT is already full."
put_msg#129rc#361"You put %dd into %dt."
oput_to_msg#129rc#361"%N puts %id into %p %t."
get_from_msg#129rc#361"You get %id from %dt."
put_to_msg#129rc#361"You put %id in %dt."
help_msg#129rc#361
list of 7{"$dispenser is an object that can be used as a container for like-typed objects. For example, a pack of cigarettes which contains twenty identical cigarettes. Instead of populating your pack with 20 objects ahead of time, this device will allow you to create them on the fly as players remove them from the container.", "It also allows you to put an object of that type back into the container, at which time the object is junked, but the number of things the container contains is incremented.", "", "Important properties:", "spawn -- the object this dispenser will create or junk", "holds -- how many of .spawn this dispenser can hold", "remaining -- host many of .spawn are left in the dispenser"}
get_only#129rc#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#361<clear>
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 dispenser"}
description#1rc#361<clear>
object_size#1r#29{8105, 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): #5 generic thing#1 root

Children: none

Call graph

calls n129_0 #129:get n107_43 #107:tell n129_0->n107_43 n20_34 #20:pronoun_sub n129_0->n20_34 n1_31 #1:dname n129_0->n1_31 n1_39 #1:dnamec n129_0->n1_39 n20_17 #20:match n129_0->n20_17 n129_1 #129:do_get n129_0->n129_1 n129_1->n20_34 n103_2 #103:junk n129_1->n103_2 n129_10 #129:make_spawn n129_1->n129_10 n103_1 #103:spawn n129_10->n103_1 n129_2 #129:put n129_2->n107_43 n129_2->n20_34 n129_2->n1_31 n129_2->n1_39 n44_0 #44:match n129_2->n44_0 n45_5 #45:isa n129_2->n45_5 n129_3 #129:do_put n129_2->n129_3 n129_3->n20_34 n129_3->n103_2 n129_3->n45_5 n129_4 #129:look_self n129_4->n107_43 n129_4->n1_39 n1_9 #1:look_self n129_4->n1_9 n20_80 #20:aggregate_number n129_4->n20_80 n129_5 #129:weight n1_37 #1:weight n129_5->n1_37 n129_11 #129:reduce_by n129_11->n103_2

Source

get

Spec any out of/from inside/from thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1if (!this.remaining)
2player:tell($su:ps(this.empty_msg));
3return;
4elseif ((this.location != player) && (this.location != player.location))
5player:tell("You can't get anything from ", this:dname(), " if you can't reach it!");
6return;
7elseif (!valid(this.spawn))
8player:tell(this:dnamec(), " doesn't seem to dispense anything.");
9return;
10endif
11if ($su:match(dobjstr, {this.spawn}, "name", {this.spawn}, "aliases") != this.spawn)
12player:tell(this:dnamec(), " doesn't have any \"", dobjstr, "\" in it.");
13return;
14endif
15this:do_get(player, this);

do_get

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

Source

1who = args[1];
2if (this.remaining < 1)
3if (this.weight > 0)
4$rpg:junk(this);
5endif
6return 0;
7elseif ((this.location != who) && (this.location != who.location))
8return 0;
9endif
10this.remaining = this.remaining - 1;
11spawn = this:make_spawn();
12who:get_gift(spawn, this);
13who:tell($su:ps(this.get_from_msg, who, this, who.location, spawn, this));
14who.location:announce_all_but({who}, $su:ps(this.oget_from_msg, who, this, who.location, spawn, this));

put

Spec any in/inside/into thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1if (this.get_only)
2player:tell("What are you going to do, tape it back onto ", this:dname(), "?");
3return;
4elseif (this.remaining == this.holds)
5player:tell($su:ps(this.full_msg, player, this, player.location));
6return;
7elseif (!(this.location in {player, player.location}))
8player:tell("You can't put anything in ", this:dname(), " if you don't have it!");
9return;
10elseif (!valid(this.spawn))
11player:tell("It looks like ", this:dname(), " can't hold anything.");
12return;
13endif
14if (!valid(dobj))
15dobj = $match_utils:match(dobjstr, {@player.contents});
16endif
17if (!valid(dobj))
18player:tell("You don't seem to have a \"", dobjstr, "\".");
19return;
20elseif (dobj.location != player)
21player:tell("You don't have ", dobj:dname(), ".");
22return;
23elseif (!$ou:isa(dobj, this.spawn))
24player:tell(this:dnamec(), " really wasn't made to hold ", dobj:dname(), ".");
25return;
26endif
27this:do_put(player, dobj);

do_put

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

Source

1who = args[1];
2what = args[2];
3if (!$ou:isa(what, this.spawn))
4return 0;
5elseif (what.location != who)
6return 0;
7endif
8this.remaining = this.remaining + 1;
9who:tell($su:ps(this.put_to_msg, who, this, who.location, what, this));
10who.location:announce_all_but({who}, $su:ps(this.oput_to_msg, who, this, who.location, what, this));
11$rpg:junk(what);

look_self

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1pass(@args);
2if (this.remaining > 0)
3player:tell(this:dnamec(), " has ", $su:aggregate_number(this.remaining), " ", (this.remaining > 1) ? this.spawn:pname() | this.spawn:name(), " left.");
4else
5player:tell("It's empty.");
6endif

weight

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1if (this.weight == -1)
2return -1;
3endif
4return pass(@args) + (this.remaining * this.spawn:weight());

set_remaining

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1this.remaining = args[1];

set_heartbeat_task

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1return this.heartbeat_task = args[1];

value

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1if (this == this.spawn)
2return this.value;
3endif
4value = this.value + (this.remaining * this.spawn:value());
5return value;

can_glob

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1return 0;

make_spawn

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

Source

1spawn = $rpg:spawn(this.spawn);
2return spawn;

reduce_by

Spec this none thisFlags rxdOwner #361Definer #129

Referenced by

none

Source

1amt = args[1];
2this.remaining = this.remaining - amt;
3if ((this.remaining <= 0) && (this.weight > 0))
4$rpg:junk(this);
5endif