# Raid AI fast-fail — AI only prepares raids against current/probable enemies. Leads every shared # availability trigger so far-off neutral targets short-circuit here and never reach ai_will_do # scoring. is_ai = no leaves the player path (PP/opinion/doctrine) completely unchanged. raid_ai_target_relevant = { hidden_trigger = { OR = { is_ai = no has_war_with = FROM has_country_flag = promised_retaliation_against@FROM is_in_array = { array = potential_and_current_enemies value = FROM } } } } # Drone raid availability — wartime/wargoal/retaliation/PP>300 # Used by drone raids that require active hostility (airfield, rocket site, swarm) # Shared available base — ai_target_relevant + war/doctrine bypass + FROM eligibility raid_available_base = { raid_ai_target_relevant = yes raid_war_or_doctrine_bypass = yes raid_target_eligible_from = yes } drone_raid_available_hostile = { set_temp_variable = { cost = 300 } raid_available_base = yes OR = { raid_can_launch = yes has_wargoal_against = FROM } } # Drone/air raid availability — grey-zone ops (PP>99 or wartime) # Used by drone/ai raids against civilian infrastructure (power grid, resources) raid_available_grey_zone = { raid_available_base = yes set_temp_variable = { cost = 99 } raid_can_launch = yes } # Raid target basic eligibility — not a subject and no NAP # Used as a building block in available blocks that have custom OR conditions raid_target_eligible = { raid_ai_target_relevant = yes raid_war_or_doctrine_bypass = yes } raid_target_eligible_from = { FROM = { NOT = { is_subject_of = ROOT } NOT = { has_non_aggression_pact_with = ROOT } hidden_trigger = { MD_special_countries = no } } } # Raid show_target — neutral-hostility intervention doctrine (opinion < 0) # Used by air/drone raids that show when at war OR when opinion < 0 + doctrine permits raid_show_target_opinion_neutral = { OR = { has_war_with = FROM AND = { has_opinion = { target = FROM value < 0 } raid_show_target_intervention_check = yes } } } # Raid show_target — hostile-only intervention doctrine (opinion < -50) # Used by cruise missile raids requiring deeper hostility raid_show_target_opinion_hostile = { OR = { has_war_with = FROM AND = { has_opinion = { target = FROM value < -50 } raid_show_target_intervention_check = yes } } } # Raid show_target — special forces hostile doctrine (opinion < -50, wargoal, or justification) # Extends raid_show_target_opinion_hostile with wargoal/justification visibility for pre-war prep raid_show_target_specops_hostile = { OR = { has_war_with = FROM has_wargoal_against = FROM is_justifying_wargoal_against = FROM AND = { has_opinion = { target = FROM value < -50 } raid_show_target_intervention_check = yes } } } # Raid show_target — intervention-doctrine reach check only # Limited interventionism requires a neighbour; regional requires same continent. Used by raids # where doctrine-based reach is the only visibility gate (the caller adds its own war/wargoal/ # country-flag check separately, so this trigger stays as a stand-alone doctrine clause). # Bypassed entirely when the rule_raid_doctrine_reach game rule is enabled — players who # don't want their doctrine restricting raid reach can flip the rule. raid_show_target_intervention_check = { OR = { has_game_rule = { rule = rule_raid_doctrine_reach option = yes } if = { limit = { has_idea = intervention_limited_interventionism } is_neighbor_of = FROM } else_if = { limit = { has_idea = intervention_regional_interventionism } custom_trigger_tooltip = { tooltip = nation_on_same_continent FROM = { is_on_same_continent_as = PREV } } } } } # Raid available — special forces tech gate # Composes with the caller's own hostility OR-block. Encapsulates the "tech_1 unlocks the # raid, tech_4 unlocks intercontinental reach" logic inside a single custom_trigger_tooltip # so callers don't reimplement the tooltip wrapper. raid_special_forces_tech_available = { raid_ai_target_relevant = yes has_tech = special_forces_tech_1 custom_trigger_tooltip = { tooltip = has_spec_ops_4_TT if = { limit = { NOT = { has_tech = special_forces_tech_4 } } FROM = { is_on_same_continent_as = PREV } } } } # Raid AI — "we are at peace with target and no promised retaliation" # 50+ verbatim duplicates of this NOT-pair appear in `factor = 0` AI gates as the standard # bail-out predicate. Extracting it makes the intent ("AI should pass on this target at peace # unless revenge is owed") readable in one line and keeps additions (e.g. adding a wargoal # bypass) in one place. raid_skip_target_non_hostile_no_retaliation = { NOT = { has_war_with = FROM } NOT = { has_country_flag = promised_retaliation_against@FROM } } # Raid AI — alliance balance is unfavourable # Use as a `factor = 0` gate: AI backs off from raiding faction members when its own # alliance-strength-ratio is clearly below parity. Threshold 0.7 matches the existing # EH_stable_situation_trigger convention. Bypassed at war or with a retaliation promise so # the AI can still strike pre-declared enemies even when outmatched. raid_alliance_unfavorable = { FROM = { is_in_faction = yes } check_variable = { alliance_strength_ratio < 0.7 } raid_skip_target_non_hostile_no_retaliation = yes } # Raid AI — actor's intervention doctrine forbids reach to this target # Mirrors the show_target/available doctrine gate inside ai_will_do so the AI doesn't waste # scoring on raids the system has already hidden. Honors rule_raid_doctrine_reach: when the # player sets the rule to yes, the doctrine never blocks AI scoring either. # Regional interventionism is deliberately omitted here because its off-continent restriction # is already enforced by the show_target triggers (raid_show_target_opinion_*); an AI that # passes show_target has already satisfied the regional reach check. raid_intervention_doctrine_reach_block = { NOT = { has_game_rule = { rule = rule_raid_doctrine_reach option = yes } } OR = { AND = { has_idea = intervention_isolation NOT = { has_war_with = FROM } } AND = { has_idea = intervention_local_security NOT = { is_neighbor_of = FROM } NOT = { has_war_with = FROM } } AND = { has_idea = intervention_limited_interventionism NOT = { is_neighbor_of = FROM } NOT = { has_war_with = FROM } } } } # Shared war/doctrine bypass — has_war = yes or rule_raid_doctrine_reach with local_security/isolation raid_war_or_doctrine_bypass = { OR = { has_war = yes if = { limit = { has_game_rule = { rule = rule_raid_doctrine_reach option = yes } } NOT = { has_idea = intervention_local_security } NOT = { has_idea = intervention_isolation } } else = { always = no } } } # Raid PP check — discounted by raid_cost_factor (ISR doctrine -0.25 → 25% off) # Caller must set cost first: set_temp_variable = { cost = 99 } then raid_can_launch = yes raid_can_launch = { set_temp_variable = { raid_required_pp = { value = cost multiply = { value = 1 add = modifier@raid_cost_factor } } } OR = { has_war_with = FROM hidden_trigger = { has_country_flag = promised_retaliation_against@FROM } has_political_power > raid_required_pp } } check_if_nuclear_weapons_in_stockpile = { custom_override_tooltip = { tooltip = has_nuclear_weapons_in_arsenal_tt OR = { has_equipment = { nuclear_missile_equipment > temp_check } has_equipment = { nuclear_ballistic_missile_equipment > temp_check } } } } is_able_to_use_nuclear_strikes = { custom_override_tooltip = { tooltip = is_able_to_use_nuclear_strikes_tt OR = { AND = { has_idea = strategic_retaliation_only has_country_flag = has_been_nuked } AND = { has_idea = tac_and_strat_retaliation has_country_flag = has_been_nuked } AND = { has_idea = tac_first_use_strat_retaliation has_country_flag = has_been_nuked } has_idea = full_first_use } } } is_able_to_use_nuclear_strikes_tac = { custom_override_tooltip = { tooltip = is_able_to_use_nuclear_strikes_tac_tt OR = { AND = { has_idea = tac_and_strat_retaliation has_country_flag = has_been_nuked } has_idea = tac_first_use_strat_retaliation has_idea = full_first_use } } } is_able_to_launch_a_nuclear_strike = { custom_override_tooltip = { tooltip = is_able_to_launch_a_strike_type_tt OR = { AND = { has_idea = nuclear_power_def var:target_state = { OR = { is_owned_by = ROOT is_claimed_by = ROOT } } surrender_progress > 0.5 } has_idea = nuclear_power_off } } }