#### COMBAT TACTICS ###########################################################
#
# NOTE: tactics must start with "tactic_" in their name to work with techs.
###############################################################################

phases = { # phase = no is the standard phase
	close_combat
	tactical_withdrawal
	seize_bridge
	hold_bridge
}

tactic_basic_attack = {

	is_attacker = yes
	trigger = { # combined scope for both country and combatant
		is_attacker = yes
		phase = no
	}
	
	active = yes

	base =  { factor = 4 }
	picture = attack
	
	countered_by = tactic_counterattack

	attacker = 0.05
}

tactic_basic_defend = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = yes
	
	base =  { factor = 4 }
	picture = defend
	
	defender = 0.05
}

#Tier 0
tactic_square_formation = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = square_formation
	
	defender = 0.25 #It's not a final value
	attacker = -0.5
}

tactic_line_formation = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 2 
		modifier={
			add = 3
			has_trait = infantry_leader
		}

	}
	picture = line_formation
	
	attacker = 0.15 #It's not a final value
	attacker_movement_speed = -0.15
	defender= -0.2
}

tactic_column_formation = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = column_formation
	
	attacker = 0.20 #It's not a final value
	defender= 0.03
}
tactic_flying_battery = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		has_trait = engineering
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = flying_battery
	
	attacker = 0.25 #It's not a final value
	attacker_movement_speed = -0.05
	defender = 0.05

}
tactic_grand_battery = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		has_trait = engineering
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = grand_battery
	
	attacker = 0.3 #It's not a final value
	attacker_movement_speed = -0.1

}

tactic_shock_tactics = { #Countered by Square Formation
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		has_trait = cavalry_leader
	}
	
	active = no
	
	base =  { 
		factor = 6
		modifier={
			add = 2
			has_trait = cavalry_expert
	 }
	}
	picture = shock_tactic
	
	countered_by = tactic_square_formation

	attacker = 0.21 #It's not a final value
	attacker_movement_speed = 0.5

}

tactic_rearguard_support = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		has_trait = cavalry_leader
	}
	
	active = no
	
	base =  { 
		factor = 3
		modifier={
			add = 2
			has_trait = cavalry_expert
	 }
	}
	picture = rearguard_support

	defender = 0.25 #It's not a final value
	attacker = 0.05
	attacker_movement_speed = 0.5

}
tactic_mounted_charge = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		has_trait = cavalry_leader
	}
	
	active = no
	
	base =  { 
		factor = 3
		modifier={
			add = 2
			has_trait = cavalry_expert
	 }
	}
	picture = mounted_charge

	attacker = 0.30 #It's not a final value

}
tactic_concetric_defense = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 3
	}
	picture = concentric_defense

	defender = 0.35 #It's not a final value

}
tactic_counter_attacks = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 3
	}
	picture = counter_attacks

	defender = 0.30 #It's not a final value
	attacker = 0.09

}

tactic_fire_and_advance = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 3
	}
	picture = fire_and_advance

	attacker = 0.23 #It's not a final value

}

tactic_tactical_flanking = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 3
	}
	picture = tactical_flanking

	attacker = 0.20 #It's not a final value

}

tactic_skirmisher_ambush = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { 
		factor = 3
	}
	picture = skirmisher_ambushes

	attacker = 0.10 #It's not a final value

}







tactic_counterattack = { # counters basic attack, assault
	is_attacker = no
	trigger = {
		is_attacker = no
		skill_advantage > 0
		phase = no
	}
	
	active = yes
	
	base =  {
		factor = 4
		modifier = {
			add = 4
			has_trait = unyielding_defender
		}
	}
	picture = counterattack
	
	defender = 0.25
}


