﻿@ruler_share_top_opinion_from_lessee = 50

# Definition of lease used for organized churches. Required for the game to run.
theocracy_lease = {
	hierarchy = { # hierarchy definition is required
		ruler_valid = {
			faith = { has_doctrine = doctrine_theocracy_temporal }
			NOT = { government_has_flag = government_is_theocracy }
		}
		liege_or_vassal_valid = {
			faith = scope:target.faith
		}
		lessee = cp:councillor_court_chaplain	# should be a councillor

		barony_valid = {
			#exists = holder
			de_jure_liege.holder = {
				NOT = { government_has_flag = government_is_theocracy }
			}
			title_province = { has_holding_type = church_holding }
		}
	}
	valid_holdings = { church_holding }

	ruler_share_min_opinion_from_lessee = 1
	hook_strength_max_opinion = strong

	tax = {
		lease_liege = 25
		rest = {
			max = 50  # when updating the weights also update this value. It is used in the tooltip and should be the maximin posible weight
			weight = {
				base = 0
				modifier = {
					add = 50
					scope:ruler = {
						has_strong_hook = scope:lessee
					}
				}
				opinion_modifier = { # Opinion Factor
					min = 0
					max = 50
					who = scope:lessee
					opinion_target = scope:ruler
					trigger = {
						NOT = {
							scope:ruler = {
								has_strong_hook = scope:lessee
							}
						}
					}
					multiplier = {
						value = 50
						divide = @ruler_share_top_opinion_from_lessee
					}
				}
			}
		}
	}

	levy = {
		lease_liege = 15
		rest = {
			max = 100  # when updating the weights also update this value. It is used in the tooltip and should be the maximin posible weight
			weight = {
				base = 0
				modifier = {
					add = 100
					scope:ruler = {
						has_strong_hook = scope:lessee
					}
				}
				opinion_modifier = { # Opinion Factor
					min = 0
					max = 100
					who = scope:lessee
					opinion_target = scope:ruler
					trigger = {
						NOT = {
							scope:ruler = {
								has_strong_hook = scope:lessee
							}
						}
					}
					multiplier = {
						value = 100
						divide = @ruler_share_top_opinion_from_lessee
					}
				}
			}
		}
	}
}
