# INSTRUCTIONS:
# -------------
# constructing_cb - default to yes. if "no", cant be picked for generation or as add_wargoal if no CB already
# is_triggered_only - Triggered from within the code or by event effects. DO NOT REMOVE THE STOCK ONES.
# mutual - The CB effects will also be used by the defender in peace treaties
# months - The number of months this CB will be valid. Only works for triggered CBs.
# prerequisites - A condition that automatically activates a CB. Does not work for triggered CBs. 'THIS' scope is the target country.
# badboy_factor - Multiplied with any badboy increase normally associated with a peace option.
# prestige_factor - Multiplied with any prestige increase normally associated with a peace option.
# peace_cost_factor - Multiplied with the cost of the peace options in the peace treaty
# po_xxx - Peace options. If toggled on, badboy_factor and prestige_factor are multiplied with any associated base changes to these (see defines.txt.)
# allowed_states - If 'po_demand_states' is on, badboy_factor applies to these provinces. 'THIS' scope is us.
# on_add - effect triggered when war goal added (triggering country's scope)
# construction_speed - base modifier for how long creating this CB will take. default is 1. 1.2 means 20% faster
# great_war_obligatory - cb is always added to the peace offer/demand in great wars.
# po_remove_cores - may be used only with: po_transfer_provinces, po_demand_state, po_annex
# crisis - can be offered as a wargoal in a crisis
#
# The peace options are:
#po_annex
#po_demand_state
#po_add_to_sphere
#po_disarmament
#po_reparations
#po_transfer_provinces
#po_remove_prestige
#po_make_puppet
#po_release_puppet
#po_status_quo
#po_install_communist_gov_type
#po_uninstall_communist_gov_type
#po_remove_cores
#po_colony

# NOTE: The order in which the peace options are listed is the order in which the AI will normally prioritize them in peace treaties

# TRIGGERED - Triggered from within the code or by event effects
# --------------------------------------------------------------

# Order that CBs are executed in a peace treaty
peace_order = { 
add_to_sphere 
take_from_sphere 
status_quo 
demand_reperations
gunboat 
conquest 
conquest_low
civil_war 
acquire_core_state 
annex_core_country
dismantle_cb
acquire_state 
take_capital
acquire_substate_region
dismantle_cb
acquire_all_cores_usa
place_in_the_sun
colonial_competition
treaty_port_casus_belli
cut_down_to_size_boxer
cut_down_to_size 
free_peoples
liberate_country
release_puppet
become_independent
make_puppet
dismantle_forts
humiliate
demand_concession_casus_belli
establish_protectorate_casus_belli
unification_humiliate_cb
unification_release_puppet_cb
unification_casus_belli
unification_annex_casus_belli
rude_boy
annex
install_communist_gov_cb
uninstall_communist_gov_cb
great_war_penalty_cb 
take_parts_mandates
annex_mandates
}

