VAT_curia_bop = {
	VAT_pope_speech_curia = {
		icon = GFX_decision_generic_speech
		allowed = {
			original_tag = VAT
		}
		visible = {
			OR = {
				has_completed_focus = VAT_loyal_to_the_pope_vicars
				AND = {
					has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
					OR = {
						var:current_pope = { is_character = VAT_Stefan_X }
						var:current_pope = { is_character = VAT_Benedict_XVI }
					}
				}
			}
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		available = {
			VAT_Conclave = {
				is_country_leader = no
			}
		}
		cost = 30
		days_remove = 10
		days_re_enable = 75
		remove_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.1
					tooltip_side = vat_traditionalists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.1
					tooltip_side = vat_reformists_side
				}
			}
			VAT_update_curia_gui = yes
		}
		modifier = {
			political_power_gain = -0.15
		}
	}
	VAT_secretary_speech_curia = {
		icon = GFX_decision_generic_speech
		allowed = {
			original_tag = VAT
		}
		visible = {
			has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
			NOT = {
				var:current_pope = { is_character = VAT_Stefan_X }
				var:current_pope = { is_character = VAT_Benedict_XVI }
			}
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		available = {
			VAT_Conclave = {
				is_country_leader = no
			}
		}
		cost = 30
		days_remove = 10
		days_re_enable = 75
		remove_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.1
					tooltip_side = vat_traditionalists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.1
					tooltip_side = vat_reformists_side
				}
			}
			VAT_update_curia_gui = yes
		}
		modifier = {
			political_power_gain = -0.15
		}
	}
	VAT_small_lobbyng_of_cardinals = {
		icon = GFX_decision_eng_propaganda_campaigns
		allowed = {
			original_tag = VAT
		}
		visible = {
			OR = {
				has_completed_focus = VAT_loyal_to_the_pope_vicars
				has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
			}
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		cost = 25
		days_remove = 30
		days_re_enable = 20
		remove_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.05
					tooltip_side = vat_traditionalists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.05
					tooltip_side = vat_reformists_side
				}
			}
			VAT_update_curia_gui = yes
		}
		modifier = {
			political_power_gain = -0.1
		}
	}
	VAT_medium_lobbyng_of_cardinals = {
		icon = GFX_decision_generic_civil_support
		allowed = {
			original_tag = VAT
		}
		visible = {
			OR = {
				has_completed_focus = VAT_loyal_to_the_pope_vicars
				has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
			}
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		cost = 40
		days_remove = 30
		days_re_enable = 45
		remove_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.07
					tooltip_side = vat_traditionalists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.07
					tooltip_side = vat_reformists_side
				}
			}
			VAT_update_curia_gui = yes
		}
		modifier = {
			political_power_gain = -0.25
		}
	}

	VAT_curia_debug_decision_add_10_to_traditionalists = {
		icon = GFX_decision_generic_prepare_civil_war
		allowed = {
			original_tag = VAT
		}
		visible = {
			is_debug = yes
		}
		cost = 0
		ai_will_do = {
			base = 0
		}
		complete_effect = {
			add_power_balance_value = {
				id = VAT_curia_bop
				value = 0.1
				tooltip_side = vat_traditionalists_side
			}
			VAT_update_curia_gui = yes
		}
	}
	VAT_curia_debug_decision_add_10_to_reformists = {
		icon = GFX_decision_generic_prepare_civil_war
		allowed = {
			original_tag = VAT
		}
		visible = {
			is_debug = yes
		}
		cost = 0
		ai_will_do = {
			base = 0
		}
		complete_effect = {
			add_power_balance_value = {
				id = VAT_curia_bop
				value = -0.1
				tooltip_side = vat_reformists_side
			}
			VAT_update_curia_gui = yes
		}
	}

	VAT_luigi_sturzo_actions_mission = {
		available = {
			power_balance_value = {
				id = VAT_curia_bop
				value > 0.89
			}
		}
		activation = {
			always = no
		}
		icon = GFX_decision_generic_political_discourse
		days_mission_timeout = 40
		is_good = yes
		timeout_effect = {	
			random_list = {
				50 = {
					add_power_balance_value = {
						id = VAT_curia_bop
						value = -0.05
						tooltip_side = vat_reformists_side
					}
				}
				30 = {
					add_power_balance_value = {
						id = VAT_curia_bop
						value = -0.03
						tooltip_side = vat_reformists_side
					}
				}
				20 = {
					add_power_balance_value = {
						id = VAT_curia_bop
						value = -0.07
						tooltip_side = vat_reformists_side
					}
				}
			}
			VAT_update_curia_gui = yes
			hidden_effect = {
				activate_mission = VAT_luigi_sturzo_actions_mission
			}
		}
	}

	VAT_curia_action_of_oposition = {
		icon = GFX_decision_generic_political_rally
		available = {
			OR = {
				power_balance_value = {
					id = VAT_curia_bop
					value > 0.89
				}
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		activation = {
			OR = {
				has_completed_focus = VAT_loyal_to_the_pope_vicars
				has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
			}
		}
		is_good = no
		days_mission_timeout = 60
		timeout_effect = {
			random_list = {
				45 = {
					if = {
						limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = -0.05
							tooltip_side = vat_reformists_side
						}
					}
					else_if = {
						limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = 0.05
							tooltip_side = vat_traditionalists_side
						}
					}
				}
				35 = {
					if = {
						limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = -0.07
							tooltip_side = vat_reformists_side
						}
					}
					else_if = {
						limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = 0.07
							tooltip_side = vat_traditionalists_side
						}
					}
				}
				20 = {
					if = {
						limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = -0.03
							tooltip_side = vat_reformists_side
						}
					}
					else_if = {
						limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
						add_power_balance_value = {
							id = VAT_curia_bop
							value = 0.03
							tooltip_side = vat_traditionalists_side
						}
					}
				}
			}
			

			VAT_update_curia_gui = yes
			
			hidden_effect = {
				activate_mission = VAT_curia_action_of_oposition
			}
		}
	}
}

