﻿# ====== ä¸€é”®å»ºé€ ï¼šæ˜¯å�¦æœ‰å»ºç­‘å�¯å»?======

# æ˜¯å�¦å�¯åŠ æ§½ï¼ˆä¸Šé™�+é‡‘é’±æ£€æŸ¥ï¼‰
qing_htool_building_slot_add_trigger = {
    trigger_if = {
        limit = { qing_htool_building_slot_add_max_value > 0 }
        NOT = {
            var:qing_htool_building_slot_information_count >= qing_htool_building_slot_add_max_value
        }
    }
    # é‡‘é’±æ£€æŸ¥ï¼ˆç”¨æ€»èŠ±è´¹ï¼‰
    trigger_if = {
        limit = { qing_htool_building_slot_cost_total > 0 }
        trigger_if = {
            limit = { has_game_rule = qing_htool_main_pay_method_gold }
            root.gold >= qing_htool_building_slot_cost_total
        }
        trigger_else_if = {
            limit = { has_game_rule = qing_htool_main_pay_method_treasury }
            trigger_if = {
                limit = { root = { has_treasury = yes } }
                root.treasury >= qing_htool_building_slot_cost_total
            }
            trigger_else = {
                root.gold >= qing_htool_building_slot_cost_total
            }
        }
        trigger_else_if = {
            limit = { has_game_rule = qing_htool_main_pay_method_gold_first }
            OR = {
                root.gold >= qing_htool_building_slot_cost_total
                AND = {
                    root.treasury >= qing_htool_building_slot_cost_total
                    root = { has_treasury = yes }
                }
            }
        }
        trigger_else_if = {
            limit = { has_game_rule = qing_htool_main_pay_method_treasury_first }
            OR = {
                AND = {
                    root.treasury >= qing_htool_building_slot_cost_total
                    root = { has_treasury = yes }
                }
                root.gold >= qing_htool_building_slot_cost_total
            }
        }
    }
}

qing_htool_building_has_constructible_trigger = {
    OR = {
        AND = { qing_htool_building_build_construct_ramparts_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_curtain_walls_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_watchtowers_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_hill_forts_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_palisades_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_idjang_forts_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_common_tradeport_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_pastures_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_hunting_grounds_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_orchards_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_farm_estates_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_cereal_fields_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_logging_camps_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_peat_quarries_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_hill_farms_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_elephant_pens_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_plantations_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_quarries_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_qanats_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_murex_farm_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_paddy_fields_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_spice_plantation_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_waterworks_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_caravanserai_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 200 root.treasury >= 200 } }
        AND = { qing_htool_building_build_construct_watermills_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 200 root.treasury >= 200 } }
        AND = { qing_htool_building_build_construct_windmills_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 200 root.treasury >= 200 } }
        AND = { qing_htool_building_build_construct_guild_halls_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_market_villages_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_stilted_granaries_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_capital_bureau_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_breweries_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_military_camps_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_regimental_grounds_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 200 root.treasury >= 200 } }
        AND = { qing_htool_building_build_construct_barracks_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_warrior_lodges_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_hillside_grazing_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_outposts_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_camel_farms_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_horse_pastures_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 100 root.treasury >= 100 } }
        AND = { qing_htool_building_build_construct_stables_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_smiths_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_workshops_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 200 root.treasury >= 200 } }
        AND = { qing_htool_building_build_construct_wind_furnace_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_powder_magazine_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_war_camps_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_kora_kora_yards_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_wantilan_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_hospices_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_scriptorium_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_monastic_schools_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_megalith_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_longhouses_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_water_temples_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 75 root.treasury >= 75 } }
        AND = { qing_htool_building_build_construct_citadel_shrine_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_sacred_pool_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
        AND = { qing_htool_building_build_construct_vihara_halls_trigger = yes OR = { NOT = { qing_htool_building_build_construct_cost_switch_trigger = yes } root.gold >= 150 root.treasury >= 150 } }
    }
}
