Losa10/PreTrain-HOI4-Modding-Assistant huggingface dataset:
### Entity: National Focus
Tree: sco_focus
Component: SCO_coalition_building
Constructs: prerequisite, has_government, has_war_with, is_major, completion_reward, is_in_faction, is_faction_leader, set_rule
Source: game
File: common/national_focus/scotland.txt

Code:
focus = {
	id = SCO_coalition_building
	icon = GFX_goal_generic_foreign_diplomacy2
	prerequisite = {
		focus = SCO_support_trade
	} {
		focus = SCO_economic_mobilization
	}
	relative_position_id = SCO_support_trade
	x = 1
	y = 2
	cost = 10
	ai_will_do = {
		factor = 3
	}
	available = {
		is_in_faction = no
		any_other_country = {
			is_major = yes
			has_government = democratic
			is_faction_leader = yes
			NOT = {
				has_war_with = ROOT
			}
		}
	}
	bypass = {

	}
	completion_reward = {
		set_rule = {
			can_create_factions = yes
		}
		get_best_alliance_match_democratic_effect = yes
		var:best_leader = {
			country_event = generic.2
		}
	}
	search_filters = {
		FOCUS_FILTER_POLITICAL
	}
}
### Entity: Idea
Component: SAF_desert_equipment
Constructs: removal_cost
Source: game
File: common/ideas/south_africa.txt

Code:
SAF_desert_equipment = {
	allowed = {
		always = no
	}
	allowed_civil_war = {
		always = yes
	}
	removal_cost = -1
	picture = generic_intel_bonus
	modifier = {
		heat_attrition_factor = -0.5
		acclimatization_hot_climate_gain_factor = 0.1
	}
}
### Entity: Idea
Component: PRC_top_command_all
Constructs: removal_cost, planning_speed
Source: game
File: common/ideas/prc.txt

Code:
PRC_top_command_all = {
	name = PRC_top_command
	allowed = {
		always = no
	}
	allowed_civil_war = {
		always = yes
	}
	removal_cost = -1
	picture = generic_pp_unity_bonus
	modifier = {
		experience_gain_army = 0.05
		experience_gain_navy = 0.05
		experience_gain_air = 0.05
		planning_speed = 0.05
		max_planning = 0.1
		navy_max_range_factor = 0.1
		amphibious_invasion = 0.1
		navy_carrier_air_targetting_factor = 0.05
		air_night_penalty = -0.15
		army_bonus_air_superiority_factor = 0.1
		naval_strike_targetting_factor = 0.05
	}
}
### Entity: National Focus
Tree: sia_focus
Component: SIA_look_to_the_waking_giant_r56
Constructs: has_completed_focus, prerequisite, has_war, limit, has_government, has_war_with, add_opinion_modifier, completion_reward
Source: game
File: common/national_focus/siam_r56.txt

Code:
focus = {
	id = SIA_look_to_the_waking_giant_r56
	prerequisite = {
		focus = SIA_negotiation_with_the_old_powers_r56
	}
	icon = GFX_Goal_USA_befriend_america
	x = -2
	y = 1
	relative_position_id = SIA_negotiation_with_the_old_powers_r56
	offset = {
		x = 1
		y = 1
		trigger = {
			has_focus_autohide_rule_trigger_r56 = yes
			OR = {
				has_completed_focus = SIA_the_non_aligned_movement_r56 SIA_navigate_asias_new_order_r56
			}
		}
	}
	cost = 4
	ai_will_do = {
		base = 1
	}
	search_filters = {
		FOCUS_FILTER_ALLIANCE
	}
	bypass = {
		USA = {
			OR = {
				exists = no
				is_subject = yes
			}
		}
	}
	available = {
		USA = {
			NOT = {
				has_war_with = ROOT
			}
			OR = {
				has_war = yes
				NOT = {
					has_government = democratic
				}
				has_completed_focus = USA_the_giant_wakes USA_limited_intervention
			}
		}
	}
	completion_reward = {
		add_opinion_modifier = {
			target = USA
			modifier = BUL_strengthened_relations_with_us
		}
		reverse_add_opinion_modifier = {
			target = USA
			modifier = BUL_strengthened_relations_with_us
		}
		custom_effect_tooltip = generic_skip_one_line_tt
		unlock_decision_tooltip = SIA_ally_the_united_states_of_america_r56
		effect_tooltip = {
			custom_effect_tooltip = unlocks_decision_invite_american_economic_advisors_which_grants_tt generic_skip_one_line_tt for_84_days_factory_output_6_dockyard_output_6_tt
			add_tech_bonus = {
				name = SIA_invite_american_economic_advisors_r56
				bonus = 0.3
				uses = 1
				category = industry
			}
			if = {
				limit = {
					NOT = {
						USA = {
							has_government = communism
						}
						has_idea = SIA_modern_market_economy_r56 SIA_sluggish_industrialization_1_r56
					}
				}
				SIA_decrease_economic_intervention_r56 = yes
			}
		}
	}
}
### Entity: National Focus
Tree: swe_focus
Component: SWE_continue_the_second_industrial_revolution
Constructs: prerequisite, completion_reward, cancel_if_invalid, add_tech_bonus
Source: game
File: common/national_focus/sweden.txt

