Losa10/PreTrain-HOI4-Modding-Assistant huggingface dataset:
### Entity: National Focus
Tree: pak_focus
Component: PAK_Family_Programs
Constructs: prerequisite, add_ideas, completion_reward
Source: game
File: common/national_focus/pakistan.txt

Code:
focus = {
	id = PAK_Family_Programs
	icon = GFX_goal_womens_rights
	cost = 10
	prerequisite = {
		focus = PAK_Secularism
	}
	x = 4
	y = 3
	relative_position_id = PAK_General_Election
	ai_will_do = {
		factor = 10
	}
	completion_reward = {
		add_ideas = PAK_Family_Programs
	}
}
### Entity: National Focus
Tree: lit_focus
Component: LIT_defence_from_above
Constructs: prerequisite, completion_reward, cancel_if_invalid, add_building_construction
Source: game
File: common/national_focus/lithuania.txt

Code:
focus = {
	id = LIT_defence_from_above
	icon = GFX_focus_generic_air_defense
	prerequisite = {
		focus = LIT_rapid_fortifications_in_the_east
	}
	x = 1
	y = 1
	relative_position_id = LIT_rapid_fortifications_in_the_east
	cost = 10
	ai_will_do = {
		factor = 1
	}
	available = {

	}
	bypass = {

	}
	cancel_if_invalid = yes
	continue_if_invalid = no
	available_if_capitulated = no
	completion_reward = {
		capital_scope = {
			add_building_construction = {
				type = anti_air_building
				level = 2
				instant_build = yes
			}
		}
	}
}
### Entity: Character
Component: TIB_namgang_rinpoche
Source: game
File: common/characters/TIB.txt

Code:
TIB_namgang_rinpoche = {
	name = TIB_namgang_rinpoche
	portraits = {
		civilian = {
			large = GFX_portrait_Namgang_Rinpoche
		}
	}
}
### Entity: Character
Component: CAN_thomas_victor_anderson
Source: game
File: common/characters/CAN.txt

Code:
CAN_thomas_victor_anderson = {
	name = CAN_thomas_victor_anderson
	portraits = {
		army = {
			large = GFX_portrait_CAN_thomas_victor_anderson
			small = GFX_portrait_CAN_thomas_victor_anderson_small
		}
	}
	corps_commander = {
		skill = 4
		attack_skill = 2
		defense_skill = 3
		planning_skill = 3
		logistics_skill = 5
		legacy_id = -1
	}
}
### Entity: Scripted Effect
Component: EAI_PR_STRATEGIES_small_airframe
Constructs: limit, is_major, set_temp_variable, check_variable, add_to_temp_variable
Source: game
File: common/scripted_effects/EAI_RESEARCH_PRIORITY_TREE_air.txt

