Battle Special FX
=================
There are 2 types of entities that can cause special effects in the battle:
combat style objects and weapon objects.

Combat styles are slightly altered skills and should be stored in /skill just 
like any other skill, but they are created by using void create_combat_style() 
instead of void create_skill(). The following examples can be found as of this 
writing:

/skill/berserker_charging.c
/skill/tiger_way.c

When the hit() -function in the battle daemon is called, a combat style is
passed as an argument along with the attacker's (and defender's) weapon data
array, which is formed in /inherit/hitloc.c: resolve_weapon() and looks like
this:

weapondata[0] = weapon (object if wielded weapon, string if natural weapon)
weapondata[1] = damage type (string value, "cut", "impact", "stab" etc.)
weapondata[2] = damage (numeric value for damage)
weapondata[3] = range (string, "close", "thrown", or "missile")
weapondata[4] = combat style object or 0
weapondata[5] = weapon skill

In case weapondata[4] is an object, there are 4 functions that can be called
from either the weapon or the combat style object or both:

int damage(object attacker, object defender, string loc, int percent, int damage, mixed atweapondata[0], mixed defweapondata[0])
int attacked( - || - )
int miss(object attacker, object defender, mixed atweapondata[0], mixed defweapondata[0])
int block(object attacker, object defender, mixed atweapondata[0], mixed defweapondata[0])

'attacker' is the attacker's living object, 'defender' is the defender's
living object, 'loc' is the target hitloc and 'percent' is the damage 
(percentage of the target hitloc's hitpoints), note that 'percent' is NOT
the same as weapondata[2], it is calculated in the battle daemon. 'damage' is
the absolute numeric value of the damage.

These functions are defined in the individual combat style files in /skill
and function as follows:

damage() is called if the effect of the hit is damaging. It is called before 
the actual damage resolving. If the return value is 1, the normal damage 
resolving is not done at all and if it is 0, the normal damage resolving is 
done normally.

attacked() is called after the actual damage effects have been called. The
return value is of no consequence.

miss() is called if the attack missed the target. It differs from the above
functions as it is called with different arguments. If the return value is 1, 
the normal miss message is skipped and if it is 0, it is given.

block() is called if the attack was blocked by the defender. The arguments are
the same as in miss() and the return value has the same functionality.

- Yorkaturr -