Code:
focus = {
	id = SWE_continue_the_second_industrial_revolution
	icon = GFX_goal_generic_consumer_goods
	x = -8
	y = 7
	cost = 10
	prerequisite = {
		focus = SWE_defense_act
	}
	relative_position_id = SWE_defense_act
	mutually_exclusive = {
		focus = SWE_the_old_enemy_stirs
	}
	ai_will_do = {
		factor = 10
	}
	available = {

	}
	bypass = {

	}
	cancel_if_invalid = yes
	continue_if_invalid = no
	available_if_capitulated = no
	search_filters = {
		FOCUS_FILTER_RESEARCH FOCUS_FILTER_INDUSTRY
	}
	completion_reward = {
		add_tech_bonus = {
			name = SWE_continue_the_second_industrial_revolution
			bonus = 1
			uses = 2
			category = industry
		}
	}
}
### Entity: State History
Component: 170
Constructs: add_core_of
Source: game
File: history/states/170-Extremadura.txt

Code:
state = {
	id = 170
	name = STATE_170
	resources = {
		tungsten = 4.0
	}
	history = {
		owner = SPR
		victory_points = {
			6902 1
		}
		buildings = {
			infrastructure = 3
			industrial_complex = 1
		}
		add_core_of = SPR
	}
	provinces = {
		809 931 985 3930 6866 6902 6948 6954 9839 9877 9917 9925 11756 11780 11798 11851 13230
	}
	manpower = 1417652
	buildings_max_level_factor = 1.0
	state_category = town
	local_supplies = 0.0
}
### Entity: Character
Component: ITA_tomislav_of_croatia
Constructs: stability_factor
Source: game
File: common/country_leader/00_traits.txt

Code:
ITA_tomislav_of_croatia = {
	random = no
	stability_factor = -0.25
	political_power_factor = 0.15
	naval_coordination = 0.2
	army_breakthrough_against_minor_factor = 0.3
	ai_will_do = {
		factor = 1
	}
}
### Entity: Shared Focus
Tree: cel_focus
Component: CEL_bimotor_aircrafts
Constructs: shared_focus, prerequisite, limit, completion_reward, has_dlc, add_tech_bonus, fighter_bonus, add_mio_funds
Source: game
File: common/national_focus/r56_celtic_shared.txt

Code:
shared_focus = {
	id = CEL_bimotor_aircrafts
	icon = GFX_focus_generic_multi_role_aircraft
	prerequisite = {
		focus = CEL_aviation_air_academy
	}
	mutually_exclusive = {
		focus = CEL_build_trainer_aircrafts
	}
	relative_position_id = CEL_aviation_air_academy
	x = 1
	y = 1
	cost = 10
	available_if_capitulated = yes
	ai_will_do = {
		factor = 1
	}
	completion_reward = {
		air_experience = 15
		if = {
			limit = {
				has_dlc = By Blood Alone
			}
			add_tech_bonus = {
				name = fighter_bonus
				bonus = 1
				uses = 1
				category = medium_air heavy_air
			}
		} {
			limit = {
				has_dlc = Arms Against Tyranny
			}
			mio:generic_general_aircraft_organization = {
				add_mio_funds = 500
			}
		}
		else = {
			add_tech_bonus = {
				name = bomber_bonus
				bonus = 1
				uses = 1
				category = cat_heavy_fighter tactical_bomber
			}
		}
	}
	search_filters = {
		FOCUS_FILTER_RESEARCH
	}
}
### Entity: Idea
Component: renault_fra
Constructs: research_bonus
Source: game
File: common/ideas/france.txt

