/**************************************************************************

template_ability.tgi
Copyright © 2002-2003 TimeGate Studios

DESCRIPTION: shared abilities that actors may use, such as spells.

REVISION HISTORY:
drp090402 - created

USAGE:

	[AbilityDefinition Template=AbilityDefinition]
	This node goes at the root level, or in an actor's "AbilityLocal" node and
	describes an ability that an actor can perform.  There are several subclasses
	to "AbilityDefinition" that should be used instead.

FIELDS:

	IDS = unique identifier for this ability, referred to by the "ability_IDS" field in the actor
	
	name = localized name displayed in the properties list on the UI.  Note that attacks may or
		   may not use a default name (e.g. "Melee Attack")
		   
	description = localized description displayed in the properties list.  Note that attacks may or
			may not use a default description.
		   
	[Flags]
		spell = main damage ignores attack efficiency (uses 100%). Defined implicitly for spell
				templates.
		vorpal = main damage ignores armor (DV 0)
		enchantment = ability will fail if any of its enchantment properties are already in place
					on the target
		center_on_resource = the ability always targets self
		target_location = ability used at target location
		ignore_for_cv = don't count this ability in CV computations (for air defenses)
		summon_multiple = does not wait for summoned object to go away before being able to summon again
		summon_unique = do not summon if the kingdom already has an instance of the actor data
		primary_island_only = targeted location must be on the primary island
		  
EXAMPLES:

[AbilityDefinition Template=AbilityDefinition]
{
	IDS = adrenaline_shot
	name = "Adrenaline Shot"
	targets = friend
	mana_cost = 20
	[Effect Template=EnchantmentEffect]
	{
		[EnchantmentProperty Template=EnchantmentProperty]
		{
			name = "Adrenaline Rush"
			duration = 30
			enchantment_type = MAGICAL
			
			[Modifier Template=AddModifier]
			attribute = MELEE_AV
			amount = 1
		}
	}
}		   

SELF-EFFECTS: You can have any ability do something to the source by adding an ability effect
 with "targets = +self."  For example, deals 25 damage to self when uses this ability.
	
**************************************************************************/

[Template AbilityDefinition]
{
	;;;;;; required fields
	
	string	IDS
	localized	name
	fixed	range
	string	targets
	string	icon ;; icon
	string	ability_type

	;; TODO: this is currently ignored by the code and the code generates
	;;  a description based on the ability effects
	localized description = null

	;; Min range for ability to be used.  Actors will not back up to get into range.
	fixed	min_range = 0

	;; Time after using an ability before it can be used again.
	;; Code uses the larger of recharge_time and attack_time+reload_time.
	fixed	recharge_time = 0
	
	;;;;;; optional fields
	
	;; area = circular radius in meters
	fixed	area = 0
	fixed	volley_area = 0
	int	max_targets = 0		;; max targets for area/volley effects. 0=unlimited
	string	projectile_IDS = null
	fixed	mana_cost = 0
	fixed	impact_impulse = 0
	fixed	recoil_impulse = 0

	;; for the UI state (for faction abilities)
	string	target_location_vfx = null
	
	;;;;;; optional fields (if area > 0)

	;; attenuation_range_min = min distance from center to take under 100% damage
	;;		0 means full area (everything gets attenuated damage)
	;;		1 means actors within 1 meter of target take full damage
	fixed	attenuation_range_min = 1
	
	;; attenuation_factor_max = amount of damage taken at max range
	;;		.5 means 50% damage at edge
	;;		1 means 100% damage at edge (everything takes full damage)
	fixed	attenuation_factor_max = 1
	
	;; impulse area = circular radius in meters to count for impulse physics.
	;;		0 means use "area" value above.
	fixed	impulse_area = 0

	;; see explanations above
	[Flags]
	{
		flag spell = false
		flag vorpal = false
		flag enchantment = false
		flag bombard = false
		flag center_on_source = false
		flag target_location = false
		flag heal = false
		flag ignore_for_cv = false
		flag summon_multiple = false
		flag summon_unique = false
		flag primary_island_only = false
	}

	;; Ability effects
	
	[list Effect Template=Effect]
	
	;; FX System events
	
	[list WhenStart Template=FXC]
	[list WhenDo Template=FXC]
	[list WhenEnd	Template=FXC]
	[list WhenDoPerTarget Template=FXC]
	[list WhenDoPerSummoned Template=FXC]
	
} ; end [Template AbilityDefinition]
