if = {
	limit = {
		has_dlc = "No Compromise, No Surrender"
	}
	set_capital = {
		state = 622
	}
	set_oob = PRC_1936_TSR
	set_rule = { can_join_factions = no }
	else_if = {
		limit = {
			NOT = { has_dlc = "No Compromise, No Surrender" }
		}
		set_capital = {
			state = 1032
		}
		set_oob = PRC_1936
	}
}

# Politics, oops all communism!

set_politics = {
	ruling_party = communism
	last_election = "1936.1.1"
	election_frequency = 48
	elections_allowed = no
}
set_popularities = {
	communism = 100
}

# Laws
add_ideas = {
	closed_economy
	service_by_requirement
	partial_economic_mobilisation
}

# Starting tech
set_technology = {
	infantry_weapons = 1
	tech_trucks = 1
	militia_tech = 1
	gw_artillery = 1
}

set_grand_doctrine = mass_assault


set_stability = 0.43
set_war_support = 0.5

#Always recruit
recruit_character = PRC_mao_zedong
recruit_character = PRC_zhu_de
recruit_character = PRC_chen_yi
recruit_character = PRC_peng_dehuai
recruit_character = PRC_lin_biao
recruit_character = PRC_kwong_hu
recruit_character = PRC_luo_zhao
recruit_character = PRC_liang_ma
recruit_character = PRC_ziao_jingguang
recruit_character = PRC_fang_zeyi
recruit_character = PRC_ye_jianying
recruit_character = PRC_chen_geng
recruit_character = PRC_liu_bocheng
recruit_character = PRC_otto_braun
recruit_character = PRC_xu_xiangqian
recruit_character = PRC_nie_rongzhen
recruit_character = PRC_su_yu
recruit_character = PRC_gao_gang
recruit_character = PRC_zhou_enlai
recruit_character = PRC_liu_shaoqi
recruit_character = PRC_dong_biwu
recruit_character = PRC_deng_xiaoping
recruit_character = PRC_luo_ruiqing
recruit_character = PRC_kang_sheng

IF = { #Recruit only if we have the dlc
	limit = {
		has_dlc = "No Compromise, No Surrender"
	}

	recruit_character = PRC_zhang_wentian
	recruit_character = PRC_zhang_guotao 
	recruit_character = PRC_wang_ming
	recruit_character = PRC_bo_gu
	recruit_character = PRC_he_long  
	recruit_character = PRC_wang_shiwei
	recruit_character = PRC_ren_bishi
	recruit_character = PRC_wang_jiaxiang
	recruit_character = PRC_mao_zemin
	recruit_character = PRC_wu_han
	recruit_character = PRC_xu_teli
	recruit_character = PRC_zuo_quan
	recruit_character = PRC_chen_changhao
	recruit_character = PRC_deng_zihiu
	recruit_character = PRC_qian_sanqiang
	recruit_character = PRC_he_zehui
	recruit_character = PRC_qian_xuesan
	recruit_character = PRC_guotao_and_mao
	recruit_character = PRC_li_zhen
	recruit_character = PRC_li_lisan
	recruit_character = PRC_chang_qiankun
	recruit_character = PRC_yang_zhicheng
	recruit_character = PRC_he_cheng
	recruit_character = PRC_xie_juezai
	recruit_character = PRC_liu_yalou
	recruit_character = PRC_liu_yuti
	recruit_character = PRC_cai_chang
	recruit_character = PRC_wu_yuzhang
	recruit_character = PRC_chen_yun
	recruit_character = PRC_chen_tanqiu
	recruit_character = PRC_li_xiannian
	recruit_character = PRC_chen_shaomin
	recruit_character = PRC_deng_yingchao
	recruit_character = PRC_bo_yibo
	recruit_character = PRC_lin_boqu
	recruit_character = PRC_shao_shiping
	recruit_character = PRC_chu_qing
	recruit_character = PRC_pavel_mif
	recruit_character = PRC_yang_shangkun
	recruit_character = PRC_luo_shunchu
	recruit_character = PRC_deng_fa
	recruit_character = PRC_zhang_dingcheng
	recruit_character = PRC_lu_sheng
	recruit_character = PRC_rao_shoukun
	recruit_character = PRC_zhang_yunyi
	recruit_character = PRC_xiao_ke
	recruit_character = PRC_ye_ting
	recruit_character = PRC_luo_ronghuan
	recruit_character = PRC_cheng_zihua
	recruit_character = PRC_zhang_qinqiu
	recruit_character = PRC_su_zhenhua
	recruit_character = PRC_wang_shusheng
	recruit_character = PRC_ulanhu
	recruit_character = PRC_zhang_zongxun

	1046 = {
		add_dynamic_modifier = { modifier = PRC_the_yulin_garrison }
	}

	ELSE = { #Recruit only if we do NOT have the dlc
		recruit_character = PRC_lin_bojiu
		recruit_character = PRC_gao_qiu
		recruit_character = PRC_ma_jin
		recruit_character = PRC_liang_shen
		recruit_character = PRC_deng_ye_peng
		recruit_character = PRC_hsia_tian
		recruit_character = PRC_zhang_wei
		recruit_character = PRC_he_yuandang
	}
}


