###_MOD trigger placeholder	######################################################################


#	WSG物种*/UGRC组装物种*			|wsg	/莉莉/swg/kc/DAL|
#	V有机物中
#	V物种改造*	---过时
#	V可繁殖

#	EMB	=Expanded Traits, Civics, Pops, and More




###_[WSG物种]	####################################################################	---禁用
UGRC_trgr_spcs_WSG = {
	OR = {
		is_archetype = WARSHIPGIRL
		is_archetype = SHENHAI
		is_archetype = UNITED_FLEET
		is_archetype = NANITES_CROP
	}
}
###_[UGRC组装物种]	---禁用
UGRC_trgr_spcs_ASSEMBLY = {
	OR = {
		is_archetype = LILY						# 莉莉
		is_archetype = STARSHIPGIRLS			# swg
		is_archetype = KANMUSU					# kc
		is_archetype = DATEALIVE				# DAL
	}
}




###	V有机物种	############################################################	同步追踪|V/wsg	scripted_triggers	|is_organic_species|
#	sg/swg/kc/adf/pkman/EMB/带刺/azl/涅托/DAL/碧蓝档案/魔女	/SC/EE
##_scopes	<pop/spcs>
##	牵扯[物种组装]无法通过给flg解决
is_organic_species = {
	species = {
		OR = {
			is_archetype = BIOLOGICAL
			is_archetype = LITHOID

			is_archetype = LILY						# 莉莉
			is_archetype = STARSHIPGIRLS			# swg
			is_archetype = KANMUSU					# kc
			is_archetype = DATEALIVE				# DAL

			is_archetype = KANSEN					#_|azl|
			is_archetype = Dolls					# adf
			is_archetype = POKEMON					#_[pkman]	[伊布帝国v1.22]=2398450274
			is_archetype = NYTO						#_|涅托|
			is_KZ_VOY_organic_species = yes
		#	is_archetype = ASCENDED					#_|EE|
			is_archetype = Schale					#_|碧蓝档案|
			is_archetype = ELF						#_|带刺|
			is_archetype = Magical_Bitch
			is_archetype = Magical_Girl
			is_archetype = WV_OBJECT				#_|魔女|
		}
	}	
}




###_[V物种改造]	####################################################################
#_MOD	+wsg
#	can_remove_beneficial_traits = {
#		hidden_trigger = { exists = from }
#		from = {
#			OR = {
#				has_technology = tech_genetic_resequencing
#				#	|mod|
#				has_wsg_genemodding_tech = yes	# wsg
#			}
#		}
#	}



