/*
 * fichier Weapon.h
 * Weapon
 * commentaires sur le fichier (facultatif)
 * 
 * 29/01/2006
 * Copyright Piquier Production
 * 
 */



#ifndef WEAPON_H_
#define WEAPON_H_

#include <string>

#include "MemoryManager/debugNew.h"


/**
 * the class which manage a unit's weapon.
 * This class contain all the attributs needed to compute fight between 2 units.
 */
class Weapon
{
public:

	// Constants

	/**
	 * damage on fatal hit
	 */
	static const float fatalDamage;
	/**
	 * minimum difference of altitude between the archer and
	 * the ennemy unit for the altitudeModifier to be valid
	 */
	static const float minAltitudeDifference;
	/**
	 * Damage modifier based on the distance between the archer and the ennemy unit
	 */
	static const float proximityModifier;

	// Variables

	/**
	 * basic damage in close combat
	 */
	float damage;
	/**
	 * ranged damage
	 */
	float rangedDamage;
	/**
	 * damage on a mounted unit
	 */
	float damageVsMounted;
	/**
	 * ranged damage on a mounted unit
	 */
	float rangedDamageVsMounted;
	/**
	 * damage multiplier on critical hit
	 */
	float criticalDamageMultiplier;	
	/**
	 * damage multiplier on critical hit for archers
	 */
	float criticalDamageRangedMultiplier;

	/**
	 * cooldown between every attack
	 */
	float weaponSpeed;
	/**
	 * maximal range to attack units
	 */
	float maxRange;
	/**
	 * minimal range to attack units
	 */
	float minRange;
	/**
	 * range during close combat
	 */
	float rangeCloseCombat;

	// Ground units vs ground units
	/**
	 * chance to make a critical hit
	 */
	float criticalHit;
	/**
	 * chance to make a fatal hit
	 */
	float fatalHit;

	// Ground units vs mounted units
	/**
	 * missing comment here
	 */
	float criticalVsMounted;
	/**
	 * missing comment here
	 */
	float fatalVsMounted;
	/**
	 * chance to hit a mounted unit (chance to hit the unit, not the horse)
	 */
	float chanceToHitMountedUnit;

	// Mounted units vs ground units
	/**
	 * chance to make a critical hit while mounted
	 */
	float criticalMounted;
	/**
	 * chance to make a fatal hit while mounted
	 */
	float fatalHitMounted;

	// Mounted units vs mounted units
	/**
	 * missing comment here
	 */
	float criticalMountedVsMounted;
	/**
	 * missing comment here
	 */
	float fatalMountedVsMounted;
	/**
	 * chance to hit mounted unit while being mounted
	 */
	float chanceToHitMountedUnitMounted;
											
	// Static modifiers

	/**
	 * damage modifiers versus light,
	 */
	float vsLightModifier;
	/**
	 * medium and heavy armored units.
	 */
	float vsMediumModifier;
	/**
	 * missing comment here
	 */
	float vsHeavyModifier;

	// Dynamic modifiers

	/**
	 * modifier for archers when shooting at an ennemy who is at a different altitude.
	 */
	float altitudeModifier;	
	/**
	 * modifie the weapon speed xxxx how ???
	 */
	float speedModifier;
	/**
	 * modifier when the unit is moving
	 */
	float movementModifier;
	/**
	 * fatal and critical % modifier when attacking a moving unit
	 */
	float movingEnnemyModifier;
	/**
	 * fatal and critical % modifier when charging
	 */
	float chargeModifier;
	/**
	 * fatal and critical % modifier when unit in combat posture
	 */
	float combatPostureModifer;
	/**
	 * missing comment here
	 */
	float movementDamageModifier;

	/**
	 * default constructor : creat a new weapon given is type
	 */
	Weapon(std::string weaponType);

	/**
	 * default destructor
	 */
	virtual ~Weapon();
};

#include "MemoryManager/debugNewOff.h"


#endif /*WEAPON_H_*/
