generic liquid container #338

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

Aliases: generic liquid container, glc

35 verbs · 61 properties · 2 children

Verbs

VerbSpecFlagsDefinerLines
tell_contentsthis none thisrxd#33828
look_selfthis none thisrxd#3382
acceptablethis none thisrxd#3388
capacity_leftthis none thisrxd#3385
fillthis out of/from inside/from anyrxd#33841
fill_fromthis none thisrxd#33829
lose_unitthis none thisrxd#33810
gain_unitthis none thisrxd#3382
_startthis none thisrxd#3382
_finishthis none thisrxd#3382
drink sipthis none nonerxd#3381
_start_drinkthis none thisrxd#33820
_finish_drinkthis none thisrxd#3388
dump emptythis none nonerxd#33818
smellthis none nonerxd#33814
weightthis none thisrxd#3388
can_globthis none thisrxd#3384
valuethis none thisrxd#3386
_breakthis none thisrxd#33813
on_spawnthis none thisrxd#33818
washnone with/using thisrxd#3388
percent_fullthis none thisrxd#3386
recyclethis none thisrxd#3384
supports_fishthis none thisrxd#3385
cant_fill_fromthis none thisrxd#3380
on_fill_fromthis none thisrxd#3380
toastany with/using thisrxd#33813
action_doing_msgthis none thisrxd#3387
drink drink2none out of/from inside/from thisrxd#3381
do_washthis none thisrxd#33835
unchuggablethis none thisrxd#3388
on_chugthis none thisrxd#3389
chug slam shoot poundthis none nonerxd#3385
chug_choke_chancethis none thisrxd#3381
entombthis none thisrxd#3385

Properties

PropertyDefinerFlagsOwnerValue
capacity#338rc#3615
infinite_fluid#338rc#3610
fillable#338rc#3611
hold_to_drink#338rc#3611
drink_msg#338rc#361"%DN takes a drink from %p %t."
recycle_on_empty#338rc#3610
fill_from_msg#338rc#361"%DN fills %p %t from %dl."
spawn_liquid#338rc#361#-1
wash_msg#338rc#361"%DN splashes water on %oself from %p %t."
show_contents#338rc#3611
unchuggable#338rc#361"it's just not feasible"
chug_start_msg#338rc#361"You tip back your %t and start chugging like mad."
ochug_start_msg#338rc#361"%DN tips back %p %t and chugs like mad."
chug_continue_msg#338rc#361"You continue chugging %dt."
ochug_continue_msg#338rc#361"%DN continues chugging %p %t."
chug_stop_msg#338rc#361"You put down your %t."
ochug_stop_msg#338rc#361"%DN puts down %p %t."
choke_start_msg#338rc#361"Ugh! You start choking on the liquid!"
ochoke_start_msg#338rc#361"%DN suddenly starts choking."
ochug_finish_msg#338rc#361"%DN lowers %p %t, wiping %p mouth with %p arm."
chug_finish_msg#338rc#361"You lower your %t, wiping your mouth with your arm."
junk_after_chug#338rc#3610
break_msg#255rc#361""
repair_difficulty#255rc#361<clear>
junk_on_break#255rc#3611
rename_on_break#255rc#361<clear>
smashable#255rc#361<clear>
repairable#255rc#361<clear>
armor#255rc#361<clear>
held_break_msg#255rc#361<clear>
oheld_break_msg#255rc#361<clear>
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#3615
min_skill#5rc#361<clear>
skill#5rc#361<clear>
recipe_for#5rc#361<clear>
carried_msg#5rc#361<clear>
aliases#1rc#361{"generic liquid container", "glc"}
description#1rc#361"A container for liquids."
object_size#1r#29{22952, 1298434482}
hidden_verbs#1rc#361<clear>
phelp_msg#1rc#361
list of 3{"It's a container for liquids. You can drink from it, and fill it from other liquid containers, fountains, or bodies of water. If you're IN a body of water (like a shower, river, or lake) try 'fill <this> from here'.", "", "You might not be able to tell what's in it just by looking, so be sure to smell it, too."}
weight#1rwc#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): #255 generic smashable thing#5 generic thing#1 root

Children: #134 generic power plant, #200 generic liquid fountain

