﻿je_rifling = {
    icon = "gfx/interface/icons/event_icons/event_military.dds"
	
	group = je_group_technology

    is_shown_when_inactive = {
        has_technology_researched = percussion_cap
    }
    possible = {
        has_technology_researched = rifling
        army_size >= 20
    }
    complete = {
        any_scope_building = { 
            is_building_type = building_arms_industry
            OR = {
                has_active_production_method = pm_rifles
                has_active_production_method = pm_repeaters
                has_active_production_method = pm_bolt_action_rifles
            }
            level >= 3
            occupancy >= 0.75
        }
		can_research = repeaters
    }
    on_complete = {
        trigger_event = { 
            id = military_tech_events.401 
        }
    }
	
	fail = {
		has_technology_researched = repeaters
	}
	
    timeout = 3650
}

je_machine_guns = {
    icon = "gfx/interface/icons/event_icons/event_military.dds"

    group = je_group_technology
    is_shown_when_inactive = {
        is_player = yes
        has_technology_researched = handcranked_machine_gun
    }
    possible = {
        has_technology_researched = automatic_machine_guns
        army_size >= 20
    }
    complete = {
        army_mobilization_option_fraction = {  
			target = mobilization_option:mobilization_option_machinegunners  
			value >= 0.2  
		} 
		any_scope_war = {
			any_scope_front = {
				any_scope_general = {
					owner = ROOT
					this.commander_military_formation = {
						has_mobilization_option = mobilization_option:mobilization_option_machinegunners
					}
				}
			}
		}
    }
    on_complete = {
        trigger_event = { 
            id = military_tech_events.402
        }
    }
    timeout = 3650
}

je_ironclads = {
    icon = "gfx/interface/icons/event_icons/event_military.dds"

    group = je_group_technology
    is_shown_when_inactive = {
        is_player = yes
        has_technology_researched = screw_frigate
    }
    possible = {
        has_technology_researched = ironclad_tech
        navy_size >= 30
    }
    complete = {
        country_navy_unit_type_fraction = {  
            target = unit_type:combat_unit_type_ironclad
            value >= 0.2  
        }
        any_military_formation = {
            filter = {
                is_fleet = yes
            }
            any_scope_character = {
                has_role = admiral
                commander_military_formation = {
                    formation_navy_unit_type_fraction = {  
                        target = unit_type:combat_unit_type_ironclad
                        value >= 0.2  
                    }
                }
            }
            percent >= 0.25
        }
    }
    on_complete = {
        trigger_event = { 
            id = military_tech_events.403
        }
    }
    timeout = 3650
}

je_monitors = {
    icon = "gfx/interface/icons/event_icons/event_military.dds"

    group = je_group_technology
    is_shown_when_inactive = {
        is_player = yes
        has_technology_researched = screw_frigate
    }
    possible = {
        has_technology_researched = monitor_tech
        navy_size >= 20
    }
    complete = {
        country_navy_unit_type_fraction = {  
            target = unit_type:combat_unit_type_monitor
            value >= 0.2  
        }
        any_military_formation = {
            filter = {
                is_fleet = yes
            }
            any_scope_character = {
                has_role = admiral
                commander_military_formation = {
                    formation_navy_unit_type_fraction = {  
                        target = unit_type:combat_unit_type_monitor
                        value >= 0.2  
                    }
                }
            }
            percent >= 0.25
        }
    }
    on_complete = {
        trigger_event = { 
            id = military_tech_events.404
        }
    }
    timeout = 3650
}