﻿# Compatibility names retained for old callers. Live age logic is centralized
# in ve_age_triggers.txt.
age_1_obj_triggers = {
	ve_age_objective_1_trigger = yes
	ve_age_objective_2_trigger = yes
	ve_age_objective_3_trigger = yes
	ve_age_objective_4_trigger = yes
	ve_age_objective_5_trigger = yes
	ve_age_objective_6_trigger = yes
	ve_age_objective_7_trigger = yes
}

age_2_obj_triggers = {
	age_1_obj_triggers = yes
}

age_3_obj_triggers = {
	age_1_obj_triggers = yes
}

golden_age_3_obj_trigger = {
	ve_can_activate_golden_age = yes
}

splendor_cost_trigger = {
	ve_can_purchase_era_reward = yes
}

# True only when an embraced, unfinished group has an idea the country can
# currently afford. This prevents false alerts from the generic 200-point floor.
ve_can_purchase_any_idea = {
	OR = {
		AND = {
			has_variable = can_go_academic
			ve_idea_affordable = { GROUP = academic }
		}
		AND = {
			has_variable = can_go_agrarian
			ve_idea_affordable = { GROUP = agrarian }
		}
		AND = {
			has_variable = can_go_financial
			ve_idea_affordable = { GROUP = financial }
		}
		AND = {
			has_variable = can_go_infrastructure
			ve_idea_affordable = { GROUP = infrastructure }
		}
		AND = {
			has_variable = can_go_extraction
			ve_idea_affordable = { GROUP = extraction }
			OR = {
				var:extraction_idea < 6
				has_global_variable = age_3_started_trigger
			}
		}
		AND = {
			has_variable = can_go_mass_conscription
			ve_idea_affordable = { GROUP = mass_conscription }
		}
		AND = {
			has_variable = can_go_war_economy
			ve_idea_affordable = { GROUP = war_economy }
		}
		AND = {
			has_variable = can_go_industrialist
			ve_idea_affordable = { GROUP = industrialist }
		}
		AND = {
			has_variable = can_go_bureaucratic
			ve_idea_affordable = { GROUP = bureaucratic }
		}
		AND = {
			has_variable = can_go_nationalist
			ve_idea_affordable = { GROUP = nationalist }
		}
		AND = {
			has_variable = can_go_parliamentary
			ve_idea_affordable = { GROUP = parliamentary }
		}
		AND = {
			has_variable = can_go_diplomatic
			ve_idea_affordable = { GROUP = diplomatic }
		}
		AND = {
			has_variable = can_go_mercantile
			ve_idea_affordable = { GROUP = mercantile }
		}
		AND = {
			has_variable = can_go_welfare
			ve_idea_affordable = { GROUP = welfare }
		}
		AND = {
			has_variable = can_go_reformist
			ve_idea_affordable = { GROUP = reformist }
		}
		AND = {
			has_variable = can_go_labour
			ve_idea_affordable = { GROUP = labour }
		}
		AND = {
			has_variable = can_go_offensive
			ve_idea_affordable = { GROUP = offensive }
		}
		AND = {
			has_variable = can_go_defensive
			ve_idea_affordable = { GROUP = defensive }
		}
		AND = {
			has_variable = can_go_naval
			ve_idea_affordable = { GROUP = naval }
		}
		AND = {
			has_variable = can_go_professional_army
			ve_idea_affordable = { GROUP = professional_army }
		}
		AND = {
			has_variable = can_go_colonial
			ve_idea_affordable = { GROUP = colonial }
		}
	}
}

culture_cost_trigger = {
	ve_can_change_identity_model = yes
}

# Can this country implement and afford the NEXT idea of $GROUP$?
# var:$GROUP$_idea holds how many are already bought, so level N+1 costs
# IDEA_COST[N+1]. Doctrine Implementation Strain is also the global purchase
# cadence: only one group idea may be adopted in each 24-month implementation
# window.
ve_idea_affordable = {
	NOT = {
		has_modifier = ve_national_insight_implementation_strain
	}
	OR = {
		AND = {
			var:$GROUP$_idea == 0
			ve_national_insight_value >= 200
		}
		AND = {
			var:$GROUP$_idea == 1
			ve_national_insight_value >= 250
		}
		AND = {
			var:$GROUP$_idea == 2
			ve_national_insight_value >= 300
		}
		AND = {
			var:$GROUP$_idea == 3
			ve_national_insight_value >= 375
		}
		AND = {
			var:$GROUP$_idea == 4
			ve_national_insight_value >= 450
		}
		AND = {
			var:$GROUP$_idea == 5
			ve_national_insight_value >= 550
		}
		AND = {
			var:$GROUP$_idea == 6
			ve_national_insight_value >= 675
		}
	}
}
