TR_FIN_build_army = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}

	enable = {
		always = yes
	}

	abort_when_not_enabled = yes

	ai_strategy = { type = build_army id = infantry value = 100 }
	ai_strategy = { type = force_build_armies value = 100 }
}

TR_FIN_militarize = {
	enable = {
		OR = {
			has_war = yes
			date > 1937.7.1
			threat > 0.85
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = { type = added_military_to_civilian_factory_ratio value = 10000 }
	
	ai_strategy = {
		type = research_weight_factor
		id = tech_mountaineers
		value = 2000
	}
}

TR_FIN_unit_buffers = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}

	enable = {
		always = yes
	}

	abort = {
		OR = {
			any_other_country = {
				OR = {
					is_justifying_wargoal_against = ROOT
					has_wargoal_against = ROOT
					has_war_with = ROOT
				}
			}
			
			SOV = {
				focus_progress = {
					focus = SOV_secure_leningrad
					progress > 0.1
				}
				NOT = { has_completed_focus = SOV_secure_leningrad }
			}
			
			has_completed_focus = FIN_cooperation_with_germany
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = put_unit_buffers
		ratio = 5
		states = {
			111
			926
			927
			930
		}
	}

	ai_strategy = {
		type = front_unit_request
		country_trigger = {
			always = yes
		}
		value = -2000
	}
}

TR_FIN_building_supply = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}
	enable = {
		has_completed_focus = FIN_cooperation_with_germany
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = build_building
		id = supply_node
		target = 3156
		value = 650
	}
}

TR_FIN_Prepare_SOV = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}

	enable = {
		OR = {
			has_completed_focus = FIN_cooperation_with_germany
			SOV = {
				OR = {
					is_justifying_wargoal_against = ROOT
					has_wargoal_against = ROOT
					AND = {
						focus_progress = {
							focus = SOV_secure_leningrad
							progress > 0.0
						}
						NOT = { 
							has_completed_focus = SOV_secure_leningrad
							has_war_with = ROOT
						}
					}
				}
			}
		}
	}

	abort = {
		OR = {
			has_war_with = SOV
			has_global_flag = SOV_Collapsed
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = prepare_for_war
		id = SOV
		value = 500
	}
}

TR_FIN_SOV_WAR_ATTACK = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}
	enable = {
		has_completed_focus = FIN_cooperation_with_germany
	}

	abort = {
		OR = {
			AND ={
				213 = { is_fully_controlled_by = FIN }
				215 = { is_controlled_by = FIN }
			}
			any_owned_state = {
				is_owned_by = ROOT
				NOT = {
					is_controlled_by = ROOT
				}
			}
		}
	}
	
	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_concentration_front_factor
		value = 100

		state_trigger = {
			state = 215
			state = 213
		}
	}

	ai_strategy = {
		type = force_concentration_target_weight
		value = 100

		state_trigger = {
			state = 215
			state = 213
		}
	}

	ai_strategy = {
		type = front_control
		ordertype = front
		priority = 5000
		execution_type = rush
		execute_order = yes
		manual_attack = yes

		state_trigger = {
			state = 215
			state = 213
		}
	}

}

