generic food #138

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

Aliases: generic food

16 verbs · 51 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
eatthis none nonerxd#1389
transfer_diseasethis none thisrxd#13811
_eatthis none thisrxd#13822
_rotthis none thisrxd#13820
look_selfthis none thisrxd#13822
set_bitesthis none thisrxd#1386
set_bloodthis none thisrxd#1381
tree_tagthis none thisrxd#13812
burn_upthis none thisrxd#1386
can_globthis none thisrxd#13812
smell sniffthis none nonerxd#13831
rot_checkthis none thisrxd#13844
cooked_bloodthis none thisrxd#1381
drugthis none thisrxd#1381
tell_appraisethis none thisrxd#13816
eat_stressthis none thisrxd#1388

Properties

PropertyDefinerFlagsOwnerValue
drug#138rc#29#895
bites#138rc#292
nutrition#138rc#291
eat_msg#138rc#29"%DN eats some of %p %t."
eat_finish_msg#138rc#29"%DN eats the last of %p %t."
blood#138rc#29{}
rot_msg#138rc#29"%DT shrivels up and rots away."
rot#138rc#290
rot_max#138rc#294
rot_chance#138rc#2950
cook_to#138rc#29#-1
cook_msg#138rc#29"%DT blackens and is burned into cinders."
remains#138rc#29#-1
edible#138rc#291
not_edible_msg#138rc#29"You can't eat %dt."
no_engrave#138rc#291
smell_msg#138rc#29""
mostly_gone_msg#138rc#29"Most of it is already eaten."
half_gone_msg#138rc#29"It's about half eaten."
some_gone_msg#138rc#29"It's got a few bites missing."
rot_msgs#138rc#29{"%DN smells a little funny, and seems shriveled.", "%DN smells pretty bad. It's starting to rot."}
handed#5rc#29<clear>
wield_msg#5rc#29<clear>
unwield_msg#5rc#29<clear>
size#5rc#29<clear>
look_place_msg#5rc#29<clear>
value#5rc#295
get_msg#5rc#29<clear>
drop_msg#5rc#29<clear>
get_fail_msg#5rc#29<clear>
junk_ok#5rc#29<clear>
floats#5rc#29<clear>
long_name_msg#5rc#29<clear>
article#5rc#29<clear>
setup_list#5rc#29<clear>
health#5rc#29<clear>
health_max#5rc#29<clear>
min_skill#5rc#29<clear>
skill#5rc#29<clear>
recipe_for#5rc#29<clear>
carried_msg#5rc#29<clear>
aliases#1rc#29{"generic food"}
description#1rc#29"A gooey amorphous mass of protein."
object_size#1r#29{12331, 1298433816}
hidden_verbs#1rc#29
list of 10{"hold", "stow", "@setup", "throw", "give", "junk", "appraise", "stash", "breakdown", "improvise"}
phelp_msg#1rc#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#1rc#29<clear>
owner_verbs#1rc#29<clear>
plural_name#1rc#29<clear>
client_image#1rc#29<clear>
listening#1rc#29<clear>

Ancestry

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

Children: none

Call graph

calls n138_0 #138:eat n107_43 #107:tell n138_0->n107_43 n20_34 #20:pronoun_sub n138_0->n20_34 n138_13 #138:drug n138_0->n138_13 n92_2 #92:queue_action n138_0->n92_2 n1_31 #1:dname n138_0->n1_31 n138_1 #138:transfer_disease n20_59 #20:name_and_number n138_1->n20_59 n138_2 #138:_eat n138_2->n20_34 n138_2->n138_13 n138_2->n138_1 n45_0 #45:has_property n138_2->n45_0 n138_15 #138:eat_stress n138_2->n138_15 n57_1 #57:_recycle n138_2->n57_1 n138_3 #138:_rot n138_3->n20_34 n103_1 #103:spawn n138_3->n103_1 n138_4 #138:look_self n138_4->n107_43 n138_4->n20_34 n1_9 #1:look_self n138_4->n1_9 n138_7 #138:tree_tag n5_18 #5:tree_tag n138_7->n5_18 n138_8 #138:burn_up n138_8->n20_34 n138_8->n103_1 n1_46 #1:room n138_8->n1_46 n103_2 #103:junk n138_8->n103_2 n138_9 #138:can_glob n5_21 #5:can_glob n138_9->n5_21 n138_10 #138:smell n138_10->n107_43 n138_10->n1_31 n1_66 #1:announce_action_text n138_10->n1_66 n6_169 #6:dnamec n138_10->n6_169 n20_6 #20:english_list n138_10->n20_6 n47_7 #47:remove_duplicates n138_10->n47_7 n138_11 #138:rot_check n138_11->n138_3 n51_36 #51:verb_or_property n138_11->n51_36 n47_64 #47:is_one_of n138_11->n47_64 n138_14 #138:tell_appraise n138_14->n107_43 n138_14->n20_6

Source

eat

Spec this none noneFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

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

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

none

Source

1value = args[1];
2if (typeof(value) == NUM)
3this.bites = value;
4else
5return E_INVARG;
6endif

set_blood

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

none

Source

1this.blood = args[1];

tree_tag

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none noneFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

none

Source

1return this.blood;

drug

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

Source

1return this.drug;

tell_appraise

Spec this none thisFlags rxdOwner #361Definer #138

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

Spec this none thisFlags rxdOwner #361Definer #138

Referenced by

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