[Package Index | Mudlib Index | Effect Index]

File /obj/vessel.c

This is a container specifically for holding liquids. The hope is to reduce the memory requirements by taking all of the liquid stuff out of /obj/container, since most of the containers are sacks and chests. Also, the reaction handler will replace the potion space.

Some additional notes:

  1. As is (hopefully) documented elsewhere, the base units of volume for most continuous media are drops and pinches, both of which are roughly 1/4 of a cc. This means that water has 200 drops per weight unit (1g/cc). Non-continuous objects are assumed to be the same density as water.

Inherits

This class inherits the following classes /obj/baggage.c

Includes

This class includes the following files /include/volumes.h, /include/tasks.h and /include/move_failures.h

Method index

Public Functions

These are functions that everyone can access.

add_volume
int add_volume(int vol)

This method returns the amount of volume left for liquids to be added into.

Parameters:
vol - the amount of volume added

Returns:
1 if the addition was successful, 0 if not

See also:
add_volume()


calc_liquid
void calc_liquid()
cmp_amount_r
int cmp_amount_r(object a,
                 object b)
cmp_weight_r
int cmp_weight_r(object a,
                 object b)
drink_amount
int drink_amount(int drinking,
                 object player)

This method drinks a certain amount of the liquid in the container. It will do all the fudging for being in combat and drinking too much, as well as dropping the bottle and so on.

Parameters:
drinking - the amount to drink
player - the person doing the drinking


fullness_adjectives
string * fullness_adjectives()

This returns an adjective for how full the current object is with liquid. This is used in the parse command handling code.

Returns:
the fullness adjective

See also:
query_max_volume()


is_fighting_bottle_smashed
int is_fighting_bottle_smashed(object player,
                               object me)

This method checks to see if the person doing the drinking can hold onto their bottle without loosing it while in combat. Warning! This code may be used in other objects to deal with handling drinking while in combat.

Parameters:
player - the player doing the drinking
me - the object being drunk

Returns:
1 if the bottle is stopped, 0 if it is not


query_cont_volume
int query_cont_volume()
query_fullness_desc
string query_fullness_desc()

This method returns the fullness description of the vessel.

Returns:
the fullness description of the vessel


query_leak_rate
int query_leak_rate()

This method returns the leak rate of the container

Returns:
the current leak rate

See also:
set_leak_rate()


query_liquid
int query_liquid()

This method returns if this vessel is currenly a liquid. This means it has a liquid inside it.

Returns:
1 if it is a liquid, 0 if not

See also:
calc_liquid()


query_liquid_desc
string query_liquid_desc()

This method returns the description of the liquid inside the vessel.

Returns:
the current liquids description


query_max_volume
int query_max_volume()

This method returns the current maxium volume associated with this container.

Returns:
the current maximum volume


query_vessel
int query_vessel()
query_volume
int query_volume()

This method returns the current amount of liquid in the container.

Returns:
the current amount of liquid in the container


query_volume_left
int query_volume_left()

This method returns the amount of volume left for liquids to be added into.

Returns:
the amount of volume left

See also:
add_volume() and transfer_liquid_to()


remove_volume
int remove_volume(int vol_lost)

This method removes some volume of liquid from the container.

Parameters:
vol_lost - the amount of volume removed

See also:
add_volume() and query_volume()


set_hide_fullness_desc
void set_hide_fullness_desc()

This method sets the fullness description to be hidden in verbose look.

Parameters:

Returns:
void

See also:
query_fullness_desc(), query_fullness(), set_show_fullness_desc()


set_leak_rate
void set_leak_rate(int i)

This method sets the leak rate of the container. The leak rate is how fast stuff leaks out of the container.

Parameters:
i - the new leak rate of the container

See also:
query_leak_rate()


set_max_volume
void set_max_volume(int v)

This method sets the maximum volume of the container.

Parameters:
v - the new maximum volume

See also:
add_volume() and query_max_volume()


set_show_fullness_desc
void set_show_fullness_desc()

This method sets the fullness description to be displayed in verbose look.

Parameters:

Returns:
void

See also:
query_fullness_desc(), query_fullness(), set_hide_fullness_desc()


xfer_volume
int xfer_volume(int vol_xferred,
                object dest)

This method transfers a given amount of a liquid to a new container.

Parameters:
dest - the destination of the liquid
vol_xferred - the amount of volume transfered