add_namespace = ET_Decolonization_Init

country_event = { # Releases
    id = ET_Decolonization_Init.0

    is_triggered_only = yes
    fire_only_once = no
    hidden = yes

    immediate = {
        if = { limit = { is_debug = yes } log = "[GetDateText]: Checking releasable nations for [This.Owner.GetTag]..." }
        # #
        #  Europe
        # #
        if = { # West Germany        [23 May 1949] WGR*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_WGR }
                OR = {
                    date > 1949.04.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = WGR }
                NOT = { original_tag = GER }
                OR = {
                    controls_state = 42
                    controls_state = 50
                    controls_state = 51
                    controls_state = 52
                    controls_state = 53
                    controls_state = 54
                    controls_state = 56
                    controls_state = 57
                    controls_state = 58
                    controls_state = 59
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_WGR
                days = 90
            }
            country_event = {
                id = ET_Independence_WestGermany.0
                days = 23
            }
        }
        if = { # East Germany        [7 October 1949] DDR*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_DDR }
                country_exists = WGR
                OR = {
                    date > 1949.04.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = DDR }
                NOT = { original_tag = GER }
                OR = {
                    controls_state = 41
                    controls_state = 60
                    controls_state = 62
                    controls_state = 63
                    controls_state = 64
                    controls_state = 65
                    controls_state = 68
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_DDR
                days = 90
            }
            country_event = {
                id = ET_Independence_EastGermany.0
                days = 3
            }
        }

        # #
        #  North America
        # #

        # #
        #  South America
        # #

        # #
        #  Africa
        #  https://en.wikipedia.org/wiki/List_of_sovereign_states_by_date_of_formation#Africa
        # #
        if = { # Algeria        [3 July 1962] FRA*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_ALG }
                OR = {
                    date > 1962.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = ANG }
                OR = {
                    controls_state = 459
                    controls_state = 460
                    controls_state = 513
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_ALG
                days = 90
            }
            country_event = {
                id = ET_Independence_Algeria.0
                days = 3
            }
        }
        if = { # Angola         [11 November 1975] POR
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_ANG }
                OR = {
                    date > 1975.10.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = ANG }
                controls_state = 540
            }
            set_country_flag = {
                flag = ET_flag_country_free_ANG
                days = 90
            }
            country_event = {
                id = ET_Independence_Angola.0
                days = 11
            }
        }
        #if = { # Benin          [1 August 1960] FRA # TODO Make nation Benin
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_BNI }
        #        OR = {
        #            date > 1960.07.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = BNI }
        #        controls_state = 776
        #    }
        #    set_global_flag = ET_flag_country_free_BNI
        #    country_event = {
        #        id = ET_Independence_Benin.0
        #        days = 1
        #    }
        #}
        if = { # Botswana       [30 September 1966] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_BOT }
                OR = {
                    date > 1966.08.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = BOT }
                controls_state = 542
            }
            set_country_flag = {
                flag = ET_flag_country_free_BOT
                days = 90
            }
            country_event = {
                id = ET_Independence_Botswana.0
                days = 30
            }
        }
        #if = { # Burkina Faso   [5 August 1960] FRA # TODO Make nation Burkina Faso
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_BUF }
        #        OR = {
        #            date > 1960.07.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = BOT }
        #        controls_state = 542
        #    }
        #    set_global_flag = ET_flag_country_free_BUF
        #    country_event = {
        #        id = ET_Independence_BurkinaFaso.0
        #        days = 5
        #    }
        #}
        if = { # Burundi        [1 July 1962] BEL
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_BRD }
                OR = {
                    date > 1962.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = BOT }
                controls_state = 769
            }
            set_country_flag = {
                flag = ET_flag_country_free_BRD
                days = 90
            }
            country_event = {
                id = ET_Independence_Burundi.0
                days = 1
            }
        }
        if = { # Cabo Verde     [5 July 1975] POR
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_CAE }
                OR = {
                    date > 1975.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = CAE }
                controls_state = 769
            }
            set_country_flag = {
                flag = ET_flag_country_free_CAE
                days = 90
            }
            country_event = {
                id = ET_Independence_CaboVerde.0
                days = 5
            }
        }
        if = { # Cameroon       [1 January 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_CMR }
                OR = {
                    date > 1959.12.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = CMR }
                controls_state = 773
            }
            set_country_flag = {
                flag = ET_flag_country_free_CMR
                days = 90
            }
            country_event = {
                id = ET_Independence_CaboVerde.0
                days = 1
            }
        }
        if = { # Central African Republic [13 August 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_CAR }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = CAR }
                controls_state = 660
            }
            set_country_flag = {
                flag = ET_flag_country_free_CAR
                days = 90
            }
            country_event = {
                id = ET_Independence_CentralAfricanRepublic.0
                days = 13
            }
        }
        if = { # Chad           [11 August 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_CHA }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = CHA }
                OR = {
                    controls_state = 775
                    controls_state = 774
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_CHA
                days = 90
            }
            country_event = {
                id = ET_Independence_Chad.0
                days = 11
            }
        }
        #if = { # Comoros        [6 July 1975] FRA # TODO Make nation Comoros
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_CMS }
        #        OR = {
        #            date > 1975.06.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = CMS }
        #        controls_state = 660
        #    }
        #    set_global_flag = ET_flag_country_free_CMS
        #    country_event = {
        #        id = ET_Independence_Comoros.0
        #        days = 6
        #    }
        #}
        if = { # Republic of Congo [30 June 1960] BEL
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_RCG }
                OR = {
                    date > 1960.05.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = RCG }
                OR = {
                    controls_state = 295
                    controls_state = 538
                    controls_state = 718
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_RCG
                days = 90
            }
            country_event = {
                id = ET_Independence_RepublicOfCongo.0
                days = 30
            }
        }
        if = { # Djibouti       [27 June 1977] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_DJI }
                OR = {
                    date > 1977.05.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = DJI }
                controls_state = 268
            }
            set_country_flag = {
                flag = ET_flag_country_free_DJI
                days = 90
            }
            country_event = {
                id = ET_Independence_Djibouti.0
                days = 27
            }
        }
        if = { # Egypt          [18 June 1953] ENG* "Suez Emergency & Egyptian Revolution of 1952"
            limit = {
                NOT = { has_country_flag = ET_flag_country_free_EGY }
                NOT = { has_global_flag = ET_flag_global_free_EGY }
                OR = {
                    date > 1953.05.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Egypt
                }
                # We want to trigger event if it exist for Eqypt
                #NOT = { original_tag = EGY }
                OR = {
                    controls_state = 446
                    controls_state = 447
                    controls_state = 452
                    controls_state = 453
                    controls_state = 456
                    controls_state = 457
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_EGY
                days = 90
            }
            country_event = {
                id = ET_Independence_Egypt.0
                days = 18
            }
        }
        if = { # Equatorial Guinea [12 October 1968] SPA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_EQG }
                OR = {
                    date > 1968.09.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = EQG }
                controls_state = 297
            }
            set_country_flag = {
                flag = ET_flag_country_free_EQG
                days = 90
            }
            country_event = {
                id = ET_Independence_EquatorialGuinea.0
                days = 12
            }
        }
        if = { # Eritrea        [27 April 1993]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_ERI }
                OR = {
                    date > 1993.03.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = ERI }
                controls_state = 538
            }
            set_country_flag = {
                flag = ET_flag_country_free_ERI
                days = 90
            }
            country_event = {
                id = ET_Independence_Eritrea.0
                days = 27
            }
        }
        #if = { # Eswatini       [6 September 1968] ENG # TODO Make nation Eswatini
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_ESW }
        #        OR = {
        #            date > 1968.08.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = ESW }
        #        controls_state = XXX
        #    }
        #    set_global_flag = ET_flag_country_free_ESW
        #    country_event = {
        #        id = ET_Independence_Eswatini.0
        #        days = 6
        #    }
        #}
        if = { # Ethiopia       [21 August 1995]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_ETH }
                OR = {
                    date > 1995.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = ETH }
                controls_state = 271
            }
            set_country_flag = {
                flag = ET_flag_country_free_ETH
                days = 90
            }
            country_event = {
                id = ET_Independence_Ethiopia.0
                days = 21
            }
        }
        if = { # Gabon          [17 August 1960] FRA
             limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_GAB }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = GAB }
                controls_state = 539
            }
            set_country_flag = {
                flag = ET_flag_country_free_GAB
                days = 90
            }
            country_event = {
                id = ET_Independence_Gabon.0
                days = 17
            }
        }
        if = { # Gambia         [18 February 1965] ENG
             limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_GAM }
                OR = {
                    date > 1965.01.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = GAM }
                controls_state = 701
            }
            set_country_flag = {
                flag = ET_flag_country_free_GAM
                days = 90
            }
            country_event = {
                id = ET_Independence_Gambia.0
                days = 18
            }
        }
        if = { # Ghana          [6 March 1957] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_GHA }
                OR = {
                    date > 1957.02.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = GHA }
                controls_state = 274
            }
            set_country_flag = {
                flag = ET_flag_country_free_GHA
                days = 90
            }
            country_event = {
                id = ET_Independence_Ghana.0
                days = 18
            }
        }
        if = { # Guinea         [2 October 1958] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_GNA }
                OR = {
                    date > 1958.09.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = GNA }
                controls_state = 780
            }
            set_country_flag = {
                flag = ET_flag_country_free_GNA
                days = 90
            }
            country_event = {
                id = ET_Independence_Guinea.0
                days = 2
            }
        }
        if = { # Guinea-Bissau  [24 September 1973] POR*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_GNB }
                OR = {
                    date > 1973.08.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = GNB }
                controls_state = 296
            }
            set_country_flag = {
                flag = ET_flag_country_free_GNB
                days = 90
            }
            country_event = {
                id = ET_Independence_GuineaBissau.0
                days = 24
            }
        }
        if = { # Ivory Coast    [4 December 1958] > French Community > [26 June 1960]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_IVO }
                OR = {
                    date > 1973.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = IVO }
                controls_state = 296
            }
            set_country_flag = {
                flag = ET_flag_country_free_IVO
                days = 90
            }
            country_event = {
                id = ET_Independence_IvoryCoast.0
                days = 4
            }
        }
        if = { # Kenya          [12 December 1963] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_KEN }
                OR = {
                    date > 1963.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = KEN }
                controls_state = 547
            }
            set_country_flag = {
                flag = ET_flag_country_free_KEN
                days = 90
            }
            country_event = {
                id = ET_Independence_Kenya.0
                days = 12
            }
        }
        #if = { # Lesotho        [4 October 1966] ENG* # TODO Make nation Lesotho
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_LES }
        #        OR = {
        #            date > 1966.09.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = LES }
        #        controls_state = XXX
        #    }
        #    set_global_flag = ET_flag_country_free_LES
        #    country_event = {
        #        id = ET_Independence_Lesotho.0
        #        days = 4
        #    }
        #}
        if = { # Libya          [24 December 1951] FRA ENG (ITA)*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_LBA }
                OR = {
                    date > 1951.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = LBA }
                OR = {
                    controls_state = 448
                    controls_state = 661
                    controls_state = 449
                    controls_state = 662
                    controls_state = 450
                    controls_state = 451
                    controls_state = 663
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_LBA
                days = 90
            }
            country_event = {
                id = ET_Independence_Libya.0
                days = 24
            }
        }
        if = { # Madagascar     [14 October 1958] > French Community > [26 June 1960]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MAD }
                OR = {
                    date > 1951.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MAD }
                controls_state = 543
            }
            set_country_flag = {
                flag = ET_flag_country_free_MAD
                days = 90
            }
            country_event = {
                id = ET_Independence_Madagascar.0
                days = 14
            }
        }
        if = { # Malawi         [6 July 1964] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MLW }
                OR = {
                    date > 1964.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MLW }
                controls_state = 770
            }
            set_country_flag = {
                flag = ET_flag_country_free_MLW
                days = 90
            }
            country_event = {
                id = ET_Independence_Malawi.0
                days = 6
            }
        }
        if = { # Mali           [25 November 1958] FRA > puppet > [22 September 1960]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MLI }
                OR = {
                    date > 1958.10.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MLI }
                controls_state = 770
            }
            set_country_flag = {
                flag = ET_flag_country_free_MLI
                days = 90
            }
            country_event = {
                id = ET_Independence_Mali.0
                days = 25
            }
        }
        if = { # Mauritania     [28 November 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MTR }
                OR = {
                    date > 1960.10.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MRT }
                controls_state = 699
            }
            set_country_flag = {
                flag = ET_flag_country_free_MRT
                days = 90
            }
            country_event = {
                id = ET_Independence_Mauritania.0
                days = 28
            }
        }
        #if = { # Mauritius      [12 March 1968] ENG # TODO Make nation Mauritius
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_MAU }
        #        OR = {
        #            date > 1968.02.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = MAU }
        #        controls_state = 707
        #    }
        #    set_global_flag = ET_flag_country_free_MAU
        #    country_event = {
        #        id = ET_Independence_Mauritius.0
        #        days = 12
        #    }
        #}
        if = { # Morocco        [18 November 1955] SPA*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MOR }
                OR = {
                    date > 1955.10.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MOR }
                OR = {
                    controls_state = 290
                    controls_state = 461
                    controls_state = 462
                    controls_state = 783
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_MOR
                days = 90
            }
            country_event = {
                id = ET_Independence_Morocco.0
                days = 18
            }
        }
        if = { # Mozambique     [25 June 1975] POR
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_MZB }
                OR = {
                    date > 1975.05.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = MZB }
                controls_state = 544
            }
            set_country_flag = {
                flag = ET_flag_country_free_MZB
                days = 90
            }
            country_event = {
                id = ET_Independence_Mozambique.0
                days = 25
            }
        }
        if = { # Namibia        [21 March 1990] South African
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_NMB }
                OR = {
                    date > 1990.02.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = NMB }
                controls_state = 541
            }
            set_country_flag = {
                flag = ET_flag_country_free_NMB
                days = 90
            }
            country_event = {
                id = ET_Independence_Namibia.0
                days = 21
            }
        }
        if = { # Niger          [4 December 1958] FRA > French Community > [3 August 1960]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_NGR }
                OR = {
                    date > 1958.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = NGR }
                controls_state = 515
            }
            set_country_flag = {
                flag = ET_flag_country_free_NGR
                days = 90
            }
            country_event = {
                id = ET_Independence_Niger.0
                days = 4
            }
        }
        if = { # Nigeria        [3 August 1960] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_NGA }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = NGR }
                controls_state = 515
            }
            set_country_flag = {
                flag = ET_flag_country_free_NGA
                days = 90
            }
            country_event = {
                id = ET_Independence_Nigeria.0
                days = 3
            }
        }
        if = { # Congo          [15 August 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_COG }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = COG }
                controls_state = 515
            }
            set_country_flag = {
                flag = ET_flag_country_free_COG
                days = 90
            }
            country_event = {
                id = ET_Independence_Congo.0
                days = 15
            }
        }
        if = { # Rwanda         [1 July 1962] BEL
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_RWA }
                OR = {
                    date > 1962.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = RWA }
                controls_state = 515
            }
            set_country_flag = {
                flag = ET_flag_country_free_RWA
                days = 90
            }
            country_event = {
                id = ET_Independence_Rwanda.0
                days = 1
            }
        }
        #if = { # São Tomé and Príncipe [12 July 1975] POR # TODO Make nation São Tomé and Príncipe
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_STP }
        #        OR = {
        #            date > 1975.06.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = STP }
        #        controls_state = 705
        #    }
        #    set_global_flag = ET_flag_country_free_STP
        #    country_event = {
        #        id = ET_Independence_SaoTomePrincipe.0
        #        days = 1
        #    }
        #}
        if = { # Senegal        [20 August 1960] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_SEN }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = SEN }
                controls_state = 272
            }
            set_country_flag = {
                flag = ET_flag_country_free_SEN
                days = 90
            }
            country_event = {
                id = ET_Independence_Senegal.0
                days = 20
            }
        }
        #if = { # Seychelles     [29 June 1976] ENG # TODO Make nation Seychelles
        #    limit = {
        #        is_ai = yes
        #        NOT = { has_country_flag = ET_flag_country_free_SEY }
        #        OR = {
        #            date > 1960.05.01
        #            has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
        #        }
        #        NOT = { original_tag = SEY }
        #        controls_state = 709
        #    }
        #    set_global_flag = ET_flag_country_free_SEY
        #    country_event = {
        #        id = ET_Independence_Seychelles.0
        #        days = 29
        #    }
        #}
        if = { # Sierra Leone   [27 April 1961] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_SIE }
                OR = {
                    date > 1960.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = SIE }
                controls_state = 515
            }
            set_country_flag = {
                flag = ET_flag_country_free_SIE
                days = 90
            }
            country_event = {
                id = ET_Independence_SierraLeone.0
                days = 27
            }
        }
        if = { # Somalia        [1 July 1960] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_SOM }
                OR = {
                    date > 1960.06.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = SOM }
                OR = {
                    controls_state = 269
                    controls_state = 559
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_SOM
                days = 90
            }
            country_event = {
                id = ET_Independence_Somalia.0
                days = 1
            }
        }
        if = { # Sudan          [1 January 1956] EGY,ENG*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_SUD }
                OR = {
                    date > 1955.12.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = SUD }
                OR = {
                    controls_state = 767
                    controls_state = 551
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_SUD
                days = 90
            }
            country_event = {
                id = ET_Independence_Sudan.0
                days = 1
            }
        }
        if = { # Tanzania       [9 December 1961] ENG Tanganyika*
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_TZN }
                OR = {
                    date > 1960.12.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = TZN }
                controls_state = 546
            }
            set_country_flag = {
                flag = ET_flag_country_free_TZN
                days = 90
            }
            country_event = {
                id = ET_Independence_Tanzania.0
                days = 9
            }
        }
        if = { # Togo           [30 August 1958] > French Union > [27 April 1960]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_TOG }
                OR = {
                    date > 1958.07.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = TOG }
                controls_state = 777
            }
            set_country_flag = {
                flag = ET_flag_country_free_TOG
                days = 90
            }
            country_event = {
                id = ET_Independence_Togo.0
                days = 30
            }
        }
        if = { # Tunisia        [20 March 1956] FRA
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_TUN }
                OR = {
                    date > 1956.02.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = TUN }
                OR = {
                    controls_state = 458
                    controls_state = 665
                }
            }
            set_country_flag = {
                flag = ET_flag_country_free_TUN
                days = 90
            }
            country_event = {
                id = ET_Independence_Tunisia.0
                days = 20
            }
        }
        if = { # Uganda         [1 March 1962] ENG > Puppet > [9 October 1962]
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_UGA }
                OR = {
                    date > 1962.02.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = UGA }
                controls_state = 548
            }
            set_country_flag = {
                flag = ET_flag_country_free_UGA
                days = 90
            }
            country_event = {
                id = ET_Independence_Uganda.0
                days = 1
            }
        }
        if = { # Zambia         [24 October 1964] ENG
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_ZAM }
                OR = {
                    date > 1962.02.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = ZAM }
                controls_state = 771
            }
            set_country_flag = {
                flag = ET_flag_country_free_ZAM
                days = 90
            }
            country_event = {
                id = ET_Independence_Zambia.0
                days = 1
            }
        }

        # #
        #  Asia
        # #

        if = { # Vietnam        [19 December 1959] FRA* "First Indochina War"
            # https://en.wikipedia.org/wiki/First_Indochina_War
            limit = {
                is_ai = yes
                NOT = { has_country_flag = ET_flag_country_free_VIN }
                OR = {
                    date > 1959.11.01
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                    has_global_flag = ET_DEBUG_Trigger_FirstIndochinaWar
                }
                NOT = { original_tag = VIN }
                OR = {
                    controls_state = 671
                    controls_state = 286
                }
            }
            ET_init_countrys_firstIndochinaWar = yes

            set_country_flag = {
                flag = ET_flag_country_free_VIN
                days = 90
            }
            country_event = {
                id = ET_Independence_Vietnam.0
                days = 19
            }
        }

        if = { # North Korea    [2 September 1945] SOV*
            # https://en.wikipedia.org/wiki/Korea
            limit = {
                at_war = no
                
                NOT = { has_country_flag = ET_flag_country_free_DPR }
                NOT = { has_global_flag = ET_flag_global_free_DPR }

                OR = {
                    date > 1945.8.02
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = DPR }
                controls_state = 527
            }

            set_country_flag = {
                flag = ET_flag_country_free_DPR
                days = 90
            }
            country_event = {
                id = ET_Independence_NorthKorea.0
                days = 19
            }
        }
        if = { # South Korea    [2 September 1945] USA*
            # https://en.wikipedia.org/wiki/Korea
            limit = {
                at_war = no

                NOT = { has_country_flag = ET_flag_country_free_KOR }
                NOT = { has_global_flag = ET_flag_global_free_KOR }

                OR = {
                    date > 1945.8.02
                    has_global_flag = ET_Flag_Global_DEBUG_Decolonization_Ignore_Dates
                }
                NOT = { original_tag = KOR }
                controls_state = 525
            }

            set_country_flag = {
                flag = ET_flag_country_free_KOR
                days = 90
            }
            country_event = {
                id = ET_Independence_SouthKorea.0
                days = 19
            }
        }
    }

    option = {}
}
