[ Package Index | Mudlib Index | Effect Index ]

File /obj/container.c

This is main container type object that players will use. For example, buckets and stuff would use this. A backpack would be a type of clothing and a potion bottle should be a vessel.

See also:
/obj/vessel.c and /obj/clothing.c

Written by Who knows, Pinkfish, Ember, Jeremy


Inherits

This class inherits the following classes /std/container.c and /std/basic/close_lock_container.c

Includes

This class includes the following files /include/move_failures.h, /include/parse_command.h and /include/potion_attrs.h

Method index

 o add_ps_vect(int *, int)
This method adds a potion space vector with a particular quantity to the object.
 o begin_config()
 o change_concentration(mixed *, int)
This method changes the concentration of the liquid to be a new and exciting concentration.
 o check_breakages()
This method checks to see if any of the things contained in the container should be broken.
 o config(int, mixed)
 o consistency_string(int)
 o contents_vect()
This method returns the vector of the contents of the container.
 o dest_active_contents()
This method will destroy all the liquid contents of the object.
 o empty_formula()
This method returns the amount of the liquid you can actually empty from a container.
 o end_config()
 o ensure_open()
This method returns true if the object is open and prints a message about the open status of the object.
 o fullness_adjectives()
This returns an adjective for how full the current object is with liquid.
 o liquid_name()
This method returns the name of the current liquid inside the container.
 o merge_potions(mixed *, mixed *, int, int, int)
 o mix_liq(mixed *, mixed *, int, int, int)
 o parse_command_adjectiv_id_list()
 o parse_command_id_list()
 o query_active_attrs()
 o query_all_attrs()
 o query_frac_parse_id(mixed *)
 o query_full_weight()
This method returns the full weight of the container.
 o query_leak_rate()
This method returns the leak rate of the container
 o query_liquid_short()
This method returns the short description of the liquid.
 o query_max_volume()
This method returns the current maxium volume associated with this container.
 o query_misc_attrs()
 o query_parse_id(mixed *)
 o query_ps_coord()
This method returns the potion space co-ordinates of the liquid.
 o query_ps_quantity()
This method returns the quantity of liquid at the potion space.
 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 query_water_volume()
This method returns the volume of water in the container.
 o query_weight_left()
This method returns the current amount of weight left that can be filled on the container.
 o remove_volume(int)
This method removes some volume of liquid from the container.
 o set_full_weight(int)
This method sets the weight of the container when it is full.
 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 set_max_weight(int)
This method sets the maximum weight of the container.
 o set_misc_attrs(mixed *, int)
 o set_ps_coord_quantity(int *, int)
This method sets the quantity of the position space co-ordinate to be the new quantity.
 o set_ps_quantity(int)
 o set_volume(int)
This method sets the current amount of liquid in the container.
 o set_water_volume(int)
This method sets the volume of water in the container.
 o sort_func(int *, int *)
 o stats()
 o test_add(object, int)
This method stops the container being added when it is closed.
 o transfer_liquid_to(object, int, mixed *, int, int *, int)
This method does the actual liquid transfer, as needed by the filling, emptying and pour operations.
 o transparency_string(int)
 o update_potion_parse()
This method updates the values used for the find_match() parseing due to the liquids.
 o void_liquid()
This method zaps all the liquid stuff in the container.

Public Functions

These are functions that everyone can access.

.
 * add_ps_vect
void add_ps_vect(int * v,
                 int quant)
This method adds a potion space vector with a particular quantity to the object.

Parameters:
v - the vector to add
quant - the quantity to add
 * begin_config
void begin_config()
 * change_concentration
mixed * change_concentration(mixed * potion,
                             int new_conc)
This method changes the concentration of the liquid to be a new and exciting concentration.

Parameters:
potion - the potion to change the concentration of
new_conc - the new concentration of the liquid
 * check_breakages
void check_breakages()
This method checks to see if any of the things contained in the container should be broken.

See also:
/std/container->add_weight()
 * config
void config(int vari,
            mixed cont)
 * consistency_string
string consistency_string(int cons)
 * contents_vect
int * contents_vect()
This method returns the vector of the contents of the container. This is based on the vectors of all the liquid with a vector set on them.

 * dest_active_contents
int dest_active_contents()
This method will destroy all the liquid contents of the object.

Returns:
the number of object destroyed
 * empty_formula
int empty_formula()
This method returns the amount of the liquid you can actually empty from a container.

Returns:
the amount of liquid that can be emptied
 * end_config
void end_config()
 * ensure_open
int ensure_open()
This method returns true if the object is open and prints a message about the open status of the object.

Returns:
1 if it is open, 0 if not
 * 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()
 * liquid_name
string liquid_name()
This method returns the name of the current liquid inside the container.

Returns:
the name of the current liquid
 * merge_potions
