package data.missions.test_ngo;

import com.fs.starfarer.api.fleet.FleetGoal;
import com.fs.starfarer.api.fleet.FleetMemberType;
import com.fs.starfarer.api.mission.FleetSide;
import com.fs.starfarer.api.mission.MissionDefinitionAPI;
import com.fs.starfarer.api.mission.MissionDefinitionPlugin;

public class MissionDefinition implements MissionDefinitionPlugin
{
    @Override
    public void defineMission(MissionDefinitionAPI api)
    {
        // Set up the fleets
        api.initFleet(FleetSide.PLAYER, "NGO", FleetGoal.ATTACK, false);
        api.initFleet(FleetSide.ENEMY, "HSS", FleetGoal.ATTACK, true);

        // Set a blurb for each fleet
        api.setFleetTagline(FleetSide.PLAYER, "Invasion Fleet");
        api.setFleetTagline(FleetSide.ENEMY, "Hegemony Defense Fleet");

        // These show up as items in the bulleted list under
        // "Tactical Objectives" on the mission detail screen
        api.addBriefingItem("Destroy any resistance!");

        // Set up the player's fleet
        api.addToFleet(FleetSide.PLAYER, "ngo_experimental_super_carrier_balanced", FleetMemberType.SHIP, "NGO Supercarrier", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_battleship_balanced", FleetMemberType.SHIP, "NGO Battleship", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_battlecruiser_balanced", FleetMemberType.SHIP, "NGO Battlecruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_gatekeeper_balanced", FleetMemberType.SHIP, "NGO Gatekeeper", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_experimental_heavy_cruiser_balanced", FleetMemberType.SHIP, "NGO Heavy Cruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_battlefreighter_balanced", FleetMemberType.SHIP, "NGO Commandcarrier", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_siegecruiser_balanced", FleetMemberType.SHIP, "NGO Siegecruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_battlecarrier_balanced", FleetMemberType.SHIP, "NGO Battlecarrier", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_cruiser_balanced", FleetMemberType.SHIP, "NGO Cruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_experimental_cruiser_balanced", FleetMemberType.SHIP, "NGO Experimental Cruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_cruiser2_balanced", FleetMemberType.SHIP, "NGO Cruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_light_cruiser_balanced", FleetMemberType.SHIP, "NGO Support Cruiser", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_experimental_heavy_tug_balanced", FleetMemberType.SHIP, "NGO Heavy Tug", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_heavy_freighter_balanced", FleetMemberType.SHIP, "NGO Heavy Freighter", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_combat_freighter_balanced", FleetMemberType.SHIP, "NGO Combat Freighter", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_heavy_destroyer_balanced", FleetMemberType.SHIP, "NGO Heavy Destroyer", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_destroyer2_balanced", FleetMemberType.SHIP, "NGO Phase Destroyer", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_destroyer_balanced", FleetMemberType.SHIP, "NGO Destroyer", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_troop_transporter_balanced", FleetMemberType.SHIP, "NGO Troop Transporter", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_freighter_balanced", FleetMemberType.SHIP, "NGO Freighter", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_heavy_frigate_balanced", FleetMemberType.SHIP, "NGO Heavy Frigate", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_frigate_balanced", FleetMemberType.SHIP, "NGO Frigate", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_frigate2_balanced", FleetMemberType.SHIP, "NGO Frigate", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_mining_frigate_balanced", FleetMemberType.SHIP, "NGO Mining Frigate", false);
        api.addToFleet(FleetSide.PLAYER, "ngo_shuttle_balanced", FleetMemberType.SHIP, "NGO Shuttle", false);

        // Set up the enemy fleet
        api.addToFleet(FleetSide.ENEMY, "onslaught_Standard", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "onslaught_Standard", FleetMemberType.SHIP, false);

        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);
        api.addToFleet(FleetSide.ENEMY, "enforcer_Assault", FleetMemberType.SHIP, false);


        // Set up the map.
        float width = 14000f;
        float height = 14000f;
        api.initMap((float) -width / 2f, (float) width / 2f, (float) -height / 2f, (float) height / 2f);

        float minX = -width / 2;
        float minY = -height / 2;

        for (int i = 0; i < 15; i++) {
            float x = (float) Math.random() * width - width / 2;
            float y = (float) Math.random() * height - height / 2;
            float radius = 100f + (float) Math.random() * 900f;
            api.addNebula(x, y, radius);
        }

        // Add an asteroid field going diagonally across the
        // battlefield, 2000 pixels wide, with a maximum of
        // 100 asteroids in it.
        // 20-70 is the range of asteroid speeds.
        api.addAsteroidField(0f, 0f, (float) Math.random() * 360f, width,20f, 70f, 100);
    }
}






