﻿# Write a book, poetry, fiction, philosophy or governance

### Author Book ###
author_book_decision = {
	picture = {
		reference = "gfx/interface/illustrations/event_scenes/tgp_study_asia.dds"
	}
	desc = author_book_decision_desc
	sort_order = 100

	selection_tooltip = author_book_decision_tooltip

	cooldown = { years = 10 }

	is_shown = {
		culture = { has_cultural_parameter = can_author_books }
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	cost = {
		gold = minor_gold_value
	}

	widget = {
		gui = "decision_view_widget_generic_multichoice_with_effects"
		controller = decision_option_list_controller
		decision_to_second_step_button = "SELECT_ACTION"
		show_from_start = yes

		item = {
			value = poetry
			current_description = poetry_book_desc
			localization = poetry
			icon = "gfx/interface/icons/court_position_task_types/grand_mentor_court_position_task_teach_liege.dds"
			is_valid = {
				
			}
			ai_chance = {
				value = 100
			}
		}

		item = {
			value = prose 
			current_description = prose_book_desc
			localization = prose
			icon = "gfx/interface/icons/court_position_task_types/court_poet_court_position_task_create_poetry.dds"
			is_valid = {
			}
			ai_chance = {
				value = 100
			}
		}

		item = {
			value = scholarship
			current_description = scholarship_book_desc
			localization = scholarship
			icon = "gfx/interface/icons/court_position_task_types/guru_teach_learning.dds"
			is_valid = {
				custom_tooltip = {
					text = scholarship.requirements.tt
					OR = {
						learning >= 15
						AND = {
							has_trait = confucian_education
							has_trait_xp = {
								trait = confucian_education
								value >= 40
							}
						}
					}
				}
			}
			ai_chance = {
				value = 100
			}
		}
	}

	effect = {
		
		switch = {
			trigger = yes
			scope:poetry = {
				custom_tooltip = poetry_book_desc
				custom_tooltip = poetry_book_effect_desc
				custom_tooltip = quickest_book_tt
				trigger_event = author_book.0001
				show_as_tooltip = {
					stress_impact = {
						base = minor_stress_impact_gain
						lazy = minor_stress_impact_gain
						lifestyle_poet = minor_stress_impact_loss #offsets penalty a bit
					}
				}
			}
			scope:prose = {
				custom_tooltip = prose_book_desc
				custom_tooltip = prose_book_effect_desc
				if = {
					limit = {
						NOT = { has_trait = confucian_education }
					}
					show_as_tooltip = { add_trait = confucian_education }
				}
				trigger_event = author_book.0004
				show_as_tooltip = {
					stress_impact = {
						base = medium_stress_impact_gain
						lazy = minor_stress_impact_gain
						journaller = minor_stress_impact_loss #offsets penalty a bit
						confucian_education = minor_stress_impact_loss #offsets penalty a bit
					}
				}
			}
			scope:scholarship = {
				custom_tooltip = scholarship_book_desc
				custom_tooltip = scholarship_effect_desc
				custom_tooltip = most_time_consuming_book_tt
				trigger_event = author_book.0005
				show_as_tooltip = {
					stress_impact = {
						base = major_stress_impact_gain
						lazy = minor_stress_impact_gain
						journaller = minor_stress_impact_loss #offsets penalty a bit
						confucian_education = minor_stress_impact_loss #offsets penalty a bit
					}
				}
			}
		}
	}
	
	ai_check_interval_by_tier = {
		barony = 0
		county = 120
		duchy = 120
		kingdom = 120
		empire = 120
		hegemony = 120
	}
	
	ai_potential = {
		short_term_gold >= major_gold_value
	}

	ai_will_do = {
		base = 100
	}
}
