--------------------------------------------------------------------------------
MATERIALS
--------------------------------------------------------------------------------
All equipment should have a support for materials. When used properly, the item
weight is calculated automatically using the stats below.
The following stats should be set to calculate item weight:
- materials
- size
- size to weight ratio
Functions for setting these stats:
- set_materials( mapping )
- set_size( integer )
- set_size_ratio( float )
--------------------------------------------------------------------------------
ITEM MATERIALS
--------------------------------------------------------------------------------
An item's materials is a list of materials with a percentage value (100% in
total). The percentage is a portion of the total weight.
Example ( a longsword ):
- Code: Select all
set_materials( ([
"steel" : 95, // the sword will be mostly made of steel
"leather" : 5, // the handle can have leather covering
]) );
--------------------------------------------------------------------------------
SIZE
--------------------------------------------------------------------------------
Size is a percentage of relative size to an average human (170cm). Thus, an item
with size of 10, will be 17cm in diameter/length/etc. This works in conjunction
with size to weight ratio, which is explained below.
Example ( a longsword ):
- Code: Select all
set_size( 75 ); // the longsword has a length of ~127cm
--------------------------------------------------------------------------------
SIZE TO WEIGHT RATIO
--------------------------------------------------------------------------------
Whereas size will define how large an object will be, the size to weight ratio
will define how much of the item's size is used to calculate weight.
For example, the longsword has a size of 75 (~127cm). However, the sword is not
a shapeless chunk of iron, but a slender piece of craftsmanship. so it will have
a fairly small size to weight ratio, let's say it would be 0.25. That means,
when calculating the weight, the size and materials will be reduced by this
ratio.
Example ( a longsword ):
- Code: Select all
set_size_ratio( 0.25 ); // the sword is quite slender