﻿###DECISIONS LIST###

#decision_solve_the_journals

decision_solve_the_journals = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_realm.dds"
	}
	decision_group_type = major
	ai_check_interval_by_tier = {
		barony = 0
		county = 0
		duchy = 180
		kingdom = 180
		empire = 180
		hegemony = 180
	}
	desc = decision_solve_the_journals_desc
	cooldown = { years = 1 }

	is_shown = {
		any_owned_story = {
			type = story_cycle_mysterious_journal
			NOT = { exists = var:journal_complete_solved }
		}
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	is_valid = {
		custom_tooltip = {
			text = you_have_journal_1_tt
			any_owned_story = {
				type = story_cycle_mysterious_journal
				exists = var:mysterious_journal.var:secret_journal
			}
		}
		custom_tooltip = {
			text = you_have_journal_2_tt
			any_owned_story = {
				type = story_cycle_mysterious_journal
				exists = var:mysterious_journal.var:secret_puzzle
			}
		}
		custom_tooltip = {
			text = you_have_journal_3_tt
			any_owned_story = {
				type = story_cycle_mysterious_journal
				exists = var:mysterious_journal.var:secret_cipher
			}
		}
	}

	effect = {
		hidden_effect = {
			random_owned_story = {
				type = story_cycle_mysterious_journal
				var:mysterious_journal = { save_scope_as = mysterious_journal }
			}
		}
		duel = {
			skill = learning
			value = high_skill_rating
			50 = { # You solve the puzzle!
				compare_modifier = {
					value = scope:duel_value
					multiplier = 0.5
				}
				custom_tooltip = {
					text = open_the_journal_tt
					trigger_event = tour_general.5010
				}
			}
			50 = { # You fail
				compare_modifier = {
					value = scope:duel_value
					multiplier = -0.5
				}
				show_as_tooltip = {
					add_stress = major_stress_gain
				}
				hidden_effect = {
					trigger_event = tour_general.5000
				}
			}
		}
	}
	

	ai_potential = {
		always = yes
	}

	ai_will_do = {
		base = 100
	}
}