gunboat = {
	sprite_index = 1
	is_triggered_only = yes
	months = 12
	constructing_cb = no
	crisis = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		OR =
		{
			has_country_modifier = in_bankrupcy
			has_country_modifier = generalised_debt_default
		}
		
		THIS = {
			NOT = {
                		has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	break_truce_prestige_factor = 0
	break_truce_infamy_factor = 0
	break_truce_militancy_factor = 0
	truce_months = 60
	
	badboy_factor = 1
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_gunboat = yes
	
	war_name = WAR_GUNBOAT_NAME
}

status_quo = {
	sprite_index = 1
	is_triggered_only = yes
	months = 12
	constructing_cb = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		always = no
	}

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_status_quo = yes
	
	war_name = WAR_NAME
}

# Conquest
conquest = {
	sprite_index = 2
	is_triggered_only = yes
	months = 12
	crisis = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		# only one state or unciv
		NOT = { number_of_states = 5 }
		OR = {
			AND = {
				civilized = yes
				NOT = { number_of_states = 2 }
			}
			AND = {
				civilized = no
				THIS = { civilized = no }
				NOT = { number_of_states = 2 }
			}
			AND = {
				civilized = no
				number_of_states = 2
				THIS = {
					OR = {
						NOT = { is_greater_power = yes }
						NOT = { nationalism_n_imperialism = 1 }
					}
				}
			}
		}
		is_independant = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	badboy_factor = 1.8
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	construction_speed = 0.5
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_annex = yes
	
	war_name = WAR_CONQUEST_NAME
}

# Civil war
civil_war = {
	sprite_index = 20
	is_triggered_only = yes
	months = 1
	constructing_cb = no
	crisis = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		always = no
	}

	badboy_factor = 0
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1
	is_civil_war = yes #this is a civil war

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	po_annex = yes
	
	war_name = CIVIL_WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Sphere of Influence Gain
add_to_sphere = {
	sprite_index = 3
	is_triggered_only = yes
	months = 6
	crisis = no

	badboy_factor = 0.5
	prestige_factor = 2
	peace_cost_factor = 50
	penalty_factor = 1

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		this = { is_greater_power = yes }
		is_greater_power = no
		is_independant = yes
		part_of_sphere = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	is_valid = {
		this = { is_greater_power = yes }
		is_greater_power = no
	}
	
	po_add_to_sphere = yes
	
	war_name = WAR_ADD_SPHERE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

take_from_sphere = {
	sprite_index = 4
	is_triggered_only = yes
	months = 6
	
	badboy_factor = 2
	prestige_factor = 3
	peace_cost_factor = 20
	penalty_factor = 1

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		this = { is_greater_power = yes }
		is_greater_power = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	
	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
		is_sphere_leader_of = FROM
		OR = {
			FROM = { is_vassal = no }
			THIS = { is_our_vassal = FROM }
		}
	}
	
	po_add_to_sphere = yes
	
	war_name = WAR_TAKE_SPHERE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}	

# Acquire Core State
acquire_core_state = {
	sprite_index = 5
	is_triggered_only = yes
	months = 12
	
	construction_speed = 0.8
	
	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 0.7
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		number_of_states = 2 # annex if you want their last state
		any_owned_province = {
			is_core = THIS
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	allowed_states = {
		any_owned_province = {
			is_core = THIS
		}
		not = { any_owned_province = { is_capital = yes } }
	}

	po_demand_state = yes
	
	war_name = WAR_TAKE_CORE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	on_po_accepted = {
	country_event =	2650	# Territorial Loss event
	}

}

# Annex Core Country
annex_core_country = {
	sprite_index = 5
	is_triggered_only = yes
	months = 12
	crisis = no

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 0.7
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		any_owned_province = {
			is_core = THIS
		}
		NOT = {
			any_owned_province = {
				NOT = {
					is_core = THIS
				}
			}
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	po_annex = yes
	
	war_name = WAR_RESTORE_ORDER_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Gain control of Substate region
acquire_substate_region = {
	sprite_index = 6
	is_triggered_only = yes
	months = 12
	construction_speed = 0.5
	crisis = no
	
	badboy_factor = 1
	prestige_factor = 2
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS
				tag = CHI}
		num_of_substates = 1 # if has any substate
		any_substate = {
			number_of_states = 1
			any_owned_province = {
				not = { is_core = THIS }
				is_colonial = no
			}
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	allowed_substate_regions = {
		is_colonial = no
		owner = { NOT = { in_sphere = THIS } }
		any_owned_province = {
			not = {	is_core = THIS }
			is_colonial = no
		}
	}

	po_demand_state = yes
	
	war_name = WAR_TAKE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}


# Gain control of State
acquire_state = {
	sprite_index = 6
	is_triggered_only = yes
	months = 6
	construction_speed = 0.5
	
	badboy_factor = 2
	prestige_factor = 2
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		number_of_states = 2 # annex if you want their last state
		any_owned_province = {
			not = { is_core = THIS }
			is_colonial = no
		}
		OR = {
			AND = {
				civilized = yes
				THIS = {
					civilized = yes
				}
			}
			AND = {
				civilized = no
				THIS = {
					civilized = no
				}
			}
		}
		is_independant = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	allowed_states = {
		is_colonial = no
		any_owned_province = {
			not = {	is_core = THIS }
			is_colonial = no
		}
		not = { any_owned_province = { is_capital = yes } }
	}
	
	allowed_states_in_crisis = {
		any_owned_province = {
			any_neighbor_province = {
				owner = { tag = THIS }
			}
		}
	}		

	po_demand_state = yes
	
	war_name = WAR_TAKE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Place in the Sun
place_in_the_sun = {
	sprite_index = 7
	is_triggered_only = yes
	months = 6

	badboy_factor = 2
	prestige_factor = 2
	peace_cost_factor = 0.9
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		any_owned_province = {
			is_colonial = yes
		}	
	}
	
	allowed_states = {
		is_colonial = yes
	}
	
	allowed_states_in_crisis = {
		any_owned_province = {
			OR = {
				is_coastal = yes
				any_neighbor_province = {
					owner = { tag = THIS }
				}
			}
		}
	}

	po_demand_state = yes

	war_name = WAR_COLONIAL_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Colonial competition
colonial_competition = {
	sprite_index = 7
	is_triggered_only = yes
	constructing_cb = no    # only used in crises
	crisis = no
	months = 12

	badboy_factor = 0
	prestige_factor = 2
	peace_cost_factor = 0.9
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	po_colony = yes

	war_name = WAR_COLONIAL_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Cut Down to size
cut_down_to_size = {
	sprite_index = 8
	is_triggered_only = yes
	months = 12
	
	badboy_factor = 1.2
	prestige_factor = 1
	peace_cost_factor = 25
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	po_disarmament = yes
	po_reparations = yes

	war_name = WAR_NAME
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		is_disarmed = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

	
cut_down_to_size_boxer = {
	sprite_index = 8
	is_triggered_only = yes
	months = 12
	constructing_cb = no
	crisis = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		is_disarmed = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	badboy_factor = 1.1
	prestige_factor = 1
	peace_cost_factor = 25
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	po_disarmament = yes
	po_reparations = yes

	war_name = WAR_BOXER_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Free Peoples
free_peoples = {
	sprite_index = 9
	is_triggered_only = yes
	months = 6

	badboy_factor = 1.5
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
		number_of_states = 2
		NOT = {
			tag = FROM
			this_culture_union = FROM	
		}
		from = {
			OR = {
				exists = yes
				NOT = {
						OR = {
							tag = GER
							tag = SCA
							tag = ITA
							tag = YUG
							tag = ROM
							tag = CZH
						}
					}
				}
			}
		
		any_owned_province = {
			is_core = FROM
			NOT =
			{
				is_core = THIS
			}
		}
		is_releasable_vassal = FROM
	}

	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal's state
	allowed_states = {
		any_owned_province = {
			is_core = FROM
		}
	}

	po_transfer_provinces = yes

	war_name = WAR_FREE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	on_po_accepted = {
        country_event =    2650    # Territorial Loss event
	}
}

# Liberate country
liberate_country = {
	sprite_index = 15
	is_triggered_only = yes
	months = 12

	badboy_factor = 2.2
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
		number_of_states = 2
		NOT = {
			tag = FROM
			this_culture_union = FROM	
		}
		from = {
			OR = {
				exists = yes
				NOT = {
						OR = {
							tag = GER
							tag = SCA
							tag = ITA
							tag = YUG
							#tag = ROM # TODO: shoudl we let the rest be liberated too?
							tag = CZH
						}
					}
				}
			}
		
		any_owned_province = {
			is_core = FROM
			NOT =
			{
				is_core = THIS
			}
		}
		is_releasable_vassal = FROM
	}

	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal's state
	allowed_states = {
		any_owned_province = {
			is_core = FROM
		}
	}
	all_allowed_states = yes
	po_transfer_provinces = yes

	war_name = WAR_LIBERATE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
    on_po_accepted = {
        	country_event =    2651    # Territorial Loss event
        random_owned = {
            limit = { owner = { tag = TUR has_global_flag = italy_fights_turk war_with = ITA } }
            ITA = { country_event = 900009 }
        }
    }
}

# Dismantle fortifications (forts + naval bases)
dismantle_forts = {
	sprite_index = 16
	is_triggered_only = yes
	months = 6

	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 5
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal's state
	allowed_states = {
		any_owned_province = {
			OR = { 
				has_building = fort
				has_building = naval_base
			}
		}
	}

	po_destroy_forts = yes
	po_destroy_naval_bases = yes

	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}


# Release Puppet
release_puppet = {
	sprite_index = 23
	is_triggered_only = yes
	months = 10

	badboy_factor = 1.2
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		NOT = { is_our_vassal = THIS }
		num_of_vassals_no_substates = 1
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
		is_our_vassal = FROM
		FROM = { is_substate = no }
	}
	
	po_release_puppet = yes
	po_add_to_sphere = yes

	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Make Puppet
make_puppet = {
	sprite_index = 10
	is_triggered_only = yes
	months = 12
	crisis = no

	badboy_factor = 2
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		# this = { NOT = { badboy = 1 } }
		OR = {
			ai = yes
			year = 1880
		}
		NOT = { is_our_vassal = THIS }
		NOT = { number_of_states = 10 }
		OR = {
			total_pops = 800000
			number_of_states = 2
		}
		NOT = { total_pops = 3000000 }
		is_greater_power = no
		is_vassal = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	#allowed_countries = {
	#	NOT = { is_our_vassal = FROM }
		#FROM = { is_substate = no }
	#}
	
	po_make_puppet = yes

	war_name = WAR_PUPPET_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Become Independent
become_independent = {
	sprite_index = 23
	is_triggered_only = yes
	months = 12
	crisis = no
	
	always = yes

	badboy_factor = 3
	prestige_factor = 1
	peace_cost_factor = 40
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 5
	break_truce_militancy_factor = 1
	truce_months = 120
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		is_our_vassal = THIS
		has_recently_lost_war = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
	NOT = { tag = JAP }
		OR = {
			FROM = { is_our_vassal = THIS }
			war_with = THIS
		}
	}
	
	po_release_puppet = yes
	po_add_to_sphere = yes

	war_name = WAR_INDEPENDENCE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
		add_war_goal = {
			casus_belli = make_puppet
		}
		leave_alliance = FROM
		release_vassal = THIS
	}
}


# Humiliate
humiliate = {
	sprite_index = 11
	is_triggered_only = yes
	months = 6

	badboy_factor = 1.5
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1
	
	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	po_remove_prestige = yes

	tws_battle_factor = 2.0
	
	war_name = WAR_HUMILIATE_NAME

	can_use = {
		NOT = { is_our_vassal = THIS }
		has_recently_lost_war = no
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
		FROM  = {
        	NOT = { has_country_modifier = neutrality_modifier }
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Demand Concession
demand_concession_casus_belli = {
	sprite_index = 7
	is_triggered_only = yes
	months = 0
	construction_speed = 1.2
	crisis = no
	
	badboy_factor = 2
	prestige_factor = 0.1
	peace_cost_factor = 0.6
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 10
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0
	
	always = no

	can_use = {
		AND = {
		   year = 1836
		   NOT = { year = 1870 }
		}
		NOT = { is_our_vassal = THIS }
		THIS = {
			civilized = yes
		}
		civilized = no
		number_of_states = 2
	}
	
	allowed_states = {
		any_owned_province = {
			is_colonial = no
		}
		not = { any_owned_province = { is_capital = yes } }
		        #Restrictions to non-African State conquering
        OR = {
            continent = africa

            NOT = { total_pops = 500000 }

            AND = {
                NOT = { total_pops = 1000000 }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_logistics = 1
                    }
                    THIS = {
                        ai = yes
                        raider_group_doctrine = 1
                        iron_steamers = 1
                    }
                }
            }

            AND = {
                NOT = { total_pops = 2000000 }
                THIS = { machine_guns = 1 }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_directionism = 1
                    }
                    THIS = {
                        ai = yes
                        steam_turbine_ships = 1
                    }
                }
            }
            AND = {
                NOT = { total_pops = 3000000 }
                THIS = {
                    bolt_action_rifles = 1
                    army_risk_management = 1
                }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_integration = 1
                    }
                    THIS = {
                        ai = yes
                        oil_driven_ships = 1
                    }
                }
            }
            AND = {
                total_pops = 3000000
                THIS = {
                    modern_divisional_structure = 1
                    army_nco_training = 1
                }
            }
        } ###End of Non-African Restrictions
	}
	
	po_demand_state = yes
	
	war_name = WAR_CONCESSION_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

# Demand Concession late
demand_concession_casus_belli_late = {
	sprite_index = 7
	is_triggered_only = yes
	months = 0
	construction_speed = 1.2
	crisis = no
	
	badboy_factor = 1
	prestige_factor = 0.1
	peace_cost_factor = 0.6
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 10
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0
	
	always = no

	can_use = {
		AND = {
		   year = 1870
		}
		NOT = { is_our_vassal = THIS }
		THIS = {
			civilized = yes
		}
		civilized = no
		number_of_states = 2
	}
	
	allowed_states = {
		any_owned_province = {
			is_colonial = no
		}
		not = { any_owned_province = { is_capital = yes } }
		        #Restrictions to non-African State conquering
        OR = {
            continent = africa

            NOT = { total_pops = 500000 }

            AND = {
                NOT = { total_pops = 1000000 }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_logistics = 1
                    }
                    THIS = {
                        ai = yes
                        raider_group_doctrine = 1
                        iron_steamers = 1
                    }
                }
            }

            AND = {
                NOT = { total_pops = 2000000 }
                THIS = { machine_guns = 1 }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_directionism = 1
                    }
                    THIS = {
                        ai = yes
                        steam_turbine_ships = 1
                    }
                }
            }
            AND = {
                NOT = { total_pops = 3000000 }
                THIS = {
                    bolt_action_rifles = 1
                    army_risk_management = 1
                }
                OR = {
                    any_owned_province = { is_overseas = no }
                    THIS = {
                        ai = no
                        naval_integration = 1
                    }
                    THIS = {
                        ai = yes
                        oil_driven_ships = 1
                    }
                }
            }
            AND = {
                total_pops = 3000000
                THIS = {
                    modern_divisional_structure = 1
                    army_nco_training = 1
                }
            }
        } ###End of Non-African Restrictions
	}
	
	po_demand_state = yes
	
	war_name = WAR_CONCESSION_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}
