rl_roguelike_fate_market = {
    rl_buy_upgrade_100 = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { NOT = { rl_offer_ui_busy = yes } }
        cost = 100
        complete_effect = { hidden_effect = { rl_purchase_upgrade_100 = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_buy_upgrade_200 = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { NOT = { rl_offer_ui_busy = yes } }
        cost = 200
        complete_effect = { hidden_effect = { rl_purchase_upgrade_200 = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_buy_upgrade_500 = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { NOT = { rl_offer_ui_busy = yes } }
        cost = 500
        complete_effect = { hidden_effect = { rl_purchase_upgrade_500 = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_buy_upgrade_1000 = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { NOT = { rl_offer_ui_busy = yes } }
        cost = 1000
        complete_effect = { hidden_effect = { rl_purchase_upgrade_1000 = yes } }
        ai_will_do = { factor = 0 }
    }
}

rl_roguelike_builds_fate = {
    rl_open_build_overview = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        cost = 0
        complete_effect = { hidden_effect = { country_event = { id = rl.20 } } }
        ai_will_do = { factor = 0 }
    }
    rl_manage_active_upgrades = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized has_global_flag = rl_ruleset_hardcore }
        available = { check_variable = { rl_hc_active_upgrade_count > 0 } NOT = { rl_offer_ui_busy = yes } }
        cost = 0
        complete_effect = {
            hidden_effect = {
                set_country_flag = rl_hc_management_mode
                clr_country_flag = rl_hc_replacement_mode
                country_event = { id = rl.51 }
            }
        }
        ai_will_do = { factor = 0 }
    }
    rl_fuse_common = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_fusion_common_cores > 2 } check_variable = { rl_fate_shards > 2 } NOT = { rl_offer_ui_busy = yes } }
        cost = 0
        complete_effect = { hidden_effect = { rl_fuse_common = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_fuse_rare = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_fusion_rare_cores > 2 } check_variable = { rl_fate_shards > 5 } NOT = { rl_offer_ui_busy = yes } }
        cost = 0
        complete_effect = { hidden_effect = { rl_fuse_rare = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_fuse_epic = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_fusion_epic_cores > 2 } check_variable = { rl_fate_shards > 11 } NOT = { rl_offer_ui_busy = yes } }
        cost = 0
        complete_effect = { hidden_effect = { rl_fuse_epic = yes } }
        ai_will_do = { factor = 0 }
    }
    rl_fuse_legendary = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_fusion_legendary_cores > 2 } check_variable = { rl_fate_shards > 23 } NOT = { rl_offer_ui_busy = yes } }
        cost = 0
        complete_effect = { hidden_effect = { rl_fuse_legendary = yes } }
        ai_will_do = { factor = 0 }
    }
    # v3.8.0: per-country setting (the game rule only sets the default), so one player no longer changes it for everybody
    rl_enable_auto_weakest_replace = {
        icon = generic_political_reform
        visible = {
            is_ai = no
            has_country_flag = rl_initialized
            has_global_flag = rl_ruleset_hardcore
            NOT = { rl_hc_auto_replace_active = yes }
        }
        cost = 0
        complete_effect = {
            hidden_effect = {
                set_country_flag = rl_hc_auto_on
                clr_country_flag = rl_hc_auto_off
            }
        }
        ai_will_do = { factor = 0 }
    }
    rl_disable_auto_weakest_replace = {
        icon = generic_political_reform
        visible = {
            is_ai = no
            has_country_flag = rl_initialized
            rl_hc_auto_replace_active = yes
        }
        cost = 0
        complete_effect = {
            hidden_effect = {
                set_country_flag = rl_hc_auto_off
                clr_country_flag = rl_hc_auto_on
            }
        }
        ai_will_do = { factor = 0 }
    }
    rl_reapply_counterpower = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized has_global_flag = rl_mode_player_only NOT = { has_global_flag = rl_counterpower_none } }
        cost = 0
        days_re_enable = 30
        complete_effect = {
            hidden_effect = {
                every_country = { limit = { is_ai = yes } set_variable = { rl_cp_applied_signature = -1 } }
                set_variable = { global.rl_cp_last_signature = -1 }
                rl_update_global_player_only_escalation = yes
                country_event = { id = rl.41 hours = 1 }
            }
        }
        ai_will_do = { factor = 0 }
    }
    rl_open_relic_archive = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        cost = 0
        complete_effect = { hidden_effect = { country_event = { id = rl.72 } } }
        ai_will_do = { factor = 0 }
    }
    rl_manage_relics = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_hc_relic_slots_used > 0 } }
        cost = 0
        complete_effect = { hidden_effect = { country_event = { id = rl.73 } } }
        ai_will_do = { factor = 0 }
    }
    rl_force_relic_discovery = {
        icon = generic_political_reform
        visible = { is_ai = no has_country_flag = rl_initialized }
        available = { check_variable = { rl_fate_shards > 39 } NOT = { has_country_flag = rl_relic_event_pending } }
        cost = 0
        complete_effect = { hidden_effect = { rl_force_relic_discovery = yes } }
        ai_will_do = { factor = 0 }
    }
}
