﻿on_court_type_changed = {
	on_actions = {
		on_court_type_changed_RE
	}
}

on_court_type_changed_RE = {
	effect = {
		remove_character_modifier = RE_court_diplo_1_verhigh
		remove_character_modifier = RE_court_diplo_1_high
		remove_character_modifier = RE_court_diplo_1_low
		remove_character_modifier = RE_court_diplo_1_verlow
		remove_character_modifier = RE_court_diplo_2_verhigh
		remove_character_modifier = RE_court_diplo_2_high
		remove_character_modifier = RE_court_diplo_2_low
		remove_character_modifier = RE_court_diplo_2_verlow
		remove_character_modifier = RE_court_mart_1_verhigh
		remove_character_modifier = RE_court_mart_1_high
		remove_character_modifier = RE_court_mart_1_low
		remove_character_modifier = RE_court_mart_1_verlow
		remove_character_modifier = RE_court_mart_2_verhigh
		remove_character_modifier = RE_court_mart_2_high
		remove_character_modifier = RE_court_mart_2_low
		remove_character_modifier = RE_court_mart_2_verlow
		remove_character_modifier = RE_court_stew_1_verhigh
		remove_character_modifier = RE_court_stew_1_high
		remove_character_modifier = RE_court_stew_1_low
		remove_character_modifier = RE_court_stew_1_verlow
		remove_character_modifier = RE_court_stew_2_verhigh
		remove_character_modifier = RE_court_stew_2_high
		remove_character_modifier = RE_court_stew_2_low
		remove_character_modifier = RE_court_stew_2_verlow
		remove_character_modifier = RE_court_intr_1_verhigh
		remove_character_modifier = RE_court_intr_1_high
		remove_character_modifier = RE_court_intr_1_low
		remove_character_modifier = RE_court_intr_1_verlow
		remove_character_modifier = RE_court_intr_2_verhigh
		remove_character_modifier = RE_court_intr_2_high
		remove_character_modifier = RE_court_intr_2_low
		remove_character_modifier = RE_court_intr_2_verlow
		remove_character_modifier = RE_court_lear_1_verhigh
		remove_character_modifier = RE_court_lear_1_high
		remove_character_modifier = RE_court_lear_1_low
		remove_character_modifier = RE_court_lear_1_verlow
		remove_character_modifier = RE_court_lear_2_verhigh
		remove_character_modifier = RE_court_lear_2_high
		remove_character_modifier = RE_court_lear_2_low
		remove_character_modifier = RE_court_lear_2_verlow
	}
}

on_hostage_taken = {
	on_actions = {
		on_hostage_taken_RE
	}
}

