# 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.
#
# 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 = {
	acknowledge_hidden_bastard = {
		filter = all
		ai_target_filter = realm

		from_potential = {
			ai = no
			is_playable = yes
		}

		potential = {
			real_father = { character = FROM }
			NOT = { trait = legit_bastard }
		}

		allow = {
			FROM = {
				piety = 100
			}
		}

		effect = {
		FROM = { character_event = { id = roy_bastard.001 } }
		custom_tooltip = {
			text = ACKNOWLEDGESECRETBASTARD }
			hidden_tooltip = {
			FROM = {
				chronicle = {
					entry = CHRONICLE_HIDDEN_BASTARD
					portrait = [Root.GetID]
				}
			}
			dynasty = FROM
			add_trait = bastard
			set_father = FROM
			recalc_succession = yes
			move_character = FROM
			if = {
				limit = {
					prisoner = yes
					host = { character = FROM }
				}
				imprison = no
			}

			FROM = {
				spouse = {
					if = {
						limit = {
							NOT = {
								any_child = {
									character = ROOT
								}	
							}
						}
						opinion = {
							who = FROM
							modifier = acknowledged_bastard
							years = 10
						}
					}
				}
				any_child = {
						limit = {
							NOT = { character = ROOT }
							dynasty = FROM
							NOT = { trait = legit_bastard }
						}
						opinion = {
							who = FROM
							modifier = acknowledged_bastard
							months = 12
							}
						}
					}
				}
			}

		ai_will_do = { factor = 0 }
	}
}
