﻿dlm_quality_relevant_skill = {
	value = 0
	if = {
		limit = { scope:dlm_target_county.title_province = { var:dlm_group = 1 } }
		add = stewardship
	}
	else_if = {
		limit = { scope:dlm_target_county.title_province = { var:dlm_group = 2 } }
		add = learning
	}
	else_if = {
		limit = { scope:dlm_target_county.title_province = { var:dlm_group = 3 } }
		add = diplomacy
	}
	else_if = {
		limit = { scope:dlm_target_county.title_province = { var:dlm_group = 4 } }
		add = intrigue
	}
	else_if = {
		limit = { scope:dlm_target_county.title_province = { var:dlm_group = 5 } }
		add = martial
	}
}

dlm_quality_bonus_points = {
	value = dlm_quality_relevant_skill
	add = {
		value = dlm_quality_relevant_skill
		multiply = 0.5
	}
	if = {
		limit = { has_trait = architect }
		add = 30
	}
}

dlm_commission_base_gold_cost = {
	value = 500
	if = {
		limit = {
			exists = scope:root.primary_title
			scope:root.primary_title = { has_variable = dlm_next_commission_gold_cost }
		}
		value = scope:root.primary_title.var:dlm_next_commission_gold_cost
	}
	else_if = {
		limit = { has_variable = dlm_next_commission_gold_cost }
		value = var:dlm_next_commission_gold_cost
	}
}

dlm_commission_base_prestige_cost = {
	value = 1000
	if = {
		limit = {
			exists = scope:root.primary_title
			scope:root.primary_title = { has_variable = dlm_next_commission_prestige_cost }
		}
		value = scope:root.primary_title.var:dlm_next_commission_prestige_cost
	}
	else_if = {
		limit = { has_variable = dlm_next_commission_prestige_cost }
		value = var:dlm_next_commission_prestige_cost
	}
}

dlm_commission_discounted_gold_cost = {
	value = dlm_commission_base_gold_cost
	multiply = 0.5
	min = 250
}

dlm_commission_discounted_prestige_cost = {
	value = dlm_commission_base_prestige_cost
	multiply = 0.5
	min = 500
}

dlm_commission_next_gold_cost = {
	value = dlm_commission_base_gold_cost
	multiply = 2
}

dlm_commission_next_prestige_cost = {
	value = 1000
}

# Landmark construction duration used by the live great project flow.
# Release value is 730 days (2 years).
# For debugging, temporarily change this to a short value like 30, then change it back before release.
# Keep the midpoint script value below aligned automatically.
dlm_landmark_construction_days = {
	value = 730
}

# Patronage checkpoint timing for the funding popup.
# This stays at 25% of the total construction time automatically.
dlm_landmark_midpoint_patronage_days = {
	value = dlm_landmark_construction_days
	multiply = 0.25
	min = 1
}
