generic food and drink #131

Parent #113Owner #36Flags read, fertileSource QuestCore.db

Aliases: generic food and drink, gfad

3 verbs · 26 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
eat drink swallow consumethis none nonerd#13118
init_for_corethis none thisrxd#13116
title short_titlethis none thisrxd#13115

Properties

PropertyDefinerFlagsOwnerValue
units#131rc#361
solid#131rc#361
healing#131rc#360.1
heal_msg#131rc#36""
script#131rc#36{}
help_msg#113rc#36"Edible items restore lost health eating or drinking them."
been_told#113r#2<clear>
drop_failed_msg#5rc#36<clear>
drop_succeeded_msg#5rc#36<clear>
odrop_failed_msg#5rc#36<clear>
odrop_succeeded_msg#5rc#36<clear>
otake_succeeded_msg#5rc#36<clear>
otake_failed_msg#5rc#36<clear>
take_succeeded_msg#5rc#36<clear>
take_failed_msg#5rc#36<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#36
list of 6{"This version of food will recombine with others of its type (ie. 6 fries + 6 fries = 12 fries).", "@set these properties:", "units => How many are available in the collective mass?", "solid => 1 (0 is liquid)", "healing => 0.1 is default.", "heal_msg => What is told to the player if noticible healing occurs."}
key#1c#360
aliases#1rc#36{"generic food and drink", "gfad"}
description#1rc#36<clear>
object_size#1r#36{3974, -1090650497}

Ancestry

Ancestors (nearest first): #113 generic collective thing#5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n131_0 #131:eat n6_18 #6:tell n131_0->n6_18 n63_1 #63:_recycle n131_0->n63_1 n35_1 #35:say_action n131_0->n35_1 n131_2 #131:title n131_0->n131_2 n131_1 #131:init_for_core n102_1 #102:init_for_core n131_1->n102_1

Source

eat drink swallow consume

Spec this none noneFlags rdOwner #2Definer #131

Referenced by

none

Source

1if (this.solid && (verb == "drink"))
2return player:tell("You can't drink a solid!");
3elseif ((!this.solid) && (verb == "eat"))
4return player:tell("It is a liquid; you can drink it.");
5elseif (!this.units)
6player:tell("There is none left!");
7if (!this.f)
8return $recycler:_recycle(this);
9endif
10endif
11$you:say_action(tostr("%N %<", verb, "s> ", this:short_title(), "."));
12this.units = this.units - 1;
13if (player.stats_current[2][4] < player.stats[2][4])
14player:take_health(this.healing);
15if (this.healing > 0.05)
16player:tell(this.heal_msg || "The nourishment makes you feel a bit better.");
17endif
18endif

init_for_core

Spec this none thisFlags rxdOwner #2Definer #131

Referenced by

none

Source

1if (caller_perms().wizard)
2if (this == $food1)
3this.build_help = {"This version of food will recombine with others of its type (ie. 6 fries + 6 fries = 12 fries).", "@set these properties:", "units => How many are available in the collective mass?", "solid => 1 (0 is liquid)", "healing => 0.1 is default.", "heal_msg => What is told to the player if noticible healing occurs."};
4this.units = 1;
5this.solid = 1;
6this.healing = 0.1;
7this.heal_msg = "";
8else
9for p in (properties($food1))
10if ((!p) in {"build_help", "help_msg"})
11clear_property(this, p);
12endif
13endfor
14endif
15return pass(@args);
16endif

title short_title

Spec this none thisFlags rxdOwner #36Definer #131

Referenced by

Source

1name = this.name;
2if (verb == "short_title")
3if (`name[1..2] == "a " ! E_RANGE => 0')
4name = name[3..$];
5elseif (`name[1..3] == "an " ! E_RANGE => 0')
6name = name[4..$];
7endif
8endif
9title = valid(au = $ansi_utils) ? au:ansi_title(this, name) | name;
10if (this.solid)
11blurb = "";
12blurb = this.units ? tostr(this.units) | "empty";
13title = blurb ? tostr(name, "(", blurb, ")") | title;
14endif
15return title;