cmp_fumo_available = {
    scope = country
    is_shown = { is_player = yes }
}

cmp_fumo_enabled = {
    scope = country
    is_shown = { is_player = yes has_variable = cmp_fumo_enabled }
}

cmp_fumo_discovered = {
    scope = country
    is_shown = {
        is_player = yes
        OR = { has_variable = cmp_fumo_discovered has_variable = cmp_fumo_enabled }
    }
}

cmp_fumo_discover = {
    scope = country
    is_shown = { is_player = yes }
    is_valid = { is_player = yes }
    effect = {
        if = {
            limit = { is_player = yes }
            set_variable = { name = cmp_fumo_discovered value = 1 }
        }
    }
}

cmp_fumo_enable = {
    scope = country
    is_shown = { is_player = yes }
    is_valid = { is_player = yes }
    effect = {
        if = {
            limit = { is_player = yes }
            set_variable = { name = cmp_fumo_discovered value = 1 }
            set_variable = { name = cmp_fumo_enabled value = 1 }
            if = {
                limit = { NOT = { has_variable = sakuya_b4_gen_land_amount } }
                set_variable = { name = sakuya_b4_gen_land_amount value = 0 }
            }
        }
    }
}

cmp_fumo_disable = {
    scope = country
    is_shown = { is_player = yes }
    is_valid = { is_player = yes }
    effect = {
        if = {
            limit = { is_player = yes }
            set_variable = { name = cmp_fumo_discovered value = 1 }
            remove_variable = cmp_fumo_enabled
        }
    }
}

cmp_fumo_create = {
    scope = country
    is_shown = { is_player = yes has_variable = cmp_fumo_enabled }
    is_valid = {
        is_player = yes
        has_variable = cmp_fumo_enabled
        exists = capital
        has_variable = sakuya_b4_gen_land_amount
        var:sakuya_b4_gen_land_amount >= 0
        var:sakuya_b4_gen_land_amount < 16
        OR = {
            var:sakuya_b4_gen_land_amount = 0
            var:sakuya_b4_gen_land_amount = 1
            var:sakuya_b4_gen_land_amount = 2
            var:sakuya_b4_gen_land_amount = 3
            var:sakuya_b4_gen_land_amount = 4
            var:sakuya_b4_gen_land_amount = 5
            var:sakuya_b4_gen_land_amount = 6
            var:sakuya_b4_gen_land_amount = 7
            var:sakuya_b4_gen_land_amount = 8
            var:sakuya_b4_gen_land_amount = 9
            var:sakuya_b4_gen_land_amount = 10
            var:sakuya_b4_gen_land_amount = 11
            var:sakuya_b4_gen_land_amount = 12
            var:sakuya_b4_gen_land_amount = 13
            var:sakuya_b4_gen_land_amount = 14
            var:sakuya_b4_gen_land_amount = 15
        }
    }
    effect = { cmp_fumo_create_effect = yes }
}
