namespace EDPlayerJournal;

public enum ThargoidVessel {
    Unknown = 0,
    Scout = 1,
    Orthrus = 2,
    Cyclops = 3,
    Basilisk = 4,
    Medusa = 5,
    Hydra = 6,
    // Includes Glaive and Scythe
    Hunter = 7,
    /// <summary>
    /// Thargoid drone
    /// </summary>
    Revenant = 8,
    /// <summary>
    /// New thargoid drone in U17
    /// </summary>
    Banshee = 9,
}

public class Thargoid {
    public static string ThargoidFaction = Factions.Thargoid;

    public static Dictionary<ulong, ThargoidVessel> VesselPayout { get; } = new() {
        // Up to date values ever since 14.02
        {    25000, ThargoidVessel.Revenant },
        {    65000, ThargoidVessel.Scout },
        {    75000, ThargoidVessel.Scout },
        // New in Update 17
        {   100000, ThargoidVessel.Banshee },
        // New in Update 15
        {  4500000, ThargoidVessel.Hunter },
        {  6500000, ThargoidVessel.Cyclops },
        { 20000000, ThargoidVessel.Basilisk },
        //{ 25000000, ThargoidVessel.Orthrus },
        { 34000000, ThargoidVessel.Medusa },
        // March, 16th 2023 the Orthrus payout was buffed again.
        { 40000000, ThargoidVessel.Orthrus },
        { 50000000, ThargoidVessel.Hydra },
        // These are the old values pre Update 14.02
        //{    80000, ThargoidVessel.Scout },
        //{  8000000, ThargoidVessel.Cyclops },
        //{ 24000000, ThargoidVessel.Basilisk },
        // In Update 14.1 the payout for Orthrus has been rebalanced.
        //{ 30000000, ThargoidVessel.Orthrus },
        //{ 40000000, ThargoidVessel.Medusa },
        // This used to be the old payout value for Orthrus, it now conflicts
        // with Post Update 14.02 Hydra values
        //{ 50000000, ThargoidVessel.Orthrus },
        //{ 60000000, ThargoidVessel.Hydra },
    };

    public static Dictionary<ThargoidVessel, string?> VesselNames { get; } = new() {
        { ThargoidVessel.Unknown, "(Unknown)" },
        { ThargoidVessel.Revenant, "Revenant" },
        { ThargoidVessel.Scout, "Scout" },
        { ThargoidVessel.Orthrus, "Orthrus" },
        { ThargoidVessel.Cyclops, "Cyclops" },
        { ThargoidVessel.Basilisk, "Basilisk" },
        { ThargoidVessel.Medusa, "Medusa" },
        { ThargoidVessel.Hydra, "Hydra" },
        { ThargoidVessel.Hunter, "Hunter" },
        { ThargoidVessel.Banshee, "Banshee" },
    };

    public static ThargoidVessel GetVesselByPayout(ulong payout) {
        if (VesselPayout.ContainsKey(payout)) {
            return VesselPayout[payout];
        }
        return ThargoidVessel.Unknown;
    }

    public static string? GetVesselName(ThargoidVessel v) {
        if (VesselNames.ContainsKey(v)) {
            return VesselNames[v];
        }
        return null;
    }
}