###	V可繁殖	############################################################	同步追踪|全部	scripted_triggers	|species_can_grow_on_colony/citizenship_allows_species_growth/can_necrophage_species_grow|
species_can_grow_on_colony = {
	###	|简单条件|	##############################	仅涉及species自身, 统一检测
	species = { NOT = { has_species_flag = UGRC_flg_spcs_RULE_procreate_DISABLE } }	# |UGRC标签|
	#is_sapient = yes
	#species = {
	#	is_robotic = no
	#	NOT = {
	#		has_species_flag = nivlac_no_procreation
	#	}
	#}


	###	|MOD条件|	##############################	EMB/wv/cglbu
	##	EMB
	if = { limit = { has_global_flag = expanded_pops_active }
		NOR = {
			AND = {
				has_global_flag = expanded_events_active
				is_exp_memorex_comatos = yes
			}
			AND = {
				has_global_flag = expanded_megastructures_installed
				is_exp_clone = yes
				$COLONY$ = {
					owner = {
						OR = {
							has_country_flag = clone_infertility_5
							AND = {
								NOT = { has_origin = origin_clones }
								years_passed > 200
							}
						}
					}
				}
			}
		}
		if = {
			limit = {
				is_exp_tree_caretaker = yes
			}
			$COLONY$ = {
				OR = {
					has_deposit = d_tree_of_life_colony
					has_deposit = d_tree_of_life_home
				}
			}
		}
		if = {
			limit = {
				has_cybernetic_creed_trait = yes
			}
			NOT = {
				$COLONY$ = {
					any_owned_species = {
						has_population_control = { country = $COLONY$.owner type = no }
						is_robotic_species = no
						has_cybernetic_creed_trait = no
					}
				}
			}
		}
	}
	##	wv
	if = { limit = { species = { has_species_flag = UGRC_flg_spcs_RULE_wv } }	#_|UGRC标签|
		if = { limit = { has_trait = trait_reanimated_materials }
			OR = {
				is_mage = yes
				$COLONY$.owner = {
					has_country_flag = syn_witch
				}
				$COLONY$ = {
					NOR = { # make sure elaina always grow first
						has_building = building_possibility_portal
						has_building = building_dimensional_instrument
						has_deposit = d_mysterious_portal
					}
				}
				$COLONY$ = {
					num_assigned_jobs = {
						job = matter_reanimator
						value > 0
					}
					NOR = { # make sure elaina always grow first
						has_building = building_possibility_portal
						has_building = building_dimensional_instrument
						has_deposit = d_mysterious_portal
					}
				}
			}
		}
		if = { limit = { has_trait = trait_houki }
			$COLONY$.owner = {
				has_country_flag = newbirth_houki
				NOT = { has_country_flag = max_houki_number_reached }
			}
		}
		if = {
			limit = { 
				OR = {
					has_trait = trait_witch
					has_trait = trait_victorika
					has_trait = trait_elaina_descendant
				}
			}
			OR = {
				$COLONY$.owner = {
					has_ascension_perk = ap_xeno_compatibility
				}
				$COLONY$ = {
					OR = {
						has_building = building_possibility_portal
						has_building = building_dimensional_instrument
						has_deposit = d_mysterious_portal
					}
				}
			}
		}
	}
	##	cglbu
	if = { limit = { has_trait = trait_DC_ethic_parasite_mind }
		OR = {
			$COLONY$.owner = { has_country_flag = has_ten_crisis_perk_1 }
			has_trait = trait_ten_zoogony
		}
	}


	###	|V额额外条件|	##############################	
	##	V公民权
	#citizenship_allows_species_growth = {
	#	COLONY = $COLONY$
	#}
	NAND = {
		$COLONY$ = {
			has_modifier = slave_colony
		}
		NOT = {
			has_citizenship_type = {
				type = citizenship_slavery
				country = $COLONY$.owner
			}
		}
	}
	NOR = {
		has_citizenship_type = {
			type = citizenship_protected_drone
			country = $COLONY$.owner
		}
		has_citizenship_type = {
			type = citizenship_symbiotic_drone
			country = $COLONY$.owner
		}
		has_citizenship_type = {
			type = citizenship_exploited_drone
			country = $COLONY$.owner
		}
	}
	##	V死灵
	#can_necrophage_species_grow = {
	#	COLONY = $COLONY$
	#}
	if = {
		limit = {
			has_trait = trait_necrophage
		}
		NOT = {
			$COLONY$ = {
				OR = {
					has_active_building = building_necrophage_elevation_chamber
					has_active_building = building_necrophage_house_of_apotheosis
				}
			}
		}
	}
}
citizenship_allows_species_growth = {
	NAND = {
		$COLONY$ = {
			has_modifier = slave_colony
		}
		NOT = {
			has_citizenship_type = {
				type = citizenship_slavery
				country = $COLONY$.owner
			}
		}
	}
	NOR = {
		has_citizenship_type = {
			type = citizenship_protected_drone
			country = $COLONY$.owner
		}
		has_citizenship_type = {
			type = citizenship_symbiotic_drone
			country = $COLONY$.owner
		}
		has_citizenship_type = {
			type = citizenship_exploited_drone
			country = $COLONY$.owner
		}
	}
}
can_necrophage_species_grow = {
	if = {
		limit = {
			has_trait = trait_necrophage
		}
		NOT = {
			$COLONY$ = {
				OR = {
					has_active_building = building_necrophage_elevation_chamber
					has_active_building = building_necrophage_house_of_apotheosis
				}
			}
		}
	}
}