﻿calculate_activity_special_type_progression = {
	scope:activity = {
		# Reset progression to 0 before recalculating
		set_variable = {
			name = activity_special_type_progression
			value = 0
		}

		if = {
			limit = {
				scope:host = {
					NOT = { has_character_flag = active_crisis_rebel }
				}
			}
			every_attending_character = {
				limit = { has_character_flag = pledged_to_heir }
				scope:activity = {
					change_variable = {
						name = activity_special_type_progression
						add = 1
					}
				}
			}
			every_attending_character = {
				limit = { has_character_flag = pledged_to_claimant }
				scope:activity = {
					change_variable = {
						name = activity_special_type_progression
						add = -1
					}
				}
			}
		}
		else = {
			every_attending_character = {
				limit = { has_character_flag = pledged_to_claimant }
				scope:activity = {
					change_variable = {
						name = activity_special_type_progression
						add = 1
					}
				}
			}
			every_attending_character = {
				limit = { has_character_flag = pledged_to_heir }
				scope:activity = {
					change_variable = {
						name = activity_special_type_progression
						add = -1
					}
				}
			}
		}
	}
}