[Package Index | Mudlib Index | Effect Index]
Written by Pinkfish
.
int adjust_cond(int i)This method adjust the current condition by the given amount. If resultant condition is less than the lowest condition, then the lowest condition is set to this value. If it is greater than the maximum condition. Then the condition is set to the maximum condition. If the condition is less than or equal to 0, then the object is attempted to be broken.
void break_me()This method breaks the object. This moves it into the recycled object section of the armoury or dests itself if this is not possible.
string cond_string()This method returns the current condition as a string.
void do_damage(string type, int amount)This method damages the object. The conditon is reduced by the amount multiplied by 1 + 2 * random(damage_chance) ewhic is then divided by 100. This means it does approximately the percentage of of the damage done to the object to its condition.
int query_cond()This method returns the current conditon.
int query_damage_chance()This method returns the percentage of the damage which is done to the object which will be carried through.
int query_hide_cond()This method returns whether the condition string returns "" or something meaning full.
int query_lowest_cond()This method returns the current lowest conditon.
int query_max_cond()This method returns the current maximum conditon.
void set_cond(int i)This method sets the current condition of the object. If this is lower than the current lowest conditon, then the lowest condition will be modified to be this.
void set_damage_chance(int number)This method sets the percentage of the damage which is done to the object which will be carried through.
Use the following chart to set the damage chance.
o==================o=====================o
| Material | Damage Chance |
o==================o=====================o
| Cloth | 20 |
| Hide | 17 |
| Bone | 16 |
| Leather | 15 |
| Wood | 12 |
| Copper | 10 |
| Bronze | 8 |
| Iron | 6 |
| Steel | 5 |
| Klatchian Steel | 3 |
| Stone | 3 |
| Octiron | 0 |
o==================o=====================o
void set_hide_cond(int i)This sets whether the condition string should be returned or not. This is for objects what indicate their condition with different long descriptions instead of the default condition string.
void set_lowest_cond(int i)This sets the lowest condition for the object. The lowest cond variable is used for repairing the armour... See where it was repaired to last time, this determines how difficult repairs will be...
void set_max_cond(int i)This sets up how much damage an object can take before it breaks. This should not be used in the actual object files unless under special circumstances. In weapon files, use new_weapon(). In armour files use setup_armour(). In clothing files, use setup_clothing(). Use ::Setup:: in clo, arm, imp and wep files.
The values may seem strange, as cloth can take more damage
per unit weight than steel. This is because steel weighs
so much, and cloth weighs so little.
o==================o=====================o
| Material | Maximum Condition |
| | per unit weight |
o==================o=====================o
| Cloth | 90 |
| Hide | 80 |
| Leather | 70 |
| Wood | 60 |
| Bone | 45 |
o==================o=====================o
| Copper | 30 |
| Stone | 40 |
| Bronze | 40 |
| Iron | 50 |
| Steel | 60 |
| Klatchian Steel | 70 |
| Octiron | 80 |
o==================o=====================o
void set_percentage(int i)This method is used to setup the objects condition. Once the maximum condition has been set, this is used to set the maximum condition to this percentage of the maximum condition. It sets the lowest conditon a random value from 70-100% of the current condition.