tactic_assault = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = yes
	
	base =  {
		factor = 2
		modifier = {
			add = 2
			has_trait = aggressive_assaulter
		}
	} #Revisit ideally this should be more common in urban terrain
	
	picture = assault
	countered_by = tactic_counterattack
	
	phase = close_combat #changes phase to close combat
	
	attacker = 0.25			#attacker gets a bonus to doing damage
}
###close combat tactics here
tactic_cc_attack = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = close_combat
	}
	
	active = yes
	
	base =  { factor = 4 }
	picture = cc_attack
	display_phase = close_combat

	attacker = 0.1			#attacker gets a bonus to doing damage
	defender = 0.05
}
tactic_cc_defend = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = close_combat
	}
	
	active = yes
	
	base =  { factor = 4 }
	picture = cc_defend
	display_phase = close_combat

	attacker = 0.05
	defender = 0.1			#defender gets a bonus to doing damage
}
tactic_cc_storm = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = close_combat
	}
	
	active = yes
	
	base =  { factor = 2 }
	picture = cc_storm
	display_phase = close_combat

	attacker = 0.2			#attacker gets a bonus to doing damage
	defender = 0.2
}
tactic_cc_local_strong_point = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = close_combat
	}
	
	active = yes
	display_phase = close_combat

	base =  { factor = 2 }
	picture = cc_local_strong_point
	
	attacker = -0.2			#attacker gets a penalty to doing damage
}
tactic_cc_withdraw = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = close_combat
	}
	
	active = yes
	
	base =  { factor = 1 }
	picture = cc_withdraw
	display_phase = close_combat

	phase = no #changes phase to no
	
	attacker = -0.05
	defender = -0.05
}


tactic_encirclement = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		frontage_full = yes
		has_reserves = yes
		OR = {
			skill_advantage > 0
			has_trait = panzer_leader
			has_trait = trickster
		}
	}
	
	active = yes
	
	base =  { 
		factor = 4
		modifier = {
			add = 4
			OR = {
				has_trait = panzer_expert
				has_trait = combined_arms_expert
			}
		}
	}
	
	picture = encircle
	countered_by = tactic_tactical_withdrawal

	combat_width = 0.5		#increased combat_width
	attacker = 0.25
	defender = 0.05
}

tactic_delay = {
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = no
	
	base =  {
		factor = 4
	}
	picture = delay
	countered_by = tactic_shock
	
	attacker_movement_speed = -0.25		#
	attacker = -0.25
	defender = -0.15
}

tactic_shock = { #counters delay
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = yes
	
	base =  {
		factor = 4
		modifier = {
			add = 4
			has_trait = aggressive_assaulter
		}
	}
	picture = shock
	countered_by = tactic_ambush
	
	defender = -0.25
}

tactic_tactical_withdrawal = { #counters encirclement
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		OR = {
			skill_advantage > 0
			has_trait = trickster
		}
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = withdraw
	
	phase = tactical_withdrawal
	
	combat_width = -0.25
	attacker = -0.25
	defender = -0.05
}
###tactical withdrawal tactics
tactic_tw_attack = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = tactical_withdrawal
	}
	
	base =  { factor = 4 }
	picture = tw_attack
	display_phase = tactical_withdrawal
	
	combat_width = -0.25	
	attacker = -0.25
	defender = -0.1
}
tactic_tw_defend = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = tactical_withdrawal
	}
	
	base =  { factor = 4 }
	picture = tw_defend
	display_phase = tactical_withdrawal
	
	combat_width = -0.25		
	attacker = -0.3
	defender = -0.05
}
tactic_tw_chase = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = tactical_withdrawal
	}
	
	base =  { factor = 4 }
	picture = tw_chase
	display_phase = tactical_withdrawal
	
	
	combat_width = -0.25		
	attacker = -0.15
	defender = -0.05
}
tactic_tw_evade = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = tactical_withdrawal
	}
	
	base =  { factor = 4 }
	picture = tw_evade
	display_phase = tactical_withdrawal
	
	
	combat_width = -0.25		
	attacker = -0.4
	defender = -0.1
}
tactic_tw_intercept = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = tactical_withdrawal
	}
	
	base =  { factor = 4 }
	picture = tw_intercept
	display_phase = tactical_withdrawal
	
	phase = no
		
	attacker = -0.05
	defender = -0.1
}



tactic_breakthrough = { #counters ambush
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		OR = {
			hardness > 0.5
			skill_advantage > 1
		}
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = breakthrough
	
	countered_by = tactic_backhand_blow
	
	attacker_movement_speed = 0.5
	attacker = 0.25
	defender = -0.15
}

tactic_ambush = { #counters shock
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		OR = {
			skill_advantage > 1
			skill > 2
			has_trait = trickster
		}
	}
	
	active = yes
	
	base =  { factor = 4 }
	picture = ambush
	countered_by = tactic_breakthrough
	
	attacker = -0.25
}