Call graph

calls n338_0 #338:tell_contents n1_42 #1:occupants n338_0->n1_42 n107_43 #107:tell n338_0->n107_43 n338_21 #338:percent_full n338_0->n338_21 n20_6 #20:english_list n338_0->n20_6 n338_1 #338:look_self n338_1->n338_0 n255_2 #255:look_self n338_1->n255_2 n338_2 #338:acceptable n338_3 #338:capacity_left n338_2->n338_3 n338_3->n1_42 n338_4 #338:fill n338_4->n1_42 n338_4->n107_43 n338_4->n338_3 n44_0 #44:match n338_4->n44_0 n5_9 #5:iname n338_4->n5_9 n1_31 #1:dname n338_4->n1_31 n1_39 #1:dnamec n338_4->n1_39 n57_9 #57:valid n338_4->n57_9 n44_8 #44:match_ambiguous n338_4->n44_8 n45_2 #45:has_verb n338_4->n45_2 n1_66 #1:announce_action_text n338_4->n1_66 n20_34 #20:pronoun_sub n338_4->n20_34 n338_5 #338:fill_from n338_4->n338_5 n338_5->n338_3 n338_5->n1_39 n103_2 #103:junk n338_5->n103_2 n48_8 #48:suspend_if_needed n338_5->n48_8 n103_47 #103:valid n338_5->n103_47 n338_6 #338:lose_unit n338_6->n1_42 n338_6->n103_2 n338_10 #338:drink n92_2 #92:queue_action n338_10->n92_2 n338_11 #338:_start_drink n338_11->n1_42 n338_11->n107_43 n338_11->n1_39 n338_11->n20_34 n338_11->n338_6 n338_12 #338:_finish_drink n338_12->n1_42 n338_12->n1_31 n338_12->n103_2 n338_13 #338:dump n338_13->n1_42 n338_13->n107_43 n338_13->n1_31 n338_13->n1_39 n338_13->n1_66 n338_13->n20_34 n107_0 #107:_wield n338_13->n107_0 n6_169 #6:dnamec n338_13->n6_169 n57_1 #57:_recycle n338_13->n57_1 n338_14 #338:smell n338_14->n1_42 n338_14->n107_43 n338_14->n20_6 n338_14->n1_66 n338_14->n6_169 n338_16 #338:can_glob n5_21 #5:can_glob n338_16->n5_21 n338_18 #338:_break n338_18->n1_39 n255_1 #255:_break n338_18->n255_1 n338_19 #338:on_spawn n45_0 #45:has_property n338_19->n45_0 n5_15 #5:on_spawn n338_19->n5_15 n338_20 #338:wash n338_20->n1_42 n338_20->n107_43 n338_20->n92_2 n338_22 #338:recycle n338_22->n57_1 n5_8 #5:recycle n338_22->n5_8 n338_23 #338:supports_fish n338_23->n1_42 n338_26 #338:toast n338_26->n107_43 n338_26->n44_0 n338_26->n1_31 n338_26->n1_66 n338_26->n107_0 n338_26->n6_169 n107_167 #107:text_sub n338_26->n107_167 n338_27 #338:action_doing_msg n338_27->n1_31 n20_59 #20:name_and_number n338_27->n20_59

Showing 48 of 55 verbs; 7 not shown.

Source

tell_contents

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1if (!this.show_contents)
2return;
3endif
4holding = this:occupants($liquid);
5if (!holding)
6player:tell("It is empty.");
7else
8pct = this:percent_full();
9if (pct > 90)
10desc = "It's full of %t.";
11elseif (pct > 70)
12desc = "It's almost filled with %t.";
13elseif (pct > 40)
14desc = "It's about half full of %t.";
15elseif (pct > 25)
16desc = "It's less than half full of %t.";
17else
18desc = "It has a little %t at the bottom.";
19endif
20fn = {};
21for x in (holding)
22if (m = x.look_container_msg)
23fn = setadd(fn, m);
24endif
25endfor
26fn = $su:english_list(fn);
27player:tell(strsub(desc, "%t", fn));
28endif

look_self

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1pass(@args);
2this:tell_contents();

