# -*- ck2.decisions -*-

# Targetted decisions are possible vs _all_ other characters and shown are in the Diplomacy View, not the Intrigue View. The taker is in the FROM scope.
#
# filter = [self/court/home_court/vassals/sub_realm/realm/dynasty/all] ('self' MUST be set for decisions targetting only the taker, the other filter types can be set to lessen CPU load)
# ai_target_filter = [self/court/home_court/vassals/sub_realm/realm/dynasty/all] (which characters for which the AI evaluates the decision.)
#	court: all characters in the AI's host court, including prisoners, and characters currently away (wards, prisoners, etc)
#	home_court: all characters in the AI's home court, including prisoners, and characters currently away (wards, prisoners, etc)
#	vassals: direct vassal rulers of the AI's employer
#	sub_realm: all characters below the AI's employer
#	realm: all characters in the same top realm as the AI
#	dynasty: all members of the same dynasty
#	rivals: your rivals plus any character you have an opinion modifier with 'crime = yes' set (the same set of characters the 'is_foe' trigger evaluates)
#	all: all living characters (Avoid if possible. VERY CPU-HEAVY!)
#

targetted_decisions = {

	scmr_emf_bless_lucky_ruler = {
		filter = all_including_me
		ai_target_filter = none

		from_potential = {
			has_character_flag = cheats_enabled
		}
		potential = {
			#is_playable = yes
			OR = {
				is_landed = yes
				is_patrician = yes
			}
			#ai = yes
			OR = {
				NOT = { trait = scmr_emf_lucky_ruler }
				NOT = { has_character_modifier = scmr_emf_mod_lucky_ruler }
			}
			NOT = { war_with = FROM } # Do not want this showing up when suing for peace
			#emf_isolated_character = no
			#NOT = { character = FROM }
		}
		allow = {
			NOT = { war_with = FROM }
			#multiplayer = no
		}
		effect = {
			#custom_tooltip = {
			#	text = emf_ctt_bless_lucky_ruler
			#	hidden_tooltip = {
			#		character_event = { id = emf_lucky.1 }
			#	}
			#}
			add_trait = scmr_emf_lucky_ruler
			add_character_modifier = {
				name = scmr_emf_mod_lucky_ruler
				duration = -1
			}
		}
		ai_will_do = {
			factor = 0
		}
	}

	scmr_emf_unbless_lucky_ruler = {
		filter = all_including_me
		ai_target_filter = none

		from_potential = {
			#is_playable = yes
			#ai = no
			has_character_flag = cheats_enabled
		}
		potential = {
			OR = {
				trait = scmr_emf_lucky_ruler
				has_character_modifier = scmr_emf_mod_lucky_ruler
			}
		}
		allow = {
			NOT = { war_with = FROM }
		}
		effect = {
			remove_trait = scmr_emf_lucky_ruler
			remove_character_modifier = scmr_emf_mod_lucky_ruler
		}
		ai_will_do = {
			factor = 0
		}
	}
}
