﻿### EOTM lifestyle auto-spend important action overrides.
### These mirror vanilla lifestyle perk-point alerts and suppress only the
### right-side alert while EOTM auto-spend is enabled for the current player.

action_can_spend_perk_point = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_any_focus = yes
				NOR = {
					has_focus_intrigue = yes
					has_focus_diplomacy = yes
					has_focus_learning = yes
					has_focus_martial = yes
					has_focus_stewardship = yes
					has_focus_wanderer = yes
				}
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_can_spend_perk_point
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_diplo = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_diplomacy = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_diplo
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_intrigue = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_intrigue = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_intrigue
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_learning = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_learning = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_learning
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_martial = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_martial = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_martial
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_stewarship = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_stewardship = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_stewarship
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

action_lifestyle_wanderer = {
	type = alert
	check_create_action = {
		if = {
			limit = {
				NOT = { has_character_flag = eotm_lifestyle_auto_spend_alerts_hidden }
				has_focus_wanderer = yes
				perk_points > 0
				is_adult = yes
			}
			try_create_important_action = {
				important_action_type = action_lifestyle_wanderer
				actor = root
			}
		}
	}

	effect = {
		scope:actor = {
			open_view_data = {
				view = lifestyle
			}
		}
	}
}