# Establish Protectorate
establish_protectorate_casus_belli = {
	sprite_index = 7
	is_triggered_only = yes
	months = 0
	construction_speed = 1.2
	crisis = no
	
	badboy_factor = 1.7
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 12
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0
	
	always = no
	
	can_use = {
		AND = {
		   year = 1836
		   NOT = { year = 1870 }
		}
		NOT = { is_our_vassal = THIS }
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
		THIS = {
			civilized = yes
		}
		OR = {
			NOT = {
				number_of_states = 2 
			}
			AND = {
				THIS = {
					AND = {
						is_greater_power = yes
						nationalism_n_imperialism = 1
					}
				}
				NOT = { number_of_states = 5 }
			}
		}
		civilized = no
	}
	
	po_annex = yes
	
	war_name = WAR_PROTECTORATE_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

#establish protectorate late
establish_protectorate_casus_belli_late = {
	sprite_index = 7
	is_triggered_only = yes
	months = 0
	construction_speed = 1.2
	crisis = no
	
	badboy_factor = 0.6
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 12
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0
	
	always = no
	
	can_use = {
		AND = {
		   year = 1870
		}
		NOT = { is_our_vassal = THIS }
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
		THIS = {
			civilized = yes
		}
		OR = {
			NOT = {
				number_of_states = 2 
			}
			AND = {
				THIS = {
					AND = {
						is_greater_power = yes
						nationalism_n_imperialism = 1
					}
				}
				NOT = { number_of_states = 5 }
			}
		}
		civilized = no
	}
	
	po_annex = yes
	
	war_name = WAR_PROTECTORATE_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}
# Unification Humiliate
unification_humiliate_cb = {
	sprite_index = 11
	is_triggered_only = no
	months = 12
	crisis = no

	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 10
	penalty_factor = 1
	
	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	always = yes
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			culture_has_union_tag = yes
			nationalism_n_imperialism = 1
			is_greater_power = yes
		}
		is_greater_power = yes
		is_culture_group = THIS
		NOT = { is_cultural_union = THIS }
		has_cultural_sphere = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	po_clear_union_sphere = yes
	
	tws_battle_factor = 2.0 # battle score twice that of oppenent
	
	war_name = UNIFICATION_HUMILIATE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

# Release Puppet
unification_release_puppet_cb = {
	sprite_index = 10
	is_triggered_only = yes
	months = 6
	crisis = no

	badboy_factor = 0
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	always = yes

	can_use = {
		NOT = { is_our_vassal = THIS }
		num_of_vassals_no_substates = 1
		THIS = {
			culture_has_union_tag = yes
			nationalism_n_imperialism = 1
			is_greater_power = yes		
			is_cultural_union = no
		}
		NOT = {
			is_culture_group = THIS
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }		
	}
	
	# THIS - us
	# FROM - country scope is possible match?
	# war target country of goal is scope
	allowed_countries = {
		is_our_vassal = FROM
		FROM = { is_culture_group = THIS is_substate = no }
	}
	
	po_release_puppet = yes
	po_add_to_sphere = yes

	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}

# Unification Demand State
unification_casus_belli = {
	sprite_index = 5
	is_triggered_only = no
	months = 12
	construction_speed = 1
	crisis = no
	
	badboy_factor = 0
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 12
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	always = yes
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			culture_has_union_tag = yes
			nationalism_n_imperialism = 1
			is_greater_power = yes
			is_cultural_union = no
		}
		NOT = {
			is_culture_group = THIS
		}
		number_of_states = 2
		any_state = {
			any_owned_province = {
				any_core = {
					this_culture_union = this_union
					is_cultural_union = yes
				}
			}
			not = { any_owned_province = { is_capital = yes } }
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	allowed_states = {
		any_owned_province = {
			any_core = {
				this_culture_union = this_union
				is_cultural_union = yes
			}
		}
		not = { any_owned_province = { is_capital = yes } }
	}
	
	po_demand_state = yes
	
	war_name = WAR_UNIFICATION_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

#Unification Annex
unification_annex_casus_belli = {
	sprite_index = 5
	is_triggered_only = no
	months = 12
	crisis = no
	
	badboy_factor = 0
	prestige_factor = 0
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 12
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	always = yes
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		THIS = {
			culture_has_union_tag = yes
			nationalism_n_imperialism = 1
			is_greater_power = yes
			is_cultural_union = no
		}
		NOT = {
			is_culture_group = THIS
		}
		NOT = {
			number_of_states = 2
		}
		any_owned_province = {
			any_core = {
				this_culture_union = this_union
				is_cultural_union = yes
			}
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	po_annex = yes
	
	war_name = WAR_UNIFICATION_ANNEX_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

# Bad Boy
rude_boy = {
	sprite_index = 11
	is_triggered_only = no
	months = 12
	construction_speed = 2
	crisis = no

	badboy_factor = 0
	prestige_factor = 0.5
	peace_cost_factor = 1.5
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0
	
	always = yes

	can_use = {
		NOT = { is_our_vassal = THIS }
		badboy = 1
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	po_remove_prestige = yes
	po_disarmament = yes
	po_reparations = yes
	
	war_name = WAR_RUDEBOI_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.1
		}
	}
}

# Install Communist Government
install_communist_gov_cb = {
	sprite_index = 12
	is_triggered_only = yes
	months = 6
	crisis = no

	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		THIS = {
			# If actor is a great power
			is_greater_power = yes
			
			# If actor gov truly communist
			government = proletarian_dictatorship
			
			# If actor ruling party is communist
			ruling_party_ideology = communist
		}
		
		AND = {
			# If reciever ruling party is not a communist
			#NOT = {
			#	ruling_party_ideology = communist
			#}
			
			# There are some amount of communist already in the country
			communist = 0.1
				
			# If reciever current gov is not proletarian_dictatorship
			NOT = {
				government = proletarian_dictatorship
			}
			
			# If reciever is not a great power
			is_greater_power = no
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	po_install_communist_gov_type = yes

	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	on_po_accepted = {
		political_reform = none_voting
		political_reform = party_appointed
		political_reform = no_meeting
		political_reform = state_press
		political_reform = state_controlled
		political_reform = underground_parties
	}
}

install_fascist_gov_cb = {
	sprite_index = 26
	is_triggered_only = yes
	months = 6
	crisis = no

	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		THIS = {
			# If actor is a great power
			is_greater_power = yes
			
			# If actor gov truly communist
			government = fascist_dictatorship
			
			# If actor ruling party is communist
			ruling_party_ideology = fascist
		}
		
		AND = {
			# If reciever ruling party is not a communist
			NOT = {
				ruling_party_ideology = fascist
			}
				
			# If reciever current gov is not proletarian_dictatorship
			NOT = {
				government = fascist_dictatorship
			}
			
			# If reciever is not a great power
			is_greater_power = no
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	on_po_accepted = {
	country_event = 100000280
		political_reform = none_voting
		political_reform = party_appointed
		political_reform = no_meeting
		political_reform = state_press
		political_reform = state_controlled
		political_reform = underground_parties
	}
}

# Revert from Communist Government
uninstall_communist_gov_cb = {
	sprite_index = 13
	is_triggered_only = yes
	months = 6
	crisis = no
	
	# Is automatically added to countries that intervened at while install_communist_gov_cb
	# so they can revert those countries government.
	constructing_cb = no

	badboy_factor = 1
	prestige_factor = 1
	peace_cost_factor = 5
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		THIS = {
			# If actor ruling party is not communist
			NOT = {
				ruling_party_ideology = communist
			}
		}
		
		# If reciever current gov is proletarian_dictatorship
		government = proletarian_dictatorship
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	po_uninstall_communist_gov_type = yes

	war_name = WAR_NAME
	
	on_add = {
		move_issue_percentage = {
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}


# Great War Penalty
great_war_penalty_cb = {
	sprite_index = 14
	is_triggered_only = yes
	months = 0
	crisis = no
	
	constructing_cb = no
	
	great_war_obligatory = yes
	
	badboy_factor = 1.3
	prestige_factor = 1.8
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	po_disarmament = yes
	po_reparations = yes

	war_name = WAR_NAME
	
	#can_use = {
	#	NOT = { is_our_vassal = THIS }
	#	is_disarmed = no
	#}
	
	on_add = {
            FROM = { set_country_flag = in_great_war }
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
            country_event = 960000
	}
}
#Take capital state
take_capital = {
	sprite_index = 6
	is_triggered_only = yes
	months = 12
	construction_speed = 0.5
	
	badboy_factor = 3
	prestige_factor = 10
	peace_cost_factor = 1
	penalty_factor = 1

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		# this = { NOT = { badboy = 1 } }

		number_of_states = 2 # annex if you want their last state
		any_owned_province = {
			not = { is_core = THIS }
			is_colonial = no
		}
		OR = {
			AND = {
				civilized = yes
				THIS = {
					civilized = yes
				}
			}
			AND = {
				civilized = no
				THIS = {
					civilized = no
				}
			}
		}
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	allowed_states = {
		is_colonial = no
		any_owned_province = {
			not = {	is_core = THIS }
			is_colonial = no
		}
		any_owned_province = { is_capital = yes }
	}
	
	allowed_states_in_crisis = {
		any_owned_province = {
			any_neighbor_province = {
				owner = { tag = THIS }
			}
		}
	}		

	po_demand_state = yes
	
	war_name = WAR_TAKE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}
#Negotiated Transfer
negotiated_transfer = {
	sprite_index = 5
	is_triggered_only = yes
	crisis = no

	badboy_factor = 0
	prestige_factor = 0
	peace_cost_factor = 0
	penalty_factor = 0

	break_truce_prestige_factor = 0
	break_truce_infamy_factor = 0
	break_truce_militancy_factor = 0
	truce_months = 0
	
	good_relation_prestige_factor = 0
	good_relation_infamy_factor = 0
	good_relation_militancy_factor = 0

	construction_speed = 2.0

	can_use = {
		number_of_states = 2 # annex if you want their last state
		OR = {
			ai = no
			AND = {
				ai = yes
				is_independant = no
				overlord = { ai = no }
			}
		}
		THIS = { ai = no }
	}
	
	allowed_states = {
		not = { any_owned_province = { is_capital = yes } }
	}

	po_demand_state = yes
	
	war_name = WAR_NEGOTIATE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.00
		}
	}
}
# Cut Down to size (Reperations)
demand_reperations = {
	sprite_index = 27
	is_triggered_only = yes
	months = 6
	
	badboy_factor = 0.5
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1
	
	construction_speed = 0.5

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	po_disarmament = no
	po_reparations = yes

	war_name = WAR_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
		FROM = {
			add_country_modifier = {
				name = no_more_war_reperations
				duration = 2160
			}
		}
	}
}

conquest_low = {
	sprite_index = 2
	is_triggered_only = yes
	months = 6
	crisis = no
	
	construction_speed = 0.5
	
	can_use = {
		# this = { NOT = { badboy = 1 } }
		NOT = {	total_pops = 400000
			civilized = no }


		
		# only one state or unciv
		NOT = { number_of_states = 5 }
		OR = {
			AND = {
				civilized = yes
				NOT = { number_of_states = 2 }
			}
			AND = {
				civilized = no
				THIS = { civilized = no }
				NOT = { number_of_states = 3 }
			}
			AND = {
				civilized = no
				number_of_states = 2
				THIS = {
					OR = {
						NOT = { is_greater_power = yes }
						NOT = { nationalism_n_imperialism = 1 }
					}
				}
			}
		}
		is_independant = yes
		THIS = {
			NOT = {
                		has_country_modifier = neutrality_modifier
			}
		}
        NOT = { has_country_modifier = neutrality_modifier 
			tag = MOD 
			tag = PAR 
			tag = LUC 
			tag = TUS }
	}

	badboy_factor = 0.8
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_annex = yes
	
	war_name = WAR_CONQUEST_NAME
}
acquire_all_cores = {
	sprite_index = 5
	is_triggered_only = yes
	months = 12
	constructing_cb = no
	crisis = no

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 30
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
			NOT = { has_country_modifier = neutrality_modifier }
		THIS = {
			NOT = { has_country_modifier = neutrality_modifier }
		}
		NOT = { relation = { who = THIS value = 100 } }
		any_owned_province = { is_core = THIS }
		any_owned_province = { NOT = { is_core = THIS } }
		NOT = { is_our_vassal = THIS }
		NOT = { vassal_of = THIS }
		
					NOT = {
				tag = JAN
			}
		THIS = {
			NOT = {
					tag = JAN
			}
		}
	}
	
	
	allowed_countries = {
		FROM = { tag = THIS }
	}

	allowed_states = {
		any_owned_province = { is_core = THIS }
	}

	all_allowed_states = yes
	po_transfer_provinces = yes
	
	war_name = WAR_LIBERATION_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
    on_po_accepted = {
        country_event =    2650    # Territorial Loss event
    }

}
# Acquire All Core States
acquire_all_cores_usa = {
    sprite_index = 5
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

    badboy_factor = 0
    prestige_factor = 2
    peace_cost_factor = 0.5
    penalty_factor = 1

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 2
    break_truce_militancy_factor = 2
    truce_months = 48

    good_relation_prestige_factor = 1
    good_relation_infamy_factor = 1
    good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        any_owned_province = { is_core = THIS }
        any_owned_province = { NOT = { is_core = THIS } }
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
                AND = {
                    war_policy = pacifism
                    war = no
                }
            }
        }
    }

    allowed_states = {
        any_owned_province = { is_core = THIS }
        #NOT = { any_owned_province = { is_capital = yes } }
    }

    all_allowed_states = yes
    po_transfer_provinces = yes

    war_name = WAR_ALL_CORES_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    265000    # Territorial Loss event
    }
}
# Great War CB's
dismantle_cb = {
    sprite_index = 25
    is_triggered_only = yes
    months = 12
    crisis = no

    construction_speed = 0.25

    badboy_factor = 1.6
    prestige_factor = 10
    peace_cost_factor = 35
    penalty_factor = 3

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 3
    break_truce_militancy_factor = 1
    truce_months = 108

    good_relation_prestige_factor = 0
    good_relation_infamy_factor = 0
    good_relation_militancy_factor = 0

    can_use = {
        OR = {
            is_greater_power = yes
            is_secondary_power = yes
            colonial_nation = yes
            any_owned_province = { is_overseas = yes }
        }
        is_disarmed = no
        is_vassal = no
        NOT = { is_our_vassal = THIS }
        OR = {
            NOT = { relation = { who = THIS value = -100 } }
            war_with = THIS
        }
        THIS = {
            is_greater_power = yes
            is_disarmed = no
            mass_politics = 1
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
        NOT = { has_country_modifier = neutrality_modifier }
    }

    po_disarmament = yes
    po_reparations = yes

    war_name = WAR_DISMANTLE_NAME

    on_add = {
        FROM = {
            set_country_flag = dismantle_declared
        }
        country_event = 960000
        move_issue_percentage = {
            from = pro_military
            to = jingoism
            value = 0.10
        }
    }

    on_po_accepted = {
        country_event = 113000
    }
}
# Cut Down to size (Reperations)
annex_mandates = {
	sprite_index = 13
	is_triggered_only = yes
	months = 12
	
	badboy_factor = 0.5
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1
	
	construction_speed = 0.5

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
                has_country_modifier = mandate_modifier
	}

	po_disarmament = no
	po_reparations = yes

	war_name = WAR_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
		FROM = {
			add_country_modifier = {
				name = no_more_war_reperations
				duration = 2160
			}
		}
	}
    on_po_accepted = {
        country_event = 112962
    }
}
# Cut Down to size (Reperations)
take_parts_mandates = {
	sprite_index = 13
	is_triggered_only = yes
	months = 12
	
	badboy_factor = 0.5
	prestige_factor = 1
	peace_cost_factor = 15
	penalty_factor = 1
	
	construction_speed = 0.5

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
                has_country_modifier = mandate_modifier
	}

	po_disarmament = no
	po_reparations = yes

	war_name = WAR_NAME

	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
		FROM = {
			add_country_modifier = {
				name = no_more_war_reperations
				duration = 2160
			}
		}
	}
    on_po_accepted = {
        country_event = 1130020
    }
}
treaty_port_casus_belli = {
	sprite_index = 18
    is_triggered_only = yes
    months = 10
    crisis = no

    badboy_factor = 1
    prestige_factor = 0.5
    peace_cost_factor = 10
    penalty_factor = 2

    break_truce_prestige_factor = 4
    break_truce_infamy_factor = 4
    break_truce_militancy_factor = 1
    truce_months = 15

    good_relation_prestige_factor = 1
    good_relation_infamy_factor = 1
    good_relation_militancy_factor = 0

    always = no

    can_use = {
        NOT = { is_our_vassal = THIS }
        THIS = {
            civilized = yes
            is_disarmed = no
            any_owned_province = { has_building = naval_base }
            NOT = { has_country_modifier = neutrality_modifier }
            OR = {
                naval_plans = 1
                ai = yes
            }
            OR = {
                AND = {
                    military_score = 25
                    total_amount_of_ships = 25
                    total_pops = 250000
                    rank = 16
                }
                war_with = THIS
            }
            OR = {
                NOT = { war_policy = pacifism }
                ai = no
                war_with = THIS
            }
        }
        NOT = { has_country_modifier = neutrality_modifier }
        civilized = no
        is_vassal = no
        num_of_cities = 2

        OR = {
            owns = 1498 #Macao
            owns = 1538 #Shanghai
            owns = 1981 #Shanghai
            owns = 2622 #Shanghai
            owns = 2649 #Shanghai
            owns = 2665 #Shanghai
            owns = 1496 #Hong Kong
            owns = 1566 #Qingdao
            owns = 1481 #Lushun - Port Arthur
            owns = 1569 #Weihai
            owns = 1606 #Jiaxing
            owns = 2681 #Taibei
            owns = 2562 #Tainan
            owns = 1499 #Hainan
            owns = 2632 #Kwangchowan
            owns = 1608 #Ningbo
            owns = 1071 #Qeshm
            owns = 1695 #Ifni
            owns = 2640 #Gwadar
            owns = 1177 #Socotra
            owns = 2048 #Zanzibar
            owns = 1637 #Cheju
			owns = 1981 #Khasab
            owns = 2589 #Tsushima
            owns = 12 #Sado
        }
    }

    po_reparations = yes

    tws_battle_factor = 1.5

    war_name = PUNITIVE_EXPEDITION_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.1
        }
    }

    on_po_accepted = {
        random_owned = {
            limit = {
                owner = {
                    civilized = no
                    OR = {
                        owns = 1498 #Macao
                        owns = 1538 #Shanghai
                        owns = 1496 #Hong Kong
                        owns = 1566 #Qingdao
                        owns = 1481 #Lushun - Port Arthur
                        owns = 1569 #Weihaiwei
                        owns = 1606 #Jiaxing
                        owns = 1485 #Taibei
                        owns = 2562 #Tainan
                        owns = 1499 #Hainan
                        owns = 1608 #Ningbo
                        owns = 1695 #Ifni
                        owns = 2622 #Gwadar
                        owns = 2665 #Kwanchonk
                        owns = 2649 #west Shanghai
						owns = 1981 #Khasab
                        owns = 1177 #Socotra
                        owns = 2048 #Zanzibar
                        owns = 1637 #Cheju
                    }
                }
                THIS = {
                    civilized = yes
                    NOT = { is_culture_group = east_asian }
                    any_owned_province = { port = yes }
                }
            }
            owner = { add_country_modifier = { name = negotiating_unequal_treaty duration = 30 } }
            THIS = { add_country_modifier = { name = negotiating_treaty duration = 30 } }
        }
        #random_owned = { limit = { owner = { civilized = no has_country_modifier = uncivilized_isolationism } }
        #    owner = { remove_country_modifier = uncivilized_isolationism }
        #}
        #random_owned = { limit = { owner = { civilized = no NOT = { has_country_modifier = western_influences } } }
        #    owner = { add_country_modifier = { name = western_influences duration = -1 } }
        #}
        #random_owned = { limit = { owner = { civilized = no NOT = { capital_scope = { has_country_modifier = legation_quarter } } } }
        #    owner = { capital_scope = { add_province_modifier = { name = legation_quarter duration = -1 } } }
        #}
    }
}
#Zemene Mesafint
zemene_mesafint = {
	sprite_index = 2
	is_triggered_only = yes
	months = 12
	crisis = no

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 0.7
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	can_use = {
		THIS = { OR = { tag = SHW  tag = GON tag = AWS tag = KAF  tag = TIG } }
		has_country_flag = zemene_mesafint 
	}

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_annex = yes
	
	war_name = Zemene_Mesafint
}
# Berlin Conference
annex_africa = {
    sprite_index = 21
    is_triggered_only = yes
    months = 12
    crisis = no

    always = yes

    construction_speed = 2.5

    badboy_factor = 0
    prestige_factor = 0.5
    peace_cost_factor = 0.6
    penalty_factor = 2

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 2
    break_truce_militancy_factor = 2
    truce_months = 60

    good_relation_prestige_factor = 0
    good_relation_infamy_factor = 0
    good_relation_militancy_factor = 0

    can_use = {
        OR = {
            AND = {
                THIS = { total_amount_of_ships = 5 }
                any_owned_province = { port = yes }
            }
            neighbour = THIS
            war_with = THIS
        }
        NOT = { is_our_vassal = THIS }
        number_of_states = 2
        OR = {
            war_with = THIS
            THIS = { military_score = 1 }
        }
        THIS = {
            nationalism_n_imperialism = 1
            capital_scope = { continent = europe }
            NOT = { tag = RUS }
            NOT = { tag = TUR }
            slavery = no_slavery
            OR = {
                is_greater_power = yes
                is_secondary_power = yes
            }
              NOT = { has_country_modifier = neutrality_modifier }
            NOT = { has_country_modifier = claimed_africa }
            NOT = { has_country_flag = congo_award }
            civilized = yes
            has_global_flag = berlin_conference
        }
        NOT = {
            tag = MOR
            tag = ALD
            tag = TRI
            tag = LIB
            tag = CYR
            primary_culture = kefficho
            primary_culture = amhara
            primary_culture = tigray
            primary_culture = oromo
            primary_culture = harari
            has_country_flag = post_colonial_country
        }
        civilized = no
        is_vassal = no
        capital_scope = { continent = africa }
        ai = yes
        OR = {
            war_with = THIS
            THIS = {
                NOT = { has_country_modifier = punitive_effects }
            }
        }

        #Claimed colonial regions can't be conquered with this CB
        NOT = {
            #Ghana
            AND = {
                any_owned_province = {
                    OR = {
                        region = ASH_1909
                        region = FRA_1907
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ASH_1909
                                region = FRA_1907
                            }
                        }
                    }
                    any_greater_power  = {
                        any_owned_province = {
                            OR = {
                                region = ASH_1909
                                region = FRA_1907
                            }
                        }
                    }
                }
            }
            #Ivory Coast
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1892
                        region = FRA_1893
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1892
                                region = FRA_1893
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1892
                                region = FRA_1893
                            }
                        }
                    }
                }
            }
            #Nigeria
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1923
                        region = FRA_1927
                        region = FRA_1930
                        region = SOK_1934
                        region = SOK_1945
                        region = SOK_1937
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1923
                                region = FRA_1927
                                region = FRA_1930
                                region = SOK_1934
                                region = SOK_1945
                                region = SOK_1937
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1923
                                region = FRA_1927
                                region = FRA_1930
                                region = SOK_1934
                                region = SOK_1945
                                region = SOK_1937
                            }
                        }
                    }
                }
            }
            #Guinea
            AND = {
                any_owned_province = { region = FRA_1883 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = FRA_1883 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = FRA_1883 }
                    }
                }
            }
            #Guinea-Bissau
            AND = {
                any_owned_province = { region = FRA_1878 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = FRA_1878 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = FRA_1878 }
                    }
                }
            }
            #Angola
            AND = {
                any_owned_province = { region = POR_1999 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = POR_1999 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = POR_1999 }
                    }
                }
            }
            #Senegal and Mauritania
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1783
                        region = FRA_1788
                        region = FRA_1775
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1783
                                region = FRA_1788
                                region = FRA_1775
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1783
                                region = FRA_1788
                                region = FRA_1775
                            }
                        }
                    }
                }
            }
            #Mali
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1798
                        region = FRA_1801
                        region = FRA_1803
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1798
                                region = FRA_1801
                                region = FRA_1803
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1798
                                region = FRA_1801
                                region = FRA_1803
                            }
                        }
                    }
                }
            }
            #Niger
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1808
                        region = FRA_1813
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1808
                                region = FRA_1813
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1808
                                region = FRA_1813
                            }
                        }
                    }
                }
            }
            #Mozambique
            AND = {
                any_owned_province = {
                    OR = {
                        region = POR_2049
                        region = POR_2054
                        region = POR_2053
                        region = POR_2060
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = POR_2049
                                region = POR_2054
                                region = POR_2053
                                region = POR_2060
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = POR_2049
                                region = POR_2054
                                region = POR_2053
                                region = POR_2060
                            }
                        }
                    }
                }
            }
            #South Africa
            AND = {
                any_owned_province = {
                    OR = {
                        region = ENG_2087
                        region = ENG_2096
                        region = ORA_2103
                        region = TRN_2108
                        region = ZUL_2113
                        region = ENG_2071
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ENG_2087
                                region = ENG_2096
                                region = ORA_2103
                                region = TRN_2108
                                region = ZUL_2113
                                region = ENG_2071
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = ENG_2087
                                region = ENG_2096
                                region = ORA_2103
                                region = TRN_2108
                                region = ZUL_2113
                                region = ENG_2071
                            }
                        }
                    }
                }
            }
            #Egypt
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1745
                        region = EGY_1758
                        region = EGY_1762
                        region = EGY_1771
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = EGY_1745
                                region = EGY_1758
                                region = EGY_1762
                                region = EGY_1771
                                region = EGY_1755
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = EGY_1745
                                region = EGY_1758
                                region = EGY_1762
                                region = EGY_1771
                                region = EGY_1755
                            }
                        }
                    }
                }
            }
            #Sudan
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1834
                        region = EGY_1827
                        region = EGY_1838
                        region = ENG_1844
                        #region = EGY_1842
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = EGY_1834
                                region = EGY_1827
                                region = EGY_1838
                                region = ENG_1844
                                #region = EGY_1842
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = EGY_1834
                                region = EGY_1827
                                region = EGY_1838
                                region = ENG_1844
                                #region = EGY_1842
                            }
                        }
                    }
                }
            }
            #Ethiopia
            AND = {
                any_owned_province = {
                    OR = {
                        region = ETH_1853
                        region = ETH_1852
                        region = ETH_1865
                        region = ETH_1859
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ETH_1853
                                region = ETH_1852
                                region = ETH_1865
                                region = ETH_1859
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = ETH_1853
                                region = ETH_1852
                                region = ETH_1865
                                region = ETH_1859
                            }
                        }
                    }
                }
            }
            #Somalia
            AND = {
                any_owned_province = {
                    OR = {
                        region = SOM_1868
                        region = SOM_1872
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = SOM_1868
                                region = SOM_1872
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = SOM_1868
                                region = SOM_1872
                            }
                        }
                    }
                }
            }
        }
    }

    allowed_states = {
        #any_owned_province = { is_colonial = no }
        #NOT = { any_owned_province = { is_capital = yes } }
        OR = {
            THIS = { ai = no }
            any_owned_province = { any_neighbor_province = { owned_by = THIS } }
            AND = {
                any_owned_province = { port = yes }
                THIS = { any_owned_province = { port = yes } }
            }
        }

        #Claimed colonial regions can't be conquered with this CB
        NOT = {
            #Ghana
            AND = {
                any_owned_province = {
                    OR = {
                        region = ASH_1909
                        region = FRA_1907
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = ASH_1909
                                    region = FRA_1907
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = ASH_1909
                                    region = FRA_1907
                                }
                            }
                        }
                    }
                }
            }
            #Ivory Coast
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1892
                        region = FRA_1893
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = FRA_1892
                                    region = FRA_1893
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = FRA_1892
                                    region = FRA_1893
                                }
                            }
                        }
                    }
                }
            }
            #Nigeria
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1923
                        region = FRA_1927
                        region = FRA_1930
                        region = SOK_1934
                        region = SOK_1945
                        region = SOK_1937
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = FRA_1923
                                    region = FRA_1927
                                    region = FRA_1930
                                    region = SOK_1934
                                    region = SOK_1945
                                    region = SOK_1937
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = FRA_1923
                                    region = FRA_1927
                                    region = FRA_1930
                                    region = SOK_1934
                                    region = SOK_1945
                                    region = SOK_1937
                                }
                            }
                        }
                    }
                }
            }
            #Guinea
            AND = {
                any_owned_province = { region = FRA_1883 }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = { region = FRA_1883 }
                        }
                        any_greater_power = {
                            any_owned_province = { region = FRA_1883 }
                        }
                    }
                }
            }
            #Guinea-Bissau
            AND = {
                any_owned_province = { region = FRA_1878 }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = { region = FRA_1878 }
                        }
                        any_greater_power = {
                            any_owned_province = { region = FRA_1878 }
                        }
                    }
                }
            }
            #Angola
            AND = {
                any_owned_province = { region = POR_1999 }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = { region = POR_1999 }
                        }
                        any_greater_power = {
                            any_owned_province = { region = POR_1999 }
                        }
                    }
                }
            }
            #Senegal and Mauritania
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1783
                        region = FRA_1788
                        region = FRA_1775
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = FRA_1783
                                    region = FRA_1788
                                    region = FRA_1775
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = FRA_1783
                                    region = FRA_1788
                                    region = FRA_1775
                                }
                            }
                        }
                    }
                }
            }
            #Mali
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1798
                        region = FRA_1801
                        region = FRA_1803
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = FRA_1798
                                    region = FRA_1801
                                    region = FRA_1803
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = FRA_1798
                                    region = FRA_1801
                                    region = FRA_1803
                                }
                            }
                        }
                    }
                }
            }
            #Niger
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1808
                        region = FRA_1813
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = FRA_1808
                                    region = FRA_1813
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = FRA_1808
                                    region = FRA_1813
                                }
                            }
                        }
                    }
                }
            }
            #Mozambique
            AND = {
                any_owned_province = {
                    OR = {
                        region = POR_2049
                        region = POR_2054
                        region = POR_2053
                        region = POR_2060
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = POR_2049
                                    region = POR_2054
                                    region = POR_2053
                                    region = POR_2060
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = POR_2049
                                    region = POR_2054
                                    region = POR_2053
                                    region = POR_2060
                                }
                            }
                        }
                    }
                }
            }
            #South Africa
            AND = {
                any_owned_province = {
                    OR = {
                        region = ENG_2087
                        region = ENG_2096
                        region = ORA_2103
                        region = TRN_2108
                        region = ZUL_2113
                        region = ENG_2071
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = ENG_2087
                                    region = ENG_2096
                                    region = ORA_2103
                                    region = TRN_2108
                                    region = ZUL_2113
                                    region = ENG_2071
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = ENG_2087
                                    region = ENG_2096
                                    region = ORA_2103
                                    region = TRN_2108
                                    region = ZUL_2113
                                    region = ENG_2071
                                }
                            }
                        }
                    }
                }
            }
            #Egypt
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1745
                        region = EGY_1758
                        region = EGY_1762
                        region = EGY_1771
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = EGY_1745
                                    region = EGY_1758
                                    region = EGY_1762
                                    region = EGY_1771
                                    region = EGY_1755
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = EGY_1745
                                    region = EGY_1758
                                    region = EGY_1762
                                    region = EGY_1771
                                    region = EGY_1755
                                }
                            }
                        }
                    }
                }
            }
            #Sudan
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1834
                        region = EGY_1827
                        region = EGY_1838
                        region = ENG_1844
                        #region = EGY_1842
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = EGY_1834
                                    region = EGY_1827
                                    region = EGY_1838
                                    region = ENG_1844
                                    #region = EGY_1842
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = EGY_1834
                                    region = EGY_1827
                                    region = EGY_1838
                                    region = ENG_1844
                                    #region = EGY_1842
                                }
                            }
                        }
                    }
                }
            }
            #Ethiopia
            AND = {
                any_owned_province = {
                    OR = {
                        region = ETH_1853
                        region = ETH_1852
                        region = ETH_1865
                        region = ETH_1859
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = ETH_1853
                                    region = ETH_1852
                                    region = ETH_1865
                                    region = ETH_1859
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = ETH_1853
                                    region = ETH_1852
                                    region = ETH_1865
                                    region = ETH_1859
                                }
                            }
                        }
                    }
                }
            }
            #Somalia
            AND = {
                any_owned_province = {
                    OR = {
                        region = SOM_1868
                        region = SOM_1872
                    }
                }
                owner = {
                    OR = {
                        any_neighbor_country = {
                            civilized = yes
                            any_owned_province = {
                                OR = {
                                    region = SOM_1868
                                    region = SOM_1872
                                }
                            }
                        }
                        any_greater_power = {
                            any_owned_province = {
                                OR = {
                                    region = SOM_1868
                                    region = SOM_1872
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    po_demand_state = yes

    war_name = WAR_CONCESSION_NAME

    on_add = {
        add_country_modifier = { name = claimed_africa duration = 120 }
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.1
        }
    }

    on_po_accepted = { THIS = { add_country_modifier = { name = claimed_africa duration = 120 } } }
}

annex_africa_full = {
    sprite_index = 21
    is_triggered_only = yes
    months = 12
    crisis = no

    always = yes

    construction_speed = 2.5

    badboy_factor = 0
    prestige_factor = 0.5
    peace_cost_factor = 0.6
    penalty_factor = 2

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 2
    break_truce_militancy_factor = 2
    truce_months = 60

    good_relation_prestige_factor = 0
    good_relation_infamy_factor = 0
    good_relation_militancy_factor = 0

    can_use = {
        OR = {
            AND = {
                THIS = { total_amount_of_ships = 5 }
                any_owned_province = { port = yes }
            }
            neighbour = THIS
            war_with = THIS
        }
        NOT = { is_our_vassal = THIS }
        NOT = { number_of_states = 2 }
        OR = {
            war_with = THIS
            THIS = { military_score = 1 }
        }
        THIS = {
            nationalism_n_imperialism = 1
            capital_scope = { continent = europe }
            NOT = { tag = RUS }
            NOT = { tag = TUR }
            slavery = no_slavery
            OR = {
                is_greater_power = yes
                is_secondary_power = yes
            }
              NOT = { has_country_modifier = neutrality_modifier }
            NOT = { has_country_modifier = claimed_africa }
            NOT = { has_country_flag = congo_award }
            civilized = yes
            has_global_flag = berlin_conference
        }
        civilized = no
        is_vassal = no
        NOT = {
            tag = MOR
            tag = ALD
            tag = TRI
            tag = LIB
            tag = CYR
            primary_culture = kefficho
            primary_culture = amhara
            primary_culture = tigray
            primary_culture = oromo
            primary_culture = harari
            has_country_flag = post_colonial_country
        }
        capital_scope = { continent = africa }
        ai = yes
        OR = {
            war_with = THIS
            THIS = { NOT = { has_country_modifier = punitive_effects } }
        }
        OR = {
            any_owned_province = { any_neighbor_province = { owned_by = THIS } }
            AND = {
                any_owned_province = { port = yes }
                THIS = { any_owned_province = { port = yes } }
            }
        }

        #Claimed colonial regions can't be conquered with this CB
        NOT = {
            #Ghana
            AND = {
                any_owned_province = {
                    OR = {
                        region = ASH_1909
                        region = FRA_1907
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ASH_1909
                                region = FRA_1907
                            }
                        }
                    }
                    any_greater_power  = {
                        any_owned_province = {
                            OR = {
                                region = ASH_1909
                                region = FRA_1907
                            }
                        }
                    }
                }
            }
            #Ivory Coast
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1892
                        region = FRA_1893
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1892
                                region = FRA_1893
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1892
                                region = FRA_1893
                            }
                        }
                    }
                }
            }
            #Nigeria
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1923
                        region = FRA_1927
                        region = FRA_1930
                        region = SOK_1934
                        region = SOK_1945
                        region = SOK_1937
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1923
                                region = FRA_1927
                                region = FRA_1930
                                region = SOK_1934
                                region = SOK_1945
                                region = SOK_1937
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1923
                                region = FRA_1927
                                region = FRA_1930
                                region = SOK_1934
                                region = SOK_1945
                                region = SOK_1937
                            }
                        }
                    }
                }
            }
            #Guinea
            AND = {
                any_owned_province = { region = FRA_1883 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = FRA_1883 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = FRA_1883 }
                    }
                }
            }
            #Guinea-Bissau
            AND = {
                any_owned_province = { region = FRA_1878 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = FRA_1878 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = FRA_1878 }
                    }
                }
            }
            #Angola
            AND = {
                any_owned_province = { region = POR_1999 }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = { region = POR_1999 }
                    }
                    any_greater_power = {
                        any_owned_province = { region = POR_1999 }
                    }
                }
            }
            #Senegal and Mauritania
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1783
                        region = FRA_1788
                        region = FRA_1775
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1783
                                region = FRA_1788
                                region = FRA_1775
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1783
                                region = FRA_1788
                                region = FRA_1775
                            }
                        }
                    }
                }
            }
            #Mali
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1798
                        region = FRA_1801
                        region = FRA_1803
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1798
                                region = FRA_1801
                                region = FRA_1803
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1798
                                region = FRA_1801
                                region = FRA_1803
                            }
                        }
                    }
                }
            }
            #Niger
            AND = {
                any_owned_province = {
                    OR = {
                        region = FRA_1808
                        region = FRA_1813
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = FRA_1808
                                region = FRA_1813
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = FRA_1808
                                region = FRA_1813
                            }
                        }
                    }
                }
            }
            #Mozambique
            AND = {
                any_owned_province = {
                    OR = {
                        region = POR_2049
                        region = POR_2054
                        region = POR_2053
                        region = POR_2060
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = POR_2049
                                region = POR_2054
                                region = POR_2053
                                region = POR_2060
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = POR_2049
                                region = POR_2054
                                region = POR_2053
                                region = POR_2060
                            }
                        }
                    }
                }
            }
            #South Africa
            AND = {
                any_owned_province = {
                    OR = {
                        region = ENG_2087
                        region = ENG_2096
                        region = ORA_2103
                        region = TRN_2108
                        region = ZUL_2113
                        region = ENG_2071
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ENG_2087
                                region = ENG_2096
                                region = ORA_2103
                                region = TRN_2108
                                region = ZUL_2113
                                region = ENG_2071
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = ENG_2087
                                region = ENG_2096
                                region = ORA_2103
                                region = TRN_2108
                                region = ZUL_2113
                                region = ENG_2071
                            }
                        }
                    }
                }
            }
            #Egypt
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1745
                        region = EGY_1758
                        region = EGY_1762
                        region = EGY_1771
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = EGY_1745
                                region = EGY_1758
                                region = EGY_1762
                                region = EGY_1771
                                region = EGY_1755
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = EGY_1745
                                region = EGY_1758
                                region = EGY_1762
                                region = EGY_1771
                                region = EGY_1755
                            }
                        }
                    }
                }
            }
            #Sudan
            AND = {
                any_owned_province = {
                    OR = {
                        region = EGY_1834
                        region = EGY_1827
                        region = EGY_1838
                        region = ENG_1844
                        #region = EGY_1842
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = EGY_1834
                                region = EGY_1827
                                region = EGY_1838
                                region = ENG_1844
                                #region = EGY_1842
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = EGY_1834
                                region = EGY_1827
                                region = EGY_1838
                                region = ENG_1844
                                #region = EGY_1842
                            }
                        }
                    }
                }
            }
            #Ethiopia
            AND = {
                any_owned_province = {
                    OR = {
                        region = ETH_1853
                        region = ETH_1852
                        region = ETH_1865
                        region = ETH_1859
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = ETH_1853
                                region = ETH_1852
                                region = ETH_1865
                                region = ETH_1859
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = ETH_1853
                                region = ETH_1852
                                region = ETH_1865
                                region = ETH_1859
                            }
                        }
                    }
                }
            }
            #Somalia
            AND = {
                any_owned_province = {
                    OR = {
                        region = SOM_1868
                        region = SOM_1872
                    }
                }
                OR = {
                    any_neighbor_country = {
                        civilized = yes
                        any_owned_province = {
                            OR = {
                                region = SOM_1868
                                region = SOM_1872
                            }
                        }
                    }
                    any_greater_power = {
                        any_owned_province = {
                            OR = {
                                region = SOM_1868
                                region = SOM_1872
                            }
                        }
                    }
                }
            }
        }
    }

    po_annex = yes

    war_name = WAR_PROTECTORATE_NAME

    on_add = {
        add_country_modifier = { name = claimed_africa duration = 120 }
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.1
        }
    }

    on_po_accepted = {
        THIS = { add_country_modifier = { name = claimed_africa duration = 120 } }
        tech_school = developing_tech_school
    }
}
# balkan liberation
balkan_liberation = {
    sprite_index = 23
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 40
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = Russo-Turkish_war

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        RUS = { country_event =    118001  }  # Territorial Loss event
    }
}