Code:
EAI_PR_STRATEGIES_small_airframe = {
	if = {
		limit = {
			OR = {
				AND = {
					EAI_FTR_tech_focus = yes
					num_of_military_factories = > 15
				} {
					EAI_CAS_tech_focus = yes
					num_of_military_factories = > 15
				} {
					EAI_CV_tech_focus = yes
					is_major = yes
				} {
					EAI_NAV_tech_focus = yes
					is_major = yes
				}
			}
		}
		set_temp_variable = {
			prio_cat = @PR_small_airframe
		}
		if = {
			limit = {
				check_variable = {
					EAI_FTR_tech_focus = yes
				}
			}
			add_to_temp_variable = {
				prio_cat = 300
			}
		} {
			limit = {
				is_major = no
			}
			set_temp_variable = {
				prio_mult = num_of_military_factories
			}
			divide_temp_variable = {
				prio_mult = 50
			}
			clamp_temp_variable = {
				var = prio_mult
				min = 0
				max = 1
			}
			multiply_temp_variable = {
				prio_cat = prio_mult
			}
		} {
			limit = {
				set_temp_variable = {
					_prio_tech = token:iw_small_airframe
				} {
					_prio_val = prio_cat
				} {
					_year = 1936
				}
				date = > 1936.6.1
				EAI_PR_year_FACTOR = yes
			}
			EAI_PR_add_to_priority_research_queue = yes
		} {
			limit = {
				set_temp_variable = {
					_prio_tech = token:basic_small_airframe
				} {
					_prio_val = prio_cat
				} {
					_year = 1936
				}
				date = > 1936.6.1
				EAI_PR_year_FACTOR = yes
			}
			EAI_PR_add_to_priority_research_queue = yes
		} {
			limit = {
				set_temp_variable = {
					_prio_tech = token:improved_small_airframe
				} {
					_prio_val = prio_cat
				} {
					_year = 1940
				}
				date = > 1939.10.1
				EAI_PR_year_FACTOR = yes
			}
			EAI_PR_add_to_priority_research_queue = yes
		} {
			limit = {
				set_temp_variable = {
					_prio_tech = token:advanced_small_airframe
				} {
					_prio_val = prio_cat
				} {
					_year = 1944
				}
				date = > 1943.10.1
				EAI_PR_year_FACTOR = yes
			}
			EAI_PR_add_to_priority_research_queue = yes
		} {
			limit = {
				set_temp_variable = {
					_prio_tech = token:modern_small_airframe
				} {
					_prio_val = prio_cat
				} {
					_year = 1945
				}
				EAI_JET_tech_focus = yes
				date = > 1944.10.1
				EAI_PR_year_FACTOR = yes
			}
			EAI_PR_add_to_priority_research_queue = yes
		}
	}
}
### Entity: Character
Component: NGA_nccr
Source: game
File: common/characters/NGA.txt

Code:
NGA_nccr = {
	advisor = {
		slot = navy_chief
		idea_token = NGA_nccr
		allowed = {
			original_tag = NGA
		}
		traits = {
			navy_chief_commerce_raiding_2
		}
		ai_will_do = {
			factor = 1.0
		}
	}
	portraits = {
		army = {
			small = GFX_idea_generic_navy_african_2
		}
	}
}
### Entity: Event
Component: GEO_event.1
Constructs: division_template, limit, owns_state, has_war_with, has_country_flag, add_political_power, has_template
Source: game
File: events/GEO_events.txt

Code:
country_event = {
	id = GEO_event.1
	title = GEO_event.1.t
	desc = GEO_event.1.desc
	picture = GFX_report_event_czech_soldiers_02
	trigger = {
		has_country_flag = georgian_legion
		has_template = Georgian Volunteers
		GEO = {
			owns_state = 231
			NOT = {
				has_war_with = ROOT
			}
		}
	}
	mean_time_to_happen = {
		days = 60
	}
	option = {
		name = ARM_event.2.a
		add_political_power = -25
	} {
		name = ARM_event.2.b
		delete_unit_template_and_units = {
			division_template = Georgian Volunteers
		}
		if = {
			limit = {
				country_exists = GEO
			}
			GEO = {
				country_event = {
					id = ARM_event.3
				}
			}
		}
	}
}
### Entity: Event
Component: tfv_south_africa.100
Constructs: is_triggered_only, ai_chance, limit, set_politics, add_popularity, add_to_faction
Source: game
File: events/TFV_South_Africa.txt

Code:
country_event = {
	id = tfv_south_africa.100
	title = tfv_south_africa.100.t
	desc = tfv_south_africa.100.d
	picture = GFX_report_event_african_soldiers
	is_triggered_only = yes
	option = {
		name = tfv_south_africa.64.a
		ai_chance = {
			base = 100
		}
		WES = {
			if = {
				limit = {
					SAF = {
						controls_state = 699
					}
				}
				transfer_state = 699
			}
		}
		SAF = {
			puppet = WES
		}
	} {
		name = tfv_south_africa.64.b
		ai_chance = {
			base = 0
		}
		WES = {
			if = {
				limit = {
					SAF = {
						controls_state = 699
					}
				}
				transfer_state = 699
			}
			hidden_effect = {
				set_politics = {
					ruling_party = communism
					elections_allowed = no
				}
				add_popularity = {
					ideology = communism
					popularity = 0.75
				}
			}
		}
		SAF = {
			add_to_faction = WES
		}
	}
}
### Entity: Event
Component: SEA_PHI_political_events.14
Constructs: is_triggered_only, limit, has_subject, is_in_faction_with, is_faction_leader, remove_from_faction, declare_war_on
Source: game
File: events/SEA_Philippines.txt