acceptable

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1what = args[1];
2if (!is_a(what, $liquid))
3return 0;
4endif
5if (this:capacity_left() < what.accumulation)
6return 0;
7endif
8return 1;

capacity_left

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1cap = this.capacity;
2for x in (this:occupants($liquid))
3cap = cap - x.accumulation;
4endfor
5return max(cap, 0);

fill

Spec this out of/from inside/from anyFlags rxdOwner #361Definer #338

Referenced by

none

Source

1target = $mu:match(iobjstr, {@player:occupants($thing), @player.location:occupants($thing), @player.location:occupants($exit), player.location});
2if (iobjstr == "here")
3target = player.location;
4endif
5if (!valid(target))
6player:tell("From a wha?");
7return;
8elseif (!$api.vessel:is_on(target))
9player:tell("You can't fill ", this:iname(), " from ", target:iname(), ".");
10return;
11elseif (target == this)
12player:tell("You can't fill ", this:dname(), " from itself because that's just stupid.");
13return;
14elseif (!this:capacity_left())
15player:tell(this:dnamec(), " is already full.");
16return;
17elseif (!this.health)
18player:tell("It's too broken to hold any liquid.");
19return;
20elseif (!$recycler:valid(target))
21target = $match_utils:match_ambiguous(iobjstr, {@player.contents, @player.location.contents});
22if (!$recycler:valid(target))
23player:tell("You don't see a '", iobjstr, "' to fill ", this:dname(), " from.");
24return;
25endif
26endif
27if (!$ou:has_verb(target, "lose_unit"))
28player:tell("You can't fill your ", this.name, " from ", target:iname(), ".");
29return;
30elseif (!this:capacity_left())
31player:tell("Your ", this.name, " is already full.");
32return;
33elseif (is_a(target, $thing) && (!target:occupants($liquid)))
34player:tell(target:dnamec(), " is empty.");
35return;
36elseif ($ou:has_verb(target, "cant_fill_from") && (m = target:cant_fill_from(player, this)))
37player:tell("You can't fill your ", this.name, " from ", target:dname(), ", because ", m, ".");
38return;
39endif
40player:aat($su:ps(target.fill_from_msg, player, this, target));
41this:fill_from(target);

fill_from

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1source = args[1];
2units = (length(args) > 1) ? args[2] | this:capacity_left();
3filled = 0;
4while (units > 0)
5if (valid(liquid = source:lose_unit()))
6liquid:add_to(this);
7units = units - 1;
8filled = filled + 1;
9else
10if (source.recycle_on_empty)
11if (is_a(this.location, $living))
12this.location:tell("You toss away the empty ", source.name, ".");
13endif
14$rpg:junk(source);
15else
16is_a(loc = this.location, $living) && loc:tell(source:dnamec(), " is now empty.");
17endif
18return;
19endif
20$cu:sin();
21endwhile
22`source:on_fill_from(this, filled) ! E_VERBNF => 0';
23if (($rpg:valid(source) && (!source:occupants($liquid))) && `source.recycle_on_empty ! ANY')
24if (is_a(this.location, $living))
25this.location:tell("You toss away the empty ", source.name, ".");
26endif
27$rpg:junk(source);
28endif
29is_a(this.location, $living) && this.location:tell(this:dnamec(), " is now full.");

lose_unit

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1if (liquids = this:occupants($liquid))
2liquid = liquids[random(length(liquids))];
3type = parent(liquid);
4liquid.accumulation = liquid.accumulation - 1;
5if (liquid.accumulation < 1)
6$rpg:junk(liquid);
7endif
8return type;
9endif
10return #-1;

gain_unit

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1type = args[1];
2type:add_to(this);

_start

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1action = args[2][1];
2return this:("_start_" + action)(@args);

_finish

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1action = args[2][1];
2return this:("_finish_" + action)(@args);

drink sip

Spec this none noneFlags rxdOwner #361Definer #338

Referenced by

none

Source

1player:queue_action(this, {"drink"}, 0, "drink " + this.name);