crimean_war_russia = {
    sprite_index = 22
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 40
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = crimean_war

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    9750700    # Territorial Loss event
    }
}

crimean_war_france = {
    sprite_index = 5
    is_triggered_only = yes
    months = 18
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 10
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = crimean_war

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    97508     # Territorial Loss event
    }
}
dismantle_cb_add = {
    sprite_index = 20
    is_triggered_only = yes
    months = 12
    crisis = no

    construction_speed = 1.5

    badboy_factor = 0
    prestige_factor = 10
    peace_cost_factor = 35
    penalty_factor = 3
    always = yes

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 3
    break_truce_militancy_factor = 1
    truce_months = 108

    good_relation_prestige_factor = 0
    good_relation_infamy_factor = 0
    good_relation_militancy_factor = 0

    can_use = {
        NOT = { is_our_vassal = THIS }
        NOT = { has_country_modifier = neutrality_modifier }
        NOT = { has_country_flag = dismantle_declared }
        has_country_flag = in_great_war
        OR = {
            is_greater_power = yes
            is_secondary_power = yes
            colonial_nation = yes
            any_owned_province = { is_overseas = yes }
        }
        civilized = yes
        is_disarmed = no
        is_vassal = no
        war_with = THIS
        THIS = {
            NOT = { has_country_modifier = neutrality_modifier }
            has_country_flag = in_great_war
            is_greater_power = yes
            is_disarmed = no
            is_vassal = no
            mass_politics = 1
        }
    }

    po_disarmament = yes
    po_reparations = yes

    war_name = WAR_DISMANTLE_NAME

    on_add = {
        FROM = {
            set_country_flag = dismantle_declared
        }
        move_issue_percentage = {
            from = pro_military
            to = jingoism
            value = 0.10
        }
    }

    on_po_accepted = {
        country_event = 113000
    }
}

