on_actions = {
	on_declare_war = {
		effect = {
			if = {
				limit = {
					ROOT = { TNO_is_anarchy_visible = no }
					FROM = { TNO_is_anarchy_visible = no }
				}
				if = {
					limit = {
						ROOT = { tag = BGR }
						FROM = { tag = GGR }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = GER }
						set_temp_variable = { defender = GER }
                        set_temp_variable = { diplomatic_alert_text_Y = -10 }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { tag = GRO }
						FROM = { tag = SAF }
					}
					XXX = { set_cosmetic_tag = XXX_afrika_schild }
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = XXX }
						set_temp_variable = { defender = SAF }
                        set_temp_variable = { diplomatic_alert_text_Y = -5 }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { is_first_colombian_cw_nation = yes }
						FROM = { is_first_colombian_cw_nation = yes }
                        NOT = { has_global_flag = ccw_fired }
					}
                    set_global_flag = ccw_fired
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = COL }
						set_temp_variable = { defender = COL }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { original_tag = AZD }
						FROM = { original_tag = CFS }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = GRO }
						set_temp_variable = { defender = CFS }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { original_tag = IRL }
						FROM = { original_tag = PER }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = IRL }
						set_temp_variable = { defender = PER }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { original_tag = INS }
						FROM = { original_tag = FRI }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = INS }
						set_temp_variable = { defender = FRI }
                        set_temp_variable = { diplomatic_alert_text_Y = -10 }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						ROOT = { tag = BOR }
						FROM = { tag = SAF }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = ROOT }
						set_temp_variable = { defender = FROM }
						set_temp_variable = { diplomatic_alert_text_Y = -10 }
						shoot_diplomatic_alert_window = yes
					}
				}
				if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = { is_iberian_country = yes }
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_blau_executed }
						}
						set_global_flag = fall_blau_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = FROM }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = { is_russian_nation = yes }
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_rot_executed }
						}
						set_global_flag = fall_rot_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = FROM }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = { is_after_midninght_russian_nation = yes }
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_rot_executed }
						}
						set_global_flag = fall_rot_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = FROM }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = { is_after_midninght_russian_nation = yes }
						NOT = { has_global_flag = fall_rot_executed }
					}
					set_global_flag = fall_rot_executed
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = ROOT }
						set_temp_variable = { defender = FROM }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = { # Second South African War
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = {
							tag = SAF
						}
						NOT = {
							has_global_flag = second_south_african_civil_war
						}
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = ROOT }
						set_temp_variable = { defender = FROM }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = {
							is_african_nation = yes
						}
						FROM = {
							if = {
								limit = {
									tag = SAF
								}
								has_global_flag = second_south_african_civil_war
							}
						}
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_vorbeck_executed }
						}
						set_global_flag = fall_vorbeck_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = FROM }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = {
							OR = {
								is_in_faction_with = JAP
								is_subject_of = JAP
								tag = JAP
							}
						}
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_dammerung_executed }
						}
						set_global_flag = fall_dammerung_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = JAP }
							set_temp_variable = { diplomatic_alert_text_Y = -11 }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = {
							OR = {
								is_in_faction_with = USA
								is_subject_of = USA
								tag = USA
							}
						}
					}
					if = {
						limit = {
							NOT = { has_global_flag = fall_rockwell_executed }
						}
						set_global_flag = fall_rockwell_executed
						every_country = {
							limit = {
								is_ai = no
								NOT = { has_country_flag = diplomatic_alerts_disabled }
							}
							set_temp_variable = { attacker = ROOT }
							set_temp_variable = { defender = USA }
							set_temp_variable = { diplomatic_alert_text_Y = -13 }
							shoot_diplomatic_alert_window = yes
						}
					}
				}
				else_if = {
					limit = {
						has_global_flag = german_civil_war_goeringvic
						ROOT = { tag = GER }
						FROM = { tag = BRG }
					}
					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = ROOT }
						set_temp_variable = { defender = FROM }
						set_temp_variable = { diplomatic_alert_text_Y = -11 }
						shoot_diplomatic_alert_window = yes
					}
				}
				else_if = { ## DEFAULT, THOSE IN LIMIT ARE DISABLED ##
					limit = {
                        NOT = {
                            is_in_array = { global.INS_soekarnoite_faction = ROOT }
                        }
                        NOT = {
                            is_in_array = { global.PER_contenders = ROOT }
                            is_in_array = { global.PER_contenders = FROM }
                        }
                        NOT = {
                            ROOT = { is_congolese_cw_nation = yes }
                            FROM = { is_congolese_cw_nation = yes }
                        }
                        NOT = {
                            ROOT = { is_first_colombian_cw_nation = yes }
                            FROM = { is_first_colombian_cw_nation = yes }
                        }
						NOT = {
                            ROOT = { is_german_civil_war_nation = yes }
							FROM = { is_german_civil_war_nation = yes }
						}
						if = {
							limit = {
								NOT = {
									any_country = {
										is_moskowien_splits = yes
										is_ai = no
									}
								}
							}
							NOT = {
								ROOT = { is_moskowien_splits = yes }
								FROM = { is_moskowien_splits = yes }
							}
						}
					}

					every_country = {
						limit = {
							is_ai = no
							NOT = { has_country_flag = diplomatic_alerts_disabled }
						}
						set_temp_variable = { attacker = ROOT }
						set_temp_variable = { defender = FROM }
						shoot_diplomatic_alert_window = yes
					}
				}
			}
		}
	}

	## ROOT - the one calling
	## FROM - the one accepting the call
	on_call_allies = {
		effect = {
			every_country = {
				limit = {
					OR = {
						has_war_together_with = ROOT
						tag = ROOT
					}
					is_ai = no
					NOT = { has_country_flag = diplomatic_alerts_disabled }
				}
				set_temp_variable = { attacker = ROOT }
				set_temp_variable = { defender = FROM }
				shoot_diplomatic_alert_window = yes
			}

			every_enemy_country = {
				limit = {
					is_ai = no
					NOT = { has_country_flag = diplomatic_alerts_disabled }
				}
				set_temp_variable = { attacker = ROOT }
				set_temp_variable = { defender = FROM }
				shoot_diplomatic_alert_window = yes
			}
		}
	}


	## ROOT - the one asking to join
	## FROM - the one accepting the ask
	on_join_allies = {
		effect = {
			every_country = {
				limit = {
					OR = {
						has_war_together_with = FROM
						tag = FROM
						tag = ROOT
					}
					is_ai = no
					NOT = { has_country_flag = diplomatic_alerts_disabled }
				}
				set_temp_variable = { attacker = FROM }
				set_temp_variable = { defender = ROOT }
				shoot_diplomatic_alert_window = yes
			}

			every_enemy_country = {
				limit = {
					is_ai = no
					NOT = { has_country_flag = diplomatic_alerts_disabled }
				}
				set_temp_variable = { attacker = FROM }
				set_temp_variable = { defender = ROOT }
				shoot_diplomatic_alert_window = yes
			}
		}
	}
}