Inheritance: MonoBehaviour
Esempio n. 1
0
    // Use this for initialization
    void Start()
    {
        trapInfo = GetComponent<Trap> ();
        if (transform.childCount >= 2) {

            rightRotCenter = transform.GetChild(0);
            rightShutter = rightRotCenter.transform.GetChild(0);
            leftRotCenter = transform.GetChild(1);
            leftShutter = leftRotCenter.transform.GetChild(0);
            rightShutterInitPos = rightRotCenter.rotation.eulerAngles;
            leftShutterInitPos = leftRotCenter.rotation.eulerAngles;

        }

        if (reverse)
        {
            openAngleDX = 0;
            openAngleSX = 0;
            leftShutter.GetComponent<BoxCollider2D>().enabled = false ;
            rightShutter.GetComponent<BoxCollider2D>().enabled = false;
        }
        else
        {
            openAngleDX = 70;
            openAngleSX = 290;
            leftShutter.GetComponent<BoxCollider2D>().enabled = true;
            rightShutter.GetComponent<BoxCollider2D>().enabled = true;
        }
    }
Esempio n. 2
0
 public TrapTrigger( GameWorld world, Texture2D active_texture,
   Texture2D inactive_texture, Vector2[] points, Vector2 spawn, Vector2 impulse, float boul_radius, TriggerableObject triggered_object = null,
   String t_name = "Trigger", Trap type = Trap.BOULDER )
     : base(world, active_texture,
   inactive_texture, points, type: TriggerType.FLOOR, cooldown: 4, name: t_name,
   texture_name: TNames.ground_switch_inactive)
 {
     m_trap = type;
     m_impulse = impulse;
     m_spawn = spawn;
     obj_radius = boul_radius;
 }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     initialMinTime = minSpawnTime;
     initialMaxTime= maxSpawnTime;
     trapInfo = transform.GetComponent<Trap>();
     if (arrowToSpawn == 0)
     {
         infiniteArrows = true;
     }
     audio = GetComponent<AudioSource> ();
     //Invoke("SpawnArrow",Random.Range (minSpawnTime, maxSpawnTime));
 }
Esempio n. 4
0
        public Trap Generate(int partyLevel)
        {
            var selectedTrap = SelectTrap(partyLevel);

            var trap = new Trap();
            trap.Name = selectedTrap.Type;
            trap.Descriptions = selectedTrap.Descriptions;
            trap.SearchDC = selectedTrap.Length;
            trap.DisableDeviceDC = selectedTrap.Width;
            trap.ChallengeRating = Convert.ToInt32(selectedTrap.Contents.Miscellaneous.Single());

            return trap;
        }
Esempio n. 5
0
 // Use this for initialization
 void Start()
 {
     initialMinTime = minSpawnTime;
     initialMaxTime = maxSpawnTime;
     trapInfo = transform.GetComponent<Trap> ();
     if (stonesToSpawn == 0) {
         infiniteStones = true;
     }
     /*
     if (stonesToSpawn == 0) {
         Invoke("SpawnStone", Random.Range (minSpawnTime, maxSpawnTime));
     }
     */
 }
        public static Collectible CreateCollectible(CollectibleType collectibleType, Vector2 position, Tile currentTile)
        {
            Collectible newCollectible = null;

            switch (collectibleType)
            {
                case CollectibleType.POWERUP:
                    int randomType = RandomManager.GetRandomInt(0, 1);
                    switch (randomType)
                    {
                        case 0:
                            newCollectible = new Powerup(DespicableGame.GetTexture(DespicableGame.GameTextures.SPEEDBOOST), position, currentTile, Powerup.PowerupType.SPEEDBOOST);
                            break;

                        case 1:
                            if (RandomManager.GetRandomTrueFalse(75))
                            {
                                newCollectible = new Powerup(DespicableGame.GetTexture(DespicableGame.GameTextures.TOY_PISTOL), position, currentTile, Powerup.PowerupType.TOY_PISTOL);
                            }
                            else
                            {
                                newCollectible = new Powerup(DespicableGame.GetTexture(DespicableGame.GameTextures.PLAYERTRAP_COLLECTIBLE), position, currentTile, Powerup.PowerupType.PLAYERTRAP);
                            }

                            break;

                    }
                    break;

                case CollectibleType.GOAL:
                    newCollectible = new Goal(DespicableGame.GetTexture(DespicableGame.GameTextures.GOAL), position, currentTile);
                    break;

                case CollectibleType.TRAP:
                    newCollectible =  new Trap(DespicableGame.GetTexture(DespicableGame.GameTextures.TRAP), position, currentTile);
                    break;

                case CollectibleType.SHIP:
                    newCollectible = new Ship(DespicableGame.GetTexture(DespicableGame.GameTextures.LEVEL_EXIT), position, currentTile);
                    break;

                case CollectibleType.BANANA:
                    newCollectible = new Banana(DespicableGame.GetTexture(DespicableGame.GameTextures.BANANA), position, currentTile);
                    break;
            }

            return newCollectible;
        }
 private bool TrapsEqual(Trap fromDDI, Trap fromMP)
 {
     Assert.IsNotNull(fromMP, fromDDI.Name + " not found in " + Libraries.Count + " test libraries");
     Assert.AreEqual(fromMP.Name, fromDDI.Name);
     Assert.AreEqual(fromMP.Type, fromDDI.Type);
     AreEqual(fromMP.Role, fromDDI.Role);
     Assert.AreEqual(fromMP.Level,fromDDI.Level);
     Assert.AreEqual(fromMP.Details, fromDDI.Details, "Different details");
     Assert.AreEqual(fromMP.ReadAloud,fromDDI.ReadAloud);
     foreach (var tsdMP in fromMP.Skills)
     {
         TrapSkillData tsdDDi =
             fromDDI.Skills.SingleOrDefault(x => x.DC == tsdMP.DC && x.SkillName == tsdMP.SkillName);
         Assert.IsNotNull(tsdDDi,tsdMP.ToString() + " not found");
         Assert.AreEqual(tsdMP.Details,tsdDDi.Details);
         Assert.AreEqual(tsdMP.ToString(),tsdDDi.ToString());
     }
     AreEqual(fromMP.Attack,fromDDI.Attack, fromDDI.Name);
     CollectionAssert.AreEqual(fromMP.Countermeasures,fromDDI.Countermeasures);
     return true;
 }
        public StandardEnvironment(Trap trap)
            : base(null, trap)
        {
            AddFn(Symbol.get_symbol("eqv?"), fn_eqv_pred);
            AddFn(Symbol.get_symbol("eq?"), fn_eq_pred);
            AddFn(Symbol.get_symbol("equal?"), fn_equal_pred);
            AddFn(Symbol.get_symbol("="), fn_eq);
            AddFn(Symbol.get_symbol("+"), fn_add);
            AddFn(Symbol.get_symbol("-"), fn_sub);
            AddFn(Symbol.get_symbol("*"), fn_mul);
            AddFn(Symbol.get_symbol("/"), fn_div);
            AddFn(Symbol.get_symbol("boolean?"), fn_boolean_pred);
            AddFn(Symbol.get_symbol("char?"), fn_char_pred);
            AddFn(Symbol.get_symbol("complex?"), fn_complex_pred);
            AddFn(Symbol.get_symbol("number?"), fn_number_pred);
            AddFn(Symbol.get_symbol("rational?"), fn_rational_pred);
            AddFn(Symbol.get_symbol("null?"), fn_null_pred);
            AddFn(Symbol.get_symbol("pair?"), fn_pair_pred);
            AddFn(Symbol.get_symbol("list?"), fn_list_pred);
            AddFn(Symbol.get_symbol("procedure?"), fn_procedure_pred);
            AddFn(Symbol.get_symbol("string?"), fn_string_pred);
            AddFn(Symbol.get_symbol("symbol?"), fn_symbol_pred);
            AddFn(Symbol.get_symbol("vector?"), fn_vector_pred);
            AddFn(Symbol.get_symbol("real?"), fn_real_pred);
            AddFn(Symbol.get_symbol("integer?"), fn_integer_pred);
            AddFn(Symbol.get_symbol("inexact?"), fn_inexact_pred);
            AddFn(Symbol.get_symbol("exact?"), fn_exact_pred);
            AddFn(Symbol.get_symbol("zero?"), fn_zero_pred);
            AddFn(Symbol.get_symbol("list"), fn_list);
            AddFn(Symbol.get_symbol("cons"), fn_cons);
            AddFn(Symbol.get_symbol("car"), fn_car);
            AddFn(Symbol.get_symbol("cdr"), fn_cdr);
            AddFn(Symbol.get_symbol("make-vector"), fn_make_vector);
            AddFn(Symbol.get_symbol("vector"), fn_vector);
            AddFn(Symbol.get_symbol("imag-part"), fn_imag_part);
            AddFn(Symbol.get_symbol("round"), fn_round);

            AddMacro(Symbol.get_symbol("quote"), m_quote);
        }
 public void ReportTrap(Trap selectedTrap)
 {
     if (selectedTrap is CannonTrap)
     {
         hasUsedCannons = true;
     }
     else if (selectedTrap is DartTrap || selectedTrap is SpikeTrap)
     {
         hasUsedSpikesOrPoison = true;
     }
 }
