orbital_bombardment_effect = {
    if = {
        limit = {
            check_variable = { country_devastation < 1 }
        }
        add_to_variable = { country_devastation = 0.001 }
        add_to_variable = { country_devastation_typr1_var = -0.001 }
    }
    if = {
        limit = {
            check_variable = { country_devastation > 0 }
            NOT = { has_dynamic_modifier = { modifier = ORBITAL_BOMBARDMENT_1 scope = ROOT } }
        }
        add_dynamic_modifier = {
            modifier = ORBITAL_BOMBARDMENT_1
            scope = THIS
        }
    }
    add_stability = -0.2
    add_war_support = -0.2
    set_country_flag = {
        flag = bombed_flag
        days = 14
        value = 1
    }
    if = {
        limit = {
            has_navy_size = {
                size > 0
                archetype = ship_hull_carrier
            }
        }
        destroy_ships = {
            type = ship_hull_carrier
            count = 1
        }
    }
    else_if = {
        limit = {
            has_navy_size = {
                size > 0
                archetype = ship_hull_heavy
            }
        }
        destroy_ships = {
            type = ship_hull_heavy
            count = 1
        }
    }
    else_if = {
        limit = {
            has_navy_size = {
                size > 0
                archetype = ship_hull_cruiser
            }
        }
        destroy_ships = {
            type = ship_hull_cruiser
            count = 1
        }
    }
    else_if = {
        limit = {
            has_navy_size = {
                size > 0
                archetype = ship_hull_light
            }
        }
        destroy_ships = {
            type = ship_hull_light
            count = 1
        }
    }
    else_if = {
        limit = {
            has_navy_size = {
                size > 0
                archetype = ship_hull_submarine
            }
        }
        destroy_ships = {
            type = ship_hull_submarine
            count = 1
        }
    }
    else = {
        if = {
            limit = {
                check_variable = { country_devastation < 1 }
            }
            add_to_variable = { country_devastation = 0.001 }
            add_to_variable = { country_devastation_typr1_var = -0.001 }
        }
    }
    
    if = {
        limit = {
            check_variable = {
                country_devastation > 0.75
            }
        }
        set_variable = { country_devastation_typr2_var = -0.5 }
    }

    if = {
        limit = {  
            any_controlled_state = {
                any_neighbor_state = {
                    is_controlled_by = ROOT
                }
                PREV = { divisions_in_state = { state = PREV size > 0 } }
            }
        }
        random_controlled_state = {
            limit = {
                any_neighbor_state = {
                    is_controlled_by = ROOT
                }
                PREV = { divisions_in_state = { state = PREV size > 0 } }
            }
            damage_units = {
                state = THIS
                limit = { has_country_flag = bombed_flag }
                damage = 0.5
                org_damage = 0.5
                str_damage = 0.5
                army = yes
                navy = no
            }
        }
    }
    else_if = {
        limit = {
            any_state = {
                PREV = { divisions_in_state = { state = PREV size > 0 } }
            }
        }
        random_state = {
            limit = {
                PREV = { divisions_in_state = { state = PREV size > 0 } }
            }
            damage_units = {
                state = THIS
                limit = { has_country_flag = bombed_flag }
                damage = 0.5
                org_damage = 0.5
                str_damage = 0.5
                army = yes
                navy = no
            }
        }
    }
    else_if = {
        limit = {
            ROOT = {
                has_country_flag = allow_orbital_bombardment_surrender_flag
            }
            num_divisions < 1
            NOT = {
                has_country_flag = temp_bombardment_surrender_flag
            }
        }
        set_country_flag = {
            flag = temp_bombardment_surrender_flag
            days = 14
            value = 1
        }
        every_controlled_state = {
            limit = {
                OR = {
                    is_claimed_by = ROOT
                    is_core_of = ROOT
                }
            }
            transfer_state_to = ROOT
        }
        country_event = {
            id = stt.104
            hours = 0
            random_hours = 0
        }
        ROOT = {
            puppet = {
                target = PREV
                end_wars = no
            }
        }
    }
}