mixed * merge_potions(mixed * potion1,
                      mixed * potion2,
                      int vol1,
                      int vol2,
                      int tot_vol)
 * mix_liq
mixed * mix_liq(mixed * arr1,
                mixed * arr2,
                int vol1,
                int vol2,
                int tot_vol)
 * parse_command_adjectiv_id_list
string * parse_command_adjectiv_id_list()
 * parse_command_id_list
string * parse_command_id_list()
 * query_active_attrs
int * query_active_attrs()
 * query_all_attrs
int * query_all_attrs()
 * query_frac_parse_id
object query_frac_parse_id(mixed * arr)
 * query_full_weight
int query_full_weight()
This method returns the full weight of the container.

See also:
set_full_weight() and query_weight()
 * query_leak_rate
int query_leak_rate()
This method returns the leak rate of the container

See also:
set_leak_rate()
 * query_liquid_short
string query_liquid_short()
This method returns the short description of the liquid.

Returns:
the short description of the liquid
See also:
query_liquid_name()
 * query_max_volume
int query_max_volume()
This method returns the current maxium volume associated with this container.

Returns:
the current maximum volume
 * query_misc_attrs
int * query_misc_attrs()
 * query_parse_id
object query_parse_id(mixed * arr)
 * query_ps_coord
int * query_ps_coord()
This method returns the potion space co-ordinates of the liquid.

Returns:
the potion space co-ordinates
See also:
query_ps_quantity()
 * query_ps_quantity
int query_ps_quantity()
This method returns the quantity of liquid at the potion space.

Returns:
the quantity of liquid
See also:
query_ps_coord() and set_ps_quantity()
 * 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()
 * query_water_volume
int query_water_volume()
This method returns the volume of water in the container.

See also:
set_water_volume()
 * query_weight_left
int query_weight_left()
This method returns the current amount of weight left that can be filled on the container.

Returns:
the current amount of weight left
 * remove_volume
int remove_volume(int vol_lost)
This method removes some volume of liquid from the container.

See also:
add_volume() and query_volume()
 * set_full_weight
void set_full_weight(int i)
This method sets the weight of the container when it is full.

Parameters:
i - the new weight of the containe when full.
See also:
query_full_weight() and set_weight()
 * 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 i)
This method sets the maximum volume of the container. This also sets the maximum weight of the container to one tenth of the volume (if there is not current maximum weight).

Parameters:
i - the new maximum volume
See also:
set_max_weight() and add_volume()
 * set_max_weight
void set_max_weight(int i)
This method sets the maximum weight of the container. This also sets the maximum volume of the container to 10 times its maximum weight. (If there is no current maximum volume).

Parameters:
i - the maxium weight of the container
See also:
set_max_volume() and add_weight()
 * set_misc_attrs
void set_misc_attrs(mixed * new_misc_attrs,
                    int misc_vol)
 * set_ps_coord_quantity
void set_ps_coord_quantity(int * new_coord,
                           int new_quantity)
This method sets the quantity of the position space co-ordinate to be the new quantity.

Parameters:
new_coord - the new co-ordinate of the liquid
new_quantity - the new quantity of the liquid
 * set_ps_quantity
void set_ps_quantity(int n)
 * set_volume
void set_volume(int i)
This method sets the current amount of liquid in the container. If the container has a leak rate, it starts to leak.

Parameters:
i - the new amount of liquid in the containe
See also:
query_volume() and set_leak_rate()
 * set_water_volume
void set_water_volume(int n)
This method sets the volume of water in the container.

Parameters:
n - the new volume of water
 * sort_func
int sort_func(int * x,
              int * y)
 * stats
mixed stats()
 * test_add
int test_add(object ob,
             int flag)
This method stops the container being added when it is closed. It also handles the same flags as the liing object. We assume this is not the same as the default containers used by things like item rooms and such.

Parameters:
ob - the object being added
flag - the addition flag
See also:
/std/basic/move.c
 * transfer_liquid_to
void transfer_liquid_to(object dest,
                        int vol_misc,
                        mixed * misc,
                        int vol_water,
                        int * coord,
                        int quantity)
This method does the actual liquid transfer, as needed by the filling, emptying and pour operations.

Parameters:
dest - where the liquid is to go
vol_misc - the volume of non-water to move
misc - the attributes for the non-water
vol_water - the volume of water to move
coord - the co-ordinate of the liquid
quantity - the quantity of the potion space liquid
 * transparency_string
string transparency_string(int trans)
 * update_potion_parse
void update_potion_parse()
This method updates the values used for the find_match() parseing due to the liquids.

See also:
/secure/simul_efun->find_match()
 * void_liquid
void void_liquid()
This method zaps all the liquid stuff in the container.


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: Thu, 18 Sep 2003 18:23:38 GMT

Lost? Try Discworld's home page.