Esempio n. 10
0
 void test(Trap t)
 {
     Debug.Log(t.State.cardName + "is a trap");
 }
        public bool Activate(RealmTime time, Item item, UseItemPacket pkt)
        {
            bool endMethod = false;
            Position target = pkt.ItemUsePos;
            Mp -= item.MpCost;

            IContainer con = Owner.GetEntity(pkt.SlotObject.ObjectId) as IContainer;
            if (con == null) return true;

            if (pkt.SlotObject.SlotId != 255 && pkt.SlotObject.SlotId != 254 && con.Inventory[pkt.SlotObject.SlotId] != item)
            {
                Entity.logger.FatalFormat("Cheat engine detected for player {0},\nItem should be {1}, but its {2}.",
                    Name, Inventory[pkt.SlotObject.SlotId].ObjectId, item.ObjectId);
                foreach (Player player in Owner.Players.Values)
                    if (player.Client.Account.Rank >= 2)
                        player.SendInfo(String.Format("Cheat engine detected for player {0},\nItem should be {1}, but its {2}.",
                    Name, Inventory[pkt.SlotObject.SlotId].ObjectId, item.ObjectId));
                Client.Disconnect();
                return true;
            }

            if (item.IsBackpack)
            {
                if (HasBackpack) return true;
                Client.Character.Backpack = new[] { -1, -1, -1, -1, -1, -1, -1, -1 };
                HasBackpack = true;
                Client.Character.HasBackpack = 1;
                Manager.Database.DoActionAsync(db =>
                    db.SaveBackpacks(Client.Character, Client.Account));
                Array.Resize(ref inventory, 20);
                int[] slotTypes =
                    Utils.FromCommaSepString32(
                        Manager.GameData.ObjectTypeToElement[ObjectType].Element("SlotTypes").Value);
                Array.Resize(ref slotTypes, 20);
                for (int i = 0; i < slotTypes.Length; i++)
                    if (slotTypes[i] == 0) slotTypes[i] = 10;
                SlotTypes = slotTypes;
                return false;
            }
            if (item.XpBooster)
            {
                if (!XpBoosted)
                {
                    XpBoostTimeLeft = (float)item.Timer;
                    XpBoosted = item.XpBooster;
                    xpFreeTimer = (float)item.Timer == -1.0 ? false : true;
                    return false;
                }
                else
                {
                    SendInfo("You have already an active XP Booster.");
                    return true;
                }
            }

            if (item.LootDropBooster)
            {
                if (!LootDropBoost)
                {
                    LootDropBoostTimeLeft = (float)item.Timer;
                    lootDropBoostFreeTimer = (float)item.Timer == -1.0 ? false : true;
                    return false;
                }
                else
                {
                    SendInfo("You have already an active Loot Drop Booster.");
                    return true;
                }
            }

            if (item.LootTierBooster)
            {
                if (!LootTierBoost)
                {
                    LootTierBoostTimeLeft = (float)item.Timer;
                    lootTierBoostFreeTimer = (float)item.Timer == -1.0 ? false : true;
                    return false;
                }
                else
                {
                    SendInfo("You have already an active Loot Tier Booster.");
                    return true;
                }
            }

            foreach (ActivateEffect eff in item.ActivateEffects)
            {
                switch (eff.Effect)
                {
                    case ActivateEffects.BulletNova:
                        {
                            ProjectileDesc prjDesc = item.Projectiles[0]; //Assume only one
                            Packet[] batch = new Packet[21];
                            uint s = Random.CurrentSeed;
                            Random.CurrentSeed = (uint)(s * time.tickTimes);
                            for (int i = 0; i < 20; i++)
                            {
                                Projectile proj = CreateProjectile(prjDesc, item.ObjectType,
                                    (int)StatsManager.GetAttackDamage(prjDesc.MinDamage, prjDesc.MaxDamage),
                                    time.tickTimes, target, (float)(i * (Math.PI * 2) / 20));
                                Owner.EnterWorld(proj);
                                FameCounter.Shoot(proj);
                                batch[i] = new Shoot2Packet()
                                {
                                    BulletId = proj.ProjectileId,
                                    OwnerId = Id,
                                    ContainerType = item.ObjectType,
                                    StartingPos = target,
                                    Angle = proj.Angle,
                                    Damage = (short)proj.Damage
                                };
                            }
                            Random.CurrentSeed = s;
                            batch[20] = new ShowEffectPacket()
                            {
                                EffectType = EffectType.Trail,
                                PosA = target,
                                TargetId = Id,
                                Color = new ARGB(0xFFFF00AA)
                            };
                            BroadcastSync(batch, p => this.Dist(p) < 35);
                        }
                        break;

                    case ActivateEffects.Shoot:
                        {
                            ActivateShoot(time, item, target);
                        }
                        break;

                    case ActivateEffects.StatBoostSelf:
                        {
                            int idx = -1;

                            if (eff.Stats == StatsType.MaximumHP) idx = 0;
                            else if (eff.Stats == StatsType.MaximumMP) idx = 1;
                            else if (eff.Stats == StatsType.Attack) idx = 2;
                            else if (eff.Stats == StatsType.Defense) idx = 3;
                            else if (eff.Stats == StatsType.Speed) idx = 4;
                            else if (eff.Stats == StatsType.Vitality) idx = 5;
                            else if (eff.Stats == StatsType.Wisdom) idx = 6;
                            else if (eff.Stats == StatsType.Dexterity) idx = 7;

                            List<Packet> pkts = new List<Packet>();

                            ActivateBoostStat(this, idx, pkts);
                            int OGstat = oldstat;
                            int bit = idx + 39;

                            int s = eff.Amount;
                            Boost[idx] += s;
                            ApplyConditionEffect(new ConditionEffect
                            {
                                DurationMS = eff.DurationMS,
                                Effect = (ConditionEffectIndex)bit
                            });
                            UpdateCount++;
                            Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                            {
                                Boost[idx] = OGstat;
                                UpdateCount++;
                            }));
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.Potion,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff)
                            }, null);
                        }
                        break;

                    case ActivateEffects.StatBoostAura:
                        {
                            int idx = -1;

                            if (eff.Stats == StatsType.MaximumHP) idx = 0;
                            if (eff.Stats == StatsType.MaximumMP) idx = 1;
                            if (eff.Stats == StatsType.Attack) idx = 2;
                            if (eff.Stats == StatsType.Defense) idx = 3;
                            if (eff.Stats == StatsType.Speed) idx = 4;
                            if (eff.Stats == StatsType.Vitality) idx = 5;
                            if (eff.Stats == StatsType.Wisdom) idx = 6;
                            if (eff.Stats == StatsType.Dexterity) idx = 7;

                            int bit = idx + 39;

                            var amountSBA = eff.Amount;
                            var durationSBA = eff.DurationMS;
                            var rangeSBA = eff.Range;
                            if (eff.UseWisMod)
                            {
                                amountSBA = (int)UseWisMod(eff.Amount, 0);
                                durationSBA = (int)(UseWisMod(eff.DurationSec) * 1000);
                                rangeSBA = UseWisMod(eff.Range);
                            }

                            this.Aoe(rangeSBA, true, player =>
                            {
                                // TODO support for noStack StatBoostAura attribute (paladin total
                                // hp increase / insta heal)
                                ApplyConditionEffect(new ConditionEffect
                                {
                                    DurationMS = durationSBA,
                                    Effect = (ConditionEffectIndex)bit
                                });
                                (player as Player).Boost[idx] += amountSBA;
                                player.UpdateCount++;
                                Owner.Timers.Add(new WorldTimer(durationSBA, (world, t) =>
                                {
                                    (player as Player).Boost[idx] -= amountSBA;
                                    player.UpdateCount++;
                                }));
                            });
                            BroadcastSync(new ShowEffectPacket()
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position() { X = rangeSBA }
                            }, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.ConditionEffectSelf:
                        {
                            var durationCES = eff.DurationMS;
                            if (eff.UseWisMod)
                                durationCES = (int)(UseWisMod(eff.DurationSec) * 1000);

                            var color = 0xffffffff;
                            switch (eff.ConditionEffect.Value)
                            {
                                case ConditionEffectIndex.Damaging:
                                    color = 0xffff0000;
                                    break;

                                case ConditionEffectIndex.Berserk:
                                    color = 0x808080;
                                    break;
                            }

                            ApplyConditionEffect(new ConditionEffect
                            {
                                Effect = eff.ConditionEffect.Value,
                                DurationMS = durationCES
                            });
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(color),
                                PosA = new Position { X = 2 }
                            }, null);
                        }
                        break;

                    case ActivateEffects.ConditionEffectAura:
                        {
                            var durationCEA = eff.DurationMS;
                            var rangeCEA = eff.Range;
                            if (eff.UseWisMod)
                            {
                                durationCEA = (int)(UseWisMod(eff.DurationSec) * 1000);
                                rangeCEA = UseWisMod(eff.Range);
                            }

                            this.Aoe(rangeCEA, true, player =>
                            {
                                player.ApplyConditionEffect(new ConditionEffect
                                {
                                    Effect = eff.ConditionEffect.Value,
                                    DurationMS = durationCEA
                                });
                            });

                            var color = 0xffffffff;
                            switch (eff.ConditionEffect.Value)
                            {
                                case ConditionEffectIndex.Damaging:
                                    color = 0xffff0000;
                                    break;

                                case ConditionEffectIndex.Berserk:
                                    color = 0x808080;
                                    break;
                            }

                            BroadcastSync(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(color),
                                PosA = new Position { X = rangeCEA }
                            }, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.Heal:
                        {
                            List<Packet> pkts = new List<Packet>();
                            ActivateHealHp(this, eff.Amount, pkts);
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;

                    case ActivateEffects.HealNova:
                        {
                            var amountHN = eff.Amount;
                            var rangeHN = eff.Range;
                            if (eff.UseWisMod)
                            {
                                amountHN = (int)UseWisMod(eff.Amount, 0);
                                rangeHN = UseWisMod(eff.Range);
                            }

                            List<Packet> pkts = new List<Packet>();
                            this.Aoe(rangeHN, true, player => { ActivateHealHp(player as Player, amountHN, pkts); });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = rangeHN }
                            });
                            BroadcastSync(pkts, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.Magic:
                        {
                            List<Packet> pkts = new List<Packet>();
                            ActivateHealMp(this, eff.Amount, pkts);
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;

                    case ActivateEffects.MagicNova:
                        {
                            List<Packet> pkts = new List<Packet>();
                            this.Aoe(eff.Range / 2, true, player => { ActivateHealMp(player as Player, eff.Amount, pkts); });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range }
                            });
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;

                    case ActivateEffects.Teleport:
                        {
                            Move(target.X, target.Y);
                            UpdateCount++;
                            Owner.BroadcastPackets(new Packet[]
                            {
                            new GotoPacket
                            {
                                ObjectId = Id,
                                Position = new Position
                                {
                                    X = X,
                                    Y = Y
                                }
                            },
                            new ShowEffectPacket
                            {
                                EffectType = EffectType.Teleport,
                                TargetId = Id,
                                PosA = new Position
                                {
                                    X = X,
                                    Y = Y
                                },
                                Color = new ARGB(0xFFFFFFFF)
                            }
                            }, null);
                        }
                        break;

                    case ActivateEffects.VampireBlast:
                        {
                            List<Packet> pkts = new List<Packet>();
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Trail,
                                TargetId = Id,
                                PosA = target,
                                Color = new ARGB(0xFFFF0000)
                            });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Diffuse,
                                Color = new ARGB(0xFFFF0000),
                                TargetId = Id,
                                PosA = target,
                                PosB = new Position { X = target.X + eff.Radius, Y = target.Y }
                            });

                            int totalDmg = 0;
                            List<Enemy> enemies = new List<Enemy>();
                            Owner.Aoe(target, eff.Radius, false, enemy =>
                            {
                                enemies.Add(enemy as Enemy);
                                totalDmg += (enemy as Enemy).Damage(this, time, eff.TotalDamage, false);
                            });
                            List<Player> players = new List<Player>();
                            this.Aoe(eff.Radius, true, player =>
                            {
                                players.Add(player as Player);
                                ActivateHealHp(player as Player, totalDmg, pkts);
                            });

                            if (enemies.Count > 0)
                            {
                                Random rand = new Random();
                                for (int i = 0; i < 5; i++)
                                {
                                    Enemy a = enemies[rand.Next(0, enemies.Count)];
                                    Player b = players[rand.Next(0, players.Count)];
                                    pkts.Add(new ShowEffectPacket
                                    {
                                        EffectType = EffectType.Flow,
                                        TargetId = b.Id,
                                        PosA = new Position { X = a.X, Y = a.Y },
                                        Color = new ARGB(0xffffffff)
                                    });
                                }
                            }

                            BroadcastSync(pkts, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.Trap:
                        {
                            BroadcastSync(new ShowEffectPacket
                            {
                                EffectType = EffectType.Throw,
                                Color = new ARGB(0xff9000ff),
                                TargetId = Id,
                                PosA = target
                            }, p => this.Dist(p) < 25);
                            Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                            {
                                Trap trap = new Trap(
                                    this,
                                    eff.Radius,
                                    eff.TotalDamage,
                                    eff.ConditionEffect ?? ConditionEffectIndex.Slowed,
                                    eff.EffectDuration);
                                trap.Move(target.X, target.Y);
                                world.EnterWorld(trap);
                            }));
                        }
                        break;

                    case ActivateEffects.StasisBlast:
                        {
                            List<Packet> pkts = new List<Packet>();

                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Concentrate,
                                TargetId = Id,
                                PosA = target,
                                PosB = new Position { X = target.X + 3, Y = target.Y },
                                Color = new ARGB(0xFF00D0)
                            });
                            Owner.Aoe(target, 3, false, enemy =>
                            {
                                if (IsSpecial(enemy.ObjectType)) return;
                                if (enemy.HasConditionEffect(ConditionEffectIndex.StasisImmune))
                                {
                                    if (!enemy.HasConditionEffect(ConditionEffectIndex.Invincible))
                                    {
                                        pkts.Add(new NotificationPacket
                                        {
                                            ObjectId = enemy.Id,
                                            Color = new ARGB(0xff00ff00),
                                            Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"Immune\"}}"
                                        });
                                    }
                                }
                                else if (!enemy.HasConditionEffect(ConditionEffectIndex.Stasis))
                                {
                                    enemy.ApplyConditionEffect(new ConditionEffect
                                    {
                                        Effect = ConditionEffectIndex.Stasis,
                                        DurationMS = eff.DurationMS
                                    });
                                    Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                                    {
                                        enemy.ApplyConditionEffect(new ConditionEffect
                                        {
                                            Effect = ConditionEffectIndex.StasisImmune,
                                            DurationMS = 3000
                                        });
                                    }));
                                    pkts.Add(new NotificationPacket
                                    {
                                        ObjectId = enemy.Id,
                                        Color = new ARGB(0xffff0000),
                                        Text = "{\"key\":\"blank\",\"tokens\":{\"data\":\"Stasis\"}}"
                                    });
                                }
                            });
                            BroadcastSync(pkts, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.Decoy:
                        {
                            Decoy decoy = new Decoy(Manager, this, eff.DurationMS, StatsManager.GetSpeed());
                            decoy.Move(X, Y);
                            Owner.EnterWorld(decoy);
                        }
                        break;

                    case ActivateEffects.Lightning:
                        {
                            Enemy start = null;
                            double angle = Math.Atan2(target.Y - Y, target.X - X);
                            double diff = Math.PI / 3;
                            Owner.Aoe(target, 6, false, enemy =>
                            {
                                if (!(enemy is Enemy)) return;
                                double x = Math.Atan2(enemy.Y - Y, enemy.X - X);
                                if (Math.Abs(angle - x) < diff)
                                {
                                    start = enemy as Enemy;
                                    diff = Math.Abs(angle - x);
                                }
                            });
                            if (start == null)
                                break;

                            Enemy current = start;
                            Enemy[] targets = new Enemy[eff.MaxTargets];
                            for (int i = 0; i < targets.Length; i++)
                            {
                                targets[i] = current;
                                Enemy next = current.GetNearestEntity(8, false,
                                    enemy =>
                                        enemy is Enemy &&
                                        Array.IndexOf(targets, enemy) == -1 &&
                                        this.Dist(enemy) <= 6) as Enemy;

                                if (next == null) break;
                                current = next;
                            }

                            List<Packet> pkts = new List<Packet>();
                            for (int i = 0; i < targets.Length; i++)
                            {
                                if (targets[i] == null) break;
                                if (targets[i].HasConditionEffect(ConditionEffectIndex.Invincible)) continue;
                                Entity prev = i == 0 ? (Entity)this : targets[i - 1];
                                targets[i].Damage(this, time, eff.TotalDamage, false);
                                if (eff.ConditionEffect != null)
                                    targets[i].ApplyConditionEffect(new ConditionEffect
                                    {
                                        Effect = eff.ConditionEffect.Value,
                                        DurationMS = (int)(eff.EffectDuration * 1000)
                                    });
                                pkts.Add(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Lightning,
                                    TargetId = prev.Id,
                                    Color = new ARGB(0xffff0088),
                                    PosA = new Position
                                    {
                                        X = targets[i].X,
                                        Y = targets[i].Y
                                    },
                                    PosB = new Position { X = 350 }
                                });
                            }
                            BroadcastSync(pkts, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.PoisonGrenade:
                        {
                            try
                            {
                                BroadcastSync(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Throw,
                                    Color = new ARGB(0xffddff00),
                                    TargetId = Id,
                                    PosA = target
                                }, p => this.Dist(p) < 25);
                                Placeholder x = new Placeholder(Manager, 1500);
                                x.Move(target.X, target.Y);
                                Owner.EnterWorld(x);
                                try
                                {
                                    Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                                    {
                                        world.BroadcastPacket(new ShowEffectPacket
                                        {
                                            EffectType = EffectType.AreaBlast,
                                            Color = new ARGB(0xffddff00),
                                            TargetId = x.Id,
                                            PosA = new Position { X = eff.Radius }
                                        }, null);
                                        world.Aoe(target, eff.Radius, false,
                                            enemy => PoisonEnemy(enemy as Enemy, eff));
                                    }));
                                }
                                catch (Exception ex)
                                {
                                    Entity.logger.ErrorFormat("Poison ShowEffect:\n{0}", ex);
                                }
                            }
                            catch (Exception ex)
                            {
                                Entity.logger.ErrorFormat("Poisons General:\n{0}", ex);
                            }
                        }
                        break;

                    case ActivateEffects.RemoveNegativeConditions:
                        {
                            this.Aoe(eff.Range / 2, true, player => { ApplyConditionEffect(NegativeEffs); });
                            BroadcastSync(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range / 2 }
                            }, p => this.Dist(p) < 25);
                        }
                        break;

                    case ActivateEffects.RemoveNegativeConditionsSelf:
                        {
                            ApplyConditionEffect(NegativeEffs);
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = 1 }
                            }, null);
                        }
                        break;

                    case ActivateEffects.IncrementStat:
                        {
                            int idx = -1;

                            if (eff.Stats == StatsType.MaximumHP) idx = 0;
                            else if (eff.Stats == StatsType.MaximumMP) idx = 1;
                            else if (eff.Stats == StatsType.Attack) idx = 2;
                            else if (eff.Stats == StatsType.Defense) idx = 3;
                            else if (eff.Stats == StatsType.Speed) idx = 4;
                            else if (eff.Stats == StatsType.Vitality) idx = 5;
                            else if (eff.Stats == StatsType.Wisdom) idx = 6;
                            else if (eff.Stats == StatsType.Dexterity) idx = 7;

                            Stats[idx] += eff.Amount;
                            int limit =
                                int.Parse(
                                    Manager.GameData.ObjectTypeToElement[ObjectType].Element(
                                        StatsManager.StatsIndexToName(idx))
                                        .Attribute("max")
                                        .Value);
                            if (Stats[idx] > limit)
                                Stats[idx] = limit;
                            UpdateCount++;
                        }
                        break;

                    case ActivateEffects.UnlockPortal:

                        Portal portal = this.GetNearestEntity(5, Manager.GameData.IdToObjectType[eff.LockedName]) as Portal;

                        Packet[] packets = new Packet[3];
                        packets[0] = new ShowEffectPacket
                        {
                            EffectType = EffectType.AreaBlast,
                            Color = new ARGB(0xFFFFFF),
                            PosA = new Position { X = 5 },
                            TargetId = Id
                        };
                        if (portal == null) break;

                        portal.Unlock(eff.DungeonName);

                        packets[1] = new NotificationPacket
                        {
                            Color = new ARGB(0x00FF00),
                            Text =
                                "{\"key\":\"blank\",\"tokens\":{\"data\":\"Unlocked by " +
                                Name + "\"}}",
                            ObjectId = Id
                        };

                        packets[2] = new TextPacket
                        {
                            BubbleTime = 0,
                            Stars = -1,
                            Name = "",
                            Text = eff.DungeonName + " Unlocked by " + Name + "."
                        };

                        BroadcastSync(packets);

                        break;

                    case ActivateEffects.Create: //this is a portal
                        {
                            ushort objType;
                            if (!Manager.GameData.IdToObjectType.TryGetValue(eff.Id, out objType) ||
                                !Manager.GameData.Portals.ContainsKey(objType))
                                break; // object not found, ignore
                            Entity entity = Resolve(Manager, objType);
                            World w = Manager.GetWorld(Owner.Id); //can't use Owner here, as it goes out of scope
                            int TimeoutTime = Manager.GameData.Portals[objType].TimeoutTime;
                            string DungName = Manager.GameData.Portals[objType].DungeonName;

                            ARGB c = new ARGB(0x00FF00);

                            entity.Move(X, Y);
                            w.EnterWorld(entity);

                            w.BroadcastPacket(new NotificationPacket
                            {
                                Color = c,
                                Text =
                                    "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + DungName + " opened by " +
                                    Client.Account.Name + "\"}}",
                                ObjectId = Client.Player.Id
                            }, null);

                            w.BroadcastPacket(new TextPacket
                            {
                                BubbleTime = 0,
                                Stars = -1,
                                Name = "",
                                Text = DungName + " opened by " + Client.Account.Name
                            }, null);
                            w.Timers.Add(new WorldTimer(TimeoutTime * 1000,
                                (world, t) => //default portal close time * 1000
                            {
                                try
                                {
                                    w.LeaveWorld(entity);
                                }
                                catch (Exception ex)
                                //couldn't remove portal, Owner became null. Should be fixed with RealmManager implementation
                                {
                                    logger.ErrorFormat("Couldn't despawn portal.\n{0}", ex);
                                }
                            }));
                        }
                        break;

                    case ActivateEffects.Dye:
                        {
                            if (item.Texture1 != 0)
                            {
                                Texture1 = item.Texture1;
                            }
                            if (item.Texture2 != 0)
                            {
                                Texture2 = item.Texture2;
                            }
                            SaveToCharacter();
                        }
                        break;

                    case ActivateEffects.ShurikenAbility:
                        {
                            if (!ninjaShoot)
                            {
                                ApplyConditionEffect(new ConditionEffect
                                {
                                    Effect = ConditionEffectIndex.Speedy,
                                    DurationMS = -1
                                });
                                ninjaFreeTimer = true;
                                ninjaShoot = true;
                            }
                            else
                            {
                                ApplyConditionEffect(new ConditionEffect
                                {
                                    Effect = ConditionEffectIndex.Speedy,
                                    DurationMS = 0
                                });
                                ushort obj;
                                Manager.GameData.IdToObjectType.TryGetValue(item.ObjectId, out obj);
                                if (Mp >= item.MpEndCost)
                                {
                                    ActivateShoot(time, item, pkt.ItemUsePos);
                                    Mp -= (int)item.MpEndCost;
                                }
                                targetlink = target;
                                ninjaShoot = false;
                            }
                        }
                        break;

                    case ActivateEffects.UnlockSkin:
                        if (!Client.Account.OwnedSkins.Contains(item.ActivateEffects[0].SkinType))
                        {
                            Manager.Database.DoActionAsync(db =>
                            {
                                Client.Account.OwnedSkins.Add(item.ActivateEffects[0].SkinType);
                                MySqlCommand cmd = db.CreateQuery();
                                cmd.CommandText = "UPDATE accounts SET ownedSkins=@ownedSkins WHERE id=@id";
                                cmd.Parameters.AddWithValue("@ownedSkins",
                                    Utils.GetCommaSepString(Client.Account.OwnedSkins.ToArray()));
                                cmd.Parameters.AddWithValue("@id", AccountId);
                                cmd.ExecuteNonQuery();
                                SendInfo(
                                    "New skin unlocked successfully. Change skins in your Vault, or start a new character to use.");
                                Client.SendPacket(new UnlockedSkinPacket
                                {
                                    SkinID = item.ActivateEffects[0].SkinType
                                });
                            });
                            endMethod = false;
                            break;
                        }
                        SendInfo("Error.alreadyOwnsSkin");
                        endMethod = true;
                        break;

                    case ActivateEffects.PermaPet: //Doesnt exist anymore
                        {
                            //psr.Character.Pet = XmlDatas.IdToType[eff.ObjectId];
                            //GivePet(XmlDatas.IdToType[eff.ObjectId]);
                            //UpdateCount++;
                        }
                        break;

                    case ActivateEffects.Pet:
                        Entity en = Entity.Resolve(Manager, eff.ObjectId);
                        en.Move(X, Y);
                        en.SetPlayerOwner(this);
                        Owner.EnterWorld(en);
                        Owner.Timers.Add(new WorldTimer(30 * 1000, (w, t) =>
                        {
                            w.LeaveWorld(en);
                        }));
                        break;

                    case ActivateEffects.CreatePet:
                        if (!Owner.Name.StartsWith("Pet Yard"))
                        {
                            SendInfo("server.use_in_petyard");
                            return true;
                        }
                        Pet.Create(Manager, this, item);
                        break;

                    case ActivateEffects.MysteryPortal:
                        string[] dungeons = new[]
                        {
                            "Pirate Cave Portal",
                            "Forest Maze Portal",
                            "Spider Den Portal",
                            "Snake Pit Portal",
                            "Glowing Portal",
                            "Forbidden Jungle Portal",
                            "Candyland Portal",
                            "Haunted Cemetery Portal",
                            "Undead Lair Portal",
                            "Davy Jones' Locker Portal",
                            "Manor of the Immortals Portal",
                            "Abyss of Demons Portal",
                            "Lair of Draconis Portal",
                            "Mad Lab Portal",
                            "Ocean Trench Portal",
                            "Tomb of the Ancients Portal",
                            "Beachzone Portal",
                            "The Shatters",
                            "Deadwater Docks",
                            "Woodland Labyrinth",
                            "The Crawling Depths",
                            "Treasure Cave Portal",
                            "Battle Nexus Portal",
                            "Belladonna's Garden Portal",
                            "Lair of Shaitan Portal"
                        };

                        var descs = Manager.GameData.Portals.Where(_ => dungeons.Contains<string>(_.Value.ObjectId)).Select(_ => _.Value).ToArray();
                        var portalDesc = descs[Random.Next(0, descs.Count())];
                        Entity por = Entity.Resolve(Manager, portalDesc.ObjectId);
                        por.Move(this.X, this.Y);
                        Owner.EnterWorld(por);

                        Client.SendPacket(new NotificationPacket
                        {
                            Color = new ARGB(0x00FF00),
                            Text =
                                "{\"key\":\"blank\",\"tokens\":{\"data\":\"" + portalDesc.DungeonName + " opened by " +
                                Client.Account.Name + "\"}}",
                            ObjectId = Client.Player.Id
                        });

                        Owner.BroadcastPacket(new TextPacket
                        {
                            BubbleTime = 0,
                            Stars = -1,
                            Name = "",
                            Text = portalDesc.ObjectId + " opened by " + Name
                        }, null);

                        Owner.Timers.Add(new WorldTimer(portalDesc.TimeoutTime * 1000, (w, t) => //default portal close time * 1000
                        {
                            try
                            {
                                w.LeaveWorld(por);
                            }
                            catch (Exception ex)
                            {
                                Entity.logger.ErrorFormat("Couldn't despawn portal.\n{0}", ex);
                            }
                        }));
                        break;

                    case ActivateEffects.GenericActivate:
                        var targetPlayer = eff.Target.Equals("player");
                        var centerPlayer = eff.Center.Equals("player");
                        var duration = (eff.UseWisMod) ?
                            (int)(UseWisMod(eff.DurationSec) * 1000) :
                            eff.DurationMS;
                        var range = (eff.UseWisMod)
                            ? UseWisMod(eff.Range)
                            : eff.Range;

                        Owner.Aoe((eff.Center.Equals("mouse")) ? target : new Position { X = X, Y = Y }, range, targetPlayer, entity =>
                        {
                            if (IsSpecial(entity.ObjectType)) return;
                            if (!entity.HasConditionEffect(ConditionEffectIndex.Stasis) &&
                                !entity.HasConditionEffect(ConditionEffectIndex.Invincible))
                            {
                                entity.ApplyConditionEffect(
                                new ConditionEffect()
                                {
                                    Effect = eff.ConditionEffect.Value,
                                    DurationMS = duration
                                });
                            }
                        });

                        // replaced this last bit with what I had, never noticed any issue with it.
                        // Perhaps I'm wrong?
                        BroadcastSync(new ShowEffectPacket()
                        {
                            EffectType = (EffectType)eff.VisualEffect,
                            TargetId = Id,
                            Color = new ARGB(eff.Color ?? 0xffffffff),
                            PosA = centerPlayer ? new Position { X = range } : target,
                            PosB = new Position(target.X - range, target.Y)
                        }, p => this.DistSqr(p) < 25);
                        /*if (eff.VisualEffect > 0)
                        {
                            Placeholder x = null;
                            if (eff.Center == "mouse")
                            {
                                x = new Placeholder(Manager, 1500);
                                x.Move(pkt.ItemUsePos.X, pkt.ItemUsePos.Y);
                                Owner.EnterWorld(x);
                            }
                            BroadcastSync(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = x?.Id ?? Id,
                                Color = new ARGB(eff.Color ?? 0xffffffff),
                                PosA = new Position {X = eff.VisualEffect/2},
                            }, p => this.Dist(p) < 25);
                        }*/
                        break;
                }
            }
            UpdateCount++;
            return endMethod;
        }
Esempio n. 12
0
 //Assigns skill values to traps
 private void ConfigureTrap(Trap bc)
 {
     if (range == 0 || dmg == 0)
         print ("Check your range and/or dmg!  One might be 0!");
     bc.dmg = dmg;
     bc.range = range;
     bc.knockback = knockback;
     bc.lifeDrain = lifeDrain;
     bc.poison = poison;
     bc.poisonDur = poisonDur;
     bc.splash = splash;
     bc.splashRad = splashRad * aoeRadiusBonus;
     bc.stun = stun;
     bc.slowdown = slowdown;
     bc.slowDur = slowDur;
     bc.penetration = penetration;
     bc.shieldShred = shieldShred;
     bc.maxArmingTime = trapArmTime;
 }
Esempio n. 13
0
 public void IsCarriableTest()
 {
     _tp = new Trap();
     Assert.AreEqual(_tp.Carriable, false);
 }
 public void RemoveTrap(Trap trap)
 {
     trapList.Remove(trap);
 }
Esempio n. 15
0
 void Awake()
 {
     m_trap = transform.parent.GetComponent <Trap>();
 }
Esempio n. 16
0
    // Update is called once per frame
    void Update()
    {
        if (!ui)
        {
            ui = GameObject.Find("CreatorUI").GetComponent <CreatorHud>();
            ui.updateMoneyText(money);
            setObjRenderer();
        }
        float inputXAmount = Input.GetAxis("L_XAxis_" + contToUse);
        float inputYAmount = Input.GetAxis("L_YAxis_" + contToUse);

        float rTriggerAmount = Input.GetAxis("TriggersR_" + contToUse);

        if (Input.GetButtonDown("A_" + contToUse))
        {
            spawnGameObject();
        }

        if (Input.GetButtonDown("RB_" + contToUse))
        {
            if (currObj < availableObjs.Count - 1)
            {
                currObj++;
            }
            else
            {
                currObj = 0;
            }
            setObjRenderer();
        }
        if (Input.GetButtonDown("LB_" + contToUse))
        {
            if (currObj > 0)
            {
                currObj--;
            }
            else
            {
                currObj = availableObjs.Count - 1;
            }
            setObjRenderer();
        }

        // Calculate how much the velocity should change based on xAccel
        Vector3 direction = new Vector3(inputXAmount, -inputYAmount, 0.0f) * (1f - (2 * rTriggerAmount));

        transform.Translate(moveSpeed * direction * Time.deltaTime);

        GetComponent <CircleCollider2D> ().attachedRigidbody.WakeUp();

        Trap thisObj = availableObjs [currObj];
        // Reset the snapped object if out of range of any cubes
        LayerMask platforms = LayerMask.GetMask("Platforms");

        if (snappedEdge == null || !GetComponent <CircleCollider2D> ().IsTouchingLayers(platforms) ||
            Input.GetButton("Y_" + contToUse) || !thisObj.canPlaceOnWalls)
        {
            // Reset the object snapped to
            snappedEdge = null;
            currObjRenderer.localPosition = new Vector3(0, 0, 0);
            currObjRenderer.eulerAngles   = new Vector3(0, 0, 0);
        }
        else
        {
            /* Update currObjectRenderer's position/rotation on the snapped edge
             * manually, as this may not be called every frame. This prevents the
             * object from being shaky when moving. */
            if (snappedEdge != null)
            {
                OnTriggerStay2D(snappedEdge.gameObject.GetComponent <BoxCollider2D> ());
            }
        }

        //Check if you can place this object right now
        canPlace = (thisObj.canPlaceInAir || snappedEdge != null);

        //Check if this object is being placed on another
        if (currObjRenderer.GetComponent <CreatorObjRenderer>().colliding)
        {
            canPlace = false;
        }
        //Check if a laser hits something
        if (thisObj.name.Equals("Laser") && !LaserHead.checkLaser(currObjRenderer.transform.position,
                                                                  currObjRenderer.transform.rotation))
        {
            canPlace = false;
        }

        Color color;

        if (canPlace)
        {
            color = new Color(1f, 1f, 1f, 0.7f);
        }
        else
        {
            color = new Color(1f, 0f, 0f, 0.3f);
        }
        currObjRenderer.GetComponent <SpriteRenderer> ().color = color;
    }
Esempio n. 17
0
 private void Awake()
 {
     _trap = new Trap();
 }
Esempio n. 18
0
 public void OnTrapStay(Trap trap)
 {
 }
Esempio n. 19
0
 public void OnTrapExit(Trap trap)
 {
 }
Esempio n. 20
0
 public void OnTrapEnter(Trap trap)
 {
 }
 public override void ResetZombie()
 {
     Trap.SetActive(false);
 }
Esempio n. 22
0
        public override void TakeHit(float damage, Trap trap)
        {
            base.TakeHit(damage, trap);

            if (trap is SpikeTrap)
                env.AchievementTracker.ReportFastSpike(this, (SpikeTrap)trap);
        }
Esempio n. 23
0
 public Environment(Environment parent, Trap trap)
 {
     m_trap = trap;
     m_parent = parent;
 }
