﻿mar_commission_celestial_tablet_decision = {
	picture = {
		reference = "gfx/interface/illustrations/decisions/decision_dynasty_house.dds"
	}
	desc = mar_commission_celestial_tablet_decision_desc
	selection_tooltip = mar_commission_celestial_tablet_decision_tooltip
	confirm_text = mar_commission_celestial_tablet_decision_confirm
	sort_order = 110
	cooldown = { years = 20 }

	is_shown = {
		is_landed = yes
		has_government = celestial_government
		OR = {
			NOT = {
				any_artifact = {
					has_variable = mar_celestial_tablet
				}
			}
			any_artifact = {
				has_variable = mar_celestial_tablet
				artifact_owner = {
					NOT = { has_government = celestial_government }
				}
			}
		}
	}

	is_valid_showing_failures_only = {
		is_available_adult = yes
	}

	cost = {
		gold = major_gold_value
		prestige = medium_prestige_value
	}

	effect = {
		if = {
			limit = {
				any_artifact = {
					has_variable = mar_celestial_tablet
					artifact_owner = {
						NOT = { has_government = celestial_government }
					}
				}
			}
			custom_tooltip = mar_celestial_tablet_recovered_tt
			random_artifact = {
				limit = {
					has_variable = mar_celestial_tablet
					artifact_owner = {
						NOT = { has_government = celestial_government }
					}
				}
				set_owner = root
			}
			mar_handle_celestial_tablet_effect = yes
		}
		else = {
			custom_tooltip = mar_celestial_tablet_forged_tt
			mar_create_random_government_artifact_effect = { OWNER = root }
		}
	}

	ai_check_interval = 120

	ai_potential = {
		short_term_gold >= major_gold_value
	}

	ai_will_do = {
		base = 15
	}
}