dismantle_cb_add_new = {
    sprite_index = 20
    is_triggered_only = yes
    months = 12
    crisis = no

    construction_speed = 1.5

    badboy_factor = 0
    prestige_factor = 10
    peace_cost_factor = 35
    penalty_factor = 3
    always = yes

    break_truce_prestige_factor = 5
    break_truce_infamy_factor = 3
    break_truce_militancy_factor = 1
    truce_months = 108

    good_relation_prestige_factor = 0
    good_relation_infamy_factor = 0
    good_relation_militancy_factor = 0

    can_use = {
        NOT = { is_our_vassal = THIS }
        NOT = { has_country_flag = dismantle_declared }
        NOT = { has_country_modifier = neutrality_modifier }
        is_greater_power = yes
        is_disarmed = no
        is_vassal = no
        war_with = THIS
        THIS = {
            NOT = { has_country_modifier = neutrality_modifier }
            NOT = { has_country_flag = in_great_war }
            is_greater_power = yes
            is_disarmed = no
            is_vassal = no
            mass_politics = 1
        }
    }

    po_disarmament = yes
    po_reparations = yes

    war_name = WAR_DISMANTLE_NAME

    on_add = {
        FROM = {
            set_country_flag = dismantle_declared
        }
        move_issue_percentage = {
            from = pro_military
            to = jingoism
            value = 0.10
        }
        country_event = 96000
    }

    on_po_accepted = {
        country_event = 113000
    }
}
paraguayan_war_PRG = {
    sprite_index = 23
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 30
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = PARAGUAYAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    1502000     # Territorial Loss event
    }
}

