NAME
simple_food.c - a simple edible thing
INHERITS
basic_thing.c (see basic_thing.doc for more info)
SETUP FUNCTIONS
set_strength
set_heal
set_empty_obj
set_eat_msg
QUERY FUNCTIONS
query_strength
query_heal
query_empty_obj
query_eat_msg
query_food (always returns 1)
REMOTE FUNCTIONS
remote_prevent_eat
remote_eat_callback
remote_smell_callback
SPECIAL PROPERTIES
_smell: the message written to this player when he/she/it smells it.
NOTA BENE
Anything that uses this file has to be approved by the admin.
=======================================================================
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 >= 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.
=======================================================================
NAME
set_heal - set how much someone will heal from eating this
SYNTAX
void set_heal(int heal);
DESCRIPTION
The person eating this will heal this many hit points.
=======================================================================
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.
Basicall 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
=======================================================================
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'.
=======================================================================
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.
=======================================================================
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;
}
=======================================================================
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.
=======================================================================
Help topics available:
| complex_drink.doc | complex_food.doc | simple_food.doc | simple_drink.doc | smorgasbord.doc |
You are guest number 86 since September 2020.
This file was last modified: June 2000.