on_hostage_taken_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:warden.var:RE_court_diplo_1_var
					scope:warden.var:RE_court_diplo_1_var <= 95
				}
			}
			scope:warden = {
				change_variable = {
					name = RE_court_diplo_1_var
					add = 5
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:warden.var:RE_court_diplo_1_var
			}
			scope:warden = {
				set_variable = {
					name = RE_court_diplo_1_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:warden.var:RE_court_intr_1_var
					scope:warden.var:RE_court_intr_1_var <= 95
				}
			}
			scope:warden = {
				change_variable = {
					name = RE_court_inrt_1_var
					add = 5
				}
				RE_axis_recount_intr = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:warden.var:RE_court_intr_1_var
			}
			scope:warden = {
				set_variable = {
					name = RE_court_inrt_1_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_hostage_released = {
	on_actions = {
		on_hostage_released_RE
	}
}

on_hostage_released_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:warden.var:RE_court_diplo_1_var
					scope:warden.var:RE_court_diplo_1_var >= 3
				}
			}
			scope:warden = {
				change_variable = {
					name = RE_court_diplo_1_var
					add = -3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:warden.var:RE_court_diplo_1_var
			}
			scope:warden = {
				set_variable = {
					name = RE_court_diplo_1_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_court_language_changed = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:target_character.var:RE_court_stew_2_var
					scope:target_character.var:RE_court_stew_2_var >= 5
				}
			}
			scope:target_character = {
				change_variable = {
					name = RE_court_stew_2_var
					add = -5
				}
				RE_axis_recount_stew = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:target_character.var:RE_court_stew_2_var
			}
			scope:target_character = {
				set_variable = {
					name = RE_court_stew_2_var
					value = 0
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:target_character.var:RE_court_lear_2_var
					scope:target_character.var:RE_court_lear_2_var <= 95
				}
			}
			scope:target_character = {
				change_variable = {
					name = RE_court_lear_2_var
					add = 5
				}
				RE_axis_recount_lear = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:target_character.var:RE_court_lear_2_var
			}
			scope:target_character = {
				set_variable = {
					name = RE_court_lear_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_alliance_added = {
	on_actions = {
		on_alliance_added_RE
	}
}

on_alliance_added_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:first.var:RE_court_diplo_1_var
					scope:first.var:RE_court_diplo_1_var >= 5
				}
			}
			scope:first = {
				change_variable = {
					name = RE_court_diplo_1_var
					add = -5
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = {
 				exists = scope:first.var:RE_court_diplo_1_var
			}
			scope:first = {
				set_variable = {
					name = RE_court_diplo_1_var
					value = 0
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:second.var:RE_court_diplo_1_var
					scope:second.var:RE_court_diplo_1_var >= 5
				}
			}
			scope:second = {
				change_variable = {
					name = RE_court_diplo_1_var
					add = -5
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:second.var:RE_court_diplo_1_var
			}
			scope:second = {
				set_variable = {
					name = RE_court_diplo_1_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_alliance_broken = {
	on_actions = {
		on_alliance_broken_RE
	}
}

on_alliance_broken_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:first.var:RE_court_diplo_2_var
					scope:first.var:RE_court_diplo_2_var <= 97
				}
			}
			scope:first = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = 3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:first.var:RE_court_diplo_1_var
			}
			scope:first = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:second.var:RE_court_diplo_2_var
					scope:second.var:RE_court_diplo_2_var <= 97
				}
			}
			scope:second = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = 3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:second.var:RE_court_diplo_2_var
			}
			scope:second = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_raid_loot_delivered = {
	on_actions = {
		on_raid_loot_delivered_RE
	}
}

on_raid_loot_delivered_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:raider.var:RE_court_mart_2_var
					scope:raider.var:RE_court_mart_2_var >= 5
				}
			}
			scope:raider = {
				change_variable = {
					name = RE_court_mart_2_var
					add = -5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:raider.var:RE_court_mart_2_var
			}
			scope:raider = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 0
				}
			}
		}
		else = {}
	}	
}

on_culture_created = {
	on_actions = {
		on_culture_created_RE
	}
}

on_culture_created_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:founder.var:RE_court_stew_2_var
					scope:founder.var:RE_court_stew_2_var >= 8
				}
			}
			scope:founder = {
				change_variable = {
					name = RE_court_stew_2_var
					add = -8
				}
				RE_axis_recount_stew = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:founder.var:RE_court_stew_2_var
			}
			scope:founder = {
				set_variable = {
					name = RE_court_stew_2_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_entered_diarchy = {
	on_actions = {
		on_entered_diarchy_RE
	}
}

on_entered_diarchy_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_diplo_2_var
					root.var:RE_court_diplo_2_var >= 5
				}
			}
			root = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = -5
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_diplo_2_var
			}
			root = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_diarch_change = {
	on_actions = {
		on_diarch_change_RE
	}
}


on_diarch_change_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_diplo_2_var
					root.var:RE_court_diplo_2_var >= 3
				}
			}
			root = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = -3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_diplo_2_var
			}
			root = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_faction_demand_accepted = {
	on_actions = {
		on_faction_demand_accepted_RE
	}
}

on_faction_demand_accepted_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_intr_2_var
					root.var:RE_court_intr_2_var >= 14
				}
			}
			root = {
				change_variable = {
					name = RE_court_intr_2_var
					add = -14
				}
				RE_axis_recount_intr = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_intr_2_var
			}
			root = {
				set_variable = {
					name = RE_court_intr_2_var
					value = 0
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_diplo_2_var
					root.var:RE_court_diplo_2_var <= 97
				}
			}
			root = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = 3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_diplo_2_var
			}
			root = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_faction_demand_rejected = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_intr_2_var
					root.var:RE_court_intr_2_var <= 92
				}
			}
			root = {
				change_variable = {
					name = RE_court_intr_2_var
					add = 8
				}
				RE_axis_recount_intr = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_intr_2_var
			}
			root = {
				set_variable = {
					name = RE_court_intr_2_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_diplo_2_var
					root.var:RE_court_diplo_2_var <= 95
				}
			}
			root = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = 5
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_diplo_2_var
			}
			root = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_hook_used = {
	on_actions = {
		on_hook_used_RE
	}
}

