[ 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

 o add_volume(int)
This method returns the amount of volume left for liquids to be added into.
 o calc_liquid()
 o cmp_amount_r(object, object)
 o cmp_weight_r(object, object)
 o drink_amount(int, object)
This method drinks a certain amount of the liquid in the container.
 o fullness_adjectives()
This returns an adjective for how full the current object is with liquid.
 o is_fighting_bottle_smashed(object, object)
This method checks to see if the person doing the drinking can hold onto their bottle without loosing it while in combat.
 o query_cont_volume()
 o query_fullness_desc()
This method returns the fullness description of the vessel.
 o query_leak_rate()
This method returns the leak rate of the container
 o query_liquid()
This method returns if this vessel is currenly a liquid.
 o query_liquid_desc()
This method returns the description of the liquid inside the vessel.
 o query_max_volume()
This method returns the current maxium volume associated with this container.
 o query_vessel()
 o query_volume()
This method returns the current amount of liquid in the container.
 o query_volume_left()
This method returns the amount of volume left for liquids to be added into.
 o remove_volume(int)
This method removes some volume of liquid from the container.
 o set_leak_rate(int)
This method sets the leak rate of the container.
 o set_max_volume(int)
This method sets the maximum volume of the container.
 o stats()
 o xfer_volume(int, object)
This method transfers a given amount of a liquid to a new container.

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
 * 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_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()
 * stats
mixed stats()
 * 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

Discworld MUD's distribution world wide web pages.
brought to you by
Cut Me Own Throat Dibbler's Sensational Sausages; buy one while they are hot.
File last modified: Sat, 07 Oct 2006 01:14:41 GMT

Lost? Try Discworld's home page.