generic food #138
Aliases: generic food
16 verbs · 51 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
eat | this none none | rxd | #138 | 9 |
transfer_disease | this none this | rxd | #138 | 11 |
_eat | this none this | rxd | #138 | 22 |
_rot | this none this | rxd | #138 | 20 |
look_self | this none this | rxd | #138 | 22 |
set_bites | this none this | rxd | #138 | 6 |
set_blood | this none this | rxd | #138 | 1 |
tree_tag | this none this | rxd | #138 | 12 |
burn_up | this none this | rxd | #138 | 6 |
can_glob | this none this | rxd | #138 | 12 |
smell sniff | this none none | rxd | #138 | 31 |
rot_check | this none this | rxd | #138 | 44 |
cooked_blood | this none this | rxd | #138 | 1 |
drug | this none this | rxd | #138 | 1 |
tell_appraise | this none this | rxd | #138 | 16 |
eat_stress | this none this | rxd | #138 | 8 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
drug | #138 | rc | #29 | #895 |
bites | #138 | rc | #29 | 2 |
nutrition | #138 | rc | #29 | 1 |
eat_msg | #138 | rc | #29 | "%DN eats some of %p %t." |
eat_finish_msg | #138 | rc | #29 | "%DN eats the last of %p %t." |
blood | #138 | rc | #29 | {} |
rot_msg | #138 | rc | #29 | "%DT shrivels up and rots away." |
rot | #138 | rc | #29 | 0 |
rot_max | #138 | rc | #29 | 4 |
rot_chance | #138 | rc | #29 | 50 |
cook_to | #138 | rc | #29 | #-1 |
cook_msg | #138 | rc | #29 | "%DT blackens and is burned into cinders." |
remains | #138 | rc | #29 | #-1 |
edible | #138 | rc | #29 | 1 |
not_edible_msg | #138 | rc | #29 | "You can't eat %dt." |
no_engrave | #138 | rc | #29 | 1 |
smell_msg | #138 | rc | #29 | "" |
mostly_gone_msg | #138 | rc | #29 | "Most of it is already eaten." |
half_gone_msg | #138 | rc | #29 | "It's about half eaten." |
some_gone_msg | #138 | rc | #29 | "It's got a few bites missing." |
rot_msgs | #138 | rc | #29 | {"%DN smells a little funny, and seems shriveled.", "%DN smells pretty bad. It's starting to rot."} |
handed | #5 | rc | #29 | <clear> |
wield_msg | #5 | rc | #29 | <clear> |
unwield_msg | #5 | rc | #29 | <clear> |
size | #5 | rc | #29 | <clear> |
look_place_msg | #5 | rc | #29 | <clear> |
value | #5 | rc | #29 | 5 |
get_msg | #5 | rc | #29 | <clear> |
drop_msg | #5 | rc | #29 | <clear> |
get_fail_msg | #5 | rc | #29 | <clear> |
junk_ok | #5 | rc | #29 | <clear> |
floats | #5 | rc | #29 | <clear> |
long_name_msg | #5 | rc | #29 | <clear> |
article | #5 | rc | #29 | <clear> |
setup_list | #5 | rc | #29 | <clear> |
health | #5 | rc | #29 | <clear> |
health_max | #5 | rc | #29 | <clear> |
min_skill | #5 | rc | #29 | <clear> |
skill | #5 | rc | #29 | <clear> |
recipe_for | #5 | rc | #29 | <clear> |
carried_msg | #5 | rc | #29 | <clear> |
aliases | #1 | rc | #29 | {"generic food"} |
description | #1 | rc | #29 | "A gooey amorphous mass of protein." |
object_size | #1 | r | #29 | {12331, 1298433816} |
hidden_verbs | #1 | rc | #29 | list of 10{"hold", "stow", "@setup", "throw", "give", "junk", "appraise", "stash", "breakdown", "improvise"} |
phelp_msg | #1 | rc | #29 | list of 1{"Mmmmm, delicious food! Food keeps the hunger away. And hunger will kill you...or at least make you uncomfortable. Don't try hoarding the food though -- most foods will rot after a while if not kept in a refrigerator."} |
weight | #1 | rc | #29 | <clear> |
owner_verbs | #1 | rc | #29 | <clear> |
plural_name | #1 | rc | #29 | <clear> |
client_image | #1 | rc | #29 | <clear> |
listening | #1 | rc | #29 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #1 root
Children: none
Call graph
Source
eat
Referenced by
none
Source
1if (!this.edible) 2player:tell($su:ps(this.not_edible_msg, player, this)); 3elseif (this:drug(player):doses_for(player) > this:drug(player).overdosage) 4player:tell("Ugh, no. You couldn't eat another bite without throwing up."); 5elseif (this.location != player) 6player:tell("You're not holding it."); 7else 8player:queue_action($actions.eat, {this}, 1, "eat " + this:dname()); 9endif
transfer_disease
Referenced by
- #138:_eat line 15:
this:transfer_disease
Source
1victim = args[1]; 2if (this.blood != {}) 3for a in (this.blood) 4if (typeof(a) != LIST) 5$nets.bugnet:announce(#-1, "bad .blood of a food: " + $su:nn(this), 1); 6return; 7elseif (length(a) > 2) 8victim:ingest(a[1], a[3], 0); 9endif 10endfor 11endif
_eat
Referenced by
none
Source
1who = args[1]; 2who:_wield(this, 0, 1); 3bites = (length(args) > 1) ? args[2] | 1; 4if ($ou:has_property(who, "feed_msg")) 5m = who.feed_msg; 6elseif (this.bites > bites) 7m = this.eat_msg; 8else 9m = this.eat_finish_msg; 10endif 11who:aat($su:ps(m, who, this)); 12if ((this:drug(who) != #895) || (!#69007:doses_for(who))) 13who:ingest(this:drug(who), this.nutrition, 0); 14endif 15this:transfer_disease(who); 16this:eat_stress(who); 17if (!this.f) 18this.bites = this.bites - bites; 19if (this.bites < 1) 20$recycler:_recycle(this); 21endif 22endif
_rot
Referenced by
- #138:rot_check line 40:
this:_rot
Source
1if ((((!this.f) && (!children(this))) && (!verbs(this))) && gamevalid(this.location)) 2msg = $su:ps(this.rot_msg, this, this); 3if (is_a(this.location, $room)) 4this.location:announce_all(msg); 5else 6this.location.listening && this.location:tell(msg); 7endif 8if (typeof(this.remains) == LIST) 9remains = this.remains; 10elseif ((typeof(this.remains) == OBJ) && valid(this.remains)) 11remains = {this.remains}; 12else 13remains = {}; 14endif 15for x in (remains) 16remnant = $rpg:spawn(x); 17remnant:moveto(this.location); 18endfor 19move(this, $tomb); 20endif
look_self
Referenced by
none
Source
1pass(@args); 2msg = ""; 3if (this.rot >= toint(tofloat(this.rot_max) / 1.3)) 4msg = this.rot_msgs[2]; 5elseif (this.rot >= (this.rot_max / 2)) 6msg = this.rot_msgs[1]; 7endif 8if (msg) 9player:tell($su:ps(msg, this)); 10msg = ""; 11endif 12gone = toint((tofloat(this.bites) / tofloat(parent(this).bites)) * 100.0); 13if (gone < 30) 14msg = this.mostly_gone_msg; 15elseif (gone < 65) 16msg = this.half_gone_msg; 17elseif (gone < 95) 18msg = this.some_gone_msg; 19endif 20if (msg) 21player:tell($su:ps(msg, this)); 22endif
set_bites
Referenced by
none
Source
1value = args[1]; 2if (typeof(value) == NUM) 3this.bites = value; 4else 5return E_INVARG; 6endif
set_blood
Referenced by
none
Source
1this.blood = args[1];
tree_tag
Referenced by
none
Source
1x = pass(@args); 2if ((this.bites * this.nutrition) >= 300) 3x = tostr(x, " ", $ansi.red, $ansi.bold_on, this.bites, " x ", this.nutrition, $ansi.reset); 4else 5x = tostr(x, " ", $ansi.cyan, this.bites, " x ", this.nutrition, $ansi.reset); 6endif 7if (!this.rot_chance) 8x = tostr(x, $ansi.red, $ansi.bold_on, " (rot ", this.rot_chance, "% x ", this.rot_max, ")", $ansi.reset); 9else 10x = tostr(x, " (rot ", this.rot_chance, "% x ", this.rot_max, ")"); 11endif 12return x;
burn_up
Referenced by
none
Source
1this:room():announce_all($su:ps(this.cook_msg, this, this)); 2if (valid(this.cook_to)) 3newfood = $rpg:spawn(this.cook_to); 4newfood:moveto(this.location); 5endif 6$rpg:junk(this);
can_glob
Referenced by
none
Source
1return 0; 2if (this.bites != parent(this).bites) 3return 0; 4elseif (this.rot != parent(this).rot) 5return 0; 6elseif (this.drug != parent(this).drug) 7return 0; 8elseif (this.blood != parent(this).blood) 9return 0; 10else 11return pass(@args); 12endif
smell sniff
Referenced by
none
Source
1pct = toint((tofloat(this.rot) / tofloat(this.rot_max)) * 100.0); 2if (pct < 10) 3m = "very fresh"; 4elseif (pct < 25) 5m = "fresh"; 6elseif (pct < 50) 7m = "a little off"; 8elseif (pct < 70) 9m = "somewhat rank"; 10elseif (pct < 90) 11m = "rotten"; 12else 13m = "nauseatingly rotten"; 14endif 15player:aat(player:dnamec(), " smells ", this:dname(), "."); 16if (this.smell_msg) 17player:tell("It smells ", this.smell_msg, ". It smells ", m, "."); 18else 19player:tell("It smells ", m, "."); 20endif 21if (this.blood) 22a = {}; 23for x in (this.blood) 24if (m = `x[1].smell_msg ! ANY') 25a = {@a, m}; 26endif 27endfor 28if (a) 29player:tell("You catch a whiff of ", $su:english_list($lu:remove_duplicates(a)), "."); 30endif 31endif
rot_check
Referenced by
none
Source
1rotchance = this.rot_chance; 2if ((typeof(rotchance) != INT) || (rotchance < 1)) 3return; 4endif 5loc = this.location; 6g_area = $area; 7g_room = $room; 8while (valid(loc) && (!is_a(loc, g_area))) 9if (is_a(loc, #2801)) 10return; 11elseif (is_a(loc, g_room)) 12temp = tofloat(loc:temperature()); 13if (temp > 80.0) 14mult = 1.0 + ((temp - 80.0) / 80.0); 15elseif (temp >= 52.0) 16mult = 1.0; 17elseif (temp < 32.0) 18mult = 0.0; 19else 20mult = (temp - 32.0) / 20.0; 21endif 22rotchance = toint(ceil(tofloat(rotchance) * mult)); 23elseif (fridge = $code_utils:verb_or_property(loc, "fridge")) 24rotchance = rotchance - fridge; 25endif 26if (has_property(loc, "open") && loc.open) 27rotchance = toint(ceil(tofloat(rotchance) * 1.5)); 28endif 29loc = loc.location; 30endwhile 31if ($lu:is_one_of(this.location, {$creature, $container}) && (af = occupants(this.location, $decals.antifreeze_vomit))) 32rotchance = rotchance - (af[1].accumulation * af[1].fridge); 33endif 34if (rotchance < 1) 35return; 36endif 37if (random(100) <= rotchance) 38newrot = this.rot + 1; 39if (newrot > this.rot_max) 40this:_rot(); 41else 42this.rot = newrot; 43endif 44endif
cooked_blood
Referenced by
none
Source
1return this.blood;
drug
Referenced by
- #138:eat line 3:
this:drug - #138:eat line 3:
this:drug - #138:_eat line 12:
this:drug - #138:_eat line 13:
this:drug
Source
1return this.drug;
tell_appraise
Referenced by
none
Source
1roll = args[1]; 2r = pass(@args); 3ds = {}; 4diff = 0; 5for b in (this.blood) 6if (min(roll, $skills.chemistry:check(player, -2, 1)) > diff) 7if (d = b[1]:effect_description(b[3])) 8ds = listappend(ds, d); 9endif 10endif 11diff = diff + 2; 12endfor 13if (ds) 14player:tell("Eating this would cause you to ", $su:english_list(ds), "."); 15endif 16return r;
eat_stress
Referenced by
- #138:_eat line 16:
this:eat_stress
Source
1who = args[1]; 2if ((stress = this.eat_stress) && is_player(who)) 3if (stress > 0) 4who:gain_stress(stress); 5else 6who:lose_stress(stress); 7endif 8endif