﻿focus_tree = {
	id = china_warlord_focus
	
	country = {
		factor = 0
		
		modifier = {
			add = 10
			OR = {
				tag = YUN
				tag = SIK
				tag = GXC
				tag = SHX
				tag = XSM
				tag = GDC
				tag = XIC
				tag = SND
				tag = KHM
				tag = NXM
				tag = GSM
				tag = SIC
				tag = KUM
				tag = HBC
			}
			has_dlc = "Waking the Tiger"
		}
	}
	
	default = no

	continuous_focus_position = { x = 50 y = 1350 }

#	focus = {
#		id = CHI_
#		icon = GFX_
#		prerequisite = { focus = }
#		mutually_exclusive = { focus =  }
#		x = -3
#		y = 0
#		relative_position_id = 
#
#		cost = 10
#
#		ai_will_do = {
#			factor = 1
#		}
#
#		available = {
#
#		}
#		
#		bypass = {
#
#		}
#
#		cancel_if_invalid = yes
#		continue_if_invalid = no
#		available_if_capitulated = no
#
#		complete_tooltip = {
#
#		}
#
#		completion_reward = {
#
#		}
#	}

	focus = {
		id = CHI_secure_internal_politics
		icon = GFX_goal_generic_major_alliance
		x = 6
		y = 0

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			OR = {
				is_ai = no
				date > 1936.1.1
			}
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
			add_political_power = 120
			warlord_rule_all_parties = yes
		}
	}

	#########################
	##### Nationalists ######
	#########################

	focus = {
		id = CHI_cooperation_with_the_nationalists
		icon = GFX_focus_chi_cooperation_with_the_nationalists
		prerequisite = { focus = CHI_secure_internal_politics }
		mutually_exclusive = { focus = CHI_cooperation_with_the_communists focus = CHI_opposition }
		x = -5
		y = 1
		relative_position_id = CHI_secure_internal_politics

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 10
				OR = {
					original_tag = YUN
					original_tag = XSM
					original_tag = GDC
					original_tag = XIC
					original_tag = SND
				}
			}
		}

		available = {
			OR = {
				is_subject = no
				is_subject_of = event_target:WTT_current_china_leader
			}
			NOT = { has_war_with = CHI }
			OR = {
				is_ai = no
				date > 1936.1.1
			}
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_stability = 0.05
			custom_effect_tooltip = CHI_cooperation_with_the_nationalists_effect_tooltip
			CHI = { add_opinion_modifier = { modifier = CHI_cooperation_with_the_nationalists_positive target = ROOT } }
			PRC = { add_opinion_modifier = { modifier = CHI_cooperation_with_the_nationalists_negative target = ROOT } }
		}
	}

	focus = {
		id = CHI_anti_opposition_campaigns
		icon = GFX_focus_generic_provoke_border_clashes
		prerequisite = { focus = CHI_cooperation_with_the_nationalists focus = CHI_cooperation_with_the_communists }
		x = 3
		y = 1
		relative_position_id = CHI_cooperation_with_the_nationalists

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip
			if = {
				limit = {
					AND = {
						has_completed_focus = CHI_cooperation_with_the_nationalists
						NOT = { any_other_country = { has_completed_focus = CHI_cooperation_with_the_communists } }
					}
				}
				custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip_no_communists
			}
			if = {
				limit = {			
					AND = {
						has_completed_focus = CHI_cooperation_with_the_communists
						NOT = { any_other_country = { has_completed_focus = CHI_cooperation_with_the_nationalists } }
					}
				}
				custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip_no_nationalists
			}
		}

		completion_reward = {
			custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip
			if = {
				limit = {
					AND = {
						has_completed_focus = CHI_cooperation_with_the_nationalists
						NOT = { any_other_country = { has_completed_focus = CHI_cooperation_with_the_communists } }
					}
				} 
				custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip_no_communists
			}
			if = {
				limit = {			
					AND = {
						has_completed_focus = CHI_cooperation_with_the_communists
						NOT = { any_other_country = { has_completed_focus = CHI_cooperation_with_the_nationalists } }
					}
				}
				custom_effect_tooltip = CHI_anti_opposition_campaigns_effect_tooltip_no_nationalists
			}
		}
	}

	focus = {
		id = CHI_technological_cooperation
		icon = GFX_goal_generic_scientific_exchange
		prerequisite = { focus = CHI_cooperation_with_the_nationalists }		
		x = -1
		y = 1
		relative_position_id = CHI_cooperation_with_the_nationalists

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		search_filters = { FOCUS_FILTER_RESEARCH }
		completion_reward = {
			if = {
				limit = {
					NOT = {
						CHI = { is_in_tech_sharing_group = CHI_technological_cooperation_tech_group } }
				}
				CHI = { add_to_tech_sharing_group = CHI_technological_cooperation_tech_group }
			}
			add_to_tech_sharing_group = CHI_technological_cooperation_tech_group
		}
	}

	focus = {
		id = CHI_new_model_province
		icon = GFX_goal_generic_construct_infrastructure
		prerequisite = { focus = CHI_cooperation_with_the_nationalists }		
		x = 1
		y = 1
		relative_position_id = CHI_cooperation_with_the_nationalists

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_STABILITY }
		completion_reward = {
			add_stability = 0.1
		}
	}

	focus = {
		id = CHI_root_out_corruption
		icon = GFX_goal_demand_sudetenland
		prerequisite = { focus = CHI_new_model_province }
		mutually_exclusive = { focus = CHI_embrace_the_opium_trade }
		x = -1
		y = 1
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 5
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
			remove_ideas = PRC_government_corruption
		}
	}

	focus = {
		id = CHI_embrace_the_opium_trade
		icon = GFX_goal_generic_trade
		prerequisite = { focus = CHI_new_model_province }
		mutually_exclusive = { focus = CHI_root_out_corruption }
		x = 1
		y = 1
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = CHI_embrace_the_opium_trade
		}
	}

	focus = {
		id = CHI_land_reform
		icon = GFX_goal_generic_position_armies
		prerequisite = { focus = CHI_root_out_corruption }
		x = -2
		y = 2
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
				}
				add_extra_state_shared_building_slots = 1 
			}
		}
	}

	focus = {
		id = CHI_reform_the_administration
		icon = GFX_focus_generic_improve_the_administration
		prerequisite = { focus = CHI_root_out_corruption focus = CHI_embrace_the_opium_trade }
		x = 0
		y = 2
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			remove_ideas = CHI_ineffective_bureaucracy_warlord
		}
	}

	focus = {
		id = CHI_join_the_republican_government
		icon = GFX_goal_generic_national_unity
		prerequisite = { focus = CHI_land_reform focus = CHI_reform_the_administration }
		x = -1
		y = 3
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}

		available = {
			custom_trigger_tooltip = {
				tooltip = is_not_supporting_someone_in_political_struggle
				NOT = {
					any_country = {
						ROOT = { has_country_flag = warlord_supports_@PREV }
					}
				}
			}
			is_subject = no
			NOT = { has_war_with = CHI }
			if = {
				limit = {
					WTT_not_taking_over_national_leadership = no				
				}
				WTT_not_taking_over_national_leadership = yes
			}
			if = {
				limit = {
					WTT_not_china_leader_refused_to_give_up_national_leadership = no
				}
				WTT_not_china_leader_refused_to_give_up_national_leadership = yes
			}
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			custom_effect_tooltip = enable_power_struggle
			WTT_setup_political_struggle = yes
			WTT_add_ROOT_to_political_struggle = yes
		}
	}

	focus = {
		id = CHI_power_struggle
		icon = GFX_goal_generic_demand_territory
		prerequisite = { focus = CHI_join_the_republican_government }
		x = -1
		y = 4
		relative_position_id = CHI_new_model_province

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				is_historical_focus_on = yes 
			}
		}

		available = {
			is_subject = no
			OR = {
				WTT_has_politcal_support_points_30 = yes
				WTT_is_ROOT_current_leader_of_china = yes
			}
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			load_focus_tree = china_nationalist_focus
			set_cosmetic_tag = CHI_warlord_leader
			every_state = {
				limit = {
					is_core_of = CHI
				}
				add_core_of = ROOT
			}
			custom_effect_tooltip = CHL_skip_one_line_tt
			CHI_no_longer_a_warlord_idea_removal = yes
		}
	}	

	#######################
	##### Communists ######
	#######################

	focus = {
		id = CHI_cooperation_with_the_communists
		icon = GFX_focus_chi_cooperation_with_the_communists
		prerequisite = { focus = CHI_secure_internal_politics }
		mutually_exclusive = { focus = CHI_cooperation_with_the_nationalists focus = CHI_opposition }
		x = 0
		y = 1
		relative_position_id = CHI_secure_internal_politics

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 10
				OR = {
					original_tag = SHX
					original_tag = SIK
				}
			}
		}

		available = {
			OR = {
				is_subject = no
				is_subject_of = event_target:WTT_communist_china
			}
			NOT = { has_war_with = PRC }
			NOT = { has_war_with = SOV }
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_political_power = 50
			custom_effect_tooltip = CHI_cooperation_with_the_communists_effect_tooltip
			SOV = {
				add_opinion_modifier = {
					target = ROOT
					modifier = CHI_cooperation_with_the_communists_positive
				}
				add_ai_strategy = {
					type = support
					id = ROOT
					value = 100
				}
			}
			PRC = {
				add_opinion_modifier = {
					target = ROOT
					modifier = CHI_cooperation_with_the_communists_positive
				}
			}
			CHI = {
				add_opinion_modifier = {
					target = ROOT
					modifier = CHI_cooperation_with_the_communists_negative
				}
			}
		}
	}

	focus = {
		id = CHI_land_redistribution
		icon = GFX_goal_generic_soviet_construction
		prerequisite = { focus = CHI_cooperation_with_the_communists }		
		x = 0
		y = 1
		relative_position_id = CHI_cooperation_with_the_communists

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			every_owned_state = {
				limit = {
					is_controlled_by = ROOT
				}
				add_extra_state_shared_building_slots = 1 
			}
		}
	}

	focus = {
		id = CHI_ideological_education
		icon = GFX_focus_generic_socialist_science
		prerequisite = { focus = CHI_land_redistribution }
		x = -1
		y = 1
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			OR = {
				is_subject = no
				if = {
					limit = { is_subject = yes }
					OVERLORD = { has_government = communism }
				}
			}
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_timed_idea = { idea = CHI_ideological_education days = 1095 }
		}
	}

	focus = {
		id = CHI_land_value_tax
		icon = GFX_goal_generic_position_armies
		prerequisite = { focus = CHI_land_redistribution }
		x = 1
		y = 1
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			add_ideas = CHI_land_value_tax
		}
	}

	focus = {
		id = CHI_judiciary_reforms
		icon = GFX_goal_generic_forceful_treaty
		prerequisite = { focus = CHI_ideological_education }
		x = -1
		y = 2
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
			remove_ideas = PRC_government_corruption
		}
	}

	focus = {
		id = CHI_communist_administrators
		icon = GFX_focus_generic_soviet_politics
		prerequisite = { focus = CHI_land_value_tax }
		x = 1
		y = 2
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			remove_ideas = CHI_ineffective_bureaucracy_warlord
		}
	}

	focus = {
		id = CHI_join_the_chinese_soviet
		icon = GFX_goal_generic_war_with_comintern
		prerequisite = { focus = CHI_judiciary_reforms focus = CHI_communist_administrators }
		x = 0
		y = 3
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0
				event_target:WTT_communist_china = {
					is_ai = no
				}
			}
			modifier = {
				factor = 0.1
				is_historical_focus_on = yes
			}
		}

		available = {
			communism > 0.4
			if = {
				limit = { NOT = { tag = SIK } }
				any_neighbor_country = {
					tag = event_target:WTT_communist_china
				}
			}			
			NOT = { has_war_with = PRC }
			NOT = { has_war_with = SOV }
			SOV = { has_government = communism }			
			is_subject = no
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			set_politics = { ruling_party = communism elections_allowed = no }
			add_opinion_modifier = { target = SOV modifier = CHI_join_the_chinese_soviet }
			SOV = { add_opinion_modifier = { target = ROOT modifier = CHI_join_the_chinese_soviet } }

			if = {
				limit = {
					event_target:WTT_communist_china = {
						NOT = { is_in_faction_with = ROOT }
						is_in_faction = no
					}
				}
				event_target:WTT_communist_china = {
					set_rule = { can_create_factions = yes }
					create_faction_from_template = {
						template = faction_template_POR_popular_front_bloc
						name = CHI_the_peoples_front
					}
					add_to_faction = event_target:WTT_communist_china
					add_to_faction = ROOT
					country_event = wtt_warlord_vs_prc.35
				}
			}
		}
	}

	focus = {
		id = CHI_the_yanan_incident
		icon = GFX_goal_support_communism
		prerequisite = { focus = CHI_join_the_chinese_soviet }
		x = 0
		y = 4
		relative_position_id = CHI_land_redistribution

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 0.1
				is_historical_focus_on = yes
			}
		}

		available = {
			has_opinion = {
				target = SOU
				value > 50
			}
			is_subject = no
			NOT = { has_war_with = PRC }
			NOT = { has_war_with = SOU }
			SOU = { has_government = communism }
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			custom_effect_tooltip = CHI_the_yanan_incident_effect_tt
			save_event_target_as = warlord
			add_ideas = PRC_soviet_tribute_1
			SOU = { country_event = { id = wtt_warlord_vs_prc.1 } }
			custom_effect_tooltip = CHL_skip_one_line_tt
			CHI_no_longer_a_warlord_idea_removal = yes
		}
	}

	#############################
	##### Opposition/Share ######
	#############################

	focus = {
		id = CHI_opposition
		icon = GFX_goal_generic_demand_territory
		prerequisite = { focus = CHI_secure_internal_politics }
		mutually_exclusive = { focus = CHI_cooperation_with_the_communists focus = CHI_cooperation_with_the_nationalists }
		x = 5
		y = 1
		relative_position_id = CHI_secure_internal_politics

		cost = 10

		ai_will_do = {
			factor = 1
			modifier = {
				factor = 10
				original_tag = GXC
			}
		}
		available = {
			OR = {
				is_ai = no
				date > 1936.1.1
			}
		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			add_war_support = 0.05
			CHI = { add_opinion_modifier = { modifier = CHI_opposition target = ROOT } }
			if = {
				limit = {
					is_subject = yes
					OVERLORD = {
						is_literally_china = yes
					}
				}
				OVERLORD = {
					set_autonomy = { target = ROOT autonomy_state = autonomy_free }
					create_wargoal = {
						target = ROOT
						type = puppet_wargoal_focus
						expire = 0
					}
				}
			}
			if = {
				limit = { is_faction_leader = yes }
				every_country = {
					limit = { is_literally_china = yes }
					ROOT = { remove_from_faction = PREV }
				}
			}
			else_if = {
				limit = { any_country = { is_in_faction_with = ROOT is_literally_china = yes } }				
				random_country = {
					limit = {
						is_in_faction_with = ROOT
						is_faction_leader = yes
					}
					remove_from_faction = ROOT
				}
			}
					
		}
	}

	focus = {
		id = CHI_institute_cross_border_raids
		icon = GFX_focus_generic_provoke_border_clashes
		prerequisite = { focus = CHI_opposition }		
		x = 0
		y = 1
		relative_position_id = CHI_opposition

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			is_subject = no
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = yes

		completion_reward = {
			custom_effect_tooltip = CHI_institute_cross_border_raids_effect_tooltip
			set_country_flag = CHI_institute_cross_border_raids
		}
	}


	focus = {
		id = CHI_public_works
		icon = GFX_focus_generic_public_works
		prerequisite = { focus = CHI_cooperation_with_the_communists focus = CHI_opposition }
		x = -1
		y = 2
		relative_position_id = CHI_opposition

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			add_ideas = CHI_public_works
		}
	}

	focus = {
		id = CHI_labor_reform
		icon = GFX_goal_generic_construction2
		prerequisite = { focus = CHI_public_works }
		x = -1
		y = 1
		relative_position_id = CHI_public_works

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY FOCUS_FILTER_MANPOWER }
		completion_reward = {
			add_ideas = CHI_labor_reform
		}
	}

	focus = {
		id = CHI_rural_militias
		icon = GFX_goal_generic_military_sphere
		prerequisite = { focus = CHI_public_works }
		x = 1
		y = 1
		relative_position_id = CHI_public_works

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_MANPOWER }
		completion_reward = {
			add_ideas = CHI_rural_militias
		}
	}

	focus = {
		id = CHI_war_taxes
		icon = GFX_goal_generic_consumer_goods
		prerequisite = { focus = CHI_opposition }
		x = 3
		y = 1
		relative_position_id = CHI_opposition

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			add_ideas = CHI_war_taxes
		}
	}

	focus = {
		id = CHI_seek_japanese_support
		icon = GFX_focus_chi_collaboration_with_the_japanese
		prerequisite = { focus = CHI_war_taxes }
		x = -2
		y = 1
		relative_position_id = CHI_war_taxes

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			is_subject = no
			NOT = { has_war_with = JAP }
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			unlock_decision_category_tooltip = CHI_seek_japanese_support
		}
	}

	focus = {
		id = CHI_personal_leadership
		icon = GFX_goal_generic_political_pressure
		prerequisite = { focus = CHI_war_taxes }
		x = 0
		y = 1
		relative_position_id = CHI_war_taxes

		cost = 5

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_command_power = 30
			IF = {
				limit = {
					any_character = {
						is_country_leader = yes
						is_field_marshal = yes 
					}
			
				}
				random_character = {
					limit = {
						is_country_leader = yes
						is_field_marshal = yes 
					}
					add_attack = 1
					add_defense = 1
					add_random_trait = { old_guard brilliant_strategist cavalry_officer politically_connected career_officer infantry_officer war_hero }	
				}
			}
			ELSE = {
				random_character = {
					limit = {
						is_country_leader = yes
					}
					add_field_marshal_role = {
						traits = {  }
						skill = 2
						attack_skill = 2
						defense_skill = 2
						planning_skill = 2
						logistics_skill = 1
					}
					add_random_trait = { old_guard brilliant_strategist cavalry_officer politically_connected 	career_officer infantry_officer war_hero }
				}
			}
		}
	}

	focus = {
		id = CHI_cult_of_personality
		icon = GFX_goal_generic_propaganda
		prerequisite = { focus = CHI_war_taxes }
		x = 2
		y = 1
		relative_position_id = CHI_war_taxes

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_STABILITY }
		completion_reward = {
			add_stability = 0.1
			add_war_support = 0.05
		}
	}

	focus = {
		id = CHI_provoke_border_clashes
		icon = GFX_focus_generic_provoke_border_clashes
		prerequisite = { focus = CHI_personal_leadership }
		mutually_exclusive = { focus = CHI_defensive_posture }
		x = -1
		y = 1
		relative_position_id = CHI_personal_leadership

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			custom_effect_tooltip = CHI_provoke_border_clashes_effect_tooltip
			set_country_flag = CHI_provoke_border_clashes
		}
	}

	focus = {
		id = CHI_defensive_posture
		icon = GFX_goal_generic_defence
		prerequisite = { focus = CHI_personal_leadership }
		mutually_exclusive = { focus = CHI_provoke_border_clashes }
		x = 1
		y = 1
		relative_position_id = CHI_personal_leadership

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_ideas = CHI_defensive_posture
		}
	}

	focus = {
		id = CHI_rapid_mobilization
		icon = GFX_goal_generic_more_territorial_claims
		prerequisite = { focus = CHI_provoke_border_clashes focus = CHI_defensive_posture }
		x = 0
		y = 2
		relative_position_id = CHI_personal_leadership

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
		}

		completion_reward = {
			add_ideas = CHI_rapid_mobilization	
		}
	}

	focus = {
		id = CHI_proclaim_rival_government
		icon = GFX_focus_chi_proclaim_rival_government
		prerequisite = { focus = CHI_rural_militias }
		prerequisite = { focus = CHI_rapid_mobilization }
		x = 1
		y = 2
		relative_position_id = CHI_rural_militias

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {
			is_subject = no
		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			every_state = {
				limit = {
					is_core_of = CHI
				}
				add_core_of = ROOT
			}
			#Switch to dominant ideology or split into 2 focus
			if = {
				limit = {
					OR = {
						has_government = communism
						communism > 0.5
					}
					NOT = { neutrality > 0.5 }
				}
				load_focus_tree = china_communist_focus
			}
			else = {
				load_focus_tree = china_nationalist_focus
			}
			custom_effect_tooltip = CHL_skip_one_line_tt
			CHI_no_longer_a_warlord_idea_removal = yes
		}
	}

	#####################
	##### Industry ######
	#####################

	focus = {
		id = CHI_industrial_investment
		icon = GFX_goal_generic_construct_civ_factory
		x = 12
		y = 0
		relative_position_id = CHI_secure_internal_politics

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = CHI_industrial_investment_IC
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					is_fully_controlled_by = ROOT
					free_building_slots = {
						building = industrial_complex
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = industrial_complex
					level = 2
					instant_build = yes
				}
				set_state_flag = CHI_industrial_investment_IC
			}
		}
	}

	focus = {
		id = CHI_public_education_reform
		icon = GFX_focus_research
		prerequisite = { focus = CHI_industrial_investment }
		x = -2
		y = 1
		relative_position_id = CHI_industrial_investment

		cost = 10

		ai_will_do = {
			factor = 10
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_RESEARCH }
		completion_reward = {
			add_research_slot = 1
		}
	}

	focus = {
		id = CHI_local_arms_production
		icon = GFX_goal_generic_production
		prerequisite = { focus = CHI_industrial_investment }
		x = 0
		y = 1
		relative_position_id = CHI_industrial_investment

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		complete_tooltip = {
			random_state = {
				limit = {
					has_state_flag = CHI_local_arms_production_AF
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
			}
		}

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			random_owned_controlled_state = {
				limit = {
					is_fully_controlled_by = ROOT
					free_building_slots = {
						building = arms_factory
						size > 0
						include_locked = yes
					}
				}
				add_extra_state_shared_building_slots = 2
				add_building_construction = {
					type = arms_factory
					level = 2
					instant_build = yes
				}
				set_state_flag = CHI_local_arms_production_AF
			}
		}
	}

	focus = {
		id = CHI_long_term_economic_planning
		icon = GFX_goal_generic_production2
		prerequisite = { focus = CHI_local_arms_production }
		x = -1
		y = 2
		relative_position_id = CHI_industrial_investment

		cost = 10

		ai_will_do = {
			factor = 4
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_INDUSTRY }
		completion_reward = {
			add_ideas = CHI_long_term_economic_planning
		}
	}

	focus = {
		id = CHI_local_arms_development
		icon = GFX_goal_generic_small_arms
		prerequisite = { focus = CHI_local_arms_production }
		x = 1
		y = 2
		relative_position_id = CHI_industrial_investment

		cost = 10

		ai_will_do = {
			factor = 2
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {
			add_tech_bonus = {
				name = CHI_local_arms_development
				bonus = 1.0
				uses = 1
				category = infantry_weapons
			}
		}
	}

	focus = {
		id = CHI_heavy_weapons_development
		icon = GFX_goal_generic_army_artillery
		prerequisite = { focus = CHI_local_arms_development }
		x = 1
		y = 3
		relative_position_id = CHI_industrial_investment

		cost = 10

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		completion_reward = {

			add_breakthrough_progress = {
				specialization = specialization_land
				value = 0.5
			}

			add_tech_bonus = {
				name = CHI_heavy_weapons_development
				bonus = 1.0
				uses = 1
				category = artillery
			}
		}
	}

	### WARLORD NATIONAL SPIRIT-RELATED FOCUSES ###

	focus = {
		id = CHI_strenghten_warlord_authority
		icon = GFX_focus_generic_military_dictatorship
		x = 16
		y = 0

		cost = 10

		relative_position_id = CHI_secure_internal_politics

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = { FOCUS_FILTER_POLITICAL }
		completion_reward = {
			IF = {
				limit = {
					has_idea = CHI_warlord_state_idea
				}
				swap_ideas = {
					remove_idea = CHI_warlord_state_idea
					add_idea = CHI_warlord_state_idea_2
				}	
			}
		}
	}

	focus = {
		id = CHI_uplift_the_cavalry_regiments
		icon = GFX_goal_generic_cavalry
		x = -1
		y = 1

		cost = 10

		prerequisite = { focus = CHI_strenghten_warlord_authority }

		relative_position_id = CHI_strenghten_warlord_authority

		mutually_exclusive = {
			focus = CHI_uplift_the_mountain_brigades
		}

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = {  }
		completion_reward = {
			swap_ideas = {
				remove_idea = CHI_warlord_state_idea_2
				add_idea = CHI_warlord_state_idea_cav
			}	
		}
	}

	focus = {
		id = CHI_uplift_the_mountain_brigades
		icon = GFX_focus_secret_rearmament
		x = 1
		y = 1

		cost = 10

		prerequisite = { focus = CHI_strenghten_warlord_authority }

		relative_position_id = CHI_strenghten_warlord_authority

		mutually_exclusive = {
			focus = CHI_uplift_the_cavalry_regiments
		}

		ai_will_do = {
			factor = 1
		}

		available = {

		}

		bypass = {

		}

		cancel_if_invalid = yes
		continue_if_invalid = no
		available_if_capitulated = no

		search_filters = {  }
		completion_reward = {

			swap_ideas = {
				remove_idea = CHI_warlord_state_idea_2
				add_idea = CHI_warlord_state_idea_mnt
			}

			add_tech_bonus = {
				name = CHI_uplift_the_mountain_brigades
				bonus = 0.75
				uses = 1
				category = mountaineers_tech
			}	
		}
	}

}
