From the NannyMUD documentation
2000-09-22
smorgasbord - A food object with edible parts.
/std/simple_food.c
add_part remove_part set_eat_msg
query_parts query_value
PROPERTY NAME
__no_eat_all - __no_eat_allDESCRIPTION
Prevents the eating of the whole item at once. If you set the value of this property to a string, that string will be written to the player, else a default message is given.
DESCRIPTION
NOTE
The usage of this object needs approval by the admin, as it is basically a portable healing system.NOTE
This food object is intended to be used for foods where you want the eater to be able to eat parts of it, like a pizza, a smoergaasbord etc.
FUNCTION
NAME
query_parts - Get a list of the parts and their data.SYNTAX
mapping query_parts()DESCRIPTION
This function returns a mapping with the edible parts as indices, and the data arrays as values. Note that the description is not included, as that is part of the 'items'. See the docs on /std/basic.c for more details on that.
FUNCTION
NAME
query_value - What is this item worth?SYNTAX
int query_value()DESCRIPTION
This function returns the value of the object, computed as value + 5 * heal + heal*heal / 9, with heal being the mean value of the sp and hp heal. The value set with 'set_value()' is used as a base value, and then the healing power of the object modify this in accordance with the rules.SEE ALSO
heal in RULES/heal heal in wizcommands/debug/heal
FUNCTION
NAME
add_part - Add an edible part to the food object.SYNTAX
varargs void add_part(string part, string desc, mixed hp, mixed sp, mixed stuff, mixed links)DESCRIPTION
With this function, you add a an edible part to the food object, and also set up how much hp and sp it is worth, as well as its stuffness. Note that the description of the item is added to the 'items' of the food, as to be possible to examine. The rest is added to the edible 'parts' of the food object. The values for hp, sp and stuff can be either integers, or strings. When the item is eaten, those values are passed through the eval function. The 'links' variable can either be zero, a string or an array of strings. It describes what parts have to be eaten before this part can be eaten.NOTE
By making mistakes on the links, you can make the object un-edible, as you can very well make circular lists: part A cannot be eaten until part B has been, but B cannot be eaten until A has been, etc.
FUNCTION
NAME
remove_part - Remove a part fo the food object.SYNTAX
void remove_part(string part)DESCRIPTION
This function will remove a part added earlier with add_part. Nothing will happen if you ry to remove a non-existant part.
FUNCTION
NAME
set_eat_msg - Set message to show when eaten.SYNTAX
void set_eat_msg(string msg)DESCRIPTION
This is really a function found in /std/simple_food.c, but as there are some differences between that and the smoergaasbord, this doc belongs here. The message set with this function is passed throug /std/msg.c when parts are eaten, but first the following tokens are replaced: $LP, $UP and $CP, which are lower_case, upper_case and capitalised versions of the part you are trying to eat.