Code:
renault_fra = {
	picture = renault
	allowed = {
		original_tag = FRA
	}
	research_bonus = {
		armor = 0.15
	}
	traits = {
		heavy_tank_manufacturer
	}
}
### Entity: Character
Component: SEN_nccr
Source: game
File: common/characters/SEN.txt

Code:
SEN_nccr = {
	advisor = {
		slot = navy_chief
		idea_token = SEN_nccr
		allowed = {
			original_tag = SEN
		}
		traits = {
			navy_chief_commerce_raiding_2
		}
		ai_will_do = {
			factor = 1.0
		}
	}
	portraits = {
		army = {
			small = GFX_idea_generic_navy_african_2
		}
	}
}
### Entity: National Focus
Tree: fin_focus
Component: FIN_contract_with_yhteissisu
Constructs: prerequisite, limit, completion_reward, has_dlc, add_mio_size, add_mio_funds_gain_factor, unlock_mio_trait_tooltip, has_idea
Source: game
File: common/national_focus/finland.txt

Code:
focus = {
	id = FIN_contract_with_yhteissisu
	icon = GFX_focus_generic_truck
	prerequisite = {
		focus = FIN_tire_factory_at_nokia
	} {
		focus = FIN_outokumpu_for_defence_industry
	}
	x = 1
	y = 1
	relative_position_id = FIN_tire_factory_at_nokia
	cost = 5
	available = {

	}
	search_filters = {
		FOCUS_FILTER_HISTORICAL FOCUS_FILTER_INDUSTRY
	}
	completion_reward = {
		if = {
			limit = {
				has_dlc = Arms Against Tyranny
			}
			mio:FIN_sisu_auto_organization = {
				add_mio_size = 1
				add_mio_funds_gain_factor = 0.35
				unlock_mio_trait_tooltip = FIN_mio_trait_yhteissisus_modern_premises
			}
		}
		else = {
			if = {
				limit = {
					has_idea = FIN_sisu_auto
				}
				swap_ideas = {
					remove_idea = FIN_sisu_auto
					add_idea = FIN_sisu_auto_improved
				}
			}
			else = {
				effect_tooltip = {
					swap_ideas = {
						remove_idea = FIN_sisu_auto
						add_idea = FIN_sisu_auto_improved
					}
				}
			}
		}
	}
}
### Entity: Order of Battle
Component: 5a Brigada del Ejército
Constructs: division_template
Source: game
File: history/units/COL_1939.txt

Code:
division = {
	name = 5a Brigada del Ejército
	location = 10747
	division_template = Brigada del Ejército
	start_experience_factor = 0.1
	start_equipment_factor = 0.3
}
### Entity: Shared Focus
Component: GUAY_beef_and_hide_industry
Constructs: shared_focus, prerequisite, limit, completion_reward, random_core_state, is_controlled_by, add_extra_state_shared_building_slots, add_building_construction
Source: game
File: common/national_focus/paraguay_uruguay_shared_branch.txt

Code:
shared_focus = {
	id = GUAY_beef_and_hide_industry
	icon = GFX_focus_ARG_capitalize_the_beef_industry
	x = 0
	y = 1
	relative_position_id = GUAY_agricultural_colonization
	prerequisite = {
		focus = GUAY_agricultural_colonization
	}
	cost = 10
	ai_will_do = {
		factor = 30
	}
	available = {

	}
	search_filters = {
		FOCUS_FILTER_INDUSTRY
	}
	completion_reward = {
		random_core_state = {
			limit = {
				is_controlled_by = ROOT
			}
			add_extra_state_shared_building_slots = 2
			add_building_construction = {
				type = industrial_complex
				level = 2
				instant_build = yes
			}
		}
	}
}
### Entity: Idea
Component: ITA_all_within_the_state_ns
Constructs: stability_factor, industrial_capacity_factory, removal_cost
Source: game
File: common/ideas/italy.txt

