types = {

	nuclear_strike = {
		days_to_prepare = 30

		category = nuclear_raids

		command_power = 20 # command power allocation cost
		ai_will_do = {
			base = 1
			modifier = {
				# Don't target anyone who is not a potential enemy
				factor = 0
				NOT = {
					is_in_array = {
						array = potential_and_current_enemies
						value = FROM  # Target country
					}
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_major = yes
				}
			}
			modifier = {
				factor = 0.25 # If possible, during peacetime, prepare strikes against the main enemies
				NOT = { has_war_with = FROM }
				FROM = { is_major = no }
			}
		}

		allowed = {
			
		}
		# Raid Type is visible
		visible = {
			is_special_project_completed = sp:sp_nuclear_bomb
		}
		# Specific Target is visible
		show_target = {
			NOT = {
				is_in_faction_with = FROM
			}
		}

		# Can prepare
		available = {
			#has_war_with = FROM
		}
		launchable = {
			has_war_with = FROM
		}

		launch_sound = raid_launch_nuclear_strike

		target_type = {
			province = any
		}
		target_icon = GFX_other_target_icon

		unit_requirements = {
			equipment = {
				type = { strategic_bomber }
				amount = { min = 10 }
			}
		}
		essential_equipment = {
			nukes = 1
		}

		starting_point = {
		    types = { air_base }
		}

		arrow = {
			type = air
		}
        unit_model = {
            type = equipment
        }

		success_factors = {
			success = {
				base = 0.5
				experience = {
					weight = 0.1
					start_weight = -0.1
					reference = 1.0
				}
				air_defence = {
					reference = 100
					start_weight = -0.05
					weight = 0.05
				}
				air_agility = {
					reference = 100
					start_weight = -0.1
					weight = 0.1
				}
				reliability = {
					start_weight = -0.1
					weight = 0.1
				}



				air_superiority = {
					reference = 1.0
					start_weight = -0.25
					weight = 0.25
				}



				# Target
				interception = {
					reference = 10
					weight = -0.25
				}
				anti_air = {
					weight = -0.05
				}
				radar = {
					weight = -0.05
				}
				intel = {
					weight = 0.2
					#start_reference = 50
					reference = 100
				}
			}
		}

		success_levels = {
			failure = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = raid_aborted_tt
						add_political_power = -50
					}
					raid_damage_units = {
						plane_loss = 0.75
						ratio = yes
					}

				}
			}
			limited_success = {
				actor_effects = {
					raid_damage_units = {
						plane_loss = 0.5
						ratio = yes
					}
					raid_add_unit_experience = 0.1
				}
				victim_effects = {
					var:target_state = {
						custom_effect_tooltip = raid_nuclear_strike_tt
						add_dynamic_modifier = {
							modifier = fallout_atomic
							days = 180
						}
					}
					var:actor_country = {
						custom_effect_tooltip = raid_nuclear_secondary_target_tt
						launch_nuke = {
							state = var:ROOT.target_state
							use_nuke = no
						}
					}
				}
			}
			success = {
			    custom_sound = raid_result_success_nuclear
				actor_effects = {
					raid_damage_units = {
						plane_loss = 0.1
						ratio = yes
					}
					raid_add_unit_experience = 0.35
				}
				victim_effects = {
					var:target_state = {
						custom_effect_tooltip = raid_nuclear_strike_tt
						add_dynamic_modifier = {
							modifier = fallout_atomic
							days = 365
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no
						}
					}
				}
			}
			critical_success = {
			    custom_sound = raid_result_critical_success_nuclear
				actor_effects = {
					raid_add_unit_experience = 0.5
				}
				victim_effects = {
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no
						}
					}
					var:target_state = {
						custom_effect_tooltip = raid_nuclear_strike_tt
						add_dynamic_modifier = {
							modifier = fallout_atomic
							days = 730
						}
					}
					
				}
			}
		}

	}

	nuclear_missile_strike = {
		category = nuclear_raids

		days_to_prepare = 14
		speed_multiplier = 0.08
		ai_will_do = {
			base = 1
			modifier = {
				# Don't target anyone who is not a potential enemy
				factor = 0
				NOT = {
					is_in_array = {
						array = potential_and_current_enemies
						value = FROM  # Target country
					}
				}
			}
			modifier = {
				factor = 2
				OR = {
					original_tag = USA
					original_tag = SOV
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_major = yes
				}
			}
			modifier = {
				factor = 0.25 # If possible, during peacetime, prepare strikes against the main enemies
				NOT = { has_war_with = FROM }
				FROM = { is_major = no }
			}
		}

		command_power = 5 # command power allocation cost

		allowed = {
			has_dlc = "Gotterdammerung"
		}
		# Raid Type is visible
		visible = {
			is_special_project_completed = sp:sp_nuclear_warheads
		}
		# Specific Target is visible
		show_target = {
			NOT = {
				is_in_faction_with = FROM
			}
		}

		# Can prepare
		available = {
			#has_war_with = FROM
		}
		launchable = {
			has_war_with = FROM
		}

		target_type = {
			province = any
		}
		target_icon = GFX_other_target_icon

		unit_requirements = {
			equipment = {
				type = { nuclear_missile_equipment }
				amount = { min = 1 }
			}
		}
		essential_equipment = {
			nukes = 1
		}

		starting_point = {
		    types = {
		        rocket_site
		        submarine
		    }
		}
		arrow = {
		    type = ballistic
		}

		launch_sound = raid_launch_nuclear_missile

        unit_model = {
            type = equipment
            scale = 0.5
        }

		success_factors = {
			success = {
				base = 0.8
				intel = {
					weight = 0.2
					#start_reference = 50
					reference = 100
				}
			}
		}



		success_levels = {
			failure = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = dud_missile_tt
					}
				}
			}
			limited_success = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = dud_missile_tt
					}
				}
			}
			success = {
			    custom_sound = raid_result_success_nuclear
				actor_effects = {
				}
				victim_effects = {
					var:target_state = {
						#custom_effect_tooltip = raid_nuclear_strike_tt
						add_dynamic_modifier = {
							modifier = fallout_atomic
							days = 365
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no #will consume nuke if specified
						}
					}
				}
			}
			critical_success = {
			    custom_sound = raid_result_critical_success_nuclear
				actor_effects = {
				}
				victim_effects = {
					var:target_state = {
						add_dynamic_modifier = {
							modifier = fallout_atomic
							days = 365
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no #will consume nuke if specified
						}
					}
				}
			}
		}
	}

	thermonuclear_strike = {
		days_to_prepare = 30

		category = nuclear_raids

		ai_will_do = {
			base = 1
			modifier = {
				# Don't target anyone who is not a potential enemy
				factor = 0
				NOT = {
					is_in_array = {
						array = potential_and_current_enemies
						value = FROM  # Target country
					}
				}
			}
			modifier = {
				factor = 2
				OR = {
					original_tag = USA
					original_tag = SOV
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_major = yes
				}
			}
			modifier = {
				factor = 0.25 # If possible, during peacetime, prepare strikes against the main enemies
				NOT = { has_war_with = FROM }
				FROM = { is_major = no }
			}
		}

		command_power = 20 # command power allocation cost

		allowed = {
			has_dlc = "Gotterdammerung"
		}
		# Raid Type is visible
		visible = {
			is_special_project_completed = sp:sp_thermo_nuclear_bomb
		}
		# Specific Target is visible
		show_target = {
			NOT = {
				is_in_faction_with = FROM
			}
		}

		# Can prepare
		available = {
			#has_war_with = FROM
		}
		launchable = {
			has_war_with = FROM
		}

		launch_sound = raid_launch_nuclear_strike

		target_type = {
			province = any
		}
		target_icon = GFX_other_target_icon
		target_loc_key = raid_target_name_thermonuclear

		unit_requirements = {
			equipment = {
				type = { strategic_bomber }
				amount = { min = 10 }
			}
		}
		nuke_type = thermonuclear_bomb

		essential_equipment = {
			nukes = 1
		}

		starting_point = {
		    types = { air_base }
		}

		arrow = {
			type = air
		}
        unit_model = {
            type = equipment
        }

		success_factors = {
			success = {
				base = 0.5
				experience = {
					weight = 0.1
					start_weight = -0.1
					reference = 1.0
				}
				air_defence = {
					reference = 100
					start_weight = -0.05
					weight = 0.05
				}
				air_agility = {
					reference = 100
					start_weight = -0.1
					weight = 0.1
				}
				reliability = {
					start_weight = -0.1
					weight = 0.1
				}



				air_superiority = {
					reference = 1.0
					start_weight = -0.25
					weight = 0.25
				}



				# Target
				interception = {
					reference = 10
					weight = -0.25
				}
				anti_air = {
					weight = -0.05
				}
				radar = {
					weight = -0.05
				}
				intel = {
					weight = 0.2
					#start_reference = 50
					reference = 100
				}
			}
		}

		success_levels = {
			failure = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = raid_aborted_tt
						add_political_power = -50
					}
					raid_damage_units = {
						plane_loss = 0.5
						ratio = yes
					}

				}
			}
			limited_success = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = raid_aborted_tt
					}
					raid_damage_units = {
						plane_loss = 0.25
						ratio = yes
					}
					raid_add_unit_experience = 0.1
				}
			}
			success = {
			    custom_sound = raid_result_success_nuclear
				actor_effects = {
					raid_damage_units = {
						plane_loss = 0.05
						ratio = yes
					}
					raid_add_unit_experience = 0.35
				}
				victim_effects = {
					var:target_state = {
						custom_effect_tooltip = raid_nuclear_strike_tt
						hidden_effect = {
							IF = {
								limit = { 
									has_dynamic_modifier = {
										modifier = fallout_atomic
									}
								}	
								remove_dynamic_modifier = {
									modifier = fallout_atomic
								}
							}
						}
						add_dynamic_modifier = {
							modifier = fallout_thermonuclear
							days = 730
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no
							nuke_type = thermonuclear_bomb
						}
					}
				}
			}
			critical_success = {
			    custom_sound = raid_result_critical_success_nuclear
				actor_effects = {
					raid_add_unit_experience = 0.5
				}
				victim_effects = {
					var:target_state = {
						custom_effect_tooltip = raid_nuclear_strike_tt
						hidden_effect = {
							IF = {
								limit = { 
									has_dynamic_modifier = {
										modifier = fallout_atomic
									}
								}	
								remove_dynamic_modifier = {
									modifier = fallout_atomic
								}
							}
						}
						add_dynamic_modifier = {
							modifier = fallout_thermonuclear
							days = 730
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no
							nuke_type = thermonuclear_bomb
						}
					}
				}
			}
		}
	}


	thermonuclear_missile_strike = {
		category = nuclear_raids

		days_to_prepare = 14
		speed_multiplier = 0.08

		ai_will_do = {
			base = 1
			modifier = {
				# Don't target anyone who is not a potential enemy
				factor = 0
				NOT = {
					is_in_array = {
						array = potential_and_current_enemies
						value = FROM  # Target country
					}
				}
			}
			modifier = {
				factor = 2
				FROM = {
					is_major = yes
				}
			}
			modifier = {
				factor = 0.25 # If possible, during peacetime, prepare strikes against the main enemies
				NOT = { has_war_with = FROM }
				FROM = { is_major = no }
			}
		}

		command_power = 5 # command power allocation cost

		allowed = {
			has_dlc = "Gotterdammerung"
		}
		# Raid Type is visible
		visible = {
			is_special_project_completed = sp:sp_nuclear_warheads
		}
		# Specific Target is visible
		show_target = {
			NOT = {
				is_in_faction_with = FROM
			}
		}

		# Can prepare
		available = {
			#has_war_with = FROM
		}
		launchable = {
			has_war_with = FROM
		}

		target_type = {
			province = any
		}
		target_icon = GFX_other_target_icon
		target_loc_key = raid_target_name_thermonuclear

		unit_requirements = {
			equipment = {
				type = { nuclear_missile_equipment }
				amount = { min = 1 }
			}
		}
		essential_equipment = {
			nukes = 1
		}
		nuke_type = thermonuclear_bomb
		starting_point = {
		    types = {
		        rocket_site
		        submarine
		    }
		}
		arrow = {
		    type = ballistic
		}

		launch_sound = raid_launch_nuclear_missile

        unit_model = {
            type = equipment
            scale = 0.5
        }

		success_factors = {
			success = {
				base = 0.8
				intel = {
					weight = 0.2
					#start_reference = 50
					reference = 100
				}
			}
		}

		success_levels = {
			failure = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = dud_missile_tt
					}
				}
			}
			limited_success = {
				actor_effects = {
					var:actor_country = {
						custom_effect_tooltip = dud_missile_tt
					}
				}
			}
			success = {
			    custom_sound = raid_result_success_nuclear
				actor_effects = {
				}
				victim_effects = {
					var:target_state = {
						#custom_effect_tooltip = raid_nuclear_strike_tt
						add_dynamic_modifier = {
							modifier = fallout_thermonuclear
							days = 730
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no #will consume nuke if specified
							nuke_type = thermonuclear_bomb
						}
					}
				}
			}
			critical_success = {
			    custom_sound = raid_result_critical_success_nuclear
				actor_effects = {
				}
				victim_effects = {
					var:target_state = {
						add_dynamic_modifier = {
							modifier = fallout_thermonuclear
							days = 730
						}
					}
					var:actor_country = {
						launch_nuke = {
							province = var:ROOT.target_province #optional use either province or state
							use_nuke = no #will consume nuke if specified
							nuke_type = thermonuclear_bomb
						}
					}
				}
			}
		}
	}
}
