﻿# Returns the skill level of the inquisitor on a scale from
# 0 (min skill) to 1 (most skill). In terms of intrigue level
# this translates to (10, 50).
# scope:councillor = councillor_inquisitor
inquisitor_skill_factor = {
	scope:councillor = {
		value = intrigue
		subtract = 10
		divide = 40
		min = 0
		max = 1
	}
}

# The increase in dread_baseline_add granted by task_impromptu_inspections.
# Range: [5, 25]
task_impromptu_inspections_dread_baseline = {
	value = 5
	add = {
		value = 20
		multiply = inquisitor_skill_factor
	}
}

# The amount of monthly control added by task_impromptu_inspections.
# Range: [0.1, 0.3]
task_impromptu_inspections_monthly_county_control = {
	value = 0.1
	add = {
		value = 0.2
		multiply = inquisitor_skill_factor
	}
}

# The chance of suppressing a heretical county each month during task_impromptu_inspections.
# Range: [6.25, 20] (aka, suppresses a heretical county every 16 to 5 months
# based on councillor skill).
task_impromptu_inspections_county_suppress_chance = {
	value = 6.25
	add = {
		value = 13.75
		multiply = inquisitor_skill_factor
	}
}

# The chance that a heretic will be identified by task_impromptu_inspections if
# heresy is active in the realm.
# Range: [16.67, 50] (aka, identifies a heretic every 6 to 2 months based on
# councillor skill).
task_impromptu_inspections_identify_heretic_chance = {
	value = 16.67
	add = {
		value = 33.33
		multiply = inquisitor_skill_factor
	}
}

# Calculates the amount of progress on task_apprehend_heretics which the
# councillor should make per 30 days. 1/30th of this value will be applied
# daily, and once the value reaches 100, the task is completed.
#
# Secret Phase Range: [10, 50] (8 - 2 Months)
# Public Phase Range: [5, 25] (20 - 4 Months)
task_apprehend_heretics_monthly_progress = {
	value = {
		value = 10
		desc = regula_council_base_progress
	}

	add = {
		value = 40
		multiply = inquisitor_skill_factor
		desc = regula_inquisitor_skill
	}

	if = {
		limit = {
			scope:councillor_liege = {
				regula_heresy_story_against_character_in_public_state_trigger = yes
			}
		}

		divide = {
			value = 2
			desc = task_apprehend_heretics_public_opposition_desc
		}
	}
}

# Calculates the expected duration of task_apprehend_heretics for the
# current inqusitor in months.
task_apprehend_heretics_duration_months = {
	value = 100
	divide = task_apprehend_heretics_monthly_progress
}

# Calculates the number of heretics which can be apprehended by the inquisitor
# upon completion of task_apprehend_heretics.
# Range [1, 4]
task_apprehend_heretics_num_heretics_captured = {
	value = 1
	add = {
		value = 3
		multiply = inquisitor_skill_factor
	}
	floor = yes
}