Code:
ITA_all_within_the_state_ns = {
	removal_cost = -1
	picture = tur_etatism
	allowed = {
		original_tag = ITA
	}
	modifier = {
		stability_factor = -0.1
		industrial_capacity_factory = 0.1
		consumer_goods_factor = -0.15
		surrender_limit = 0.1
	}
}
### Entity: National Focus
Tree: den_focus
Component: DEN_sign_a_trade_deal
Constructs: prerequisite, limit, has_war_with, has_country_flag, completion_reward, has_variable, has_opinion, is_justifying_wargoal_against
Source: game
File: common/national_focus/denmark.txt

Code:
focus = {
	id = DEN_sign_a_trade_deal
	icon = GFX_goal_generic_positive_trade_relations
	prerequisite = {
		focus = DEN_sign_non_aggression_deal
	}
	relative_position_id = DEN_sign_non_aggression_deal
	x = -1
	y = 1
	cost = 10
	bypass = {

	}
	available = {
		if = {
			limit = {
				NOT = {
					has_country_flag = DEN_has_non_aggression_flag
				}
			}
			custom_trigger_tooltip = {
				tooltip = DEN_has_non_aggression_pact_signator_tt
				any_other_country = {
					OR = {
						original_tag = ENG GER SOV USA
					}
					has_variable = DEN_guaranteeing_nation
				}
			}
		}
		else = {
			var:DEN.DEN_guaranteeing_nation = {
				has_opinion = {
					target = ROOT
					value = > 24
				}
			}
			NOT = {
				has_war_with = var:DEN.DEN_guaranteeing_nation
				is_justifying_wargoal_against = var:DEN.DEN_guaranteeing_nation
				var:DEN.DEN_guaranteeing_nation = {
					is_justifying_wargoal_against = ROOT
				}
			}
		}
		is_subject = no
	}
	ai_will_do = {

	}
	search_filters = {
		FOCUS_FILTER_POLITICAL FOCUS_FILTER_INTERNATIONAL_TRADE
	}
	completion_reward = {
		add_equipment_subsidy = {
			cic = 500
			equipment_type = small_plane_airframe
			seller_trigger = DEN_guarantor_seller_trigger
		} {
			cic = 500
			equipment_type = light_tank_chassis
			seller_trigger = DEN_guarantor_seller_trigger
		} {
			cic = 500
			equipment_type = medium_tank_chassis
			seller_trigger = DEN_guarantor_seller_trigger
		} {
			cic = 500
			equipment_type = infantry_equipment
			seller_trigger = DEN_allied_weapons_seller_trigger
		} {
			cic = 250
			equipment_type = motorized_equipment
			seller_trigger = DEN_guarantor_seller_trigger
		} {
			cic = 250
			equipment_type = artillery_equipment
			seller_trigger = DEN_guarantor_seller_trigger
		} {
			cic = 250
			equipment_type = anti_air_equipment
			seller_trigger = DEN_guarantor_seller_trigger
		}
		var:DEN.DEN_guaranteeing_nation = {
			country_event = {
				id = denmark_protection_event.4
				days = 2
			}
		}
		custom_effect_tooltip = if_they_accept_tt
		event_option_tooltip = denmark_protection_event.5.a
	}
}
### Entity: Trigger Reference
Construct: has_guaranteed
Source: vanilla_docs
File: documentation/triggers_documentation.md

Doc:
## has_guaranteed

* Supported Scopes: COUNTRY
* Supported Targets: THIS, ROOT, PREV, FROM, OWNER, CONTROLLER, OCCUPIED, CAPITAL

```
check if country has guaranteed specified country
```
### Entity: Event
Component: r56.soviet.22
Constructs: ai_chance, has_completed_focus, limit, has_country_flag, fire_only_once, add_political_power, set_country_flag, has_game_rule
Source: game
File: events/r56_Soviet.txt

