﻿# GORA UI+ — Improved Parliament Graph: aggregate script values
#
# Side-effect free; safe to call from any country scope. Consumed by the
# seat-allocation effects in scripted_effects/gora_ipg_seat_allocation.txt.

# Total seats in the hemicycle. The seat-layout GUI (ipg_seat_layout.gui)
# is hand-positioned for exactly 300 seats — changing this without
# regenerating the layout produces visual gaps.
ipg_number_of_seats = { value = 300 }

# Sum of clout across every IG that currently exerts political influence.
# Denominator for the Power Structure share calculation.
ipg_total_active_ig_clout = {
	value = 0
	every_interest_group = {
		limit = { ig_clout > 0 }
		add = ig_clout
	}
}

# Aggregate population share of all aligned IGs, clamped to [0, 1].
ipg_total_aligned_population_share = {
	value = 0
	every_interest_group = {
		limit = { interest_group_population_percentage > 0 }
		add = interest_group_population_percentage
	}
	max = 1
}

# Sum of clout across all party members (used in Party scope).
ipg_party_total_clout = {
	value = 0
	every_member = {
		limit = { is_marginal = no }
		add = ig_clout
	}
}

# Cheap order key used after the master effect snapshots each party's clout.
# Keeping this as a named script value matches ordered_*'s vanilla contract.
ipg_cached_party_clout_value = {
	value = var:ipg_cached_party_clout
}
