#####################################################################################################################
# COMMENTS HAVE BEEN INCLUDED FOR SAKE OF EXPLANATION, CAN BE REMOVED #
# ID's must not include spaces!
# Decisions MUST be visible for the AI to execute them, if in doubt, switch tag to the AI country and check if they can see/execute the mission.
#####################################################################################################################
industry_management = {		#Name of category that decisions will appear under, decisions MUST have a category to work properly.
	wait = {		#ID of the decision, must not contain spaces!

		icon = GFX_decision_icon_default		#The left side icon to show for this decision.
		
		# CONDITIONS TO MAKE THIS DECISION/MISSION APPEAR AND EXECUTE
		
		available = {		
		}
		
		fire_only_once = no		#If set to yes, the decision will only appear once, after execution will not appear again.
		days_re_enable = 5	#The amount of days of days it will take for the decision to reappear. Not valid if fire_only_once is set to yes

		visible = {		#Conditions to make this decision visible, can be left blank to make it always appear.
			is_debug = yes
		}		

		cost = 0		#The cost to execute the decision, by default its political power.

		# EFFECTS OF THIS DECISION/MISSION

		complete_effect = {		#The effects to execute once the envelope icon is clicked.
			custom_effect_tooltip = "DECISION_EFFECT_YAY"
			hidden_effect = {
				add_political_power = 500
			}
		}
		
		# AI LOGIC FOR THIS DECISION/MISSION

		ai_will_do = {	#Modifiers for the AI to decide when to execute the decision.
			factor = 0			
		}
	}
	
	###################################################
	####### HIRE PRIVATE CONSTRUCTION COMPANIES #######
	###################################################
	
	hire_private_construction_companies_very_small_industry = {

		icon = category_generic_foreign_policy

		visible = {
		  industrial_complex > 2
		  industrial_complex < 7
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.45
		}
		remove_effect = {	
          add_political_power = -750		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	hire_private_construction_companies_small_industry = {

		icon = category_generic_foreign_policy

		visible = {
          OR = {
            industrial_complex > 7
            industrial_complex = 7
          }
		  industrial_complex < 15
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.40
		}
		remove_effect = {	
          add_political_power = -550		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	hire_private_construction_companies_medium_industry = {

		icon = category_generic_foreign_policy

		visible = {
          OR = {
            industrial_complex > 15
            industrial_complex = 15
          }
		  industrial_complex < 23
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.35
		}
		remove_effect = {	
          add_political_power = -500		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	hire_private_construction_companies_slight_large_industry = {

		icon = category_generic_foreign_policy

		visible = {
          OR = {
            industrial_complex > 23
            industrial_complex = 23
          }
		  industrial_complex < 45
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.20
		}
		remove_effect = {	
          add_political_power = -480		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	hire_private_construction_companies_large_industry = {

		icon = category_generic_foreign_policy

		visible = {
          OR = {
            industrial_complex > 45
            industrial_complex = 45
          }
		  industrial_complex < 120
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.20
		}
		remove_effect = {	
          add_political_power = -400		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	hire_private_construction_companies_very_large_industry = {

		icon = category_generic_foreign_policy

		visible = {
          OR = {
            industrial_complex > 120
            industrial_complex = 120
          }
		  industrial_complex < 250
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.15
		}
		remove_effect = {	
          add_political_power = -250		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 5
		}
	}
	hire_private_construction_companies_huge_industry = {

		icon = category_generic_foreign_policy

		visible = {
		  OR = {
            industrial_complex > 250
            industrial_complex = 250
          }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 135

		days_remove = 160

		modifier = {
           production_speed_buildings_factor = 0.10
		}
		remove_effect = {	
          add_political_power = -175		#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	
	###################################################
	####### HIRE PRIVATE CONSTRUCTION COMPANIES #######
	###################################################
	
	###################################################
	####### OTHER  ####################################
	###################################################
	
	plan_small_military_sectors = {

		icon = category_generic_political_actions

		visible = {
		  OR = { 
		    num_of_controlled_states < 3
			num_of_controlled_states = 1
		  }
		  OR = { 
		    num_of_military_factories < 3
			num_of_military_factories = 0
		  }
		  num_of_civilian_factories > num_of_military_factories
		}
		
	    available = {
		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 230

		days_remove = 5

		modifier = {
           civilian_factory_use = 2
		}
		remove_effect = {	
            random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			}		
		}
		
		ai_will_do = {
			factor = 35
		}
	}
	
	###################################################
	####### OTHER  ####################################
	###################################################
	
	###################################################
	#######    COMMUNIST DECISIONS ####################
	###################################################
	
	five_year_plan = {

		icon = category_generic_industry

		visible = {
		  has_government = communism
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 0

		days_remove = 1826

		modifier = {
           production_speed_buildings_factor = 0.1
		   consumer_goods_factor = 0.05
		   production_factory_max_efficiency_factor = 0.05
		   production_factory_efficiency_gain_factor = -0.15 
		}
		remove_effect = {	
          add_political_power = 260
          country_event = imd.2		  #The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	begin_collectivization = {

		icon = category_generic_communism

		visible = {
		  has_government = communism
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = yes
		
		cost = 150

		days_remove = 200

		modifier = {
           production_speed_buildings_factor = 0.05
		   consumer_goods_factor = 0.03
		   production_factory_efficiency_gain_factor = -0.25 
		}
		remove_effect = {	
          country_event = imd.3		  #The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 100
		}
	}
	
	###################################################
	#######    COMMUNIST DECISIONS ####################
	###################################################
	
	###################################################
	#######    OFFENSIVE WAR DECISIONS ################
	###################################################
	
	begin_preparing_war_production = {

		icon = generic_prepare_civil_war

		visible = {
		  has_war = yes
		  NOT = { has_idea = war_prepared_imd }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 50

		days_remove = 60

		modifier = {
           production_speed_buildings_factor = -0.02
		   consumer_goods_factor = 0.03
		   production_factory_efficiency_gain_factor = -0.5
		}
		remove_effect = {	
          country_event = imd.6
          add_ideas = war_prepared_imd		  #The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 100
		}
	}
	rise_military_industry_salaries = {

		icon = generic_prepare_civil_war

		visible = {
		  has_war = yes
		  has_idea = war_prepared_imd
		  NOT = { has_idea = lowered_military_industry_salaries_imd }
		  NOT = { has_idea = rised_military_industry_salaries_imd }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 50

		days_remove = 7

		modifier = {
         
		}
		remove_effect = {	
          add_ideas = rised_military_industry_salaries_imd	  #The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 45
		}
	}
	lower_military_industry_salaries = {

		icon = generic_prepare_civil_war

		visible = {
		  has_idea = rised_military_industry_salaries_imd
		  NOT = { has_idea = lowered_military_industry_salaries_imd }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 35

		days_remove = 7

		modifier = {
          stability_factor = -0.1
		}
		remove_effect = {	
           add_timed_idea = {
              idea = lowered_military_industry_salaries_imd
              days = 30
            } 
            remove_ideas = rised_military_industry_salaries_imd			#The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 85
		}
	}
	launch_shock_offensive = {

		icon = generic_ignite_civil_war

		visible = { 
		  has_offensive_war = yes
		  has_idea = war_prepared_imd
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 50

		days_remove = 70

		modifier = {
		    production_factory_efficiency_gain_factor = 0.15
			industry_repair_factor = 0.2
			production_oil_factor = 0.25
			line_change_production_efficiency_factor = -0.05
			consumer_goods_factor = 0.1
			industrial_capacity_factory = 0.1
			supply_consumption_factor = 0.05
		}
		remove_effect = {	
           add_timed_idea = {
              idea = recent_offensive_imd
              days = 80
            }   #The effects to execute once the mission expires/completes and enters the remove phase.
		}
		
		ai_will_do = {
			factor = 50
		}
	}
	
	###################################################
	#######    OFFENSIVE WAR DECISIONS ################
	###################################################
	
	###################################################
	#######    DEFENSIVE WAR DECISIONS ################
	###################################################
	
	launch_state_industrial_conversion = {

		icon = generic_prepare_civil_war

		visible = {
		  has_defensive_war = yes
		  has_idea = war_prepared_imd
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 25

		days_remove = 70

		modifier = {
		   conversion_cost_civ_to_mil_factor = -0.6
		   stability_factor = -0.1
		}
		remove_effect = {	
           add_stability = -0.15
		}
		
		ai_will_do = {
			factor = 25
		}
	}
	launch_last_stand_industrial_push_1 = {

		icon = generic_prepare_civil_war

		visible = {
		  has_defensive_war = yes
		  has_idea = war_prepared_imd
		  NOT = { has_idea = damaged_industry }
		  NOT = { has_idea = very_damaged_industry }
		  NOT = { has_idea = collapsed_industry }
		  NOT = { has_idea = ruined_industry }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 35

		days_remove = 130

		modifier = {
		   	supply_consumption_factor = -0.05
			stability_factor = -0.1
			war_support_factor = -0.05
			industry_repair_factor = 0.2
			consumer_goods_factor = -0.05
		}
		remove_effect = {	
           custom_effect_tooltip = industrial_push_warning
		   add_political_power = -100
		   hidden_effect = {
		     add_timed_idea = { 
		       idea = damaged_industry
			   days = 160
		     }
			 
		   } 
		}
		
		ai_will_do = {
			factor = 20
		}
	}
	launch_last_stand_industrial_push_2 = {

		icon = generic_prepare_civil_war

		visible = {
		  has_defensive_war = yes
		  has_idea = war_prepared_imd
		  has_idea = damaged_industry
		  NOT = { has_idea = very_damaged_industry }
		  NOT = { has_idea = collapsed_industry }
		  NOT = { has_idea = ruined_industry }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 35

		days_remove = 130

		modifier = {
		   	supply_consumption_factor = -0.1
			stability_factor = -0.05
			war_support_factor = -0.03
			industry_repair_factor = 0.5
			consumer_goods_factor = -0.1
			out_of_supply_factor = -0.1
			supply_combat_penalties_on_core_factor = -0.05
		}
		remove_effect = {	
           add_political_power = -100
		   custom_effect_tooltip = industrial_push_warning2
		   hidden_effect = {
		     remove_ideas = damaged_industry
		     add_timed_idea = { 
		       idea = very_damaged_industry
			   days = 220
		     }
			 
		   } 
		   
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	launch_last_stand_industrial_push_3 = {

		icon = generic_prepare_civil_war

		visible = {
		  has_defensive_war = yes
		  has_idea = war_prepared_imd
		  has_idea = very_damaged_industry
		  NOT = { has_idea = damaged_industry }
		  NOT = { has_idea = collapsed_industry }
		  NOT = { has_idea = ruined_industry }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 35

		days_remove = 130

		modifier = {
		   	supply_consumption_factor = -0.2
			stability_factor = -0.05
			war_support_factor = -0.03
			industry_repair_factor = 0.65
			consumer_goods_factor = -0.25
			out_of_supply_factor = -0.15
			supply_combat_penalties_on_core_factor = -0.1
		}
		remove_effect = {	
           add_political_power = -100
		   custom_effect_tooltip = industrial_push_warning3
		   hidden_effect = {
		     remove_ideas = very_damaged_industry
		     add_timed_idea = { 
		       idea = collapsed_industry
			   days = 300
		     }
			 
		   } 
		   
		}
		
		ai_will_do = {
			factor = 0.5
		}
	}
	launch_last_stand_industrial_push_4 = {

		icon = generic_prepare_civil_war

		visible = {
		  has_defensive_war = yes
		  has_idea = war_prepared_imd
		  has_idea = collapsed_industry
		  NOT = { has_idea = ruined_industry }
		  NOT = { has_idea = damaged_industry }
		  NOT = { has_idea = very_damaged_industry }
		  NOT = { has_idea = ruined_industry }
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 35

		days_remove = 260

		modifier = {
		   	supply_consumption_factor = -0.65
			stability_factor = -0.05
			war_support_factor = -0.03
			industry_repair_factor = 0.75
			consumer_goods_factor = -0.35
			out_of_supply_factor = -0.35
			supply_combat_penalties_on_core_factor = -0.3
		}
		remove_effect = {	
           add_political_power = -100
		   custom_effect_tooltip = industrial_push_warning4
		   hidden_effect = {
		     remove_ideas = collapsed_industry
             add_ideas = ruined_industry
		   } 
		   
		}
		
		ai_will_do = {
			factor = 0.5
		}
	}
	repair_the_industry = {

		icon = generic_factory

		visible = {
		  has_war = no
		  has_idea = ruined_industry
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 0

		days_remove = 230

		modifier = {
			consumer_goods_factor = 1.0
		}
		remove_effect = {	
           add_political_power = 175
		   custom_effect_tooltip = repair_industry_tt
		   custom_effect_tooltip = repair_industry_tt2
		   hidden_effect = {
		     remove_ideas = ruined_industry
		   } 
		   
		}
		
		ai_will_do = {
			factor = 100
		}
	}
	

	

}

international_industrial_market = {		#Name of category that decisions will appear under, decisions MUST have a category to work properly.
	wait2 = {		#ID of the decision, must not contain spaces!

		icon = GFX_decision_icon_default		#The left side icon to show for this decision.
		
		# CONDITIONS TO MAKE THIS DECISION/MISSION APPEAR AND EXECUTE
		
		available = {
           
		}
		
		fire_only_once = no		#If set to yes, the decision will only appear once, after execution will not appear again.
		days_re_enable = 5	#The amount of days of days it will take for the decision to reappear. Not valid if fire_only_once is set to yes

		visible = {		#Conditions to make this decision visible, can be left blank to make it always appear.
			is_debug = yes
		}		

		cost = 0		#The cost to execute the decision, by default its political power.

		# EFFECTS OF THIS DECISION/MISSION

		complete_effect = {		#The effects to execute once the envelope icon is clicked.
			custom_effect_tooltip = "DECISION_EFFECT_YAY"
			hidden_effect = {
				add_political_power = 500
			}
		}
		
		# AI LOGIC FOR THIS DECISION/MISSION

		ai_will_do = {	#Modifiers for the AI to decide when to execute the decision.
			factor = 0			
		}
	}
	
	contract_1_civil_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_1_locked
          NOT = { has_decision = end_contract_1 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_1_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = industrial_complex
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_1_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_1_military_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_1_locked
          NOT = { has_decision = end_contract_1 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_1_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_1_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_2_civil_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_2_locked
          NOT = { has_decision = end_contract_2 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_2_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = industrial_complex
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_2_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_2_military_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_2_locked	
          NOT = { has_decision = end_contract_2 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_2_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_2_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_3_civil_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_3_locked
          NOT = { has_decision = end_contract_3 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_3_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = industrial_complex
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_3_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_3_military_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_3_locked	
          NOT = { has_decision = end_contract_3 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_3_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_3_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_4_civil_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_4_locked	
          NOT = { has_decision = end_contract_4 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_4_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = industrial_complex
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_4_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_4_military_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_4_locked	
          NOT = { has_decision = end_contract_4 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_4_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_4_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 1
		}
	}
	contract_5_civil_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_5_locked
          NOT = { has_decision = end_contract_5 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_5_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = industrial_complex
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = industrial_complex
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_5_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
		
		ai_will_do = {
			factor = 10
		}
	}
	contract_5_military_factory = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_5_locked
          NOT = { has_decision = end_contract_5 }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 150

		days_remove = 200

		modifier = {
			consumer_goods_factor = 0.25
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_5_countries
                   value = THIS.id
                }
			  }
			  random_owned_controlled_state = {
				limit = {
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
					OR = {
						is_in_home_area = yes
						NOT = {
							owner = {
								any_owned_state = {
									free_building_slots = {
										building = arms_factory
										size > 0
										include_locked = yes
									}
									is_in_home_area = yes
								}
							}
						}
					}
				}
				add_extra_state_shared_building_slots = 1
				add_building_construction = {
					type = arms_factory
					level = 1
					instant_build = yes
				}
			 }
			  add_political_power = 300
			  every_country = {
		        limit = { 
			     is_in_array = {
                   array = ROOT.contract_5_countries
                   value = THIS.id
                 }
			    }
				country_event = imd.7
			  }
			    
		    
		    }
		}
	}
	end_contract_1 = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_1_locked
          NOT = { has_decision = contract_1_civil_factory }
		  NOT = { has_decision = contract_1_military_factory }	 
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 10

		days_remove = 30

		modifier = {
			
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_1_countries
                   value = THIS.id
                }
			  }
			  remove_from_array = {
                 array = ROOT.contract_1_countries
                 value = THIS.id
              }
		    }
			remove_ideas = contract_1_locked
		}
		
		ai_will_do = {
			factor = 15
		}
	}
	end_contract_2 = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_2_locked
          NOT = { has_decision = contract_2_civil_factory }
		  NOT = { has_decision = contract_2_military_factory }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 10

		days_remove = 30

		modifier = {
			
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_2_countries
                   value = THIS.id
                }
			  }
			  remove_from_array = {
                 array = ROOT.contract_2_countries
                 value = THIS.id
              }
		    }
			remove_ideas = contract_2_locked
		}
		
		ai_will_do = {
			factor = 20
		}
	}
	end_contract_3 = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_3_locked
          NOT = { has_decision = contract_3_civil_factory }
		  NOT = { has_decision = contract_3_military_factory }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 10

		days_remove = 30

		modifier = {
			
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_3_countries
                   value = THIS.id
                }
			  }
			  remove_from_array = {
                 array = ROOT.contract_3_countries
                 value = THIS.id
              }
		    }
			remove_ideas = contract_3_locked
		}
		
		ai_will_do = {
			factor = 35
		}
	}
	end_contract_4 = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_4_locked
          NOT = { has_decision = contract_4_civil_factory }
		  NOT = { has_decision = contract_4_military_factory }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 10

		days_remove = 30

		modifier = {
			
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_4_countries
                   value = THIS.id
                }
			  }
			  remove_from_array = {
                 array = ROOT.contract_4_countries
                 value = THIS.id
              }
		    }
			remove_ideas = contract_4_locked
		}
		
		ai_will_do = {
			factor = 35
		}
	}
	end_contract_5 = {

		icon = generic_factory

		visible = {
	
		}
		
		available = {
          has_idea = contract_5_locked
          NOT = { has_decision = contract_5_civil_factory }
		  NOT = { has_decision = contract_5_military_factory }		  
		}

		cancel_trigger = {
	
		}
		
		fire_only_once = no
		
		cost = 10

		days_remove = 30

		modifier = {
			
		}
		remove_effect = {	
            every_country = {
		      limit = { 
			    is_in_array = {
                   array = ROOT.contract_5_countries
                   value = THIS.id
                }
			  }
			  remove_from_array = {
                 array = ROOT.contract_5_countries
                 value = THIS.id
              }
		    }
			remove_ideas = contract_5_locked
		}
		
		ai_will_do = {
			factor = 35
		}
	}
}
	
	
}