Code:
country_event = {
	id = r56.soviet.22
	title = r56.soviet.22.t
	desc = r56.soviet.22.d
	picture = GFX_report_event_001
	fire_only_once = yes
	trigger = {
		NOT = {
			has_completed_focus = SOV_form_a_fifth_column_old
		}
		focus_progress = {
			focus = SOV_form_a_fifth_column_old
			progress = > 0.7
		}
	}
	mean_time_to_happen = {
		days = 1
	}
	option = {
		name = r56.soviet.22.b
		ai_chance = {
			factor = 3
		}
		set_country_flag = yes_generals
		if = {
			limit = {
				has_country_flag = yes_to_exiles_2
			}
			set_country_flag = yes_to_exiles_3
		} {
			limit = {
				has_country_flag = yes_to_exiles_1
			}
			set_country_flag = yes_to_exiles_2
		} {
			limit = {
				NOT = {
					has_country_flag = yes_to_exiles_1
				}
			}
			set_country_flag = yes_to_exiles_1
		}
		custom_effect_tooltip = SOV_post_coup_unlock_tt available_military_high_command SOV_increase_post_coup_chaos_idea_tier
		show_ideas_tooltip = SOV_anatoly_rogozhin SOV_konstantin_nechaev
	} {
		name = r56.soviet.22.a
		ai_chance = {
			factor = 7
			modifier = {
				factor = 0
				OR = {
					has_country_flag = SOV_AI_RANDOM_RETURN_OF_THE_TSAR SOV_AI_RANDOM_RUSSIAN_FASCISM SOV_AI_RANDOM_RUSSIAN_DEMOCRACY
					has_game_rule = {
						rule = SOV_AI_BEHAVIOR
						option = EXILES_TSARIST
					} {
						rule = SOV_AI_BEHAVIOR
						option = EXILES_FASCIST
					} {
						rule = SOV_AI_BEHAVIOR
						option = EXILES_DEMOCRATIC
					}
				}
			}
		}
		add_political_power = -75
	}
}
### Entity: National Focus
Tree: can_focus
Component: CAN_fund_the_national_research_council
Constructs: prerequisite, completion_reward, cancel_if_invalid, add_research_slot
Source: game
File: common/national_focus/canada.txt

Code:
focus = {
	id = CAN_fund_the_national_research_council
	icon = GFX_focus_research
	prerequisite = {
		focus = CAN_department_of_munitions_and_supply CAN_national_resources_mobilization_act
	}
	x = -1
	y = 2
	relative_position_id = CAN_defence_of_canada_regulations
	cost = 10
	ai_will_do = {
		factor = 75
	}
	available = {

	}
	bypass = {

	}
	cancel_if_invalid = yes
	continue_if_invalid = no
	available_if_capitulated = yes
	search_filters = {
		FOCUS_FILTER_RESEARCH
	}
	completion_reward = {
		add_research_slot = 1
	}
}
### Entity: National Focus
Tree: raj_focus
Component: RAJ_indian_gurkhas
Constructs: has_completed_focus, division_template, prerequisite, add_ideas, completion_reward, has_tech, cancel_if_invalid, random_owned_controlled_state
Source: game
File: common/national_focus/india.txt