VAT_curia = {
	VAT_expand_budget_in_civilian_sector = {
		icon = GFX_decision_generic_factory
		allowed = {
			original_tag = VAT
		}
		available = {
			NOT = { has_decision = VAT_expand_budget_in_arms_sector }
			has_completed_focus = VAT_revision_of_economic_financing
		}
		visible = {
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		cost = 35
		days_remove = 90
		days_re_enable = 90
		complete_effect = {
			custom_effect_tooltip = vat_several_cardinals_will_go_into_opposition
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.05
					tooltip_side = vat_reformists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.05
					tooltip_side = vat_traditionalists_side
				}
			}
			VAT_update_curia_gui = yes
		}
		modifier = {
			political_power_gain = -0.05
			consumer_goods_factor = 0.05
			production_speed_buildings_factor = 0.05
			production_speed_industrial_complex_factor = 0.05
			monthly_population = 0.05
		}
	}
	VAT_expand_budget_in_arms_sector = {
		icon = GFX_decision_generic_merge_plant_tank
		allowed = {
			original_tag = VAT
		}
		available = {
			NOT = { has_decision = VAT_expand_budget_in_civilian_sector }
			has_completed_focus = VAT_revision_of_economic_financing
		}
		visible = {
			NOT = {
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		cost = 35
		days_remove = 90
		days_re_enable = 90
		complete_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.05
					tooltip_side = vat_reformists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.05
					tooltip_side = vat_traditionalists_side
				}
			}
		}
		modifier = {
			political_power_gain = -0.05
			consumer_goods_factor = 0.05
			production_speed_arms_factory_factor = 0.05
			production_factory_efficiency_gain_factor = 0.05
			production_factory_max_efficiency_factor = 0.05
		}
	}
	VAT_listen_to_representative_of_national_minorities = {
		icon = GFX_decision_generic_political_discourse
		allowed = {
			original_tag = VAT
		}
		available = {
			NOT = { has_decision = VAT_listen_to_representative_of_military_command }
			has_completed_focus = VAT_god_created_us_free
		}
		visible = {
			NOT = {
				has_completed_focus = VAT_loyal_to_the_pope_vicars
				has_completed_focus = VAT_the_new_democratic_curia
				has_completed_focus = VAT_rebuild_the_roman_curia
			}
		}
		cost = 35
		days_remove = 30
		days_re_enable = 50
		complete_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.05
					tooltip_side = vat_reformists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.05
					tooltip_side = vat_traditionalists_side
				}
			}
		}
		modifier = {
			political_power_gain = -0.05
			war_support_factor = -0.03
			compliance_growth = 0.05
			resistance_target = -0.05
		}
	}
	VAT_listen_to_representative_of_military_command = {
		icon = GFX_decision_generic_army_support #GFX_decision_generic_police_action
		allowed = {
			original_tag = VAT
		}
		available = {
			NOT = { has_decision = VAT_listen_to_representative_of_national_minorities }
			has_completed_focus = VAT_remember_of_cesare_borgia
		}
		visible = {
			NOT = {
				has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
			}
		}
		cost = 35
		days_remove = 30
		days_re_enable = 50
		complete_effect = {
			if = {
				limit = { has_completed_focus = VAT_loyal_to_the_pope_vicars }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.05
					tooltip_side = vat_reformists_side
				}
			}
			else_if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.05
					tooltip_side = vat_traditionalists_side
				}
			}
		}
		modifier = {
			stability_factor = -0.03
			war_support_factor = 0.05
			army_org_factor = 0.05
			army_org_regain = 0.05
			command_abilities_cost_factor = -0.05
		}
	}
}

