﻿# Use the existing roster and per-senator weights; eligible senators with opinion >= 20 support recognition.
aureliani_senate_recognition_member_weight = {
	value = 1
	if = { limit = { is_powerful_vassal = yes } add = 2 }
	if = { limit = { highest_held_title_tier >= tier_duchy } add = 1 }
	if = { limit = { diplomacy >= 12 } add = 1 }
}
aureliani_senate_recognition_total_weight = {
	value = 0
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_1 house:house_aureliani.var:aureliani_senator_1 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_1.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_2 house:house_aureliani.var:aureliani_senator_2 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_2.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_3 house:house_aureliani.var:aureliani_senator_3 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_3.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_4 house:house_aureliani.var:aureliani_senator_4 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_4.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_5 house:house_aureliani.var:aureliani_senator_5 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_5.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_6 house:house_aureliani.var:aureliani_senator_6 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_6.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_7 house:house_aureliani.var:aureliani_senator_7 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_7.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_8 house:house_aureliani.var:aureliani_senator_8 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_8.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_9 house:house_aureliani.var:aureliani_senator_9 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_9.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_10 house:house_aureliani.var:aureliani_senator_10 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_10.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_11 house:house_aureliani.var:aureliani_senator_11 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_11.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_12 house:house_aureliani.var:aureliani_senator_12 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_12.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_13 house:house_aureliani.var:aureliani_senator_13 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_13.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_14 house:house_aureliani.var:aureliani_senator_14 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_14.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_15 house:house_aureliani.var:aureliani_senator_15 = { aureliani_senator_eligible_trigger = yes } } add = house:house_aureliani.var:aureliani_senator_15.aureliani_senate_recognition_member_weight }
}
aureliani_senate_recognition_yes_weight = {
	value = 0
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_1 house:house_aureliani.var:aureliani_senator_1 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_1.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_2 house:house_aureliani.var:aureliani_senator_2 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_2.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_3 house:house_aureliani.var:aureliani_senator_3 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_3.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_4 house:house_aureliani.var:aureliani_senator_4 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_4.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_5 house:house_aureliani.var:aureliani_senator_5 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_5.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_6 house:house_aureliani.var:aureliani_senator_6 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_6.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_7 house:house_aureliani.var:aureliani_senator_7 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_7.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_8 house:house_aureliani.var:aureliani_senator_8 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_8.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_9 house:house_aureliani.var:aureliani_senator_9 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_9.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_10 house:house_aureliani.var:aureliani_senator_10 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_10.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_11 house:house_aureliani.var:aureliani_senator_11 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_11.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_12 house:house_aureliani.var:aureliani_senator_12 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_12.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_13 house:house_aureliani.var:aureliani_senator_13 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_13.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_14 house:house_aureliani.var:aureliani_senator_14 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_14.aureliani_senate_recognition_member_weight }
	if = { limit = { exists = house:house_aureliani.var:aureliani_senator_15 house:house_aureliani.var:aureliani_senator_15 = { aureliani_senator_eligible_trigger = yes opinion = { target = house:house_aureliani.house_head value >= 20 } } } add = house:house_aureliani.var:aureliani_senator_15.aureliani_senate_recognition_member_weight }
}

aureliani_senate_recognition_required_weight = {
	value = aureliani_senate_recognition_total_weight
	divide = 2
	floor = yes
	add = 1
}