Esempio n. 24
0
        public override void OnResponse(RelayInfo info)
        {
            if (info.ButtonID == 0)
            {
                Trap.OnSelfClose(User);
                return;
            }

            if (info.ButtonID > 0 && info.ButtonID < 5)
            {
                var id      = info.ButtonID;
                var current = Progress[Progress.Count - 1];
                var next    = 35;
                var count   = (int)Count;
                var perRow  = (int)Math.Sqrt(count);
                int pick;

                if (Progress.Count >= 0 && Progress.Count < Path.Count)
                {
                    next = Path[Progress.Count];
                }

                switch (id)
                {
                default:
                case 1: pick = current - perRow; break;

                case 2: pick = current + 1; break;

                case 3: pick = current + perRow; break;

                case 4: pick = current - 1; break;
                }

                if (pick < 0 || pick > count - 1)      //Off board or already chosen spot
                {
                    User.PlaySound(0x5B6);
                    Refresh();
                }
                else if ((current == count - 2 || current == (count - 1) - perRow) && pick == count - 1)
                {
                    Trap.Path.Clear();
                    Trap.Progress.Clear();

                    Trap.OnComplete(User);
                }
                else if (pick == next)
                {
                    Trap.OnProgress(User, pick);
                    Trap.Progress.Add(pick);

                    Refresh();
                }
                else
                {
                    Trap.OnFailed(User);
                    Trap.Progress.Clear();
                }
            }

            else if (info.ButtonID == 5 && Trap.CanDecipher)
            {
                ShowNext = true;
                Refresh();
            }
        }
Esempio n. 25
0
 void Start()
 {
     trapDoor = transform.parent.parent.GetComponent<TrapDoor> ();
     trapInfo = transform.parent.parent.GetComponent<Trap> ();
 }
Esempio n. 26
0
        public SnmpVersionOne(SnmpV1TrapPacket pkt, EndPoint inep, List <MibTreeInformation> mibTreeInformation, List <TowerDevices> towerDevices, List <AlarmLogStatus> alarmLog)
        {
            var context = GlobalHost.ConnectionManager.GetHubContext <HubMessage>();

            foreach (Vb v in pkt.Pdu.VbList)
            {
                Trap   trap = new Trap();
                string IP   = inep.ToString();
                trap.IpAddres     = pkt.Pdu.AgentAddress.ToString();
                trap.CurrentOID   = pkt.Pdu.Enterprise.ToString();
                trap.ReturnedOID  = v.Oid.ToString();
                trap.dateTimeTrap = DateTime.Now.ToString();

                if (v.Value.GetType().Name == "OctetString")
                {
                    trap.Value = hex.Hexstrings(v.Value.ToString());
                }
                else
                {
                    trap.Value = v.Value.ToString();
                }
                var tDevice = towerDevices.Where(t => t.IP == pkt.Pdu.AgentAddress.ToString()).FirstOrDefault();

                alarmStatusDescription = alarmstatus.AlarmColorDefines(trap.Value, trap.CurrentOID, trap.ReturnedOID, alarmLog, tDevice);
                trap.AlarmStatus       = alarmStatusDescription.AlarmStatusColor;
                trap.AlarmDescription  = alarmStatusDescription.AlarmDescription;

                if (tDevice == null)
                {
                    trap.Countrie    = "Unknown";
                    trap.States      = "Unknown";
                    trap.City        = "Unknown";
                    trap.DeviceName  = "Unknown";
                    trap.TowerName   = "Unknown";
                    trap.Description = "Unknown";
                }
                else
                {
                    trap.Countrie   = tDevice.CountrieName;
                    trap.States     = tDevice.StateName;
                    trap.City       = tDevice.CityName;
                    trap.DeviceName = tDevice.DeviceName;
                    trap.TowerName  = tDevice.TowerName;

                    string oid = pkt.Pdu.Enterprise.ToString();
                    var    OidMibdescription = mibTreeInformation.Where(o => o.OID == oid).FirstOrDefault();
                    if (OidMibdescription == null)
                    {
                        oid = oid.Remove(oid.Length - 1);
                        oid = oid.Remove(oid.Length - 1);
                        OidMibdescription = mibTreeInformation.Where(o => o.OID == oid).FirstOrDefault();
                    }
                    if (OidMibdescription == null)
                    {
                        oid = oid.Remove(oid.Length - 1);
                        oid = oid.Remove(oid.Length - 1);
                        OidMibdescription = mibTreeInformation.Where(o => o.OID == oid).FirstOrDefault();

                        if (OidMibdescription != null)
                        {
                            trap.Description = OidMibdescription.Description;
                            trap.OIDName     = OidMibdescription.Name;
                        }
                        else
                        {
                            trap.Description = "Unknown";
                            trap.OIDName     = "Unknown";
                        }
                    }
                    else
                    {
                        if (OidMibdescription.Description != null)
                        {
                            trap.Description = OidMibdescription.Description;
                        }
                        trap.OIDName = OidMibdescription.Name;
                    }
                    if (trap.Description == "")
                    {
                        trap.Description = "Unknown";
                    }
                }
                context.Clients.All.onHitRecorded(trap);

                db.Traps.Add(trap);
                db.SaveChanges();
            }
        }
Esempio n. 27
0
        public void Update(float elapsedTime)
        {
            #region Turret

            foreach (Turret turret in _game.TurretComponent.All)
            {
                turretTimer += elapsedTime;
                foreach (Enemy enemy in _game.EnemyComponent.All)
                {
                    Vector2 toEnemy  = _game.PositionComponent[enemy.EntityID].Center - turret.position.Center;
                    float   distance = toEnemy.Length();
                    toEnemy.Normalize();
                    if (distance <= turret.range)
                    {
                        if (turretTimer > 0.2f)
                        {
                            _game.WeaponFactory.CreateBullet(BulletType.TurretBullet, toEnemy, turret.position);
                            turretTimer = 0;
                        }
                        break;
                    }
                }
            }
            #endregion

            #region Trap
            trapTimer += elapsedTime;
            List <Trap> traps = new List <Trap>();
            foreach (Trap trap in _game.TrapComponent.All)
            {
                traps.Add(trap);
            }
            for (int i = 0; i < traps.Count; i++)
            {
                Trap trap = traps[i];
                if (!(trap.isSet))
                {
                    foreach (Enemy enemy in _game.EnemyComponent.All)
                    {
                        Vector2 toEnemy = _game.PositionComponent[enemy.EntityID].Center - trap.position.Center;
                        float   check   = toEnemy.Length();
                        if (check < trap.range)
                        {
                            trap.trappedEnemy = enemy;
                            trap.isSet        = true;
                            _game.TrapComponent[trap.EntityID] = trap;
                            _game.PositionComponent[trap.trappedEnemy.EntityID] = trap.position;
                            break;
                        }
                    }
                }

                else
                {
                    _game.PositionComponent[trap.trappedEnemy.EntityID] = trap.position;
                }
            }

            #endregion

            #region ExplodingDroid

            List <ExplodingDroid> droids = new List <ExplodingDroid>();
            foreach (ExplodingDroid droid in _game.ExplodingDroidComponent.All)
            {
                droids.Add(droid);
            }
            for (int i = 0; i < droids.Count; i++)
            {
                ExplodingDroid droid = droids[i];
                if (!(droid.hasEnemy))
                {
                    droid.enemyToAttack = findClosestEnemy(droid.EntityID);
                    droid.hasEnemy      = true;
                    _game.ExplodingDroidComponent[droid.EntityID] = droid;
                }

                else
                {
                    if (_game.MovementComponent.Contains(droid.EntityID) && _game.EnemyComponent.Contains(droid.enemyToAttack.EntityID))
                    {
                        Vector2 toEnemy = _game.PositionComponent[droid.enemyToAttack.EntityID].Center - droid.position.Center;
                        toEnemy.Normalize();

                        Movement move = _game.MovementComponent[droid.EntityID];
                        move.Direction = toEnemy;
                        _game.MovementComponent[droid.EntityID] = move;
                    }

                    else
                    {
                        droid.hasEnemy = false;
                    }
                }
            }

            #endregion
        }
Esempio n. 28
0
 public Trap Create(Trap trap)
 {
     _traps.InsertOne(trap);
     return(trap);
 }
 public void DeregisterTrap( Trap t )
 {
     Traps.Remove( t );
 }
Esempio n. 30
0
 public void Update(string id, Trap trapIn)
 {
     _traps.ReplaceOne(trap => trap.Id == id, trapIn);
 }
Esempio n. 31
0
        private void Activate(RealmTime time, Item item, Position target)
        {
            MP -= item.MpCost;
            foreach (var eff in item.ActivateEffects)
            {
                switch (eff.Effect)
                {
                    case ActivateEffects.BulletNova:
                        {
                            var prjDesc = item.Projectiles[0]; //Assume only one
                            var batch = new Packet[21];
                            var s = Random.CurrentSeed;
                            Random.CurrentSeed = (uint)(s * time.tickTimes);
                            for (var i = 0; i < 20; i++)
                            {
                                var proj = CreateProjectile(prjDesc, item.ObjectType,
                                    (int)statsMgr.GetAttackDamage(prjDesc.MinDamage, prjDesc.MaxDamage),
                                    time.tickTimes, target, (float)(i * (Math.PI * 2) / 20));
                                Owner.EnterWorld(proj);
                                fames.Shoot(proj);
                                batch[i] = new ShootPacket
                                {
                                    BulletId = proj.ProjectileId,
                                    OwnerId = Id,
                                    ContainerType = item.ObjectType,
                                    Position = target,
                                    Angle = proj.Angle,
                                    Damage = (short)proj.Damage
                                };
                            }
                            Random.CurrentSeed = s;
                            batch[20] = new ShowEffectPacket
                            {
                                EffectType = EffectType.Trail,
                                PosA = target,
                                TargetId = Id,
                                Color = new ARGB(0xFFFF00AA)
                            };
                            Owner.BroadcastPackets(batch, null);
                        }
                        break;
                    case ActivateEffects.Shoot:
                        {
                            ActivateShoot(time, item, target);
                        }
                        break;
                    case ActivateEffects.StatBoostSelf:
                        {
                            var idx = -1;

                            switch ((StatsType)eff.Stats)
                            {
                                case StatsType.MaximumHP:
                                    idx = 0;
                                    break;
                                case StatsType.MaximumMP:
                                    idx = 1;
                                    break;
                                case StatsType.Attack:
                                    idx = 2;
                                    break;
                                case StatsType.Defense:
                                    idx = 3;
                                    break;
                                case StatsType.Speed:
                                    idx = 4;
                                    break;
                                case StatsType.Vitality:
                                    idx = 5;
                                    break;
                                case StatsType.Wisdom:
                                    idx = 6;
                                    break;
                                case StatsType.Dexterity:
                                    idx = 7;
                                    break;
                            }
                            var pkts = new List<Packet>();

                            ActivateBoostStat(this, idx, pkts);
                            var OGstat = oldstat;

                            var s = eff.Amount;
                            Boost[idx] += s;
                            UpdateCount++;
                            Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                            {
                                Boost[idx] = OGstat;
                                UpdateCount++;
                            }));
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.Potion,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff)
                            }, null);
                        }
                        break;
                    case ActivateEffects.StatBoostAura:
                        {
                            var idx = -1;
                            switch ((StatsType)eff.Stats)
                            {
                                case StatsType.MaximumHP:
                                    idx = 0;
                                    break;
                                case StatsType.MaximumMP:
                                    idx = 1;
                                    break;
                                case StatsType.Attack:
                                    idx = 2;
                                    break;
                                case StatsType.Defense:
                                    idx = 3;
                                    break;
                                case StatsType.Speed:
                                    idx = 4;
                                    break;
                                case StatsType.Vitality:
                                    idx = 5;
                                    break;
                                case StatsType.Wisdom:
                                    idx = 6;
                                    break;
                                case StatsType.Dexterity:
                                    idx = 7;
                                    break;
                            }

                            var s = eff.Amount;
                            BehaviorBase.AOE(Owner, this, eff.Range, true, player =>
                            {
                                (player as Player).Boost[idx] += s;
                                player.UpdateCount++;
                                Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                                {
                                    (player as Player).Boost[idx] -= s;
                                    player.UpdateCount++;
                                }));
                            });
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range }
                            }, null);
                        }
                        break;
                    case ActivateEffects.ConditionEffectSelf:
                        {
                            ApplyConditionEffect(new ConditionEffect
                            {
                                Effect = eff.ConditionEffect.Value,
                                DurationMS = eff.DurationMS
                            });
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = 1 }
                            }, null);
                        }
                        break;

                    case ActivateEffects.Tag:
                        {
                            //Add Tag to DB
                            using (Database db = new Database())
                            {
                                var db1 = db.CreateQuery();
                                db1.CommandText = "SELECT tags FROM accounts WHERE id=@id;";
                                db1.Parameters.AddWithValue("@id", psr.Account.AccountId);
                                db1.ExecuteScalar();
                                db1.Parameters.AddWithValue("@tags", item.ObjectId);
                                db1.CommandText = "UPDATE accounts SET tags=@tags";
                                db1.ExecuteNonQuery();
                                UpdateCount++;
                            }
                        } break;

                    case ActivateEffects.ConditionEffectAura:
                        {
                            BehaviorBase.AOE(Owner, this, eff.Range, true, player =>
                            {
                                player.ApplyConditionEffect(new ConditionEffect
                                {
                                    Effect = eff.ConditionEffect.Value,
                                    DurationMS = eff.DurationMS
                                });
                            });
                            var color = 0xffffffff;
                            if (eff.ConditionEffect.Value == ConditionEffectIndex.Damaging)
                                color = 0xffff0000;
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(color),
                                PosA = new Position { X = eff.Range }
                            }, null);
                        }
                        break;
                    case ActivateEffects.Heal:
                        {
                            var pkts = new List<Packet>();
                            ActivateHealHp(this, eff.Amount, pkts);
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.HealNova:
                        {
                            var pkts = new List<Packet>();
                            BehaviorBase.AOE(Owner, this, eff.Range, true,
                                player => { ActivateHealHp(player as Player, eff.Amount, pkts); });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range }
                            });
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.Magic:
                        {
                            var pkts = new List<Packet>();
                            ActivateHealMp(this, eff.Amount, pkts);
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.MagicNova:
                        {
                            var pkts = new List<Packet>();
                            BehaviorBase.AOE(Owner, this, eff.Range, true,
                                player => { ActivateHealMp(player as Player, eff.Amount, pkts); });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range }
                            });
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.Teleport:
                        {
                            Move(target.X, target.Y);
                            UpdateCount++;
                            Owner.BroadcastPackets(new Packet[]
                        {
                            new GotoPacket
                            {
                                ObjectId = Id,
                                Position = new Position
                                {
                                    X = X,
                                    Y = Y
                                }
                            },
                            new ShowEffectPacket
                            {
                                EffectType = EffectType.Teleport,
                                TargetId = Id,
                                PosA = new Position
                                {
                                    X = X,
                                    Y = Y
                                },
                                Color = new ARGB(0xFFFFFFFF)
                            }
                        }, null);
                        }
                        break;
                    case ActivateEffects.VampireBlast:
                        {
                            var pkts = new List<Packet>();
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Trail,
                                TargetId = Id,
                                PosA = target,
                                Color = new ARGB(0xFFFF0000)
                            });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Diffuse,
                                Color = new ARGB(0xFFFF0000),
                                TargetId = Id,
                                PosA = target,
                                PosB = new Position { X = target.X + eff.Radius, Y = target.Y }
                            });

                            var totalDmg = 0;
                            var enemies = new List<Enemy>();
                            BehaviorBase.AOE(Owner, target, eff.Radius, false, enemy =>
                            {
                                enemies.Add(enemy as Enemy);
                                totalDmg += (enemy as Enemy).Damage(this, time, eff.TotalDamage, false);
                            });
                            var players = new List<Player>();
                            BehaviorBase.AOE(Owner, this, eff.Radius, true, player =>
                            {
                                players.Add(player as Player);
                                ActivateHealHp(player as Player, totalDmg, pkts);
                            });

                            var rand = new Random();
                            for (var i = 0; i < 5; i++)
                            {
                                var a = enemies[rand.Next(0, enemies.Count)];
                                var b = players[rand.Next(0, players.Count)];
                                pkts.Add(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Flow,
                                    TargetId = b.Id,
                                    PosA = new Position { X = a.X, Y = a.Y },
                                    Color = new ARGB(0xffffffff)
                                });
                            }

                            if (enemies.Count > 0)
                            {
                                var a = enemies[rand.Next(0, enemies.Count)];
                                var b = players[rand.Next(0, players.Count)];
                                pkts.Add(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Flow,
                                    TargetId = b.Id,
                                    PosA = new Position { X = a.X, Y = a.Y },
                                    Color = new ARGB(0Xffffffff)
                                });
                            }

                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.Trap:
                        {
                            var effColor = new ARGB(0xff9000ff);
                            if (eff.Color != null)
                                effColor = new ARGB((uint)eff.Color);
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.Throw,
                                Color = effColor,
                                TargetId = Id,
                                PosA = target
                            }, null);
                            Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                            {
                                var trap = new Trap(
                                    this,
                                    eff.Radius,
                                    eff.TotalDamage,
                                    eff.ConditionEffect ?? ConditionEffectIndex.Slowed,
                                    eff.EffectDuration);
                                trap.Move(target.X, target.Y);
                                world.EnterWorld(trap);
                            }));
                        }
                        break;
                    case ActivateEffects.StasisBlast:
                        {
                            var pkts = new List<Packet>();

                            var effColor = new ARGB(0xffffffff);
                            if (eff.Color != null)
                                effColor = new ARGB((uint)eff.Color);
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.Concentrate,
                                TargetId = Id,
                                PosA = target,
                                PosB = new Position { X = target.X + 3, Y = target.Y },
                                Color = effColor
                            });
                            BehaviorBase.AOE(Owner, target, 3, false, enemy =>
                            {
                                if (enemy.HasConditionEffect(ConditionEffects.StasisImmune))
                                {
                                    pkts.Add(new NotificationPacket
                                    {
                                        ObjectId = enemy.Id,
                                        Color = new ARGB(0xff00ff00),
                                        Text = "Immune"
                                    });
                                }
                                else if (enemy.isPet)
                                {
                                }
                                else if (!enemy.HasConditionEffect(ConditionEffects.Stasis))
                                {
                                    enemy.ApplyConditionEffect(
                                        new ConditionEffect
                                        {
                                            Effect = ConditionEffectIndex.Stasis,
                                            DurationMS = eff.DurationMS
                                        },
                                        new ConditionEffect
                                        {
                                            Effect = ConditionEffectIndex.Confused,
                                            DurationMS = eff.DurationMS
                                        }
                                        );
                                    Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                                    {
                                        enemy.ApplyConditionEffect(new ConditionEffect
                                        {
                                            Effect = ConditionEffectIndex.StasisImmune,
                                            DurationMS = 3000
                                        }
                                            );
                                    }
                                        ));
                                    pkts.Add(new NotificationPacket
                                    {
                                        ObjectId = enemy.Id,
                                        Color = new ARGB(0xffff0000),
                                        Text = "Stasis"
                                    });
                                }
                            });
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.Decoy:
                        {
                            var decoy = new Decoy(this, eff.DurationMS, statsMgr.GetSpeed());
                            decoy.Move(X, Y);
                            Owner.EnterWorld(decoy);
                        }
                        break;
                    case ActivateEffects.MultiDecoy:
                        {
                            for (var i = 0; i < eff.Amount; i++)
                            {
                                var decoy = Decoy.DecoyRandom(this, eff.DurationMS, statsMgr.GetSpeed());
                                decoy.Move(X, Y);
                                Owner.EnterWorld(decoy);
                            }
                        }
                        break;
                    case ActivateEffects.Lightning:
                        {
                            Enemy start = null;
                            var angle = Math.Atan2(target.Y - Y, target.X - X);
                            var diff = Math.PI / 3;
                            BehaviorBase.AOE(Owner, target, 6, false, enemy =>
                            {
                                if (!(enemy is Enemy)) return;
                                var x = Math.Atan2(enemy.Y - Y, enemy.X - X);
                                if (Math.Abs(angle - x) < diff)
                                {
                                    start = enemy as Enemy;
                                    diff = Math.Abs(angle - x);
                                }
                            });
                            if (start == null)
                                break;

                            var current = start;
                            var targets = new Enemy[eff.MaxTargets];
                            for (var i = 0; i < targets.Length; i++)
                            {
                                targets[i] = current;
                                float dist = 8;
                                var next = BehaviorBase.GetNearestEntity(current, ref dist, false,
                                    enemy =>
                                        enemy is Enemy &&
                                        Array.IndexOf(targets, enemy) == -1 &&
                                        BehaviorBase.Dist(this, enemy) <= 6) as Enemy;

                                if (next == null) break;
                                current = next;
                            }

                            var pkts = new List<Packet>();
                            for (var i = 0; i < targets.Length; i++)
                            {
                                if (targets[i] == null) break;
                                var prev = i == 0 ? (Entity)this : targets[i - 1];
                                targets[i].Damage(this, time, eff.TotalDamage, false);
                                if (eff.ConditionEffect != null)
                                    targets[i].ApplyConditionEffect(new ConditionEffect
                                    {
                                        Effect = eff.ConditionEffect.Value,
                                        DurationMS = (int)(eff.EffectDuration * 1000)
                                    });
                                var shotColor = new ARGB(0xffff0088);
                                if (eff.Color != null)
                                    shotColor = new ARGB((uint)eff.Color);
                                pkts.Add(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Lightning,
                                    TargetId = prev.Id,
                                    Color = shotColor,
                                    PosA = new Position
                                    {
                                        X = targets[i].X,
                                        Y = targets[i].Y
                                    },
                                    PosB = new Position { X = 350 }
                                });
                            }
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.PoisonGrenade:
                        {
                            try
                            {
                                Owner.BroadcastPacket(new ShowEffectPacket
                                {
                                    EffectType = EffectType.Throw,
                                    Color = new ARGB(0xffddff00),
                                    TargetId = Id,
                                    PosA = target
                                }, null);
                                var x = new Placeholder(1500);
                                x.Move(target.X, target.Y);
                                Owner.EnterWorld(x);
                                Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                                {
                                    try
                                    {
                                        Owner.BroadcastPacket(new ShowEffectPacket
                                        {
                                            EffectType = EffectType.AreaBlast,
                                            Color = new ARGB(0xffddff00),
                                            TargetId = x.Id,
                                            PosA = new Position { X = eff.Radius }
                                        }, null);
                                    }
                                    catch
                                    {
                                        Console.ForegroundColor = ConsoleColor.DarkRed;
                                        Console.Out.WriteLine("Crash halted - Nobody likes death...");
                                        Console.ForegroundColor = ConsoleColor.White;
                                    }
                                    var enemies = new List<Enemy>();
                                    BehaviorBase.AOE(world, target, eff.Radius, false,
                                        enemy => PoisonEnemy(enemy as Enemy, eff));
                                }));
                            }
                            catch
                            {
                                Console.ForegroundColor = ConsoleColor.DarkBlue;
                                Console.Out.WriteLine("Crash halted - Poison grenade??");
                                Console.ForegroundColor = ConsoleColor.White;
                            }
                        }
                        break;
                    case ActivateEffects.RemoveNegativeConditions:
                        {
                            BehaviorBase.AOE(Owner, this, eff.Range, true, player => { ApplyConditionEffect(NegativeEffs); });
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = eff.Range }
                            }, null);
                        }
                        break;
                    case ActivateEffects.RemoveNegativeConditionsSelf:
                        {
                            ApplyConditionEffect(NegativeEffs);
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xffffffff),
                                PosA = new Position { X = 1 }
                            }, null);
                        }
                        break;
                    case ActivateEffects.IncrementStat:
                        {
                            var idx = -1;
                            switch ((StatsType)eff.Stats)
                            {
                                case StatsType.MaximumHP:
                                    idx = 0;
                                    break;
                                case StatsType.MaximumMP:
                                    idx = 1;
                                    break;
                                case StatsType.Attack:
                                    idx = 2;
                                    break;
                                case StatsType.Defense:
                                    idx = 3;
                                    break;
                                case StatsType.Speed:
                                    idx = 4;
                                    break;
                                case StatsType.Vitality:
                                    idx = 5;
                                    break;
                                case StatsType.Wisdom:
                                    idx = 6;
                                    break;
                                case StatsType.Dexterity:
                                    idx = 7;
                                    break;
                            }
                            Stats[idx] += eff.Amount;
                            var limit =
                                int.Parse(
                                    XmlDatas.TypeToElement[ObjectType].Element(StatsManager.StatsIndexToName(idx))
                                        .Attribute("max")
                                        .Value);
                            if (Stats[idx] > limit)
                                Stats[idx] = limit;
                            UpdateCount++;
                        }
                        break;
                    case ActivateEffects.Create: //this is a portal
                        {
                            short objType;
                            if (!XmlDatas.IdToType.TryGetValue(eff.Id, out objType) ||
                                !XmlDatas.PortalDescs.ContainsKey(objType))
                                break; // object not found, ignore
                            var entity = Resolve(objType);
                            var w = RealmManager.GetWorld(Owner.Id); //can't use Owner here, as it goes out of scope
                            var TimeoutTime = XmlDatas.PortalDescs[objType].TimeoutTime;
                            var DungName = XmlDatas.PortalDescs[objType].DungeonName;

                            ARGB c;
                            c.A = 0;
                            c.B = 91;
                            c.R = 233;
                            c.G = 176;

                            if (eff.Id == "Wine Cellar Portal") //wine cellar incantation
                            {
                                var opened = false;
                                foreach (var i in w.StaticObjects)
                                {
                                    if (i.Value.ObjectType == 0x0721) //locked wine cellar portal
                                    {
                                        opened = true;
                                        entity.Move(i.Value.X, i.Value.Y);
                                        w.EnterWorld(entity);
                                        w.LeaveWorld(i.Value);
                                        UpdateCount++;
                                    }
                                }
                                if (opened)
                                {
                                    psr.SendPacket(new NotificationPacket
                                    {
                                        Color = c,
                                        Text = DungName + " opened by " + psr.Account.Name,
                                        ObjectId = psr.Player.Id
                                    });

                                    w.BroadcastPacket(new TextPacket
                                    {
                                        BubbleTime = 0,
                                        Stars = -1,
                                        Name = "",
                                        Text = DungName + " opened by " + psr.Account.Name
                                    }, null);
                                    w.Timers.Add(new WorldTimer(TimeoutTime * 1000,
                                        (world, t) => //default portal close time * 1000
                                        {
                                            try
                                            {
                                                w.LeaveWorld(entity);
                                            }
                                            catch
                                            //couldn't remove portal, Owner became null. Should be fixed with RealmManager implementation
                                            {
                                                Console.WriteLine(@"Couldn't despawn portal.");
                                            }
                                        }));
                                }
                            }
                            else
                            {
                                entity.Move(X, Y);
                                w.EnterWorld(entity);

                                psr.SendPacket(new NotificationPacket
                                {
                                    Color = c,
                                    Text = DungName + " opened by " + psr.Account.Name,
                                    ObjectId = psr.Player.Id
                                });

                                w.BroadcastPacket(new TextPacket
                                {
                                    BubbleTime = 0,
                                    Stars = -1,
                                    Name = "",
                                    Text = DungName + " opened by " + psr.Account.Name
                                }, null);
                                w.Timers.Add(new WorldTimer(TimeoutTime * 1000,
                                    (world, t) => //default portal close time * 1000
                                    {
                                        try
                                        {
                                            w.LeaveWorld(entity);
                                        }
                                        catch
                                        //couldn't remove portal, Owner became null. Should be fixed with RealmManager implementation
                                        {
                                            Console.WriteLine(@"Couldn't despawn portal.");
                                        }
                                    }));
                            }
                        }
                        break;
                    case ActivateEffects.Dye:
                        {
                            if (item.Texture1 != 0)
                            {
                                Texture1 = item.Texture1;
                            }
                            if (item.Texture2 != 0)
                            {
                                Texture2 = item.Texture2;
                            }
                            SaveToCharacter();
                        }
                        break;
                    case ActivateEffects.PartyAOE:
                        {
                            var randomnumber = Random.Next(1, 5);
                            ConditionEffectIndex partyeffect = 0;
                            var color = 0xffffffff;
                            if (randomnumber == 1)
                            {
                                partyeffect = ConditionEffectIndex.Damaging;
                                color = 0xffff0000;
                            }
                            if (randomnumber == 2)
                            {
                                color = 0xff00ff00;
                                partyeffect = ConditionEffectIndex.Speedy;
                            }
                            if (randomnumber == 3)
                            {
                                color = 0xffffd800;
                                partyeffect = ConditionEffectIndex.Berserk;
                            }

                            if (randomnumber == 4)
                            {
                                color = 0xff00ffff;
                                partyeffect = ConditionEffectIndex.Healing;
                            }
                            BehaviorBase.AOE(Owner, this, eff.Range, true, player =>
                            {
                                player.ApplyConditionEffect(new ConditionEffect
                                {
                                    Effect = partyeffect,
                                    DurationMS = eff.DurationMS
                                });
                            });

                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(color),
                                PosA = new Position { X = eff.Range }
                            }, null);
                        }
                        break;
                    case ActivateEffects.ShurikenAbility:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            ApplyConditionEffect(new ConditionEffect
                            {
                                Effect = ConditionEffectIndex.Speedy,
                                DurationMS = eff.DurationMS
                            });

                            var pt = eff.ObjectId;
                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var substitute = Resolve(obj);
                            substitute.PlayerOwner = this;
                            substitute.isPet = true;
                            w.EnterWorld(substitute);
                            substitute.Move(X, Y);
                            targetlink = target;
                        }
                        break;
                    case ActivateEffects.TomeDamage:
                        {
                            var pkts = new List<Packet>();
                            BehaviorBase.AOE(Owner, this, eff.Range, false,
                                enemy =>
                                {
                                    (enemy as Enemy).Damage(this, time,
                                        (int)statsMgr.GetAttackDamage(eff.TotalDamage, eff.TotalDamage), false,
                                        new ConditionEffect[0]);
                                });
                            pkts.Add(new ShowEffectPacket
                            {
                                EffectType = EffectType.AreaBlast,
                                TargetId = Id,
                                Color = new ARGB(0xFF00FF00),
                                PosA = new Position { X = eff.Range }
                            });
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;
                    case ActivateEffects.Mushroom:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            Size = eff.Amount;
                            UpdateCount++;
                            w.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) =>
                            {
                                try
                                {
                                    Size = 100;
                                    UpdateCount++;
                                }
                                catch
                                {
                                }
                            }));
                        }
                        break;

                    case ActivateEffects.PearlAbility:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            var pt = eff.ObjectId;
                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var substitute = Resolve(obj);
                            substitute.PlayerOwner = this;
                            substitute.isPet = true;
                            w.EnterWorld(substitute);
                            substitute.Move(X, Y);
                            targetlink = target;
                            var pkts = new List<Packet>();
                            ActivateHealHp(this, eff.Amount, pkts);
                            Owner.BroadcastPackets(pkts, null);
                        }
                        break;

                    case ActivateEffects.PermaPet:
                        {
                            psr.Character.Pet = XmlDatas.IdToType[eff.ObjectId];
                            GivePet(XmlDatas.IdToType[eff.ObjectId]);
                            UpdateCount++;
                        }
                        break;
                    case ActivateEffects.MiniPot:
                        {
                            Client.Player.Stats[1] = 1;
                            Client.Player.Stats[0] = 1;
                            Client.Player.Stats[6] = 1;
                            Client.Player.Stats[7] = 1;
                            Client.Player.Stats[2] = 1;
                            Client.Player.Stats[3] = 1;
                            Client.Player.Stats[5] = 1;
                            Client.Player.Stats[4] = 1;
                        }
                        break;
                    case ActivateEffects.Backpack:
                        {
                            var bps = 1;
                            foreach (var i in psr.Character.Backpacks)
                            {
                                if (bps < i.Key)
                                    bps = i.Key;
                            }
                            psr.Character.Backpacks.Add(bps + 1, new short[] { -1, -1, -1, -1, -1, -1, -1, -1 });
                            new Database().SaveBackpacks(psr.Character, psr.Account);
                            SendInfo("Added backpack #" + (bps + 1));
                        }
                        break;
                    case ActivateEffects.Drake:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            var pt = eff.ObjectId;
                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var drake = Resolve(obj);
                            drake.PlayerOwner = this;
                            w.EnterWorld(drake);
                            drake.Move(X, Y);
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                TargetId = Id,
                                Color = new ARGB(0x9195A9),
                                EffectType = EffectType.AreaBlast,
                                PosA = new Position
                                {
                                    X = 1
                                }
                            }, null);
                            Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) => { w.LeaveWorld(drake); }));
                        }
                        break;
                    case ActivateEffects.BuildTower:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            var pt = eff.ObjectId;

                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var tower = Resolve(obj);
                            tower.PlayerOwner = this;
                            tower.isPet = true;
                            w.EnterWorld(tower);
                            tower.Move(X, Y);
                            Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) => { w.LeaveWorld(tower); }));
                        }
                        break;
                    case ActivateEffects.MonsterToss:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            var pt = eff.ObjectId;
                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var monster = Resolve(obj);
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.Throw,
                                Color = new ARGB(0x000000),
                                TargetId = Id,
                                PosA = target
                            }, null);
                            Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
                            {
                                w.EnterWorld(monster);
                                monster.Move(target.X, target.Y);
                            }));
                        }
                        break;
                    case ActivateEffects.Halo:
                        {
                            var halo = new Halo(this, eff.Range, eff.Amount, eff.DurationMS);
                            halo.Move(X, Y);
                            Owner.EnterWorld(halo);
                        }
                        break;
                    case ActivateEffects.Fame:
                        {
                            CurrentFame = psr.Account.Stats.Fame = new Database().UpdateFame(psr.Account, eff.Amount);

                        }
                        break;
                    case ActivateEffects.SamuraiAbility:
                        {
                            var ydist = target.Y - Y;
                            var xdist = target.X - X;
                            var xwalkable = target.X + xdist / 2;
                            var ywalkable = target.Y + ydist / 2;
                            var tile = Owner.Map[(int)xwalkable, (int)ywalkable];
                            ObjectDesc desc;
                            if (XmlDatas.TileDescs[tile.TileId].NoWalk)
                                return;
                            if (XmlDatas.ObjectDescs.TryGetValue(tile.ObjType, out desc))
                            {
                                if (!desc.Static)
                                    return;
                            }
                            Owner.BroadcastPacket(new ShowEffectPacket
                            {
                                EffectType = EffectType.Diffuse,
                                Color = new ARGB(0xFFFF0000),
                                TargetId = Id,
                                PosA = target,
                                PosB = new Position { X = target.X + eff.Radius, Y = target.Y }
                            }, null);
                            BehaviorBase.AOE(Owner, target, eff.Radius, false, enemy =>
                            {
                                (enemy as Enemy).Damage(this, time, eff.TotalDamage, false, new ConditionEffect
                                {
                                    Effect = ConditionEffectIndex.Bleeding,
                                    DurationMS = eff.DurationMS
                                });
                            });
                            Move(target.X + xdist / 2, target.Y + ydist / 2);
                            UpdateCount++;

                            Owner.BroadcastPackets(new Packet[]
                        {
                            new GotoPacket
                            {
                                ObjectId = Id,
                                Position = new Position
                                {
                                    X = X,
                                    Y = Y
                                }
                            },
                            new ShowEffectPacket
                            {
                                EffectType = EffectType.Teleport,
                                TargetId = Id,
                                PosA = new Position
                                {
                                    X = X,
                                    Y = Y
                                },
                                Color = new ARGB(0xFFFFFFFF)
                            }
                        }, null);
                            ApplyConditionEffect(new ConditionEffect
                            {
                                Effect = ConditionEffectIndex.Paralyzed,
                                DurationMS = eff.DurationMS2
                            });
                        }
                        break;
                    case ActivateEffects.Summon:
                        {
                            var w = RealmManager.GetWorld(Owner.Id);
                            var pt = eff.ObjectId + " Summon";

                            short obj;
                            XmlDatas.IdToType.TryGetValue(pt, out obj);
                            var summon = Resolve(obj);
                            summon.PlayerOwner = this;
                            summon.isPet = true;
                            w.EnterWorld(summon);
                            summon.Move(X, Y);
                            Owner.Timers.Add(new WorldTimer(eff.DurationMS, (world, t) => { w.LeaveWorld(summon); }));
                        }
                        break;

                }
            }
            UpdateCount++;
        }
