on_actions = { on_daily = { effect = { if = { limit = { ROOT = { has_war_with = ALN } } # Only check state traps if nation has activated them or any state has trap flags if = { limit = { ROOT = { OR = { has_country_flag = EH_nation_activated_electric_traps_flag any_controlled_state = { has_state_flag = EH_electric_trap_enabled_flag } } } } every_controlled_state = { limit = { has_state_flag = EH_electric_trap_enabled_flag NOT = { is_frontline_state = yes } NOT = { is_second_line_state = yes } NOT = { is_third_line_state = yes } } clr_state_flag = EH_electric_trap_enabled_flag } } if = { limit = { ROOT = { has_country_flag = EH_nation_activated_electric_traps_flag has_war_with = ALN } } ROOT = { every_controlled_state = { limit = { OR = { is_frontline_state = yes is_second_line_state = yes } } set_state_flag = EH_electric_trap_enabled_flag } } } if = { limit = { ROOT = { has_completed_focus = EH_investigate_strange_structure NOT = { has_country_flag = EH_country_succeeded_in_drone_mission_flag } } } ROOT = { EH_drone_mission_calculations_effect = yes } } # STATIC # if = { limit = { has_idea = EH_disrupted_satellite_network_idea check_variable = { EH_static_countdown_var = 0 } } set_variable_to_random = { var = EH_static_countdown_var min = 14 max = 45 integer = yes } } if = { limit = { check_variable = { EH_static_countdown_var > 1 } } add_to_variable = { EH_static_countdown_var = -1 } } if = { limit = { check_variable = { EH_static_countdown_var = 1 } NOT = { is_special_project_completed = sp:sp_monitor_portal_energy_emissions_project } } set_country_flag = { flag = EH_random_static_gui_flag days = 3 value = 1 } remove_ideas = EH_disrupted_satellite_network_idea add_timed_idea = { idea = EH_satellite_critical_failure_idea days = 3 } random_controlled_state = { limit = { infrastructure > 0 industrial_complex > 0 } damage_building = { type = infrastructure damage = 2 } damage_building = { type = industrial_complex damage = 2 } } random_controlled_state = { limit = { arms_factory > 1 } damage_building = { type = arms_factory damage = 2 } } set_variable = { EH_static_countdown_var = 0 } } # TESLA # if = { limit = { has_country_flag = EH_tesla_airframe_in_production_flag } if = { limit = { check_variable = { EH_tesla_airframe_progress < 210 } } ROOT = { add_to_variable = { EH_tesla_airframe_progress = EH_tesla_module_production_speed } clamp_variable = { var = EH_tesla_airframe_progress max = 210 } EH_refresh_gui = yes } } else = { ROOT = { clr_country_flag = EH_tesla_airframe_in_production_flag set_country_flag = EH_tesla_airframe_completed_flag EH_is_tesla_finished = yes } } } if = { limit = { has_country_flag = EH_tesla_neutralizer_in_production_flag } if = { limit = { check_variable = { EH_tesla_neutralizer_progress < 210 } } ROOT = { add_to_variable = { EH_tesla_neutralizer_progress = EH_tesla_module_production_speed } clamp_variable = { var = EH_tesla_neutralizer_progress max = 210 } EH_refresh_gui = yes } } else = { ROOT = { clr_country_flag = EH_tesla_neutralizer_in_production_flag set_country_flag = EH_tesla_neutralizer_completed_flag EH_is_tesla_finished = yes } } } if = { limit = { has_country_flag = EH_tesla_emp_in_production_flag } if = { limit = { check_variable = { EH_tesla_emp_progress < 210 } } ROOT = { add_to_variable = { EH_tesla_emp_progress = EH_tesla_module_production_speed } clamp_variable = { var = EH_tesla_emp_progress max = 210 } EH_refresh_gui = yes } } else = { ROOT = { clr_country_flag = EH_tesla_emp_in_production_flag set_country_flag = EH_tesla_emp_completed_flag EH_is_tesla_finished = yes } } } # MECHS # if = { limit = { ROOT = { has_country_flag = EH_mech_production_1_in_progress_flag check_variable = { EH_mech_production_1_progress_var < 100 } } } ROOT = { add_to_variable = { EH_mech_production_1_progress_var = EH_mech_production_1_cost_var } clamp_variable = { var = EH_mech_production_1_progress_var max = 100 } EH_refresh_gui = yes } } else_if = { limit = { ROOT = { check_variable = { EH_mech_production_1_progress_var = 100 } } } ROOT = { clr_country_flag = EH_mech_production_1_in_progress_flag set_variable = { EH_mech_production_1_progress_var = 0 } if = { limit = { has_country_flag = EH_first_mech_1_selected_flag } add_equipment_to_stockpile = { type = HACS_0 amount = var:EH_mech_1_amount producer = ROOT } } else_if = { limit = { has_country_flag = EH_first_mech_2_selected_flag } add_equipment_to_stockpile = { type = HACS_1 amount = var:EH_mech_1_amount producer = ROOT } } else = { add_equipment_to_stockpile = { type = HACS_2 amount = var:EH_mech_1_amount producer = ROOT } } clr_country_flag = EH_first_mech_1_selected_flag clr_country_flag = EH_first_mech_2_selected_flag set_variable = { EH_mech_1_amount = 0 } EH_refresh_gui = yes } } if = { limit = { ROOT = { has_country_flag = EH_mech_production_2_in_progress_flag check_variable = { EH_mech_production_2_progress_var < 100 } } } ROOT = { add_to_variable = { EH_mech_production_2_progress_var = EH_mech_production_2_cost_var } clamp_variable = { var = EH_mech_production_2_progress_var max = 100 } EH_refresh_gui = yes } } else_if = { limit = { ROOT = { check_variable = { EH_mech_production_2_progress_var = 100 } } } ROOT = { clr_country_flag = EH_mech_production_2_in_progress_flag set_variable = { EH_mech_production_2_progress_var = 0 } if = { limit = { has_country_flag = EH_second_mech_1_selected_flag } add_equipment_to_stockpile = { type = HACS_0 amount = var:EH_mech_2_amount producer = ROOT } } else_if = { limit = { has_country_flag = EH_second_mech_2_selected_flag } add_equipment_to_stockpile = { type = HACS_1 amount = var:EH_mech_2_amount producer = ROOT } } else = { add_equipment_to_stockpile = { type = HACS_2 amount = var:EH_mech_2_amount producer = ROOT } } clr_country_flag = EH_second_mech_1_selected_flag clr_country_flag = EH_second_mech_2_selected_flag set_variable = { EH_mech_2_amount = 0 } EH_refresh_gui = yes } } if = { limit = { ROOT = { has_country_flag = EH_mech_production_3_in_progress_flag check_variable = { EH_mech_production_3_progress_var < 100 } } } ROOT = { add_to_variable = { EH_mech_production_3_progress_var = EH_mech_production_3_cost_var } clamp_variable = { var = EH_mech_production_3_progress_var max = 100 } EH_refresh_gui = yes } } else_if = { limit = { ROOT = { check_variable = { EH_mech_production_3_progress_var = 100 } } } ROOT = { clr_country_flag = EH_mech_production_3_in_progress_flag set_variable = { EH_mech_production_3_progress_var = 0 } if = { limit = { has_country_flag = EH_third_mech_1_selected_flag } add_equipment_to_stockpile = { type = HACS_0 amount = var:EH_mech_3_amount producer = ROOT } } else_if = { limit = { has_country_flag = EH_third_mech_2_selected_flag } add_equipment_to_stockpile = { type = HACS_1 amount = var:EH_mech_3_amount producer = ROOT } } else = { add_equipment_to_stockpile = { type = HACS_2 amount = var:EH_mech_3_amount producer = ROOT } } clr_country_flag = EH_third_mech_1_selected_flag clr_country_flag = EH_third_mech_2_selected_flag set_variable = { EH_mech_3_amount = 0 } EH_refresh_gui = yes } } if = { limit = { ROOT = { has_country_flag = EH_mech_production_4_in_progress_flag check_variable = { EH_mech_production_4_progress_var < 100 } } } ROOT = { add_to_variable = { EH_mech_production_4_progress_var = EH_mech_production_4_cost_var } clamp_variable = { var = EH_mech_production_4_progress_var max = 100 } EH_refresh_gui = yes } } else_if = { limit = { ROOT = { check_variable = { EH_mech_production_4_progress_var = 100 } } } ROOT = { clr_country_flag = EH_mech_production_4_in_progress_flag set_variable = { EH_mech_production_4_progress_var = 0 } if = { limit = { has_country_flag = EH_fourth_mech_1_selected_flag } add_equipment_to_stockpile = { type = HACS_0 amount = var:EH_mech_4_amount producer = ROOT } } else_if = { limit = { has_country_flag = EH_fourth_mech_2_selected_flag } add_equipment_to_stockpile = { type = HACS_1 amount = var:EH_mech_4_amount producer = ROOT } } else = { add_equipment_to_stockpile = { type = HACS_2 amount = var:EH_mech_4_amount producer = ROOT } } clr_country_flag = EH_fourth_mech_1_selected_flag clr_country_flag = EH_fourth_mech_2_selected_flag set_variable = { EH_mech_4_amount = 0 } EH_refresh_gui = yes } } if = { limit = { ROOT = { has_country_flag = EH_mech_production_5_in_progress_flag check_variable = { EH_mech_production_5_progress_var < 100 } } } ROOT = { add_to_variable = { EH_mech_production_5_progress_var = EH_mech_production_5_cost_var } clamp_variable = { var = EH_mech_production_5_progress_var max = 100 } EH_refresh_gui = yes } } else_if = { limit = { ROOT = { check_variable = { EH_mech_production_5_progress_var = 100 } } } ROOT = { clr_country_flag = EH_mech_production_5_in_progress_flag set_variable = { EH_mech_production_5_progress_var = 0 } if = { limit = { has_country_flag = EH_fifth_mech_1_selected_flag } add_equipment_to_stockpile = { type = HACS_0 amount = var:EH_mech_5_amount producer = ROOT } } else_if = { limit = { has_country_flag = EH_fifth_mech_2_selected_flag } add_equipment_to_stockpile = { type = HACS_1 amount = var:EH_mech_5_amount producer = ROOT } } else = { add_equipment_to_stockpile = { type = HACS_2 amount = var:EH_mech_5_amount producer = ROOT } } clr_country_flag = EH_fifth_mech_1_selected_flag clr_country_flag = EH_fifth_mech_2_selected_flag set_variable = { EH_mech_5_amount = 0 } EH_refresh_gui = yes } } } } } on_weekly = { effect = { if = { limit = { EH_scenario_enabled = yes } if = { limit = { ROOT = { has_completed_focus = EH_a_new_resource } } ROOT = { EH_set_randallite_effect = yes EH_randallite_effects = yes } } if = { limit = { ROOT = { check_variable = { EH_research_sites_constructed_var > 0 } has_country_flag = EH_research_sites_enabled NOT = { has_country_flag = EH_research_sites_strike_cooldown_flag } has_war_with = ALN } } ROOT = { random = { chance = 40 EH_research_site_strike_effect = yes } } } if = { limit = { has_idea = EH_scientist_andrzej_trautman_idea } ROOT = { random = { chance = 5 if = { limit = { is_special_project_being_researched = sp:sp_monitor_portal_energy_emissions_project } sp:sp_monitor_portal_energy_emissions_project = { add_project_progress_ratio = 0.03 } } if = { limit = { is_special_project_being_researched = sp:sp_spies_in_hive_project } sp:sp_spies_in_hive_project = { add_project_progress_ratio = 0.03 } } if = { limit = { is_special_project_being_researched = sp:sp_the_tesla_weapon_project } sp:sp_the_tesla_weapon_project = { add_project_progress_ratio = 0.03 } } } } } if = { limit = { check_variable = { EH_randallite_mines_set_up_var > 0 } } EH_weekly_randallite_income_effect = yes } } } } on_weekly_ALN = { effect = { if = { limit = { has_army_size = { size < 750 } NOT = { has_country_flag = EH_chimera_stop_spawning_units_flag } } if = { limit = { 814 = { has_state_flag = EH_state_with_portal } } 814 = { create_unit = { division = "name = \"Alaskan Cluster\" division_template = \"Portal Cluster\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 15079 allow_spawning_on_enemy_provs = yes count = 1 } create_unit = { division = "name = \"Alaskan Cluster\" division_template = \"Portal Cluster 2\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 15079 allow_spawning_on_enemy_provs = yes count = 1 } create_unit = { division = "name = \"Alaskan Cluster\" division_template = \"Portal Cluster 3\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 15079 allow_spawning_on_enemy_provs = yes count = 1 } } } if = { limit = { 591 = { has_state_flag = EH_state_with_portal } } 591 = { create_unit = { division = "name = \"Tibetan Cluster\" division_template = \"Portal Cluster\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 14126 allow_spawning_on_enemy_provs = yes count = 2 } create_unit = { division = "name = \"Tibetan Cluster\" division_template = \"Portal Cluster 2\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 14126 allow_spawning_on_enemy_provs = yes count = 2 } create_unit = { division = "name = \"Tibetan Cluster\" division_template = \"Portal Cluster 3\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 14126 allow_spawning_on_enemy_provs = yes count = 1 } } } if = { limit = { 457 = { has_state_flag = EH_state_with_portal } } 457 = { create_unit = { division = "name = \"Chilean Cluster\" division_template = \"Portal Cluster\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 11009 allow_spawning_on_enemy_provs = yes count = 1 } create_unit = { division = "name = \"Chilean Cluster\" division_template = \"Portal Cluster 2\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 11009 allow_spawning_on_enemy_provs = yes count = 2 } create_unit = { division = "name = \"Chilean Cluster\" division_template = \"Portal Cluster 3\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 11009 allow_spawning_on_enemy_provs = yes count = 1 } } } if = { limit = { 234 = { has_state_flag = EH_state_with_portal } } 234 = { create_unit = { division = "name = \"Ethiopian Cluster\" division_template = \"Portal Cluster\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 13831 allow_spawning_on_enemy_provs = yes count = 1 } create_unit = { division = "name = \"Ethiopian Cluster\" division_template = \"Portal Cluster 2\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 13831 allow_spawning_on_enemy_provs = yes count = 1 } create_unit = { division = "name = \"Ethiopian Cluster\" division_template = \"Portal Cluster 3\" start_experience_factor = 1 start_equipment_factor = 1" owner = ROOT prioritize_location = 13831 allow_spawning_on_enemy_provs = yes count = 2 } } } } if = { limit = { has_army_size = { size > 799 } } set_country_flag = EH_chimera_stop_spawning_units_flag } if = { limit = { OR = { has_decision = EH_construct_southern_zenobia_defense_line has_decision = EH_construct_western_zenobia_defense_line } NOT = { has_global_flag = EH_zenobia_line_construction_flag } } set_global_flag = EH_zenobia_line_construction_flag news_event = { id = EH_event.800 days = 1 } } if = { limit = { has_decision = EH_construct_bosphorus_defense_line NOT = { has_global_flag = EH_bosphorus_line_construction_flag } } set_global_flag = EH_bosphorus_line_construction_flag news_event = { id = EH_event.803 days = 1 } } if = { limit = { has_decision = EH_construct_caucasus_defense_line NOT = { has_global_flag = EH_caucasus_line_construction_flag } } set_global_flag = EH_caucasus_line_construction_flag news_event = { id = EH_event.806 days = 1 } } if = { limit = { has_decision = EH_construct_europe_defense_line NOT = { has_global_flag = EH_europe_line_construction_flag } } set_global_flag = EH_europe_line_construction_flag news_event = { id = EH_event.810 days = 1 } } if = { limit = { OR = { AND = { OR = { controls_province = 14157 controls_province = 3871 controls_province = 13227 } 217 = { has_state_flag = EH_state_with_zenobia_line_wall } } AND = { OR = { controls_province = 12764 controls_province = 7079 } 216 = { has_state_flag = EH_state_with_zenobia_line_wall } } } NOT = { has_global_flag = EH_zenobia_line_fallen_flag } } set_global_flag = EH_zenobia_line_fallen_flag news_event = { id = EH_event.801 days = 1 } } if = { limit = { OR = { controls_province = 1155 controls_province = 9947 } NOT = { OR = { has_global_flag = EH_zenobia_line_fallen_flag has_active_mission = EH_outer_saladin_defense_line_destruction } } 213 = { has_state_flag = EH_state_with_saladin_line_wall } } set_global_flag = EH_zenobia_line_fallen_flag news_event = { id = EH_event.802 days = 1 } } if = { limit = { OR = { controls_province = 9833 controls_province = 849 } NOT = { OR = { has_global_flag = EH_bosphorus_line_fallen_flag has_active_mission = EH_bosphorus_defense_line_destruction } } 155 = { has_state_flag = EH_state_with_bosphorus_line_wall } } set_global_flag = EH_bosphorus_line_fallen_flag news_event = { id = EH_event.805 days = 1 } } if = { limit = { has_global_flag = EH_bosphorus_line_fallen_flag has_global_flag = EH_mechs_announced_flag NOT = { has_global_flag = EH_bosphorus_counterattack_flag } NOT = { OR = { controls_province = 9833 controls_province = 849 } } } set_global_flag = EH_bosphorus_counterattack_flag news_event = { id = EH_event.511 days = 1 } } if = { limit = { OR = { controls_province = 9417 controls_province = 11418 controls_province = 11403 controls_province = 3463 controls_province = 3147 controls_province = 9415 controls_province = 6794 controls_province = 11566 controls_province = 9594 controls_province = 6791 controls_province = 9735 controls_province = 9753 controls_province = 757 } NOT = { OR = { has_global_flag = EH_caucasus_line_fallen_flag has_active_mission = EH_caucasus_defense_line_destruction_2 } } 669 = { has_state_flag = EH_state_with_caucasus_line_wall } } set_global_flag = EH_caucasus_line_fallen_flag news_event = { id = EH_event.809 days = 1 } } if = { limit = { OR = { controls_province = 4640 controls_province = 11057 controls_province = 9221 controls_province = 13932 controls_province = 3298 controls_province = 341 controls_province = 9275 controls_province = 310 controls_province = 11358 controls_province = 13256 controls_province = 9295 controls_province = 3320 controls_province = 327 controls_province = 9274 controls_province = 6281 controls_province = 3254 controls_province = 400 controls_province = 347 controls_province = 11247 controls_province = 290 controls_province = 11466 controls_province = 9452 controls_province = 6580 controls_province = 585 controls_province = 6522 controls_province = 3434 controls_province = 3565 controls_province = 11520 controls_province = 746 controls_province = 11676 controls_province = 727 controls_province = 11689 controls_province = 6584 controls_province = 9716 controls_province = 723 controls_province = 6747 controls_province = 9701 controls_province = 6706 controls_province = 3076 controls_province = 14287 controls_province = 687 } NOT = { OR = { has_global_flag = EH_europe_line_fallen_flag has_active_mission = EH_europe_defense_line_destruction } } 669 = { has_state_flag = EH_state_with_europe_line_wall } } set_global_flag = EH_europe_line_fallen_flag news_event = { id = EH_event.811 days = 1 } } if = { limit = { controls_province = 16092 NOT = { has_global_flag = EH_fall_of_washington_dc } } set_global_flag = EH_fall_of_washington_dc news_event = { id = EH_event.900 days = 1 } } if = { limit = { controls_province = 3878 NOT = { has_global_flag = EH_fall_of_new_york } } set_global_flag = EH_fall_of_new_york news_event = { id = EH_event.901 days = 1 } } if = { limit = { controls_province = 9814 NOT = { has_global_flag = EH_fall_of_los_angeles } } set_global_flag = EH_fall_of_los_angeles news_event = { id = EH_event.902 days = 1 } } if = { limit = { controls_province = 9671 NOT = { has_global_flag = EH_fall_of_san_francisco } } set_global_flag = EH_fall_of_san_francisco news_event = { id = EH_event.903 days = 1 } } if = { limit = { controls_province = 6380 NOT = { has_global_flag = EH_fall_of_moscow } } set_global_flag = EH_fall_of_moscow news_event = { id = EH_event.904 days = 1 } } if = { limit = { controls_province = 7014 NOT = { has_global_flag = EH_fall_of_shanghai } } set_global_flag = EH_fall_of_shanghai news_event = { id = EH_event.905 days = 1 } } if = { limit = { has_war = yes } every_enemy_country = { limit = { has_country_flag = EH_nation_activated_electric_traps_flag } every_controlled_state = { if = { limit = { OR = { is_frontline_state = yes is_second_line_state = yes } } set_state_flag = EH_electric_trap_enabled_flag } else_if = { limit = { has_state_flag = EH_electric_trap_enabled_flag NOT = { is_third_line_state = yes } } clr_state_flag = EH_electric_trap_enabled_flag } } } } } } on_monthly = { effect = { if = { limit = { check_variable = { EH_research_sites_constructed_var > 0 } has_country_flag = EH_research_sites_enabled NOT = { has_country_flag = EH_event_fired_flag } } if = { limit = { NOT = { has_country_flag = EH_event_1_fired_flag } } random = { chance = 30 country_event = EH_focus_event.9 } } if = { limit = { NOT = { has_country_flag = EH_event_2_fired_flag } } random = { chance = 50 country_event = EH_focus_event.10 } } if = { limit = { NOT = { has_country_flag = EH_event_3_fired_flag } } random = { chance = 10 country_event = EH_focus_event.11 } } } } } on_monthly_ALN = { effect = { every_enemy_country = { limit = { has_completed_focus = EH_study_new_enemy check_variable = { EH_army_attack_factor_var3 < 0.12 } } add_to_variable = { EH_army_attack_factor_var3 = 0.02 } add_to_variable = { EH_army_defence_factor_var3 = 0.02 } } if = { limit = { num_divisions_in_states = { count > 0 states = { 870 871 } } } 870 = { teleport_armies = { to_state = 1213 } } 871 = { teleport_armies = { to_state = 1213 } } } } } on_startup = { effect = { random_country = { # It must be some specific country to trigger the event limit = { EH_scenario_enabled = yes } news_event = EH_event.0 } } } }