﻿mi_rival_ruler = {

	on_other_nation = no
	on_own_nation = yes
	
	sound = "event:/SFX/UI/Character/sfx_ui_character_imprison"
	
	potential_trigger = {
		hidden:scope:actor = {
			is_ai = no
		}
		hidden:scope:target = {
			custom_tooltip = {
				text = ""
				is_alive = yes
				NOT = {
					is_rival = scope:actor.current_ruler
				}
			}
		}
	}
	
	allowed_trigger = {
		hidden:scope:actor = {
			can_pay_price = price_add_rival
		}
		scope:target = {
			NOT = {
				this = scope:actor.current_ruler
			}
			NOT = {
				is_friend = scope:actor.current_ruler
			}
			NOT = {
				is_rival = scope:actor.current_ruler
			}
		}
		scope:actor.current_ruler = {
			can_get_rivals = yes
		}
		custom_tooltip = {
			text = mi_rival_once_a_month
			scope:actor.current_ruler = {
				NOT = {
					has_variable = mi_rival_with_rival
				}
			}
		}
	}
	
	effect = {
		scope:actor.current_ruler = {
			set_variable = {
				name = mi_rival_with_rival
				days = 30
			}
		}
		custom_tooltip = current_ruler_rival_with_taget
		scope:actor = {
			pay_price = price_add_rival
			trigger_event = {
				on_action = custom_on_action_mi_rival
				days = { 5 15 }
			}
		}
	}
	
}	

mi_derival_ruler = {

	on_other_nation = no
	on_own_nation = yes
	
	sound = "event:/SFX/UI/Character/sfx_ui_character_give_free_hands"
	
	potential_trigger = {
		hidden:scope:actor = {
			is_ai = no
		}
		hidden:scope:target = {
			custom_tooltip = {
				text = ""
				is_alive = yes
				is_rival = scope:actor.current_ruler
			}
		}
	}
	
	allowed_trigger = {
		hidden:scope:actor = {
			can_pay_price = price_remove_rival
		}
		scope:target = {
			NOT = {
				this = scope:actor.current_ruler
			}
			is_rival = scope:actor.current_ruler
		}
		custom_tooltip = {
			text = mi_derival_once_a_month
			scope:actor.current_ruler = {
				NOT = {
					has_variable = mi_derival_with_rival
				}
			}
		}
	}
	
	effect = {
		scope:actor.current_ruler = {
			set_variable = {
				name = mi_derival_with_rival
				days = 30
			}
		}
		custom_tooltip = current_ruler_derival_with_taget
		scope:actor = {
			pay_price = price_remove_rival
			trigger_event = {
				on_action = custom_on_action_mi_derival
				days = { 10 20 }
			}
		}
	}
}