wolfpacks = {
    track = submarines
    name = SUBDOCTRINE_SUBMARINE_WOLFPACKS
    description = SUBDOCTRINE_SUBMARINE_WOLFPACKS_DESC
    icon = GFX_doctrine_wolfpacks_medium

    xp_cost = 100
    xp_type = navy

    available = {
        always = yes
    }

    ai_will_do = { 
        base = 1
    }

    # EFFECTS
	naval_retreat_speed_after_initial_combat = 0.15
	submarine = {
		max_organisation = 10
	}

    rewards = {
		predictive_expertise = {
			submarine = {
				naval_torpedo_hit_chance_factor = 0.05
			}
		}
		pack_search_patterns = {
			submarine = {
				surface_detection = 0.15
				convoy_raiding_coordination = 0.20
			}
		}
		improvisation = {
			submarine = {
				max_strength = 0.2
				max_organisation = 10
			}
		}
        rough_weather_procedure = {
			equipment_bonus = {
                ship_hull_submarine = {
				    naval_weather_penalty_factor = -0.15
		        }
            }
		}
		wolfpack_coordination = {
			submarine = {
				surface_detection = 0.15
				convoy_raiding_coordination = 0.10
			}
		}
    }
}

submarine_fleet_operations = {
    track = submarines
    name = SUBDOCTRINE_SUBMARINE_FLEET_OPERATIONS
    description = SUBDOCTRINE_SUBMARINE_FLEET_OPERATIONS_DESC
    icon = GFX_doctrine_submarine_operations_medium

    xp_cost = 100
    xp_type = navy

    available = {
        always = yes
    }

    ai_will_do = { 
        base = 1
    }

    # EFFECTS
	naval_torpedo_screen_penetration_factor = 0.05

    rewards = {
		long_range_patrol_schedule = {
			submarine = {
				surface_detection = 0.30
				naval_range = 0.1 #TODO: does this work?
			}
		}
		sustained_operations = {
			submarine = {
				max_organisation = 15
			}
		}
		ambush_tactics = {
			navy_submarine_attack_factor = 0.10
		}
		diverse_operations = {
			submarine = { mines_planting = 0.20 }
		}
		predictive_search_patterns = {
			submarine = {
				surface_detection = 0.20
				convoy_raiding_coordination = 0.20
			}
		}
    }
}

capital_hunters = {
	track = submarines
    name = SUBDOCTRINE_SUBMARINE_CAPITAL_HUNTERS
    description = SUBDOCTRINE_SUBMARINE_CAPITAL_HUNTERS_DESC
    icon = GFX_doctrine_unrestricted_submarine_warfare_medium

    xp_cost = 100
    xp_type = navy

    ai_will_do = { 
        base = 1

    }
    available = {
        always = yes
    }

    naval_torpedo_reveal_chance_factor = -0.1

    rewards = {
    	fire_protocol_drills = {
    		submarine = {
    			naval_torpedo_hit_chance_factor = 0.15
    		}
    	}
    	battle_line_priority = {
    		naval_torpedo_screen_penetration_factor = 0.05
    	}
    	quick_reload_procedures = {
    		submarine = {
    			torpedo_attack = 0.1
    		}
    	}
    	battleship_chase = {
    		submarine = {
    			fuel_consumption = -0.1
    			naval_range = 0.1
    		}

    	}
    	escape_when_empty = {
    		submarine = {
    			sub_visibility = -0.05
    			naval_speed = 0.1
    		}
    		sub_retreat_speed = 0.1

    	}
    }
}

submarine_coastal_defense = {
	track = submarines
    name = SUBDOCTRINE_SUBMARINE_COASTAL_DEFENSE
    description = SUBDOCTRINE_SUBMARINE_COASTAL_DEFENSE_DESC
    icon = GFX_doctrine_undersea_blockade_medium

    xp_cost = 100
    xp_type = navy

    available = {
        is_special_project_completed = sp:sp_naval_midget_submarine
    }
    visible = {
        has_dlc = "No Compromise, No Surrender"
    }

    submarine = {
        supply_consumption = -0.02
    }

    rewards = {

    	optimized_compartments = {
            equipment_bonus = {
                ship_hull_midget_submarine = {
                    reliability = 0.2
                    instant = yes
                }
            }
    	}
    	patrol_vigilance = {
    		submarine = {
    			max_organisation = 20
    			surface_detection = 0.2
    		}
    	}
    	maneuever_fire = {
            equipment_bonus = {
                ship_hull_midget_submarine = {
                    torpedo_attack = 0.1
                    instant = yes
                }
            }
    	}
    	locals_knowledge = {
    		submarine = {
    			sub_visibility = -0.05
    		}
    	}
    	counter_submarine_operations = {
    		submarine = {
    			torpedo_attack = 0.1
    		}
            equipment_bonus = {
                ship_hull_midget_submarine = {
                    sub_visibility = -0.05

                    instant = yes
                }
            }
    	}
    }
}