Code:
country_event = {
	id = SEA_PHI_political_events.14
	title = SEA_PHI_political_events.14.t
	desc = SEA_PHI_political_events.14.desc
	picture = GFX_report_event_FDR_speech
	is_triggered_only = yes
	option = {
		FROM = {
			if = {
				limit = {
					has_subject = ROOT
				}
				end_puppet = ROOT
			} {
				limit = {
					is_in_faction_with = PHI
					is_faction_leader = yes
				}
				remove_from_faction = ROOT
			}
			declare_war_on = {
				target = ROOT
				type = topple_government
			}
			hidden_effect = {
				activate_mission = USA_execute_war_plan_brown
			}
		}
		activate_mission = PHI_defend_against_USA
		name = SEA_PHI_political_events.14.a
	}
}
### Entity: National Focus
Tree: afg_focus
Component: AFG_reform_4
Constructs: prerequisite, limit, completion_reward, add_tech_bonus, random_core_state, is_owned_and_controlled_by, add_extra_state_shared_building_slots, add_building_construction
Source: game
File: common/national_focus/afghanistan.txt

Code:
focus = {
	id = AFG_reform_4
	icon = GFX_focus_generic_modernize_industry
	prerequisite = {
		focus = AFG_reform_1
	}
	x = 0
	y = 1
	relative_position_id = AFG_reform_1
	cost = 10
	ai_will_do = {
		factor = 10
	}
	available = {

	}
	search_filters = {
		FOCUS_FILTER_INDUSTRY FOCUS_FILTER_RESEARCH
	}
	completion_reward = {
		add_tech_bonus = {
			name = AFG_reform_4
			bonus = 0.5
			uses = 2
			category = industry
		}
		random_core_state = {
			limit = {
				free_building_slots = {
					building = industrial_complex
					size = > 0
					include_locked = yes
				}
				is_owned_and_controlled_by = ROOT
			}
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
		}
	}
}
### Entity: Event
Component: poland.158
Constructs: has_completed_focus, has_government, fire_only_once, is_puppet, set_country_flag
Source: game
File: events/r56_Poland.txt

Code:
news_event = {
	id = poland.158
	title = poland.158.t
	desc = poland.158.d
	picture = GFX_Nationalist_Congress
	fire_only_once = yes
	trigger = {
		tag = POL
		POL = {
			has_government = democratic
			has_completed_focus = POL_The_Endecja_Movement
			is_puppet = no
		}
	}
	mean_time_to_happen = {
		days = 1
	}
	option = {
		name = poland.158.a
		hidden_effect = {
			set_country_flag = POL_Nationalists_In_Power
		}
	}
}
### Entity: Idea
Component: AFG_red_cross
Constructs: stability_factor
Source: game
File: common/ideas/r56_afghanistan.txt

Code:
AFG_red_cross = {
	picture = AFG_red_crescent
	allowed = {
		always = yes
	}
	allowed_civil_war = {
		always = yes
	}
	modifier = {
		consumer_goods_factor = 0.1
		stability_factor = 0.05
		custom_modifier_tooltip = AFG_red_cross_idea_tt
	}
}
### Entity: Event
Component: lar_split_belgium.2
Constructs: is_triggered_only, ai_chance, limit, has_subject
Source: game
File: events/LaR_France.txt

