using System.Collections.Generic;
using Model.Entity.Parts;
using Model.Entity.Types;
using Model.Types;

namespace Model.Entity.Data;

public partial class EntityData
{
    public static Dictionary<string, EntityModel> GetAbilityData()
    {
        return new Dictionary<string, EntityModel>
        {
            // Abilities
            // Q'Rath
            {
                DataType.ABILITY_RadiantWard,
                new EntityModel(DataType.ABILITY_RadiantWard, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Radiant Ward", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target a location. A Hidden mine is laid there.

                            Detonates when enemy ground units get close. Enemies hit 
                            are revealed, slowed, and take additional damage.
                            """
                    })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D", HoldSpace = true })
                    .AddPart(new EntityProductionModel { DefensiveLayer = 45, Cooldown = 40 })
                    .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_RadiantWard })
                    .AddPart(new EntityVitalityModel
                        { Health = 30, DefenseLayer = 30, Lasts = 60, Armor = ArmorType.Light })
                    .AddPart(new EntityRequirementModel
                    {
                        Id = DataType.BUILDING_HouseOfFadingSaints,
                        Requirement = RequirementType.Production_Building
                    })
            },

            {
                DataType.PASSIVE_Maledictions,
                new EntityModel(DataType.PASSIVE_Maledictions, EntityType.Passive)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Maledictions", Descriptive = DescriptiveType.Passive,
                        Description = @"Stun ground units? With Maledictions passive.",
                        Notes = "Not implemented"
                    })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
            },
            {
                DataType.ABILITY_Windstep,
                new EntityModel(DataType.ABILITY_Windstep, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Windstep", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target a location. Teleport to location: costs Shields.

                            Decrease cooldown and avoid Shield cost when teleporting to <b style="color:white">Hallowed Ground</b>.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 20 })
            },
            {
                DataType.ABILITY_Intervention,
                new EntityModel(DataType.ABILITY_Intervention, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Intervention", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Target a location. A Saoshin leaps to the location and heals friendly units."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 30 })
            },
            {
                DataType.ABILITY_OrdainedPassage,
                new EntityModel(DataType.ABILITY_OrdainedPassage, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Ordained Passage", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target an area to send a damage reduction to circle to.

                            The circle starts at the Ark Mother, travels to the target location, and stays there for a duration.
                            Friendly units get damage reduction while in the circle, including when it is movie.
                            Costs all the Ark Mother's Shields.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "D", HoldSpace = true })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 3, Energy = 55 })
            },
            {
                DataType.ABILITY_DeployAbsolver,
                new EntityModel(DataType.ABILITY_DeployAbsolver, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Absolver", Descriptive = DescriptiveType.Ability,
                        Description =
                            @"Deploying the Absolver drastically <b style=""color: orange"">increases its attack speed</b>."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
            },
            {
                DataType.ABILITY_DeployMagi,
                new EntityModel(DataType.ABILITY_DeployMagi, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Magi", Descriptive = DescriptiveType.Ability,
                        Description =
                            """Deploys the Magi to project <b style="color:white">Hallowed Ground</b> around it."""
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
            },

            {
                DataType.ABILITY_DeploySentinel,
                new EntityModel(DataType.ABILITY_DeploySentinel, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Sentinel", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Deploy to absorb enemy projectiles. Costs Shields.

                            Deployed units cannot move. Use Mobilize to move again.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D", HoldSpace = true })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
            },


            {
                DataType.ABILITY_Smite,
                new EntityModel(DataType.ABILITY_Smite, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Smite", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target an enemy unit. Deal damage after a delay.

                            After being targeted, the enemy can move out of range to 
                            cancel damage. Can store up to 2 charges.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 2, Energy = 30 })
            },


            {
                DataType.ABILITY_Awestrike,
                new EntityModel(DataType.ABILITY_Awestrike, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Awestrike", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target and area. Damages enemy ground units.

                            Units in the center of the area take more damage. 
                            Units take damage over time after the initial burst of damage and continue to take damage
                            over time after leaving the area.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 8, Energy = 60 })
            },

            {
                DataType.ABILITY_TitheBlades,
                new EntityModel(DataType.ABILITY_TitheBlades, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Tithe Blades", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Activate to steal Shields from your nearby ground units, up to a cap.

                            Also increases attack speed based on amount of Shields stolen.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D", HoldSpace = true })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
                    .AddPart(new EntityProductionModel { Cooldown = 70 })
            },

            {
                DataType.ABILITY_MobilizeQrath,
                new EntityModel(DataType.ABILITY_MobilizeQrath, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Mobilize Q'Rath", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Mobilize all deployed Q'Rath units."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "TAB", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
            },
            // Abilities
            // Aru
            {
                DataType.ABILITY_MobilizeAru,
                new EntityModel(DataType.ABILITY_MobilizeAru, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Mobilize Aru", Descriptive = DescriptiveType.Ability,
                        Description =
                            @"Mobilize all deployed Aru units."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_Offering,
                new EntityModel(DataType.ABILITY_Offering, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Offering", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Sacrifices 10 life to give Masked Hunters +3 damage for 3 shots. And increased speed and attack speed."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_Offering })
                    .AddPart(new EntityProductionModel { Cooldown = 5 })
            },
            {
                DataType.ABILITY_DiveBomb,
                new EntityModel(DataType.ABILITY_DiveBomb, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Dive Bomb", Descriptive = DescriptiveType.Ability,
                        Description =
                            "The aarox dives down into the ground, dealing damage in a smaller area. Non-hovering units in the area take additional damage over time."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_DrainingEmbrace,
                new EntityModel(DataType.ABILITY_DrainingEmbrace, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Draining Embrace", Descriptive = DescriptiveType.Ability,
                        Description = "Units in the target area are rooted and lose energy."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" })
                    .AddPart(new EntityProductionModel { Energy = 30, Cooldown = 5 })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_BloodPlague,
                new EntityModel(DataType.ABILITY_BloodPlague, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Blood Plague", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Damage is based on maximum HP. Damage cannot kill a unit."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" })
                    .AddPart(new EntityProductionModel { Energy = 90, Cooldown = 8 })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_DeployResinant,
                new EntityModel(DataType.ABILITY_DeployResinant, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Resinant", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Get even more attack range if deployed on Rootway. Deploying a unit makes it unable to move. Use Mobilize to move again."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_DeployBloodAnchor,
                new EntityModel(DataType.ABILITY_DeployBloodAnchor, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Blood Anchor", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Activate to deploy and begin spawning Cystic Crawlers.<br/>
                            <br/>
                            Generates Rootway. Cystic Crawlers are temporary units that cannot survive off Rootway and self-destruct to deal
                            area damage. Deployed units cannot move. Use Mobilize to move again.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_BloodyRebound,
                new EntityModel(DataType.ABILITY_BloodyRebound, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Bloody Rebond", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Active to prevent death for a duration. 
                            Instead of dying, the Bloodbound will teleport to the place it was when the ability was activated. 
                            It also takes less damage while Blood Rebound is active. 
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" })
                    .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityProductionModel { Energy = 50, Cooldown = 40 })
            },

            {
                DataType.ABILITY_RootVice,
                new EntityModel(DataType.ABILITY_RootVice, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Root Vice", Descriptive = DescriptiveType.Ability,
                        Description =
                            "Roots all units for several seconds, then leaves them slowed for several seconds after."
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" })
                    .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityProductionModel { Energy = 50, Cooldown = 10 })
            },
            {
                DataType.ABILITY_BirthingStorm,
                new EntityModel(DataType.ABILITY_BirthingStorm, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Birthing Storm", Descriptive = DescriptiveType.Ability,
                        Description =
                            """
                            Target an area to deal damage and Seed enemies.
                            """,
                        Notes =
                            """
                            Deals 10 damage + 5% of max life of the target immediately upon affecting the enemy unit. <br/>
                            It deals 15 damage + 15% after 8 seconds. If the unit dies during those 8 seconds (including the final burst), 
                            spawns 1 quitl every 2 supply of the dead unit, rounded up. Stacking only refreshes duration of debuff.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" })
                    .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityProductionModel { Energy = 95, Cooldown = 8 })
            },
            {
                DataType.ABILITY_DeployDreadSister,
                new EntityModel(DataType.ABILITY_DeployDreadSister, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deploy Dread Sister", Descriptive = DescriptiveType.Dislodger,
                        Description =
                            """
                            Deploy to get more damage and more range.<br/>
                            <br/>
                            Can only attack ground. Each shot cost Energy. Use Mobilize to move again.
                            """
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityVanguardAddedModel
                        { ImmortalId = DataType.IMMORTAL_Mala, ReplaceId = DataType.UNIT_Godphage })
            },
            {
                DataType.ABILITY_MorphToGodphage,
                new EntityModel(DataType.ABILITY_MorphToGodphage, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Morph To Godphage", Descriptive = DescriptiveType.Dislodger,
                        Description = "Active to morph a Red Seer into a Godphage"
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
                    .AddPart(new EntityProductionModel { Alloy = 150, Energy = 100, BuildTime = 25 })
                    .AddPart(new EntitySupplyModel { Takes = 8 })
                    .AddPart(new EntityRequirementModel
                        { Id = DataType.UNIT_RedSeer, Requirement = RequirementType.Morph })
                    .AddPart(new EntityVitalityModel { Health = 225, DefenseLayer = 375, Armor = ArmorType.Heavy })
                    .AddPart(new EntityMovementModel { Speed = 350, Movement = MovementType.Ground })
                    .AddPart(new EntityWeaponModel
                        { Damage = 155, Range = 1100, SecondsBetweenAttacks = 7f, Targets = TargetType.Ground })
                    .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HiddenX })
                    .AddPart(new EntityIdUpgradeModel { Id = DataType.UPGRADE_GodphageDamage })
            },

            {
                DataType.ABILITY_DeepTunnel,
                new EntityModel(DataType.ABILITY_DeepTunnel, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Deep Tunnel"
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "TAB", HoldSpace = true, HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },

            {
                DataType.ABILITY_ObstructingSwarm,
                new EntityModel(DataType.ABILITY_ObstructingSwarm, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Obstructing Swarm"
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            },
            {
                DataType.ABILITY_Hematoma,
                new EntityModel(DataType.ABILITY_Hematoma, EntityType.Ability)
                    .AddPart(new EntityInfoModel
                    {
                        Name = "Hematoma"
                    })
                    .AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "D" })
                    .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
            }
        };
    }
}