ammunition_category = {



	buy_ammo_50000 = {
		icon = GFX_ammunition
		allowed = { always = yes }
		fire_only_once = no
		days_remove = 7
		days_re_enable = 0

		custom_cost_trigger = {
			check_variable = { treasury > 4.9 }
		}

		custom_cost_text = cost_5_0

		complete_effect = {
			set_temp_variable = { treasury_change = -5 }
			modify_treasury_effect = yes
			custom_effect_tooltip = "Adds 50,000 rounds of ammo to our stockpile"
		}

		remove_effect = {
			set_variable = { ammunition_daily = 50 }

			# base gain
			set_variable = { modifier_gain = modifier@daily_ammunition_gain }
			divide_variable = { modifier_gain = 1000 }
			add_to_variable = { ammunition_daily = modifier_gain }

			# factor
			set_variable = { ammunition_factor_calc = 1 }
			add_to_variable = { ammunition_factor_calc = modifier@ammunition_factor }
			clamp_variable = { 
				var = ammunition_factor_calc 
				min = 0 
				#max = 0
			}

			multiply_variable = { ammunition_daily = ammunition_factor_calc }


			add_to_variable = { ammunition_variable = ammunition_daily }
		}
	}
	
	
	buy_ammo_100000 = {
		icon = GFX_ammunition
		allowed = { always = yes }
		fire_only_once = no
		days_remove = 7
		days_re_enable = 0

		custom_cost_trigger = {
			check_variable = { treasury > 9.9 }
		}

		custom_cost_text = cost_10_0

		complete_effect = {
			set_temp_variable = { treasury_change = -10 }
			modify_treasury_effect = yes
			custom_effect_tooltip = "Adds 10,000 rounds of ammo to our stockpile"
		}

		remove_effect = {
			set_variable = { ammunition_daily = 100 }

			# base gain
			set_variable = { modifier_gain = modifier@daily_ammunition_gain }
			divide_variable = { modifier_gain = 1000 }
			add_to_variable = { ammunition_daily = modifier_gain }

			# factor
			set_variable = { ammunition_factor_calc = 1 }
			add_to_variable = { ammunition_factor_calc = modifier@ammunition_factor }
			clamp_variable = { 
				var = ammunition_factor_calc 
				min = 0 
				#max = 0
			}

			multiply_variable = { ammunition_daily = ammunition_factor_calc }


			add_to_variable = { ammunition_variable = ammunition_daily }
		}
	}
	
	
	
	
	buy_ammo_500000 = {
		icon = GFX_ammunition
		allowed = { always = yes }
		fire_only_once = no
		days_remove = 7
		days_re_enable = 0

		custom_cost_trigger = {
			check_variable = { treasury > 49.9 }
		}

		custom_cost_text = cost_50_0

		complete_effect = {
			set_temp_variable = { treasury_change = -50 }
			modify_treasury_effect = yes
			custom_effect_tooltip = "Adds 50,000 rounds of ammo to our stockpile"
		}

		remove_effect = {
			set_variable = { ammunition_daily = 500 }

			# base gain
			set_variable = { modifier_gain = modifier@daily_ammunition_gain }
			divide_variable = { modifier_gain = 1000 }
			add_to_variable = { ammunition_daily = modifier_gain }

			# factor
			set_variable = { ammunition_factor_calc = 1 }
			add_to_variable = { ammunition_factor_calc = modifier@ammunition_factor }
			clamp_variable = { 
				var = ammunition_factor_calc 
				min = 0 
				#max = 0
			}

			multiply_variable = { ammunition_daily = ammunition_factor_calc }


			add_to_variable = { ammunition_variable = ammunition_daily }
		}
	}
	
	
	
	
	
	ammo_eff = {
		icon = GFX_ammunition
		allowed = { always = yes }
		fire_only_once = no
		days_remove = 60
		days_re_enable = 7

		custom_cost_trigger = {
			check_variable = { treasury > 0 }
		}

		custom_cost_text = cost_0

		complete_effect = {
			set_temp_variable = { money = gdp_total }
			divide_temp_variable = { money = -3000 }
			multiply_temp_variable = { money = 1.7 }
			set_temp_variable = { treasury_change = money }
			modify_treasury_effect = yes
			
			custom_effect_tooltip = "Trade military equipment production efficiency for ammo production efficiency. This has a 30 day cooldown."
			
			add_timed_idea = {
				idea = ammo_eff_idea
				days = 60
			}
		}
	}
}
