skylib_fluffos_v3/
skylib_fluffos_v3/bin/
skylib_fluffos_v3/bin/db/
skylib_fluffos_v3/fluffos-2.9-ds2.04/
skylib_fluffos_v3/fluffos-2.9-ds2.04/ChangeLog.old/
skylib_fluffos_v3/fluffos-2.9-ds2.04/Win32/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/simuls/
skylib_fluffos_v3/fluffos-2.9-ds2.04/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/clone/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/command/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/data/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/etc/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/master/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/log/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/compiler/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/efuns/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/operators/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/u/
skylib_fluffos_v3/fluffos-2.9-ds2.04/tmp/
skylib_fluffos_v3/fluffos-2.9-ds2.04/windows/
skylib_fluffos_v3/mudlib/
skylib_fluffos_v3/mudlib/cmds/
skylib_fluffos_v3/mudlib/cmds/admin/
skylib_fluffos_v3/mudlib/cmds/guild-race/
skylib_fluffos_v3/mudlib/cmds/living/broken/
skylib_fluffos_v3/mudlib/cmds/player/group_cmds/
skylib_fluffos_v3/mudlib/cmds/playtester/
skylib_fluffos_v3/mudlib/d/admin/
skylib_fluffos_v3/mudlib/d/admin/room/
skylib_fluffos_v3/mudlib/d/admin/room/we_care/
skylib_fluffos_v3/mudlib/d/admin/save/
skylib_fluffos_v3/mudlib/d/admin/text/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/buildings/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/map/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/roads/
skylib_fluffos_v3/mudlib/d/learning/chars/
skylib_fluffos_v3/mudlib/d/learning/functions/
skylib_fluffos_v3/mudlib/d/learning/handlers/
skylib_fluffos_v3/mudlib/d/learning/help_topics/
skylib_fluffos_v3/mudlib/d/learning/help_topics/npcs/
skylib_fluffos_v3/mudlib/d/learning/help_topics/objects/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/RCS/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/crowd/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/situations/
skylib_fluffos_v3/mudlib/d/learning/save/
skylib_fluffos_v3/mudlib/d/learning/school/
skylib_fluffos_v3/mudlib/d/learning/school/add_sc/
skylib_fluffos_v3/mudlib/d/learning/school/characters/
skylib_fluffos_v3/mudlib/d/learning/school/general/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/basic_commands/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/edtutor/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/unix_tutor/
skylib_fluffos_v3/mudlib/d/learning/school/items/
skylib_fluffos_v3/mudlib/d/learning/school/npc_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/room_basic/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/situations/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/terrain_tutor/
skylib_fluffos_v3/mudlib/d/learning/text/
skylib_fluffos_v3/mudlib/d/liaison/
skylib_fluffos_v3/mudlib/d/mudlib/
skylib_fluffos_v3/mudlib/d/mudlib/changes/
skylib_fluffos_v3/mudlib/d/playtesters/
skylib_fluffos_v3/mudlib/d/playtesters/effects/
skylib_fluffos_v3/mudlib/d/playtesters/handlers/
skylib_fluffos_v3/mudlib/d/playtesters/items/
skylib_fluffos_v3/mudlib/d/sage/
skylib_fluffos_v3/mudlib/doc/
skylib_fluffos_v3/mudlib/doc/creator/
skylib_fluffos_v3/mudlib/doc/driver/
skylib_fluffos_v3/mudlib/doc/driver/efuns/arrays/
skylib_fluffos_v3/mudlib/doc/driver/efuns/buffers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/calls/
skylib_fluffos_v3/mudlib/doc/driver/efuns/compile/
skylib_fluffos_v3/mudlib/doc/driver/efuns/filesystem/
skylib_fluffos_v3/mudlib/doc/driver/efuns/floats/
skylib_fluffos_v3/mudlib/doc/driver/efuns/functions/
skylib_fluffos_v3/mudlib/doc/driver/efuns/general/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mappings/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mixed/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mudlib/
skylib_fluffos_v3/mudlib/doc/driver/efuns/numbers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/parsing/
skylib_fluffos_v3/mudlib/doc/login/
skylib_fluffos_v3/mudlib/doc/lpc/basic_manual/
skylib_fluffos_v3/mudlib/doc/lpc/intermediate/
skylib_fluffos_v3/mudlib/doc/new/add_command/
skylib_fluffos_v3/mudlib/doc/new/events/
skylib_fluffos_v3/mudlib/doc/new/handlers/
skylib_fluffos_v3/mudlib/doc/new/living/race/
skylib_fluffos_v3/mudlib/doc/new/living/spells/
skylib_fluffos_v3/mudlib/doc/new/object/
skylib_fluffos_v3/mudlib/doc/new/player/
skylib_fluffos_v3/mudlib/doc/new/room/guild/
skylib_fluffos_v3/mudlib/doc/new/room/outside/
skylib_fluffos_v3/mudlib/doc/new/room/storeroom/
skylib_fluffos_v3/mudlib/doc/object/
skylib_fluffos_v3/mudlib/doc/playtesters/
skylib_fluffos_v3/mudlib/doc/policy/
skylib_fluffos_v3/mudlib/doc/weapons/
skylib_fluffos_v3/mudlib/global/
skylib_fluffos_v3/mudlib/global/creator/
skylib_fluffos_v3/mudlib/handlers/
skylib_fluffos_v3/mudlib/include/casino/
skylib_fluffos_v3/mudlib/include/cmds/
skylib_fluffos_v3/mudlib/include/effects/
skylib_fluffos_v3/mudlib/include/npc/
skylib_fluffos_v3/mudlib/include/room/
skylib_fluffos_v3/mudlib/include/shops/
skylib_fluffos_v3/mudlib/net/daemon/
skylib_fluffos_v3/mudlib/net/daemon/chars/
skylib_fluffos_v3/mudlib/net/inherit/
skylib_fluffos_v3/mudlib/net/obj/
skylib_fluffos_v3/mudlib/net/obj/BACKUPS/
skylib_fluffos_v3/mudlib/obj/amulets/
skylib_fluffos_v3/mudlib/obj/armours/plate/
skylib_fluffos_v3/mudlib/obj/b_day/
skylib_fluffos_v3/mudlib/obj/clothes/transport/horse/
skylib_fluffos_v3/mudlib/obj/faith/symbols/
skylib_fluffos_v3/mudlib/obj/fungi/
skylib_fluffos_v3/mudlib/obj/gatherables/
skylib_fluffos_v3/mudlib/obj/instruments/
skylib_fluffos_v3/mudlib/obj/media/
skylib_fluffos_v3/mudlib/obj/misc/player_shop/
skylib_fluffos_v3/mudlib/obj/monster/godmother/
skylib_fluffos_v3/mudlib/obj/monster/transport/
skylib_fluffos_v3/mudlib/obj/rings/
skylib_fluffos_v3/mudlib/obj/scabbards/
skylib_fluffos_v3/mudlib/obj/spells/
skylib_fluffos_v3/mudlib/obj/stationery/
skylib_fluffos_v3/mudlib/obj/stationery/envelopes/
skylib_fluffos_v3/mudlib/obj/toys/
skylib_fluffos_v3/mudlib/obj/vessels/
skylib_fluffos_v3/mudlib/obj/weapons/axes/
skylib_fluffos_v3/mudlib/obj/weapons/chains/
skylib_fluffos_v3/mudlib/obj/weapons/maces/BACKUPS/
skylib_fluffos_v3/mudlib/save/autodoc/
skylib_fluffos_v3/mudlib/save/book_handler/
skylib_fluffos_v3/mudlib/save/books/history/calarien/
skylib_fluffos_v3/mudlib/save/mail/
skylib_fluffos_v3/mudlib/save/new_soul/data/
skylib_fluffos_v3/mudlib/save/parcels/
skylib_fluffos_v3/mudlib/save/playerinfo/
skylib_fluffos_v3/mudlib/save/players/d/
skylib_fluffos_v3/mudlib/save/players/s/
skylib_fluffos_v3/mudlib/save/random_names/
skylib_fluffos_v3/mudlib/save/random_names/data/
skylib_fluffos_v3/mudlib/save/terrains/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_desert/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_grassy_field/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_mountain/
skylib_fluffos_v3/mudlib/save/todo_lists/
skylib_fluffos_v3/mudlib/secure/
skylib_fluffos_v3/mudlib/secure/cmds/admin/
skylib_fluffos_v3/mudlib/secure/cmds/lord/
skylib_fluffos_v3/mudlib/secure/config/
skylib_fluffos_v3/mudlib/secure/handlers/autodoc/
skylib_fluffos_v3/mudlib/secure/handlers/intermud/
skylib_fluffos_v3/mudlib/secure/include/global/
skylib_fluffos_v3/mudlib/secure/save/
skylib_fluffos_v3/mudlib/secure/save/handlers/
skylib_fluffos_v3/mudlib/secure/std/
skylib_fluffos_v3/mudlib/secure/std/classes/
skylib_fluffos_v3/mudlib/secure/std/modules/
skylib_fluffos_v3/mudlib/std/creator/
skylib_fluffos_v3/mudlib/std/dom/
skylib_fluffos_v3/mudlib/std/effects/
skylib_fluffos_v3/mudlib/std/effects/external/
skylib_fluffos_v3/mudlib/std/effects/fighting/
skylib_fluffos_v3/mudlib/std/effects/magic/
skylib_fluffos_v3/mudlib/std/effects/magic/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/other/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/priest/
skylib_fluffos_v3/mudlib/std/effects/room/
skylib_fluffos_v3/mudlib/std/environ/
skylib_fluffos_v3/mudlib/std/guilds/
skylib_fluffos_v3/mudlib/std/guilds/old/
skylib_fluffos_v3/mudlib/std/languages/
skylib_fluffos_v3/mudlib/std/liquids/
skylib_fluffos_v3/mudlib/std/npc/
skylib_fluffos_v3/mudlib/std/npc/goals/
skylib_fluffos_v3/mudlib/std/npc/goals/basic/
skylib_fluffos_v3/mudlib/std/npc/goals/misc/
skylib_fluffos_v3/mudlib/std/npc/plans/
skylib_fluffos_v3/mudlib/std/npc/plans/basic/
skylib_fluffos_v3/mudlib/std/npc/types/
skylib_fluffos_v3/mudlib/std/npc/types/helper/
skylib_fluffos_v3/mudlib/std/npcs/
skylib_fluffos_v3/mudlib/std/outsides/
skylib_fluffos_v3/mudlib/std/races/shadows/
skylib_fluffos_v3/mudlib/std/room/basic/BACKUPS/
skylib_fluffos_v3/mudlib/std/room/basic/topography/
skylib_fluffos_v3/mudlib/std/room/controller/
skylib_fluffos_v3/mudlib/std/room/inherit/topography/
skylib_fluffos_v3/mudlib/std/room/topography/area/
skylib_fluffos_v3/mudlib/std/room/topography/iroom/
skylib_fluffos_v3/mudlib/std/room/topography/milestone/
skylib_fluffos_v3/mudlib/std/shadows/curses/
skylib_fluffos_v3/mudlib/std/shadows/disease/
skylib_fluffos_v3/mudlib/std/shadows/fighting/
skylib_fluffos_v3/mudlib/std/shadows/healing/
skylib_fluffos_v3/mudlib/std/shadows/magic/
skylib_fluffos_v3/mudlib/std/shadows/poison/
skylib_fluffos_v3/mudlib/std/shadows/room/
skylib_fluffos_v3/mudlib/std/shops/controllers/
skylib_fluffos_v3/mudlib/std/shops/objs/
skylib_fluffos_v3/mudlib/std/shops/player_shop/
skylib_fluffos_v3/mudlib/std/socket/
skylib_fluffos_v3/mudlib/std/soul/d/
skylib_fluffos_v3/mudlib/std/soul/e/
skylib_fluffos_v3/mudlib/std/soul/i/
skylib_fluffos_v3/mudlib/std/soul/j/
skylib_fluffos_v3/mudlib/std/soul/k/
skylib_fluffos_v3/mudlib/std/soul/l/
skylib_fluffos_v3/mudlib/std/soul/n/
skylib_fluffos_v3/mudlib/std/soul/o/
skylib_fluffos_v3/mudlib/std/soul/q/
skylib_fluffos_v3/mudlib/std/soul/r/
skylib_fluffos_v3/mudlib/std/soul/u/
skylib_fluffos_v3/mudlib/std/soul/v/
skylib_fluffos_v3/mudlib/std/soul/y/
skylib_fluffos_v3/mudlib/std/soul/z/
skylib_fluffos_v3/mudlib/std/stationery/
skylib_fluffos_v3/mudlib/w/
skylib_fluffos_v3/mudlib/w/default/
skylib_fluffos_v3/mudlib/w/default/armour/
skylib_fluffos_v3/mudlib/w/default/clothes/
skylib_fluffos_v3/mudlib/w/default/item/
skylib_fluffos_v3/mudlib/w/default/npc/
skylib_fluffos_v3/mudlib/w/default/room/
skylib_fluffos_v3/mudlib/w/default/weapon/
skylib_fluffos_v3/mudlib/www/
skylib_fluffos_v3/mudlib/www/java/
skylib_fluffos_v3/mudlib/www/secure/
skylib_fluffos_v3/mudlib/www/secure/lpc/advanced/
skylib_fluffos_v3/mudlib/www/secure/lpc/intermediate/
skylib_fluffos_v3/win32/
/**
 * This class keeps track of the condition of a particular object.  It
 * handles damaging the object when it is hit and the lowest conditon to
 * which the object has been damaged.  The lowest conditon keeps track of
 * how hard the object is to fix.  If an object has been reduced to really
 * shaggy condition at one point, it will be a lot harder to fix from then
 * on.
 * @author Pinkfish
 */