Code:
country_event = {
	id = lar_split_belgium.2
	title = lar_split_belgium.2.t
	desc = lar_split_belgium.2.desc
	Picture = GFX_report_event_generic_sign_treaty1
	is_triggered_only = yes
	option = {
		name = lar_split_belgium.2.a
		ai_chance = {
			factor = 100
		}
		IF = {
			limit = {
				FROM = {
					has_subject = COG
				}
			}
			puppet = COG
		}
		puppet = FROM
		transfer_state = 34 980
	}
}
### Entity: Idea
Component: POL_Air_Focus
Constructs: removal_cost, equipment_bonus, build_cost_ic
Source: game
File: common/ideas/r56_poland.txt

Code:
POL_Air_Focus = {
	allowed = {
		original_tag = POL
		always = no
	}
	allowed_civil_war = {
		always = yes
	}
	picture = generic_air_bonus
	removal_cost = -1
	equipment_bonus = {
		small_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		cv_small_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		small_plane_cas_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		cv_small_plane_cas_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		small_plane_naval_bomber_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		cv_small_plane_naval_bomber_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		medium_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		medium_plane_fighter_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		medium_plane_scout_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		large_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
		large_plane_maritime_patrol_plane_airframe = {
			build_cost_ic = -0.1
			instant = yes
		}
	}
}
### Entity: National Focus
Tree: usa_focus
Component: USA_carrier_primacy
Constructs: prerequisite, completion_reward, add_breakthrough_progress, add_tech_bonus, create_equipment_variant, allow_without_tech
Source: game
File: common/national_focus/usa.txt

Code:
focus = {
	id = USA_carrier_primacy
	icon = GFX_goal_generic_navy_carrier
	prerequisite = {
		focus = USA_bureau_of_ships
	}
	mutually_exclusive = {
		focus = USA_battleship_primacy
	}
	x = -1
	y = 1
	relative_position_id = USA_bureau_of_ships
	cost = 10
	available_if_capitulated = yes
	search_filters = {
		FOCUS_FILTER_RESEARCH
	}
	completion_reward = {
		add_breakthrough_progress = {
			specialization = specialization_naval
			value = 0.25
		}
		add_tech_bonus = {
			name = USA_carrier_primacy
			bonus = 1.0
			uses = 2
			category = cv_tech
		}
		create_equipment_variant = {
			name = Essex Class
			name_group = USA_CV_HISTORICAL
			type = ship_hull_carrier_2
			allow_without_tech = no
			modules = {
				fixed_ship_deck_slot_1 = ship_deck_space
				fixed_ship_deck_slot_2 = ship_deck_space
				fixed_ship_anti_air_slot = ship_anti_air_2
				fixed_ship_engine_slot = carrier_ship_engine_3
				fixed_ship_secondaries_slot = empty
				front_1_custom_slot = ship_deck_space
				mid_1_custom_slot = ship_armor_carrier_deck
			}
			design_team = mio:USA_newport_news_shipbuilding_organization
		}
	}
}
### Entity: AI Strategy
Component: GER_amphibious_tanks
Constructs: has_war, is_major, any_of
Source: game
File: common/ai_equipment/GER_tank.txt