paraguayan_war_ARG = {
    sprite_index = 17
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 70
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = PARAGUAYAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    1503000      # Territorial Loss event
    }
}
italian_war_of_independence = {
    sprite_index = 21
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 30
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name =  ITALIAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    1603000      # Territorial Loss event
    }
}

indian_war_of_independence = {
    sprite_index = 23
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 30
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = INDIA_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    1643000      # Territorial Loss event
    }
}

Spanish_American_war = {
    sprite_index = 5
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 40
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = SPANISH_AMERICAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    1743000      # Territorial Loss event
    }
}
treaty_port_casus_belli_hong_kong = {
	sprite_index = 18
    is_triggered_only = yes
    months = 10
    crisis = no

    badboy_factor = 1
    prestige_factor = 0.5
    peace_cost_factor = 10
    penalty_factor = 2

    break_truce_prestige_factor = 4
    break_truce_infamy_factor = 4
    break_truce_militancy_factor = 1
    truce_months = 15

    good_relation_prestige_factor = 1
    good_relation_infamy_factor = 1
    good_relation_militancy_factor = 0

    always = no

    can_use = {
        always = no
    }

    po_reparations = yes

    tws_battle_factor = 1.5

    war_name = PUNITIVE_EXPEDITION_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.1
        }
    }

    on_po_accepted = {
        random_owned = {
            limit = {
                owner = {
                    civilized = no
                    OR = {
                        owns = 1498 #Macao
                        owns = 1538 #Shanghai
                        owns = 1496 #Hong Kong
                        owns = 1566 #Qingdao
                        owns = 1481 #Lushun - Port Arthur
                        owns = 1569 #Weihaiwei
                        owns = 1606 #Jiaxing
                        owns = 1485 #Taibei
                        owns = 2562 #Tainan
                        owns = 1499 #Hainan
                        owns = 1608 #Ningbo
                        owns = 1695 #Ifni
                        owns = 1177 #Socotra
                        owns = 2048 #Zanzibar
                        owns = 1637 #Cheju
                    }
                }
                THIS = {
                    civilized = yes
                    NOT = { is_culture_group = east_asian }
                    any_owned_province = { port = yes }
                }
            }
            owner = { add_country_modifier = { name = negotiating_unequal_treaty duration = 30 } }
            THIS = { add_country_modifier = { name = negotiating_treaty_hong_kong duration = 30 } }
        }
        #random_owned = { limit = { owner = { civilized = no has_country_modifier = uncivilized_isolationism } }
        #    owner = { remove_country_modifier = uncivilized_isolationism }
        #}
        #random_owned = { limit = { owner = { civilized = no NOT = { has_country_modifier = western_influences } } }
        #    owner = { add_country_modifier = { name = western_influences duration = -1 } }
        #}
        #random_owned = { limit = { owner = { civilized = no NOT = { capital_scope = { has_country_modifier = legation_quarter } } } }
        #    owner = { capital_scope = { add_province_modifier = { name = legation_quarter duration = -1 } } }
        #}
    }
}

