NAME
simple_drink.c - simple drink object
INHERITS
/std/basic_thing.c see basic_thing.doc for further details
SETUP FUNCTIONS
set_strength
set_soak
set_heal
set_drink_msg
set_empty_obj
QUERY_FUNCTIONS
query_strength
query_heal
query_soak
query_empty_obj
query_drink_msg
query_drink
REMOTE FUNCTIONS
remote_prevent_drink
remote_drink_callback
SPECIAL PROPERTIES
_too_strong_msg: this is sent to msg() if the drink is too strong,
default is "That is too strong for you.\n"
NOTA BENE
Anything that uses this file has to be approved by the admin.
==========================================================================
NAME
set_strength - set how intoxicating the drink is
SYNTAX
void set_strength(int strength);
DESCRIPTION
This function sets how intoxicated the player will become when
drinking this drink. The value can also be negative. The value
is sent to eval() when the player drinks the drink.
==========================================================================
NAME
set_soak - set how thirst quenching the drink is
SYNTAX
void set_soak(int soak);
DESCRIPTION
This function sets how thirst quenching this drink is. The only
effect of this value is that a player can not drink any amount of
thirst quenching drinks. The value can also be negative. The value
is sent to eval() when the player drinks the drink.
==========================================================================
NAME
set_heal - set how healing he drink is
SYNTAX
void set_heal(int heal);
DESCRIPTION
This function sets how healing this drink is. That is, how many
hp and sp the player will get when drinking this drink.
The value can also be negative. The value is sent to eval() when
the player drinks the drink.
==========================================================================
NAME
set_drink_msg - set the drink message
SYNTAX
void set_drink_msg(string msg);
DESCRIPTION
The argument to this function will be eval:ed and sent to msg()
when someone drinks this drink.
==========================================================================
NAME
set_empty_obj - give a replacement when this is empty
SYNTAX
void set_empty_obj(mixed ob);
DESCRIPTION
The default is that when you drink this drink the object self-
destructs and nothing is left. With this function you can make
another object take it's place, such as an empty cup or an empty
bottle. The argument should either be the file name of something
to clone, or the actual object itself. Since 'ob' is sent to eval()
it can also be a reference to a function that returns the object
you want.
EXAMPLE
set_empty_obj("a bottle");
==========================================================================
NAME
remote_prevent_drink - do extra checks before drinking
SYNTAX
int remote_prevent_drink(object drink)
DESCRIPTION
This function is called in the __remote object when someone tries
to drink this drink. If for some reason this player isn't allowed
to drink this drink remote_prevent_drink should write some approperiate
message and return 1.
==========================================================================
NAME
remote_drink_callback - do extra effects
SYNTAX
int remote_drink_callback(object drink);
DESCRIPTION
This function lets you do extra interesting stuff when someone
drinks this drink. It is called after all the checks has been done,
the messages have been written and the healing/intoxication/soak
has been added. If remote_drink_callback returns 1, the drink itself
will not selfdestruct or replace itself with the empty_obj.
==========================================================================
Help topics available:
| complex_drink.doc | complex_food.doc | simple_food.doc | simple_drink.doc | smorgasbord.doc |
You are guest number 172 since January 2020.
This file was last modified: June 2000.