Esempio n. 32
0
 public void Remove(Trap trapIn)
 {
     _traps.DeleteOne(trap => trap.Id == trapIn.Id);
 }
Esempio n. 33
0
 private bool TrapsEqual(Trap fromDDI)
 {
     return(TrapsEqual(fromDDI, FindTrap(fromDDI.Name)));
 }
Esempio n. 34
0
    public virtual void OnTriggerEnter2D(Collider2D coll)
    {
        if (frozen)
        {
            return;
        }

        /*if(coll.gameObject.tag == "Enemy"){ //handled before anything that cares about shields
         *      if(knockChained){
         *              Enemy e = coll.GetComponent<Enemy>();
         *              float progressGap = progress-e.GetProgress();
         *              carrySpacing = progressGap;
         *              CarryEnemy(e);
         *      }
         * }*/
        if (shield != null)
        {
            if (shield.hitThisFrame)           //the shield handled collision for us this time
            {
                return;
            }
            else             //the shield was either missed or hasn't been handled by collision yet
            {
                if (secondaryCollisionTicket)
                {
                    //let execution through to actually handle the collision- we're calling this function manually
                    secondaryCollisionTicket = false; //punch the ticket
                }
                else                                  //skip colliding- wait until update to check if the shield got it for us
                {
                    collidedThisFrame = true;
                    heldCollision     = coll;                 //store the collision so we can handle it if/when we call this manually
                    return;
                }
            }
        }
        if (coll == null)
        {
            Debug.Log("bullet's gone");
            return;
        }
        //Debug.Log ("!!! we made it through to our own collision");
        if (coll.gameObject.tag == "Bullet")         //if it's a bullet
        {
            Bullet bc = coll.gameObject.GetComponent <Bullet> ();
            if (bc != null)
            {
                if (bc.CheckActive())                 //if we get a Yes, this bullet/trap/shield is active
                {
                    //dude, the timer on split bullets is to keep it from colliding with itself, not enemies

                    bc.enemyHit = this.gameObject;
                    GetStatused(bc);
                    //StartCoroutine (StatusEffectsBullet (bc));
                    hp -= bc.dmg;
                    timesShot++;
                    bc.Collide();

                    if (hp <= 0)
                    {
                        hp = 0;
                        Die();
                    }
                }
            }
        }
        else if (coll.gameObject.tag == "Trap")         //if it's a trap
        {
            if (tripsTraps)
            {
                Trap tc = coll.gameObject.GetComponent <Trap>();
                if (tc != null)
                {
                    if (tc.CheckActive())                     //if we get a Yes, this bullet/trap/shield is active
                    {
                        tc.enemyHit = this.gameObject;
                        //StartCoroutine (StatusEffectsTrap (tc));
                        hp -= tc.dmg;
                        tc.Collide();
                        if (hp <= 0)
                        {
                            Die();
                        }
                    }
                }
            }
        }
        else if (coll.gameObject.tag == "Shield")         //if it's a shield
        {
            //shield actions are handled in DialController
        }
        else if (coll.gameObject.tag == "AoE")
        {
            //Debug.Log ("enemy collided with AoE");
            GameObject obj = coll.gameObject;
            AoE        ac  = obj.GetComponent <AoE>();
            if (ac.parent == "Bullet")
            {
                // if (ac.aoeBulletCon.enemyHit != this.gameObject) //if this isn't the enemy originally hit
                // {
                //  //Debug.Log ("parent is bullet@");
                //  Bullet bc = ac.aoeBulletCon;
                //  GetStatused(bc);
                //  //StartCoroutine (StatusEffectsBullet (bc));
                //  hp -= bc.dmg;
                //  Debug.Log ("damage taken: " + bc.dmg);
                //  //timesShot++;
                //  if(hp <= 0){
                //      Die ();
                //  }
                // }
            }
            else if (ac.parent == "Trap")
            {
                // if (ac.aoeTrapCon.enemyHit != this.gameObject) //if this isn't the enemy originally hit
                // {
                //  Trap tc = ac.aoeTrapCon;
                //  //StartCoroutine (StatusEffectsTrap (tc));
                //  hp -= tc.dmg;
                //  if(hp <= 0){
                //      Die ();
                //  }
                // }
            }
        }
        //other types of collision?
    }
        public void ReportPoisonImmune(Enemies.ImmuneEnemy immuneEnemy, Trap poisonTrap)
        {
            //there's only one achievement that matters here
            if (achieved[Achievements.WhyWontYouDie])
                return;

            //we only care about fully upgraded traps
            if (poisonTrap.CanUpgrade)
                return;

            if (poisonCounts == null)
                poisonCounts = new Dictionary<Enemy, int>();

            if (poisonCounts.ContainsKey(immuneEnemy))
            {
                poisonCounts[immuneEnemy]++;
                if (poisonCounts[immuneEnemy] >= 5)
                {
                    achieved[Achievements.WhyWontYouDie] = true;
                    saveAchieved();
                    poisonCounts = null;
                }
            }
            else
            {
                poisonCounts[immuneEnemy] = 1;
            }
        }
Esempio n. 36
0
 bool PieceTrapColision(Trap trap, int railPieceNumber)
 {
     return(trap == null || (railPieceNumber > -1 && trap.CanPutPiece[railPieceNumber]));
 }
Esempio n. 37
0
    public void ShieldAgainstTrap(Trap t)
    {
        float amount = t.dmg;
        power -= amount;
        RefreshShieldColors();
        if(power <= 0){
            GetBroken ();
        }

        GetStatused(t);
        if(t.penetration > 0){
            float penDamage = t.penetration*t.dmg;
            TakeDamage(penDamage);
        }
        if(t.shieldShred > 0){
            float shredDamage = t.shieldShred*t.dmg;
            capacity -= shredDamage;
            if(power > capacity){
                power = capacity;
            }
        }
        /*if(t.slowsShields != 0){
            SlowRegen(t.slowsShields);
        }*/
    }
Esempio n. 38
0
 void Start()
 {
     trapInfo = transform.GetComponent <Trap>();
 }
