bm_explosive_reactive_armor_project = {
	specialization = specialization_land
	icon = GFX_sp_explosive_reactive_armor
	project_tags = {
		sp_tag_tank
	}

	breakthrough_cost = {
		specialization_land = 2
	}

	resource_cost = {
		resources = {
			steel = 3
			chromium = 2
		}
	}



	prototype_time = sp_time.prototype.medium
	complexity = sp_complexity.medium

	allowed = {
		has_dlc = "No Step Back"
	}
	available  = {
		if = {
			limit = {
				FROM = {
					is_ai = yes
				}
			}
			FROM = {
				always = no
			}
		}
		else = {
			FROM = {
				has_tech = armor_tech_4
				OR = {
					has_tech = advanced_medium_tank_chassis
					has_tech = advanced_heavy_tank_chassis
				}
			}
		}
	}

	generic_prototype_rewards = {
		bm_progress_reward_low
		bm_progress_reward_medium
		bm_progress_loss_low
		bm_progress_loss_medium
		bm_land_breakthrough_reward_low
		bm_land_breakthrough_reward_medium
		bm_land_breakthrough_reward_high
		bm_land_scientist_xp_reward_low
		bm_land_scientist_xp_reward_medium
		bm_land_scientist_xp_reward_high
		bm_land_scientist_xp_reward_very_high
	}	

	project_output = {
		country_effects = {
			custom_effect_tooltip = {
				localization_key = bm_explosive_reactive_armor_project_module_tt
				NAME = bm_explosive_reactive_armor_1
				DESC = bm_explosive_reactive_armor_1_desc
				ICON = GFX_bm_explosive_reactive_armor_module_icon
			}
		}

		enable_equipment_modules = {
			bm_explosive_reactive_armor_1
		}
	}

	unique_prototype_rewards = {
		bm_explosive_reactive_armor_project_reward_1 = {
			fire_only_once = yes

			threshold = {
				min = 0
				max = 100
			}

			weight = {
				base = 1000.0
			}

			option = {
				token = bm_explosive_reactive_armor_project_option_1

				iteration_output = {
					country_effects = {
						random_list = {
							40 = {
								FROM = {
									add_project_progress_ratio = constant:sp_progress.loss.medium
								}
							}
							30 = {
								add_breakthrough_progress = {
									value = sp_breakthrough_progress.high
									specialization = specialization_land
								}
							}							
						}
					}
				}
			}
			option = {
				token = bm_explosive_reactive_armor_project_option_2

				iteration_output = {
					scientist_effects = {
						if = {
							limit = {
								has_trait = scientist_trait_armored_specialist	
							}
							injure_scientist_for_days = 30
						}
						else = {
							random_list = {
								50 = {
									add_scientist_xp = {
										experience = constant:sp_scientist_xp_gain.low
										specialization = specialization_land
									}
								}
								30 = {
									add_scientist_trait = scientist_trait_armored_specialist
								}
							}							
						}
					}
				}
			}
		}
	}
}