TR_FIN_SOV_WAR_DEFEND = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}
	enable = {
		has_completed_focus = FIN_cooperation_with_germany
	}

	abort = {
		OR = {
			AND ={
				213 = { is_fully_controlled_by = FIN }
				215 = { is_controlled_by = FIN }
			}
			any_owned_state = {
				is_owned_by = ROOT
				NOT = {
					is_controlled_by = ROOT
				}
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_concentration_front_factor
		ratio = 0.6
		value = 50

		state_trigger = {
			is_owned_by = SOV
			NOT = {
				state = 215
				state = 213
			}
		}
	}

	ai_strategy = {
		type = force_concentration_target_weight
		value = 50

		state_trigger = {
			is_owned_by = SOV
			NOT = {
				state = 215
				state = 213
			}
		}
	}

	ai_strategy = {
		type = force_concentration_factor
		value = -50
	}

	ai_strategy = {
		type = front_control
		ordertype = front
		ratio = 0.6
		priority = 1000
		execution_type = careful
		# execute_order = no
		manual_attack = yes

		state_trigger = {
			is_owned_by = SOV
			NOT = {
				state = 215
				state = 213
			}
		}
	}
}

TR_FIN_SOV_HOLD_WAR = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}
	enable = {
		has_completed_focus = FIN_cooperation_with_germany
		215 = { is_fully_controlled_by = FIN }
		213 = { is_fully_controlled_by = FIN }
		date < 1943.7.1
	}

	abort = {
		any_owned_state = {
			is_owned_by = ROOT
			NOT = {
				is_controlled_by = ROOT
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = force_concentration_front_factor
		ratio = 0.5
		value = -100

		tag = SOV
	}

	ai_strategy = {
		type = force_concentration_target_weight
		value = -100

		tag = SOV
	}

	ai_strategy = {
		type = force_concentration_factor
		value = -50
	}

	ai_strategy = {
		type = front_control
		ordertype = front
		priority = 1000
		execution_type = careful
		
		execute_order = no
		manual_attack = no
		tag = SOV
	}

	ai_strategy = {
		type = build_building
		id = supply_node
		target = 11175
		value = 5000
	}
}

TR_FIN_SOV_HOME_LAND = {
	allowed = {
		original_tag = FIN
		is_historical_focus_on = yes
	}
	enable = {
		any_owned_state = {
			is_owned_by = ROOT
			NOT = {
				is_controlled_by = ROOT
			}
		}
	}

	abort_when_not_enabled = yes

	ai_strategy = {
		type = front_control
		ordertype = front
		ratio = 0.2
		priority = 5000
		execution_type = rush_weak
		
		execute_order = yes
		manual_attack = yes
		
		state_trigger = {
			is_owned_by = ROOT
			NOT = {
				is_fully_controlled_by = ROOT
			}
		}
	}

	ai_strategy = {
		type = force_concentration_front_factor
		ratio = 0.2
		value = 100

		state_trigger = {
			is_owned_by = ROOT
			NOT = {
				is_fully_controlled_by = ROOT
			}
		}
	}

	ai_strategy = {
		type = force_concentration_target_weight
		value = 100

		state_trigger = {
			is_owned_by = ROOT
			NOT = {
				is_fully_controlled_by = ROOT
			}
		}
	}
}

TR_BUILDING_3_INFRASTRUCTURE_111 = { enable = { original_tag = 111.owner 111 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 111 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_149 = { enable = { original_tag = 149.owner 149 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 149 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_150 = { enable = { original_tag = 150.owner 150 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 150 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_926 = { enable = { original_tag = 926.owner 926 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 926 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_927 = { enable = { original_tag = 927.owner 927 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 927 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_928 = { enable = { original_tag = 928.owner 928 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 928 value = 500 } }
TR_BUILDING_3_INFRASTRUCTURE_930 = { enable = { original_tag = 930.owner 930 = { infrastructure < 3 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = infrastructure target = 930 value = 500 } }

TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_111 = { enable = { original_tag = 111.owner 111 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 111 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_149 = { enable = { original_tag = 149.owner 149 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 149 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_150 = { enable = { original_tag = 150.owner 150 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 150 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_926 = { enable = { original_tag = 926.owner 926 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 926 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_927 = { enable = { original_tag = 927.owner 927 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 927 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_928 = { enable = { original_tag = 928.owner 928 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 928 value = 500 } }
TR_BUILDING_CIC_AFTER_3_INFRASTRUCTURE_930 = { enable = { original_tag = 930.owner 930 = { infrastructure > 2 } date < 1937.7.1 } abort_when_not_enabled = yes ai_strategy = { type = build_building id = industrial_complex target = 930 value = 500 } }