From the NannyMUD documentation

LAST CHANGE

2000-12-12

NAME

        simple_food - A simple edible thing.

INHERITS

	basic_thing

FUNCTIONS

SETUP FUNCTIONS

	set_strength
	set_heal
	set_eat_msg
	set_empty_obj

QUERY FUNCTIONS

	query_strength
	query_heal
	query_empty_obj
	query_eat_msg
	query_food (always returns 1)

OTHER FUNCTIONS

	remote_prevent_eat
	remote_eat_callback
	remote_smell_callback

PROPERTIES

INTERNAL PROPERTIES


PROPERTY NAME

        _smell - _smell

DESCRIPTION

	The message written to this player when he/she/it smells it.

PROPERTY NAME

        prevent_eat_in_env - prevent_eat_in_env

DESCRIPTION

	If set, the player must have it in inventory to be able to eat it.
	If set to a string, the string is written to the player when trying
	to eat it, otherwise "What?" is written.

DESCRIPTION


NOTE

        Anything that uses this file has to be approved by the admin.

FUNCTION


NAME

        set_strength - Set how much food it is.

SYNTAX

void set_strength(int strength)

DESCRIPTION

	This sets how much food it is, a player can not eat things that
	has strength %gt;= his level * 8. Note that the 'strength' of the
	food does not affect how much it heals, only who can eat it and
	how much they can eat of it per minute.

FUNCTION


NAME

        set_heal - Set how much someone will heal from eating this.

SYNTAX

void set_heal(int heal)

DESCRIPTION

        This function sets how healing this food is. That is, how many
        hp and sp the player will get when eating this.
        The value can also be negative.

FUNCTION


NAME

        set_eat_msg - Set message to show when eaten.

SYNTAX

void set_eat_msg(string msg)

DESCRIPTION

        This is a standard form message that is shown when someone
        eats this object. See documentation for msg() in /std/msg.c
        for more information on this 'standard form'.

FUNCTION


NAME

        set_empty_obj - Set what will be left when eaten.

SYNTAX

void set_empty_obj(mixed empty_obj)

DESCRIPTION

        When this is eaten, empty_obj will be sent to eval(), and if the
        returning value is a string this will be cloned, else the returned
        value is assumed to be an object or zero.        If this operation results in an object, it will be moved to the
        same environment as the food that was eaten. The food itself will
        then selfdestruct.        Basically empty_obj should be one of four things:
                1, a filename to be cloned
                2, an object
                3, a string on the form "@func(arg)" that is evaluated
                   to return something that fits 1 or 2.
                4, zero, this will cause the object to simply go away
                   when eaten. This is the default
                5, a string on the form "a something" where "something"
                   will be sent to /std/lib for cloning

FUNCTION


NAME

        remote_prevent_eat - Prevent people to eat us.

SYNTAX

int remote_prevent_eat(object food)

DESCRIPTION

        This function is called in __remote when the player tries to
        eat this object. It should write a message and return 1 to
        prevent the object from being eaten.

FUNCTION


NAME

        remote_eat_callback - Do eat side effects.

SYNTAX

int remote_eat_callback(object food)

DESCRIPTION

        This function is called in __remote when the player eats the
        'food'. All checks has been done already, so this function can
        only be used to add side effects. It can not be used to prevent
        'food' from being eaten. It can however prevent the object from
        selfdestructing (or being replaced by empty_obj) by returning 1.

EXAMPLE

        int remote_eat_callback(object food)
        {
          this_player()->frog_curse(1);
          return 0;
        }

FUNCTION


NAME

        remote_smell_callback - Do smell side effects.

SYNTAX

void remote_smell_callback(object food)

DESCRIPTION

	This function is called in __remote when the player smells the 'food'.
	If it returns 1, no other messages will be written.