new_fleet_in_being = {
    folder = naval

    name = GRAND_DOCTRINE_FLEET_IN_BEING
    description = GRAND_DOCTRINE_FLEET_IN_BEING_DESC
    icon = GFX_doctrine_fleet_in_being_medium
    available = {
        has_navy_size = {
            type = capital_ship
            size > 3
        }
    }

    xp_cost = 100
    xp_type = navy

    ai_will_do = {
        base = 1
    }

    tracks = {
        submarines
        screens
        carriers
        capital_ships
    }

    # EFFECTS
    effect = {
        custom_effect_tooltip = new_fleet_in_being_sub_tt
    }
    SH_battleship = {
        max_organisation = 5
    }
	battleship = {
		max_organisation = 5
	}
    battle_cruiser = {
        max_organisation = 5
    }
	positioning = 0.1
	
    milestones = {
		{
            #Submarines
	        naval_torpedo_reveal_chance_factor = -0.05
			convoy_raiding_efficiency_factor = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = submarines_milestone_var
                        }
                    }
                    set_variable = { submarines_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { submarines_milestone_var = 1 }
                }
            }
        }
		{
            #Screens
			convoy_escort_efficiency = 0.10
            convoy_retreat_speed = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = screens_milestone_var
                        }
                    }
                    set_variable = { screens_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { screens_milestone_var = 1 }
                }
            }
        }
        {
            #Carriers
	        carrier = {
                carrier_surface_detection = 0.1
                carrier_sub_detection = 0.05
            }
            fighter_sortie_efficiency = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = carriers_milestone_var
                        }
                    }
                    set_variable = { carriers_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { carriers_milestone_var = 1 }
                }
            }
        }
        {
            #Capital Ships
			positioning = 0.1
            strike_force_movement_org_loss = -0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = capital_ships_milestone_var
                        }
                    }
                    set_variable = { capital_ships_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { capital_ships_milestone_var = 1 }
                }
            }
        }
    }
}

new_convoy_raiding = {
    folder = naval

    name = GRAND_DOCTRINE_CONVOY_RAIDING
    description = GRAND_DOCTRINE_CONVOY_RAIDING_DESC
    icon = GFX_doctrine_trade_interdiction_medium
    available = {
        has_tech = basic_torpedo
        has_navy_size = {
            type = screen_ship
            size > 3
        }
        has_navy_size = {
            type = submarine
            size > 3
        }
    }

    xp_cost = 100
    xp_type = navy

    ai_will_do = {
        base = 1

        modifier = {
            factor = 10
            is_major = no
        }
    }

    tracks = {
        submarines
        screens
        carriers
        capital_ships
    }

    # EFFECTS
	
	effect = {
        custom_effect_tooltip = new_convoy_raiding_sub_tt
    }
	submarine = {
		max_organisation = 10
		surface_detection = 0.05
	}
	convoy_raiding_efficiency_factor = 0.1
	
    milestones = {
		{
            #Submarines
	        naval_torpedo_reveal_chance_factor = -0.1
			submarine = {
                convoy_raiding_coordination = 0.1
                naval_speed = 0.1
            }
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = submarines_milestone_var
                        }
                    }
                    set_variable = { submarines_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { submarines_milestone_var = 1 }
                }
            }
        }
		{
            #Screens
            mines_planting_by_fleets_factor = 0.1
            naval_enemy_retreat_chance = -0.05
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = screens_milestone_var
                        }
                    }
                    set_variable = { screens_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { screens_milestone_var = 1 }
                }
            }
        }
        {
            #Carriers
	        carrier = {
                carrier_surface_detection = 0.1
                carrier_sub_detection = 0.1
            }
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = carriers_milestone_var
                        }
                    }
                    set_variable = { carriers_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { carriers_milestone_var = 1 }
                }
            }
        }
        {
            #Capital Ships
			navy_max_range_factor = 0.1
            naval_enemy_fleet_size_ratio_penalty_factor = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = capital_ships_milestone_var
                        }
                    }
                    set_variable = { capital_ships_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { capital_ships_milestone_var = 1 }
                }
            }
        }
    }
}

