NAME smoergaasbord.c - a food object with edible parts INHERITS /std/simple_food.c Read the doc on simple_food.doc for more details. SETUP FUNCTIONS add_part remove_part QUERY_FUNCTIONS query_parts query_value SPECIAL PROPERTIES __no_eat_all 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. NOTE The usage of this object needs approval by the admin, as it is basically a portable healing system. INTENDED USAGE 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. ========================================================================== 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. ========================================================================== 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 /doc/RULES/heal.r ========================================================================== 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. ========================================================================== 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. ========================================================================== 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. ==========================================================================
Help topics available:
complex_drink.doc | complex_food.doc | simple_food.doc | simple_drink.doc | smorgasbord.doc |
You are guest number 101 since November 2019.
This file was last modified: June 2000.