Code:
focus = {
	id = RAJ_indian_gurkhas
	icon = GFX_focus_RAJ_indian_gurkhas
	prerequisite = {
		focus = RAJ_indianisation_of_army
	}
	x = -1
	y = 2
	relative_position_id = RAJ_indianisation_of_army
	cost = 10
	ai_will_do = {
		factor = 25
		modifier = {
			factor = 2
			has_completed_focus = RAJ_chindits
		}
	}
	available = {
		has_tech = tech_mountaineers
	}
	bypass = {

	}
	cancel_if_invalid = yes
	continue_if_invalid = no
	available_if_capitulated = no
	search_filters = {
		FOCUS_FILTER_MANPOWER
	}
	completion_reward = {
		add_ideas = RAJ_indian_gurkhas
		custom_effect_tooltip = RAJ_create_unit_gurkas_tt
		hidden_effect = {
			division_template = {
				name = Gorkha Rifles
				priority = 2
				division_names_group = RAJ_MNT_01
				regiments = {
					mountaineers = {
						x = 0
						y = 0
					} {
						x = 0
						y = 1
					} {
						x = 0
						y = 2
					} {
						x = 1
						y = 0
					} {
						x = 1
						y = 1
					} {
						x = 1
						y = 2
					} {
						x = 2
						y = 0
					} {
						x = 2
						y = 1
					} {
						x = 2
						y = 2
					}
				}
			}
			random_owned_controlled_state = {
				prioritize = {
					439
				}
				create_unit = {
					division = name = "1. Gorkha Rifles" division_template = "Gorkha Rifles" start_experience_factor = 1.0
					owner = RAJ
				}
			}
		}
	}
}
### Entity: Military Industrial Organization
Component: FRI_artillery_workshops_hanoi_organiztion
Constructs: production_bonus
Source: game
File: common/military_industrial_organization/organizations/r56_FRI_organization.txt

Code:
FRI_artillery_workshops_hanoi_organiztion = {
	name = Artillery Workshops Hanoi
	include = generic_artillery_organization
	icon = GFX_idea_generic_artillery_manufacturer_2
	allowed = {
		original_tag = FRI
	}
	initial_trait = {
		name = generic_mio_initial_trait_artillery_manufacturer
		organization_modifier = {
			military_industrial_organization_research_bonus = 0.05
		}
		production_bonus = {
			production_cost_factor = -0.03
		}
	}
}
### Entity: Operation
Component: capture_tito_infiltration
Source: game
File: common/operation_phases/lar_historical_operations.txt

Code:
capture_tito_infiltration = {
	name = capture_tito_infiltration
	desc = capture_tito_infiltration_desc
	icon = GFX_phase_capture_tito_infiltration_small
	picture = GFX_phase_capture_tito_infiltration
	equipment = {
		transport_plane_equipment = 2
	}
}
### Entity: National Focus
Tree: cze_focus
Component: CZE_establish_a_armament_factory_in_uhersky_brod
Constructs: prerequisite, limit, completion_reward, has_full_control_of_state, cancel_if_invalid, add_to_variable, has_dlc, add_tech_bonus
Source: game
File: common/national_focus/czechoslovakia_mu.txt

