#  another_world

default_unit_production = {
	enable = {
		always = yes
		NOT = { original_tag = ZSL }
		NOT = { original_tag = ZBR }
		NOT = { original_tag = ZET }
		NOT = { original_tag = ZIK }		
		NOT = { original_tag = ZPA }
		NOT = { original_tag = ZRI }
		NOT = { original_tag = ZMN }
		NOT = { original_tag = ZJA }
		NOT = { original_tag = ZCS }
	}	
	abort = { always = no }
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 4
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = 0
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 2
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 70
	}	
	#Air unit factors
	ai_strategy = {
		type = unit_ratio
		id = fighter
		value = 70
	}	
	ai_strategy = {
		type = unit_ratio
		id = cas
		value = 5
	}	
	ai_strategy = {
		type = unit_ratio
		id = tactical_bomber
		value = 5
	}	
	ai_strategy = {
		type = unit_ratio
		id = strategic_bomber
		value = 5
	}	
	ai_strategy = {
		type = unit_ratio
		id = naval_bomber
		value = 5
	}	
	# Naval unit factors
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 20
	}
	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 10
	}
	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 30
	}
	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 15
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = fighter
		value = 35
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = infantry
		value = 40
	}	
	ai_strategy = {
		type = equipment_production_factor
		id = artillery
		value = 25
	}
}

default_role_ratios = {
	enable = {
		not = {
			has_dlc = "Man the Guns"
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = role_ratio
		id = naval_capital
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = naval_sub
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = 100
	}
}
default_role_ratios = {
	enable = {
		has_dlc = "Man the Guns"
		not = {
			OR = {
				original_tag = ZSL
				original_tag = ZRI
				original_tag = ZNP
				original_tag = ZJA	
				original_tag = ZMN
				original_tag = ZRE	
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bb
		value = -80
	}
	ai_strategy = {
		type = role_ratio
		id = naval_capital_bc
		value = -20
	}
	ai_strategy = {
		type = role_ratio
		id = naval_carrier
		value = -70
	}
	ai_strategy = {
		type = role_ratio
		id = naval_submarine
		value = 100
	}
	ai_strategy = {
		type = role_ratio
		id = naval_screen
		value = 65
	}
	ai_strategy = {
		type = role_ratio
		id = naval_escort
		value = 35
	}
	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = 25
	}
	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = 20
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 15
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = 20
	}
}

convoy_voy_voy_voy = {
	enable = {
		has_dlc = "Man the Guns"
		convoy_threat > 0.2
	}
	abort = {
		convoy_threat < 0.2
	}
	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = -20
	}
	ai_strategy = {
		type = role_ratio
		id = naval_escort
		value = 25
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = -10
	}
	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 30
	}
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = -10
	}
	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 25
	}
}

ill_show_you_mine = {
	enable = {
		has_dlc = "Man the Guns"
		mine_threat > 0.2
	}
	abort = {
		mine_threat < 0.2
	}
	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_heavy
		value = -20
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 25
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = -10
	}
}

ill_show_you_mine_2 = {
	enable = {
		has_dlc = "Man the Guns"
		mine_threat > 0.5
	}
	abort = {
		mine_threat < 0.5
	}
	ai_strategy = {
		type = role_ratio
		id = naval_cruiser_light
		value = -20
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_sweeper
		value = 25
	}
	ai_strategy = {
		type = role_ratio
		id = naval_mine_layer
		value = -10
	}
}

default_pp_spend_amount = {
	enable = {
		always = yes
	}	
	abort = { always = no }
	ai_strategy = {
		type = pp_spend_amount
		id = idea
		value = 100
	}	
	ai_strategy = {
		type = pp_spend_amount
		id = decision
		value = 100
	}
}

default_paratroopers_production = {
	enable = {
#		NOT = { original_tag = GER }
		ai_wants_divisions >  12 #Massively decreasing the amount of paratroopers the AI wants
	}
	abort = {
		ai_wants_divisions < 13 #Massively decreasing the amount of paratroopers the AI wants
	}
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = 0
	}
}

