From the NannyMUD documentation

LAST CHANGE

2000-12-12

NAME

        simple_drink - Simple drink object.

INHERITS

	/std/basic_thing.c

FUNCTIONS

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

OTHER FUNCTIONS

	remote_prevent_drink
	remote_drink_callback

PROPERTIES

INTERNAL PROPERTIES


PROPERTY NAME

        _too_strong_msg - _too_strong_msg

DESCRIPTION

	This is sent to msg() if the drink is too strong.
	Default is "That is too strong for you.\n".

PROPERTY NAME

        prevent_drink_in_env - prevent_drink_in_env

DESCRIPTION

	If set, the player must have it in inventory to be able to drink 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 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.

FUNCTION


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.

FUNCTION


NAME

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

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.

FUNCTION


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.

FUNCTION


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");

FUNCTION


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.

FUNCTION


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.