dvg_noongar_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:NNG
		root = {
			has_state_in_state_region = STATE_NOONGAR
		}
		NOT = {
			root = c:NNG
		}
	}

    possible = {
		year >= 1845
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.3 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_pitjantjajara_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:PJT
		root = {
			has_state_in_state_region = STATE_COOMALONG
			has_state_in_state_region = STATE_NOONGAR
		}
		NOT = {
			exists = c:NNG
			exists = c:YMT
			root = c:PJT
		}
	}

    possible = {
		year >= 1850
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.4 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_yolngu_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:YLN
		root = {
			has_state_in_state_region = STATE_YOLNGU
		}
		NOT = {
			root = c:YLN
		}
	}

    possible = {
		year >= 1850
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.5 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_nunga_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:NUN
		root = {
			has_state_in_state_region = STATE_PITJANTJAJARA
		}
		NOT = {
			root = c:NUN
		}
	}

    possible = {
		year >= 1855
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.6 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_yamatji_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:YMT
		root = {
			has_state_in_state_region = STATE_COOMALONG
		}
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
	}

    possible = {
		year >= 1845
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.7 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_kauri_colony = {
	is_shown = {
		has_game_rule = australia_railroaded
		exists = c:KAU
		OR = {
			AND = {
				NOT = {
					country_has_primary_culture = cu:aborigine
					exists = c:ZHR
				}
				root = {
					has_state_in_state_region = STATE_YONGJIA
				}
			}
			AND = {
				OR = {
					AND = {
						has_variable = dvg_yongjia_given
						NOT = {
							exists = c:SCA
						}
					}
					NOT = {
						has_variable = dvg_yongjia_given
					}
				}
				exists = c:ZHR
				root = c:ZHR
			}
			AND = {
				has_variable = dvg_yongjia
			}
		}
	}

    possible = {
		year >= 1858
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.8 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_embrace_the_koori = {
	is_shown = {
		has_variable = dvg_yaluo_open_lists
		has_variable = dvg_yaluo_tribute_force
	}

    possible = {
		has_variable = dvg_yaluo_open_lists
		has_variable = dvg_yaluo_tribute_force
	}

    when_taken = {
		remove_variable = dvg_yaluo_open_lists
		remove_variable = dvg_yaluo_tribute_force
		add_primary_culture = cu:aborigine
    }

	ai_chance = {
		base = 100
	}
}

dvg_yaluo_ask_scandinavia_for_help = {
	is_shown = {
		has_variable = dvg_yaluo_open_to_scandinavia
	}

    possible = {
		has_variable = dvg_yaluo_open_to_scandinavia
		year >= 1855
	}

    when_taken = {
		c:SCA = {
			trigger_event = { id = dvg_carlshavn.2 popup = yes }
		}
    }

	ai_chance = {
		base = 100
	}
}

dvg_integrate_the_guli = {
	is_shown = {
		exists = c:KOO
		OR = {
			AND = {
				exists = c:YLO
				root = c:YLO
			}
			AND = {
				exists = c:ZHR
				root = c:ZHR
			}
		}
	}

    possible = {
		year >= 1850
		NOT = { 
			has_variable = dvg_asked_guli
		}
	}

    when_taken = {
		custom_tooltip = {
			text = dvg_koori_colony_tt
			c:KOO = {
				trigger_event = { id = dvg_zhourao.9 }
			}
		}
		hidden_effect = {
			set_variable = dvg_asked_guli
		}
    }

	ai_chance = {
		base = 100
	}
}

dvg_push_southwards = {
	is_shown = {
		exists = c:YAL
		NOT = {
			country_has_primary_culture = cu:aborigine
		}
		root = {
			has_state_in_state_region = STATE_WENCHENG
		}
		NOT = {
			has_variable = dvg_southern_push_variable
		}
	}

    possible = {
		year >= 1850
	}

    when_taken = {
		trigger_event = { id = dvg_zhourao.701 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_wiradjuri_war = {
	is_shown = {
		exists = c:WIR
		root = {
			has_state_in_state_region = STATE_ZHENG_HE
		}
		NOT = {
			has_variable = dvg_wiradjuri_war_variable
		}
	}

    possible = {
		year >= 1850
	}

    when_taken = {
		trigger_event = { id = dvg_zhourao.501 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_new_zealand = {
	is_shown = {
		exists = c:BRG
		root = c:BRG
		root = {
			has_state_in_state_region = STATE_NOONGAR
			has_state_in_state_region = STATE_COOMALONG
			has_state_in_state_region = STATE_PITJANTJAJARA
			has_state_in_state_region = STATE_OODNATTA
		}
	}

    possible = {
		year >= 1870
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.1 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_new_zealand_integrations = {
	is_shown = {
		exists = c:BRG
		exists = c:NVZ
		root = c:BRG
		root = {
			OR = {
				has_state_in_state_region = STATE_NOONGAR
				has_state_in_state_region = STATE_COOMALONG
				has_state_in_state_region = STATE_PITJANTJAJARA
				has_state_in_state_region = STATE_OODNATTA
				has_state_in_state_region = STATE_YONGJIA
				has_state_in_state_region = STATE_YOLNGU
				has_state_in_state_region = STATE_YONGLING
				has_state_in_state_region = STATE_QINGSHUI
				has_state_in_state_region = STATE_GUANSHAN
				has_state_in_state_region = STATE_XINXIANG
				has_state_in_state_region = STATE_ZHENG_HE
				has_state_in_state_region = STATE_WEIHUAI
				has_state_in_state_region = STATE_TAITUNG
				has_state_in_state_region = STATE_WEIZHOU
				has_state_in_state_region = STATE_JINZHOU
				has_state_in_state_region = STATE_WENCHENG
				has_state_in_state_region = STATE_PARLEVAR
			}
		}
		OR = {
			AND = {
				exists = c:BRG
				c:BRG = {
					has_diplomatic_pact = {
						who = c:NVZ
						type = puppet
						is_initiator = yes
					}
				}
			}
			AND = {
				exists = c:BRG
				c:BRG = {
					has_diplomatic_pact = {
						who = c:NVZ
						type = dominion
						is_initiator = yes
					}
				}
			}
		}
	}

    possible = {
		year >= 1860
	}

    when_taken = {
		trigger_event = { id = dvg_oceania.9 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_propose_to_yaluo = {
	is_shown = {
		exists = c:SCA
		exists = c:YLO
		root = c:SCA
		NOT = {
			has_variable = dvg_scandi_proposed
		}
	}

    possible = {
		year >= 1854
	}

    when_taken = {
		c:YLO = {
			trigger_event = { id = dvg_zhourao.4 popup = yes }
		}
		hidden_effect = {
			set_variable = dvg_scandi_proposed
		}
    }

	ai_chance = {
		base = 100
	}
}

dvg_stay_catholic = {
	is_shown = {
		exists = c:ZHR
		root = c:ZHR
		rel:catholic = {
			is_state_religion = c:ZHR
		}
		NOT = {
			has_variable = dvg_catholiced_mjn
		}
	}

    possible = {
		rel:catholic = {
			is_state_religion = c:ZHR
		}
	}

    when_taken = {
		trigger_event = { id = dvg_zhourao.502 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_declare_war_on_yaluo = {
	is_shown = {
		exists = c:MJN
		exists = c:YLO
		root = c:MJN
		OR = {
			NOT = {
				c:YLO = {
					is_player = yes
				}
			}
			AND = {
				c:MJN = {
					is_player = yes
				}
				c:YLO = {
					is_player = yes
				}
			}
			AND = {
				c:MJN = {
					is_player = no
				}
				c:YLO = {
					is_player = no
				}
			}
		}
		NOT = {
			has_variable = dvg_second_kongsi_war_decision_variable
		}
	}

    possible = {
		year >= 1855
	}

    when_taken = {
		hidden_effect = {
			set_variable = dvg_second_kongsi_war_decision_variable
		}
		trigger_event = { id = dvg_zhourao.12 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}

dvg_declare_war_on_mianjin = {
	is_shown = {
		exists = c:YLO
		exists = c:MJN
		root = c:YLO
		OR = {
			NOT = {
				c:MJN = {
					is_player = yes
				}
			}
			AND = {
				c:MJN = {
					is_player = yes
				}
				c:YLO = {
					is_player = yes
				}
			}
		}
		NOT = {
			has_variable = dvg_second_kongsi_war_decision_variable
		}
	}

    possible = {
		year >= 1855
	}

    when_taken = {
		hidden_effect = {
			set_variable = dvg_second_kongsi_war_decision_variable
		}
		trigger_event = { id = dvg_zhourao.13 popup = yes }
    }

	ai_chance = {
		base = 100
	}
}