tactic_blitz = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		hardness > 0.5
		phase = no
		OR = {
			skill > 2
			has_trait = panzer_leader
			skill_advantage > 1
		}
	}
	
	active = no
	
	base =  { 
		factor = 4
		modifier = {
			add = 4
			OR = {
				has_trait = panzer_expert
				has_trait = combined_arms_expert
			}
		}
	}
	
	picture = blitz
	countered_by = tactic_elastic_defense
	
	attacker_movement_speed = 0.5
	attacker = 0.15
	defender = -0.15
}


tactic_elastic_defense = { #counters blitz
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		OR = {
			has_trait = defensive_doctrine
			skill > 2
		}
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = elastic_defence
	
	attacker_movement_speed = -0.25
	attacker = -0.15
	defender = 0.10
}

tactic_backhand_blow = { #counters breakthrough
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		OR = {
			skill > 4
			AND = {
				has_trait = defensive_doctrine
				skill > 3
			}
		}
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = backhand_blow
	
	attacker_movement_speed = -0.3
	attacker = -0.2
	defender = 0.25
}

tactic_seize_bridge = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		has_combat_modifier = river_crossing
		phase = no
		OR = {
			skill > 3
			AND = {
				has_trait = offensive_doctrine
				skill > 2
			}
		}
	}
	
	base =  { factor = 2 }
	picture = seize_bridge
	
	phase = seize_bridge
	
	attacker_movement_speed = 0.1
	combat_width = -0.25
	attacker = 0.2
	defender = -0.05
}
tactic_attacker_sb_hold = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = seize_bridge
	}
	
	base =  { factor = 4 }
	picture = attacker_sb_hold
	display_phase = seize_bridge
	
	combat_width = -0.25
	attacker = 0.2
}
tactic_attacker_sb_skillful_defence = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = seize_bridge
		skill > 4
	}
	
	base =  { factor = 4 }
	picture = attacker_sb_skillful_defence
	display_phase = seize_bridge

	combat_width = -0.25
	attacker = 0.2
	defender = -0.1
}
tactic_defender_sb_assault = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = seize_bridge
	}
	
	base =  { factor = 4 }
	picture = defender_sb_assault
	display_phase = seize_bridge

	combat_width = -0.25
	defender = -0.05
}
tactic_defender_sb_reckless_assault = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = seize_bridge
		skill < 3
	}
	
	base =  { factor = 4 }
	picture = defender_sb_reckless_assault
	display_phase = seize_bridge

	combat_width = -0.25
	attacker = 0.25
	defender = -0.1
}
tactic_defender_sb_retake_bridge = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = seize_bridge
		OR = {
			skill > 2
			has_trait = trickster
		}
	}
	
	countered_by = tactic_attacker_sb_skillful_defence
	phase = hold_bridge
	
	base =  { factor = 4 }
	picture = defender_sb_retake_bridge
	display_phase = seize_bridge

	combat_width = -0.25
	attacker = 0.1
	defender = -0.05
}

tactic_hold_bridge = { 
	is_attacker = no
	trigger = {
		has_combat_modifier = river_crossing
		is_attacker = no
		phase = no
		OR = {
			skill > 2
			has_trait = defensive_doctrine
		}
	}
	
	base =  { factor = 2 }
	picture = tactic_hold_bridge
	
	phase = hold_bridge
	
	attacker_movement_speed = 0.1
	combat_width = -0.25
	attacker = 0.2
	defender = -0.05
}
tactic_attacker_hb_attack = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = hold_bridge
	}
	
	base =  { factor = 4 }
	picture = attacker_hb_attack
	display_phase = hold_bridge

	combat_width = -0.25
	attacker = 0.1
}
tactic_attacker_hb_rush = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = hold_bridge
		skill > 4
	}
	
	base =  { factor = 4 }
	picture = attacker_hb_rush
	display_phase = hold_bridge

	combat_width = -0.25
	attacker = 0.2
}
tactic_attacker_hb_storm = { 
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = hold_bridge
	}
	
	base =  { factor = 2 }
	picture = attacker_hb_storm
	display_phase = hold_bridge

	countered_by = tactic_defender_hb_skillful_defence
	
	phase = seize_bridge
	
	combat_width = -0.25
	attacker = 0.2
	defender = 0.05
}
tactic_defender_hb_hold = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = hold_bridge
		skill < 3
	}
	
	base =  { factor = 2 }
	picture = defender_hb_hold
	display_phase = hold_bridge

	combat_width = -0.25
	attacker = 0.2
	defender = -0.1
}
tactic_defender_hb_skillful_defence = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = hold_bridge
		OR = {
			skill > 2
			has_trait = trickster
		}
	}
	
	base =  { factor = 2 }
	picture = defender_hb_skillful_defence
	display_phase = hold_bridge
	
	combat_width = -0.25
	attacker = 0.1
	defender = 0.05
}

