# Comprehensive Sandbox Control - state actions scripted triggers
#
# State-scoped triggers. Target state is in scope. Acting country is ROOT.

# csc_state_action_transfer_owner_enabled
csc_state_action_transfer_owner_enabled = {
	NOT = { is_owned_by = ROOT }
}

# csc_state_action_transfer_controller_enabled
csc_state_action_transfer_controller_enabled = {
	NOT = { is_controlled_by = ROOT }
}

# csc_state_action_add_core_enabled
csc_state_action_add_core_enabled = {
	NOT = { is_core_of = ROOT }
}

# csc_state_action_remove_core_enabled
csc_state_action_remove_core_enabled = {
	is_core_of = ROOT
}

# csc_state_action_add_claim_enabled
csc_state_action_add_claim_enabled = {
	NOT = { is_claimed_by = ROOT }
}

# csc_state_action_remove_claim_enabled
csc_state_action_remove_claim_enabled = {
	is_claimed_by = ROOT
}

# csc_state_action_move_capital_enabled
csc_state_action_move_capital_enabled = {
	is_owned_by = ROOT
	NOT = {
		is_capital = yes
	}
}

# csc_state_action_build_slots_enabled
csc_state_action_build_slots_enabled = {
	is_owned_by = ROOT
}

# csc_state_action_give_resource_rights_enabled
# Offer only on states ROOT does not own (owning already grants the resources)
# and does not already hold rights to (complementary with the remove gate).
csc_state_action_give_resource_rights_enabled = {
	NOT = { is_owned_by = ROOT }
	NOT = { ROOT = { has_resources_rights = { state = PREV } } }
}

# csc_state_action_remove_resource_rights_enabled
# Offer only when ROOT actually holds rights to this state. Checked in country
# scope (state = PREV) per vanilla usage; receiver does not accept a scope
# keyword. Note: the engine trigger returns false for resource-less states.
csc_state_action_remove_resource_rights_enabled = {
	ROOT = { has_resources_rights = { state = PREV } }
}

# csc_state_action_repair_buildings_enabled
csc_state_action_repair_buildings_enabled = {
	is_controlled_by = ROOT
}
