generic food and drink 2 #132

Parent #5Owner #36Flags read, fertileSource RPG Core/rpgcore-patched.db

Aliases: generic food and drink 2, gfad2

4 verbs · 24 properties · 1 children

Verbs

VerbSpecFlagsDefinerLines
eat drink swallow consumethis none nonerd#13218
init_for_corethis none thisrxd#13216
title short_titlethis none thisrxd#1329
valuethis none thisrxd#1321

Properties

PropertyDefinerFlagsOwnerValue
units#132rc#361
solid#132rc#361
healing#132rc#360.1
heal_msg#132rc#36""
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 7{"Unlike the original generic food & drink, this object will not combine with others of its kind", "(ie. 6 fries + 6 fries = 2 objects with 6 fries each).", "As a result, this version also has a consistant serving size and the player does not specify how many units.", "@set these properties:", "units => units => How many are in a serving?", "solid => 1 (0 is liquid)", "healing => 0.1 is default."}
key#1c#360
aliases#1rc#36{"generic food and drink 2", "gfad2"}
description#1rc#36<clear>
object_size#1r#36{4252, -1090650497}
html#1rc#36<clear>

Ancestry

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

Children: #157 elixir

Call graph

calls n132_0 #132:eat n6_18 #6:tell n132_0->n6_18 n63_1 #63:_recycle n132_0->n63_1 n35_1 #35:say_action n132_0->n35_1 n132_2 #132:title n132_0->n132_2 n132_1 #132:init_for_core n102_1 #102:init_for_core n132_1->n102_1

Source

eat drink swallow consume

Spec this none noneFlags rdOwner #2Definer #132

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("Try drinking it instead.");
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> some ", this:short_title(), "."));
12this.units = this.units - 1;
13if (`player.stats_current[2][4] < player.stats[2][4] ! E_PROPNF => 0')
14player:take_health(this.healing);
15if (this.healing > 0.05)
16player:tell("The nourishment makes you feel a bit better.");
17endif
18endif

init_for_core

Spec this none thisFlags rxdOwner #2Definer #132

Referenced by

none

Source

1if (caller_perms().wizard)
2if (this == $food2)
3this.build_help = {"Unlike the original generic food & drink, this object will not combine with others of its kind", "(ie. 6 fries + 6 fries = 2 objects with 6 fries each).", "As a result, this version also has a consistant serving size and the player does not specify how many units.", "@set these properties:", "units => units => How many are in a serving?", "solid => 1 (0 is liquid)", "healing => 0.1 is default."};
4this.units = 1;
5this.solid = 1;
6this.healing = 0.1;
7this.heal_msg = "";
8else
9for p in (properties($food2))
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 #132

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
9return valid(au = $ansi_utils) ? au:ansi_title(this, name) | name;

value

Spec this none thisFlags rxdOwner #2Definer #132

Referenced by

none

Source

1return this.value_base * tofloat(this.units);