VAT_curia_laws = {
	vat_debug_laws = {
		visible = {is_debug = yes}
		complete_effect = {
			resize_array = {
				array = vat_curia_law_vote_frames
				size = 70
				value = 2
			}

			set_temp_variable = {
				sl_v = 1
			}
			custom_effect_tooltip = vat_bill_law
			hidden_effect = {
				set_variable = {                 
					current_law = 1
				}
				set_variable = {
					current_law_pope_vote = 1
				}
				set_variable = {                
					current_law_secretary_vote = 1
				}
				set_variable = {                
					curia_law_vote_value = 50
				}
			}
			VAT_law_initialization = yes
		}
	}
	vat_debug_laws2 = {
		visible = {is_debug = yes}
		complete_effect = {
			resize_array = {
				array = vat_curia_law_vote_frames
				size = 70
				value = 2
			}

			set_temp_variable = {
				sl_v = 3
			}
			custom_effect_tooltip = vat_bill_law
			hidden_effect = {
				set_variable = {                 
					current_law = 3
				}
				set_variable = {
					current_law_pope_vote = 0
				}
				set_variable = {                
					current_law_secretary_vote = 0
				}
				set_variable = {                
					curia_law_vote_value = 30
				}
			}
			VAT_law_initialization = yes
		}
	}
	vat_debug_laws3 = {
		visible = {is_debug = yes}
		complete_effect = {
			set_temp_variable = {
				sl_v = 3
			}
			set_variable = {
				next_opposition_law = 3
			}
			set_temp_variable = {
				sl_v = next_opposition_law
			}
			custom_effect_tooltip = vat_bill_law
			#TODO: сделать условие если законопроект от Папы, то баланс сил на сторону Папы, иначе - на сторону Курии
			hidden_effect = {
				set_variable = {                
					current_law_is_oppisition = 1
				}
				set_variable = {                 
					current_law = next_opposition_law
				}
				set_variable = {
					current_law_pope_vote = 1
				}
				set_variable = {                
					current_law_secretary_vote = 1
				}
				set_variable = {
					curia_law_vote_value = 30
				}
			}
			VAT_law_initialization = yes
		}
	}
	VAT_curia_law_voting_mission = {
		icon = GFX_decision_SWI_no_elected_president
		activation = {
			always = no
		}
		available = {
			hidden_trigger = {
				always = no
			}
		}
		is_good = yes
		days_mission_timeout = 30
		timeout_effect = {
			set_temp_variable = {
				temp_votes = curia_law_vote_value
			}
			add_to_temp_variable = {
				temp_votes = current_law_pope_vote
			}
			add_to_temp_variable = {
				temp_votes = current_law_secretary_vote
			}
			#add pope/secretary votes
			if = {
				limit = {
					VAT_law_can_be_applied = yes
				}
				custom_effect_tooltip = curia_law_voting_mission_passing_tt
				#custom_effect_tooltip = add_curia_law_tt
				#custom_effect_tooltip = add_curia_law_modifiers_tt
				hidden_effect = {
					meta_effect = {
						text = {
							add_ideas = vat_curia_law_idea_[I]
						}
						I = current_law
					}
				}
				#clear law data
				set_variable = {
					current_law = 0
				}
				set_variable = {
					current_law_pope_vote = 0
				}
				set_variable = {
					current_law_secretary_vote = 0
				}
				set_variable = {
					curia_law_vote_value = 0
				}
				set_variable = {                
					current_law_is_oppisition = 0
				}
			}
			else_if = {
				limit = {
					check_variable = {
						curia_law_vote_value = 35
					}
				}
				custom_effect_tooltip = curia_law_voting_mission_additional_voting_tt
				hidden_effect = { activate_mission = VAT_curia_law_additional_voting_mission }
			}
			else = {
				custom_effect_tooltip = curia_law_voting_mission_not_passing_tt
				hidden_effect = {
					if = {
						limit = {
							OR = {
								check_variable = {
									current_law = 10
								}
								check_variable = {
									current_law = 11
								}
							}
						}
						country_event = {
							id = vat_curia.2
						}
					}
					else_if = {
						limit = {
							check_variable = {
								current_law_is_oppisition = 1
							}
						}
						country_event = vat_curia.4
					}
					else = {
						country_event = {
							id = vat_curia.1
						}
					}
				}
			}
			VAT_update_curia_law_gui = yes
		}
	}

	VAT_curia_law_additional_voting_mission = {
		icon = GFX_decision_SWI_no_elected_president
		activation = {
			always = no
		}
		available = {
			hidden_trigger = {
				always = no
			}
		}
		is_good = yes
		days_mission_timeout = 7
		timeout_effect = {
			set_temp_variable = {
				temp_votes = curia_law_vote_value
			}
			add_to_temp_variable = {
				temp_votes = current_law_pope_vote
			}
			add_to_temp_variable = {
				temp_votes = current_law_secretary_vote
			}
			#add pope/secretary votes
			if = {
				limit = {
					VAT_law_can_be_applied = yes
				}
				custom_effect_tooltip = curia_law_voting_mission_passing_tt
				hidden_effect = {
					meta_effect = {
						text = {
							add_ideas = vat_curia_law_idea_[I]
						}
						I = current_law
					}
				}
				#clear law data
				set_variable = {
					current_law = 0
				}
				set_variable = {
					current_law_pope_vote = 0
				}
				set_variable = {
					current_law_secretary_vote = 0
				}
				set_variable = {
					curia_law_vote_value = 0
				}
				set_variable = {                
					current_law_is_oppisition = 0
				}
			}
			else = {
				custom_effect_tooltip = curia_law_voting_mission_not_passing_tt
				hidden_effect = {
					if = {
						limit = {
							OR = {
								check_variable = {
									current_law = 10
								}
								check_variable = {
									current_law = 11
								}
							}
						}
						country_event = {
							id = vat_curia.2
						}
					}
					else_if = {
						limit = {
							check_variable = {
								current_law_is_oppisition = 1
							}
						}
						country_event = vat_curia.4
					}
					else = {
						country_event = {
							id = vat_curia.1
						}
					}
				}
			}
			VAT_update_curia_law_gui = yes
		}
	}

	VAT_action_of_oposition_law = {
		icon = GFX_decision_generic_break_treaty
		activation = {
			check_variable = { current_law > 0 }
		}
		available = {
			check_variable = { current_law = 0 }
		}
		is_good = no
		days_mission_timeout = 7
		timeout_effect = {
			if = {
				limit = {
					VAT_Conclave = {
						is_country_leader = no
					}
				}
				if = {
					limit = {
						check_variable = { current_law_is_oppisition = 0 }
					}
					if = {
						limit = {
							NOT = {
								check_variable = { current_law = 10 }
								check_variable = { current_law = 11 }
							}
						}
						VAT_curia_add_support_law_remove_5 = yes
					}
					else = {
						VAT_curia_add_support_law_remove_3 = yes
					}
				}
				else = {
					VAT_curia_add_support_law_5 = yes
				}
			}
			hidden_effect = {
				activate_mission = VAT_action_of_oposition_law
			}
		}
	}

	VAT_lobbying_for_the_bill = {
		icon = GFX_decision_generic_speech

		allowed = { tag = VAT }
		visible = { 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
		}

		available = {
			NOT = {
				has_decision = VAT_bribe_cardinals
				has_decision = VAT_put_pressure_on_cardinals
			}
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = vat_lobbying_for_the_bill_cost_var #20
		days_remove = 3
		days_re_enable = 6

		modifier = {
			political_power_gain = -0.25
		}

		remove_effect = {
			VAT_curia_add_support_law_5 = yes
		}
	}

	VAT_critisize_the_bill = {
		icon = GFX_decision_generic_speech

		allowed = { tag = VAT }
		visible = { 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 0 } 
			} 
		}

		available = {
			NOT = {
				has_decision = VAT_lobbying_for_the_bill
				has_decision = VAT_put_pressure_on_cardinals
				has_decision = VAT_bribe_cardinals
				has_decision = VAT_support_society_discontent_about_the_law
			}
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = vat_lobbying_for_the_bill_cost_var #20
		days_remove = 3
		days_re_enable = 6

		modifier = {
			political_power_gain = -0.25
		}

		remove_effect = {
			VAT_curia_add_support_law_remove_5 = yes
		}
	}

	VAT_bribe_cardinals = {
		icon = GFX_decision_hol_attract_foreign_investors

		allowed = { tag = VAT }
		visible = { 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
		}

		available = {
			NOT = {
				has_decision = VAT_lobbying_for_the_bill
				has_decision = VAT_put_pressure_on_cardinals
				has_decision = VAT_critisize_the_bill
				has_decision = VAT_support_society_discontent_about_the_law
			}
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = vat_bribe_cardinals_cost_var #30
		days_re_enable = 9

		complete_effect = {
			VAT_curia_add_support_law_6 = yes
		}
	}

	VAT_support_society_discontent_about_the_law = {
		icon = GFX_decision_generic_political_rally

		allowed = { tag = VAT }
		visible = { 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 0 } 
			} 
		}

		available = {
			NOT = {
				has_decision = VAT_lobbying_for_the_bill
				has_decision = VAT_put_pressure_on_cardinals
				has_decision = VAT_critisize_the_bill
				has_decision = VAT_bribe_cardinals
			}
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = vat_bribe_cardinals_cost_var #30
		days_re_enable = 4
		days_remove = 5

		remove_effect = {
			VAT_curia_add_support_law_remove_7 = yes
			if = {
				limit = {
					has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics
				}
				add_popularity = {
					ideology = neutrality
					popularity = -0.02
				}
			}
			else = {
				add_popularity = {
					ideology = democratic
					popularity = -0.02
				}
			}
		}
	}

	VAT_put_pressure_on_cardinals = {
		icon = GFX_decision_generic_political_discourse

		allowed = { tag = VAT }
		visible = { NOT = { check_variable = { current_law = 0 } } }

		available = {
			NOT = {
				has_decision = VAT_lobbying_for_the_bill
				has_decision = VAT_critisize_the_bill
				has_decision = VAT_bribe_cardinals
				has_decision = VAT_support_society_discontent_about_the_law
			}
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = vat_put_pressure_on_cardinals_cost_var #25
		days_re_enable = 12

		complete_effect = {
			if = {
				limit = {
					check_variable = { current_law_is_oppisition = 0 }
				}
				add_to_variable = {
					value = 4
					var = curia_law_vote_value
					tooltip = VAT_curia_add_support_law_4_tt
				}
			}
			else = {
				subtract_from_variable = {
					value = 4
					var = curia_law_vote_value
					tooltip = VAT_curia_remove_support_law_4_tt
				}
			}
			add_stability = -0.02
			VAT_update_curia_law_gui = yes
		}
	}

	VAT_talk_with_pope = {
		icon = GFX_decision_generic_political_discourse

		allowed = { tag = VAT }
		visible = { 
			check_variable = { current_law_pope_vote = 0 } 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
			NOT = { 
				check_variable = { current_law = 10 } 
				check_variable = { current_law = 11 } 
			} 
		}

		available = {
			NOT = { has_decision = VAT_push_on_pope }
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = 20
		days_re_enable = 7

		complete_effect = {
			random_list = {
				40 = {
					set_variable = {
						value = 1
						var = current_law_pope_vote
						tooltip = set_papal_vote_1_tt
					}
				}
				60 = {
				}
			}
		}
	}

	VAT_push_on_pope = {
		icon = GFX_decision_SWI_dismiss_council

		allowed = { tag = VAT }
		visible = { 
			check_variable = { current_law_pope_vote = 0 } 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
			NOT = { 
				check_variable = { current_law = 10 } 
				check_variable = { current_law = 11 } 
			} 
		}

		available = {
			NOT = { has_decision = VAT_talk_with_pope }
			VAT_Conclave = {
				is_country_leader = no
			}
		}

		cost = 35
		days_re_enable = 12

		complete_effect = {
			random_list = {
				60 = {
					set_variable = {
						value = 1
						var = current_law_pope_vote
						tooltip = set_papal_vote_1_tt
					}
				}
				40 = {
				}
			}
			add_stability = -0.04
		}
	}

	VAT_talk_with_secretary = {
		icon = GFX_decision_generic_political_discourse

		allowed = { tag = VAT }
		visible = { 
			check_variable = { current_law_secretary_vote = 0 } 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
			NOT = { 
				check_variable = { current_law = 10 } 
				check_variable = { current_law = 11 } 
			} 
		}

		available = {
			NOT = { has_decision = VAT_push_on_secretary }
		}

		cost = 20
		days_re_enable = 7

		complete_effect = {
			random_list = {
				40 = {
					set_variable = {
						value = 1
						var = current_law_secretary_vote
						tooltip = set_secretary_vote_1_tt
					}
				}
				60 = {
				}
			}
		}
	}

	VAT_push_on_secretary = {
		icon = GFX_decision_SWI_dismiss_council

		allowed = { tag = VAT }
		visible = { 
			check_variable = { current_law_secretary_vote = 0 } 
			NOT = { 
				check_variable = { current_law = 0 } 
				check_variable = { current_law_is_oppisition = 1 } 
			} 
			NOT = { 
				check_variable = { current_law = 10 } 
				check_variable = { current_law = 11 } 
			} 
		}

		available = {
			NOT = { has_decision = VAT_talk_with_secretary }
		}

		cost = 35
		days_re_enable = 12

		complete_effect = {
			random_list = {
				60 = {
					set_variable = {
						value = 1
						var = current_law_secretary_vote
						tooltip = set_secretary_vote_1_tt
					}
				}
				40 = {
				}
			}
			add_stability = -0.04
		}
	}

	VAT_veto_law = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			check_variable = { current_law_is_oppisition = 1 } 
		}

		available = {
			NOT = { has_decision = VAT_talk_with_secretary }
		}

		cost = 75
		days_re_enable = 12

		complete_effect = {
			if = {
				limit = { has_completed_focus = VAT_opposition_to_domination_of_Pope_in_politics }
				add_power_balance_value = {
					id = VAT_curia_bop
					value = 0.07
					tooltip_side = vat_traditionalists_side
				}
				add_popularity = {
					ideology = democratic
					popularity = -0.05
				}
				VAT_veto_by_reformists = yes
			}
			else = {
				add_power_balance_value = {
					id = VAT_curia_bop
					value = -0.07
					tooltip_side = vat_reformists_side
				}
				add_popularity = {
					ideology = neutrality
					popularity = -0.05
				}
				VAT_veto_by_traditionalists = yes
			}
		}
	}


	### OPPOSITION LAWS 
	VAT_curia_law_opposition_suggest = {
		icon = GFX_decision_eng_trade_unions_support
		activation = {
			always = no
		}
		available = {
			hidden_trigger = {
				always = no
			}
		}

		is_good = no
		days_mission_timeout = 45

		timeout_effect = {
			set_temp_variable = {
				sl_v = next_opposition_law
			}
			custom_effect_tooltip = vat_bill_law
			#TODO: сделать условие если законопроект от Папы, то баланс сил на сторону Папы, иначе - на сторону Курии
			hidden_effect = {
				set_variable = {                
					current_law_is_oppisition = 1
				}
				set_variable = {                 
					current_law = next_opposition_law
				}
				set_variable = {
					current_law_pope_vote = 1
				}
				set_variable = {                
					current_law_secretary_vote = 1
				}
				set_variable = {
					curia_law_vote_value = 30
				}
				country_event = vat_curia.5
			}
			VAT_law_initialization = yes
		}
	}

	VAT_curia_conservators_demand_strengthen_of_papal_guard = {
		icon = GFX_decision_SWI_consolidate_council_power
		activation = {
			always = no
		}
		available = {
			has_completed_focus = VAT_formation_of_papal_guard
			#VAT_can_introduce_a_bill = yes
		}

		is_good = no
		days_mission_timeout = 50

		timeout_effect = {
			complete_national_focus = VAT_formation_of_papal_guard
			add_power_balance_value = {
				id = VAT_curia_bop
				value = 0.07
				tooltip_side = vat_traditionalists_side
			}
		}

		complete_effect = {
			add_power_balance_value = {
				id = VAT_curia_bop
				value = -0.05
				tooltip_side = vat_reformists_side
			}
		}
	}

	VAT_cancel_state_censorship = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			has_completed_focus = VAT_god_created_us_free
			has_idea = vat_curia_law_idea_5
			check_variable = { current_law = 0 }
		}

		available = {
			VAT_can_introduce_a_bill = yes
		}

		cost = 75
		days_remove = 30

		remove_effect = {
			remove_ideas = vat_curia_law_idea_5
			custom_effect_tooltip = generic_skip_one_line_tt
		}
	}


	#CANCEL OPPOSITION LAWS
	VAT_cancel_law_reformed_papal_police = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			has_completed_focus = VAT_era_dictatorship_pontificate
			has_idea = vat_curia_law_idea_3
			check_variable = { current_law = 0 }
		}

		available = {
			has_completed_focus = VAT_formation_of_papal_guard
			VAT_can_introduce_a_bill = yes
		}

		cost = 75
		days_remove = 30

		remove_effect = {
			add_stability = -0.07
			remove_ideas = vat_curia_law_idea_3

			custom_effect_tooltip = generic_skip_one_line_tt

			if = {
				limit = { 
					NOT = { has_dynamic_modifier = { modifier = VAT_papal_guard } } 
				}
				custom_effect_tooltip = formation_of_papal_guard_tt
				hidden_effect = {
					add_dynamic_modifier = {
						modifier = VAT_papal_guard
					}
				}
				custom_effect_tooltip = generic_skip_one_line_tt
			}

			custom_effect_tooltip = vat_curia_law_idea_6_effect
			hidden_effect = {
				add_ideas = vat_curia_law_idea_6
			}
		}
	}
	VAT_cancel_law_priority_to_small_business = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			has_completed_focus = VAT_era_dictatorship_pontificate
			has_country_flag = VAT_priority_to_small_business_passed
			check_variable = { current_law = 0 }
		}

		available = {
			has_dynamic_modifier = {
				modifier = VAT_economics_of_the_vatican
			}
			VAT_can_introduce_a_bill = yes
		}

		cost = 75
		days_remove = 30

		remove_effect = {
			add_stability = -0.07
			set_temp_variable = {
				sl_v = 9
			}
			custom_effect_tooltip = vat_bill_law_cancel
			
			clr_country_flag = VAT_priority_to_small_business_passed
			add_to_variable = {
				papacy_economic_political_power_factor_var = -0.03
			}
			add_to_variable = {
				papacy_economic_production_industrial_concern_cost_factor_var = -0.1
			}
			add_to_variable = {
				papacy_economic_stability_factor_var = -0.03
			}
			add_to_variable = {
				papacy_economic_production_speed_buildings_factor_var = -0.07
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			hidden_effect = {
				add_ideas = vat_curia_law_idea_7
				set_country_flag = VAT_priority_to_big_industrialists_passed
			}
			custom_effect_tooltip = vat_curia_law_idea_7_effect
		}
	}

	VAT_cancel_law_papal_guard_terror = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			has_completed_focus = VAT_redistribution_of_executive_power
			has_country_flag = VAT_papal_guard_terror_passed
			check_variable = { current_law = 0 }
		}

		available = {
			VAT_can_introduce_a_bill = yes
		}

		cost = 45
		days_remove = 45

		remove_effect = {
			set_temp_variable = {
				sl_v = 6
			}
			custom_effect_tooltip = vat_bill_law_cancel

			clr_country_flag = VAT_papal_guard_terror_passed
			add_to_variable = {
				var = papal_guard_pp_var
				value = -0.07
			}
			add_to_variable = {
				var = papal_guard_resistance_target_var
				value = 0.05
			}
			add_to_variable = {
				var = papal_guard_compliance_growth_var
				value = 0.05
			}
			add_to_variable = {
				var = papal_guard_stability_var
				value = 0.05
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			set_temp_variable = {
				sl_v = 3
			}
			custom_effect_tooltip = vat_bill_law
			hidden_effect = {
				set_variable = {                 
					current_law = 3
				}
				set_variable = {                
					curia_law_vote_value = 35
				}
				set_variable = {
					current_law_pope_vote = 1
				}
				set_variable = {
					current_law_secretary_vote = 1
				}
			}
			VAT_law_initialization = yes
		}
	}
	VAT_cancel_law_priority_to_big_industry = {
		icon = GFX_decision_generic_break_treaty

		allowed = { tag = VAT }
		visible = { 
			has_completed_focus = VAT_redistribution_of_executive_power
			has_country_flag = VAT_priority_to_big_industrialists_passed
			check_variable = { current_law = 0 }
		}

		available = {
			has_dynamic_modifier = {
				modifier = VAT_economics_of_the_vatican
			}
			VAT_can_introduce_a_bill = yes
		}

		cost = 45
		days_remove = 45

		remove_effect = {
			set_temp_variable = {
				sl_v = 7
			}
			custom_effect_tooltip = vat_bill_law_cancel

			clr_country_flag = VAT_priority_to_big_industrialists_passed
			add_to_variable = {
				papacy_economic_political_power_factor_var = -0.05
			}
			add_to_variable = {
				papacy_economic_consumer_goods_factor_var = 0.05
			}

			custom_effect_tooltip = generic_skip_one_line_tt

			set_temp_variable = {
				sl_v = 9
			}
			custom_effect_tooltip = vat_bill_law
			hidden_effect = {
				set_variable = {                 
					current_law = 9
				}
				set_variable = {                
					curia_law_vote_value = 30
				}
				set_variable = {
					current_law_pope_vote = 1
				}
				set_variable = {
					current_law_secretary_vote = 1
				}
			}
			VAT_law_initialization = yes
		}
	}
}