##########################
#
# Better Mystic decisions
#
##########################

targeted_decisions = {
	
	#Power: Summon familiar
	bm_summon_familiar = {
		
		filter = self
		ai = no
		
		potential = {
			prisoner = no
			NOT = { trait = incapable }
			trait = mystic
			OR = {
				has_character_modifier = bm_summoner
				has_character_modifier = bm_wizard
			}
		}

		allow = {
			custom_tooltip = {
				text = devil_worshipers_summon_familiar_cd_tooltip
				NOT = { has_character_modifier = summon_familiar_cooldown }
			}
			piety = 300
		}

		effect = {
			hidden_effect = {
				add_character_modifier = {
					name = summon_familiar_cooldown
					years = 5
					hidden = yes
				}
				character_event = { id = BM.102 }
			}
			piety = -300
		}

		revoke_allowed = {
			always = no
		}
	}
	
	#Power: Alchemy Potion
	bm_alchemy_potion = {
		
		filter = self
		ai = no
		
		potential = {
			prisoner = no
			NOT = { trait = incapable }
			trait = mystic
			OR = {
				has_character_modifier = bm_alchemist
				has_character_modifier = bm_wizard
			}
		}

		allow = {
			custom_tooltip = {
				text = bm_alchemy_potion_cd_tooltip
				NOT = { has_character_modifier = bm_potion_cd }
			}
			piety = 30
		}

		effect = {
			hidden_effect = {
				add_character_modifier = {
					name = bm_potion_cd
					years = 1
					hidden = yes
				}
				character_event = { id = BM.202 }
			}
			piety = -30
		}

		revoke_allowed = {
			always = no
		}
	}

	#Power: Astrology Star
	bm_astrology_star = {
		
		filter = self
		ai = no
		
		potential = {
			prisoner = no
			NOT = { trait = incapable }
			trait = mystic
			OR = {
				has_character_modifier = bm_astrologer
				has_character_modifier = bm_wizard
			}
		}

		allow = {
			custom_tooltip = {
				text = hermetics_scrying_cooldown_tooltip
				has_an_omen_modifier_trigger = no
				NOT = {
					OR = {
						has_character_modifier = scrying_cooldown
						has_character_modifier = bm_good_battle
						has_character_modifier = bm_bad_battle
						has_character_modifier = bm_good_relationship
						has_character_modifier = bm_bad_relationship
						has_character_modifier = bm_good_power
						has_character_modifier = bm_bad_power
					}
				}
			}
			piety = 50
		}

		effect = {
			hidden_effect = {
				add_character_modifier = {
					name = scrying_cooldown
					years = 1
					hidden = yes
				}
				character_event = { id = BM.302 }
			}
			piety = -50
		}

		revoke_allowed = {
			always = no
		}
	}

	#Power: Child Horoscope
	bm_make_horoscope = {
		
		ai = no
		
		from_potential = {
			trait = mystic
			OR = {
				has_character_modifier = bm_astrologer
				has_character_modifier = bm_wizard
			}
		}

		potential = {
    		is_child_of = FROM
		}

		allow = {
    		is_adult = no
			custom_tooltip = {
				text = hermetics_horoscope_cooldown_tooltip
				NOT = { has_character_modifier = horoscope_cooldown }
			}
			FROM = { has_society_currency_medium_trigger = yes }
		}

		effect = {
			hidden_effect = {
				add_character_modifier = {
					name = horoscope_cooldown
					duration =-1 #not actually a cooldown, but blocks decision until cleared (which does happen, promise)
					hidden = yes
				}
				save_event_target_as = horoscope_child
				FROM = { character_event = { id = MNM.1250 days = 5 } }
			}
			FROM = { detract_society_currency_medium_effect = yes }
		}

		revoke_allowed = { always = no }

	}

}

decisions = {

	bm_lapissmith = {
		is_high_prio = yes # Will show an alert once decision is enabled
		ai = no

		potential = {
			trait = mystic
			has_artifact = bm_lapis_sage
			NOT = {
				OR = {
					has_artifact = bm_lapis_sword
					has_artifact = bm_lapis_lance
					has_artifact = bm_lapis_bow
					has_artifact = bm_lapis_pistol
				}
			}
			OR = {
				has_character_modifier = bm_alchemist
				has_character_modifier = bm_wizard
			}
		}
		allow = {
			wealth = 500
			prisoner = no
			is_adult = yes
			NOT = { trait = incapable }
		}
		effect = {
			wealth = -500
			character_event = { id = BM.218 }
		}
		revoke_allowed = {
			always = no # Generic setting
		}
	}

}