# Author(s): AngriestBird # Function: state_owned_or_puppet_owned_by_root # Purpose: State-scoped trigger. Returns true if the state is owned by ROOT or by a subject of ROOT. # Used inside count_triggers blocks in *_integrate_start available checks so puppet-held cores count toward the 80% threshold. state_owned_or_puppet_owned_by_root = { owner = { OR = { tag = ROOT is_subject_of = ROOT } } } # Function: formable_purchase_state_is_purchasable # Purpose: State-scoped trigger, ROOT = the prospective buyer. True while the state's current holder # can still be sold a formable core state. Shared by _buy_core_state's target_trigger and # cancel_trigger and by formable_purchase_deliver_offer so all three agree on one definition. formable_purchase_state_is_purchasable = { NOT = { is_owned_by = ROOT } owner = { NOT = { is_subject_of = ROOT } NOT = { has_war_with = ROOT } NOT = { has_country_flag = formable_purchase_offer_pending } NOT = { check_variable = { formable_offer_buyer_id > 0 } } NOT = { ROOT = { OR = { has_country_flag = formable_purchase_cooldown@PREV has_country_flag = formable_purchase_refused@PREV } } } } }