generic liquid container #338
Aliases: generic liquid container, glc
35 verbs · 61 properties · 2 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
tell_contents | this none this | rxd | #338 | 28 |
look_self | this none this | rxd | #338 | 2 |
acceptable | this none this | rxd | #338 | 8 |
capacity_left | this none this | rxd | #338 | 5 |
fill | this out of/from inside/from any | rxd | #338 | 41 |
fill_from | this none this | rxd | #338 | 29 |
lose_unit | this none this | rxd | #338 | 10 |
gain_unit | this none this | rxd | #338 | 2 |
_start | this none this | rxd | #338 | 2 |
_finish | this none this | rxd | #338 | 2 |
drink sip | this none none | rxd | #338 | 1 |
_start_drink | this none this | rxd | #338 | 20 |
_finish_drink | this none this | rxd | #338 | 8 |
dump empty | this none none | rxd | #338 | 18 |
smell | this none none | rxd | #338 | 14 |
weight | this none this | rxd | #338 | 8 |
can_glob | this none this | rxd | #338 | 4 |
value | this none this | rxd | #338 | 6 |
_break | this none this | rxd | #338 | 13 |
on_spawn | this none this | rxd | #338 | 18 |
wash | none with/using this | rxd | #338 | 8 |
percent_full | this none this | rxd | #338 | 6 |
recycle | this none this | rxd | #338 | 4 |
supports_fish | this none this | rxd | #338 | 5 |
cant_fill_from | this none this | rxd | #338 | 0 |
on_fill_from | this none this | rxd | #338 | 0 |
toast | any with/using this | rxd | #338 | 13 |
action_doing_msg | this none this | rxd | #338 | 7 |
drink drink2 | none out of/from inside/from this | rxd | #338 | 1 |
do_wash | this none this | rxd | #338 | 35 |
unchuggable | this none this | rxd | #338 | 8 |
on_chug | this none this | rxd | #338 | 9 |
chug slam shoot pound | this none none | rxd | #338 | 5 |
chug_choke_chance | this none this | rxd | #338 | 1 |
entomb | this none this | rxd | #338 | 5 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
capacity | #338 | rc | #361 | 5 |
infinite_fluid | #338 | rc | #361 | 0 |
fillable | #338 | rc | #361 | 1 |
hold_to_drink | #338 | rc | #361 | 1 |
drink_msg | #338 | rc | #361 | "%DN takes a drink from %p %t." |
recycle_on_empty | #338 | rc | #361 | 0 |
fill_from_msg | #338 | rc | #361 | "%DN fills %p %t from %dl." |
spawn_liquid | #338 | rc | #361 | #-1 |
wash_msg | #338 | rc | #361 | "%DN splashes water on %oself from %p %t." |
show_contents | #338 | rc | #361 | 1 |
unchuggable | #338 | rc | #361 | "it's just not feasible" |
chug_start_msg | #338 | rc | #361 | "You tip back your %t and start chugging like mad." |
ochug_start_msg | #338 | rc | #361 | "%DN tips back %p %t and chugs like mad." |
chug_continue_msg | #338 | rc | #361 | "You continue chugging %dt." |
ochug_continue_msg | #338 | rc | #361 | "%DN continues chugging %p %t." |
chug_stop_msg | #338 | rc | #361 | "You put down your %t." |
ochug_stop_msg | #338 | rc | #361 | "%DN puts down %p %t." |
choke_start_msg | #338 | rc | #361 | "Ugh! You start choking on the liquid!" |
ochoke_start_msg | #338 | rc | #361 | "%DN suddenly starts choking." |
ochug_finish_msg | #338 | rc | #361 | "%DN lowers %p %t, wiping %p mouth with %p arm." |
chug_finish_msg | #338 | rc | #361 | "You lower your %t, wiping your mouth with your arm." |
junk_after_chug | #338 | rc | #361 | 0 |
break_msg | #255 | rc | #361 | "" |
repair_difficulty | #255 | rc | #361 | <clear> |
junk_on_break | #255 | rc | #361 | 1 |
rename_on_break | #255 | rc | #361 | <clear> |
smashable | #255 | rc | #361 | <clear> |
repairable | #255 | rc | #361 | <clear> |
armor | #255 | rc | #361 | <clear> |
held_break_msg | #255 | rc | #361 | <clear> |
oheld_break_msg | #255 | rc | #361 | <clear> |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | 5 |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic liquid container", "glc"} |
description | #1 | rc | #361 | "A container for liquids." |
object_size | #1 | r | #29 | {22952, 1298434482} |
hidden_verbs | #1 | rc | #361 | <clear> |
phelp_msg | #1 | rc | #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 | #1 | rwc | #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): #255 generic smashable thing → #5 generic thing → #1 root
Children: #134 generic power plant, #200 generic liquid fountain
Call graph
Showing 48 of 55 verbs; 7 not shown.
Source
tell_contents
Referenced by
- #338:look_self line 2:
this:tell_contents
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
Referenced by
- #134:look_self line 2:
pass(
Source
1pass(@args); 2this:tell_contents();
acceptable
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
Referenced by
- #338:acceptable line 5:
this:capacity_left - #338:fill line 14:
this:capacity_left - #338:fill line 30:
this:capacity_left - #338:fill_from line 2:
this:capacity_left
Source
1cap = this.capacity; 2for x in (this:occupants($liquid)) 3cap = cap - x.accumulation; 4endfor 5return max(cap, 0);
fill
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
Referenced by
- #338:fill line 41:
this:fill_from
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
Referenced by
- #338:_start_drink line 17:
this:lose_unit
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
Referenced by
none
Source
1type = args[1]; 2type:add_to(this);
_start
Referenced by
none
Source
1action = args[2][1]; 2return this:("_start_" + action)(@args);
_finish
Referenced by
none
Source
1action = args[2][1]; 2return this:("_finish_" + action)(@args);
drink sip
Referenced by
none
Source
1player:queue_action(this, {"drink"}, 0, "drink " + this.name);
_start_drink
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
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
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
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
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
Referenced by
none
Source
1if (this.contents) 2return 0; 3endif 4return pass(@args);
value
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
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
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
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
Referenced by
- #338:tell_contents line 8:
this:percent_full
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
Referenced by
- #134:recycle line 2:
pass(
Source
1for x in (this.contents) 2$recycler:_recycle(x); 3endfor 4return pass(@args);
supports_fish
Referenced by
none
Source
1if (length(f = this:occupants($liquid)) == 1) 2if (is_a(f[1], #169515)) 3return 1; 4endif 5endif
cant_fill_from
Referenced by
none
Source
No program (verb defined but unprogrammed).
on_fill_from
Referenced by
none
Source
No program (verb defined but unprogrammed).
toast
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
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
Referenced by
none
Source
1player:queue_action(this, {"drink"}, 0, "drink " + this.name);
do_wash
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
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
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
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
Referenced by
none
Source
1return 0;
entomb
Referenced by
- #134:entomb line 3:
pass(
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);