new_base_strike = {
    folder = naval

    name = GRAND_DOCTRINE_BASE_STRIKE
    description = GRAND_DOCTRINE_BASE_STRIKE_DESC
    icon = GFX_doctrine_base_strike_medium
    available = {
        has_navy_size = {
            type = carrier
            size > 0
        }
    }

    xp_cost = 100
    xp_type = navy

    ai_will_do = {
        base = 1
    }

    tracks = {
        submarines
        screens
        carriers
        capital_ships
    }

    # EFFECTS
	
	effect = {
        custom_effect_tooltip = new_base_strike_sub_tt
    }
	carrier = {
		max_organisation = 10
	}
	port_strike = 0.4
	
    milestones = {
		{
            #Submarines
	        submarine = {
                surface_detection = 0.05
                convoy_raiding_coordination = 0.05
            }
            naval_torpedo_screen_penetration_factor = 0.05
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = submarines_milestone_var
                        }
                    }
                    set_variable = { submarines_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { submarines_milestone_var = 1 }
                }
            }
        }
		{
            #Screens
			screening_efficiency = 0.1
            naval_retreat_chance = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = screens_milestone_var
                        }
                    }
                    set_variable = { screens_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { screens_milestone_var = 1 }
                }
            }
        }
        {
            #Carriers
	        carrier_capacity_penalty_reduction = -0.1
			sortie_efficiency = 0.1
            carrier = {
                carrier_surface_detection = 0.05
                carrier_sub_detection = 0.05
            }
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = carriers_milestone_var
                        }
                    }
                    set_variable = { carriers_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { carriers_milestone_var = 1 }
                }
            }
        }
        {
            #Capital Ships
			navy_anti_air_attack_factor = 0.1
            positioning = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = capital_ships_milestone_var
                        }
                    }
                    set_variable = { capital_ships_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { capital_ships_milestone_var = 1 }
                }
            }
        }
    }
}

new_littoral_defense = {
    folder = naval

    name = GRAND_DOCTRINE_LITTORAL_DEFENSE
    description = GRAND_DOCTRINE_LITTORAL_DEFENSE_DESC
    icon = GFX_doctrine_littoral_defense_medium
    available = {
        always = yes
    }

    xp_cost = 75
    xp_type = navy

    ai_will_do = {
        base = 0
    }

    tracks = {
        submarines
        screens
        carriers
        capital_ships
    }

    # EFFECTS
	effect = {
        custom_effect_tooltip = new_littoral_defense_sub_tt
    }
	navy_max_range_factor = -0.5
    navy_visibility = -0.1
	
    milestones = {
		{
            #Submarines
	        submarine = {
                surface_detection = 0.05
            }
            naval_torpedo_reveal_chance_factor = -0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = submarines_milestone_var
                        }
                    }
                    set_variable = { submarines_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { submarines_milestone_var = 1 }
                }
            }
        }
		{
            #Screens
			naval_retreat_chance = 0.1
            night_spotting_chance = 0.05
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = screens_milestone_var
                        }
                    }
                    set_variable = { screens_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { screens_milestone_var = 1 }
                }
            }
        }
        {
            #Carriers
	        navy_carrier_air_agility_factor = 0.1
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = carriers_milestone_var
                        }
                    }
                    set_variable = { carriers_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { carriers_milestone_var = 1 }
                }
            }
        }
        {
            #Capital Ships
			naval_retreat_speed_after_initial_combat = 0.1
            naval_night_attack = 0.05
            effect = {
                if = {
                    limit = {
                        NOT = {
                            has_variable = capital_ships_milestone_var
                        }
                    }
                    set_variable = { capital_ships_milestone_var = 1 }
                }
                else = {
                    add_to_variable = { capital_ships_milestone_var = 1 }
                }
            }
        }
    }
}