Code:
focus = {
	id = CZE_establish_a_armament_factory_in_uhersky_brod
	icon = GFX_focus_generic_reorient_production
	overlay = GFX_focus_overlay_cze_small_arms_focus
	prerequisite = {
		focus = CZE_continue_industrial_relocation_schemes CZE_expand_existing_armory_plants
	}
	relative_position_id = CZE_keep_focus_on_weapon_exports
	x = -2
	y = 2
	cost = 5
	available = {
		CZE_has_a_skoda_infantry_focus = yes
		has_full_control_of_state = 75
	}
	ai_will_do = {
		factor = 2
	}
	cancel_if_invalid = yes
	continue_if_invalid = no
	available_if_capitulated = no
	completion_reward = {
		custom_effect_tooltip = CZE_modify_skoda_works_ns_intro_tt generic_skip_one_line_tt generic_skip_one_line_tt
		add_to_variable = {
			CZE_skoda_works_dynamic_modifier_production_speed_arms_factory_factor = 0.05
			tooltip = production_speed_arms_factory_factor_tt
		}
		if = {
			limit = {
				has_dlc = By Blood Alone
			}
			add_tech_bonus = {
				name = CZE_establish_a_armament_factory_in_uhersky_brod
				bonus = 0.25
				uses = 1
				category = cat_air_guns
			}
		} {
			limit = {
				has_dlc = Arms Against Tyranny
			}
			unlock_military_industrial_organization_tooltip = mio:CZE_ceska_zbrojovka_uhersky_brod_organization
			mio:CZE_ceska_zbrojovka_uhersky_brod_organization = {
				add_mio_size = 2
				add_mio_funds_gain_factor = 0.25
			}
			custom_effect_tooltip = generic_skip_one_line_tt
		}
		else = {
			add_tech_bonus = {
				name = CZE_establish_a_armament_factory_in_uhersky_brod
				bonus = 0.05
				uses = 1
				category = air_equipment
			}
		} {
			custom_effect_tooltip = available_designer generic_skip_one_line_tt
			show_ideas_tooltip = CZE_ceska_zbrojovka_uhersky_brod
		}
		add_tech_bonus = {
			name = CZE_establish_a_armament_factory_in_uhersky_brod
			bonus = 1
			uses = 1
			category = infantry_weapons
		}
		random_owned_controlled_state = {
			prioritize = {
				75
			}
			limit = {
				free_building_slots = {
					building = arms_factory
					size = > 0
					include_locked = yes
				}
				OR = {
					is_in_home_area = yes
					NOT = {
						owner = {
							any_owned_state = {
								free_building_slots = {
									building = arms_factory
									size = > 0
									include_locked = yes
								}
								is_in_home_area = yes
							}
						}
					}
				}
			}
			add_extra_state_shared_building_slots = 1
			add_building_construction = {
				type = arms_factory
				leve
# ... (truncated)
### Entity: Unit Leader
Component: trait_engineer
Constructs: gain_xp, has_combat_modifier
Source: game
File: common/unit_leader/00_traits.txt

Code:
trait_engineer = {
	type = corps_commander
	gain_xp = {
		OR = {
			has_combat_modifier = fort_attack river_crossing
		}
	}
	cost = 700
	modifier = {
		river = {
			attack = 0.05
		}
		fort = {
			attack = 0.1
		}
	}
	slot = high_command
	specialist_advisor_trait = army_entrenchment_1
	expert_advisor_trait = army_entrenchment_2
	genius_advisor_trait = army_entrenchment_3
	ai_will_do = {
		factor = 1
	}
	gui_row = 4
}
### Entity: National Focus
Tree: chl_focus
Component: CHL_a_new_empire_of_brazil
Constructs: prerequisite, limit, has_government, owns_state, completion_reward, is_subject, is_subject_of, is_in_faction_with
Source: game
File: common/national_focus/chile.txt

Code:
focus = {
	id = CHL_a_new_empire_of_brazil
	icon = GFX_focus_CHL_a_new_empire_of_brazil
	relative_position_id = CHL_satellite_kingdoms
	x = -1
	y = 1
	cost = 10
	prerequisite = {
		focus = CHL_satellite_kingdoms
	} {
		focus = CHL_secure_the_brazilian_border
	}
	mutually_exclusive = {

	}
	will_lead_to_war_with = BRA POR
	ai_will_do = {
		base = 2
	}
	available = {
		has_government = neutrality
		is_subject = no
		OR = {
			BRA = {
				exists = yes
				OR = {
					AND = {
						is_subject_of = ROOT
						is_in_faction_with = ROOT
					}
					NOT = {
						is_in_faction_with = ROOT
					}
				}
			}
			AND = {
				POR = {
					exists = yes
					owns_state = 500
					NOT = {
						is_in_faction_with = ROOT
					}
				}
			}
		}
	}
	bypass = {
		BRA = {
			is_in_faction_with = ROOT
			NOT = {
				is_subject_of = ROOT
			}
		}
	}
	search_filters = {
		FOCUS_FILTER_ANNEXATION
	}
	completion_reward = {
		every_state = {
			limit = {
				NOT = {
					OR = {
						is_claimed_by = ROOT
						is_core_of = ROOT
					}
				}
				OR = {
					is_core_of = BRA
					AND = {
						is_on_continent = south_america
						is_core_of = POR
					}
				}
			}
			add_claim_by = ROOT
		}
		IF = {
			limit = {
				BRA = {
					exists = yes
				}
			}
			create_wargoal = {
				type = take_claimed_state
				target = BRA
			}
		}
		ELSE_IF = {
			limit = {
				BRA = {
					exists = no
				}
				POR = {
					exists = yes
					owns_state = 500
				}
			}
			create_wargoal = {
				type = take_claimed_state
				target = POR
			}
		}
		unlock_decision_tooltip = {
			decision = CHL_integrate_rio_grande_do_sul
			show_effect_tooltip = yes
			show_modifiers = no
		}
	}
}