default_garrison_production = {
	enable = {
		NOT = { 
			original_tag = ZSL 
			original_tag = ZRI			
		}
		ai_wants_divisions >  12 #Massively decreasing the amount of garrison and suppression the AI wants
		is_major = yes
	}
	abort = {
		ai_wants_divisions < 13 #Massively decreasing the amount of garrison and suppression the AI wants
		is_major = no
	}
	ai_strategy = {
		type = role_ratio
		id = garrison
		value = 5
	}	
}

default_mountaineers_production = {
	enable = {
		NOT = { original_tag = ZSL }
		ai_wants_divisions > 11 #Decreasing the amount of mountaineers the AI wants
	}
	abort = {
		ai_wants_divisions < 12 #Decreasing the amount of mountaineers the AI wants
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = 3
	}
}

default_marines_production = {
	enable = {
		NOT = { original_tag = ZSL }
		ai_wants_divisions > 49
	}
	abort = {
		ai_wants_divisions < 50
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = 0
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 0
	}
}

default_mobile_production = {
	enable = {
		NOT = { original_tag = ZSL }
		ai_wants_divisions > 11
		has_tech = motorised_infantry
	}
	abort = {
		ai_wants_divisions < 12
	}
	ai_strategy = {
		type = role_ratio
		id = mobile
		value = 2
	}
}

default_armored_production = {
	enable = {
		NOT = { original_tag = ZSL }	
		ai_wants_divisions > 49
	}
	abort = {
		ai_wants_divisions < 50
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 2
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = 0
	}
}

highered_armored_production = {
	enable = {
		NOT = { original_tag = ZSL }
		num_of_military_factories > 69
	}
	abort = {
		num_of_military_factories < 70
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = 5
	}
}

slightly_naval_focused_nation = {
	enable = {
		OR = {
			tag = ZRI
			tag = ZMN
			tag = ZRE
			tag = ZCS
			tag = ZJA
			tag = ZNP
		}
	}
	abort = { always = no }
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 1
	}
}

more_naval_focused_nation = {
	enable = {
		OR = {
			tag = ZMN
			tag = ZCS
			tag = ZJA
			tag = ZNP
		}
		date > "1991.1.1" #Delaying it by a couple of years
	}
	abort = { always = no }
	ai_strategy = {
		type = unit_ratio
		id = capital_ship
		value = 2		 #1 to 2
	}
	ai_strategy = {
		type = unit_ratio
		id = submarine
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = screen_ship
		value = 1
	}
	ai_strategy = {
		type = unit_ratio
		id = convoy
		value = 1
	}
}

default_area_priority = {
	enable = {
		NOT = { 
			original_tag = ZJA 
			original_tag = ZNP 
			original_tag = ZRL
		}
	}
	abort = { always = no }
	ai_strategy = {
		type = area_priority
		id = europe
		value = 75
	}
	ai_strategy = {
		type = area_priority
		id = scandinavia
		value = 75
	}	
	ai_strategy = {
		type = area_priority
		id = north_america
		value = 75
	}	
	ai_strategy = {
		type = area_priority
		id = south_america
		value = 50
	}	
	ai_strategy = {
		type = area_priority
		id = asia
		value = 75
	}	
	ai_strategy = {
		type = area_priority
		id = middle_east
		value = 50
	}
	ai_strategy = {
		type = area_priority
		id = suez
		value = 50
	}	
	ai_strategy = {
		type = area_priority
		id = pacific
		value = 100
	}	
	ai_strategy = {
		type = area_priority
		id = oceania
		value = 50
	}
}

default_area_priority_non_africa = {
    enable = {
        NOT = { capital_scope = { is_on_continent = africa } }
    }
	abort = { always = no }
    ai_strategy = {
        type = area_priority
        id = africa
        value = -70
    }
    ai_strategy = {
        type = area_priority
        id = suez
        value = -70
    }
}

