-
add_metric_weight
varargs int add_metric_weight(int i,
object ob)
This function is notified to add weight from inventory, see
move(). This is masked by containers and stuff to do
significant things.
-
adjust_metric_weight
void adjust_metric_weight(int w)
This method adjusts the weight by the given number of centigrams.
- Parameters:
w - the amount to change the weight by
- See also:
set_metric_weight() and query_metric_weight()
-
adjust_money
varargs int adjust_money(mixed amt,
string coin)
This method changes the value of the object by a certain number of
coins. The coins can be any type.
- Returns:
the new value
- See also:
/obj/handlers/money_handler->query_total_value(), adjust_value(), query_money_array() and set_value()
-
adjust_value
int adjust_value(int i)
This method changes the current value of the object.
- Parameters:
i - the amount to change the value by
- Returns:
the new value of the object
-
adjust_weight
void adjust_weight(int w,
int unit)
This method adjusts the weight by the given amount expressed in
the given unit (following /include/units.h).
When overriding the adjust_weight function, it is advised to
mask adjust_metric_weight instead, as there are several things
which call only that; adjust_weight is merely a convenience
interface to adjust_metric_weight.
- Parameters:
w - the amount to change the weight by
unit - the unit the amount is expressed in (indicated in
number of metric units)
- See also:
adjust_metric_weight.c, set_weight() and query_weight()
-
print_complete_weight
string print_complete_weight(string unit)
This method returns the complete weight (so including inventory
for containers) expressed in the given unit, for printing as
debug information or querying by creators in a call.
-
print_length
string print_length(string unit)
This method returns the length expressed in the given unit, for
printing as debug information or querying by creators in a call.
-
print_weight
string print_weight(string unit)
This method returns the weight expressed in the given unit, for
printing as debug information or querying by creators in a call.
-
print_width
string print_width(string unit)
This method returns the width expressed in the given unit, for
printing as debug information or querying by creators in a call.
-
query_base_value
int query_base_value()
This method returns the vase value of the object. This is before
any scaling from things like condition occurs.
- Returns:
the base value
-
query_complete_float_weight
float query_complete_float_weight(int unit)
This method queries the weight of an object in the given weight
unit; for containers, the weight of inventory is added. This is
converted to a float because typical object weights will not be a
multiple of all weight units.
- See also:
query_complete_weight
.c
-
query_complete_metric_weight
int query_complete_metric_weight()
This method returns the current weight of the object in centigrams.
It does basicly the same thing as query_metric_weight, but takes
shadows into account.
- Returns:
the current weight of the object in centigrams.
- See also:
set_weight(), adjust_metric_weight() and query_metric_weight()
-
query_complete_weight
varargs int query_complete_weight(int unit)
This method queries the curent weight of the object, in the given
unit; for containers, the weight of inventory is added.
If no unit is given, then UNIT_NINTHPOUND is assumed, which
corresponds to 50 grams. The result is rounded up if the actual
weight cannot be expressed as a whole number of the given unit.
The use of this function without a unit argument is DEPRECATED.
Please supply the unit in all case.
-
query_float_length
float query_float_length(int unit)
This method queries the length of an object in the given length
unit. The width should be the shorter side of an object and the
length its longer one.
Note: this is a float, because typical sizes will not always be a
multiple of all size units.
- See also:
query_length
.c
-
query_float_weight
float query_float_weight(int unit)
This method queries the weight of an object in the given weight
unit. This is converted to a float because typical object weights
will not be a multiple of all weight units.
- See also:
query_weight
.c
-
query_float_width
float query_float_width(int unit)
This method queries the width of an object in the given length
unit. The width should be the shorter side of an object and the
length its longer one.
Note: this is a float, because typical sizes will not always be a
multiple of all size units.
- See also:
query_width
.c
-
query_length
int query_length(int unit)
This method queries the length of an object, in the given unit,
rounded up (units can be found in /include/units.h). The width
should be the shorter side of an object and the length its
longer one.
- See also:
set_length()
-
query_metric_length
int query_metric_length()
This method queries the length of an object in milimetres. The width
should be the shorter side of an object and the length its longer
one.
- Returns:
the amount the length is set to
- See also:
set_metric_length()
-
query_metric_weight
int query_metric_weight()
This method returns the current weight of the object in centigrams.
- Returns:
the current weight of the object
- See also:
query_weight(), set_metric_weight() and adjust_metric_weight()
-
query_metric_width
int query_metric_width()
This method queries the width of an object in milimetres. The width
should be the shorter side of an object and the length its longer
one.
- Returns:
the amount the width is set to
- See also:
set_metric_width()
-
query_money
int query_money(string type)
This method returns the number of coins of a certain
type that are in the value of the object. This is not
a good estimate of value or anything, no idea why it is
here really. I am sure I had a good reason
at the time :)
- Parameters:
type - the type of coin to look for
- Returns:
the number of coins of that type
- See also:
/obj/handlers/money_handlers->create_money_array(), set_value(), adjust_value(), adjust money(), query_money_array() and query_value()
-
query_money_array
mixed * query_money_array()
This method returns the value of the object as a money array. The
money array is a list oif coinages followed by a number of coins.
Eg: ({ "copper", 10, "silver", 12 }).
- See also:
/obj/handlers/money_handlers->create_money_array(), set_value(), adjust_value(), adjust_money() and query_value()
-
query_value
int query_value()
This method returns the current value of the object.
- Returns:
the current value of the object
-
query_value_at
int query_value_at(object place)
This method figures out how much an object will cost in a certain
place. For instance at a shop that does not handle artifcacts an
artifact will be bought and sold cheaply. The current types
of "artifact", "enchantment" and "material" are recognised.
A property in the shop of the type "artifact valued" will
cause the values of that type to be taken into account.
- Parameters:
place - the object to find the value at
- Returns:
the value in the shop
- See also:
query_value(), set_value_info() and adjust_value()
-
query_value_info
mapping query_value_info()
This method returns the information associated for all the special
bits of the object. The value infor maping ihas keys which are
the type of value info and the value is the value of it.
- Returns:
the value info mapping
- See also:
set_value_info(), query_value_at() and remove_value_info()
-
query_value_real
int query_value_real(string place)
This method always returns the most expensive value of an item.
This should be used for things like theif quotas and anything which
requires the real actual value of an item.
- Parameters:
place - the place to find the values in
-
query_weight
varargs int query_weight(int unit)
This method queries the curent weight of the object, in the given
unit. If no unit is given, then UNIT_NINTHPOUND is assumed, which
corresponds to 50 grams. The result is rounded up if the actual
weight cannot be expressed as a whole number of the given unit.
The use of this function without a unit argument is DEPRECATED.
Please supply the unit in all case.
- See also:
set_weight(), query_float_weight() and query_metric_weight()
-
query_width
int query_width(int unit)
This method queries the width of an object, in the given unit,
rounded up (units can be found in /include/units.h). The width
should be the shorter side of an object and the length its longer
one.
- See also:
set_width()
-
remove_value_info
void remove_value_info(string word)
This method removes the value information for a type of
special object. This is the extra value information associated
with the "artifact", "enchantment" or "material" of the object.
- Parameters:
word - the type of value information to remove
- See also:
query_value_at(), set_value_info() and set_value()
-
set_cm_length
void set_cm_length(int l)
This method sets the length to the given amount in centimeters.
- Parameters:
l - the amount to set the length to
- See also:
set_metric_length()
-
set_cm_width
void set_cm_width(int w)
This method sets the width to the given amount in centimeters.
- Parameters:
w - the amount to set the width to
- See also:
set_metric_width() and query_width
.c
-
set_gram_weight
void set_gram_weight(int w)
This method sets the weight of the object in grams (for more
precision, use set_metric_weight, which allows you to specify
centigrams).
When setting the weights of weapons use the following guide:
o===================o=====================o=======o
| Weapon | Approx. Weight (kg) | Grams |
o===================o=====================o=======o
| Dagger | 0.5 | 500 |
| War Hammer | 1.1 | 1100 |
| Mace | 1.3 | 1300 |
| Flail | 1.5 | 1500 |
| Pole Axe | 2.3 | 2300 |
| Short Sword | 0.8 | 800 |
| Broad Sword | 1.1 | 1100 |
| Long Sword | 1.4 | 1400 |
| Bastard Sword | 1.9 | 1900 |
| Two-handed Sword | 2.7 | 2700 |
o===================o=====================o=======o
- Parameters:
w - the amount to change the weight by
- See also:
set_metric_weight()
-
set_inch_length
void set_inch_length(int l)
This method sets the length to the given amount in inches. Note
that these are Discworld inches, defined as 25mm.
- Parameters:
l - the amount to set the length to
- See also:
set_metric_length()
-
set_inch_width
void set_inch_width(int w)
This method sets the width to the given amount in inches. Note
that these are Discworld inches, defined as 25mm.
- Parameters:
w - the amount to set the width to
- See also:
set_metric_width()
-
set_length
varargs void set_length(int l,
int unit)
This method sets the length to the given amount in the given unit.
If no unit is given, then a default of UNIT_INCH is assumed.
Use of this function without second argument is DEPRECATED.
Please always supply the unit explicitly, even when using inches!
- Parameters:
w - the amount to set the width to
- See also:
set_metric_length(), set_inch_length(), query_length()
-
set_metric_length
void set_metric_length(int l)
This method sets the length to the given amount in milimeters.
This is the base unit of Discworld.
Note: this is the function that is called by all functions which
set the length in a particular unit. Objects wishing to mask
length should mask just this function.
- Parameters:
l - the amount to set the length to
- See also:
query_metric_length(), set_length(), set_mm_length(), set_cm_length() and set_inch_length()
-
set_metric_weight
void set_metric_weight(int w)
This method sets the weight of the object in centigrams -- that is,
1/100 of a gram. To simplify calls for most objects, use
set_gram_weight or set_weight with a unit instead.
- See also:
adjust_metric_weight.c, query_metric_weight.c, set_gram_weight.c and set_weight
.c
-
set_metric_width
void set_metric_width(int w)
This method sets the width to the given amount in milimeters.
This is the base unit of Discworld.
Note: this is the function that is called by all functions which
set the width in a particular unit. Objects wishing to mask
width should mask just this function.
- Parameters:
w - the amount to set the width to
- See also:
query_metric_width(), set_width(), set_mm_width(), set_cm_width() and set_inch_width()
-
set_mm_length
void set_mm_length(int l)
This method sets the length to the given amount in milimeters.
- Parameters:
l - the amount to set the length to
- See also:
set_metric_length()
-
set_mm_width
void set_mm_width(int w)
This method sets the width to the given amount in milimeters.
- Parameters:
w - the amount to set the width to
- See also:
set_metric_width() and query_width
.c
-
set_value
void set_value(int number)
This method sets the value of the object. The actual value in
coins and so forth is worked out by the money handler based on the
value.
- Parameters:
number - the new value of the object
- See also:
query_value(), adjust_value() and query_money_array()
-
set_value_info
void set_value_info(string word,
int number)
This method sets the value information for a type of
special object. This is the extra value information associated
with the "artifact", "enchantment" or "material" of the object.
- Parameters:
word - the type of value information
number - the amount to set it to
- See also:
query_value_at(), remove_value_info() and set_value()
-
set_weight
varargs void set_weight(int w,
int unit)
This function sets the weight of the object expressed in the given
unit (following /include/units.h). The default, if no unit is
given, is UNIT_NINTHPOUND, so fifty gram unit. However, use of
this function without explicit unit is DEPRECATED. Please
indicate units, or use set_metric_weight for the basic unit
instead.
When overriding the set_weight function, it is advised to mask
set_metric_weight instead.
Note: for most objects, it is most convenient to set weights in
grams. This can be done directly using set_gram_weight.
- See also:
set_gram_weight (also for a list of recommended weights).c, set_weight.c and query_weight
.c
-
set_width
varargs void set_width(int w,
int unit)
This method sets the width to the given amount in the given unit.
If no unit is given, then a default of UNIT_INCH is assumed.
Use of this function without second argument is DEPRECATED.
Please always supply the unit explicitly, even when using inches!
- Parameters:
w - the amount to set the width to
- See also:
set_metric_width(), set_inch_width(), query_width()
-
weight_stat
string weight_stat(int metric)