coastal_minelaying = {
	track = submarines
    name = SUBDOCTRINE_SUBMARINE_COASTAL_MINELAYING
    description = SUBDOCTRINE_SUBMARINE_COASTAL_MINELAYING_DESC
    icon = GFX_doctrine_convoy_interdiction_medium

    xp_cost = 100
    xp_type = navy

    available = {
        always = yes
    }
    visible = {
        has_dlc = "No Compromise, No Surrender"
    }

    naval_mines_effect_reduction = 0.1

    rewards = {

    	covert_buildup = {
    		submarine = {
    			naval_speed = 0.1
    			mines_planting = 0.25
    		}

    	}

    	placement_for_effect = {
    		naval_mines_damage_factor = 0.25
    	}


    	minefield_patrols = {
    		destroyer = {
    			mines_planting = 0.25
    			lg_attack = 0.1
    		}

    	}
    	overhead_protection = {
    		destroyer = {
    			anti_air_attack = 0.1
    		}

    	}
    	clearing_procedures = {
    		submarine = {
    			mines_sweeping = 0.2
    		}
    		destroyer = {
    			mines_sweeping = 0.2
    		}
    	}
    }
}

long_range_submarines = {
    track = submarines
    name = SUBDOCTRINE_SUBMARINE_LONG_RANGE_SUBMARINES
    description = SUBDOCTRINE_SUBMARINE_LONG_RANGE_SUBMARINES_DESC
    icon = GFX_doctrine_long_range_submarines_medium

    xp_cost = 100
    xp_type = navy

    available = {
        OR = {
            is_special_project_completed = sp:sp_naval_cruiser_submarine
            is_special_project_completed = sp:sp_naval_submarine_carrier
        }
        
    }
    visible = {
        has_dlc = "Gotterdammerung"
    }

    naval_torpedo_hit_chance_factor = 0.1

    rewards = {

        ocean_patrols = {
            equipment_bonus = {
                ship_hull_fleet_submarine = {
                    surface_detection = 0.1
                    instant = yes
                }
                ship_hull_cruiser_submarine = {
                    surface_detection = 0.1
                    instant = yes
                }
            }
            submarine = {
                max_organisation = 10
            }
        }
        improved_dive_protocols = {
            equipment_bonus = {
                ship_hull_fleet_submarine = {
                    surface_visibility = -0.05
                    instant = yes
                }
                ship_hull_cruiser_submarine = {
                    surface_visibility = -0.05
                    instant = yes
                }
                ship_hull_carrier_submarine = {
                    surface_visibility = -0.1
                    instant = yes

                }
            }
        }
        support_the_surface = {
            equipment_bonus = {
                ship_hull_fleet_submarine = {
                    naval_speed = 0.1
                    torpedo_attack = 0.2
                    instant = yes
                }
                ship_hull_cruiser_submarine = {
                    naval_speed = 0.1
                    torpedo_attack = 0.2
                    instant = yes
                }
                ship_hull_carrier_submarine = {
                    naval_speed = 0.2
                    instant = yes
                }
            }
        }
        stowage_efficiency = {
            equipment_bonus = {
                ship_hull_fleet_submarine = {
                    fuel_consumption = -0.2
                    instant = yes
                }
                ship_hull_cruiser_submarine = {
                    fuel_consumption = -0.2
                    instant = yes
                }
                ship_hull_carrier_submarine = {
                    submarine_carrier_size = 2
                    instant = yes
                }
            }
        }

        deep_water_supremacy = {
            submarine = {
                sub_detection = 0.2
                torpedo_attack = 0.1
            }
        }   

    }

}

