﻿#ch_convert_holding_to_castle_decision
#ch_convert_holding_to_city_decision
#ch_convert_holding_to_temple_decision

ch_convert_holding_to_castle_decision = {
    decision_group_type = pcm
    picture = { reference = "gfx/interface/illustrations/decisions/castle.dds" }
    ai_check_interval = 0
    is_shown = {
        NOT = {
            has_government = tribal_government
        }
        is_landed = yes
    }
    widget = {
        # Name of the widget to use. Must be at the path <decision_view_widgets>/<widget_name>.gui
        gui = decision_view_widget_ch_convert_holding
        # Some widgets require a custom controller (see below). Default: default
        controller = create_holy_order
        barony_valid = {
            trigger_if = {
                limit = { exists = this }
                ch_barony_is_valid_for_castle_trigger = { CHARACTER = scope:ruler }
            }
            trigger_else = {
                custom_description = {
                    text = "has_ch_barony_selected"
                    always = no
                }
            }
        }
    }
    is_valid_showing_failures_only = {
        is_available_adult = yes
        is_at_war = no
    }
    is_valid = {
        is_at_war = no
        custom_description = {
            text = "has_ch_eligble_barony_to_castle_in_county"
            any_held_county = {
                any_in_de_jure_hierarchy = {
                    ch_barony_is_valid_for_castle_trigger = { CHARACTER = scope:ruler }
                }
            }
        }
        subject = root.culture
        culture = {
            has_innovation = innovation_motte
        }
    }
    cost = {
        #gold = main_building_tier_1_cost
    }
    effect = {
        scope:barony.title_province = {
            set_holding_type = castle_holding
        }
        # custom_tooltip = ch_convert_holding_to_castle_decision_effect_message
    }
    ai_potential = {
        always = no
    }
    ai_will_do = {
        base = 0
    }
}

ch_convert_holding_to_city_decision = {
    decision_group_type = pcm
    picture = { reference = "gfx/interface/illustrations/decisions/city.dds" }
    ai_check_interval = 0
    is_shown = {
        NOT = {
            has_government = tribal_government
        }
        is_landed = yes
    }
    widget = {
        # Name of the widget to use. Must be at the path <decision_view_widgets>/<widget_name>.gui
        gui = decision_view_widget_ch_convert_holding
        # Some widgets require a custom controller (see below). Default: default
        controller = create_holy_order
        barony_valid = {
            trigger_if = {
                limit = { exists = this }
                ch_barony_is_valid_for_city_trigger = { CHARACTER = scope:ruler }
            }
            trigger_else = {
                custom_description = {
                    text = "has_ch_barony_selected"
                    always = no
                }
            }
        }
    }
    is_valid_showing_failures_only = {
        is_available_adult = yes
        is_at_war = no
    }
    is_valid = {
        is_at_war = no
        custom_description = {
            text = "has_ch_eligble_barony_to_city_in_county"
            any_held_county = {
                any_in_de_jure_hierarchy = {
                    ch_barony_is_valid_for_city_trigger = { CHARACTER = scope:ruler }
                }
            }
        }
        subject = root.culture
        culture = {
            has_innovation = innovation_city_planning 
        }
    }
    cost = {
        #gold = main_building_tier_1_cost
    }
    effect = {
        scope:barony.title_province = {
            set_holding_type = city_holding
        }
        # custom_tooltip = ch_convert_holding_to_city_decision_effect_message
    }
    ai_potential = {
        always = no
    }
    ai_will_do = {
        base = 0
    }
}

ch_convert_holding_to_temple_decision = {
    decision_group_type = pcm
    picture = { reference = "gfx/interface/illustrations/decisions/temple.dds" }
    ai_check_interval = 0
    is_shown = {
        NOT = {
            has_government = tribal_government
        }
        is_landed = yes
    }
    widget = {
        # Name of the widget to use. Must be at the path <decision_view_widgets>/<widget_name>.gui
        gui = decision_view_widget_ch_convert_holding
        # Some widgets require a custom controller (see below). Default: default
        controller = create_holy_order
        barony_valid = {
            trigger_if = {
                limit = { exists = this }
                ch_barony_is_valid_for_temple_trigger = { CHARACTER = scope:ruler }
            }
            trigger_else = {
                custom_description = {
                    text = "has_ch_barony_selected"
                    always = no
                }
            }
        }
    }
    is_valid_showing_failures_only = {
        is_available_adult = yes
        is_at_war = no
    }
    is_valid = {
        is_at_war = no
        custom_description = {
            text = "has_ch_eligble_barony_to_temple_in_county"
            any_held_county = {
                any_in_de_jure_hierarchy = {
                    ch_barony_is_valid_for_temple_trigger = { CHARACTER = scope:ruler }
                }
            }
        }
        subject = root.culture
        culture = {
            has_innovation = innovation_city_planning 
        }
    }
    cost = {
        #gold = main_building_tier_1_cost
    }
    effect = {
        scope:barony.title_province = {
            set_holding_type = church_holding
        }
        # custom_tooltip = ch_convert_holding_to_temple_decision_effect_message
    }
    ai_potential = {
        always = no
    }
    ai_will_do = {
        base = 0
    }
}