on_hook_used_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_intr_1_var
					root.var:RE_court_intr_1_var >= 3
				}
			}
			root = {
				change_variable = {
					name = RE_court_intr_1_var
					add = -3
				}
				RE_axis_recount_intr = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_intr_1_var
			}
			root = {
				set_variable = {
					name = RE_court_intr_1_var
					value = 0
				}
			}
		}
		else = {}
	
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_diplo_2_var
					root.var:RE_court_diplo_2_var >= 3
				}
			}
			root = {
				change_variable = {
					name = RE_court_diplo_2_var
					add = -3
				}
				RE_axis_recount_diplo = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_diplo_2_var
			}
			root = {
				set_variable = {
					name = RE_court_diplo_2_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_imprison = {
	on_actions = {
		on_imprison_RE
	}
}

on_imprison_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:imprisoner.var:RE_court_intr_2_var
					scope:imprisoner.var:RE_court_intr_2_var <= 97
				}
			}
			scope:imprisoner = {
				change_variable = {
					name = RE_court_intr_2_var
					add = 3
				}
				RE_axis_recount_intr = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:imprisoner.var:RE_court_intr_2_var
			}
			scope:imprisoner = {
				set_variable = {
					name = RE_court_intr_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_title_gain = {
	on_actions = {
		on_title_gain_RE
	}
}

on_title_gain_RE = {
	effect = {
		if = {
			limit = { scope:title.tier > tier_county } 
			if = {
				limit = { 
					AND = {
						exists = root.var:RE_court_stew_1_var
						root.var:RE_court_stew_1_var <= 95
					}
				}
				root = {
					change_variable = {
						name = RE_court_stew_1_var
						add = 5
					}
					RE_axis_recount_stew = yes
				}
			}
			else_if = {
				limit = { 
					exists = root.var:RE_court_stew_1_var
				}
				root = {
					set_variable = {
						name = RE_court_stew_1_var
						value = 100
					}
				}
			}
			else = {}
		}	
		else = { }
	}
}

on_travel_plan_complete = {
	on_actions = {
		on_travel_plan_complete_RE
	}
}

on_travel_plan_complete_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_lear_2_var
					root.var:RE_court_lear_2_var <= 98
				}
			}
			root = {
				change_variable = {
					name = RE_court_lear_2_var
					add = 2
				}
				RE_axis_recount_lear = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_lear_2_var
			}
			root = {
				set_variable = {
					name = RE_court_lear_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_war_won_attacker = {
	on_actions = {
		on_war_won_attacker_RE
	}
}

on_war_won_attacker_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:attacker.var:RE_court_mart_2_var
					scope:attacker.var:RE_court_mart_2_var >= 5
				}
			}
			scope:attacker = {
				change_variable = {
					name = RE_court_mart_2_var
					add = -5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:attacker.var:RE_court_mart_2_var
			}
			scope:attacker = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 0
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:attacker.var:RE_court_mart_1_var
					scope:attacker.var:RE_court_mart_1_var <= 95
				}
			}
			scope:attacker = {
				change_variable = {
					name = RE_court_mart_1_var
					add = 5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:attacker.var:RE_court_mart_1_var
			}
			scope:attacker = {
				set_variable = {
					name = RE_court_mart_1_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:defender.var:RE_court_mart_2_var
					scope:defender.var:RE_court_mart_2_var <= 95
				}
			}
			scope:defender = {
				change_variable = {
					name = RE_court_mart_2_var
					add = 5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:defender.var:RE_court_mart_2_var
			}
			scope:defender = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_war_won_defender = {
	on_actions = {
		on_war_won_defender_RE
	}
}

on_war_won_defender_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:attacker.var:RE_court_mart_2_var
					scope:attacker.var:RE_court_mart_2_var <= 97
				}
			}
			scope:attacker = {
				change_variable = {
					name = RE_court_mart_2_var
					add = 3
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:attacker.var:RE_court_mart_2_var
			}
			scope:attacker = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:defender.var:RE_court_mart_2_var
					scope:defender.var:RE_court_mart_2_var >= 10
				}
			}
			scope:defender = {
				change_variable = {
					name = RE_court_mart_2_var
					add = -10
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:defender.var:RE_court_mart_2_var
			}
			scope:defender = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 0
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:defender.var:RE_court_mart_1_var
					scope:defender.var:RE_court_mart_1_var >= 5
				}
			}
			scope:defender = {
				change_variable = {
					name = RE_court_mart_1_var
					add = -5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:defender.var:RE_court_mart_1_var
			}
			scope:defender = {
				set_variable = {
					name = RE_court_mart_1_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_war_white_peace = {
	on_actions = {
		on_war_white_peace_RE
	}
}

on_war_white_peace_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:attacker.var:RE_court_mart_2_var
					scope:attacker.var:RE_court_mart_2_var <= 95
				}
			}
			scope:attacker = {
				change_variable = {
					name = RE_court_mart_2_var
					add = 5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:attacker.var:RE_court_mart_2_var
			}
			scope:attacker = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 100
				}
			}
		}
		else = {}
		
		if = {
			limit = { 
				AND = {
					exists = scope:defender.var:RE_court_mart_2_var
					scope:defender.var:RE_court_mart_2_var >= 5
				}
			}
			scope:defender = {
				change_variable = {
					name = RE_court_mart_2_var
					add = -5
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:defender.var:RE_court_mart_2_var
			}
			scope:defender = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 0
				}
			}
		}
		else = {}
	}
}