kurdish_independence = {
    sprite_index = 23
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 30
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = KURDISTAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    2743000      # Territorial Loss event
    }
}
# Conquest
scramble_for_africa = {
	sprite_index = 24
	is_triggered_only = yes
    constructing_cb = no
	crisis = no
	
	can_use = {
		NOT = { is_our_vassal = THIS }
		# only one state or unciv
		is_independant = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}

	badboy_factor = 1.8
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 4
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	construction_speed = 0.5
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_annex = yes
	
	war_name = WAR_CONQUEST_NAME
}
italian_war_of_independence1 = {
    sprite_index = 21
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 20
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name =  ITALIAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    16030000      # Territorial Loss event
    }
}
depose_qing = {
	sprite_index = 13
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 0.3
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_annex = yes
	po_disarmament = no
    war_name =  NIAN_LUAN

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
     country_event =    16030200    # Territorial Loss event
    }
}
#War Lord Era
zemene_mesafint_China = {
	sprite_index = 20
	is_triggered_only = yes
	months = 12
	crisis = no

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 0.7
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	can_use = {
		THIS = { OR = { tag = CHI  tag = KMT  tag = SXI  tag = HNN tag = GXI tag = HUI  tag = FJN  tag = XBI tag = SZC tag = GMJ tag = XIN tag = GNG tag = YNN tag = ZHI tag = MGL tag = MCK tag = TPG } }
		OR = { tag = CHI  tag = KMT  tag = SXI  tag = HNN tag = GXI tag = HUI  tag = FJN  tag = XBI tag = SZC tag = GMJ tag = XIN tag = GNG tag = YNN tag = ZHI tag = MCK tag = TPG } 
		has_global_flag = warlord_era 
	}

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 1
	penalty_factor = 1
	
	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
	
	po_annex = yes
	
	war_name = WAR_RESTORE_ORDER_NAME
}

