generic food and drink 2 #132
Aliases: generic food and drink 2, gfad2
4 verbs · 24 properties · 1 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
eat drink swallow consume | this none none | rd | #132 | 18 |
init_for_core | this none this | rxd | #132 | 16 |
title short_title | this none this | rxd | #132 | 9 |
value | this none this | rxd | #132 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
units | #132 | rc | #36 | 1 |
solid | #132 | rc | #36 | 1 |
healing | #132 | rc | #36 | 0.1 |
heal_msg | #132 | rc | #36 | "" |
drop_failed_msg | #5 | rc | #36 | <clear> |
drop_succeeded_msg | #5 | rc | #36 | <clear> |
odrop_failed_msg | #5 | rc | #36 | <clear> |
odrop_succeeded_msg | #5 | rc | #36 | <clear> |
otake_succeeded_msg | #5 | rc | #36 | <clear> |
otake_failed_msg | #5 | rc | #36 | <clear> |
take_succeeded_msg | #5 | rc | #36 | <clear> |
take_failed_msg | #5 | rc | #36 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #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 | #1 | c | #36 | 0 |
aliases | #1 | rc | #36 | {"generic food and drink 2", "gfad2"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {4252, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #5 generic thing → #102 subthing → #1 Root Class
Children: #157 elixir
Call graph
Source
eat drink swallow consume
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
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
Referenced by
- #132:eat line 11:
this:short_title
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
Referenced by
none
Source
1return this.value_base * tofloat(this.units);