on_war_invalidated = {
	on_actions = {
		on_war_invalidated_RE
	}
}


on_war_invalidated_RE = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = scope:attacker.var:RE_court_mart_2_var
					scope:attacker.var:RE_court_mart_2_var <= 90
				}
			}
			scope:attacker = {
				change_variable = {
					name = RE_court_mart_2_var
					add = 10
				}
				RE_axis_recount_mart = yes
			}
		}
		else_if = {
			limit = { 
				exists = scope:attacker.var:RE_court_mart_2_var
			}
			scope:attacker = {
				set_variable = {
					name = RE_court_mart_2_var
					value = 100
				}
			}
		}
		else = {}
	}
}

on_join_war_as_secondary = {
	on_actions = {
		on_join_war_as_secondary_RE
	}
}

on_join_war_as_secondary_RE = {
	effect = {
		if = {
			limit = {
				scope:war = {
					is_attacker = root
				}
			}
			if = {
				limit = { 
					AND = {
						exists = root.var:RE_court_mart_1_var
						root.var:RE_court_mart_1_var <= 95
					}
				}
				root = {
					change_variable = {
						name = RE_court_mart_1_var
						add = 5
					}
					RE_axis_recount_mart = yes
				}
			}
			else_if = {
				limit = { 
					exists = root.var:RE_court_mart_1_var
				}
				root = {
					set_variable = {
						name = RE_court_mart_1_var
						value = 5
					}
				}
			}
			else = {}
		}
		else = {
			if = {
				limit = { 
					AND = {
						exists = root.var:RE_court_mart_1_var
						root.var:RE_court_mart_1_var >= 5
					}
				}
				root = {
					change_variable = {
						name = RE_court_mart_1_var
						add = -5
					}
					RE_axis_recount_mart = yes
				}
			}
			else_if = {
				limit = { 
					exists = root.var:RE_court_mart_1_var
				}
				root = {
					set_variable = {
						name = RE_court_mart_1_var
						value = 0
					}
				}
			}
			else = {}
		}
	}
}


on_county_faith_change = {
	on_actions = {
		on_county_faith_change_RE
	}
}

on_county_faith_change_RE = {
	effect = {
		if = {
			limit = { holder.faith = root.faith }		
			if = {
				limit = { 
					AND = {
						exists = holder.var:RE_court_stew_2_var
						holder.var:RE_court_stew_2_var <= 95
					}
				}
				holder = {
					change_variable = {
						name = RE_court_stew_2_var
						add = 5
					}
					RE_axis_recount_stew = yes
				}
			}
			else_if = {
				limit = { 
					exists = holder.var:RE_court_stew_2_var
				}
				holder = {
					set_variable = {
						name = RE_court_stew_2_var
						value = 100
					}
				}
			}
			else = {}
		}
	}
}