default_area_priority_non_europe = {
    enable = {
		NOT = { original_tag = ZOR }
		NOT = { original_tag = ZUF }
		NOT = { original_tag = ZPA }
		NOT = { original_tag = ZVZ }
        NOT = { capital_scope = { is_on_continent = europe } }
    }
	abort = { always = no }
    ai_strategy = {
        type = area_priority
        id = europe
        value = -70
    }    
}

####

default_stockpile_management = {
	enable = {
		num_divisions > 150
	}
	abort = {
		num_divisions < 130
	}
	ai_strategy = {
		type = equipment_stockpile_surplus_ratio
		value = 35 # double base stockpile #from 25 to 35
	}
}
###################################################################################################################################
##################################################################################################################################
##################################################################################################################################
##################################################################################################################################
##################################################################################################################################
production_unit_20_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZKR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZTH tag = XMA } }	
		AND = {
			num_of_factories < 20
			num_divisions > 30
		}
	}
	abort = {
		OR = {
			num_of_factories > 20
			num_divisions < 30
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_25_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZKR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZTH tag = XMA } }
		AND = {
			num_of_factories < 25
			num_divisions > 35
		}
	}
	abort = {
		OR = {
			num_of_factories > 25
			num_divisions < 35
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_30_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZKR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZTH tag = XMA } }
		AND = {
			num_of_factories < 30
			num_divisions > 40
		}
	}
	abort = {
		OR = {
			num_of_factories > 30
			num_divisions < 40
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_35_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZKR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZTH tag = XMA } }
		AND = {
			num_of_factories < 35
			num_divisions > 50
		}
	}
	abort = {
		OR = {
			num_of_factories > 35
			num_divisions < 50
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_40_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZKR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZTH tag = XMA } }
		AND = {
			num_of_factories < 40
			num_divisions > 55
		}
	}
	abort = {
		OR = {
			num_of_factories > 40
			num_divisions < 55
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_45_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = XMA } }
		AND = {
			num_of_factories < 45
			num_divisions > 60
		}
	}
	abort = {
		OR = {
			num_of_factories > 45
			num_divisions < 60
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_50_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = XMA } }
		AND = {
			num_of_factories < 50
			num_divisions > 65
		}
	}
	abort = {
		OR = {
			num_of_factories > 50
			num_divisions < 65
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_55_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = XMA } }
		AND = {
			num_of_factories < 55
			num_divisions > 75
		}
	}
	abort = {
		OR = {
			num_of_factories > 55
			num_divisions < 75
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_60_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZBR tag = ZRI tag = ZRL tag = ZBA tag = ZVZ tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = XMA } }
		AND = {
			num_of_factories < 60
			num_divisions > 80
		}
	}
	abort = {
		OR = {
			num_of_factories > 60
			num_divisions < 80
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_65_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 65
			num_divisions > 90
		}
	}
	abort = {
		OR = {
			num_of_factories > 65
			num_divisions < 90
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_70_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 70
			num_divisions > 95
		}
	}
	abort = {
		OR = {
			num_of_factories > 70
			num_divisions < 95
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_75_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 75
			num_divisions > 100
		}
	}
	abort = {
		OR = {
			num_of_factories > 75
			num_divisions < 100
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_80_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 80
			num_divisions > 105
		}
	}
	abort = {
		OR = {
			num_of_factories > 80
			num_divisions < 105
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_85_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 85
			num_divisions > 115
		}
	}
	abort = {
		OR = {
			num_of_factories > 85
			num_divisions < 115
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_90_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 90
			num_divisions > 120
		}
	}
	abort = {
		OR = {
			num_of_factories > 90
			num_divisions < 120
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_95_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 95
			num_divisions > 125
		}
	}
	abort = {
		OR = {
			num_of_factories > 95
			num_divisions < 125
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_100_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 100
			num_divisions > 135
		}
	}
	abort = {
		OR = {
			num_of_factories > 100
			num_divisions < 135
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_110_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND tag = ZVZ } }
		AND = {
			num_of_factories < 110
			num_divisions > 140
		}
	}
	abort = {
		OR = {
			num_of_factories > 110
			num_divisions < 140
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_120_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZNP tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 120
			num_divisions > 150
		}
	}
	abort = {
		OR = {
			num_of_factories > 120
			num_divisions < 150
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_130_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 130
			num_divisions > 160
		}
	}
	abort = {
		OR = {
			num_of_factories > 130
			num_divisions < 160
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_140_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 140
			num_divisions > 180
		}
	}
	abort = {
		OR = {
			num_of_factories > 140
			num_divisions < 180
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_150_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 150
			num_divisions > 190
		}
	}
	abort = {
		OR = {
			num_of_factories > 150
			num_divisions < 190
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_160_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 160
			num_divisions > 210
		}
	}
	abort = {
		OR = {
			num_of_factories > 160
			num_divisions < 210
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_170_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 170
			num_divisions > 220
		}
	}
	abort = {
		OR = {
			num_of_factories > 170
			num_divisions < 220
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_180_ratios = {
	enable = {
		NOT = { OR = { tag = ZPA tag = ZSL tag = ZZR tag = ZRE tag = ZMN tag = UNA tag = UNB tag = UNC tag = UND } }
		AND = {
			num_of_factories < 180
			num_divisions > 240
		}
	}
	abort = {
		OR = {
			num_of_factories > 180
			num_divisions < 240
		}
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
production_unit_220_ratios = {
	enable = {		
		num_divisions > 260		
	}
	abort = {		
		num_divisions < 260		
	}	
	ai_strategy = {
		type = role_ratio
		id = paratroopers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = mountaineers
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = marines
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = armor
		value = -100
	}
	ai_strategy = {
		type = role_ratio
		id = infantry
		value = -100
	}	
}
##########################################################

build_intelligence_agency_as_major = {
	enable = {
		is_major = yes
		OR = {
			has_war = yes
			date > 1988.1.1
		}
	}
	abort = { always = no }
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = 5
	}
}

build_intelligence_agency = {
	enable = {
		date > 1990.1.1
		has_war = no
		num_of_civilian_factories > 25
	}
	abort = {
		OR = {
			has_war = yes
			num_of_civilian_factories < 25
		}
	}
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = 5
	}
}

upgrade_intelligence_agency = {
	enable = {
		date > 1990.1.1
		num_of_civilian_factories > 50
	}
	abort = {
		OR = {
			num_of_civilian_factories < 40
		}
	}
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = 5
	}
}

upgrade_intelligence_agency_as_spy_master = {
	enable = {
		is_spymaster = yes
		OR = {
			has_war = no
			num_of_civilian_factories > 50
		}
	}
	abort = {
		is_spymaster = no
		num_of_civilian_factories < 40
	}
	ai_strategy = {
		type = intelligence_agency_usable_factories
		value = 10
	}
}

addintelligence_agency_normal_upgrade_prio = {
	enable = {
		always = yes
	}
	abort = { always = no }
	ai_strategy = {
		type = intelligence_agency_branch_desire_factor
		id = branch_intelligence
		value = 1000
	}
	ai_strategy = {
		type = intelligence_agency_branch_desire_factor
		id = branch_defense
		value = 1000
	}
	ai_strategy = {
		type = intelligence_agency_branch_desire_factor
		id = branch_operation
		value = 500
	}
	ai_strategy = {
		type = intelligence_agency_branch_desire_factor
		id = branch_operative
		value = 100
	}
	ai_strategy = {
		type = intelligence_agency_branch_desire_factor
		id = branch_crypto
		value = 2000
	}	
}

ask_foreign_manpower_as_major = {
	enable = {
		is_major = yes
		garrison_manpower_need > 200000
	}	
	abort = {
		garrison_manpower_need < 100000
	}
	ai_strategy = {
		type = asking_foreign_garrison
		value = 100		
	}
}

more_upgrades_as_spymaster = {
	enable = {
		is_spymaster = yes
	}	
	abort = {
		is_spymaster = no
	}
	ai_strategy = {
		type = agency_ai_base_num_factories_factor
		value = -50    # -50% on the define
	}
	ai_strategy = {
		type = agency_ai_per_upgrade_factories_factor
		value = -25    # -25% on the define
	}
}

put_garrisons_on_high_prio = {
	enable = {
		always = yes
	}	
	abort = { always = no }
	ai_strategy = {
		type = garrison_reinforcement_priority
		value = 100 # positive is high prio, negative is low prio
	}
}

default_spyplanes_production = {
	enable = {
		has_tech = scout_plane1
		is_major = yes
		#OR = {
		#	has_equipment = {
		#		scout_plane_equipment > 50
		#	}
		#	has_deployed_air_force_size = {
		#		size > 50
		#		type = scout_plane
		#	}
		#}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = unit_ratio
		id = scout_plane
		value = -99
	}
	ai_strategy = {
		type = equipment_production_factor
		id = scout_plane
		value = -99
	}
	ai_strategy = {
		type = equipment_production_min_factories
		id = scout_plane
		value = 1
	}
}

minors_dont_spy = {
	enable = {
		has_tech = scout_plane1
		is_major = no
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = unit_ratio
		id = scout_plane
		value = -10
	}
}

##############################################################################################################################
DEFAULT_template_design = {
	enable = {
		NOT = { OR = { tag = ZSL tag = ZBR tag = ZIK tag = ZMN tag = ZPA tag = ZRI } }	
		date < 1990.1.1				
	}
	abort = { 
		date > 1990.1.1
	}
	ai_strategy = {
		type = template_prio
		id = motorized
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = cavalry
		value = -100
	}	
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 50
	}
	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = -10
	}
	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = -50
	}
	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = -50
	}	
	ai_strategy = {
		type = template_prio
		id = infantry
		value = 60
	}
}