tactic_guerrilla_tactics = { #People's army defender tactic. also for German volksturm branch.
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
		OR = {
			skill > 2
			has_trait = trickster
		}
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_guerrilla_tactics
	
	combat_width = -0.5
	attacker = -0.7
	defender = -0.6
}

tactic_human_wave_tactics = { #People's army attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		frontage_full = yes
		has_reserves = yes
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_human_wave_tactics
	
	combat_width = 0.5
	attacker = 0.1 
	defender = 0.1
}

tactic_banzai_charge = { #Special Japan attacker tactic
	is_attacker = yes
	trigger = {
		tag = JAP
		is_attacker = yes
		phase = no
	}
	
	active = yes
	
	countered_by = tactic_overwhelming_fire
	
	base =  { factor = 4 }
	picture = tactic_banzai_charge
	
	attacker_movement_speed = 0.1
	attacker = 0.25 
	defender = 0.1
}

tactic_infantry_charge = { #GBP -> Infantry attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_infantry_charge
	
	attacker = 0.1 
	defender = -0.05
}

tactic_planned_attack = { #GBP -> Armor attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_planned_attack
	
	attacker = 0.15 
}

tactic_relentless_assault = { #Deep battle attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_relentless_assault
	
	attacker_movement_speed = 0.15
	attacker = 0.2
	defender = 0.05	
}

tactic_unexpected_thrust = { #Mobile warfare attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_unexpected_thrust
	
	attacker_movement_speed = 0.15
	attacker = 0.15 
}

tactic_overwhelming_fire = { # Counters Banzai charge
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = no
	}
	
	active = no
	
	base =  { factor = 2 }
	picture = tactic_overwhelming_fire
	
	attacker = -0.1
	defender = 0.1
}

tactic_barrage = { #Superior firepower attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_barrage
	
	attacker = 0.1
	defender = -0.2	
}

tactic_creaping_barrage = { #co-ordinated firepower attacker tactic
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}
	
	active = no
	
	base =  { factor = 4 }
	picture = tactic_barrage
	
	attacker = 0.1
	defender = -0.15
}

tactic_oblique_attack = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		OR = {
			skill_advantage > 2
		}
	}
	
	active = no
	
	base =  { factor = 5 }
	picture = tactic_unexpected_thrust
	
	countered_by = tactic_elastic_defense
	
	attacker_movement_speed = 0.55
	attacker = 0.3
	defender = -0.15
}

tactic_tw_expert_retreat = { 
	is_attacker = no
	trigger = {
		is_attacker = no
		phase = tactical_withdrawal
	}
	
	base =  { factor = 5 }
	picture = tw_evade
	display_phase = tactical_withdrawal
	
	
	combat_width = -0.25		
	attacker = -0.45
}

tactic_concentrated_barrage = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		OR = {
			skill > 2
			has_trait = artillery_leader
			skill_advantage > 1
		}
	}
	
	active = no
	
	base =  { factor = 5 }
	picture = tactic_barrage
	
	attacker = 0.10
	defender = -0.25	
}

tactic_combined_assault = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		OR = {
			skill > 2
			has_trait = artillery_leader
			skill_advantage > 1
		}
	}
	
	active = no
	
	base =  { factor = 5 }
	picture = tactic_barrage
	
	attacker = 0.15
	defender = -0.20
	combat_width = 0.5
}

tactic_ga_pa = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
		OR = {
			skill_advantage > 2
		}
	}
	
	active = no
	
	base =  { factor = 5 }
	picture = tactic_unexpected_thrust
	
	countered_by = tactic_tw_evade
	
	attacker_movement_speed = 0.2
	attacker = 0.25
	defender = 0.05
}

tactic_charge = {
	is_attacker = yes
	trigger = {
		is_attacker = yes
		phase = no
	}

	active = yes

	base =  {
		factor = 4
		modifier = {
			add = 4
			has_trait = cavalry_leader
		}
	}
	picture = shock
	countered_by = tactic_ambush

	attacker = 0.1
	defender = -0.25
	attacker_movement_speed = 0.15
}