Esempio n. 39
0
    void AddObstacle(Layer layer, float posX, int stageObjectId, ItemDropManager itemDropManager, FSM parentFsm, bool lastMonster)
    {
        FieldInstance instance = null;
        ObjectField objectField = TableLoader.GetTable<ObjectField>().Get(stageObjectId);
        ObjectStage objectStage = TableLoader.GetTable<ObjectStage>().Get(stageObjectId);

        if (objectStage.Type == E_StageObjectType.Monster)
        {
            ObjectMonster objectMonster = TableLoader.GetTable<ObjectMonster>().Get(objectStage.ObjectID);
            if (objectMonster.MonsterType == E_MonsterType.Boss)
            {
                BossAlertTrigger alertTrigger = new BossAlertTrigger(parentFsm);
                layer.AddSubject(alertTrigger, posX - Constants.Instance.Field.CameraWidth, 0);
                AddFieldInstance(alertTrigger);

                instance = new BossMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else if (lastMonster)
            {
                instance = new LastMonster(objectField, objectStage, itemDropManager, parentFsm);
            }
            else
            {
                instance = new BattleObstacle(objectField, objectStage, itemDropManager, parentFsm);
            }
        }
        else if (objectStage.Type == E_StageObjectType.Chest)
        {
            instance = new Chest(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.EndPoint)
        {
            instance = new StageEndDoor(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Trap)
        {
            instance = new Trap(objectField, objectStage, itemDropManager, parentFsm);
        }
        else if (objectStage.Type == E_StageObjectType.Etc)
        {
            instance = new StageObject(objectField, objectStage, itemDropManager, parentFsm);
        }
        else
        {
            Assert.Fail("not implemented");
        }

        layer.AddSubject(instance, posX, 0);
        AddFieldInstance(instance);
    }
Esempio n. 40
0
    public void MoveNextTile()
    {
        remainingMovement = MovementSpeed;
//		Debug.Log(remainingMovement);
//		CalculateDistancesToPlayers();
//		GameObject Unit = GameObject.Find ("UnitOne");
        selectTargetting();
//		CalculateDistancesToPlayers();
        GameObject        Player = GameObject.Find(selectedPlayer);
        PlayableCharacter player = Player.GetComponent <PlayableCharacter> ();

        map.GeneratePathToEnemy(player.PlayerClass.TileX, player.PlayerClass.TileY);

        while (remainingMovement > 0)
        {
            currentTile = ("Hex_" + TileX + "_" + TileY);
            GameObject.Find(currentTile).GetComponent <ClickableTile> ().IsNotWalkable();

//			tile.IsNotWalkable();
            int tileXHolder = TileX;
            int tileYHolder = TileY;
            CalculateDistance();

            if ((currentPath == null || distance <= AttackRange) && Blinded == false)
            {
//				Debug.Log(remainingMovement);
                if (remainingMovement >= 1)
                {
                    Attack();
                }
                return;
            }
            if ((currentPath == null || distance <= AttackRange) && Blinded == true)
            {
                return;
            }
            // Get cost from current tile to next tile
            remainingMovement -= map.CostToEnterTile(currentPath[0].x, currentPath[0].y, currentPath[1].x, currentPath[1].y);

            // Move us to the next tile in the sequence
            TileX = currentPath[1].x;
            TileY = currentPath[1].y;

            transform.position = map.TileCoordToWorldCoord(TileX, TileY);               // Update our unity world position

            // Remove the old "current" tile
            currentPath.RemoveAt(0);
//			Debug.Log(this.name + " " + currentPath.Count);
            if (currentPath.Count == 1)
            {
                // We only have one tile left in the path, and that tile MUST be our ultimate
                // destination -- and we are standing on it!
                // So let's just clear our pathfinding info.
                currentPath = null;
            }
            currentTile = ("Hex_" + tileXHolder + "_" + tileYHolder);
            ClickableTile clickableTile = GameObject.Find(currentTile).GetComponent <ClickableTile> ();
            clickableTile.IsWalkable();
            currentTile   = ("Hex_" + TileX + "_" + TileY);
            clickableTile = GameObject.Find(currentTile).GetComponent <ClickableTile> ();
            clickableTile.IsNotWalkable();

            if (clickableTile.trapped)
            {
                clickableTile.trapped = false;
                GameObject Trap = GameObject.Find("_Scripts");
                Trap       trap = Trap.GetComponent <Trap> ();
                trap.TrapActivate();
            }
        }
    }
 public Trap AddTrap(byte playerId)
 {
     Trap trap = new Trap(playerId, playerTrapIdPool[playerId]++);
     trapList.Add(trap);
     return trap;
 }
Esempio n. 42
0
    private void configDefault()
    {
        //ITEM 全局的加,代码生成的 action由自己设置
        GameObject[] gameOBs = GameObject.FindGameObjectsWithTag("Item");
        foreach (GameObject gb in gameOBs)
        {
            BoxCollider2D[] boxC2ds = gb.GetComponentsInChildren <BoxCollider2D>();
            foreach (BoxCollider2D b2d in boxC2ds)
            {
                if (b2d.name == "Hitbox")
                {
                    //查看自定义数值
                    SuperCustomProperties scp = gb.GetComponent <SuperCustomProperties>();
                    if (scp != null)
                    {
                        CustomProperty cp;
                        if (scp.TryGetCustomProperty("ItemType", out cp))
                        {
                            if (cp.m_Value.Equals("ExitPort"))
                            {
                                Item item = b2d.gameObject.AddComponent <Item>();
                                item.interactionBodyAction = ItemAction.ItemExitAction();

                                break;
                            }
                        }
                    }
                    else
                    {
                        if (b2d.GetComponent <Item>() == null)
                        {
                            Item item = b2d.gameObject.AddComponent <Item>();
                        }
                    }
                }
            }
        }

        GameObject[] peakPositions = GameObject.FindGameObjectsWithTag("Trap");
        foreach (GameObject peakPosition in peakPositions)
        {
            SuperCustomProperties scp = peakPosition.GetComponent <SuperCustomProperties>();
            if (scp != null)
            {
                CustomProperty cp;
                if (scp.TryGetCustomProperty("TrapName", out cp))
                {
                    string peakName = cp.m_Value;
                    Trap   trap     = Instantiate((GameObject)Resources.Load("Trap/" + peakName), peakPosition.transform.position, Quaternion.identity).GetComponent <Trap>();
                    trap.transform.parent = peakPosition.GetComponentInParent <BlockController>().gameObject.transform;
                    AdjustingTileOffset(trap.transform);
                }
                Destroy(peakPosition);
            }
        }

        GameObject[] buffTilePositions = GameObject.FindGameObjectsWithTag("BuffTile");
        foreach (GameObject buffTilePosition in buffTilePositions)
        {
            SuperCustomProperties scp = buffTilePosition.GetComponent <SuperCustomProperties>();
            if (scp != null)
            {
                CustomProperty cp;
                if (scp.TryGetCustomProperty("BuffTileName", out cp))
                {
                    string BuffTileName = cp.m_Value;
                    IncreamSpeedBuffTile increamSpeedBuffTile = Instantiate((GameObject)Resources.Load("BuffTile/" + BuffTileName), buffTilePosition.transform.position, Quaternion.identity).GetComponent <IncreamSpeedBuffTile>();
                    increamSpeedBuffTile.transform.parent = buffTilePosition.GetComponentInParent <BlockController>().gameObject.transform;
                    AdjustingTileOffset(increamSpeedBuffTile.transform);
                    if (scp.TryGetCustomProperty("BuffSpeedIncrementPresent", out cp))
                    {
                        increamSpeedBuffTile.buffName = cp.m_Value;
                    }
                    Destroy(buffTilePosition);
                }
            }
        }

        GameObject[] obstaclePositions = GameObject.FindGameObjectsWithTag("Obstacle");
        foreach (GameObject obstaclePosition in obstaclePositions)
        {
            SuperCustomProperties scp = obstaclePosition.GetComponent <SuperCustomProperties>();
            if (scp != null)
            {
                CustomProperty cp;
                if (scp.TryGetCustomProperty("ObstacleName", out cp))
                {
                    string   ObstacleName = cp.m_Value;
                    Obstacle obstacle     = Instantiate((GameObject)Resources.Load("Obstacle/" + ObstacleName), obstaclePosition.transform.position, Quaternion.identity).GetComponent <Obstacle>();
                    obstacle.transform.parent = obstaclePosition.GetComponentInParent <BlockController>().gameObject.transform;
                    AdjustingTileOffset(obstacle.transform);
                    Destroy(obstaclePosition);
                }
            }
            PhysicsMaterial2D pMaterial2D = (PhysicsMaterial2D)Resources.Load("ZeroFrictionPhysicsMaterial2D");
            Collider2D[]      collider2Ds = GameObject.FindObjectsOfType <Collider2D>();
            foreach (Collider2D collider2D in collider2Ds)
            {
                if (collider2D.gameObject.layer == LayerMask.NameToLayer("Wall"))
                {
                    collider2D.sharedMaterial = pMaterial2D;
                }
            }
        }
    }
Esempio n. 43
0
    /// <summary>
    /// Synchronizes with the server, then calls run().
    /// </summary>
    /// <returns>
    /// Return true to end turn, false to resynchronize with the 
    /// server and run again.
    /// </returns>
    public bool startTurn()
    {
        int count = 0;
        iteration++;

        count = Client.getPlayerCount(connection);
        players = new Player[count];
        for(int i = 0; i < count; i++)
          players[i] = new Player(Client.getPlayer(connection, i));

        count = Client.getMappableCount(connection);
        mappables = new Mappable[count];
        for(int i = 0; i < count; i++)
          mappables[i] = new Mappable(Client.getMappable(connection, i));

        count = Client.getTileCount(connection);
        tiles = new Tile[count];
        for(int i = 0; i < count; i++)
          tiles[i] = new Tile(Client.getTile(connection, i));

        count = Client.getTrapCount(connection);
        traps = new Trap[count];
        for(int i = 0; i < count; i++)
          traps[i] = new Trap(Client.getTrap(connection, i));

        count = Client.getThiefCount(connection);
        thiefs = new Thief[count];
        for(int i = 0; i < count; i++)
          thiefs[i] = new Thief(Client.getThief(connection, i));

        count = Client.getThiefTypeCount(connection);
        thiefTypes = new ThiefType[count];
        for(int i = 0; i < count; i++)
          thiefTypes[i] = new ThiefType(Client.getThiefType(connection, i));

        count = Client.getTrapTypeCount(connection);
        trapTypes = new TrapType[count];
        for(int i = 0; i < count; i++)
          trapTypes[i] = new TrapType(Client.getTrapType(connection, i));

        if(!initialized)
        {
          initialized = true;
          init();
        }

        return run();
    }
Esempio n. 44
0
    void Update()
    {
        if (PauseAnimator.GetBool("PauseEnabled") == true)
        {
            return;
        }
        if (health.getHealth() <= 0)
        {
            if (team == -1)
            {
                thePlayer.GetComponent <InGameCash>().addAmount(10);
            }
            activ = false;
        }
        if (activ)
        {
            if (state == (int)States.CHARGE)
            {
                float dist = 0;
                if (team == 1)
                {
                    for (uint j = 0; j < enemyGridSystem.GridSize; ++j)
                    {
                        float yDist = enemyGridSystem.grid[j].transform.position.y - originPos.y;
                        //Debug.Log("TEST");

                        if (Mathf.Abs(enemyGridSystem.grid[j].transform.position.x - originPos.x) < 20 && !enemyGridSystem.IsGreyedOut(j) && Mathf.Abs(yDist) > dist)
                        {
                            //Debug.Log("TEST");
                            dist        = Mathf.Abs(yDist);
                            targetPos   = enemyGridSystem.grid[j].transform.position;
                            targetIndex = j;
                        }
                    }
                }
                else if (team == -1)
                {
                    for (uint j = 0; j < theGridSystem.GridSize; ++j)
                    {
                        float yDist = theGridSystem.grid[j].transform.position.y - originPos.y;
                        if (Mathf.Abs(theGridSystem.grid[j].transform.position.x - originPos.x) < 20 && !theGridSystem.IsGreyedOut(j) && Mathf.Abs(yDist) > dist)
                        {
                            dist        = Mathf.Abs(yDist);
                            targetPos   = theGridSystem.grid[j].transform.position;
                            targetIndex = j;
                        }
                    }
                }


                Vector3 hello = targetPos - Pos;
                //hello.x = 0;
                //hello.y = team;
                //hello.z = 0;
                hello.Normalize();
                bool collided = false;
                for (int i = 0; i < game.objects.Count; ++i)
                {
                    Vector3 nextPosition = Pos + hello * speed;
                    if (!(Mathf.Abs(game.objects[i].transform.position.x - Pos.x) < 10 * canvasLocalScale.x && Mathf.Abs(game.objects[i].transform.position.y - Pos.y) < 10 * canvasLocalScale.y))
                    {
                        if (Collided(nextPosition, game.objects[i].transform.position))
                        {
                            collided = true;
                        }
                    }
                }
                if (!collided)
                {
                    Pos += hello * speed;
                }

                transform.position = Pos;
                if (/*prevhealth != health*/ health.isHealthModified())
                {
                    // state = (int)States.CHASE;
                    aggrotimer = 0;
                }
                //prevhealth = health;
                health.setHealthModifiedToFalse();
                float minNearest = 1000000;
                nearest = null;
                for (int i = 0; i < game.objects.Count; ++i)
                {
                    nearestAI = game.objects[i].GetComponent <TroopAI>();
                    if (nearestAI.activ && nearestAI.team != team)
                    {
                        //Vector2 hello1 = new Vector2(game.objects[i].transform.position.x - transform.position.x, game.objects[i].transform.position.y - transform.position.y);
                        //float dist = hello1.SqrMagnitude();
                        //if (dist <= vision * vision && dist < minNearest)
                        //{
                        //    minNearest = dist;
                        //    nearest = game.objects[i];
                        //}
                        if (game.objects[i].transform.position.x > transform.position.x - attackWidth && game.objects[i].transform.position.x < transform.position.x + attackWidth && (game.objects[i].transform.position - transform.position).magnitude < range + 10 * canvasLocalScale.x && Mathf.Abs(game.objects[i].transform.position.y - transform.position.y) < attackHeight + 10 * canvasLocalScale.y)
                        {
                            nearest = game.objects[i];
                        }
                    }
                }
                if (nearest != null)
                {
                    state = (int)States.ATTACK;
                }
            }

            if (state == (int)States.ATTACK)
            {
                attacktimer += Time.deltaTime;
                if (nearest != null)
                {
                    nearestAI = nearest.GetComponent <TroopAI>();
                    if (nearestAI.activ)
                    {
                        if (attacktimer > (attckSpd))
                        {
                            //Class 1 = Infantry, Class 2 = Bowmen, Class 3 = Cavalry
                            attacktimer = 0;
                            if (_class == nearestAI._class)
                            {
                                if (!fireProj && _class == 2 && nearestAI)
                                {
                                    theProjectile.CreateProjectile(projectileOBJ, this, nearestAI, attckDmg);
                                }
                                else if (_class != 2)
                                {
                                    nearestAI.health.addHealth(-attckDmg);
                                }
                            }
                            if (_class == 1 && nearestAI._class == 3)
                            {
                                nearestAI.health.addHealth(-attckDmg * 3);
                            }
                            if (_class == 1 && nearestAI._class == 2)
                            {
                                nearestAI.health.addHealth(-attckDmg);
                            }
                            if (_class == 2 && nearestAI._class == 1)
                            {
                                if (!fireProj && nearestAI)
                                {
                                    theProjectile.CreateProjectile(projectileOBJ, this, nearestAI, attckDmg + 10);
                                }
                                else
                                {
                                    nearestAI.health.addHealth(-attckDmg * 5);
                                }
                            }
                            if (_class == 2 && nearestAI._class == 3)
                            {
                                if (!fireProj && nearestAI)
                                {
                                    theProjectile.CreateProjectile(projectileOBJ, this, nearestAI, attckDmg);
                                }
                                else
                                {
                                    nearestAI.health.addHealth(-attckDmg);
                                }
                            }
                            if (_class == 3 && nearestAI._class == 1)
                            {
                                nearestAI.health.addHealth(-attckDmg);
                            }
                            if (_class == 3 && nearestAI._class == 2)
                            {
                                nearestAI.health.addHealth(-attckDmg * 3);
                            }
                            attacktimer = 0;
                        }
                    }
                    else
                    {
                        state = (int)States.CHARGE;
                    }
                }
                else
                {
                    state = (int)States.CHARGE;
                }
            }

            //Powerups
            if (thePowerupsSystem && thePowerupsSystem.PowerupsIsActive == true)
            {
                //Search player powerups list
                if (team == 1)
                {
                    for (int i = 0; i < thePowerupsSystem.PlayerGridPowerups.Count; ++i)
                    {
                        if (Collided(thePowerupsSystem.PlayerGridPowerups[i].powerupPosition, transform.position))
                        {
                            switch (thePowerupsSystem.PlayerGridPowerups[i].powerType)
                            {
                            case PowerupsSystem.POWERUP_TYPE.POWERUP_ATTACKDAMAGE:
                            {
                                attckDmg += thePowerupsSystem.PlayerGridPowerups[i].AddedAttackDamage;
                                break;
                            }

                            case PowerupsSystem.POWERUP_TYPE.POWERUP_ATTACKSPEED:
                            {
                                attckSpd -= thePowerupsSystem.PlayerGridPowerups[i].AddedAttackSpeed;
                                break;
                            }

                            case PowerupsSystem.POWERUP_TYPE.POWERUP_MOVESPEED:
                            {
                                speed += thePowerupsSystem.PlayerGridPowerups[i].AddedMoveSpeed;
                                break;
                            }

                            default:
                                break;
                            }

                            Destroy(thePowerupsSystem.PlayerGridPowerups[i].PowerUpTexture);
                            thePowerupsSystem.PlayerGridPowerups.RemoveAt(i);
                        }
                    }
                }
                else  //Search enemy player grid list
                {
                    for (int i = 0; i < thePowerupsSystem.EnemyGridPowerups.Count; ++i)
                    {
                        if (Collided(thePowerupsSystem.EnemyGridPowerups[i].powerupPosition, transform.position))
                        {
                            switch (thePowerupsSystem.EnemyGridPowerups[i].powerType)
                            {
                            case PowerupsSystem.POWERUP_TYPE.POWERUP_ATTACKDAMAGE:
                            {
                                attckDmg += thePowerupsSystem.EnemyGridPowerups[i].AddedAttackDamage;
                                break;
                            }

                            case PowerupsSystem.POWERUP_TYPE.POWERUP_ATTACKSPEED:
                            {
                                attckSpd += thePowerupsSystem.EnemyGridPowerups[i].AddedAttackSpeed;
                                break;
                            }

                            case PowerupsSystem.POWERUP_TYPE.POWERUP_MOVESPEED:
                            {
                                speed += thePowerupsSystem.EnemyGridPowerups[i].AddedMoveSpeed;
                                break;
                            }

                            default:
                                break;
                            }

                            Destroy(thePowerupsSystem.EnemyGridPowerups[i].PowerUpTexture);
                            thePowerupsSystem.EnemyGridPowerups.RemoveAt(i);
                        }
                    }
                }
            }
            if (theTrapSystem && theTrapSystem.trapSystemActive)
            {
                foreach (GameObject go in theTrapSystem.myTraps)
                {
                    Trap theTrap = go.GetComponent <Trap>();
                    if (!theTrap.isactive)
                    {
                        continue;
                    }
                    if (theTrap.team == team)
                    {
                        continue;
                    }
                    if (Collided(go.transform.position, transform.position))
                    {
                        theTrap.activateTrap(this);
                        //Destroy(theTrap);
                        theTrap.isactive = false;
                        go.SetActive(false);
                    }
                }
                theTrapSystem.cleanUpTraps();
            }
        }
    }
Esempio n. 45
0
 /// <summary>
 /// Reduces health by the specified amount and flashes red.  Note there
 /// is no invincibility frame!
 /// </summary>
 /// <param name="damage"></param>
 public override void TakeHit(float damage, Trap trap)
 {
     health -= damage;
 }
Esempio n. 46
0
 /// <summary>
 /// Sets up the slot at the specified index with the specified trap.
 /// </summary>
 /// <param name="slotIndex">Slot index value = [0, slots.length).</param>
 /// <param name="slotTrap">A trap for the slot or null if the slot should be empty.</param>
 private void SetUpSlot(int slotIndex, Trap slotTrap)
 {
     gameplayUIData.slots[slotIndex].Trap = slotTrap;
 }
Esempio n. 47
0
 public void SwitchTest()
 {
     _tp = new Trap();
     Assert.AreEqual(_tp.Switch, true);
 }
Esempio n. 48
0
 public void EmptySlot()
 {
     this.Trap = null;
 }
Esempio n. 49
0
    IEnumerator PrepareSpell(string spellType, Spell spell, Tower tower, Trap trap, TowerWizard towerWizard, GameObject bulletPrefab, List <TowerWizard> atTowers)
    {
        Wizard.StopCasting = true;
        ui.SetPrepareIcon(spell.spellID);
        float time  = spell.prepareTime;
        float perc  = Time.deltaTime / time * 100;
        float value = 100;;

        while (time > 0)
        {
            ui.SetPrepareValue(value);
            time  -= Time.deltaTime;
            value -= perc;
            yield return(null);
        }
        ui.SetPrepareValue(0);

        if (spellType.Equals(Constants.ATTACK))
        {
            for (int i = 0; i < attackTowers.Count; i++)
            {
                attackTowers [i].Attack(spell.damage, spell.school, spell.target, bulletPrefab);
            }
        }
        else if (spellType.Equals(Constants.SLOW))
        {
            towerWizard.SlowEnemyMoving(spell.school, spell.target);
        }
        else if (spellType.Equals(Constants.HEAL))
        {
            if (tower)
            {
                float healPoints = Constants.TOWER_HEAL_POINTS;
                tower.HealTower(healPoints);
            }
            else
            {
                PrintMessage("Too late");
            }
        }

        else if (spellType.Equals(Constants.RETURN_TOWER))
        {
            if (tower)
            {
                wizard.ManaRecover(tower.cost * PlayerStats.GetPlayerManaReturn() * tower.hp_norm);
                print("Return " + (tower.cost * PlayerStats.GetPlayerManaReturn() * tower.hp_norm));
                tower.TowerDeath();
            }
            else
            {
                PrintMessage("No target");
            }
        }

        else if (spellType.Equals(Constants.RETURN_TRAP))
        {
            if (trap)
            {
                wizard.ManaRecover(trap.cost * PlayerStats.GetPlayerManaReturn());
                print("Return " + (trap.cost * PlayerStats.GetPlayerManaReturn()));
                trap.TowerDeath();
            }
            else
            {
                PrintMessage("No target");
            }
        }
        EndCasting();
    }
Esempio n. 50
0
    public void AddTrap(Trap trap)
    {
        if (allTraps == null)
            allTraps = new List<Trap>();

        allTraps.Add(trap);
    }
Esempio n. 51
0
        public void UseSkill(Aggregate playerType, SkillType skillType, int rank, uint userID)
        {
            #region Global Variables

            uint eid;
            Random random = new Random();

            #endregion

            #region Check Cool Down

            //make sure the user isn't cooling down from a previous use
            foreach (CoolDown cd in _game.CoolDownComponent.All)
            {
                if (cd.Type == skillType && cd.UserID == userID)
                    return;
            }

            #endregion

            switch (playerType)
            {
                #region Checking Player Type

                #region Cyborg

                case Aggregate.CyborgPlayer:

                    #region Race Variables

                    #endregion

                    switch (skillType)
                    {
                        #region Checking Skill Type

                        case SkillType.EnergyShield:

                            #region Skill Variables
                            TimedEffect timedEffectShield;
                            Buff buffEffectShield;
                            float effectDurationShield;
                            uint targetIDShield;
                            int damageDecreaseShield;
                            int healShield;
                            HealOverTime hotShield;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 1;
                                    effectDurationShield = 5;
                                    damageDecreaseShield = 10;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }

                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 1;
                                    effectDurationShield = 5;
                                    damageDecreaseShield = 12;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 2;
                                    effectDurationShield = 6;
                                    damageDecreaseShield = 12;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 2;
                                    effectDurationShield = 6;
                                    damageDecreaseShield = 14;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 3;
                                    effectDurationShield = 7;
                                    damageDecreaseShield = 15;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 3;
                                    effectDurationShield = 8;
                                    damageDecreaseShield = 16;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 4;
                                    effectDurationShield = 17;
                                    damageDecreaseShield = 9;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 4;
                                    effectDurationShield = 10;
                                    damageDecreaseShield = 18;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 5;
                                    effectDurationShield = 10;
                                    damageDecreaseShield = 20;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetIDShield = GetPlayerID();
                                    healShield = 5;
                                    effectDurationShield = 10;
                                    damageDecreaseShield = 25;

                                    foreach (Player player in _game.PlayerComponent.All)
                                    {
                                        targetIDShield = player.EntityID;
                                        timedEffectShield = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDurationShield,
                                            TimeLeft = effectDurationShield,
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffectShield);

                                        hotShield = new HealOverTime()
                                        {
                                            EntityID = eid,
                                            AmountPerTick = healShield,
                                            TickTime = 1
                                        };
                                        _game.HealOverTimeComponent.Add(eid, hotShield);

                                        buffEffectShield = new Buff()
                                        {
                                            EntityID = eid,
                                            TargetID = targetIDShield,
                                            DefenseMelee = damageDecreaseShield,
                                            DefenseRanged = damageDecreaseShield
                                        };
                                        _game.BuffComponent.Add(eid, buffEffectShield);
                                    }
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.Defibrillate:

                            #region Skill Variables

                            TimedEffect timedEffect;
                            float effectDuration;

                            Buff buffEffect;
                            uint targetID;
                            int speedIncrease;
                            int AttackSpeedIncrease;

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    effectDuration = 3;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 150;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    effectDuration = 3;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 200;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    effectDuration = 4;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 200;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    effectDuration = 4;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 250;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    effectDuration = 5;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 250;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    effectDuration = 5;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 300;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    effectDuration = 5;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 300;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    effectDuration = 6;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 300;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    effectDuration = 6;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 350;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    effectDuration = 8;
                                    targetID = GetPlayerID();
                                    speedIncrease = 200;
                                    AttackSpeedIncrease = 400;

                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDuration,
                                        TimeLeft = effectDuration,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    buffEffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackSpeed = AttackSpeedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffect);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.Nanobots:

                            #region Skill Variables
                            TimedEffect timedEffectNano;
                            float effectDurationNano;

                            DirectHeal directheal;
                            uint targetIDNano;
                            int heal;

                            HealOverTime hot;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 5;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 8;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 10;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 12;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 14;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal); eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 16;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 18;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 20;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 25;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetIDNano = GetPlayerID();
                                    heal = 25;
                                    effectDurationNano = 10;

                                    directheal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        Amount = heal
                                    };
                                    _game.DirectHealComponent.Add(eid, directheal);

                                    timedEffectNano = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationNano,
                                        TimeLeft = effectDurationNano,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectNano);

                                    hot = new HealOverTime()
                                    {
                                        EntityID = eid,
                                        AmountPerTick = 1,
                                        TickTime = 2
                                    };
                                    _game.HealOverTimeComponent.Add(eid, hot);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.TargettingUpgrade:

                            #region Skill Variables

                            Buff buffEffectTarget;
                            int WeaponIncrease;

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 120;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 145;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 130;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 135;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 145;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 160;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 175;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 200;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 225;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    WeaponIncrease = 250;
                                    buffEffectTarget = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponStrength = WeaponIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectTarget);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.RepulsorArm:

                            #region Skill Variables
                            InstantEffect instantEffectRepulse;
                            uint eid_2Repulse;
                            uint targetIDRepulse;

                            KnockBack knockBackEffectRepulse;
                            Vector2 originRepulse;
                            float distanceRepulse;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetIDRepulse = GetPlayerID();
                                    eid_2Repulse = Entity.NextEntity();
                                    originRepulse = _game.PositionComponent[targetIDRepulse].Center;
                                    distanceRepulse = 100;

                                    instantEffectRepulse = new InstantEffect()
                                    {
                                        EntityID = eid_2Repulse,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Repulse, instantEffectRepulse);

                                    knockBackEffectRepulse = new KnockBack()
                                    {
                                        EntityID = eid_2Repulse,
                                        Origin = originRepulse,
                                        Distance = distanceRepulse,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Repulse, knockBackEffectRepulse);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.EnergyShot:

                            #region Skill Variables
                            DirectDamage DirectDamageShot;
                            InstantEffect instantEffectShot;
                            int shotDamage;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    shotDamage = 5;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);

                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    shotDamage = 10;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    shotDamage = 15;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    shotDamage = 20;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    shotDamage = 25;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    shotDamage = 30;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    shotDamage = 35;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    shotDamage = 38;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    shotDamage = 40;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    shotDamage = 45;

                                    instantEffectShot = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffectShot);

                                    DirectDamageShot = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = shotDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, DirectDamageShot);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.AlloyBody:

                            #region Skill Variables

                            Buff buffEffectAlloy;
                            int damageDecrease;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 5;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 10;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 12;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 14;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 16;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 18;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 20;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 26;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 32;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    damageDecrease = 40;
                                    buffEffectAlloy = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        DefenseMelee = damageDecrease,
                                        DefenseRanged = damageDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectAlloy);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.CyberneticSlam:

                            #region Skill Variables
                            InstantEffect instantEffectSlam;
                            uint eid_2Slam;
                            uint targetIDSlam;

                            DirectDamage DirectDamageSlam;
                            int slamDamage;

                            KnockBack knockBackEffectSlam;
                            Vector2 originSlam;
                            float distanceSlam;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 40;
                                    slamDamage = 5;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 60;
                                    slamDamage = 10;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 80;
                                    slamDamage = 15;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 100;
                                    slamDamage = 20;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 120;
                                    slamDamage = 25;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 140;
                                    slamDamage = 30;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 160;
                                    slamDamage = 35;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 180;
                                    slamDamage = 40;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 200;
                                    slamDamage = 45;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetIDSlam = GetPlayerID();
                                    eid_2Slam = Entity.NextEntity();
                                    originSlam = _game.PositionComponent[targetIDSlam].Center;
                                    distanceSlam = 220;
                                    slamDamage = 50;

                                    instantEffectSlam = new InstantEffect()
                                    {
                                        EntityID = eid_2Slam,
                                    };
                                    _game.InstantEffectComponent.Add(eid_2Slam, instantEffectSlam);

                                    DirectDamageSlam = new DirectDamage()
                                    {
                                        EntityID = eid_2Slam,
                                        Damage = slamDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid_2Slam, DirectDamageSlam);

                                    knockBackEffectSlam = new KnockBack()
                                    {
                                        EntityID = eid_2Slam,
                                        Origin = originSlam,
                                        Distance = distanceSlam,
                                    };
                                    _game.KnockBackComponent.Add(eid_2Slam, knockBackEffectSlam);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.ThrusterRush:

                            #region Skill Variables
                            TimedEffect timedEffectRush;
                            float effectDurationRush;

                            Buff buffEffectRush;
                            uint targetIDRush;
                            int speedIncreaseRush;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    effectDurationRush = 1;
                                    targetIDRush = GetPlayerID();
                                    speedIncreaseRush = 600;

                                    timedEffectRush = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = effectDurationRush,
                                        TimeLeft = effectDurationRush,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffectRush);

                                    buffEffectRush = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetIDRush,
                                        MovementSpeed = speedIncreaseRush,
                                    };
                                    _game.BuffComponent.Add(eid, buffEffectRush);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        default:
                            break;

                        #endregion
                    }
                    break;

                #endregion

                #region Gargranian

                case Aggregate.GargranianPlayer:

                    #region Race Variables

                    #endregion

                    switch (skillType)
                    {
                        #region Checking Skill Type

                        case SkillType.Teleport:
                            {
                                #region Skill Variables
                                int psiCost = (int)(_game.StatsComponent[userID].PsiBase * .05);
                                int distance = 300;
                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .5);
                                        break;

                                    case 2:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .45);
                                        break;

                                    case 3:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .40);
                                        break;

                                    case 4:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .35);
                                        break;

                                    case 5:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .30);
                                        break;

                                    case 6:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .25);
                                        break;

                                    case 7:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .20);
                                        break;

                                    case 8:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .15);
                                        break;

                                    case 9:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .10);
                                        break;

                                    case 10:
                                        psiCost += (int)(_game.StatsComponent[userID].PsiBase * .05);
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }

                                #region Logic
                                if(DrainPsiOrFatigue(userID, psiCost))
                                {
                                    //a new eid for the animation
                                    uint entityId = Entity.NextEntity();

                                    //need to get your old position and which direction you were facing
                                    Position pos = _game.PositionComponent[userID];
                                    Facing facing = (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow;

                                    //create the animation for the after effect
                                    SpriteAnimation animation = new SpriteAnimation()
                                    {
                                        EntityID = entityId,
                                        IsLooping = false,
                                        CurrentFrame = 0,
                                        CurrentAnimationRow = (int)facing,
                                        FramesPerSecond = 15,
                                        IsPlaying = true,
                                        TimePassed = 0
                                    };
                                    _game.SpriteAnimationComponent[entityId] = animation;

                                    //give the after effect a position
                                    Position animationPos = new Position()
                                    {
                                        EntityID = entityId,
                                        Center = new Vector2(pos.Center.X - 32, pos.Center.Y - 32),
                                        Radius = 0,
                                        RoomID = _game.PositionComponent[userID].RoomID
                                    };
                                    _game.PositionComponent[entityId] = animationPos;

                                    //set the spritesheet for the after effect
                                    Texture2D spriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/Invis");
                                    spriteSheet.Name = "Spritesheets/Skills/Effects/Invis";

                                    //set up the sprite for the after effect
                                    Sprite sprite = new Sprite()
                                    {
                                        EntityID = entityId,
                                        SpriteBounds = new Rectangle(0, 0, 64, 64),
                                        SpriteColor = new Color(255, 255, 255, 255),
                                        SpriteSheet = spriteSheet,
                                        UseDifferentColor = false,
                                    };
                                    _game.SpriteComponent[entityId] = sprite;

                                    //allow the after effect to expire
                                    TimedEffect timedEffect = new TimedEffect()
                                    {
                                        EntityID = entityId,
                                        TotalDuration = 1,
                                        TimeLeft = 1
                                    };
                                    _game.TimedEffectComponent.Add(entityId, timedEffect);

                                    //depending at which direction the character is facing, move them in that direction
                                    switch (facing)
                                    {
                                        case Facing.North:
                                            pos.Center.Y -= distance;
                                            if (pos.Center.Y <= 0)
                                                pos.Center.Y = 5;
                                            break;
                                        case Facing.East:
                                            pos.Center.X += distance;
                                            if (pos.Center.X >= _game.GraphicsDevice.Viewport.Width)
                                                pos.Center.X = _game.GraphicsDevice.Viewport.Width - 5;
                                            break;
                                        case Facing.South:
                                            pos.Center.Y += distance;
                                            if (pos.Center.Y >= _game.GraphicsDevice.Viewport.Height)
                                                pos.Center.Y = _game.GraphicsDevice.Viewport.Height - 5;
                                            break;
                                        case Facing.West:
                                            pos.Center.X -= distance;
                                            if (pos.Center.X <= 0)
                                                pos.Center.X = 5;
                                            break;
                                    }

                                    //update their position
                                    _game.PositionComponent[userID] = pos;

                                    //check for collision with static objects
                                    _game.CollisionSystem.CheckTeleportCollision(userID, facing);

                                }
                                #endregion
                                break;
                            }

                        case SkillType.Invisibility:
                            {
                                #region Skill Variables
                                int duration = 0;
                                int psiCost = (int)(_game.StatsComponent[userID].PsiBase * .05);
                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        duration = 2;
                                        break;

                                    case 2:
                                        duration = 4;
                                        break;

                                    case 3:
                                        duration = 6;
                                        break;

                                    case 4:
                                        duration = 8;
                                        break;

                                    case 5:
                                        duration = 10;
                                        break;

                                    case 6:
                                        duration = 12;
                                        break;

                                    case 7:
                                        duration = 14;
                                        break;

                                    case 8:
                                        duration = 16;
                                        break;

                                    case 9:
                                        duration = 18;
                                        break;

                                    case 10:
                                        duration = 20;
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                                #region Logic
                                if (DrainPsiOrFatigue(userID, psiCost))
                                {
                                    eid = Entity.NextEntity();

                                    TimedEffect timedEffect;
                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };
                                    _game.TimedEffectComponent.Add(eid, timedEffect);

                                    AgroDrop agroDrop = new AgroDrop()
                                    {
                                        EntityID = eid,
                                        PlayerID = userID
                                    };
                                    _game.AgroDropComponent.Add(eid, agroDrop);

                                    ChangeVisibility changeVisibility;
                                    changeVisibility = new ChangeVisibility()
                                    {
                                        EntityID = eid,
                                        TargetID = userID,
                                        newColor = new Color(45, 45, 45, 0)
                                    };
                                    _game.ChangeVisibilityComponent.Add(eid, changeVisibility);
                                }
                                #endregion
                                break;
                            }

                        case SkillType.Meditate:
                            {
                                #region Skill Variables
                                float psiAmount = (float)(_game.StatsComponent[userID].PsiBase * .01);
                                int duration = 5;
                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .02);
                                        break;

                                    case 2:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .04);
                                        break;

                                    case 3:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .06);
                                        break;

                                    case 4:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .08);
                                        break;

                                    case 5:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .10);
                                        break;

                                    case 6:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .12);
                                        break;

                                    case 7:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .14);
                                        break;

                                    case 8:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .16);
                                        break;

                                    case 9:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .18);
                                        break;

                                    case 10:
                                        psiAmount += (float)(_game.StatsComponent[userID].PsiBase * .2);
                                        break;

                                    default:
                                        break;
                                }
                                    #endregion

                                    #region logic

                                         uint entityId = Entity.NextEntity();

                                         TimedEffect timed = new TimedEffect()
                                         {
                                             EntityID = entityId,
                                             TimeLeft = duration,
                                             TotalDuration = duration
                                         };
                                         _game.TimedEffectComponent[entityId] = timed;

                                         PsiOrFatigueRegen regen = new PsiOrFatigueRegen()
                                         {
                                             EntityID = entityId,
                                             TargetID = userID,
                                             AmountPerTick = psiAmount,
                                             CurrentTime = 1,
                                             TickTime = 1
                                         };
                                         _game.PsiOrFatigueRegenComponent[entityId] = regen;

                                    #endregion
                                break;
                            }
                        case SkillType.PsionicSpear:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.Push:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.ImprovedPsionicSpear:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.MentalBarrier:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.WormOfGargran:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.Soothe:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        default:
                            break;

                        #endregion
                    }
                    break;

                #endregion

                #region Cultist
                //Implementation for the Cultist Player ~Nick B.
                //Useful - Regex for separating rank cases into regions
                //Replace: break;.*:Cc:Cc
                //With: break;\n#endregion\n\n#region Rank \n
                //Turns
                //      break;
                //
                //      case 2:
                //Into
                //      break;
                //      #endregion
                //
                //      #region Rank
                //      case 2:
                //
                // All thats needed is to add #region Rank 1
                // and an #endregion after case 10
                // and put in the rank numbers
                // ~Nick B.
                case Aggregate.CultistPlayer:
                    {
                        #region Race Variables
                        int test;
                        #endregion

                        switch (skillType)
                        {
                            #region Checking Skill Type

                            case SkillType.Enslave: //Projectile
                                {
                                    #region Skill Logic

                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Enslave,
                                        (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], rank, 300, userID);

                                    #endregion

                                    break;
                                }

                            case SkillType.Fear: //AOE
                                {
                                    #region Skill Variables
                                    int fearRange = 0;
                                    #endregion

                                    #region Skill Logic

                                    switch (rank)
                                    {
                                        #region Checking Rank

                                        #region Rank 1
                                        case 1:
                                            fearRange = 10;
                                            break;
                                        #endregion

                                        #region Rank 2
                                        case 2:
                                            fearRange = 13;
                                            break;
                                        #endregion

                                        #region Rank 3
                                        case 3:
                                            fearRange = 17;
                                            break;
                                        #endregion

                                        #region Rank 4
                                        case 4:
                                            fearRange = 25;
                                            break;
                                        #endregion

                                        #region Rank 5
                                        case 5:
                                            fearRange = 30;
                                            break;
                                        #endregion

                                        #region Rank 6
                                        case 6:
                                            fearRange = 37;
                                            break;
                                        #endregion

                                        #region Rank 7
                                        case 7:
                                            fearRange = 48;
                                            break;
                                        #endregion

                                        #region Rank 8
                                        case 8:
                                            fearRange = 55;
                                            break;
                                        #endregion

                                        #region Rank 9
                                        case 9:
                                            fearRange = 67;
                                            break;
                                        #endregion

                                        #region Rank 10
                                        case 10:
                                            fearRange = 90;
                                            break;
                                        #endregion

                                        default:
                                            break;
                                        #endregion
                                    }

                                    _game.SkillEntityFactory.CreateSkillAoE(SkillType.Fear,
                                        _game.PositionComponent[userID], rank, fearRange);

                                    #endregion

                                    break;
                                }

                            case SkillType.Sacrifice: //Instant
                                {
                                    #region Skill Variables

                                    InstantEffect instantEffect;
                                    DirectHeal directHeal;
                                    DirectDamage directDamage;

                                    uint enslavedEnemyID = int.MaxValue;
                                    float damageValue = 0, healValue = 0;

                                    #endregion

                                    #region Skill Logic

                                    //Getting whatever is the first monster enslaved by this player
                                    //Alternatively, could sacrifice all enslaved monsters
                                    foreach (Enslave effect in _game.EnslaveComponent.All)
                                    {
                                        if (effect.OwnerID == userID && _game.EnemyComponent.Contains(effect.TargetID))
                                        {
                                            enslavedEnemyID = effect.TargetID;
                                            break;
                                        }
                                    }

                                    if (!_game.EnemyComponent.Contains(enslavedEnemyID)) return;

                                    damageValue = _game.EnemyComponent[enslavedEnemyID].Health;

                                    switch (rank)
                                    {
                                        #region Checking Rank

                                        #region Rank 1
                                        case 1:
                                            healValue = damageValue * 0.10f; //10% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 2
                                        case 2:
                                            healValue = damageValue * 0.15f; //15% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 3
                                        case 3:
                                            healValue = damageValue * 0.20f; //20% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 4
                                        case 4:
                                            healValue = damageValue * 0.25f; //25% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 5
                                        case 5:
                                            healValue = damageValue * 0.35f; //35% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 6
                                        case 6:
                                            healValue = damageValue * 0.50f; //50% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 7
                                        case 7:
                                            healValue = damageValue * 0.80f; //80% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 8
                                        case 8:
                                            healValue = damageValue * 1.00f; //100% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 9
                                        case 9:
                                            healValue = damageValue * 1.10f; //110% of remaining life
                                            break;
                                        #endregion

                                        #region Rank 10
                                        case 10:
                                            healValue = damageValue * 0.1f; //10% of remaining life
                                            break;
                                        #endregion

                                        default:
                                            return;
                                        #endregion
                                    }

                                    //Since the only variance between ranks is the healValue variable, we can
                                    //keep it simple by just adding all the effects down here, after we've
                                    //got the variables initialized
                                    // ~Nick B.

                                    eid = Entity.NextEntity();

                                    instantEffect = new InstantEffect()
                                    {
                                        EntityID = eid,
                                        isTriggered = false,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffect);

                                    directDamage = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        TargetID = enslavedEnemyID,
                                        Damage = damageValue,
                                    };
                                    _game.DirectDamageComponent.Add(eid, directDamage);

                                    directHeal = new DirectHeal()
                                    {
                                        EntityID = eid,
                                        TargetID = userID,
                                        Amount = healValue,
                                    };
                                    _game.DirectHealComponent.Add(eid, directHeal);

                                    #endregion

                                    break;
                                }

                            case SkillType.PsionicSpear: //Projectile
                                {
                                    #region Skill Logic

                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.PsionicSpear,
                                        (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], rank, 300, userID);

                                    #endregion

                                    break;
                                }

                            case SkillType.Taint: //Projectile
                                {
                                    #region Skill Logic

                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Taint,
                                        (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], rank, 300, userID);

                                    #endregion

                                    break;
                                }

                            case SkillType.Rot: //Projectile
                                {
                                    #region Skill Logic

                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.Rot,
                                        (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], rank, 300, userID);

                                    #endregion

                                    break;
                                }

                            case SkillType.Push: //AOE
                                {
                                    #region Skill Variables
                                    int pushRange = 0;
                                    #endregion

                                    #region Skill Logic

                                    switch (rank)
                                    {
                                        #region Checking Rank

                                        #region Rank 1
                                        case 1:
                                            pushRange = 15;
                                            break;
                                        #endregion

                                        #region Rank 2
                                        case 2:
                                            pushRange = 20;
                                            break;
                                        #endregion

                                        #region Rank 3
                                        case 3:
                                            pushRange = 24;
                                            break;
                                        #endregion

                                        #region Rank 4
                                        case 4:
                                            pushRange = 30;
                                            break;
                                        #endregion

                                        #region Rank 5
                                        case 5:
                                            pushRange = 45;
                                            break;
                                        #endregion

                                        #region Rank 6
                                        case 6:
                                            pushRange = 60;
                                            break;
                                        #endregion

                                        #region Rank 7
                                        case 7:
                                            pushRange = 85;
                                            break;
                                        #endregion

                                        #region Rank 8
                                        case 8:
                                            pushRange = 100;
                                            break;
                                        #endregion

                                        #region Rank 9
                                        case 9:
                                            pushRange = 125;
                                            break;
                                        #endregion

                                        #region Rank 10
                                        case 10:
                                            pushRange = 150;
                                            break;
                                        #endregion

                                        default:
                                            break;
                                        #endregion
                                    }

                                    _game.SkillEntityFactory.CreateSkillAoE(SkillType.Push,
                                        _game.PositionComponent[userID], rank, pushRange);

                                    #endregion

                                    break;
                                }

                            case SkillType.Lightning: //Instant
                                {
                                    #region Skill Variables

                                    InstantEffect instantEffect;
                                    DirectDamage directDamage;

                                    uint eid_2;
                                    TimedEffect timedEffect;
                                    Stun stun;

                                    Random damageMod = new Random();

                                    Position evalPosition;
                                    uint tempEnemyID;
                                    List<uint> ignoreList = new List<uint>();
                                    int chainNumber = 0;
                                    float duration = 0;
                                    int damageValue = 0;
                                    float maxChainDistance = 0;

                                    #endregion

                                    #region Skill Logic
                                    //No need to continue if we can't even get the position of the player
                                    //which means there will need to be some bugs to iron out
                                    if (!_game.PositionComponent.Contains(userID)) return;

                                    evalPosition = _game.PositionComponent[userID];

                                    switch (rank)
                                    {
                                        #region Checking Rank

                                        #region Rank 1
                                        case 1:
                                            chainNumber = 1; //Chains through 1 enemy
                                            duration = 2; //Duration of 2 seconds
                                            damageValue = 2 + damageMod.Next(4); //Damage between 2 and 5
                                            maxChainDistance = 10; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 2
                                        case 2:
                                            chainNumber = 1; //Chains through 1 enemy
                                            duration = 3; //Duration of 3 seconds
                                            damageValue = 4 + damageMod.Next(5); //Damage between 4 and 8
                                            maxChainDistance = 15; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 3
                                        case 3:
                                            chainNumber = 2; //Chains through 2 enemies
                                            duration = 3; //Duration of 3 seconds
                                            damageValue = 6 + damageMod.Next(5); //Damage between 6 and 10
                                            maxChainDistance = 15; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 4
                                        case 4:
                                            chainNumber = 2; //Chains through 2 enemies
                                            duration = 4; //Duration of 4 seconds
                                            damageValue = 10 + damageMod.Next(3); //Damage between 10 and 12
                                            maxChainDistance = 18; //Biggest gap an arc with span
                                            break;
                                        #endregion

                                        #region Rank 5
                                        case 5:
                                            chainNumber = 3; //Chains through 3 enemies
                                            duration = 5; //Duration of 5 seconds
                                            damageValue = 13 + damageMod.Next(3); //Damage between 13 and 15
                                            maxChainDistance = 21; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 6
                                        case 6:
                                            chainNumber = 3; //Chains through 3 enemies
                                            duration = 5; //Duration of 5 seconds
                                            damageValue = 17 + damageMod.Next(4); //Damage between 17 and 20
                                            maxChainDistance = 26; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 7
                                        case 7:
                                            chainNumber = 4; //Chains through 4 enemies
                                            duration = 7; //Duration of 7 seconds
                                            damageValue = 22 + damageMod.Next(6); //Damage between 22 and 27
                                            maxChainDistance = 30; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 8
                                        case 8:
                                            chainNumber = 4; //Chains through 4 enemies
                                            duration = 7; //Duration of 7 seconds
                                            damageValue = 30 + damageMod.Next(11); //Damage between 30 and 40
                                            maxChainDistance = 38; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 9
                                        case 9:
                                            chainNumber = 5; //Chains through 5 enemies
                                            duration = 7; //Duration of 7 seconds
                                            damageValue = 35 + damageMod.Next(13); //Damage between 35 and 47
                                            maxChainDistance = 45; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        #region Rank 10
                                        case 10:
                                            chainNumber = 6; //Chains through 6 enemies
                                            duration = 10; //Duration of 10 seconds
                                            damageValue = 50 + damageMod.Next(16); //Damage between 50 and 65
                                            maxChainDistance = 50; //Biggest gap an arc will span
                                            break;
                                        #endregion

                                        default:
                                            return;
                                        #endregion
                                    }

                                    eid = Entity.NextEntity();
                                    instantEffect = new InstantEffect()
                                    {
                                        EntityID = eid,
                                        isTriggered = false,
                                    };
                                    _game.InstantEffectComponent.Add(eid, instantEffect);

                                    eid_2 = Entity.NextEntity();
                                    timedEffect = new TimedEffect()
                                    {
                                        EntityID = eid_2,
                                        TotalDuration = duration,
                                        TimeLeft = duration,
                                    };

                                    for (int x = 0; x < chainNumber; x++)
                                    {
                                        tempEnemyID = _game.CollisionSystem.GetClosestEnemy(evalPosition, ignoreList, maxChainDistance);

                                        //No need to continue, no enemy is close enough or no other enemies exist
                                        if (!_game.EnemyComponent.Contains(tempEnemyID)) break;

                                        //Add the enemy we just chained to to the ignore list, we don't want
                                        //to chain to them again
                                        ignoreList.Add(tempEnemyID);

                                        //This will be an instant effect, so we'll use eid here
                                        directDamage = new DirectDamage()
                                        {
                                            EntityID = eid,
                                            TargetID = tempEnemyID,
                                            Damage = damageValue,
                                        };
                                        _game.DirectDamageComponent.Add(eid, directDamage);

                                        //This will be a timed effect, so we'll need eid_2 here
                                        stun = new Stun()
                                        {
                                            EntityID = eid_2,
                                            TargetID = tempEnemyID,
                                            Type = StunType.CantBreak,
                                        };
                                        _game.StunComponent.Add(eid_2, stun);
                                    }

                                    #endregion

                                    break;
                                }

                            case SkillType.Malice: //AOE
                                {
                                    #region Skill Variables
                                    int meterConversion = 75;
                                    int maliceRange = 0;
                                    #endregion

                                    #region Skill Logic

                                    switch (rank)
                                    {
                                        #region Checking Rank

                                        #region Rank 1
                                        case 1:
                                            maliceRange = 2;
                                            break;
                                        #endregion

                                        #region Rank 2
                                        case 2:
                                            maliceRange = 2;
                                            break;
                                        #endregion

                                        #region Rank 3
                                        case 3:
                                            maliceRange = 3;
                                            break;
                                        #endregion

                                        #region Rank 4
                                        case 4:
                                            maliceRange = 3;
                                            break;
                                        #endregion

                                        #region Rank 5
                                        case 5:
                                            maliceRange = 4;
                                            break;
                                        #endregion

                                        #region Rank 6
                                        case 6:
                                            maliceRange = 5;
                                            break;
                                        #endregion

                                        #region Rank 7
                                        case 7:
                                            maliceRange = 5;
                                            break;
                                        #endregion

                                        #region Rank 8
                                        case 8:
                                            maliceRange = 6;
                                            break;
                                        #endregion

                                        #region Rank 9
                                        case 9:
                                            maliceRange = 6;
                                            break;
                                        #endregion

                                        #region Rank 10
                                        case 10:
                                            maliceRange = 6;
                                            break;
                                        #endregion

                                        default:
                                            break;
                                        #endregion
                                    }

                                    _game.SkillEntityFactory.CreateSkillAoE(SkillType.Malice,
                                        _game.PositionComponent[userID], rank, maliceRange * meterConversion);

                                    #endregion

                                    break;
                                }

                            default:
                                {
                                    break;
                                }

                            #endregion
                        }
                        break;
                    }

                #endregion

                #region Vermis

                case Aggregate.ZombiePlayer:
                    CoolDown coolDown;
                    TimedEffect timeEffect;
                    Buff buff;
                    #region Race Variables

                    #endregion

                    switch (skillType)
                    {
                        #region Checking Skill Type

                        case SkillType.ThrownBlades:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], 1, 300, userID);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 2, 300, userID);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 3, 300, userID);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 4, 300, userID);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 5, 300, userID);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 6, 300, userID);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 7, 300, userID);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 8, 300, userID);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 9, 300, userID);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.ThrownBlades,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.ThrownBlades, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 10, 300, userID);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.FrenziedAttack:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID =eid,
                                        TimeLeft = 10,
                                         TotalDuration=10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 100,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 10,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 10,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID =eid,
                                        TimeLeft = 10,
                                         TotalDuration=10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 120,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 15,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 15,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 12,
                                        TimeLeft = 12,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 12,
                                        TotalDuration = 12,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 120,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 15,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 15,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 140,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 20,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 20,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;
                                case 5:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 140,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 20,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 20,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 140,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 20,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 20,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 160,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 25,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 25,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 160,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 25,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 25,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 180,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 30,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 30,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 20,
                                        TimeLeft = 20,
                                        Type = SkillType.FrenziedAttack,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 20,
                                        TotalDuration = 20,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 200,
                                        DefenseMelee = 0,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 35,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = true,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 35,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.CausticWeapons:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.CausticWeapons,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.MeatShield:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 10,
                                        TotalDuration = 10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 1,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -6,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 10,
                                        TotalDuration = 10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 1,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -5,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 12,
                                        TimeLeft = 12,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 12,
                                        TotalDuration = 12,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 2,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -5,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 2,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -4,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;
                                case 5:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 3,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -4,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 3,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -3,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 4,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -3,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 4,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -2,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 5,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = true,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = -2,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 20,
                                        TimeLeft = 20,
                                        Type = SkillType.MeatShield,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 20,
                                        TotalDuration = 20,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = 0,
                                        DefenseMelee = 0,
                                        DefenseRanged = 7,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = false,
                                        isPercentDefenseRanged = true,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength =- 1,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.HardenedBody:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 10,
                                        TotalDuration = 10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -100,
                                        DefenseMelee = 1,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength =0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 10,
                                        TotalDuration = 10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -90,
                                        DefenseMelee = 1,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength =0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 12,
                                        TimeLeft = 12,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 12,
                                        TotalDuration = 12,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -90,
                                        DefenseMelee = 2,
                                        DefenseRanged =0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -80,
                                        DefenseMelee = 2,
                                        DefenseRanged = 2,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;
                                case 5:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 14,
                                        TimeLeft = 14,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -80,
                                        DefenseMelee = 3,
                                        DefenseRanged = 2,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -70,
                                        DefenseMelee = 3,
                                        DefenseRanged = 3,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 16,
                                        TimeLeft = 16,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -70,
                                        DefenseMelee = 4,
                                        DefenseRanged = 4,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -60,
                                        DefenseMelee = 4,
                                        DefenseRanged = 4,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 18,
                                        TimeLeft = 18,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -60,
                                        DefenseMelee = 5,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = false,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed =true,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();

                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 20,
                                        TimeLeft = 20,
                                        Type = SkillType.HardenedBody,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    timeEffect = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 20,
                                        TotalDuration = 20,
                                    };
                                    _game.TimedEffectComponent.Add(eid, timeEffect);
                                    buff = new Buff()
                                    {
                                        EntityID = eid,
                                        MovementSpeed = -50,
                                        DefenseMelee = 7,
                                        DefenseRanged = 0,
                                        AttackMelee = 0,
                                        AttackRanged = 0,
                                        AttackSpeed = 00,
                                        isPercentAttackMelee = false,
                                        isPercentAttackRanged = false,
                                        isPercentAttackSpeed = true,
                                        isPercentDefenseMelee = true,
                                        isPercentDefenseRanged = false,
                                        isPercentFatigue = false,
                                        isPercentHealth = false,
                                        isPercentMovementSpeed = false,
                                        Fatigue = 0,
                                        Health = 0,
                                        isPercentPsi = false,
                                        isPercentResistPoison = false,
                                        isPercentWeaponAccuracy = false,
                                        isPercentWeaponSpeed = false,
                                        isPercentWeaponStrength = false,
                                        Psi = 0,
                                        ResistPoison = 0,
                                        TargetID = userID,
                                        WeaponAccuracy = 0,
                                        WeaponSpeed = 0,
                                        WeaponStrength = 0,
                                    };
                                    _game.BuffComponent.Add(eid, buff);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.Regeneration:

                            #region Skill Variables
                            HealOverTime HoT;
                            TimedEffect time;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 1,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 10,
                                        TotalDuration = 10,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 1,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 12,
                                        TotalDuration = 12,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 12,
                                        TimeLeft = 12,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 12,
                                        TimeLeft = 12,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 1,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 12,
                                        TotalDuration = 12,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);

                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 2,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 3,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 14,
                                        TotalDuration = 14,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 3,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 4,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 16,
                                        TotalDuration = 16,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 4,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 18,
                                        TotalDuration = 18,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 10,
                                        TimeLeft = 10,
                                        Type = SkillType.Regeneration,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    HoT = new HealOverTime()
                                    {
                                        AmountPerTick = 5,
                                        CurrentStack = 1,
                                        CurrentTime = 0,
                                        EntityID = eid,
                                        MaxStack = 1,
                                        TargetID = userID,
                                        TickTime = 1,
                                    };
                                    _game.HealOverTimeComponent.Add(eid, HoT);

                                    time = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TimeLeft = 20,
                                        TotalDuration = 20,
                                    };
                                    _game.TimedEffectComponent.Add(eid, time);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.BenignParasite:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 1, 300, userID);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 2, 300, userID);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 3, 300, userID);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 4, 300, userID);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 5, 300, userID);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 6, 300, userID);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 7, 300, userID);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 8, 300, userID);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                        _game.PositionComponent[userID], 9, 300, userID);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.BenignParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.BenignParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 10, 300, userID);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.MaliciousParasite:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 1, 300, userID);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 2, 300, userID);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 3, 300, userID);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 4, 300, userID);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 5, 300, userID);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 6, 300, userID);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 7, 300, userID);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 8, 300, userID);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 9, 300, userID);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MaliciousParasite,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MaliciousParasite, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 10, 300, userID);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        case SkillType.MindlessParasites:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 1, 300, userID);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 2, 300, userID);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 3, 300, userID);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 4, 300, userID);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 5, 300, userID);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 6, 300, userID);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 7, 300, userID);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 8, 300, userID);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 9, 300, userID);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    coolDown = new CoolDown()
                                    {
                                        EntityID = eid,
                                        MaxTime = 1,
                                        TimeLeft = 1,
                                        Type = SkillType.MindlessParasites,
                                        UserID = userID,
                                    };
                                    _game.CoolDownComponent.Add(eid, coolDown);
                                    _game.SkillEntityFactory.CreateSkillProjectile(SkillType.MindlessParasites, (Facing)_game.SpriteAnimationComponent[userID].CurrentAnimationRow,
                                       _game.PositionComponent[userID], 10, 300, userID);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;

                        default:
                            break;

                        #endregion
                    }
                    break;

                #endregion

                #region Earthian

                //Earthian Skills done by Andrew Bellinder
                case Aggregate.EarthianPlayer:
                    #region Race Variables

                    #endregion

                    switch (skillType)
                    {
                        #region Checking Skill Type

                        #region Turret

                        case SkillType.Turret:
                            {

                                #region Skill Variables
                                Turret turret;
                                TimedEffect timedEffect;
                                float effectDuration;
                                Sprite sprite;
                                Position turretPosition;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 3;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 100,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);

                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 4;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 100,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);

                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 150,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 6;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 200,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 7;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 250,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 8;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 300,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 9;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 350,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 10;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 400,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 11;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 450,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 12;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        turretPosition = _game.PositionComponent[GetPlayerID()];
                                        turret = new Turret()
                                        {
                                            EntityID = eid,
                                            position = turretPosition,
                                            range = 500,
                                        };
                                        _game.TurretComponent.Add(eid, turret);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(11, 49, 37, 63),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, turret.position);
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Trap

                        case SkillType.Trap:
                            {

                                #region Skill Variables

                                TimedEffect timedEffect;
                                float effectDuration;
                                Trap trap;
                                Sprite sprite;
                                Position trapPosition;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 3;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 20,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 4;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 20,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 4;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 30,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 4;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 30,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 40,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 40,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 6;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 50,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 6;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 50,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 6;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 60,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 7;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        trapPosition = _game.PositionComponent[GetPlayerID()];
                                        trap = new Trap()
                                        {
                                            EntityID = eid,
                                            position = trapPosition,
                                            isSet = false,
                                            range = 60,
                                            duration = effectDuration,
                                        };
                                        _game.TrapComponent.Add(eid, trap);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                            SpriteBounds = new Rectangle(0, 10, 69, 42),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, trap.position);
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Exploding Droids

                        case SkillType.ExplodingDroids:
                            {
                                if (_game.EnemyComponent.All.Count() > 0)
                                {
                                    #region Skill Variables

                                    TimedEffect timedEffect;
                                    float effectDuration;

                                    Movement movement;
                                    float droidSpeed;

                                    ExplodingDroid explodingDroid;
                                    Sprite sprite;

                                    Position droidPosition;

                                    Collideable collideable;

                                    #endregion

                                    switch (rank)
                                    {
                                        #region Checking Rank
                                        case 1:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 110;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 32;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 2:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 115;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 35;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 3:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 120;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 40;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 4:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 125;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 45;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 5:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 130;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 50;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 6:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 135;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 55;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 7:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 140;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 60;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 8:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 145;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 65;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 9:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 150;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 70;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        case 10:
                                            eid = Entity.NextEntity();
                                            effectDuration = 6;
                                            droidSpeed = 155;

                                            timedEffect = new TimedEffect()
                                            {
                                                EntityID = eid,
                                                TotalDuration = effectDuration,
                                                TimeLeft = effectDuration
                                            };
                                            _game.TimedEffectComponent.Add(eid, timedEffect);

                                            movement = new Movement()
                                            {
                                                EntityID = eid,
                                                Speed = droidSpeed,
                                            };
                                            _game.MovementComponent.Add(eid, movement);

                                            droidPosition = _game.PositionComponent[GetPlayerID()];
                                            droidPosition.Radius = 75;
                                            explodingDroid = new ExplodingDroid()
                                            {
                                                EntityID = eid,
                                                position = droidPosition,
                                                hasEnemy = false,
                                            };
                                            _game.ExplodingDroidComponent.Add(eid, explodingDroid);

                                            sprite = new Sprite()
                                            {
                                                EntityID = eid,
                                                SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/EngineeringOffense"),
                                                SpriteBounds = new Rectangle(51, 45, 71, 82),
                                            };
                                            _game.SpriteComponent.Add(eid, sprite);

                                            collideable = new Collideable()
                                            {
                                                EntityID = eid,
                                                RoomID = droidPosition.RoomID,
                                                Bounds = new CircleBounds(droidPosition.Center, droidPosition.Radius),
                                            };
                                            _game.CollisionComponent.Add(eid, collideable);

                                            _game.PositionComponent.Add(eid, explodingDroid.position);
                                            break;

                                        default:
                                            break;
                                        #endregion
                                    }
                                }
                            }
                            break;

                        #endregion

                        #region Healing Station

                        case SkillType.HealingStation:
                            {

                                #region Skill Variables

                                HealingStation healingStation;
                                Sprite sprite;
                                Position stationPosition;

                                Collideable collideable;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 10,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 15,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 20,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 25,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 30,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 35,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 40,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 45,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 50,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();

                                        stationPosition = _game.PositionComponent[GetPlayerID()];

                                        healingStation = new HealingStation()
                                        {
                                            EntityID = eid,
                                            position = stationPosition,
                                            healthAvailable = 60,

                                        };
                                        _game.HealingStationComponent.Add(eid, healingStation);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = stationPosition.RoomID,
                                            Bounds = new CircleBounds(stationPosition.Center, stationPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Turret"),
                                            SpriteBounds = new Rectangle(0, 0, 37, 28),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        _game.PositionComponent.Add(eid, stationPosition);

                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Portable Shop

                        case SkillType.PortableShop:
                            {

                                #region Skill Variables
                                TimedEffect timedEffect;
                                float effectDuration;
                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 1);
                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 7;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 9;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 9;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 11;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 13;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 15;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 17;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 20;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        _game.SkillEntityFactory.CreateSkillDeployable(SkillType.PortableShop, _game.PositionComponent[GetPlayerID()], 2);
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Portable Shield

                        case SkillType.PortableShield:
                            {

                                #region Skill Variables

                                TimedEffect timedEffect;
                                float effectDuration;

                                PortableShield portableShield;
                                Position shieldPosition;

                                Sprite sprite;
                                Collideable collideable;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 5;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition); break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 6;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 7;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 8;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 9;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 10;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 11;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 12;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 13;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 14;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        shieldPosition = _game.PositionComponent[GetPlayerID()];
                                        shieldPosition.Radius = 100;

                                        portableShield = new PortableShield()
                                        {
                                            EntityID = eid,
                                            position = shieldPosition,
                                        };
                                        _game.PortableShieldComponent.Add(eid, portableShield);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/BubbleShield"),
                                            SpriteBounds = new Rectangle(18, 34, 229, 136),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        collideable = new Collideable()
                                        {
                                            EntityID = eid,
                                            RoomID = shieldPosition.RoomID,
                                            Bounds = new CircleBounds(shieldPosition.Center, shieldPosition.Radius),
                                        };
                                        _game.CollisionComponent.Add(eid, collideable);

                                        _game.PositionComponent.Add(eid, shieldPosition);
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Motivate

                        case SkillType.Motivate:
                            {

                                #region Skill Variables

                                TimedEffect timedEffect;
                                float effectDuration;

                                Buff buffEffect;

                                Sprite sprite;
                                Position motivatePosition;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank

                                    #region Rank 1

                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 5,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }

                                        break;

                                    #endregion

                                    #region Rank 2

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 10,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 3

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 15,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 4

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 20,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 5

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 25,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 6

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 30,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 7

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 35,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 8

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 40,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 9

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 45,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    #region Rank 10

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/bubble"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        motivatePosition = _game.PositionComponent[GetPlayerID()];
                                        motivatePosition.Center.X += 40;
                                        motivatePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, motivatePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                Health = 50,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    #endregion

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Fall Back

                        case SkillType.FallBack:
                            {
                                #region Skill Variables

                                TimedEffect timedEffect;
                                float effectDuration;

                                Buff buffEffect;

                                Sprite sprite;
                                Position fallBackPosition;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 1,
                                                AttackMelee = -1,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }

                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 2,
                                                AttackMelee = -1,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }

                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 3,
                                                AttackMelee = -2,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 4,
                                                AttackMelee = -2,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 5,
                                                AttackMelee = -3,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 6,
                                                AttackMelee = -3,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 7,
                                                AttackMelee = -4,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 8,
                                                AttackMelee = -4,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 9,
                                                AttackMelee = -5,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/fallback"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        fallBackPosition = _game.PositionComponent[GetPlayerID()];
                                        fallBackPosition.Center.X += 40;
                                        fallBackPosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, fallBackPosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = 10,
                                                AttackMelee = -5,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        #region Charge

                        case SkillType.Charge:
                            {

                                #region Skill Variables
                                TimedEffect timedEffect;
                                float effectDuration;

                                Buff buffEffect;

                                Sprite sprite;
                                Position chargePosition;

                                #endregion

                                switch (rank)
                                {
                                    #region Checking Rank
                                    case 1:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -1,
                                                AttackMelee = 1,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }

                                        break;

                                    case 2:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -1,
                                                AttackMelee = 2,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }

                                        break;

                                    case 3:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -2,
                                                AttackMelee = 3,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 4:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -2,
                                                AttackMelee = 4,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 5:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -3,
                                                AttackMelee = 5,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 6:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -3,
                                                AttackMelee = 6,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 7:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -4,
                                                AttackMelee = 7,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 8:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -4,
                                                AttackMelee = 8,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 9:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -5,
                                                AttackMelee = 9,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    case 10:
                                        eid = Entity.NextEntity();
                                        effectDuration = 0.5f;

                                        timedEffect = new TimedEffect()
                                        {
                                            EntityID = eid,
                                            TotalDuration = effectDuration,
                                            TimeLeft = effectDuration
                                        };
                                        _game.TimedEffectComponent.Add(eid, timedEffect);

                                        sprite = new Sprite()
                                        {
                                            EntityID = eid,
                                            SpriteSheet = _game.Content.Load<Texture2D>("Spritesheets/Skills/Effects/charge"),
                                            SpriteBounds = new Rectangle(0, 0, 76, 48),
                                        };
                                        _game.SpriteComponent.Add(eid, sprite);

                                        chargePosition = _game.PositionComponent[GetPlayerID()];
                                        chargePosition.Center.X += 40;
                                        chargePosition.Center.Y -= 30;

                                        _game.PositionComponent.Add(eid, chargePosition);

                                        foreach (Player player in _game.PlayerComponent.All)
                                        {
                                            eid = Entity.NextEntity();

                                            buffEffect = new Buff()
                                            {
                                                EntityID = eid,
                                                TargetID = player.EntityID,
                                                DefenseMelee = -5,
                                                AttackMelee = 10,
                                            };
                                            _game.BuffComponent.Add(eid, buffEffect);
                                        }
                                        break;

                                    default:
                                        break;
                                    #endregion
                                }
                            }
                            break;

                        #endregion

                        default:
                            break;

                        #endregion
                    }
                    break;

                #endregion

                #region Space Pirate
                //This was the part contributed by Austin Murphy
                case Aggregate.SpacePiratePlayer:

                    #region Race Variables

                    #endregion

                    switch (skillType)
                    {
                        #region Checking Skill Type

                        #region AgilityBerserker
                        case SkillType.AgilityBerserker:

                            #region Skill Variables
                            TimedEffect te1, te2;
                            int speedIncrease = 1000;
                            int attackDecrease = -50;
                            float duration, cd;
                            uint targetID;
                            Buff buffeffect;
                            int afterS = -500;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    duration = 10;
                                    cd = 55;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease,
                                        AttackMelee = attackDecrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    duration = 15;
                                    cd = 50;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    duration = 20;
                                    cd = 45;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    duration = 25;
                                    cd = 40;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    duration = 30;
                                    cd = 35;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    duration = 35;
                                    cd = 30;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    duration = 40;
                                    cd = 25;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    duration = 45;
                                    cd = 20;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    duration = 50;
                                    cd = 15;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    duration = 55;
                                    cd = 5;
                                    targetID = GetPlayerID();
                                    te1 = new TimedEffect()
                                    {
                                        EntityID = eid,
                                        TotalDuration = duration,
                                        TimeLeft = duration
                                    };

                                    _game.TimedEffectComponent.Add(eid, te1);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        MovementSpeed = speedIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region DualWielding
                        case SkillType.DualWielding:

                            #region Skill Variables
                            int offhand;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    offhand = -80;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    offhand = -74;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    offhand = -68;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    offhand = -62;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    offhand = -56;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    offhand = -50;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    offhand = -44;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    offhand = -38;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    offhand = -32;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    offhand = -20;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = offhand,
                                        AttackMelee = offhand
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region HeavyDrinker
                        case SkillType.HeavyDrinker:

                            #region Skill Variables
                            int resistance;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    resistance = 5;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    resistance = 10;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    resistance = 20;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    resistance = 30;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    resistance = 40;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    resistance = 50;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    resistance = 60;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    resistance = 70;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    resistance = 80;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    resistance = 90;
                                    targetID = GetPlayerID();

                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        ResistPoison = resistance
                                    };
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region TrickShot
                        //Trick shot has been modified greatly to fit into our prototype game.
                        case SkillType.TrickShot:

                            #region Skill Variables
                            int TSDamage;
                            DirectDamage dd;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    TSDamage = 20;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    TSDamage = 40;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    TSDamage = 60;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    TSDamage = 80;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    TSDamage = 100;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    TSDamage = 120;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    TSDamage = 140;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    TSDamage = 160;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    TSDamage = 180;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    TSDamage = 200;
                                    dd = new DirectDamage()
                                    {
                                        EntityID = eid,
                                        Damage = TSDamage
                                    };
                                    _game.DirectDamageComponent.Add(eid, dd);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region PowerShot
                        case SkillType.PowerShot:

                            #region Skill Variables
                            int PSDamageIncrease;
                            InstantEffect ie;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 10;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 20;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 30;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 40;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 50;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 60;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 70;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 80;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 90;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    PSDamageIncrease = 100;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackRanged = PSDamageIncrease
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);

                                    ie = new InstantEffect()
                                    {
                                        EntityID = eid
                                    };
                                    _game.InstantEffectComponent.Add(eid, ie);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region EagleShot
                        //EagleShot has been heavly modified to fit within our game prototype.
                        case SkillType.EagleShot:

                            #region Skill Variables
                            int ESA;
                            InstantEffect eie;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 10;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 20;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 30;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 40;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 50;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 60;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 70;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 80;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 90;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    targetID = GetPlayerID();
                                    ESA = 100;
                                    eie = new InstantEffect()
                                    {
                                        EntityID = eid,
                                    };
                                    _game.InstantEffectComponent.Add(eid, eie);
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        WeaponAccuracy = ESA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region Theft
                        case SkillType.Theft:

                            #region Skill Variables
                            ChanceToSucceed cts;
                            int prob;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    prob = 5;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    prob = 10;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    prob = 20;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    prob = 30;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    prob = 40;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    prob = 50;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    prob = 60;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    prob = 70;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    prob = 80;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    prob = 90;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region Mug
                        case SkillType.Mug:

                            #region Skill Variables
                            int mugA;
                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    prob = 5;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    prob = 10;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    prob = 20;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    prob = 30;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    prob = 40;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    prob = 50;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    prob = 60;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    prob = 70;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    prob = 80;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    prob = 90;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);

                                    mugA = -75;
                                    targetID = GetPlayerID();
                                    buffeffect = new Buff()
                                    {
                                        EntityID = eid,
                                        TargetID = targetID,
                                        AttackMelee = mugA
                                    };
                                    _game.BuffComponent.Add(eid, buffeffect);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        #region LockPick
                        case SkillType.LockPicking:

                            #region Skill Variables

                            #endregion

                            switch (rank)
                            {
                                #region Checking Rank
                                case 1:
                                    eid = Entity.NextEntity();
                                    prob = 5;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 2:
                                    eid = Entity.NextEntity();
                                    prob = 10;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 3:
                                    eid = Entity.NextEntity();
                                    prob = 20;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 4:
                                    eid = Entity.NextEntity();
                                    prob = 30;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 5:
                                    eid = Entity.NextEntity();
                                    prob = 40;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 6:
                                    eid = Entity.NextEntity();
                                    prob = 50;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 7:
                                    eid = Entity.NextEntity();
                                    prob = 60;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 8:
                                    eid = Entity.NextEntity();
                                    prob = 70;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 9:
                                    eid = Entity.NextEntity();
                                    prob = 80;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                case 10:
                                    eid = Entity.NextEntity();
                                    prob = 90;
                                    cts = new ChanceToSucceed()
                                    {
                                        EntityID = eid,
                                        SuccessRateAsPercentage = prob
                                    };
                                    _game.ChanceToSucceedComponent.Add(eid, cts);
                                    break;

                                default:
                                    break;
                                #endregion
                            }
                            break;
                        #endregion

                        default:
                            break;

                        #endregion
                    }
                    break;

                #endregion

                default:
                    break;

                #endregion
            }
        }