#include <armoury.h>
#include <move_failures.h>

#define DAMAGE_NORM 100

nosave int cond, max_cond, lowest_cond, damage_chance, hide_cond;

void create() {
   max_cond = 1;
} /* create() */

/* This should be masked. */
/**
 * This method breaks the object.  This moves it into the recycled
 * object section of the armoury or dests itself if this is not
 * possible.
 */
void break_me() {
   if( (int)TO->move( "/room/rubbish" ) != MOVE_OK )
       move_object("/room/rubbish");
} /* break_me() */

/**
 * This method returns the current condition as a string.
 * @return the string value of the condition
 */
string cond_string() {
   string str;

   if( cond > max_cond )
       cond = max_cond;
   if( hide_cond )
       return "";

   str = ({"It is", "They are"})[query_group(TO)]+" ";

   switch( ( 100 * cond ) / max_cond ) {
      case 91 .. 100 :
         return str + "in excellent condition.\n";
      case 81 .. 90 :
         return str + "in very good condition.\n";
      case 71 .. 80 :
         return str + "in good condition.\n";
      case 61 .. 70 :
         return str + "in OK condition.\n";
      case 51 .. 60 :
         return str + "in fairly good condition.\n";
      case 41 .. 50 :
         return str + "in fairly poor condition.\n";
      case 31 .. 40 :
         return str + "in poor condition.\n";
      case 21 .. 30 :
         return str + "in really poor condition.\n";
      case 11 .. 20 :
         return str + "in very poor condition.\n";
      case 1 .. 10 :
         return str + "in atrocious condition.\n";
      default :
         return str + "a complete wreck.\n";
   }
} /* cond_string() */

