###############################################
# === xenomorph_lustful_void_compat_wargoals.txt ===
###############################################
# Xenomorph + Lustful Void Compatibility War Goals
# Place in: common/war_goals/xenomorph_lustful_void_compat_wargoals.txt
# Self-contained compatibility war goal; uses Hive-local capture wrappers instead of requiring LV scripted effects.

wg_xeno_breeding_frenzy = {
	casus_belli = cb_xeno_breeding_frenzy
	hide_if_no_cb = no
	total_war = no
	cede_claims = no

	galactic_empire_joins_defender = {
		from = { is_galactic_emperor = yes }
		imperial_authority >= 100
	}

	surrender_acceptance = -50

	potential = {
		has_total_war_cb = no
		OR = {
			has_valid_civic = civic_xenomorph_matriarchs_hunger
			has_valid_civic = civic_xenomorph_patriarchs_dominion
		}
		NOT = { is_in_federation_with = from }
		NAND = {
			is_galactic_emperor = yes
			from = { is_galactic_community_member = yes }
		}
	}

	possible = {
		custom_tooltip = {
			fail_text = has_claimed_all_systems
			from = {
				is_country_type = default
				any_owned_planet = {
					is_colony = yes
					root = { NOT = { has_claim = prev.solar_system } }
				}
			}
		}
		custom_tooltip = {
			fail_text = cannot_use_against_emperor
			OR = {
				from = { is_galactic_emperor = no }
				is_galactic_community_member = no
			}
		}
		custom_tooltip = {
			fail_text = pax_galactica_active
			NAND = {
				is_active_resolution = resolution_emperor_pax_galactica
				is_galactic_community_member = yes
				from = { is_galactic_community_member = yes }
			}
		}
	}

	on_accept = {
		custom_tooltip = wg_lv_breedingoffensive_accept_them
		add_resource = {
			food = 250
			minerals = 125
			mult = from.trigger:num_owned_planets
		}
		xeno_breeding_offensive_kidnap_leaders = yes
		xeno_breeding_offensive_kidnap_pops = yes
	}

	on_status_quo = {
		xeno_breeding_offensive_kidnap_leaders = yes
		xeno_breeding_offensive_kidnap_pops = yes
	}

	ai_weight = { weight = 100 }
}

###############################################
# === xenomorph_wargoals_expanded.txt ===
###############################################
###############################################
# Xenomorph War Goals Expanded
# Place in: common/war_goals/xenomorph_wargoals_expanded.txt
###############################################

wg_xenomorph_harvest_broodstock = {
	casus_belli = cb_xenomorph_harvest_broodstock
	hide_if_no_cb = no
	total_war = no
	cede_claims = no
	surrender_acceptance = -25

	potential = {
		has_total_war_cb = no
		is_xenomorph_empire = yes
		NOT = { is_in_federation_with = from }
	}

	possible = {
		from = {
			is_country_type = default
			any_owned_planet = { is_colony = yes }
		}
	}

	on_accept = {
		add_modifier = { modifier = xenomorph_harvest_broodstock_victory days = 1800 }
		# LV compat bonus; the modifier definition lives in xenomorph_lustful_void_compat_static_modifiers.txt
		# and its single line silently no-ops when Lustful Void is not loaded.
		add_modifier = { modifier = xenomorph_harvest_broodstock_victory_lv_bonus days = 1800 }
		add_resource = { food = 500 minerals = 250 mult = from.trigger:num_owned_planets }
		from = { add_modifier = { modifier = xenomorph_broodstock_harvested days = 1800 } }
	}

	on_status_quo = {
		add_modifier = { modifier = xenomorph_partial_broodstock_harvest days = 900 }
		add_resource = { food = 250 minerals = 100 }
	}

	ai_weight = { weight = 75 }
}

wg_xenomorph_infestation_war = {
	casus_belli = cb_xenomorph_infestation_war
	hide_if_no_cb = no
	total_war = no
	cede_claims = occupied_only
	surrender_acceptance = -50

	potential = {
		has_total_war_cb = no
		is_xenomorph_empire = yes
		NOT = { is_in_federation_with = from }
	}

	possible = {
		from = {
			is_country_type = default
			any_owned_planet = { is_colony = yes }
		}
	}

	on_accept = {
		add_modifier = { modifier = xenomorph_infestation_victory days = 3600 }
		from = {
			add_modifier = { modifier = xenomorph_forced_infestation_country days = 3600 }
			every_owned_planet = {
				limit = { is_colony = yes }
				add_modifier = { modifier = xenomorph_forced_infestation_planet days = 3600 }
			}
		}
	}

	on_status_quo = {
		add_modifier = { modifier = xenomorph_partial_infestation days = 1800 }
	}

	ai_weight = { weight = 100 }
}

wg_xenomorph_claim_the_hive = {
	casus_belli = cb_xenomorph_claim_the_hive
	hide_if_no_cb = no
	total_war = no
	cede_claims = yes
	surrender_acceptance = -35

	potential = {
		has_total_war_cb = no
		is_xenomorph_empire = yes
		NOT = { is_in_federation_with = from }
	}

	possible = {
		from = {
			is_country_type = default
			any_owned_planet = {
				is_colony = yes
				OR = {
					has_building = building_xenomorph_queen_mother_hive
					is_planet_class = pc_hive
				}
			}
		}
	}

	on_accept = {
		add_modifier = { modifier = xenomorph_claimed_hive_victory days = 1800 }
		add_resource = { unity = 500 society_research = 500 }
	}

	on_status_quo = {
		add_resource = { unity = 250 society_research = 250 }
	}

	ai_weight = { weight = 50 }
}

wg_xenomorph_royal_supremacy = {
	casus_belli = cb_xenomorph_royal_supremacy
	hide_if_no_cb = no
	total_war = no
	cede_claims = no
	surrender_acceptance = -75

	potential = {
		has_total_war_cb = no
		OR = {
			has_origin = origin_xenomorph_queen_mother
			has_origin = origin_xenomorph_prime
		}
		NOT = { is_in_federation_with = from }
	}

	possible = {
		from = {
			is_country_type = default
			OR = {
				is_xenomorph_empire = yes
				has_authority = auth_hive_mind
				any_owned_planet = {
					is_colony = yes
					OR = {
						has_building = building_xenomorph_queen_mother_hive
					}
				}
			}
		}
	}

	on_accept = {
		add_modifier = { modifier = xenomorph_royal_supremacy_victory days = 3600 }
		from = { add_modifier = { modifier = xenomorph_royal_submission days = 3600 } }
		add_resource = { unity = 1000 influence = 100 }
	}

	on_status_quo = {
		add_modifier = { modifier = xenomorph_contested_supremacy days = 1800 }
	}

	ai_weight = { weight = 35 }
}