Code:
GER_amphibious_tanks = {
	category = land
	blocked_for = {

	}
	available_for = {
		GER
	}
	roles = {
		land_amphibious_tank
	}
	priority = {
		factor = 20
	}
	basic_amphibious_tank_default = {
		priority = {
			factor = 10
		}
		history = yes
		target_variant = {
			match_value = 1000
			type = amphibious_tank_chassis
			modules = {
				main_armament_slot = {
					any_of = {
						tank_auto_cannon_2 tank_auto_cannon
					}
				}
				turret_type_slot = tank_light_turret_type
				suspension_type_slot = tank_bogie_suspension
				armor_type_slot = tank_riveted_armor
				engine_type_slot = tank_gasoline_engine
				special_type_slot_1 = tank_radio_module
				special_type_slot_2 = empty
				special_type_slot_3 = empty
				special_type_slot_4 = empty
			}
			upgrades = {
				tank_nsb_engine_upgrade = 5
				tank_nsb_armor_upgrade = {
					base = 2
					modifier = {
						add = 2
						has_war = yes
					} {
						any_enemy_country = {
							is_major = yes
						}
						add = 3
					}
				}
			}
		}
		allowed_modules = {
			tank_auto_cannon tank_auto_cannon_2 tank_bogie_suspension tank_riveted_armor tank_gasoline_engine tank_light_two_man_tank_turret tank_radio_3 tank_radio_2 tank_radio_1
		}
	}
}
### Entity: National Focus
Tree: sov_focus
Component: SOV_the_komsomol
Constructs: prerequisite, completion_reward, add_political_power, add_popularity, unlock_propaganda_campaign_tt, unlock_propaganda_campaign_slot_tt, unlock_decision_tooltip
Source: game
File: common/national_focus/soviet.txt

Code:
focus = {
	id = SOV_the_komsomol
	icon = GFX_SOV_the_komsomol_ccp_2d_sov_compatibility
	prerequisite = {
		focus = SOV_expand_the_agitprop
	}
	x = 2
	y = 1
	relative_position_id = SOV_expand_the_agitprop
	cost = 5
	available = {

	}
	search_filters = {
		FOCUS_FILTER_POLITICAL FOCUS_FILTER_PROPAGANDA
	}
	completion_reward = {
		add_political_power = 50
		add_popularity = {
			ideology = communism
			popularity = 0.1
		}
		custom_effect_tooltip = unlock_propaganda_campaign_tt unlock_propaganda_campaign_slot_tt
		unlock_decision_tooltip = SOV_propaganda_knowledge SOV_propaganda_builders_of_communism SOV_propaganda_sweep_scum_out
		SOV_unlock_propaganda_campaign_slot_effect = yes
	}
}
### Entity: Country History
Country: UGA
Component: UGA_characters
Constructs: recruit_character
Source: game
File: history/countries/UGA - Uganda.txt

Code:
# Leaders & Characters for UGA
recruit_character = UGA_aco2 UGA_nt UGA_communist_guy UGA_pot UGA_acas UGA_acr UGA_stc UGA_ai2 UGA_ncs UGA_ncm UGA_acd2 UGA_democratic_guy UGA_fascist_guy UGA_coi UGA_ar UGA_aa2 UGA_awt UGA_acgs UGA_mt UGA_nccr
### Entity: AI Strategy
Component: SOV_fifth_column_tsarism
Constructs: has_government, has_country_flag, has_game_rule, has_global_flag, is_subject
Source: game
File: common/ai_strategy_plans/SOV_old_alternate_strategy_plan.txt

Code:
SOV_fifth_column_tsarism = {
	name = SOV Return of the Tsar
	desc = 
	allowed = {
		original_tag = SOV
	}
	enable = {
		OR = {
			has_game_rule = {
				rule = SOV_ai_behavior
				option = EXILES_TSARIST
			}
			has_country_flag = SOV_AI_RANDOM_RETURN_OF_THE_TSAR
		}
		has_global_flag = sov_old_focus_tree
	}
	abort = {
		is_subject = yes
		NOT = {
			has_government = neutrality
		}
	}
	ai_national_focuses = {
		SOV_form_a_fifth_column_old SOV_finish_the_five_year_plan_old SOV_counter_coup_old SOV_power_struggle_old SOV_in_the_name_of_the_czar_old SOV_purge_splinter_factions_old SOV_siberian_railnetworks SOV_improve_western_railnetworks SOV_Improve_TransSiberian_Railway SOV_third_five_year_plan_old SOV_Social_Welfare_old SOV_Education_Initiative SOV_Mass_Immunizations_old SOV_progress_cult_old
	}
	focus_factors = {
		SOV_great_purge = 0
		SOV_trotskyite_victory = 0
	}
	ideas = {
		SOV_pavel_milyukov = 500
		SOV_andrey_vlasov = 999
		SOV_anatoly_rogozhin = 800
		SOV_konstantin_nechaev = 800
		SOV_boris_smyslovsky = 500
	}
	weight = {
		factor = 1.0
		modifier = {
			factor = 1.0
		}
	}
}
### Entity: Joint Focus
Component: NORDIC_nordic_army
Constructs: prerequisite, joint_focus, add_ideas, completion_reward, has_army_manpower, add_manpower
Source: game
File: common/national_focus/nordic_shared.txt

