Example #1
0
        private void Setup()
        {
            try
            {
                if (BoltNetwork.isRunning)
                {
                    if (entity == null)
                    {
                        entity = transform.root.GetComponentInChildren <BoltEntity>();
                    }
                    if (entity == null)
                    {
                        entity = HealthScript.entity;
                    }
                    if (entity == null)
                    {
                        entity = transform.root.GetComponent <BoltEntity>();
                    }
                    EnemyManager.AddHostEnemy(this);
                }
                if (!EnemyManager.enemyByTransform.ContainsKey(transform))
                {
                    EnemyManager.enemyByTransform.Add(this.transform, this);
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }

            //Assiging base health, if new enemy
            if (baseHealth == 0)
            {
                baseHealth = HealthScript.Health;
            }
            else                //reverting health to base health if reused enemy (in case enemies are pooled)
            {
                HealthScript.Health = baseHealth;
            }

            StopAllCoroutines();

            Steadfast          = 100;
            slows              = new Dictionary <int, EnemyDebuff>();
            dmgTakenDebuffs    = new Dictionary <int, EnemyDebuff>();
            dmgDealtDebuffs    = new Dictionary <int, EnemyDebuff>();
            FireDamageDebuffs  = new Dictionary <int, EnemyDebuff>();
            DamageOverTimeList = new List <DoT>();
            abilities          = new List <Abilities>();

            //picking abilities
            if ((UnityEngine.Random.value < 0.1 || (AIScript.creepy_boss && !AIScript.girlFullyTransformed) || ModSettings.difficulty == ModSettings.Difficulty.Hell) && enemyType != Enemy.Baby)
            {
                int abilityAmount = UnityEngine.Random.Range(3, 7);
                if (AIScript.creepy_boss)
                {
                    abilityAmount = 10;
                }                   //Megan boss always has abilities, a lot of them.

                int   i            = 0;
                Array abilityArray = Enum.GetValues(typeof(Abilities));

                //Determining if enemy is Elite, Miniboss or Boss type of enemy
                if (abilityAmount > 6 && Random.value < 0.3f)
                {
                    _rarity = EnemyRarity.Boss;
                    abilities.Add(Abilities.BossSteadfast);
                }
                else if (abilityAmount > 4 && Random.value < 0.3f)
                {
                    abilities.Add(Abilities.EliteSteadfast);
                    _rarity = EnemyRarity.Miniboss;
                }
                else
                {
                    _rarity = EnemyRarity.Elite;
                }

                if (AIScript.creepy_boss && !AIScript.girlFullyTransformed)                    //Force adding BossSteadfast to Megan
                {
                    abilities.Clear();
                    _rarity = EnemyRarity.Boss;
                    abilities.Add(Abilities.BossSteadfast);
                }

                //Trial and error method of picking abilities
                while (i < abilityAmount)
                {
                    bool      canAdd = true;
                    Abilities ab     = (Abilities)abilityArray.GetValue(UnityEngine.Random.Range(0, abilityArray.Length));
                    if (ab == Abilities.Steadfast || ab == Abilities.EliteSteadfast || ab == Abilities.BossSteadfast)
                    {
                        if (abilities.Contains(Abilities.Steadfast) || abilities.Contains(Abilities.EliteSteadfast) || abilities.Contains(Abilities.BossSteadfast))
                        {
                            canAdd = false;
                        }
                    }
                    else if (ab == Abilities.Tiny || ab == Abilities.Huge)
                    {
                        if (AIScript.creepy_boss && ab == Abilities.Tiny)
                        {
                            canAdd = false;
                        }
                        else if (abilities.Contains(Abilities.Huge) || abilities.Contains(Abilities.Tiny))
                        {
                            canAdd = false;
                        }
                    }
                    else if (ab == Abilities.Undead && !(AIScript.creepy || AIScript.creepy_fat))
                    {
                        canAdd = false;
                    }
                    if (abilities.Contains(ab))
                    {
                        canAdd = false;
                    }
                    if (canAdd)
                    {
                        i++;
                        abilities.Add(ab);
                    }
                }
            }
            else
            {
                _rarity = EnemyRarity.Normal;
            }

            SetType();
            SetLevel();
            RollName();
            //Assigning rest of stats
            int dif = (int)ModSettings.difficulty;

            DamageMult  = Mathf.Pow(Level, 3.5f) / 100f + 0.4f;
            DamageMult *= dif * 2f + 1;

            Armor          = Mathf.FloorToInt(Random.Range(Mathf.Pow(Level, 2.4f) * 0.36f + 1, Mathf.Pow(Level, 2.45f) + 20) * ModSettings.EnemyArmorMultiplier);
            Armor         *= dif / 2 + 1;
            ArmorReduction = 0;
            extraHealth    = (HealthScript.Health * Mathf.Pow((float)Level, 2.215f + (dif * 0.19f)) / 16);
            extraHealth   *= dif / 2 + 1;
            AnimSpeed      = 0.94f + (float)Level / 190;

            extraHealth *= ModSettings.EnemyHealthMultiplier;
            DamageMult  *= ModSettings.EnemyDamageMultiplier;
            AnimSpeed   *= ModSettings.EnemySpeedMultiplier;

            if (_rarity != EnemyRarity.Normal)
            {
                Armor *= 2;
            }
            //Extra health for boss type enemies
            switch (_rarity)
            {
            case EnemyRarity.Elite:
                extraHealth *= 2;

                break;

            case EnemyRarity.Miniboss:
                extraHealth *= 5;

                break;

            case EnemyRarity.Boss:
                extraHealth *= 10;
                if (!abilities.Contains(Abilities.Tiny))
                {
                    gameObject.transform.localScale *= 1.1f;
                }

                break;
            }
            extraHealth *= (float)(dif * 0.25f + 0.75f);
            if (dif > 3)
            {
                extraHealth *= 2.15f;
            }
            if (dif > 6)
            {
                extraHealth *= 3.4f;
            }
            //Applying some abilities
            if (abilities.Contains(Abilities.Huge))
            {
                Armor *= 2;
                gameObject.transform.localScale *= 2;
                extraHealth *= 2;
                DamageMult  *= 2;
                AnimSpeed   /= 1.6f;
            }
            else if (abilities.Contains(Abilities.Tiny))
            {
                gameObject.transform.localScale *= 0.35f;
                AnimSpeed  *= 1.1f;
                DamageMult *= 1.2f;
                BroadcastMessage("SetTriggerScaleForTiny", SendMessageOptions.DontRequireReceiver);
            }
            if (abilities.Contains(Abilities.Steadfast))
            {
                Steadfast = 5;
            }
            if (abilities.Contains(Abilities.EliteSteadfast))
            {
                Steadfast = 2f;
            }
            if (abilities.Contains(Abilities.BossSteadfast))
            {
                Steadfast = 0.25f;
            }
            if (abilities.Contains(Abilities.ExtraHealth))
            {
                extraHealth *= 3;
            }
            if (abilities.Contains(Abilities.ExtraDamage))
            {
                DamageMult *= 4f;
            }
            if (abilities.Contains(Abilities.RainEmpowerement))
            {
                prerainDmg   = DamageMult;
                prerainArmor = Armor;
            }
            if (abilities.Contains(Abilities.Juggernaut))
            {
                CCimmune   = true;
                AnimSpeed /= 1.15f;
            }
            if (abilities.Contains(Abilities.Avenger))
            {
                if (avengerability == null)
                {
                    avengerability = gameObject.AddComponent <Avenger>();
                }
                avengerability.progression = this;
                avengerability.Stacks      = 0;
            }
            else if (avengerability != null)
            {
                Destroy(avengerability);
            }
            if (abilities.Contains(Abilities.FireAura))
            {
                float aurDmg = (5 * Level + 1) * ((int)ModSettings.difficulty + 1.3f);
                FireAura.Cast(gameObject, aurDmg);
                if (BoltNetwork.isRunning)
                {
                    using (System.IO.MemoryStream answerStream = new System.IO.MemoryStream())
                    {
                        using (System.IO.BinaryWriter w = new System.IO.BinaryWriter(answerStream))
                        {
                            w.Write(8);
                            w.Write(2);
                            w.Write(entity.networkId.PackedValue);
                            w.Write(aurDmg);
                        }
                        ChampionsOfForest.Network.NetworkManager.SendLine(answerStream.ToArray(), ChampionsOfForest.Network.NetworkManager.Target.Clients);
                        answerStream.Close();
                    }
                }

                InvokeRepeating("SendFireAura", 20, 30);
            }
            else
            {
                var aura = gameObject.GetComponent <FireAura>();
                if (aura != null)
                {
                    Destroy(aura);
                }
            }
            //Clamping Health
            try
            {
                maxHealth = extraHealth;
                HealthScript.maxHealthFloat = extraHealth;
                Armor = Mathf.Min(Armor, int.MaxValue - 5);
                if (Armor < 0)
                {
                    Armor = int.MaxValue;
                }
                //Setting other health variables
                HealthScript.maxHealth = Mathf.RoundToInt(Mathf.Min(extraHealth, int.MaxValue - 5));
                HealthScript.Health    = Mathf.RoundToInt(Mathf.Min(extraHealth, int.MaxValue - 5));
                extraHealth           -= HealthScript.Health;
                DebuffDmgMult          = DamageMult;
                DualLifeSpend          = false;
                setupComplete          = true;
                OnDieCalled            = false;
                BaseDamageMult         = DamageMult;
                BaseAnimSpeed          = AnimSpeed;
            }
            catch (Exception e)
            {
                ModAPI.Log.Write(e.ToString());
                CotfUtils.Log(e.Message);
            }

            AssignBounty();

            SteadfastCap = Mathf.Max(Steadfast * 0.01f * maxHealth, 1f);
            if (SteadfastCap < 1)             // Making sure the enemy can be killed
            {
                SteadfastCap = 1;
            }

            CreationTime = Time.time;

            if (BoltNetwork.isRunning)
            {
                ulong id = entity.networkId.PackedValue;
                using (System.IO.MemoryStream answerStream = new System.IO.MemoryStream())
                {
                    using (System.IO.BinaryWriter w = new System.IO.BinaryWriter(answerStream))
                    {
                        w.Write(30);
                        w.Write(id);
                        w.Write(BaseDamageMult);
                        foreach (Abilities ability in abilities)
                        {
                            w.Write((int)ability);
                        }
                        w.Close();
                    }
                    ChampionsOfForest.Network.NetworkManager.SendLine(answerStream.ToArray(), ChampionsOfForest.Network.NetworkManager.Target.Clients);
                    answerStream.Close();
                }
            }
        }
Example #2
0
        private void Setup()
        {
            try
            {
                if (BoltNetwork.isRunning)
                {
                    if (entity == null)
                    {
                        entity = transform.root.GetComponentInChildren <BoltEntity>();
                    }
                    if (entity == null)
                    {
                        entity = _Health.entity;
                    }
                    if (entity == null)
                    {
                        entity = transform.root.GetComponent <BoltEntity>();
                    }
                    EnemyManager.AddHostEnemy(this);
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }

            //Assiging base health, if new enemy
            if (BaseHealth == 0)
            {
                BaseHealth = _Health.Health;
            }
            else    //reverting health to base health if reused enemy (in case enemies are pooled)
            {
                _Health.Health = BaseHealth;
            }


            RollName();

            Steadfast         = 1000;
            slows             = new Dictionary <int, EnemyDebuff>();
            dmgTakenDebuffs   = new Dictionary <int, EnemyDebuff>();
            dmgDealtDebuffs   = new Dictionary <int, EnemyDebuff>();
            FireDamageDebuffs = new Dictionary <int, EnemyDebuff>();
            abilities         = new List <Abilities>();

            //picking abilities
            if (UnityEngine.Random.value < 0.1 || (_AI.creepy_boss && !_AI.girlFullyTransformed))
            {
                int count = UnityEngine.Random.Range(2, 7);
                if (_AI.creepy_boss)
                {
                    count = 10;
                }                                      //Megan boss always has abilities, a lot of them.
                else if (EnemyName == "Farket")
                {
                    count = 11;
                }

                int   i   = 0;
                Array arr = Enum.GetValues(typeof(Abilities));

                //Determining if enemy is Elite, Miniboss or Boss type of enemy
                if (count > 6 && Random.value < 0.3f)
                {
                    type = EnemyType.Boss; abilities.Add(Abilities.BossSteadfast);
                }
                else if (count > 4 && Random.value < 0.3f)
                {
                    abilities.Add(Abilities.EliteSteadfast); type = EnemyType.Miniboss;
                }
                else
                {
                    type = EnemyType.Elite;
                }

                if (_AI.creepy_boss)    //Force adding BossSteadfast to Megan
                {
                    abilities.Clear();
                    type = EnemyType.Boss;
                    abilities.Add(Abilities.BossSteadfast);
                }

                //Trial and error method of picking abilities
                while (i < count)
                {
                    bool      success = true;
                    Abilities ab      = (Abilities)arr.GetValue(UnityEngine.Random.Range(0, arr.Length));
                    if (ab == Abilities.Steadfast || ab == Abilities.EliteSteadfast || ab == Abilities.BossSteadfast)
                    {
                        if (abilities.Contains(Abilities.Steadfast) || abilities.Contains(Abilities.EliteSteadfast) || abilities.Contains(Abilities.BossSteadfast))
                        {
                            success = false;
                        }
                    }
                    else if (ab == Abilities.Tiny || ab == Abilities.Huge)
                    {
                        if (_AI.creepy_boss && ab == Abilities.Tiny)
                        {
                            success = false;
                        }
                        else if (abilities.Contains(Abilities.Huge) || abilities.Contains(Abilities.Tiny))
                        {
                            success = false;
                        }
                    }
                    else if (ab == Abilities.DoubleLife && !(_AI.creepy || _AI.creepy_fat))
                    {
                        success = false;
                    }
                    if (abilities.Contains(ab))
                    {
                        success = false;
                    }
                    if (success)
                    {
                        i++; abilities.Add(ab);
                    }
                }
            }
            else
            {
                type = EnemyType.Normal;
            }


            AssignEnemyType();

            //Assigning level
            AssignLevel();

            //Assigning rest of stats
            DamageMult     = Level / 4.5f + 0.55f;
            Armor          = Mathf.FloorToInt(Random.Range(Level * Level * 0.5f, Level * Level * 1.1f));
            ArmorReduction = 0;
            Health         = Mathf.RoundToInt((_Health.Health * Mathf.Pow(Level, 1.35f) / 2));
            AnimSpeed      = 1f + (float)Level / 125;


            if (EnemyName == "Farket")
            {
                AnimSpeed  *= 2;
                Armor      *= 2;
                Health     *= 2;
                DamageMult *= 2;
            }
            //Extra health for boss type enemies
            switch (type)
            {
            case EnemyType.Elite:
                Health *= 2;

                break;

            case EnemyType.Miniboss:
                Health *= 5;

                break;

            case EnemyType.Boss:
                Health *= 10;
                break;
            }

            //Applying some abilities
            if (abilities.Contains(Abilities.Huge))
            {
                Armor *= 2;
                gameObject.transform.localScale *= 2;
                Health     *= 2;
                DamageMult *= 2;
            }
            else if (abilities.Contains(Abilities.Tiny))
            {
                gameObject.transform.localScale *= 0.35f;
                Health     *= 2;
                DamageMult *= 1.5f;
                BroadcastMessage("SetTriggerScaleForTiny", SendMessageOptions.DontRequireReceiver);
            }
            if (abilities.Contains(Abilities.Steadfast))
            {
                Steadfast = 8;
            }
            if (abilities.Contains(Abilities.EliteSteadfast))
            {
                Steadfast = 2f;
            }
            if (abilities.Contains(Abilities.BossSteadfast))
            {
                Steadfast = 1;
            }
            if (abilities.Contains(Abilities.ExtraHealth))
            {
                Health *= 3;
            }
            if (abilities.Contains(Abilities.ExtraDamage))
            {
                DamageMult *= 2.5f;
            }
            if (abilities.Contains(Abilities.RainEmpowerement))
            {
                prerainDmg   = DamageMult;
                prerainArmor = Armor;
            }
            if (abilities.Contains(Abilities.Juggernaut))
            {
                CCimmune = true;
            }
            if (abilities.Contains(Abilities.FireAura))
            {
                float aurDmg = (3 * Level + 20f) * DamageAmp / 2;
                FireAura.Cast(gameObject, aurDmg);
                if (BoltNetwork.isRunning)
                {
                    Network.NetworkManager.SendLine("ES2" + entity.networkId.PackedValue + ";" + aurDmg, NetworkManager.Target.Clinets);
                }
                InvokeRepeating("SendFireAura", 20, 30);
            }
            //Clamping Health
            Health = Mathf.Min(Health, int.MaxValue - 5);


            //Setting other health variables
            _Health.maxHealthFloat = Health;
            MaxHealth         = Health;
            _Health.maxHealth = Mathf.RoundToInt(Health);
            _Health.Health    = Mathf.RoundToInt(Health);
            DebuffDmgMult     = DamageMult;
            DualLifeSpend     = false;
            setupComplete     = true;
            OnDieCalled       = false;
            BaseDamageMult    = DamageMult;
            BaseAnimSpeed     = AnimSpeed;

            AssignBounty();

            SteadfastCap = Mathf.RoundToInt(Steadfast * 0.01f * MaxHealth);
            if (SteadfastCap < 1) // Making sure the enemy can be killed
            {
                SteadfastCap = 1;
            }

            CreationTime = Time.time;

            if (BoltNetwork.isRunning)
            {
                ulong id = entity.networkId.PackedValue;

                string aa = "AI" + id + ";" + BaseDamageMult + ";";
                foreach (var ability in abilities)
                {
                    aa += (int)ability + ";";
                }
                NetworkManager.SendLine(aa, NetworkManager.Target.Clinets);
            }
        }
Example #3
0
        private void Setup()
        {
            try
            {
                if (BoltNetwork.isRunning)
                {
                    if (entity == null)
                    {
                        entity = transform.root.GetComponentInChildren <BoltEntity>();
                    }
                    if (entity == null)
                    {
                        entity = HealthScript.entity;
                    }
                    if (entity == null)
                    {
                        entity = transform.root.GetComponent <BoltEntity>();
                    }
                    EnemyManager.AddHostEnemy(this);
                }
                if (!EnemyManager.enemyByTransform.ContainsKey(transform))
                {
                    EnemyManager.enemyByTransform.Add(this.transform, this);
                }
            }
            catch (Exception ex)
            {
                ModAPI.Log.Write(ex.ToString());
            }

            //Assiging base health, if new enemy
            if (baseHealth == 0)
            {
                baseHealth = HealthScript.Health;
            }
            else                //reverting health to base health if reused enemy (in case enemies are pooled)
            {
                HealthScript.Health = baseHealth;
            }

            StopAllCoroutines();

            Steadfast          = 100;
            slows              = new Dictionary <int, EnemyDebuff>();
            dmgTakenDebuffs    = new Dictionary <int, EnemyDebuff>();
            dmgDealtDebuffs    = new Dictionary <int, EnemyDebuff>();
            FireDamageDebuffs  = new Dictionary <int, EnemyDebuff>();
            DamageOverTimeList = new List <DoT>();
            abilities          = new List <Abilities>();

            bool isElite = (Random.value < 0.1 || (AIScript.creepy_boss && !AIScript.girlFullyTransformed) || ModSettings.difficulty == ModSettings.Difficulty.Hell) && ModSettings.AllowElites;

            SetType(ref isElite);


            //picking abilities
            if (isElite)
            {
                int abilityAmount = (int)ModSettings.difficulty > (int)ModSettings.Difficulty.Veteran ? Random.Range(3, 7) : 2;
                if (AIScript.creepy_boss)
                {
                    abilityAmount = 10;
                }                   //Megan boss always has abilities, a lot of them.

                int   i            = 0;
                Array abilityArray = Enum.GetValues(typeof(Abilities));

                //Determining if enemy is Elite, Miniboss or Boss type of enemy
                if (abilityAmount > 6 && Random.value < 0.1f)
                {
                    _rarity = EnemyRarity.Boss;
                    abilities.Add(Abilities.BossSteadfast);
                }
                else if (abilityAmount > 4 && Random.value < 0.25f)
                {
                    abilities.Add(Abilities.EliteSteadfast);
                    _rarity = EnemyRarity.Miniboss;
                }
                else
                {
                    _rarity = EnemyRarity.Elite;
                }

                if (AIScript.creepy_boss && !AIScript.girlFullyTransformed)                    //Force adding BossSteadfast to Megan
                {
                    abilities.Clear();
                    _rarity = EnemyRarity.Boss;
                    abilities.Add(Abilities.BossSteadfast);
                }

                //Trial and error method of picking abilities
                while (i < abilityAmount)
                {
                    bool      canAdd = true;
                    Abilities ab     = (Abilities)abilityArray.GetValue(Random.Range(0, abilityArray.Length));
                    if (ab == Abilities.Steadfast || ab == Abilities.EliteSteadfast || ab == Abilities.BossSteadfast)
                    {
                        if (abilities.Contains(Abilities.Steadfast) || abilities.Contains(Abilities.EliteSteadfast) || abilities.Contains(Abilities.BossSteadfast))
                        {
                            canAdd = false;
                        }
                    }
                    else if (ab == Abilities.Tiny || ab == Abilities.Gargantuan)
                    {
                        if (AIScript.creepy_boss && ab == Abilities.Tiny)
                        {
                            canAdd = false;
                        }
                        else if (abilities.Contains(Abilities.Gargantuan) || abilities.Contains(Abilities.Tiny))
                        {
                            canAdd = false;
                        }
                    }
                    else if (ab == Abilities.Undead && !(AIScript.creepy || AIScript.creepy_fat))
                    {
                        canAdd = false;
                    }
                    else if (ab == Abilities.ArcaneCataclysm || ab == Abilities.BlackHole || ab == Abilities.FireCataclysm || ab == Abilities.Meteor)
                    {
                        if ((int)ModSettings.difficulty < (int)ModSettings.Difficulty.Master)
                        {
                            canAdd = false;
                        }
                    }
                    if (abilities.Contains(ab))
                    {
                        canAdd = false;
                    }
                    if (canAdd)
                    {
                        i++;
                        abilities.Add(ab);
                    }
                }
            }
            else
            {
                _rarity = EnemyRarity.Normal;
            }

            SetLevel();
            RollName(isElite);
            setupDifficulty = ModSettings.difficulty;
            //Assigning rest of stats
            int dif = (int)setupDifficulty;

            DamageMult     = level < 67 ? ((31f - 0.286f * (level - 20f)) * (level - 5f) + 3.5f) * (level - 1f) + 11 : Mathf.Pow(level - 60, 2.61f) * 600;
            armor          = Mathf.FloorToInt(Random.Range(Mathf.Pow(level, 2.4f) * 0.36f + 1, Mathf.Pow(level, 2.45f) + 20) * ModSettings.EnemyArmorMultiplier);
            armor         *= dif / 2 + 1;
            armorReduction = 0;
            extraHealth    = (Mathf.Sqrt(HealthScript.Health) + 40) * Mathf.Pow(level, 2.22f) / 6f;
            extraHealth   *= (level / 50) + 0.4f;

            AnimSpeed           = 0.93f + (float)level / 175;
            HealthScript.Health = int.MaxValue;

            extraHealth *= ModSettings.EnemyHealthMultiplier;
            DamageMult  *= ModSettings.EnemyDamageMultiplier;
            AnimSpeed   *= ModSettings.EnemySpeedMultiplier;

            if (_rarity != EnemyRarity.Normal)
            {
                armor *= 2;
            }
            //Extra health for boss type enemies
            switch (_rarity)
            {
            case EnemyRarity.Elite:
                extraHealth *= 5;

                break;

            case EnemyRarity.Miniboss:
                extraHealth *= 10;

                break;

            case EnemyRarity.Boss:
                extraHealth *= 20;
                if (!abilities.Contains(Abilities.Tiny))
                {
                    gameObject.transform.localScale *= 1.1f;
                }

                break;
            }
            if (level > 25)
            {
                extraHealth *= 2.15f;
            }
            if (level > 50)
            {
                extraHealth *= 2f;
            }
            if (level > 100)
            {
                extraHealth *= 3.4f;
            }
            if (level > 200)
            {
                extraHealth *= 2.5f;
            }
            if (level > 300)
            {
                extraHealth *= 3.2f;
            }
            //Applying some abilities
            if (abilities.Contains(Abilities.Gargantuan))
            {
                armor       *= 3;
                extraHealth *= 2.5f;
                DamageMult  *= 2.5f;
                AnimSpeed   /= 1.5f;
                BroadcastMessage("SetTriggerScale", 2.5f, SendMessageOptions.DontRequireReceiver);
            }
            else if (abilities.Contains(Abilities.Tiny))
            {
                AnimSpeed  *= 1.1f;
                DamageMult *= 1.2f;
                BroadcastMessage("SetTriggerScale", 5f, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                BroadcastMessage("SetTriggerScale", 1.6f, SendMessageOptions.DontRequireReceiver);
            }
            if (abilities.Contains(Abilities.Steadfast))
            {
                Steadfast = 6;
                armor    *= 2;
            }
            if (abilities.Contains(Abilities.EliteSteadfast))
            {
                Steadfast = 4f;
                armor    *= 2;
            }
            if (abilities.Contains(Abilities.BossSteadfast))
            {
                Steadfast = 1f;
                armor    *= 2;
            }
            if (abilities.Contains(Abilities.ExtraHealth))
            {
                extraHealth *= 4;
            }
            if (abilities.Contains(Abilities.ExtraDamage))
            {
                DamageMult *= 5f;
            }
            if (abilities.Contains(Abilities.RainEmpowerment))
            {
                prerainDmg   = DamageMult;
                prerainArmor = armor;
            }
            if (abilities.Contains(Abilities.Juggernaut))
            {
                CCimmune   = true;
                AnimSpeed /= 1.15f;
            }
            if (abilities.Contains(Abilities.Avenger))
            {
                if (avengerability == null)
                {
                    avengerability = gameObject.AddComponent <Avenger>();
                }
                avengerability.progression = this;
                avengerability.Stacks      = 0;
            }
            else if (avengerability != null)
            {
                Destroy(avengerability);
            }
            if (abilities.Contains(Abilities.Radiance))
            {
                float aurDmg = DamageMult / 20;
                FireAura.Cast(gameObject, aurDmg);
                if (BoltNetwork.isRunning)
                {
                    using (System.IO.MemoryStream answerStream = new System.IO.MemoryStream())
                    {
                        using (System.IO.BinaryWriter w = new System.IO.BinaryWriter(answerStream))
                        {
                            w.Write(8);
                            w.Write(2);
                            w.Write(entity.networkId.PackedValue);
                            w.Write(aurDmg);
                        }
                        Network.NetworkManager.SendLine(answerStream.ToArray(), Network.NetworkManager.Target.Clients);
                        answerStream.Close();
                    }
                }

                InvokeRepeating("SendFireAura", 20, 30);
            }
            else
            {
                var aura = gameObject.GetComponent <FireAura>();
                if (aura != null)
                {
                    Destroy(aura);
                }
            }
            //Clamping Health
            try
            {
                maxHealth = extraHealth;
                HealthScript.maxHealthFloat = maxHealth;
                HealthScript.Health         = (int)Mathf.Min(maxHealth, int.MaxValue);
                extraHealth = Mathf.Max(0, maxHealth - HealthScript.Health);
                ClampHealth();
                armor = Mathf.Min(armor, int.MaxValue - 5);
                if (armor < 0)
                {
                    armor = int.MaxValue;
                }
                DebuffDmgMult  = 1;
                DualLifeSpend  = false;
                setupComplete  = true;
                OnDieCalled    = false;
                BaseDamageMult = Mathf.Abs(DamageMult);
                BaseAnimSpeed  = AnimSpeed;
                knockbackSpeed = 0;
            }
            catch (Exception e)
            {
                CotfUtils.Log(e.Message);
            }

            AssignBounty();

            steadfastCap = Mathf.Max(Steadfast * 0.01f * maxHealth, 1f);
            if (steadfastCap < 1)             // Making sure the enemy can be killed
            {
                steadfastCap = 1;
            }

            CreationTime = Time.time;

            if (BoltNetwork.isRunning)
            {
                ulong id = entity.networkId.PackedValue;
                color = normalColor;
                SyncAppearance(id);
            }
        }