save_global_event_target_as = WTT_communist_china

# Balance of Power or Non-DLC ideas counterpart

IF = {
	limit = {
		has_dlc = "No Compromise, No Surrender"
	}

	set_power_balance = {
	    id = PRC_communist_power_struggle
	    left_side = PRC_bop_left_side
	    right_side = PRC_bop_right_side
	    set_value = -0.15
	}

	#### Dynamic Modifiers ####

	### Central Committee
	set_variable = { PRC_central_committee_justify_war_goal_time = 0.5 }
	set_variable = { PRC_central_committee_political_power_factor = 0 }
	set_variable = { PRC_central_committee_faction_influence_war_score_factor = 0 }
	set_variable = { PRC_central_committee_party_popularity_stability_factor = 0 }
	set_variable = { PRC_central_committee_faction_influence_contribution_factor = 0 }
	set_variable = { PRC_central_committee_subjects_autonomy_gain = 0 }

	add_dynamic_modifier = {
		modifier = PRC_central_committee
	}

	### The Chinese Red Army ###
	set_variable = { PRC_the_chinese_army_training_time_factor = 0.1 }
	set_variable = { PRC_the_chinese_army_army_org_factor = -0.1 }
	set_variable = { PRC_the_chinese_army_conscription_factor = -0.1 }
	set_variable = { PRC_the_chinese_army_experience_gain_army_factor = -0.15 }
	set_variable = { PRC_the_chinese_army_equipment_capture = 0 }
	set_variable = { PRC_the_chinese_army_army_armor_attack_factor = -0.1 } 
	set_variable = { PRC_the_chinese_red_army_land_night_attack = 0 }
	set_variable = { PRC_the_chinese_red_army_org_loss_when_moving = 0 }
	set_variable = { PRC_the_chinese_red_army_attrition = -0.05 }
	set_variable = { PRC_the_chinese_red_army_max_dig_in = 0 }
	set_variable = { PRC_the_chinese_red_army_army_attack_factor = -0.1 }
	set_variable = { PRC_the_chinese_red_army_army_morale_factor = 0 }
	set_variable = { PRC_the_chinese_red_army_max_planning_factor = -0.05 }
	set_variable = { PRC_the_chinese_red_army_army_infantry_attack_factor = 0 }
	set_variable = { PRC_the_chinese_red_army_army_artillery_attack_factor = 0 }

	add_dynamic_modifier = {
		modifier = PRC_the_chinese_red_army
	}

	## Bolshevik dominance
	set_variable = { PRC_bolshevik_dominance_research_speed_factor = 0 }
	set_variable = { PRC_bolshevik_dominance_production_speed_industrial_complex_factor = 0 } ## Make sure same values as BOP
	set_variable = { PRC_bolshevik_dominance_political_power_gain = 0 }
	set_variable = { PRC_bolshevik_dominance_industrial_capacity_factory = 0 }
	set_variable = { PRC_bolshevik_dominance_industrial_capacity_dockyard = 0 }


	### PLA Navy ###
	set_variable = { PRC_pla_navy_naval_coordination = 0 }
	set_variable = { PRC_pla_navy_naval_accidents_chance = -0.05 }
	set_variable = { PRC_pla_navy_navy_org_factor = 0.05 }
	set_variable = { PRC_pla_navy_navy_submarine_attack_factor = 0 }
	set_variable = { PRC_pla_navy_industrial_capacity_dockyard = 0 }
	set_variable = { PRC_pla_navy_sortie_efficiency = 0 }
	set_variable = { PRC_pla_navy_navy_max_range_factor = -0.1 }

	### PLA Air Force ### 
	set_variable = { PRC_pla_air_force_air_ace_generation_chance_factor = 0 }
	set_variable = { PRC_pla_air_force_air_cas_efficiency = 0.05 }
	set_variable = { PRC_pla_air_force_air_intercept_efficiency = 0.025 }
	set_variable = { PRC_pla_air_force_air_strategic_bomber_bombing_factor = 0 }
	set_variable = { PRC_pla_air_force_air_cas_present_factor = 0 }
	set_variable = { PRC_pla_air_force_air_agility_factor = 0 }


	### Agrarian Society ###
	set_variable = { PRC_industry_production_speed_buildings_factor = -0.1 }
	set_variable = { PRC_industry_global_building_slots_factor = 0 }
	set_variable = { PRC_industry_research_speed_factor = -0.15 }
	set_variable = { PRC_industry_industrial_capacity_factory = -0.1 }
	set_variable = { PRC_industry_production_factory_start_efficiency_factor = 0 }
	set_variable = { PRC_industry_line_change_production_efficiency_factor = 0 }
	set_variable = { PRC_industry_production_factory_max_efficiency_factor = 0 }
	set_variable = { PRC_industry_local_resources_factor = 0 }

	add_dynamic_modifier = {
		modifier = PRC_agrarian_society
	}

	set_variable = { PRC_asian_democratic_union_num_of_members = 1 }
	set_variable = { PRC_asian_democratic_union_modifier_research_speed_factor = 0 }
	set_variable = { PRC_asian_democratic_union_modifier_consumer_goods_factor = 0 }

	### The Great Production Movement ### 


	## Helper variables
	set_variable = { PRC_initialize_five_year_plan_civ_factories_multiplier = 1.5 } ## Used to calculate NF
	set_variable = { PRC_initialize_five_year_plan_mil_factories_multiplier = 2 }
	set_variable = { PRC_initialize_shorter_market_plans_civ_factories_multiplier = 1.5 } # 1.3 led to things like 2.6 factories required
	set_variable = { PRC_initialize_shorter_market_plans_mil_factories_multiplier = 1.5 }
	set_variable = { PRC_five_year_plan_length = 1825 } ## 5 years
	set_variable = { PRC_shorter_market_plan_length = 900 } 

	set_variable = { PRC_gain_faction_inluence_number = 0.001 } #0.1%
	set_variable = { PRC_infiltration_cost = 100 }
	set_variable = { PRC_infiltration_cost_base = PRC_infiltration_cost }

	set_variable = { PRC_28_bolshevik_decisions_cost = 50 }

	set_variable = { PRC_rural_recruitment_manpower = 1000 }
	set_variable = { PRC_raid_weapon_depots_equipment_limited_success = 250 }
	set_variable = { PRC_raid_weapon_depots_equipment_gain_success = 500 }
	set_variable = { PRC_raid_weapon_depots_equipment_critical_success = 1000 }

	set_variable = { PRC_emergency_protocol_idea_days = 180 }



	### Create Operatives 

	if = {
		limit = {
			has_DLC = "La Resistance"
		}
		## Mo Xiong
		create_operative_leader = {
			name = PRC_mo_xiong 
			bypass_recruitment = no 
			available_to_spy_master = yes 
			traits = { operative_double_agent }
			gfx = GFX_portrait_PRC_mo_xiong 
			nationalities = { PRC CHI }
			gender = male
		}
		## Xiong Xiangui
		create_operative_leader = {
			name = PRC_xiong_xianghui
			bypass_recruitment = no 
			available_to_spy_master = yes 
			traits = { operative_double_agent operative_well_groomed }
			gfx = GFX_portrait_PRC_xiong_xianghui 
			nationalities = { PRC CHI }
			gender = male
		}
		## Li Kenong
		create_operative_leader = {
			name = PRC_li_kenong
			bypass_recruitment = no 
			available_to_spy_master = yes 
			gfx = GFX_portrait_PRC_li_kenong
			traits = { operative_double_agent }
			nationalities = { PRC CHI } 
			gender = male
		}
	}

	
	### Starting Country flags 

	set_country_flag = PRC_pavel_mif_alive

	### Ideas ###

	add_ideas = PRC_defunct_state_bank

	else_if = { #TODO_MH replace these with dynamic modifiers that can be interacted with
		limit = {
			has_dlc = "Waking the Tiger"
		}
		add_ideas = {
			PRC_the_long_march_1
			PRC_red_army_weakened
			PRC_low_popular_support_3
			PRC_power_struggles
		}
	}
}