Code:
joint_focus = {
	id = NORDIC_nordic_army
	icon = {
		GFX_focus_NORDIC_dem_army = {
			NORDIC_democratic_alliance_viable = yes
		} yes
		GFX_focus_NORDIC_com_army = {
			NORDIC_communist_alliance_viable = yes
		}
		GFX_focus_NORDIC_mon_army = {
			NORDIC_monarchist_alliance_viable = yes
		}
	}
	dynamic = yes
	prerequisite = {
		focus = NORDIC_northern_command
	}
	x = 3
	y = 1
	relative_position_id = NORDIC_northern_command
	cost = 10
	text_icon = NORDIC_focus_style
	available = {
		NORDIC_basic_available_trigger = yes
		has_army_manpower = {
			size = > 84999
		}
		num_divisions = > 15
	}
	search_filters = {
		FOCUS_FILTER_ARMY_XP FOCUS_FILTER_MANPOWER
	}
	joint_trigger = {
		NORDIC_basic_joint_trigger = yes
	}
	completion_reward = {

	}
	completion_reward_joint_originator = {
		army_experience = 60
		add_manpower = 8000
		add_ideas = {
			NORDIC_joint_army_originator_ns_1
		}
	}
	completion_reward_joint_member = {
		army_experience = 40
		add_manpower = 4000
		add_ideas = {
			NORDIC_joint_army_member_ns_1
		}
	}
}
### Entity: National Focus
Tree: ukr_focus
Component: UKR_take_a_pro_russian_stance
Constructs: prerequisite, limit, has_government, completion_reward, is_subject, is_in_faction, is_faction_leader
Source: game
File: common/national_focus/ukraine.txt

Code:
focus = {
	id = UKR_take_a_pro_russian_stance
	icon = GFX_goal_SOV_russian_monarchy
	prerequisite = {
		focus = UKR_our_place_in_the_world
	}
	relative_position_id = UKR_our_place_in_the_world
	mutually_exclusive = {
		focus = UKR_free_the_oppressed_cossacks
	}
	x = 0
	y = 1
	cost = 10
	ai_will_do = {
		factor = 2.5
	}
	available = {
		is_subject = no
		is_in_faction = no
		SOU = {
			OR = {
				has_government = neutrality fascism
			}
		}
	}
	available_if_capitulated = yes
	search_filters = {
		FOCUS_FILTER_ANNEXATION
	}
	completion_reward = {
		if = {
			limit = {
				SOU = {
					is_faction_leader = yes
				}
				is_in_faction = no
			}
			SOU = {
				country_event = generic.2
			}
		}
	}
}
### Entity: Event
Component: news.288
Constructs: is_triggered_only, set_global_flag, is_in_faction_with
Source: game
File: events/NewsEvents.txt

Code:
news_event = {
	id = news.288
	title = news.288.t
	desc = news.288.desc
	picture = GFX_news_event_chinese_soldiers_march
	immediate = {
		set_global_flag = chiang_needs_to_die
	}
	major = yes
	is_triggered_only = yes
	option = {
		name = news.288.a
		trigger = {
			OR = {
				TAG = CHI PRC
			}
		}
	} {
		name = news.288.b
		trigger = {
			NOT = {
				TAG = CHI PRC
			}
			OR = {
				TAG = JAP
				is_in_faction_with = JAP
			}
		}
	} {
		name = news.288.c
		trigger = {
			NOT = {
				TAG = PRC CHI JAP
				is_in_faction_with = JAP
			}
		}
	}
}
### Entity: Event
Component: ARG_political_events.32
Constructs: is_triggered_only, ai_chance
Source: game
File: events/TOA_Argentina.txt