Esempio n. 52
0
        private static Encounter get_encounter(Map map, MapArea ma, AutoBuildData data)
        {
            object[]  objArray;
            Encounter encounter = new Encounter()
            {
                MapID     = map.ID,
                MapAreaID = ma.ID
            };

            EncounterBuilder.Build(data, encounter, false);
            if (encounter.GetDifficulty(Session.Project.Party.Level, Session.Project.Party.Size) != Difficulty.Extreme)
            {
                switch (Session.Random.Next() % 6)
                {
                case 0:
                case 1:
                case 3:
                {
                    Trap trap = DelveBuilder.select_trap(data);
                    if (trap == null)
                    {
                        break;
                    }
                    encounter.Traps.Add(trap);
                    break;
                }

                case 4:
                {
                    SkillChallenge skillChallenge = DelveBuilder.select_challenge(data);
                    if (skillChallenge == null)
                    {
                        break;
                    }
                    encounter.SkillChallenges.Add(skillChallenge);
                    break;
                }
                }
            }
            List <Rectangle> rectangles = new List <Rectangle>();

            foreach (TileData tile in map.Tiles)
            {
                Tile tile1 = Session.FindTile(tile.TileID, SearchType.Global);
                int  num   = (tile.Rotations % 2 == 0 ? tile1.Size.Width : tile1.Size.Height);
                Size size  = new Size(num, (tile.Rotations % 2 == 0 ? tile1.Size.Height : tile1.Size.Width));
                rectangles.Add(new Rectangle(tile.Location, size));
            }
            Dictionary <Point, bool> points = new Dictionary <Point, bool>();

            for (int i = ma.Region.Left; i != ma.Region.Right; i++)
            {
                for (int j = ma.Region.Top; j != ma.Region.Bottom; j++)
                {
                    Point point = new Point(i, j);
                    bool  flag  = false;
                    foreach (Rectangle rectangle in rectangles)
                    {
                        if (!rectangle.Contains(point))
                        {
                            continue;
                        }
                        flag = true;
                        break;
                    }
                    points[point] = flag;
                }
            }
            foreach (EncounterSlot slot in encounter.Slots)
            {
                ICreature creature = Session.FindCreature(slot.Card.CreatureID, SearchType.Global);
                int       size1    = Creature.GetSize(creature.Size);
                foreach (CombatData combatDatum in slot.CombatData)
                {
                    List <Point> points1 = new List <Point>();
                    for (int k = ma.Region.Left; k != ma.Region.Right; k++)
                    {
                        for (int l = ma.Region.Top; l != ma.Region.Bottom; l++)
                        {
                            Point point1 = new Point(k, l);
                            bool  flag1  = true;
                            for (int m = point1.X; m != point1.X + size1; m++)
                            {
                                for (int n = point1.Y; n != point1.Y + size1; n++)
                                {
                                    Point point2 = new Point(m, n);
                                    if (!points.ContainsKey(point2) || !points[point2])
                                    {
                                        flag1 = false;
                                    }
                                }
                            }
                            if (flag1)
                            {
                                points1.Add(point1);
                            }
                        }
                    }
                    if (points1.Count == 0)
                    {
                        continue;
                    }
                    int   num1 = Session.Random.Next() % points1.Count;
                    Point item = points1[num1];
                    combatDatum.Location = item;
                    for (int o = item.X; o != item.X + size1; o++)
                    {
                        for (int p = item.Y; p != item.Y + size1; p++)
                        {
                            points[new Point(o, p)] = false;
                        }
                    }
                }
            }
            encounter.SetStandardEncounterNotes();
            EncounterNote encounterNote = encounter.FindNote("Illumination");

            if (encounterNote != null)
            {
                switch (Session.Random.Next(6))
                {
                case 0:
                case 1:
                case 2:
                {
                    encounterNote.Contents = "The area is in bright light.";
                    break;
                }

                case 3:
                case 4:
                {
                    encounterNote.Contents = "The area is in dim light.";
                    break;
                }

                case 5:
                {
                    encounterNote.Contents = "None.";
                    break;
                }
                }
            }
            EncounterNote item1 = encounter.FindNote("Victory Conditions");

            if (item1 != null)
            {
                List <string> strs  = new List <string>();
                List <string> strs1 = new List <string>();
                bool          flag2 = false;
                int           count = 0;
                foreach (EncounterSlot encounterSlot in encounter.Slots)
                {
                    if (encounterSlot.CombatData.Count == 1 && (encounterSlot.Card.Leader || encounterSlot.Card.Flag == RoleFlag.Elite || encounterSlot.Card.Flag == RoleFlag.Solo))
                    {
                        strs1.Add(encounterSlot.CombatData[0].DisplayName);
                    }
                    ICreature creature1 = Session.FindCreature(encounterSlot.Card.CreatureID, SearchType.Global);
                    if (creature1 == null)
                    {
                        continue;
                    }
                    if (!(creature1.Role is Minion))
                    {
                        count += encounterSlot.CombatData.Count;
                    }
                    else
                    {
                        flag2 = true;
                    }
                }
                if (strs1.Count != 0)
                {
                    int    num2 = Session.Random.Next() % strs1.Count;
                    string str  = strs1[num2];
                    if (Session.Random.Next() % 12 == 0)
                    {
                        strs.Add(string.Concat("Defeat ", str, "."));
                        strs.Add(string.Concat("Capture ", str, "."));
                    }
                    if (Session.Random.Next() % 12 == 0)
                    {
                        int num3 = Session.Dice(2, 4);
                        objArray = new object[] { "The party must defeat ", str, " within ", num3, " rounds." };
                        strs.Add(string.Concat(objArray));
                    }
                    if (Session.Random.Next() % 12 == 0)
                    {
                        int num4 = Session.Dice(2, 4);
                        objArray = new object[] { "After ", num4, ", ", str, " will flee or surrender." };
                        strs.Add(string.Concat(objArray));
                    }
                    if (Session.Random.Next() % 12 == 0)
                    {
                        int num5 = 10 * Session.Dice(1, 4);
                        objArray = new object[] { "At ", num5, "% HP, ", str, " will flee or surrender." };
                        strs.Add(string.Concat(objArray));
                    }
                    if (Session.Random.Next() % 12 == 0)
                    {
                        strs.Add(string.Concat("The party must obtain an item from ", str, "."));
                    }
                    if (Session.Random.Next() % 12 == 0)
                    {
                        strs.Add(string.Concat("Defeat ", str, " by destroying a guarded object in the area."));
                    }
                    if (flag2)
                    {
                        strs.Add(string.Concat("Minions will flee or surrender when ", str, " is defeated."));
                    }
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    int num6 = 2 + Session.Random.Next() % 4;
                    strs.Add(string.Concat("The party must defeat their opponents within ", num6, " rounds."));
                }
                if (flag2 && Session.Random.Next() % 12 == 0)
                {
                    int num7 = 2 + Session.Random.Next() % 4;
                    strs.Add(string.Concat("The party must defend a certain area from ", num7, " waves of minions."));
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    int num8 = 2 + Session.Random.Next() % 4;
                    strs.Add(string.Concat("At least one character must get to a certain area and stay there for ", num8, " consecutive rounds."));
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    int num9 = 2 + Session.Random.Next() % 4;
                    strs.Add(string.Concat("The party must leave the area within ", num9, " rounds."));
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    strs.Add("The party must keep the enemy away from a certain area for the duration of the encounter.");
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    strs.Add("The party must escort an NPC safely through the encounter area.");
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    strs.Add("The party must rescue an NPC from their opponents.");
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    strs.Add("The party must avoid contact with the enemy in this area.");
                }
                if (Session.Random.Next() % 12 == 0)
                {
                    strs.Add("The party must attack and destroy a feature of the area.");
                }
                if (count > 1 && Session.Random.Next() % 12 == 0)
                {
                    int num10 = 1 + Session.Random.Next(count);
                    strs.Add(string.Concat("The party must defeat ", num10, " non-minion opponents."));
                }
                if (strs.Count != 0)
                {
                    int num11 = Session.Random.Next() % strs.Count;
                    item1.Contents = strs[num11];
                }
            }
            return(encounter);
        }
 public void RegisterTrap( Trap t )
 {
     Traps.Add( t );
 }