/**
 * 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, and wep files.
 * <p>
 * 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.
 * <br><br>
 * o==================o=====================o<br>
 * |     Material     |  Maximum Condition  |<br>
 * |                  |   per unit weight   |<br>
 * o==================o=====================o<br>
 * | Cloth            |         90          |<br>
 * | Hide             |         80          |<br>
 * | Leather          |         70          |<br>
 * | Wood             |         60          |<br>
 * | Bone             |         45          |<br>
 * o==================o=====================o<br>
 * | Copper           |         30          |<br>
 * | Stone            |         40          |<br>
 * | Bronze           |         40          |<br>
 * | Iron             |         50          |<br>
 * | Steel            |         60          |<br>
 * | Klatchian Steel  |         70          |<br>
 * | Octiron          |         80          |<br>
 * o==================o=====================o
 *
 * @see new_weapon
 * @see setup_armour
 * @see setup_clothing
 * @see set_weight
 * @see set_damage_chance
 */
void set_max_cond(int i) { max_cond = 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.
 * @param i the new condition
 * @see adjust_condition
 */
void set_cond( int i ) {
   cond = ( i < 0 ? 0 : i );

   if( cond < lowest_cond )
       lowest_cond = cond;

   if( cond <= 0 ) {
       if( ENV(TO) && !ENV(TO)->query_property("don't break contents") )
           TO->break_me();
       return 0;
   }
} /* set_cond() */

/**
 * 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.
 * @param i the amount to adjust the condition by
 * @return the new condition
 * @see set_cond()
 */
int adjust_cond( int i ) {
   cond += i;

   if( cond < 0 )
       cond = 0;
   if( cond < lowest_cond )
       lowest_cond = cond;
   if( cond > max_cond )
       cond = max_cond;
   if( cond <= 0 ) {
       if( ENV(TO) && !ENV(TO)->query_property( "don't break contents" ) )
           TO->break_me();
       return 0;
   }
   return cond;
} /* adjust_cond() */

/**
 * 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...
 * @param i the new lowest condition
 * @see adjust_cond()
 * @see set_cond()
 */
void set_lowest_cond(int i) { lowest_cond = 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.
 * @param i set it to 1 to hide the condition string.
 */
void set_hide_cond(int i) { hide_cond = i; }

/**
 * This method returns the current conditon.
 * @return the current condition
 */
int query_cond() {
  if( cond > max_cond )
      cond = max_cond;
  return cond;
} /* query_cond() */

/**
 * This method returns the current maximum conditon.
 * @return the current maximum condition
 */
int query_max_cond() { return max_cond; }

/**
 * This method returns the current lowest conditon.
 * @return the current lowest condition
 */
int query_lowest_cond() { return lowest_cond; }

/**
 * This method returns whether the condition string returns "" or something
 * meaning full.
 * @return the current lowest condition
 */
int query_hide_cond() { return hide_cond; }

/**
 * 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.
 * @param i the percentage condiion
 * @see /handlers/armoury.c
 * @see set_cond()
 * @see set_lowest_cond()
 * @see query_max_cond()
 */
void set_percentage(int i) {
   if( i > 100 )
       i = 100;
   set_cond( ( query_max_cond() * i ) / 100 );
   set_lowest_cond( ( query_cond() * ( random(30) + 70 ) ) / 100 );
} /* set_percentage() */

/**
 * This method returns the percentage of the damage which is done to the
 * object which will be carried through.
 * @return the damage chance
 * @see do_damage()
 */
int query_damage_chance() { return damage_chance; }

/**
 * This method sets the percentage of the damage which is done to the
 * object which will be carried through.
 * <p>
 * Use the following chart to set the damage chance.
 * <br><br>
 * o==================o=====================o<br>
 * |     Material     |    Damage Chance    |<br>
 * o==================o=====================o<br>
 * | Cloth            |         20          |<br>
 * | Hide             |         17          |<br>
 * | Bone             |         16          |<br>
 * | Leather          |         15          |<br>
 * | Wood             |         12          |<br>
 * | Copper           |         10          |<br>
 * | Bronze           |          8          |<br>
 * | Iron             |          6          |<br>
 * | Steel            |          5          |<br>
 * | Klatchian Steel  |          3          |<br>
 * | Stone            |          3          |<br>
 * | Octiron          |          0          |<br>
 * o==================o=====================o
 *
 * @see new_weapon
 * @see setup_armour
 * @see setup_clothing
 * @see set_weight
 * @see set_max_cond
 * @see query_damage_chance()
 * @see do_damage()
 * @param number the new damage chance
 */
void set_damage_chance( int number ) { damage_chance = number; }

/**
 * 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.
 * @see set_damage_chance()
 * See query_damage_chance()
 */
void do_damage( string type, int amount ) {
   int wholes, parts;

   wholes = amount * ( 1 + random( damage_chance ) + random( damage_chance ) );
   parts = wholes % DAMAGE_NORM;
   wholes /= DAMAGE_NORM;
   if( random( DAMAGE_NORM ) < parts )
       wholes++;
   adjust_cond( -wholes );
} /* do_damage() */

/** @ignore */
mixed *stats() {
   return
      ({
         ({ "condition", cond }),
         ({ "max cond", max_cond }),
         ({ "lowest cond", lowest_cond }),
         ({ "damage chance", damage_chance }),
         ({ "hide cond", hide_cond }),
      });
} /* stats() */

/** @ignore */
mapping query_static_auto_load() {
   mapping m;

   m = ([ ]);

   if( max_cond )
       m["max cond"] = max_cond;
   if( damage_chance )
       m["damage chance"] = damage_chance;
   if( hide_cond )
       m["hide cond"] = hide_cond;

   return m;

} /* query_static_auto_load */

/** @ignore */
void init_static_arg( mapping map ) {
   if( !undefinedp( map[ "max cond" ] ) )
       max_cond = map[ "max cond" ];
   if( !undefinedp( map[ "damage chance" ] ) )
       damage_chance = map[ "damage chance" ];
   if( !undefinedp( map[ "hide cond" ] ) )
       hide_cond = map[ "hide cond" ];
} /* init_static_arg() */

/** @ignore */
mapping query_dynamic_auto_load() {
   mapping m;

   if( cond > max_cond )
       cond = max_cond;
   if( lowest_cond > cond )
       lowest_cond = cond;

   m = ([ ]);

   if( cond )
       m["cond"] = cond;
   if( lowest_cond )
       m["lowest cond"] = lowest_cond;

   return m;

} /* query_dynamic_auto_load */

/** @ignore */
void init_dynamic_arg( mapping map ) {
   if( !undefinedp( map[ "cond" ] ) )
       cond = map[ "cond" ];
   if( !undefinedp( map[ "lowest cond" ] ) )
       lowest_cond = map[ "lowest cond" ];
} /* init_dynamic_arg() */