DEFAULT_template_design = {
	enable = {
		NOT = { OR = { tag = ZSL tag = ZBR tag = ZET tag = ZIK tag = ZMN tag = ZPA tag = ZRI tag = ZJA tag = ZCS tag = ZNP } }
		date > 1990.1.1				
	}
	abort = { always = no }
	ai_strategy = {
		type = template_prio
		id = mechanized
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = cavalry
		value = -100
	}	
	ai_strategy = {
		type = template_prio
		id = light_armor
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = medium_armor
		value = 20
	}	
	ai_strategy = {
		type = template_prio
		id = modern_armor
		value = 50
	}
	ai_strategy = {
		type = template_prio
		id = heavy_armor
		value = 10
	}
	ai_strategy = {
		type = template_prio
		id = paratroopers
		value = -50
	}	
	ai_strategy = {
		type = template_prio
		id = infantry
		value = 10
	}
}

save_admiral_pp_for_later = {
	enable = {
		has_war = no
		threat < 0.3
		has_political_power < 200		
	}
	abort = {
		OR = {
			has_war = yes	
			threat > 0.3
			has_political_power > 200
		}
	}

	ai_strategy = { # dont burn PP on admirals (can still get free ones)
		type = pp_spend_priority
		id = admiral
		value = -100
	}
}