acquire_state_China = {
	sprite_index = 20
	is_triggered_only = yes
	months = 12
	crisis = no

	badboy_factor = 0
	prestige_factor = 5
	peace_cost_factor = 0.7
	penalty_factor = 1
	always = yes

	break_truce_prestige_factor = 5
	break_truce_infamy_factor = 2
	break_truce_militancy_factor = 2
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

	can_use = {
		THIS = { OR = { tag = CHI  tag = TAI tag = KMT  tag = SXI  tag = HNN tag = GXI tag = HUI  tag = FJN  tag = XBI tag = SZC tag = GMJ tag = XIN tag = GNG tag = YNN tag = ZHI tag = MGL  tag = MGI tag = KML tag = MCK tag = TPG } }
		OR = { tag = TAI tag = CHI  tag = KMT  tag = SXI  tag = HNN tag = GXI tag = HUI  tag = FJN  tag = XBI tag = SZC tag = GMJ tag = XIN tag = GNG tag = YNN tag = ZHI tag = MCK tag = MGL tag = MGI  tag = KML tag = TPG } 
		has_global_flag = warlord_era 
		NOT = { is_our_vassal = THIS }
		number_of_states = 2 # annex if you want their last state
		any_owned_province = {
			not = { is_core = THIS }
			is_colonial = no
		}
		OR = {
			AND = {
				civilized = yes
				THIS = {
					civilized = yes
				}
			}
			AND = {
				civilized = no
				THIS = {
					civilized = no
				}
			}
		}
		is_independant = yes
		THIS = {
			NOT = {
                has_country_modifier = neutrality_modifier
			}
		}
        	NOT = { has_country_modifier = neutrality_modifier }
	}
	
	allowed_states = {
		is_colonial = no
		any_owned_province = {
			not = {	is_core = THIS }
			is_colonial = no
		}
		not = { any_owned_province = { is_capital = yes } }
	}
	
	allowed_states_in_crisis = {
		any_owned_province = {
			any_neighbor_province = {
				owner = { tag = THIS }
			}
		}
	}		

	po_demand_state = yes
	
	war_name = WAR_TAKE_NAME
	
	on_add = {
		move_issue_percentage = { 
			from = jingoism 
			to = pro_military
			value = 0.25
		}
	}
}
ethiopian_demands = {
    sprite_index = 5
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 20
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name =  ETHIOPIAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    37030000      # Territorial Loss event
    }
}
Mexican-American_War = {
    sprite_index = 22
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 70
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name =  MEXICAN_WAR_NAME

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        country_event =    7703040      # Territorial Loss event
    }
}
# balkan liberation2
balkan_liberation2 = {
    sprite_index = 23
    is_triggered_only = yes
    months = 12
    constructing_cb = no
    crisis = no

	break_truce_prestige_factor = 1
	break_truce_infamy_factor = 1
	break_truce_militancy_factor = 1
	peace_cost_factor = 40
	truce_months = 60
	
	good_relation_prestige_factor = 1
	good_relation_infamy_factor = 1
	good_relation_militancy_factor = 1

    can_use = {
        always = no
        NOT = { is_our_vassal = THIS }
        number_of_states = 2 # annex if you want their last state
        is_vassal = no
        NOT = { has_country_modifier = neutrality_modifier }
        THIS = {
            NOT = {
                has_country_modifier = neutrality_modifier
            }
        }
    }

	po_disarmament = no
	po_reparations = yes
    war_name = Crusade_war

    on_add = {
        move_issue_percentage = {
            from = jingoism
            to = pro_military
            value = 0.25
        }
    }

    on_po_accepted = {
        SIS = { country_event =    148001  }  # Territorial Loss event
    }
}
