#ϣ۹modרtriggers


#Ƿг
#scope:country
allow_harmonize = {
		OR = {
				has_valid_civic = civic_harmonious
				has_valid_civic = civic_harmonious_tree
				has_modifier = m_kala_gift
		} 
}
#ܹг
#scope:country
can_harmonize ={
		OR = {
				#гȺһ԰ͳ
				AND = {
					has_valid_civic = civic_harmonious 
					has_swapped_tradition = tr_ideal_homeland
				}
				#ǷȺӵкг
				has_valid_civic = civic_harmonious_tree 
				#ӵпĹ
				has_modifier = m_kala_gift
		}
}

#Ƿг(ͻhive˿ڳ1/3,кг)
#scope:Planet
can_harmonize_planet = {
		OR = {
				has_building = building_life_tree	
				has_building = building_mother_life_tree  
				has_building = building_hive_synapse
		}
		harmonize_hive_is_enough =  yes	
}
#кгķȺǷ㹻
#scope:planet
harmonize_hive_is_enough = {
		OR = {
				AND = {
						planet_size < 6
						count_owned_pops = {
								count > 0
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 5
						planet_size < 9
						count_owned_pops = {
								count > 1
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 8
						planet_size < 12
						count_owned_pops = {
								count > 2
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 11
						planet_size < 15
						count_owned_pops = {
								count > 3
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 14
						planet_size < 18
						count_owned_pops = {
								count > 4
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 17
						planet_size < 21
						count_owned_pops = {
								count > 5
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 20
						planet_size < 24
						count_owned_pops = {
								count > 6
								limit = { has_trait = trait_hive_mind }						
						}
				}
				AND = {
						planet_size > 23
						count_owned_pops = {
								count > 7
								limit = { has_trait = trait_hive_mind }						
						}
				}
		}	
}

#жɵķȺǷ㹻
#scope:planet
grown_harmonize_hive_is_enough = {
		OR = {
				AND = {
						planet_size < 6
						count_owned_pops = {
								count > 0
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 5
						planet_size < 9
						count_owned_pops = {
								count > 1
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 8
						planet_size < 12
						count_owned_pops = {
								count > 2
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 11
						planet_size < 15
						count_owned_pops = {
								count > 3
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 14
						planet_size < 18
						count_owned_pops = {
								count > 4
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 17
						planet_size < 21
						count_owned_pops = {
								count > 5
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 20
						planet_size < 24
						count_owned_pops = {
								count > 6
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
				AND = {
						planet_size > 23
						count_owned_pops = {
								count > 7
								limit = { has_trait = trait_hive_mind  is_growing = no }						
						}
				}
		}	
}

#Ƿ̫Ҫ
#scope:Planet
tree_spirit_enough_num_to_purge = {
		OR = {
				has_building = building_life_tree	  
				has_building = building_mother_life_tree
		}
		OR = {
				AND = {
						planet_size < 6
						count_owned_pops = {
								count > 1
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 5
						planet_size < 9
						count_owned_pops = {
								count > 2
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 8
						planet_size < 12
						count_owned_pops = {
								count > 3
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 11
						planet_size < 15
						count_owned_pops = {
								count > 4
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 14
						planet_size < 18
						count_owned_pops = {
								count > 5
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 17
						planet_size < 21
						count_owned_pops = {
								count > 6
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 20
						planet_size < 24
						count_owned_pops = {
								count > 7
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
				AND = {
						planet_size > 23
						count_owned_pops = {
								count > 8
								limit = { has_trait = trait_hive_mind  is_being_purged = no }						
						}
				}
		}		
}

#жǷɳΪĸ
#scope:country
allow_grow_up_to_mother_life_tree = {
		OR = {
				has_valid_civic = civic_harmonious_tree				
				has_modifier = m_kala_gift
		} 
}

#жǷֲ
#SCOPE:PLANET
can_build_life_tree_seed = {
		OR = {
		    #1-51λ
				AND = {
						planet_size = 1
						count_owned_pops = {
								count < 1
								limit = { NOT = {	has_trait = trait_hive_mind }	}
						}
				}
				AND = {
						planet_size = 2
						count_owned_pops = {
								count < 2
								limit = { NOT = {	has_trait = trait_hive_mind }	}	
						}
				}
				AND = {
						planet_size = 3
						count_owned_pops = {
								count < 3
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 4
						count_owned_pops = {
								count < 4
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 5
						count_owned_pops = {
								count < 5
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#6-82λ
				AND = {
						planet_size = 6
						count_owned_pops = {
								count < 5
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 7
						count_owned_pops = {
								count < 6
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 8
						count_owned_pops= {
								count < 7
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#9-113λ
				AND = {
						planet_size = 9
						count_owned_pops = {
								count < 7
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 10
						count_owned_pops = {
								count < 8
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 11
						count_owned_pops = {
								count < 9
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#12-144λ
				AND = {
						planet_size = 12
						count_owned_pops = {
								count < 9
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 13
						count_owned_pops = {
								count < 10
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 14
						count_owned_pops = {
								count < 11
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#15-175λ
				AND = {
						planet_size = 15
						count_owned_pops = {
								count < 11
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 16
						count_owned_pops = {
								count < 12
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 17
						count_owned_pops = {
								count < 13
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#18-206λ
				AND = {
						planet_size = 18
						count_owned_pops = {
								count < 13
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 19
						count_owned_pops = {
								count < 14
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 20
						count_owned_pops = {
								count < 15
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#21-237λ
				AND = {
						planet_size = 21
						count_owned_pops = {
								count < 15
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 22
						count_owned_pops = {
								count < 16
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 23
						count_owned_pops = {
								count < 17
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				#24-258λ
				AND = {
						planet_size = 24
						count_owned_pops = {
								count < 17
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
				AND = {
						planet_size = 25
						count_owned_pops = {
								count < 18
								limit = { NOT = {	has_trait = trait_hive_mind }	}					
						}
				}
		}	
}

#ж鱣£Ƿ˿
#SCOPE:PLANET
can_grow_no_affect_tree_spirit = {
		OR = {
		    #1-51λ
				AND = {
						planet_size = 1
						count_owned_pops = {
								count < 0
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}
						}
				}
				AND = {
						planet_size = 2
						count_owned_pops = {
								count < 1
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}
						}
				}
				AND = {
						planet_size = 3
						count_owned_pops = {
								count < 2
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}			
						}
				}
				AND = {
						planet_size = 4
						count_owned_pops = {
								count < 3
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 5
						count_owned_pops = {
								count < 4
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				#6-82λ
				AND = {
						planet_size = 6
						count_owned_pops = {
								count < 4
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 7
						count_owned_pops = {
								count < 5
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 8
						count_owned_pops= {
								count < 6
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				#9-113λ
				AND = {
						planet_size = 9
						count_owned_pops = {
								count < 6
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 10
						count_owned_pops = {
								count < 7
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 11
						count_owned_pops = {
								count < 8
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				#12-144λ
				AND = {
						planet_size = 12
						count_owned_pops = {
								count < 8
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 13
						count_owned_pops = {
								count < 9
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}					
						}
				}
				AND = {
						planet_size = 14
						count_owned_pops = {
								count < 10
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}					
						}
				}
				#15-175λ
				AND = {
						planet_size = 15
						count_owned_pops = {
								count < 10
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 16
						count_owned_pops = {
								count < 11
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 17
						count_owned_pops = {
								count < 12
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				#18-206λ
				AND = {
						planet_size = 18
						count_owned_pops = {
								count < 12
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}					
						}
				}
				AND = {
						planet_size = 19
						count_owned_pops = {
								count < 13
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 20
						count_owned_pops = {
								count < 14
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				#21-237λ
				AND = {
						planet_size = 21
						count_owned_pops = {
								count < 14
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 22
						count_owned_pops = {
								count < 15
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}			
						}
				}
				AND = {
						planet_size = 23
						count_owned_pops = {
								count < 16
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}					
						}
				}
				#24-258λ
				AND = {
						planet_size = 24
						count_owned_pops = {
								count < 16
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}				
						}
				}
				AND = {
						planet_size = 25
						count_owned_pops = {
								count < 17
								limit = { 
										NOT = {	has_trait = trait_hive_mind }	 
										OR = {
										   is_growing = no
										   has_trait = trait_mechanical
										} 
								}			
						}
				}
		}	
}

#жǷ
#scope:Planet
has_life_tree = {
		OR = {
				has_building = building_life_tree	
				has_building = building_mother_life_tree  
				has_blocker =  tb_growing_life_tree 
		}
}

#ж鱣£Ƿ˿
#scope:Planet
#can_grow_no_affect_tree_spirit = {
#    OR = {
#    		harmonize_hive_is_enough =  yes	
#    		can_build_life_tree_seed = yes
#    }
#}

#жǷиmoddifier
#scope:planet
has_neg_planet_modifier = {
		OR = {
				has_modifier = bleak_planet
				has_modifier = mineral_poor
				has_modifier = weak_magnetic_field
				has_modifier = high_gravity
		}
}

#жǷй
#scope:planet
has_ever_neg_planet_modifier = {
		OR = {
				has_planet_flag = f_ever_bleak_planet
				has_planet_flag = f_ever_mineral_poor 
				has_planet_flag = f_ever_weak_magnetic_field
				has_planet_flag = f_ever_high_gravity	
		}
}

#жǷп
#scope:planet
has_sublimable_planet_modifier = {
		OR = {
				#ȶĹ
				has_modifier = unstable_tectonics
				#ת
				has_modifier = tidal_locked 
				#
				has_modifier = wild_storms
				#Σյ
				has_modifier = hazardous_weather 
				#ΣյҰ
				has_modifier = dangerous_wildlife
				#ʯײ
				has_modifier = asteroid_impacts
		}
}

#жǷ
#scope:planet
is_planet_sublimed = {
		OR = {
				#ʹ԰
				has_modifier = m_geological_parks
				#Ļƻ
				has_modifier = m_everlasting_dusk
				#֮
				has_modifier = m_paradise_of_rain
				#ѱ
				has_modifier = m_tamed_weather
				#
				has_modifier = m_intelligent_friendly_wildlife
				#Ըʥ
				has_modifier = m_holy_place_to_make_wish
		}
}

#жǷˣӰ鱣
#scope:country
harmony_allow_build_robot_pop = {	 
	 OR = {
	    #û֮Ի
	    allow_grow_up_to_mother_life_tree = no
	 		#ai,鱣
	 		AND = {
	 				is_ai =  yes
	 				NOT = { any_owned_planet = { has_modifier = m_protect_tree_spirit	} }
	 		}
	 		#ai,û鱣
	 		AND = {
	 				is_ai = no
	 				NOT = { any_owned_planet = {
	 						has_modifier = m_protect_tree_spirit
	 						sector_controlled = yes
	 				} }
	 		}
	 }
}