_start_drink

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1who = args[1];
2doses = (length(args) > 2) ? args[3] | 1;
3if (this.hold_to_drink)
4if (!who:_wield(this, 0, 1))
5player:tell("You'd have to be holding it first.");
6return E_NONE;
7endif
8endif
9if (!this:occupants($liquid))
10who:tell(this:dnamec(), " is empty.");
11return E_NONE;
12else
13m = this.drink_msg;
14if (m)
15who:aat($su:ps(m, who, this, this));
16endif
17liquid = this:lose_unit();
18liquid:drink(who, doses);
19return {1.0, 0};
20endif

_finish_drink

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1who = args[1];
2if (!this:occupants($liquid))
3who:tell("You drank the last drops from ", this:dname(), ".");
4if (this.recycle_on_empty)
5$rpg:junk(this);
6who.wielding = setremove(who.wielding, this);
7endif
8endif

dump empty

Spec this none noneFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (!(liquids = this:occupants($liquid)))
2player:tell(this:dnamec(), " is already empty.");
3elseif (this.location != player)
4player:tell("You're not holding ", this:dname(), ".");
5else
6player:_wield(this, 0, 1);
7if (is_a(player.location, #1034))
8player:aat($su:ps(("%DN dumps %p %t into the " + player.location.liquid.name) + ".", player, this));
9else
10player:aat(player:dnamec(), " dumps ", player.pp, " ", this.name, " out on the ", player.location:floor_msg(), ".");
11for x in (liquids)
12x:moveto(player.location);
13endfor
14endif
15if (this.recycle_on_empty && (!this.f))
16$recycler:_recycle(this);
17endif
18endif

smell

Spec this none noneFlags rxdOwner #361Definer #338

Referenced by

none

Source

1smells = {};
2player:aat(player:dnamec(), " sniffs at ", (this.location == player) ? player.pp | "the", " ", this.name, ".");
3for x in (this:occupants($liquid))
4if (s = x.smell_msg)
5if (!(x.smell_msg in smells))
6smells = {@smells, x.smell_msg};
7endif
8endif
9endfor
10if (smells)
11player:tell("It smells like ", $su:english_list(smells), ".");
12else
13player:tell("You don't smell anything.");
14endif

weight

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1wt = 0;
2if (this.weight != -1)
3for x in (this.contents)
4w = `x.weight_per_unit ! ANY => 0';
5wt = wt + (w * `x.accumulation ! ANY => 0');
6endfor
7endif
8return this.weight + wt;

can_glob

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (this.contents)
2return 0;
3endif
4return pass(@args);

value

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1wt = 0;
2for x in (this.contents)
3w = `x.value_per_unit ! ANY => 0';
4wt = wt + (w * x.accumulation);
5endfor
6return this.value + wt;

_break

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (!this.contents)
2return pass(@args);
3else
4if (is_a(this.location, $room))
5this.location:announce_all(this:dnamec(), " splits open, spilling liquid across the ", this.location:floor_msg(), ".");
6elseif (is_a(who = this.location, $creature))
7who:aat(who:dnamec(), "'s ", this.name, " breaks, soaking ", who.po, " with liquid.");
8endif
9for x in (this.contents)
10x:moveto(this.location);
11endfor
12pass(@args);
13endif

on_spawn

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1liquids = (typeof(this.spawn_liquid) == LIST) ? this.spawn_liquid | {this.spawn_liquid};
2lc = 1;
3for x in [1..this.capacity]
4yield;
5liquid = liquids[lc];
6lc = lc + 1;
7if (lc > length(liquids))
8lc = 1;
9endif
10if (valid(liquid))
11if ($ou:has_property(liquid, "blood"))
12liquid:add_to(this, lc, liquid.blood);
13else
14liquid:add_to(this, lc);
15endif
16endif
17endfor
18return pass(@args);

wash

Spec none with/using thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if ((!(d = player:occupants($decal))) && (!#43890:doses_for(player)))
2player:tell("You don't have any stains to wash off.");
3return;
4elseif (!(water = this:occupants(#169515)))
5player:tell("You can't wash with air. It's empty.");
6return;
7endif
8player:queue_action($actions.verb, {this, "do_wash", {player}, 3.0}, 1, "wash");

percent_full

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1hc = 0;
2for x in (this.contents)
3hc = hc + x.accumulation;
4endfor
5pct = toint((tofloat(hc) / tofloat(this.capacity)) * 100.0);
6return pct;

recycle

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1for x in (this.contents)
2$recycler:_recycle(x);
3endfor
4return pass(@args);

supports_fish

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (length(f = this:occupants($liquid)) == 1)
2if (is_a(f[1], #169515))
3return 1;
4endif
5endif

cant_fill_from

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

No program (verb defined but unprogrammed).

on_fill_from

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

No program (verb defined but unprogrammed).

toast

Spec any with/using thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (!player:_wield(this))
2player:tell("You'd have to be holding ", this:dname(), " to make a toast.");
3return;
4endif
5if (!valid(who = $mu:match(dobjstr, player.location:occupants($living))))
6player:aat(player:dnamec(), " raises ", player.pp, " ", this.name, (".  \"" + player:text_sub(("To " + dobjstr) + "!")) + "\"");
7elseif (!(drinks = who:occupants(#239716, "wielding")))
8player:tell(who:dnamec(), " isn't holding a drink.");
9elseif (who == player)
10player:aat(player:dnamec(), " raises ", player.pp, " ", this.name, ".  \"To ME!\"");
11else
12player:aat(player:dnamec(), " raises ", player.pp, " ", this.name, ", clinking it against ", who:dname(), "'s ", drinks[1].name, ".");
13endif

action_doing_msg

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1action = args[2][1];
2if (action == "drink")
3return "drinking from " + this:dname();
4else
5$nets.prognet:announce(#2, (((("unknown liquid (#239716) doing_msg => " + $su:nn(player)) + " used ") + $su:nn(this)) + " args: ") + toliteral(args), 1);
6return "";
7endif

drink drink2

Spec none out of/from inside/from thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1player:queue_action(this, {"drink"}, 0, "drink " + this.name);

do_wash

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1who = args[1];
2if ((!(d = who:occupants($decal))) && (!#43890:doses_for(who)))
3who:tell("You don't have any stains to wash off.");
4return;
5elseif (!(water = this:occupants(#169515)))
6who:tell("You can't wash with that.");
7return;
8endif
9water = water[1];
10decal = #-1;
11if (#43890:doses_for(who))
12who:aat(who:dnamec(), " frantically splashes ", water.name, " from ", who.pp, " ", this.name, " on ", who.po, "self.");
13#43890:remove_from(who, 1);
14(!this.infinite_fluid) && water:reduce_by(2);
15return;
16endif
17(!this.infinite_fluid) && water:reduce_by(5);
18for x in (d)
19if ((!x.f) && x.wipeable)
20decal = x;
21break;
22endif
23endfor
24if (!is_a(decal, $decal))
25who:tell("That didn't seem to work.");
26return;
27endif
28who:aat($su:ps(this.wash_msg, who, this, who.location, water, decal));
29od = parent(decal);
30decal:reduce_by(1);
31if (decal.location == who)
32who:tell("You got some of ", od:dname(), " off.");
33else
34who:tell("You got the last of ", od:dname(), " off.");
35endif

unchuggable

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1{who} = args;
2if (!this:occupants($liquid))
3return "it's empty";
4elseif (this.location != who)
5return "you're not holding it";
6else
7return this.unchuggable;
8endif

on_chug

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1{who} = args;
2drops = max(1, $skills.endurance:total(player) - 10);
3while (drops && `valid(l = this:occupants($liquid)[random($)]) ! E_INVARG => 0')
4n = min(drops, l.accumulation);
5l:drink(who, n);
6l:reduce_by(n);
7drops = drops - n;
8endwhile
9return {0, this:occupants($liquid)};

chug slam shoot pound

Spec this none noneFlags rxdOwner #361Definer #338

Referenced by

none

Source

1if (this.location == player)
2player:queue_action($actions.chug, {this}, 1, "chug " + this:dname());
3else
4player:tell("You have to be holding it.");
5endif

chug_choke_chance

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

none

Source

1return 0;

entomb

Spec this none thisFlags rxdOwner #361Definer #338

Referenced by

Source

1"Copied from generic liquid container (#239716):recycle by chill (#241405) Wed Jun  2 21:43:18 2010 CDT";
2for x in (this.contents)
3$recycler:_recycle(x);
4endfor
5return pass(@args);