Code:
country_event = {
	id = ARG_political_events.32
	title = ARG_political_events.32.t
	desc = ARG_political_events.32.desc
	picture = GFX_report_event_generic_sign_treaty2
	is_triggered_only = yes
	option = {
		name = ARG_political_events.32.a
		ai_chance = {
			base = 90
		}
		FROM = {
			country_event = {
				id = ARG_political_events.33
				days = 1
			}
		}
	} {
		name = ARG_political_events.32.b
		ai_chance = {
			base = 10
		}
		FROM = {
			country_event = {
				id = ARG_political_events.34
				days = 1
			}
		}
	}
}
### Entity: AI Strategy
Component: EAI_ESPIONAGE_espionage_build_network_1
Constructs: check_variable, is_preparing_operation, has_finished_collecting_for_operation, is_running_operation, build_intel_network
Source: game
File: common/ai_strategy/EAI_ESPIONAGE_strategies.txt

Code:
EAI_ESPIONAGE_espionage_build_network_1 = {
	enable = {
		NOT = {
			check_variable = {
				EAI_operation_target = 0
			}
		} {
			is_preparing_operation = {
				target = var:EAI_operation_target
				operation = var:EAI_operation_type
			}
			has_finished_collecting_for_operation = {
				target = var:EAI_operation_target
				operation = var:EAI_operation_type
			}
			is_running_operation = {
				target = var:EAI_operation_target
				operation = var:EAI_operation_type
			}
		}
		check_variable = {
			EAI_ESP_available_operatives = 1
		}
		network_strength = {
			target = var:EAI_operation_target
			value = < global.EAI_OPERATION_NETWORK_REQUIREMENT^EAI_operation_type
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = operative_mission
		mission = build_intel_network
		value = 10000
		mission_target = var:EAI_operation_target
		num_operatives = 1
	}
}
### Entity: AI Strategy
Component: EAI_CHI_china_DEPLOY_garrison_3
Constructs: has_completed_focus, limit, has_war_with, has_country_flag, is_literally_china, has_global_flag, is_ai, check_variable
Source: game
File: common/ai_strategy/CHI_EAI.txt

Code:
EAI_CHI_china_DEPLOY_garrison_3 = {
	allowed = {
		is_literally_china = yes
	}
	enable = {
		if = {
			limit = {
				OR = {
					is_literally_china = yes
				}
			}
			NOT = {
				EAI_MILITARY_home_threatened_TRIGGER = yes
			}
		}
		OR = {
			has_war_with = JAP
			has_global_flag = {
				flag = EAI_JAP_blitz_china_1000d
				value = 1
				days = < 90
			}
			AND = {
				JAP = {
					focus_progress = {
						focus = JAP_reinforce_the_beijing_garrison
						progress = > 0
					}
					NOT = {
						has_completed_focus = JAP_reinforce_the_beijing_garrison
					}
				}
			}
		} {
			JAP = {
				is_ai = no
			}
			check_variable = {
				global.EAI_sino_japanese_war = 1
			}
		} {
			AND = {
				surrender_progress = > 0.2
			} {
				has_country_flag = {
					flag = EAI_MILITARY_trend_losing_war
					value = 1
					days = > 60
				}
				check_variable = {
					EAI_MILITARY_trend_value = > 0.02
				}
			}
		}
	}
	abort_when_not_enabled = yes
	ai_strategy = {
		type = put_unit_buffers
		ratio = 0.2
		states = {
			594 591 592 593 595 596 613 598 597 743
		}
		subtract_invasions_from_need = no
		subtract_fronts_from_need = no
	}
}