
This file describes the rules for creating armours in Genesis.
==============================================================

Armours are created by cloning or inheriting the file "/std/armour.c".
The armours can then be configured by calling the functions that are 
described in the file.

Armours are made unique by using different armour types, armour classes, 
and armour modifiers. The document /doc/man/Genesis/armour_guide contains
several tables of standard armours, listing how armour type, armour class,
and armour modifiers are used in armour creation.


  o Armour type.

    This indicates what part of the body that the armour protects. Armour 
    types generally correspond to hitlocations. There is a given number of 
    'slots' for which a player can wear an armour. There can not be more  
    than one armour for each slot, so, for example, when a shield is worn, 
    a weapon cannot be wielded in that hand. For a complete listing of 
    armour types and toolslots read "/sys/wa_types.h".

    Table of armour slots <-> Hitlocations.

    ARMOUR          PROTECTING
      TYPE   TORSO HEAD LEGS R_ARM L_ARM
    ------------------------------------
    A_BODY     X      
    A_HEAD	    X
    A_LEGS	         X
    A_R_ARM	               X
    A_L_ARM	                     X
    A_ARMS                     X     X
    A_ROBE      X         X                
    A_SHIELD                   X     X  
    HANDS
    A_ANY_FINGER
    A_FEET
    A_NECK
    A_WAIST                        

    any magical armour
               X    X    X     X     X  


  o Armour classes.

    This is a relative value for the quality of the armour. All armour types
    can have ac values from 0-60.  The higher the value of the ac the better 
    protection the armour offers.  Certain types may cover the same part of 
    the body (overlapping), giving protection against a hit at that part with 
    more than ac100. In such a case the summed ac value for the body part is
    set to 100.


  o Armour modifier.

    This indicates an armours sensitivity to certain types of attacks, ie,
    it sets bonuses or penelties based upon damage types. The armour modifier 
    is an array holding a modify value for each damage type (impale, slash,
    and bludgeon). Note that the ac should reflect the average ac and the 
    modifiers should average out to 0. 

    An armour modifier array set to ({ -3, 3, 0 })  would be -3 for impale 
    damage, +3 for slash damage, and normal for bludgeon.

    The following table lists some attributes which may go with an armour, 
    and the corresponding bonuses and penalties to their AC.  

        MOD  ARMOUR CLASS          CONDITION	   MAKE
        ------------------------------------------------------------
        -3                         corroded         
        -2   soft metals               
        -1   bronze, brass         worn            orc made
         0   iron                  normal          human made
        +1   tempered iron         well-kept       dwarf or elf made 
        +2   steel                     
        +3   alloyed steel                             
        +4   mithril alloy                         magical


When creating armours, certain RULES must be respected.

1.- Limits on Armour Class (ac)

    For all armours:

    Max ac found (on the ground)	:  10
    Max ac purchased from armourer      :  35
    Max ac bought			:  40
    Max ac conquered (in combat)	:  60
    Max ac reward for solving quest	:  20 * questlevel (see xp_scale)

    "Max ac purchased from armourer" means those armours that are created
    by an armourer and sold without requiring combat or a quest.  Armours
    that were originally obtained through combat or a quest and are
    purchased in a shop are not included in this category.

    The limit of ac 40 for bought armours means that all armours exceeding
    40 must have the property OBJ_M_NO_BUY set.
    
    Even though armour gained through combat can be up to ac60, only a
    major foe may have such armament. Use your common sense :-)
   
2.- Calculation of armour value:
    
    The base value in copper coins of an armour is calculated with the 
    formula:        cc = ac * ac / 3 + ac * 7 + 20

    Use add_prop(OBJ_I_VALUE, F_VALUE_ARMOUR(ac)) to calculate the value
    of your normal, non-magical armour.
    
    If the armour is magical and you want to make its value greater than 
    normal for its armour class, you can 
        add_prop(OBJ_I_VALUE, F_VALUE_ARMOUR(ac) + n)
    Doing this will add n copper coins in value to its normal value based
    on the armour's class.


3.- Limits on modifiers.
       
    The maximum modifier may be selected, based on the ac, as follows:

        ac    Max modifier
        ------------------
        10        +/- 2
        20        +/- 3       
        60        +/- 4       (magical)


4.- Limits on skill and stat checks:

    It is considered illegal for any armour in any Genesis domain (with
    the exception of Immortal) to have a query for stat average > 90 or 
    individual stat > 90 before the armour may be worn/removed.

    It is highly recommended that resolve_task be used in functions that
    query for stats or skills in players before the armour can be worn.


5.- Magical armours must have all relevant magical properties set.

    - OBJ_I_IS_MAGIC_ARMOUR set to 1 to identify this armour as magical.
    - MAGIC_AM_MAGIC, to identify the form of the magic and its
      strength.
    - MAGIC_AM_ID_INFO, supporting 'identify' spells, giving mortals the
      chance to learn more about the nature and the history of the item.
    - OBJ_S_WIZINFO, to inform wizards about the special properties of
      the armour. This should also contain where it is cloned and which
      monsters wear the armours (path names).

    Magical armours must be documented in /d/Domain/open/MAGIC


How to make an armour
====================

An armour should always begin with these statements:

inherit "/std/armour";
#include "/sys/wa_types.h"  /* wa_types.h contains some definitions we want */
#include "/sys/stdproperties.h" /* The properties of value, volume and weight */

void
create_armour()
{
    /* Set the name, short description and long description */
    set_name("helmet");
    set_short("small helmet"); /* Observe, not 'a small helmet' */
    set_long("It's small but would probably protect you a little.\n");

    /* Now, a player can refere to this armour as 'armour' and 'helmet'. To
     * distinguish it from other helmets, we want the player to be able to 
     * use 'small helmet' as an id too.
     */
    set_adj("small");

    /* Now we want to set the armour class, and perhas a modifier to it */
    set_ac(4);
    /*        impale, slash, bludgeon */
    set_am(({   -2,     1,      1 }));

    /* We also need to set what type of armour this is */
    set_at(A_HEAD); /* It protects the head */

    /* Then we want the object to have value, weight and volume too. If
     * your value or weight setting is too low, then default values will
     * be used
     */
    add_prop(OBJ_I_VALUE, 123);
    add_prop(OBJ_I_VOLUME, 200);
    add_prop(OBJ_I_WEIGHT, 1000);
}


SEE ALSO:
    /doc/man/Genesis/armour_guide    For list of armours and values
    /doc/examples/armours/*          For armour code examples