do_not_waste_pp_if_saving_for_manpower_laws = {
	enable = {
		manpower_per_military_factory < 500
		has_war = yes
	}
	abort = {
		OR = {
			manpower_per_military_factory > 500
			has_war = no
		}
	}
	ai_strategy = {
		type = pp_spend_priority
		id = relation
		value = -9999
	}
	ai_strategy = {
		type = pp_spend_priority
		id = guarantee
		value = -9999
	}
}

ZIK_minor_allies = { #страны-омники фолькунгии охотнее вступают в альянс с ФСР
#	name = "Folkungia omniki allies"

	allowed = {
		OR = {
			original_tag = ZLK
			original_tag = ZNR
			original_tag = ZTL
			original_tag = ZNU
			original_tag = ZTH
			original_tag = ZPK
			original_tag = ZLB
			original_tag = ZCI
			original_tag = ZMK
			original_tag = ZCR
			original_tag = ZON
		}
	}
	enable = {
		OR = {
			has_government = communism
			communism > 0.5
		}
		is_in_faction = no
		ZIK = {
			has_government = communism
		}
		OR = {
			original_tag = ZLK
			original_tag = ZNR
			original_tag = ZTL
			original_tag = ZNU
			original_tag = ZTH
			original_tag = ZPK
			original_tag = ZLB
			original_tag = ZCI
			original_tag = ZMK
			original_tag = ZCR
			original_tag = ZON
		}
	}
	abort = {
		ZIK = {
			NOT = {
				has_government = communism
			}
		}
	}
	ai_strategy = {
		type = alliance
		id = ZIK
		value = 50
	}
}

