# Build the naval college: occupies 5 civs for 90 days via the
# nc_under_construction timed idea (consumer_goods_factor = 0.10). The outer
# guard refuses to fire if construction is already running OR the country
# doesn't have 5 free civs. The same checks live in the build button's
# click_enabled trigger so the button greys out at the same threshold;
# this is belt-and-suspenders.
nc_build_college_effect = {
	if = {
		limit = {
			NOT = { check_variable = { nc_built = 1 } }
			NOT = { check_variable = { nc_construction_active = 1 } }
			num_of_civilian_factories_available_for_projects > 4
		}
		set_variable = { nc_construction_active = 1 }
		set_variable = { nc_construction_days_remaining = 90 }
		# Init the progress-bar x offset at "fully clipped" so the bar
		# starts empty before the first on_daily recomputation.
		set_variable = { nc_construction_bar_x = -377 }
		add_timed_idea = {
			idea = nc_under_construction
			days = 90
		}
	}
}

nc_complete_construction_effect = {
	set_variable = { nc_built = 1 }
	set_variable = { nc_construction_active = 0 }
	set_variable = { nc_construction_days_remaining = 0 }

	# Seed the academy tier/upgrade variables so the academy tab is
	# usable the moment construction finishes (without this, tier vars
	# would be 0 and the row labels would render as "T0").
	nc_academy_init_defaults_effect = yes
}