on_county_culture_change = {
	on_actions = {
		on_county_culture_change_RE
	}
}

on_county_culture_change_RE = {
	effect = {
		if = {
			limit = { holder.culture = root.culture }		
			if = {
				limit = { 
					AND = {
						exists = holder.var:RE_court_stew_2_var
						holder.var:RE_court_stew_2_var <= 95
					}
				}
				holder = {
					change_variable = {
						name = RE_court_stew_2_var
						add = 5
					}
					RE_axis_recount_stew = yes
				}
			}
			else_if = {
				limit = { 
					exists = holder.var:RE_court_stew_2_var
				}
				holder = {
					set_variable = {
						name = RE_court_stew_2_var
						value = 100
					}
				}
			}
			else = {}
		}
	}
}

on_prestige_level_gain = {
	on_actions = {
		on_prestige_level_gain_RE
	}
}


on_prestige_level_gain_RE  = {
	effect = {
		if = {
			limit = { 
				AND = {
					exists = root.var:RE_court_stew_1_var
					root.var:RE_court_stew_1_var <= 95
				}
			}
			root = {
				change_variable = {
					name = RE_court_stew_1_var
					add = 5
				}
				RE_axis_recount_stew = yes
			}
		}
		else_if = {
			limit = { 
				exists = root.var:RE_court_stew_1_var
			}
			root = {
				set_variable = {
					name = RE_court_stew_1_var
					value = 100
				}
			}
		}
		else = {}
	}
}

three_year_playable_pulse = {
	effect = {
		if = {
			limit = {
				has_royal_court = yes
				is_ai = no
			}
			if = {
				limit = { has_court_type = court_diplomatic }
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = -4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_1_var
							root.var:RE_court_diplo_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_1_var
							add = 4
						}
					}
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = -6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_diplo_2_var
							root.var:RE_court_diplo_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_diplo_2_var
							add = 3
						}
					}
				}
				RE_axis_recount_diplo = yes
			}
			if = {
				limit = { has_court_type = court_warlike }
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = -6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 9
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_1_var
							root.var:RE_court_mart_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_1_var
							add = 3
						}
					}
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 4
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_mart_2_var
							root.var:RE_court_mart_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_mart_2_var
							add = 2
						}
					}
				}
				RE_axis_recount_mart = yes
			}
			if = {
				limit = { has_court_type = court_administrative }
				if = {
					
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -1
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 6
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_1_var
							root.var:RE_court_stew_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_1_var
							add = 6
						}
					}
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = -2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_stew_2_var
							root.var:RE_court_stew_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_stew_2_var
							add = 6
						}
					}
				}
				RE_axis_recount_stew = yes
			}
			if = {
				limit = { has_court_type = court_intrigue }
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = -7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 7
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_1_var
							root.var:RE_court_intr_1_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_1_var
							add = 3
						}
					}
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var >= 60
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 8
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_intr_2_var
							root.var:RE_court_intr_2_var <= 40
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_intr_2_var
							add = 4
						}
					}
				}
				RE_axis_recount_intr = yes
			}
			if = {
				limit = { has_court_type = court_scholarly }
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 50
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 50
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var >= 80
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 20
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 3
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 20
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 20
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 20
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 20
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_1_var
							root.var:RE_court_lear_1_var <= 50
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_1_var
							add = 10
						}
					}
				}
				if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 80
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 50
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 50
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 50
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -10
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 80
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 80
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var >= 80
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = -5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_bellicose }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_bureaucratic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_courtly }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 2
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_communal }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_egalitarian }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_spiritual}
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				else_if = { 
					limit = { 
						AND = {
							exists = root.var:RE_court_lear_2_var
							root.var:RE_court_lear_2_var <= 20
							root.culture = { has_cultural_pillar = ethos_stoic }
						}
					}
					root = {
						change_variable = {
							name = RE_court_lear_2_var
							add = 5
						}
					}
				}
				RE_axis_recount_lear = yes
			}
		}
	}
}