seishu_major_anti_allies = { #страны мажоры не очень то хотят в сейшу
#	name = "seishu_major_anti_allies"
	allowed = {
		OR = {
			original_tag = ZRI
			original_tag = ZSL
			original_tag = ZKR
			original_tag = ZSE
			original_tag = XPX
			original_tag = ZBR
			original_tag = ZBA
			original_tag = ZOR
		}
	}
	enable = {		
		is_in_faction = no
		ZMN = {
			is_seishu_leader = yes
		}
		OR = {
			original_tag = ZRI
			original_tag = ZSL
			original_tag = ZKR
			original_tag = ZSE
			original_tag = XPX
			original_tag = ZBR
			original_tag = ZBA
			original_tag = ZOR
		}
	}
	abort = {
		OR = {
			is_in_faction_with = ZMN
			ZMN = {
				is_seishu_leader = no
			}
		}
	}
	ai_strategy = {
		type = alliance
		id = ZMN
		value = -50
	}
}

liga_major_anti_allies = { #страны мажоры не очень то хотят в лигу
#	name = "liga_major_anti_allies"
	allowed = {
		OR = {
			original_tag = ZRI
			original_tag = ZSL
			original_tag = ZKR
			original_tag = ZSE
			original_tag = XPX
			original_tag = ZBR
			original_tag = ZBA
			original_tag = ZOR
		}
	}
	enable = {		
		is_in_faction = no
		ZCS = {
			is_lingsan_liga_leader = yes
		}
		OR = {
			original_tag = ZRI
			original_tag = ZSL
			original_tag = ZKR
			original_tag = ZSE
			original_tag = XPX
			original_tag = ZBR
			original_tag = ZBA
			original_tag = ZOR
		}
	}
	abort = {
		OR = {
			is_in_faction_with = ZCS
			ZCS = {
				is_seishu_leader = no
			}
		}
	}
	ai_strategy = {
		type = alliance
		id = ZCS
		value = -50
	}
}

default_railway_gun_management = {
	enable = {
		num_divisions > 150
		is_major = yes
		has_dlc = "No Step Back"
	}
	abort = {
		num_divisions < 120
	}	
	ai_strategy = { # This will add the specified value to the RAILWAY_GUN_PRODUCTION_BASE_DIVISIONS_RATIO_PERCENT define and use that as the desired railway guns / divisions ratio (in %)
		type = railway_gun_divisions_ratio
		value = 4
	}	
}

default_produce_floating_harbors = {
	enable = {
#		is_historical_focus_on = no
		has_war = yes
		num_of_naval_factories > 25
		num_of_military_factories > 40 # floating harbors are used for invasions. Why do large invasions if you don't have the industrial capacity?
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = unit_ratio
		id = floating_harbor # for floating harbors, 'unit_ratio' is actually not a ratio but an absolute desired number
		value = 10
	}
}