add_opinion_modifier = { target = CHI modifier = hostile_status }



1939.1.1 = {

	add_political_power = 1198
	add_command_power = 100
	if = {
		limit = {
			has_dlc = "No Compromise, No Surrender"
		}
		set_capital = {
			state = 1032
		}
		set_oob = PRC_1939_TSR
		set_rule = { can_join_factions = yes }
		else_if = {
			limit = {
				NOT = { has_dlc = "No Compromise, No Surrender" }
			}
			set_capital = {
				state = 1032
			}
			set_oob = PRC_1939
		}
	}

	IF = {
		limit = {
			NOT = {
				has_dlc = "No Compromise, No Surrender"
			}
		}
		complete_national_focus = PRC_strengthen_the_central_secretariat
		complete_national_focus = PRC_land_redistribution
		complete_national_focus = PRC_enforce_the_three_rules
		complete_national_focus = PRC_agrarian_socialism
		complete_national_focus = PRC_the_yanan_base_area
		complete_national_focus = PRC_focus_on_china
		complete_national_focus = PRC_infiltration
		complete_national_focus = PRC_revolutionary_military_commission
		complete_national_focus = PRC_literacy_programs
		complete_national_focus = CHI_invite_foreign_investors
		complete_national_focus = CHI_mission_to_the_soviet_union
		complete_national_focus = PRC_ban_the_opium_trade
		complete_national_focus = PRC_military_intelligence_department
		complete_national_focus = PRC_prepare_for_war_with_japan
		complete_national_focus = PRC_anti_japanese_expedition
		complete_national_focus = PRC_provoke_japan
		complete_national_focus = PRC_mobile_warfare

		set_research_slots = 3

		add_ideas = {
			PRC_revolutionary_military_commission
			PRC_low_popular_support_3
			PRC_the_long_march_2
			PRC_mobile_warfare
			PRC_focus_on_china
		}
		remove_ideas = {
			PRC_low_popular_support_1
			PRC_the_long_march_1
		}
		ELSE_IF = {
			limit = {
				has_dlc = "No Compromise, No Surrender"
			}
			#Complete Focuses
			complete_national_focus = PRC_put_an_end_to_the_sufan
			complete_national_focus = PRC_eight_points_for_attention
			complete_national_focus = PRC_rally_the_industry
			complete_national_focus = PRC_long_march_to_recovery
			complete_national_focus = PRC_reestablish_the_state_bank
			complete_national_focus = PRC_red_army_reborn
			complete_national_focus = PRC_develop_yanan_soviet
			complete_national_focus = PRC_rally_the_peasants
			complete_national_focus = PRC_guide_central_committee
			complete_national_focus = PRC_leadership_of_mao
			complete_national_focus = PRC_on_guerilla_warfare
			complete_national_focus = PRC_three_rules_of_discipline
			complete_national_focus = PRC_request_for_aid
			complete_national_focus = PRC_establish_friendly_bases
			complete_national_focus = PRC_propaganda_efforts
			complete_national_focus = PRC_secure_the_peoples_support
			complete_national_focus = PRC_raid_weapon_depots
			complete_national_focus = PRC_dissent_in_the_united_front
			complete_national_focus = PRC_empower_the_guerillas

			#Handle Focuses Manually
			unlock_national_focus = PRC_the_westward_expedition
			unlock_national_focus = PRC_expedite_land_revolution
			unlock_national_focus = PRC_the_eastward_expedition
			unlock_national_focus = PRC_burn_the_paper_tigers
			unlock_national_focus = PRC_usurp_control_over_yanan
			unlock_national_focus = PRC_CSCEC_mils
			unlock_national_focus = PRC_ban_special_goods_trade
			unlock_national_focus = PRC_asymmetric_warfare

			add_ideas = PRC_trade_of_special_goods_banned_stabilised
			remove_ideas = PRC_mediating_general_secretary_idea #This is given through a focus, so we need to remove it
			add_ideas = PRC_mediating_general_secretary_idea_drifting_right

			add_to_variable = {	PRC_the_chinese_red_army_max_dig_in = 5 }
			add_to_variable = {	PRC_the_chinese_red_army_org_loss_when_moving = -0.05 }

			#These Events & Focuses will Sway the BoP:
			#PRC_expedite_land_revolution -5%

			add_power_balance_value = {
				id = PRC_communist_power_struggle
				value = -0.05
			}
		}
	}
	
	# Chinese Popular Front effects
	add_to_war = {
		targeted_alliance = CHI
		enemy = JAP
		hostility_reason = asked_to_join
	}
	set_country_flag = PRC_joined_CHI_against_JAP
	remove_opinion_modifier = { target = CHI modifier = hostile_status }
	add_state_claim = 612
	add_state_claim = 1474
	add_state_claim = 1475
	add_state_claim = 1455
	add_state_claim = 1456
	add_state_claim = 1458
	add_state_claim = 1459
	add_state_claim = 611
	add_state_claim = 1476
	add_state_claim = 714
	add_state_claim = 1423
	add_state_claim = 1424
	add_state_claim = 1425
	add_state_claim = 1426
	add_state_claim = 1427
	add_state_claim = 1428
	add_state_claim = 1451
	add_state_claim = 1429
	add_state_claim = 1430
	add_state_claim = 1431
	add_state_claim = 717
	add_state_claim = 1417
	add_state_claim = 1418
	add_state_claim = 1419
	add_state_claim = 1420
	add_state_claim = 1421
	add_state_claim = 1422
	add_state_claim = 328
	add_state_claim = 1434
	add_state_claim = 1435
	add_state_claim = 1436
	add_state_claim = 1437
	add_state_claim = 1438
	add_state_claim = 1439
	add_state_claim = 1440
	add_state_claim = 1416
	add_state_claim = 716
	add_state_claim = 715
	add_state_claim = 1443
	add_state_claim = 1445
	add_state_claim = 610
	add_state_claim = 1444
	add_state_claim = 1446
	add_state_claim = 1447
	add_state_claim = 1448
	add_state_claim = 1449
	add_state_claim = 1450
	add_state_claim = 609
	add_state_claim = 1487
	add_state_claim = 1488
	add_state_claim = 1038
	add_state_claim = 1494
	add_state_claim = 1495
	add_state_claim = 1496
	add_state_claim = 1497
	add_state_claim = 597
	add_state_claim = 1499
	add_state_claim = 1498
	add_state_claim = 1501
	add_state_claim = 1502
	add_state_claim = 1503
	add_state_claim = 1504
	add_state_claim = 1505
	add_state_claim = 614
	add_state_claim = 1490
	add_state_claim = 1491
	add_state_claim = 1492
	add_state_claim = 1493
	add_state_claim = 525
	add_state_claim = 608
	add_state_claim = 1489
	add_state_claim = 615
	add_state_claim = 527

	add_ideas = {
		#laws
		partial_economic_mobilisation
		service_by_requirement
		closed_economy
	}
	
	set_technology = {
		tech_mountaineers = 1
		#doctrines
		#air_superiority = 1

		#electronics
		electronic_mechanical_engineering = 1
		radio = 1
		mechanical_computing = 1
		computing_machine = 1
		basic_encryption = 1
		basic_decryption = 1

		#industry
		basic_machine_tools = 1
		improved_machine_tools = 1
		advanced_machine_tools = 1
		fuel_silos = 1
		fuel_refining = 1
		construction1 = 1
		construction2 = 1
		construction3 = 1
		concentrated_industry = 1
		concentrated_industry2 = 1
		concentrated_industry3 = 1
	}

set_grand_doctrine = mass_assault
set_sub_doctrine = peoples_war
add_mastery = {
    amount = 125
    sub_doctrine = peoples_war
}



}