Esempio n. 54
0
 public CellInformation(Cell cell, bool walkable, bool fighting, bool useAI, int efficience, Trap trap, Glyph glyph)
 {
     Cell       = cell;
     Walkable   = walkable;
     Fighting   = fighting;
     UseAI      = useAI;
     Efficience = efficience;
     Trap       = trap;
     Glyph      = glyph;
 }
Esempio n. 55
0
 void Start()
 {
     trapInfo = transform.GetComponent<Trap>();
 }
Esempio n. 56
0
    public void Activate(Trap trap)
    {
        this.trap = trap;

        StartCoroutine(ActiveTime());
    }
Esempio n. 57
0
    public void ReturnMana(Spell spell, int [] cellCoord)
    {
        int cellLine = cellCoord [0];
        int cellNum  = cellCoord [1];

        print(cellLine + " " + cellNum);
        Cell    cell    = field.GetCell(cellLine, cellNum);
        Vector2 cellPos = cell.transform.position;

        if (!cell.IsEngaged)
        {
            PrintMessage("Nothing to return!");
            EndCasting();
            return;
        }
        if (spell.cost > wizard.GetManapoints())
        {
            PrintMessage("You have no mana!");
            EndCasting();
            return;
        }

        List <Tower> lineTowers     = ec.lines [cellLine].lineTowers;
        Tower        towerToDestroy = null;

        for (int i = 0; i < lineTowers.Count; i++)
        {
            Tower towerTmp = lineTowers [i];
            if (towerTmp != null)
            {
                if (towerTmp.GetCell() == field.GetCell(cellLine, cellNum))
                {
                    towerToDestroy = towerTmp;
                }
            }
        }

        if (towerToDestroy)
        {
            StartCoroutine(PrepareSpell(Constants.RETURN_TOWER, spell, towerToDestroy, null, null, null, null));
            wizard.ManaWaste(spell.cost);
            PrintMessage(spell.spellName);
            return;
        }

        List <Trap> lineTraps     = ec.lines [cellLine].lineTraps;
        Trap        trapToDestroy = null;

        for (int i = 0; i < lineTraps.Count; i++)
        {
            Trap trapTmp = lineTraps [i];
            if (trapTmp != null)
            {
                if (trapTmp.GetCell() == field.GetCell(cellLine, cellNum))
                {
                    trapToDestroy = trapTmp;
                }
            }
        }

        if (trapToDestroy)
        {
            StartCoroutine(PrepareSpell(Constants.RETURN_TRAP, spell, null, trapToDestroy, null, null, null));
            wizard.ManaWaste(spell.cost);
            PrintMessage(spell.spellName);
            return;
        }

        if (!trapToDestroy && !towerToDestroy)
        {
            PrintMessage("Bad attempt!");
            EndCasting();
        }
    }
