##########################################################################
# Empire edicts
##########################################################################
#女神的祝福
country_edict = {
	name = "blessing_of_life_goddess"
	length = 0
	cost = { influence = 0 }
	modifier = {
	}
		
	potential = {
		NOT = { has_country_flag = f_blessing_of_life_goddess }
		has_modifier = m_blessing_of_life_goddess
		allow_harmonize = yes
	}
	
	allow = {
		unity > 5000
	}
	
	effect = {
		custom_tooltip = TP_GEN_LIFE_TREE_SEED
		hidden_effect = {
				set_timed_country_flag = { flag = f_blessing_of_life_goddess days = 3600 }
				add_life_tree_seed = yes
		}		
		add_unity = -5000
	}
	#ai有种子就不会用这个政策
	ai_weight = {
		weight = 1
		modifier = {
			factor = 0
			check_variable =  { which = "seed_num"  value > 0 }	
		}		
	}	
}

#树灵保护法令
country_edict = {
	name = "protect_tree_spirit"
	length = 0
	cost = { influence = 0 }
	modifier = {
	}
	
	potential = {
		NOT = { has_modifier = m_protect_tree_spirit_edict }
		OR = {
		  has_valid_civic = civic_harmonious_tree
			has_modifier = m_kala_gift
		}
	}
	
	allow = {
	}
	
	effect = {
		hidden_effect = {
			#给国家加上树灵保护法令修正
			if = {
					limit = { NOT = { has_modifier = m_protect_tree_spirit_edict } }
					add_modifier = { modifier =  "m_protect_tree_spirit_edict"  days = -1 } 
			}
			#检查每一颗行星，符合条件的打上树灵保护标记
			country_event = { id = harmonious_planet.28 } 
		}
	}
	
	#ai总用这个政策
	ai_weight = {
		weight = 1		
	}	
}

#取消树灵保护法令
country_edict = {
	name = "cancel_protect_tree_spirit"
	length = 0
	cost = { influence = 0 }
	modifier = {
	}
	
	potential = {
		has_modifier = m_protect_tree_spirit_edict
		OR = {
		  has_valid_civic = civic_harmonious_tree
			has_modifier = m_kala_gift
		}
	}
	
	allow = {
	}
	
	effect = {
		hidden_effect = {
			#给国家移除树灵保护法令修正
			remove_modifier = m_protect_tree_spirit_edict
			#检查每一颗行星，移除树灵保护标记
			every_owned_planet = {
					limit = {
							 has_modifier = m_protect_tree_spirit
					}
					remove_modifier = m_protect_tree_spirit					
			}	
		}
	}
	
	#ai从不用这个政策
	ai_weight = {
		weight = 0		
	}	
}