﻿##################################################

#	Fury of the Northmen Other Decisions List

#	Raise Runestone [Expanded] - Raise a runestone to yourself, your actions, or your family.

##################################################


#############################################
# Raise Runestone [Expanded]				#
# by Ewan Cowhig Croft						#
#############################################

### Raise Stele Decision ###
raise_stele_decision = {
	title = raise_stele_decision_name
	picture = {
		reference = "gfx/interface/illustrations/decisions/fp1_decision_raise_runestone.dds"
	}
	desc = raise_stele_decision_desc
	selection_tooltip = raise_stele_decision_tooltip
	decision_group_type = major

	cooldown = { years = 10 }
	
	sort_order = 80

	is_shown = {
		# DLC check.
		has_fp1_dlc_trigger = yes
		# Landed characters only: nobody likes a mercenary.
		is_landed = yes
		primary_title.tier > tier_barony
		# Holds a suitable culture at a suitable period.
		fp1_can_raise_stele_trigger = yes
	}

	is_valid = {
		# Has a valid reason.
		OR = {
			custom_description = {
				text = raise_stele_decision_ancestor
				# For family.
				has_variable = ancestor_to_bury
			}
			custom_description = {
				text = raise_stele_decision_victory
				# Won a war that gained them territory.
				has_variable = recent_conquest_victory
			}
			custom_description = {
				text = raise_stele_decision_rank
				# Marking going up a rank.
				has_variable = recent_rank_increase
			}
		}
	}

	is_valid_showing_failures_only = {
		# Standard checks.
		is_available_adult = yes
		# Shouldn't be at war.
		is_at_war = no
	}

	cost = { 
		gold = {
			value = 0
			if = {
				limit = {
					has_treasury = no
				}
				add = raise_stele_gold_cost
			}
		}
		treasury = {
			value = 0
			if = {
				limit = {
					has_treasury = yes
				}
				add = raise_stele_gold_cost
			}
		}
	}

	effect = {
		# Save the gold value for refund purposes.
		set_variable = {
			name = raise_stele_refund
			value = raise_stele_gold_cost
		}
		# Generic effects.
		show_as_tooltip = { fp1_apply_generic_stele_bonuses_effect = yes }
		# Inform that they'll be a bit weaker outside of your own culture (& similar).
		custom_tooltip = raise_stele_decision_tt.variable_strength
		# Show type effects.
		custom_tooltip = raise_stele_decision_tt.effects_list
		# Show a warning about it being destroyed if someone outside of your dynasty takes over the county it's built in
		custom_description_no_bullet = {
			text = raise_runestone_decision_warning
		}
		# Moved ahead to selection.
		trigger_event = fp1_other_decisions.0101
	}

	ai_check_interval_by_tier = {
		barony = 0
		county = 120
		duchy = 36
		kingdom = 36
		empire = 36
		hegemony = 36
	}
	
	ai_potential = {
		# Only take it if you can afford it.
		short_term_gold >= raise_stele_gold_cost
	}

	ai_will_do = {
		# We don't want too many runestones all over the place.
		base = 50
	}
}