Esempio n. 58
0
 void traTest(Trap t)
 {
     test(t);
 }
Esempio n. 59
0
    private void DoTrap(Trap trap, Camel camel)
    {
        //Debug.Log(string.Format("Camel {0} land on trap {1}", camel.name, trap.isPlusTrap ? "+" : "-"));

        if(trap.isPlusTrap)
        {
            MoveCamel(camel.name, 1);
        }
        else
        {
            MoveCamelUnder(camel.name);
        }
    }
Esempio n. 60
0
        internal override void Execute()
        {
            Level      Level      = this.Device.GameMode.Level;
            GameObject GameObject = Level.GameObjectManager.Filter.GetGameObjectById(this.Id);

            if (GameObject != null)
            {
                if (GameObject is Building)
                {
                    Building Building = (Building)GameObject;
                    if (Building.UpgradeAvailable)
                    {
                        BuildingData Data         = (BuildingData)Building.Data;
                        ResourceData ResourceData = this.UseAltResource ? Data.AltBuildResourceData(Building.GetUpgradeLevel() + 1) : Data.BuildResourceData;

                        if (ResourceData != null)
                        {
                            if (Level.Player.Resources.GetCountByData(ResourceData) >= Data.BuildCost[Building.GetUpgradeLevel() + 1])
                            {
                                if (Data.VillageType == 0 ? Level.WorkerManager.FreeWorkers > 0 : Level.WorkerManagerV2.FreeWorkers > 0)
                                {
                                    Level.Player.Resources.Remove(ResourceData, Data.BuildCost[Building.GetUpgradeLevel() + 1]);
                                    Building.StartUpgrade();

                                    if (Data.IsTownHall2)
                                    {
                                        if (Level.Player.TownHallLevel2 == 0)
                                        {
                                            foreach (var gameObject in Level.GameObjectManager.GameObjects[0][1])
                                            {
                                                Building     building2 = (Building)gameObject;
                                                BuildingData data2     = building2.BuildingData;
                                                if (building2.Locked)
                                                {
                                                    if (!data2.Locked)
                                                    {
#if DEBUG
                                                        Logging.Info(this.GetType(), $"Builder Building: Unlocking {data2.Name} with ID {gameObject.Id}");
#endif
                                                        building2.Locked = false;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                            else
                            {
                                Logging.Error(this.GetType(), "Unable to upgrade the building. The player doesn't have enough resources.");
                            }
                        }
                        else
                        {
                            Logging.Error(this.GetType(), "Unable to upgrade the building. The resource data is null");
                        }
                    }
                    else
                    {
                        Logging.Error(this.GetType(), "Unable to upgrade the building. Upgrade is not available.");
                    }
                }
                else if (GameObject is Trap)
                {
                    Trap Trap = (Trap)GameObject;
                    if (Trap.UpgradeAvailable)
                    {
                        TrapData     Data         = Trap.TrapData;
                        ResourceData ResourceData = Data.BuildResourceData;

                        if (ResourceData != null)
                        {
                            if (Level.Player.Resources.GetCountByData(ResourceData) >= Data.BuildCost[Trap.GetUpgradeLevel() + 1])
                            {
                                if (Data.VillageType == 0 ? Level.WorkerManager.FreeWorkers > 0 : Level.WorkerManagerV2.FreeWorkers > 0)
                                {
                                    Level.Player.Resources.Remove(ResourceData, Data.BuildCost[Trap.GetUpgradeLevel() + 1]);
                                    Trap.StartUpgrade();
                                }
                            }
                            else
                            {
                                Logging.Error(this.GetType(), "Unable to upgrade the Trap. The player doesn't have enough resources.");
                            }
                        }
                        else
                        {
                            Logging.Error(this.GetType(), "Unable to start upgrade the Trap. The resources data is null.");
                        }
                    }
                    else
                    {
                        Logging.Error(this.GetType(), "Unable to upgrade the building. Upgrade is not available.");
                    }
                }
                else if (GameObject is VillageObject)
                {
                    VillageObject     VillageObject = (VillageObject)GameObject;
                    VillageObjectData Data          = VillageObject.VillageObjectData;
                    ResourceData      ResourceData  = Data.BuildResourceData;

                    if (ResourceData != null)
                    {
                        if (Level.Player.Resources.GetCountByData(ResourceData) >= Data.BuildCost[VillageObject.GetUpgradeLevel() + 1])
                        {
                            if (Data.VillageType == 0 ? Level.WorkerManager.FreeWorkers > 0 : Level.WorkerManagerV2.FreeWorkers > 0)
                            {
                                Level.Player.Resources.Remove(ResourceData, Data.BuildCost[VillageObject.GetUpgradeLevel() + 1]);
                                VillageObject.StartUpgrade();
                            }
                        }
                        else
                        {
                            Logging.Error(this.GetType(), "Unable to upgrade the VillageObject. The player doesn't have enough resources.");
                        }
                    }
                    else
                    {
                        Logging.Error(this.GetType(), "Unable to start upgrade the VillageObject. The resources data is null.");
                    }
                }
                else
                {
                    Logging.Error(this.GetType(), $"Unable to determined Game Object type. Game Object type {GameObject.Type}.");
                }
            }
            else
            {
                Logging.Error(this.GetType(), "Unable to upgrade the gameObject. GameObject is null");
#if COMMAND_DEBUG
                Device.Account.Player.Debug.Dump();
#endif
            }
        }