Inheritance: MonoBehaviour
Example #1
0
 protected void AddTurret(Turret turret)
 {
     turrets.Add(turret);
     turret.GetTarget += AssignTargetToTurret;
     turret.TurretDestroyed += TurretDestroyed;
     turret.SetRotationOrigin(turret.transform.forward);
 }
	void updateCursor(){
		if (Input.GetMouseButtonDown(0)){
			Debug.Log("click");
			RaycastHit hit;
			// Construct a ray from the current touch coordinates
			Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
			if (Physics.Raycast (ray,out hit)) {
				GameObject cursorSpot = hit.collider.gameObject;
				Debug.Log(cursorSpot);
				string hitTag = cursorSpot.tag;
				if(hitTag == "tower"){
					//cursorSpot.renderer.material.color = Color.blue;
					turretIsSelected = true;
					//if(selectedTurret != null & cursorSpot!= selectedTurret){
					//	selectedTurret.renderer.material.color = Color.white;
					//}
					if(selectedTurret != null)//turns the light off of the previous turret
						selectedTurret.GetComponent<Light>().enabled = false;
					selectedTurret = cursorSpot;
					selectedTurret.GetComponent<Light>().enabled = true;//highlights the selected turret
					//selectedTurret.GetComponent<Halo>();
					selectedScript = selectedTurret.GetComponent<Turret>();
					Debug.Log("hit");
				}	
			}
		}
	}
    // Use this for initialization
    void Start()
    {
        turret = transform.parent.GetComponent<Turret>();
        Physics.IgnoreCollision(turret.collider, collider); // ignore turret collider
        Physics.IgnoreCollision(turret.GetComponentInChildren<Detector>().collider, collider); // ignore detector collider
        transform.parent = turret.transform; // attach to the turret

        originScaleInit = origin.transform.localScale;

        laserShotPosInit = transform.localPosition;
        laserShotScaleInit = transform.localScale;

        fireTime = 0;
        armTime = turret.armTime;
        fireSpeed = turret.fireSpeed;
        maxScale = turret.detectorLength/turret.halfTurretLength*originScaleInit.x + originScaleInit.x;

        if (turret.direction == Turret.Direction.up || turret.direction == Turret.Direction.down) {
            delta = new Vector3(0, 0, 1);
        } else {
            delta = new Vector3(1, 0, 0);
        }

        // set end point scale to max!
        endScaleInit = end.transform.localScale;
        end.transform.localScale += (maxScale - Vector3.Dot (endScaleInit, delta)) * delta;
        endScaleInit = end.transform.localScale;

        shootState = ShootState.alert;
    }
 public int getWeaponCount(Turret.TurretType type)
 {
     int count = 0;
     switch(type)
     {
         case Turret.TurretType.Laser:
             count =  TurretInventory[0].Count;
             break;
         case Turret.TurretType.Ion: 
             count = TurretInventory[1].Count;
             break;
         case Turret.TurretType.Railgun:
             count =  TurretInventory[2].Count;
             break;
         case Turret.TurretType.Beam:
             count =  TurretInventory[3].Count;
             break;
         case Turret.TurretType.PowerDrainer:
             count =  TurretInventory[4].Count;
             break;
         case Turret.TurretType.FireMissile:
             count =  TurretInventory[5].Count;
             break;
         case Turret.TurretType.BallisticMissile:
             count =  TurretInventory[6].Count;
             break;
         case Turret.TurretType.AOEMissile:
             count =  TurretInventory[7].Count;
             break;
     }
     return count;
 }
Example #5
0
 public void initialize(Turret.TurretType type, HPSelectButton hpb, Turret t)
 {
     Type = type;
     HPB = hpb;
     turretRef = t;
     typeReadout.Display(turretRef.getTypeString());
     updateCount();
 }
Example #6
0
 // Called when the sell button is pressed.
 public void Sell()
 {
     objectManager.gameState.playerMoney += SelectedTurret.Msrp;
     objectManager.Map.UnBlockNode(SelectedTurret.transform.position);
     Destroy(SelectedTurret.gameObject);
     SelectedTurret = null;
     transform.position = new Vector3(transform.position.x, transform.position.y - 1000, transform.position.z);
 }
	/* to test creating turrets
	  void generateTurrets(){
		Turret turret;
		Turret = ((GameObject)Instantiate(TurretPrefab, new Vector3( - Mathf.Floor(mapSize/2),1.4f,Mathf.Floor(mapSize/2)), Quaternion.Euler(new Vector3()))).GetComponent<Turret>();
		TurretList.Add(turret);
		ally.Add(turret);
	}*/


	void deselectTurret(){
		if(turretIsSelected && Input.GetKey(KeyCode.Escape)){
			selectedTurret.GetComponent<Light>().enabled = false;
			turretIsSelected = false;
			selectedScript = null;
			//selectedTurret.renderer.material.color = Color.white;
			selectedTurret = null;
		}
	}
    // Called when the sell button is pressed.
    public void Sell()
    {
        objectManager.GuiButtonMethods.PlaySellSound();

        objectManager.gameState.playerMoney += SelectedTurret.Msrp;
        objectManager.Map.UnBlockNode(SelectedTurret.transform.position);
        Destroy(SelectedTurret.gameObject);
        SelectedTurret = null;
    }
Example #9
0
	public ForceMode forceMode;					//forceMode of ecplosion



//	public float radius = 50.0F;
 //   public float power = 100.0F;


	// Use this for initialization
	void Start () 
	{
		instance = this;
		_ballColors = GameObject.Find("GameManager").GetComponent<GameController>().ballColors;



		SetFirstSootingBallColors();

	
	}
    public int getNumberAttached(Turret.TurretType type)
    {
        int count = 0;
        foreach (Turret t in PlayerController.PC.weapons)
        {
            if (t.getType() == type)
                count++;
        }
        return count;

    }
Example #11
0
    public void Reset()
    {
        T = GameObject.Find("Turret_" + turretNumber.ToString()).GetComponentInChildren<Turret>();

        if (!secondary)
        {
            GameObject instance = (GameObject)Instantiate(T.bullet);
            this.transform.renderer.material = instance.renderer.material;
            Destroy(instance);
        }
        else
        {
            GameObject instance = (GameObject)Instantiate(T.secondaryBullet);
            this.transform.renderer.material = instance.renderer.material;
            Destroy(instance);
        }
    }
Example #12
0
    protected void AssignTargetToTurret(Turret turret)
    {
        Collider[] colliders = Physics.OverlapSphere(this.transform.position, 1000);
        if (colliders.Length == 0)
        {
            return;
        }

        List<Ship> potentialTargets = new List<Ship>();

        foreach (Collider collider in colliders)
        {
            Ship ship = collider.gameObject.GetComponent<Ship>();
            if (ship != null && ship != this.GetComponent<Ship>())
            {
                if (ship.FactionID != this.factionID)
                {
                    potentialTargets.Add(ship);
                }
            }
        }

        Ship closestTarget = null;
        foreach (Ship ship in potentialTargets)
        {
            if (closestTarget == null)
            {
                closestTarget = ship;
            }
            if (Vector3.Distance(turret.transform.position, ship.transform.position) < Vector3.Distance(closestTarget.transform.position, ship.transform.position))
            {
                closestTarget = ship;
            }
        }

        if (closestTarget != null)
        {
            turret.SetTarget(closestTarget.gameObject);
        }
    }
Example #13
0
 void Start()
 {
     anim       = GetComponent <Animator>();
     turretSelf = transform.GetComponent <Turret>();
 }
Example #14
0
    public void CheckResults(bool isPlayer,Turret T)
    {
        if (GlobalVars.GameMode != "Wager Match")
        {
            if (!isPlayer)
            {

                Destroy(T.transform.parent.gameObject);
                _EnemyList.Insert(_EnemyList.IndexOf(T),null);
                _EnemyList.Remove(T);
                GlobalVars.HasPlayerLeveled(Random.Range(1,15));

                if (_EnemyList[0] == null &&_EnemyList[1] == null &&_EnemyList[2] == null &&_EnemyList[3] == null)
                {
                    GlobalVars._playerScore_Wins++;
                    GlobalVars._TempWins++;
                    EndGame(false);
                }
            }
            else
            {

                Destroy(T.transform.parent.gameObject);
                _PlayerList.Insert(_PlayerList.IndexOf(T),null);
                _PlayerList.Remove(T);

                if (_PlayerList[0] == null &&_PlayerList[1] == null &&_PlayerList[2] == null &&_PlayerList[3] == null)
                {
                    GlobalVars._playerScore_Losses++;
                    GlobalVars._TempLoss++;
                    EndGame(false);
                }
            }
        }

        else
        {
            if (!isPlayer)
            {
                _EnemyList.Remove(T);
                Destroy(T.transform.parent.gameObject);
                GlobalVars.HasPlayerLeveled(Random.Range(1,15));

                if (_EnemyList.Count == 0)
                {
                    GlobalVars._playerScore_Wins++;
                    GlobalVars._TempWins++;
                    EndGame(true);
                }
            }
            else
            {
                _PlayerList.Remove(T);
                Destroy(T.transform.parent.gameObject);

                if (_PlayerList.Count == 0)
                {
                    GlobalVars._playerScore_Losses++;
                    GlobalVars._TempLoss++;
                    EndGame(true);
                }
            }

        }
    }
Example #15
0
 void Start()
 {
     _turret = GameObject.FindObjectOfType <Turret>();
 }
Example #16
0
 public void AssignAbility(Turret _turret)
 {
 }
Example #17
0
    public override void Start()
    {
        InitScript.inGame = true;
        InitScript.totalScore = 0;
        bonusSpeed = 2f;
        score = 0;
        value1 = 0;
        value2 = 0;
        value3 = 0;
        FrameCounter = 120;
        obstacles = new List<Obstacle>();
        powerups = new List<Powerup>();
        bullets = new List<Bullet>();

        background = new Starfield(InitScript.bg1Pos,false);
        Futile.stage.AddChild(background);

        background2 = new Starfield(InitScript.bg2Pos, false);
        Futile.stage.AddChild(background2);

        bar = new EnergyBar();
        Futile.stage.AddChild(bar);

        walls = new FSprite("AwesomeWall.png");
        walls.scale = 2.0f;
        walls.x = 0;
        Futile.stage.AddChild(walls);

        //score stuffffff
        digit1 = new FSprite("0.png");
        digit1.scale = 2.0f;
        digit1.x = -159.7772f + 180;
        digit1.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit1);

        digit2 = new FSprite("0.png");
        digit2.scale = 2.0f;
        digit2.x = -159.7772f + 160;
        digit2.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit2);

        digit3 = new FSprite("0.png");
        digit3.scale = 2.0f;
        digit3.x = -159.7772f + 140;
        digit3.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit3);

        ///////

        testPlayer = new Spaceman();
        Futile.stage.AddChild(testPlayer);
        testPlayer.PlayerAlive();

        victoryFlare = new FSprite("Victory0.png");
        victoryFlare.scale = 2.0f;
        victoryFlare.x = 159.7772f - 30;
        victoryFlare.y = -Futile.screen.halfHeight + 160;
        Futile.stage.AddChild(victoryFlare);

        btnPause = new FButton("PauseButton.png");
        btnPause.x = -159.7772f + 12;
        btnPause.y = Futile.screen.halfHeight - 12;
        btnPause.scale = 2.0f;
        //btnPause.isVisible = false;
        Futile.stage.AddChild(btnPause);

        turret = new Turret();
        Futile.stage.AddChild(turret);

        laser = new LazerTurret();
        Futile.stage.AddChild(laser);

        laserActual = new Lazer();
        Futile.stage.AddChild(laserActual);

        rocket = new RocketTurret();
        Futile.stage.AddChild(rocket);

        pausedScreen = new FSprite("Paused0.png");
        pausedScreen.scale = 2.0f;
        pausedScreen.isVisible = false;
        Futile.stage.AddChild(pausedScreen);

        InitScript.blackBar1.MoveToTop();
        InitScript.blackBar2.MoveToTop();

        btnPause.SignalRelease += HandlePauseButtonRelease;
        Futile.instance.SignalUpdate += HandleUpdate;
    }
 private static bool MaxLevels(Turret turretToCheck)
 {
     return(turretToCheck.UpgradeOneLevel +
            turretToCheck.UpgradeTwoLevel +
            turretToCheck.UpgradeThreeLevel >= 3);
 }
Example #19
0
 public void addPlayerData(Turret player)
 {
     this.damage_base      = player.damage_base;
     this.attack_rate_base = player.attack_rate_base;
     this.gold             = player.gold;
 }
Example #20
0
 public TurretControls(Turret parentTurret)
 {
     this.parentTurret = parentTurret;
 }
 static BulletScript()
 {
     currentTurretTurn = Turret.LEFT;
 }
Example #22
0
 protected void TurretDestroyed(Turret turret)
 {
     turret.gameObject.SetActive(false);
 }
 /// <summary>
 /// Increases the damage for a turret
 /// </summary>
 /// <param name="turret">The turret to increase damage for</param>
 public override void AddModule(Turret turret)
 {
     turret.damage.AddModifier(percentageChange);
 }
 private void RemoveTurret(Turret t)
 {
     Turrets.Remove(t);
 }
Example #25
0
    //! Called by unity engine for rendering and handling GUI events.
    public void OnGUI()
    {
        // STYLE
        GUI.skin = GetComponent <PlayerGUI>().thisGUIskin;

        // ASPECT RATIO
        float ScreenHeight = Screen.height;
        float ScreenWidth  = Screen.width;

        if (ScreenWidth / ScreenHeight < 1.7f)
        {
            ScreenHeight = (ScreenHeight * 0.75f);
        }
        if (ScreenHeight < 700)
        {
            GUI.skin.label.fontSize = 10;
        }

        if (!playerController.stateManager.Busy() && GetComponent <MainMenu>().finishedLoading == true)
        {
            // MACHINE CONTROL GUI
            if (playerController.inventoryOpen == false && playerController.machineGUIopen == true && playerController.objectInSight != null)
            {
                GameObject obj = playerController.objectInSight;

                if (obj.GetComponent <PowerConduit>() != null)
                {
                    bool         netFlag      = false;
                    PowerConduit powerConduit = obj.GetComponent <PowerConduit>();
                    if (powerConduit.connectionFailed == false)
                    {
                        GUI.DrawTexture(guiCoordinates.FourButtonSpeedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        GUI.Label(guiCoordinates.outputLabelRect, "Range");
                        powerConduit.range = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, powerConduit.range, 6, 120);
                        if (GUI.Button(guiCoordinates.outputControlButton3Rect, "Dual Output: " + powerConduit.dualOutput))
                        {
                            if (powerConduit.dualOutput == true)
                            {
                                powerConduit.dualOutput = false;
                            }
                            else
                            {
                                powerConduit.dualOutput = true;
                            }
                            playerController.PlayButtonSound();
                        }
                        if (GUI.Button(guiCoordinates.outputControlButton4Rect, "Close"))
                        {
                            playerController.machineGUIopen = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    else
                    {
                        GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            powerConduit.connectionAttempts = 0;
                            powerConduit.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        bool rangeDeSync  = powerConduit.range != playerController.networkedConduitRange;
                        bool outputDeSync = powerConduit.dualOutput != playerController.networkedDualPower;
                        if (rangeDeSync || outputDeSync || netFlag)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = powerConduit.gameObject.transform.position;
                            updateNetworkConduitCoroutine          = StartCoroutine(net.SendPowerData(location, powerConduit.range, powerConduit.dualOutput));
                            playerController.networkedConduitRange = powerConduit.range;
                            playerController.networkedDualPower    = powerConduit.dualOutput;
                        }
                    }
                }

                if (obj.GetComponent <RailCartHub>() != null)
                {
                    bool        netFlag = false;
                    RailCartHub hub     = obj.GetComponent <RailCartHub>();
                    if (hub.connectionFailed == false)
                    {
                        if (hubStopWindowOpen == false)
                        {
                            GUI.DrawTexture(guiCoordinates.FiveButtonSpeedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                            GUI.Label(guiCoordinates.railCartHubCircuitLabelRect, "Circuit");
                            int    circuit       = hub.circuit;
                            string circuitString = GUI.TextField(guiCoordinates.railCartHubCircuitRect, circuit.ToString(), 3);
                            try
                            {
                                hub.circuit = int.Parse(circuitString);
                            }
                            catch
                            {
                                // NOOP
                            }
                            GUI.Label(guiCoordinates.outputLabelRect, "Range");
                            hub.range = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, hub.range, 6, 120);
                            if (GUI.Button(guiCoordinates.outputControlButton3Rect, "Stop Settings"))
                            {
                                hubStopWindowOpen = true;
                                playerController.PlayButtonSound();
                            }
                            if (GUI.Button(guiCoordinates.outputControlButton4Rect, "Close"))
                            {
                                playerController.machineGUIopen = false;
                                hubStopWindowOpen = false;
                                playerController.PlayButtonSound();
                            }
                        }
                        else
                        {
                            GUI.DrawTexture(guiCoordinates.FiveButtonSpeedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                            GUI.Label(guiCoordinates.longOutputLabelRect, "Stop Time");
                            if (GUI.Button(guiCoordinates.outputControlButton0Rect, "Stop: " + hub.stop))
                            {
                                if (hub.stop == true)
                                {
                                    hub.stop = false;
                                }
                                else
                                {
                                    hub.stop = true;
                                }
                                playerController.PlayButtonSound();
                            }
                            hub.stopTime = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, hub.stopTime, 0, 600);
                            if (GUI.Button(guiCoordinates.outputControlButton3Rect, "Range Settings"))
                            {
                                hubStopWindowOpen = false;
                                playerController.PlayButtonSound();
                            }
                            if (GUI.Button(guiCoordinates.outputControlButton4Rect, "Close"))
                            {
                                playerController.machineGUIopen = false;
                                hubStopWindowOpen = false;
                                playerController.PlayButtonSound();
                            }
                        }
                    }
                    else
                    {
                        GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            hub.connectionAttempts = 0;
                            hub.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        bool circuitDeSync = hub.circuit != playerController.networkedHubCircuit;
                        bool rangeDeSync   = hub.range != playerController.networkedHubRange;
                        bool stopDeSync    = hub.stop != playerController.networkedHubStop;
                        bool timeDeSync    = (int)hub.stopTime != (int)playerController.networkedHubStopTime;
                        if (circuitDeSync || rangeDeSync || stopDeSync || timeDeSync || netFlag)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = hub.gameObject.transform.position;
                            updateNetworkConduitCoroutine         = StartCoroutine(net.SendHubData(location, hub.circuit, hub.range, hub.stop, hub.stopTime));
                            playerController.networkedHubCircuit  = hub.circuit;
                            playerController.networkedHubRange    = hub.range;
                            playerController.networkedHubStop     = hub.stop;
                            playerController.networkedHubStopTime = hub.stopTime;
                        }
                    }
                }

                if (obj.GetComponent <Retriever>() != null)
                {
                    bool      netFlag   = false;
                    Retriever retriever = obj.GetComponent <Retriever>();
                    if (retriever.connectionFailed == false)
                    {
                        GUI.DrawTexture(guiCoordinates.FourButtonSpeedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        if (retriever.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            retriever.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, retriever.speed, 0, retriever.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                        if (GUI.Button(guiCoordinates.outputControlButton3Rect, "Choose Items"))
                        {
                            if (obj.GetComponent <InventoryManager>().initialized == true)
                            {
                                playerController.inventoryOpen  = true;
                                playerController.storageGUIopen = true;
                                playerController.machineGUIopen = false;
                                playerController.PlayButtonSound();
                            }
                        }
                        if (GUI.Button(guiCoordinates.outputControlButton4Rect, "Close"))
                        {
                            playerController.machineGUIopen = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    else
                    {
                        GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            retriever.connectionAttempts = 0;
                            retriever.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (retriever.speed != playerController.networkedConduitRange || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = retriever.gameObject.transform.position;
                            updateNetworkConduitCoroutine          = StartCoroutine(net.SendConduitData(location, retriever.speed));
                            playerController.networkedConduitRange = retriever.speed;
                        }
                    }
                }

                if (obj.GetComponent <AutoCrafter>() != null)
                {
                    bool        netFlag     = false;
                    AutoCrafter autoCrafter = obj.GetComponent <AutoCrafter>();
                    if (autoCrafter.connectionFailed == false)
                    {
                        GUI.DrawTexture(guiCoordinates.FourButtonSpeedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        if (autoCrafter.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            autoCrafter.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, autoCrafter.speed, 0, autoCrafter.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                        if (GUI.Button(guiCoordinates.outputControlButton3Rect, "Choose Item"))
                        {
                            if (obj.GetComponent <InventoryManager>().initialized == true)
                            {
                                playerController.inventoryOpen  = true;
                                playerController.storageGUIopen = true;
                                playerController.machineGUIopen = false;
                                playerController.PlayButtonSound();
                            }
                        }
                        if (GUI.Button(guiCoordinates.outputControlButton4Rect, "Close"))
                        {
                            playerController.machineGUIopen = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    else
                    {
                        GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            autoCrafter.connectionAttempts = 0;
                            autoCrafter.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (autoCrafter.speed != playerController.networkedConduitRange || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = autoCrafter.gameObject.transform.position;
                            updateNetworkConduitCoroutine          = StartCoroutine(net.SendConduitData(location, autoCrafter.speed));
                            playerController.networkedConduitRange = autoCrafter.speed;
                        }
                    }
                }

                if (obj.GetComponent <UniversalConduit>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    UniversalConduit conduit = obj.GetComponent <UniversalConduit>();
                    if (conduit.connectionFailed == false)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Range");
                        conduit.range = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, conduit.range, 6, 120);
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            conduit.connectionAttempts = 0;
                            conduit.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (conduit.range != playerController.networkedConduitRange || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = conduit.gameObject.transform.position;
                            updateNetworkConduitCoroutine          = StartCoroutine(net.SendConduitData(location, conduit.range));
                            playerController.networkedConduitRange = conduit.range;
                        }
                    }
                }

                if (obj.GetComponent <DarkMatterConduit>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    DarkMatterConduit conduit = obj.GetComponent <DarkMatterConduit>();
                    if (conduit.connectionFailed == false)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Range");
                        conduit.range = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, conduit.range, 6, 120);
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            conduit.connectionAttempts = 0;
                            conduit.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (conduit.range != playerController.networkedConduitRange || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = conduit.gameObject.transform.position;
                            updateNetworkConduitCoroutine          = StartCoroutine(net.SendConduitData(location, conduit.range));
                            playerController.networkedConduitRange = conduit.range;
                        }
                    }
                }

                if (obj.GetComponent <HeatExchanger>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    HeatExchanger hx = obj.GetComponent <HeatExchanger>();
                    if (hx.inputObject != null)
                    {
                        if (hx.inputObject.GetComponent <UniversalConduit>() != null)
                        {
                            if (hx.connectionFailed == false)
                            {
                                GUI.Label(guiCoordinates.outputLabelRect, "Output");
                                hx.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, hx.speed, 0, playerController.hxAmount);
                            }
                            else
                            {
                                GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                                if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                                {
                                    netFlag = true;
                                    hx.connectionAttempts = 0;
                                    hx.connectionFailed   = false;
                                    playerController.PlayButtonSound();
                                }
                            }
                            if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                            {
                                if (hx.speed != playerController.networkedMachineSpeed || netFlag == true)
                                {
                                    NetworkSend net      = playerController.networkController.networkSend;
                                    Vector3     location = hx.gameObject.transform.position;
                                    updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, hx.speed));
                                    playerController.networkedMachineSpeed = hx.speed;
                                }
                            }
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Input");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "No Input");
                    }
                }

                if (obj.GetComponent <PowerSource>() != null)
                {
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    PowerSource powerSource = obj.GetComponent <PowerSource>();
                    if (powerSource.connectionFailed == true)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            powerSource.connectionAttempts = 0;
                            powerSource.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Online");
                    }
                }

                if (obj.GetComponent <Auger>() != null)
                {
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    Auger auger = obj.GetComponent <Auger>();
                    if (auger.power > 0)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Output");
                        auger.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, auger.speed, 0, auger.power);
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (auger.speed != playerController.networkedMachineSpeed)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = auger.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, auger.speed));
                            playerController.networkedMachineSpeed = auger.speed;
                        }
                    }
                }

                if (obj.GetComponent <UniversalExtractor>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    UniversalExtractor extractor = obj.GetComponent <UniversalExtractor>();
                    if (extractor.connectionFailed == false)
                    {
                        if (extractor.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            extractor.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, extractor.speed, 0, extractor.power);
                        }
                        else
                        {
                            GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            extractor.connectionAttempts = 0;
                            extractor.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (extractor.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = extractor.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, extractor.speed));
                            playerController.networkedMachineSpeed = extractor.speed;
                        }
                    }
                }
                if (obj.GetComponent <DarkMatterCollector>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    DarkMatterCollector collector = obj.GetComponent <DarkMatterCollector>();
                    if (collector.connectionFailed == false)
                    {
                        if (collector.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            collector.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, collector.speed, 0, collector.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            collector.connectionAttempts = 0;
                            collector.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (collector.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = collector.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, collector.speed));
                            playerController.networkedMachineSpeed = collector.speed;
                        }
                    }
                }

                if (obj.GetComponent <Smelter>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    Smelter smelter = obj.GetComponent <Smelter>();
                    if (smelter.connectionFailed == false)
                    {
                        if (smelter.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            smelter.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, smelter.speed, 0, smelter.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            smelter.connectionAttempts = 0;
                            smelter.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (smelter.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = smelter.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, smelter.speed));
                            playerController.networkedMachineSpeed = smelter.speed;
                        }
                    }
                }

                if (obj.GetComponent <AlloySmelter>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    AlloySmelter alloySmelter = obj.GetComponent <AlloySmelter>();
                    if (alloySmelter.connectionFailed == false)
                    {
                        if (alloySmelter.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            alloySmelter.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, alloySmelter.speed, 0, alloySmelter.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            alloySmelter.connectionAttempts = 0;
                            alloySmelter.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (alloySmelter.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = alloySmelter.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, alloySmelter.speed));
                            playerController.networkedMachineSpeed = alloySmelter.speed;
                        }
                    }
                }

                if (obj.GetComponent <Press>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    Press press = obj.GetComponent <Press>();
                    if (press.connectionFailed == false)
                    {
                        if (press.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            press.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, press.speed, 0, press.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            press.connectionAttempts = 0;
                            press.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (press.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = press.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, press.speed));
                            playerController.networkedMachineSpeed = press.speed;
                        }
                    }
                }

                if (obj.GetComponent <Extruder>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    Extruder extruder = obj.GetComponent <Extruder>();
                    if (extruder.connectionFailed == false)
                    {
                        if (extruder.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            extruder.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, extruder.speed, 0, extruder.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            extruder.connectionAttempts = 0;
                            extruder.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (extruder.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = extruder.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, extruder.speed));
                            playerController.networkedMachineSpeed = extruder.speed;
                        }
                    }
                }

                if (obj.GetComponent <ModMachine>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    ModMachine modMachine = obj.GetComponent <ModMachine>();
                    if (modMachine.connectionFailed == false)
                    {
                        if (modMachine.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            modMachine.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, modMachine.speed, 0, modMachine.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            modMachine.connectionAttempts = 0;
                            modMachine.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (modMachine.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = modMachine.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, modMachine.speed));
                            playerController.networkedMachineSpeed = modMachine.speed;
                        }
                    }
                }

                if (obj.GetComponent <Turret>() != null)
                {
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    Turret turret = obj.GetComponent <Turret>();
                    if (turret.power > 0)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Output");
                        if (turret.power < 30)
                        {
                            turret.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, turret.speed, 0, turret.power);
                        }
                        else
                        {
                            turret.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, turret.speed, 0, 30);
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (turret.speed != playerController.networkedMachineSpeed)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = turret.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, turret.speed));
                            playerController.networkedMachineSpeed = turret.speed;
                        }
                    }
                }

                if (obj.GetComponent <MissileTurret>() != null)
                {
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    MissileTurret turret = obj.GetComponent <MissileTurret>();
                    if (turret.power > 0)
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Output");
                        if (turret.power < 30)
                        {
                            turret.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, turret.speed, 0, turret.power);
                        }
                        else
                        {
                            turret.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, turret.speed, 0, 30);
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (turret.speed != playerController.networkedMachineSpeed)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = turret.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, turret.speed));
                            playerController.networkedMachineSpeed = turret.speed;
                        }
                    }
                }

                if (obj.GetComponent <GearCutter>() != null)
                {
                    bool netFlag = false;
                    GUI.DrawTexture(guiCoordinates.speedControlBGRect, textureDictionary.dictionary["Interface Background"]);
                    GearCutter gearCutter = obj.GetComponent <GearCutter>();
                    if (gearCutter.connectionFailed == false)
                    {
                        if (gearCutter.power > 0)
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "Output");
                            gearCutter.speed = (int)GUI.HorizontalSlider(guiCoordinates.outputControlButton2Rect, gearCutter.speed, 0, gearCutter.power);
                        }
                        else
                        {
                            GUI.Label(guiCoordinates.outputLabelRect, "No Power");
                        }
                    }
                    else
                    {
                        GUI.Label(guiCoordinates.outputLabelRect, "Offline");
                        if (GUI.Button(guiCoordinates.outputControlButton2Rect, "Reboot"))
                        {
                            netFlag = true;
                            gearCutter.connectionAttempts = 0;
                            gearCutter.connectionFailed   = false;
                            playerController.PlayButtonSound();
                        }
                    }
                    if (PlayerPrefsX.GetPersistentBool("multiplayer") == true)
                    {
                        if (gearCutter.speed != playerController.networkedMachineSpeed || netFlag == true)
                        {
                            NetworkSend net      = playerController.networkController.networkSend;
                            Vector3     location = gearCutter.gameObject.transform.position;
                            updateNetworkMachineCoroutine          = StartCoroutine(net.SendMachineData(location, gearCutter.speed));
                            playerController.networkedMachineSpeed = gearCutter.speed;
                        }
                    }
                }
            }
            else
            {
                hubStopWindowOpen = false;
                gameObject.GetComponent <MSCameraController>().enabled = true;
            }
        }
    }
Example #26
0
        protected override void Apply(AttributeLoader loader, object wrapperObj)
        {
            if (!(wrapperObj is WeaponAttributesWrapper w))
            {
                throw new System.InvalidCastException();
            }

            loader.ApplyPPatch(TracerSpeed, () => w.TracerSpeed, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TracerSpeedMult, () => w.TracerSpeed);

            loader.ApplyPPatch(TracerLength, () => w.TracerLength, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(TracerLengthMult, () => w.TracerLength);

            loader.ApplyPPatch(BaseDamagePerRound, () => w.BaseDamagePerRound, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(BaseDamagePerRoundMult, () => w.BaseDamagePerRound);

            loader.ApplyPPatch(BaseWreckDamagePerRound, () => w.BaseWreckDamagePerRound, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(BaseWreckDamagePerRoundMult, () => w.BaseWreckDamagePerRound);

            loader.ApplyPPatch(FiringRecoil, () => w.FiringRecoil);
            loader.ApplyPMultPatch(FiringRecoilMult, () => w.FiringRecoil);

            loader.ApplyPPatch(WindUpTimeMS, () => w.WindUpTimeMS);
            loader.ApplyPMultPatch(WindUpTimeMSMult, () => w.WindUpTimeMS);

            loader.ApplyPPatch(RateOfFire, () => w.RateOfFire);
            loader.ApplyPMultPatch(RateOfFireMult, () => w.RateOfFire);

            loader.ApplyPPatch(NumberOfBursts, () => w.NumberOfBursts);
            loader.ApplyPMultPatch(NumberOfBurstsMult, () => w.NumberOfBursts);

            loader.ApplyPPatch(DamagePacketsPerShot, () => w.DamagePacketsPerShot);
            loader.ApplyPMultPatch(DamagePacketsPerShotMult, () => w.DamagePacketsPerShot);

            loader.ApplyPPatch(BurstPeriodMinTimeMS, () => w.BurstPeriodMinTimeMS);
            loader.ApplyPMultPatch(BurstPeriodMinTimeMSMult, () => w.BurstPeriodMinTimeMS);

            loader.ApplyPPatch(BurstPeriodMaxTimeMS, () => w.BurstPeriodMaxTimeMS);
            loader.ApplyPMultPatch(BurstPeriodMaxTimeMSMult, () => w.BurstPeriodMaxTimeMS);

            loader.ApplyPPatch(CooldownTimeMS, () => w.CooldownTimeMS);
            loader.ApplyPMultPatch(CooldownTimeMSMult, () => w.CooldownTimeMS);

            loader.ApplyPPatch(WindDownTimeMS, () => w.WindDownTimeMS);
            loader.ApplyPMultPatch(WindDownTimeMSMult, () => w.WindDownTimeMS);

            loader.ApplyPPatch(ReloadTimeMS, () => w.ReloadTimeMS);
            loader.ApplyPMultPatch(ReloadTimeMSMult, () => w.ReloadTimeMS);

            loader.ApplyPPatch(AreaOfEffectRadius, () => w.AreaOfEffectRadius, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(AreaOfEffectRadiusMult, () => w.AreaOfEffectRadius);

            loader.ApplyPPatch(FriendlyFireDamageScalar, () => w.FriendlyFireDamageScalar, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(FriendlyFireDamageScalarMult, () => w.FriendlyFireDamageScalar);

            loader.ApplyPPatch(WeaponOwnerFriendlyFireDamageScalar, () => w.WeaponOwnerFriendlyFireDamageScalar, Fixed64.UnsafeFromDouble);
            loader.ApplyPMultPatch(WeaponOwnerFriendlyFireDamageScalarMult, () => w.WeaponOwnerFriendlyFireDamageScalar);

            loader.ApplyPPatch(ExcludeFromAutoTargetAcquisition, () => w.ExcludeFromAutoTargetAcquisition);
            loader.ApplyPPatch(ExcludeFromAutoFire, () => w.ExcludeFromAutoFire);
            loader.ApplyPPatch(ExcludeFromHeightAdvantage, () => w.ExcludeFromHeightAdvantage);
            loader.ApplyPPatch(DamageType, () => w.DamageType);
            loader.ApplyPPatch(IsTracer, () => w.IsTracer);
            loader.ApplyPPatch(LineOfSightRequired, () => w.LineOfSightRequired);
            loader.ApplyPPatch(LeadsTarget, () => w.LeadsTarget);
            loader.ApplyPPatch(KillSkipsUnitDeathSequence, () => w.KillSkipsUnitDeathSequence);
            loader.ApplyPPatch(RevealTriggers, () => w.RevealTriggers);
            loader.ApplyPPatch(UnitStatusAttackingTriggers, () => w.UnitStatusAttackingTriggers);
            loader.ApplyPPatch(TargetStyle, () => w.TargetStyle);
            loader.ApplyPPatch(ActiveStatusEffectsIndex, () => w.ActiveStatusEffectsIndex);

            if (Modifiers != null)
            {
                var l = w.Modifiers?.Select(x => new WeaponModifierInfoWrapper(x)).ToList() ?? new List <WeaponModifierInfoWrapper>();
                loader.ApplyLPatch(Modifiers, l, () => new WeaponModifierInfoWrapper(), nameof(WeaponModifierInfo));
                w.Modifiers = l.ToArray();
            }

            loader.ApplyPPatch(AreaOfEffectFalloffType, () => w.AreaOfEffectFalloffType);
            loader.ApplyPPatch(ExcludeWeaponOwnerFromAreaOfEffect, () => w.ExcludeWeaponOwnerFromAreaOfEffect);

            if (Turret != null)
            {
                using (loader.logger.BeginScope($"Turret:"))
                {
                    var w2 = new TurretAttributesWrapper(w.Turret);
                    Turret.Apply(loader, w2, null);
                    w.Turret = w2;
                }
            }

            ApplyRangeAttributes(loader, WeaponRange.Short, RangeAttributesShort, w);
            ApplyRangeAttributes(loader, WeaponRange.Medium, RangeAttributesMedium, w);
            ApplyRangeAttributes(loader, WeaponRange.Long, RangeAttributesLong, w);

            loader.ApplyPPatch(ProjectileEntityTypeToSpawn, () => w.ProjectileEntityTypeToSpawn);
            loader.ApplyPPatch(StatusEffectsTargetAlignment, () => w.StatusEffectsTargetAlignment);
            loader.ApplyPPatch(StatusEffectsExcludeTargetType, () => w.StatusEffectsExcludeTargetType);

            if (StatusEffectsSets != null)
            {
                var l = w.StatusEffectsSets?.Select(x => new StatusEffectsSetAttributesWrapper(x)).ToList() ?? new List <StatusEffectsSetAttributesWrapper>();
                loader.ApplyLPatch(StatusEffectsSets, l, () => new StatusEffectsSetAttributesWrapper(), nameof(StatusEffectsSetAttributes));
                w.StatusEffectsSets = l.Where(x => x != null).ToArray();
            }

            if (TargetPrioritizationAttributes != null)
            {
                using (loader.logger.BeginScope($"TargetPrioritizationAttributes:"))
                {
                    var w2 = new TargetPriorizationAttributesWrapper(w.TargetPriorizationAttributes);
                    TargetPrioritizationAttributes.Apply(loader, w2, null);
                    w.TargetPriorizationAttributes = w2;
                }
            }

            if (EntityTypesToSpawnOnImpact != null)
            {
                var l = w.EntityTypesToSpawnOnImpact?.Select(x => new EntityTypeToSpawnAttributesWrapper(x)).ToList() ?? new List <EntityTypeToSpawnAttributesWrapper>();
                loader.ApplyLPatch(EntityTypesToSpawnOnImpact, l, () => new EntityTypeToSpawnAttributesWrapper(), nameof(EntityTypeToSpawnAttributes));
                w.EntityTypesToSpawnOnImpact = l.Where(x => x != null).ToArray();
            }

            if (OutputDPS == true)
            {
                OutputWeaponDPS(loader, w);
            }
        }
Example #27
0
 private void Start()
 {
     _turret           = gameObject.GetComponent <Turret>();
     _bulletPoolSystem = GameObject.Find("BulletPool").GetComponent <BulletPoolSystem>();
     firePoint         = gameObject.transform.Find("Head").transform.Find("FP").GetComponent <Transform>();
 }
Example #28
0
 private void ShootTurret(Turret turret)
 {
     turret.Shoot();
     AudioManager.Instance.PlayOneShot(AudioEnum.TurretShoot);
 }
Example #29
0
 // Use this for initialization
 void Start()
 {
     turret = transform.parent.GetComponent<Turret>();
     Physics.IgnoreCollision(turret.collider, collider); // ignore turret collider
     Physics.IgnoreCollision(turret.GetComponentInChildren<LaserShot>().collider, collider); // ignore laser collider
 }
 /// <summary>
 /// Removes a damage upgrade for a turret
 /// </summary>
 /// <param name="turret">The turret to remove a damage upgrade for</param>
 public override void RemoveModule(Turret turret)
 {
     turret.damage.TakeModifier(percentageChange);
 }
Example #31
0
    public void Start()
    {
        Turret turret = GetComponentInParent <Turret>();

        turret.changeHealthEvent.AddListener(UpdateHealth);
    }
 private void Awake()
 {
     turret = transform.root.GetComponent <Turret>();
 }
Example #33
0
        /// <summary>
        /// Scripts that use UpdateManager and run on clients as well as on server shall be added here.
        /// </summary>
        private void RegisterScripts_ClientAndServer()
        {
            #region Attached

            RegisterForBlock(new MyObjectBuilderType[] { typeof(MyObjectBuilder_MotorStator), typeof(MyObjectBuilder_MotorAdvancedStator), typeof(MyObjectBuilder_MotorSuspension) },
                             block => RegisterForUpdates(100, (new StatorRotor.Stator(block)).Update, block));

            RegisterForBlock(typeof(MyObjectBuilder_ExtendedPistonBase), (block) => {
                Piston.PistonBase pistonBase = new Piston.PistonBase(block);
                RegisterForUpdates(100, pistonBase.Update, block);
            });

            RegisterForBlock(typeof(MyObjectBuilder_ShipConnector), (block) => {
                Connector conn = new Connector(block);
                RegisterForUpdates(10, conn.Update, block);
            });

            RegisterForBlock(typeof(MyObjectBuilder_LandingGear), (block) => {
                if (!Hacker.IsHacker(block))
                {
                    new LandingGear(block);
                }
            });

            #endregion

            #region Antenna Communication

            Action <IMyCubeBlock> nodeConstruct = block => {
                RelayNode node = new RelayNode(block);
                RegisterForUpdates(100, node.Update100, block);
            };

            RegisterForBlock(typeof(MyObjectBuilder_Beacon), nodeConstruct);
            RegisterForBlock(typeof(MyObjectBuilder_LaserAntenna), nodeConstruct);
            RegisterForBlock(typeof(MyObjectBuilder_RadioAntenna), nodeConstruct);

            RegisterForCharacter(character => {
                if (character.IsPlayer)
                {
                    RelayNode node = new RelayNode(character);
                    RegisterForUpdates(100, node.Update100, (IMyEntity)character);
                }
            });

            RegisterForBlock(typeof(MyObjectBuilder_MyProgrammableBlock), block => {
                ProgrammableBlock pb = new ProgrammableBlock(block);
                if (MyAPIGateway.Multiplayer.IsServer)
                {
                    RegisterForUpdates(100, pb.Update100, block);
                }
            });

            RegisterForBlock(typeof(MyObjectBuilder_TextPanel), block => {
                TextPanel tp = new TextPanel(block);
                if (MyAPIGateway.Multiplayer.IsServer)
                {
                    RegisterForUpdates(100, tp.Update100, block);
                }
            });

            RegisterForBlock(typeof(MyObjectBuilder_Projector), block => {
                Projector p = new Projector(block);
                if (MyAPIGateway.Session.Player != null)
                {
                    RegisterForUpdates(100, p.Update100, block);
                    RegisterForUpdates(1, p.Update1, block);
                }
            });

            if (MyAPIGateway.Session.Player != null)
            {
                new Player();
            }

            #endregion

            #region Autopilot

            if (!MyAPIGateway.Multiplayer.IsServer)
            {
                //RadarEquipment.Definition apRadar = new RadarEquipment.Definition()
                //{
                //	Radar = true,
                //	LineOfSight = false,
                //	MaxTargets_Tracking = 3,
                //	MaxPowerLevel = 1000
                //};

                Action <IMyCubeBlock> apConstruct = (block) => {
                    if (ShipAutopilot.IsAutopilotBlock(block))
                    {
                        nodeConstruct(block);
                        new AutopilotTerminal(block);
                        //RadarEquipment r = new RadarEquipment(block, apRadar, block);
                        //RegisterForUpdates(100, r.Update100, block);
                    }
                };

                if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bUseRemoteControl))
                {
                    RegisterForBlock(typeof(MyObjectBuilder_RemoteControl), apConstruct);
                }
                RegisterForBlock(typeof(MyObjectBuilder_Cockpit), apConstruct);
            }

            if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bAirResistanceBeta))
            {
                RegisterForGrid(grid => {
                    AeroEffects aero = new AeroEffects(grid);
                    RegisterForUpdates(1, aero.Update1, grid);
                    if (MyAPIGateway.Multiplayer.IsServer)
                    {
                        RegisterForUpdates(100, aero.Update100, grid);
                    }
                });
                RegisterForBlock(typeof(MyObjectBuilder_Cockpit), block => RegisterForUpdates(1, (new CockpitTerminal(block)).Update1, block));
            }

            #endregion

            #region Radar

            if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bAllowRadar))
            {
                RegisterForBlock(typeof(MyObjectBuilder_Beacon), (block) => {
                    if (RadarEquipment.IsDefinedRadarEquipment(block))
                    {
                        new RadarEquipment(block);
                    }
                });
                RegisterForBlock(typeof(MyObjectBuilder_RadioAntenna), (block) => {
                    if (RadarEquipment.IsDefinedRadarEquipment(block))
                    {
                        new RadarEquipment(block);
                    }
                });
                RegisterForUpdates(100, RadarEquipment.UpdateAll);
            }

            #endregion

            #region Terminal Control

            RegisterForBlock(new MyObjectBuilderType[] { typeof(MyObjectBuilder_RadioAntenna), typeof(MyObjectBuilder_LaserAntenna) }, block => new ManualMessage(block));

            #endregion Terminal Control

            #region Weapon Control

            if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bAllowWeaponControl))
            {
                #region Turrets

                Action <IMyCubeBlock> constructor;
                if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bAllowGuidedMissile))
                {
                    constructor = block => {
                        if (!WeaponTargeting.ValidWeaponBlock(block))
                        {
                            return;
                        }
                        Turret t = new Turret(block);
                        RegisterForUpdates(1, t.Update_Targeting, block);
                        if (GuidedMissileLauncher.IsGuidedMissileLauncher(block))
                        {
                            GuidedMissileLauncher gml = new GuidedMissileLauncher(t);
                            RegisterForUpdates(1, gml.Update1, block);
                        }
                    }
                }
                ;
                else
                {
                    constructor = block => {
                        if (!WeaponTargeting.ValidWeaponBlock(block))
                        {
                            return;
                        }
                        Turret t = new Turret(block);
                        RegisterForUpdates(1, t.Update_Targeting, block);
                    }
                };

                RegisterForBlock(typeof(MyObjectBuilder_LargeGatlingTurret), constructor);
                RegisterForBlock(typeof(MyObjectBuilder_LargeMissileTurret), constructor);
                RegisterForBlock(typeof(MyObjectBuilder_InteriorTurret), constructor);

                #endregion

                #region Fixed

                if (ServerSettings.GetSetting <bool>(ServerSettings.SettingName.bAllowGuidedMissile))
                {
                    constructor = block => {
                        if (!WeaponTargeting.ValidWeaponBlock(block))
                        {
                            return;
                        }
                        FixedWeapon w = new FixedWeapon(block);
                        RegisterForUpdates(1, w.Update_Targeting, block);
                        if (GuidedMissileLauncher.IsGuidedMissileLauncher(block))
                        {
                            GuidedMissileLauncher gml = new GuidedMissileLauncher(w);
                            RegisterForUpdates(1, gml.Update1, block);
                        }
                    };
                }
                else
                {
                    constructor = block => {
                        if (!WeaponTargeting.ValidWeaponBlock(block))
                        {
                            return;
                        }
                        FixedWeapon w = new FixedWeapon(block);
                        RegisterForUpdates(1, w.Update_Targeting, block);
                    }
                };

                RegisterForBlock(typeof(MyObjectBuilder_SmallGatlingGun), constructor);
                RegisterForBlock(typeof(MyObjectBuilder_SmallMissileLauncher), constructor);
                RegisterForBlock(typeof(MyObjectBuilder_SmallMissileLauncherReload), constructor);

                #endregion

                // apparently missiles do not have their positions synced
                RegisterForUpdates(1, GuidedMissile.Update1);
                RegisterForUpdates(10, GuidedMissile.Update10);
                RegisterForUpdates(100, GuidedMissile.Update100);
            }
            else
            {
                Log.DebugLog("Weapon Control is disabled", Logger.severity.INFO);
            }

            #endregion

            #region Solar

            if (!MyAPIGateway.Multiplayer.IsServer)
            {
                RegisterForBlock(typeof(MyObjectBuilder_OxygenFarm), (block) => new Solar(block));
                RegisterForBlock(typeof(MyObjectBuilder_SolarPanel), (block) => new Solar(block));
            }

            #endregion

            new ChatHandler();
            Globals.Update100();
            RegisterForUpdates(100, Globals.Update100);

            Action <IMyCubeBlock> act = (block) => MainCockpitFix.AddController((IMyShipController)block);
            RegisterForBlock(typeof(MyObjectBuilder_Cockpit), act);
            RegisterForBlock(typeof(MyObjectBuilder_RemoteControl), act);
        }
Example #34
0
 // Start is called before the first frame update
 private void Start()
 {
     transform.position = dirFrom;
     playerTurret       = player.GetComponent <Turret>();
 }
Example #35
0
 public bool canSpawn(Turret.TurretType type)
 {
     if(type == Turret.TurretType.AOEMissile || type == Turret.TurretType.BallisticMissile || type == Turret.TurretType.FireMissile)
             return (getHasMissileEquipped() < maxAllowableMissiles);
     return true;            
 }
Example #36
0
 void Awake()
 {
     turret = gameObject.GetComponentInParent <Turret>();
 }
Example #37
0
 private void TakeControlOfTurret(Turret turret)
 {
     activeCamera.transform.position = turret.transform.position;
 }
 public void AddTurretToSwitch(Turret turret)
 {
     turrets.Add(turret);
 }
Example #39
0
 // Use this for initialization
 void Start()
 {
     player = GameObject.Find ("Turret").GetComponent<Turret> ();
 }
 public void RemoveTurretFromSwitch(Turret turret)
 {
     turrets.Remove(turret);
 }
Example #41
0
 void Awake()
 {
     Turret = GetComponentInChildren <Turret>();
 }
Example #42
0
 public void Seek(Transform _target, Turret _shooter)
 {
     target  = _target;
     shooter = _shooter;
 }
Example #43
0
 public override void ApplyToTurret(Turret turret)
 {
     turret.Damage += damageIncrease;
 }
Example #44
0
        public void DestroyTurret(Turret turret, BaseBullet bullet)
        {
            /*
            _turrets.Remove(turret);

            _structure.Vertices.Add(new Vector2());
            var index = _structure.Vertices.FindIndex(vertex => vertex == turret.InitialPosition);

            var newPosition = turret.InitialPosition + bullet.Direction * 20f;
            _structure.Vertices[index] = newPosition;

            var newTurret = new Turret(GameRef, this, newPosition, _myPatterns[0]);
            newTurret.Initialize();
            _turrets.Add(newTurret);

            var allVertices = new HashSet<Vector2>(_structure.Vertices).ToList();
            */
            //_polygonShape = new PolygonShape(GameRef.GraphicsDevice, allVertices.ToArray());
        }
 public void destroyInventory(Turret.TurretType type)
  {
     switch (type)
     {
         case Turret.TurretType.Laser:
             laserTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.Ion:
             ionTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.Railgun:
             railTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.BallisticMissile:
             ballisticMissileTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.FireMissile:
             fireMissileTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.AOEMissile:
             aoeMissileTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.Beam:
             chargeBeamTurrets.RemoveAt(0);
             break;
         case Turret.TurretType.PowerDrainer:
             drainBeamTurrets.RemoveAt(0);
             break;
     }
 }
Example #46
0
 void Start()
 {
     _thisTurret = this.transform.parent.GetComponent<Turret>();
 }
 public int getTotalWeaponCount(Turret.TurretType type)
 {
     return getWeaponCount(type) + getNumberAttached(type);
 }
Example #48
0
 public void AddEntity(Turret entity)
 {
     turrets.Add (entity);
 }
 public void createInventory(Turret.TurretType type)
 {
     switch (type)
     {
         case Turret.TurretType.Laser:
             LaserTurret lt = TrashMan.spawn("LaserTurret").GetComponent<LaserTurret>();
             lt.gameObject.SetActive(false);
             lt.transform.parent = this.transform;
             lt.listRef = laserTurrets;
             laserTurrets.Add(lt);
             break;
         case Turret.TurretType.Ion:
             IonTurret it = TrashMan.spawn("IonTurret").GetComponent<IonTurret>();
             it.gameObject.SetActive(false);
             it.transform.parent = this.transform;
             it.listRef = ionTurrets;
             ionTurrets.Add(it);
             break;
         case Turret.TurretType.Railgun:
             RailTurret rt = TrashMan.spawn("RailTurret").GetComponent<RailTurret>();
             rt.gameObject.SetActive(false);
             rt.transform.parent = this.transform;
             rt.listRef = railTurrets;
             railTurrets.Add(rt);
             break;
         case Turret.TurretType.BallisticMissile:
             if (ballisticMissileTurrets.Count == PlayerController.PC.maxAllowableMissiles)
                 return;
             BallisticTurret bt = TrashMan.spawn("BallisticMissileTurret").GetComponent<BallisticTurret>();
             bt.gameObject.SetActive(false);
             bt.transform.parent = this.transform;
             bt.listRef = ballisticMissileTurrets;
             ballisticMissileTurrets.Add(bt);
             break;
         case Turret.TurretType.FireMissile:
             if (fireMissileTurrets.Count == PlayerController.PC.maxAllowableMissiles)
                 return;
             FireMissileTurret fmt = TrashMan.spawn("FireMissileTurret").GetComponent<FireMissileTurret>();
             fmt.gameObject.SetActive(false);
             fmt.transform.parent = this.transform;
             fmt.listRef = fireMissileTurrets;
             fireMissileTurrets.Add(fmt);
             break;
         case Turret.TurretType.AOEMissile:
             if (aoeMissileTurrets.Count == PlayerController.PC.maxAllowableMissiles)
                 return;
             AOEMissileTurret amt = TrashMan.spawn("AOEMissileTurret").GetComponent<AOEMissileTurret>();
             amt.gameObject.SetActive(false);
             amt.transform.parent = this.transform;
             amt.listRef = aoeMissileTurrets;
             aoeMissileTurrets.Add(amt);
             break;
         case Turret.TurretType.Beam:
             ChargeBeamTurret cbt = TrashMan.spawn("chargeBeamTurret").GetComponent<ChargeBeamTurret>();
             cbt.gameObject.SetActive(false);
             cbt.transform.parent = this.transform;
             cbt.listRef = chargeBeamTurrets;
             chargeBeamTurrets.Add(cbt);
             break;
         case Turret.TurretType.PowerDrainer:
             DrainBeamTurret dbt = TrashMan.spawn("powerDrainerTurret").GetComponent<DrainBeamTurret>();
             dbt.gameObject.SetActive(false);
             dbt.transform.parent = this.transform;
             dbt.listRef = drainBeamTurrets;
             drainBeamTurrets.Add(dbt);
             break;
     }
 }
 public static void Postfix(Turret __instance)
 {
     __instance.registerComponentsForVFX();
 }
 private static bool MaxLevels(Turret turretToCheck)
 {
     return turretToCheck.UpgradeOneLevel +
         turretToCheck.UpgradeTwoLevel +
         turretToCheck.UpgradeThreeLevel >= 3;
 }
Example #52
0
    public void Build(GameObject turret)
    {
        GameObject tempTurret = (GameObject)Instantiate(turret, transform.position, Quaternion.identity);

        turretRef = tempTurret.GetComponent <Turret> ();
    }
Example #53
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
            }
        }
        public void Repair(MechComponent component, bool isFloatieMessage = false)
        {
            Mech    mech    = component.parent as Mech;
            Vehicle vehicle = component.parent as Vehicle;
            Turret  turret  = component.parent as Turret;

            Log.Debug?.Write("Repair:" + component.parent.DisplayName + ":" + component.parent.GUID + ":" + component.defId + " mech:" + (mech != null ? "true" : "false") + " vehicle:" + (vehicle != null ? "true" : "false") + " turret:" + (turret != null ? "true" : "false") + "\n");
            HashSet <int> affectedISLocations    = new HashSet <int>();
            HashSet <int> affectedArmorLocations = new HashSet <int>();
            bool          armorReparied          = false;
            bool          structureReparied      = false;

            if (this.AffectInstalledLocation)
            {
                affectedISLocations.Add(component.Location);
                if (mech != null)
                {
                    ChassisLocations componentLocation = (ChassisLocations)component.Location;
                    switch (componentLocation)
                    {
                    case ChassisLocations.CenterTorso:
                        affectedArmorLocations.Add((int)ArmorLocation.CenterTorso);
                        affectedArmorLocations.Add((int)ArmorLocation.CenterTorsoRear);
                        break;

                    case ChassisLocations.RightTorso:
                        affectedArmorLocations.Add((int)ArmorLocation.RightTorso);
                        affectedArmorLocations.Add((int)ArmorLocation.RightTorsoRear);
                        break;

                    case ChassisLocations.LeftTorso:
                        affectedArmorLocations.Add((int)ArmorLocation.LeftTorso);
                        affectedArmorLocations.Add((int)ArmorLocation.LeftTorsoRear);
                        break;

                    default:
                        affectedArmorLocations.Add((int)componentLocation);
                        break;
                    }
                }
                else
                {
                    affectedArmorLocations.Add(component.Location);
                }
            }
            ;
            int stackItemUID = component.parent.Combat.StackManager.NextStackUID;

            if (mech != null)
            {
                for (int t = 0; t < this.MechStructureLocations.Length; ++t)
                {
                    affectedISLocations.Add((int)this.MechStructureLocations[t]);
                }
                for (int t = 0; t < this.MechArmorLocations.Length; ++t)
                {
                    affectedArmorLocations.Add((int)this.MechArmorLocations[t]);
                }
            }
            else
            if (vehicle != null)
            {
                for (int t = 0; t < this.VehicleLocations.Length; ++t)
                {
                    affectedISLocations.Add((int)this.VehicleLocations[t]);
                    affectedArmorLocations.Add((int)this.VehicleLocations[t]);
                }
            }
            else
            {
                for (int t = 0; t < this.BuildingLocations.Length; ++t)
                {
                    affectedISLocations.Add((int)this.BuildingLocations[t]);
                    affectedArmorLocations.Add((int)this.BuildingLocations[t]);
                }
            }
            Log.Debug?.Write(" Affected armor locations:");
            foreach (var loc in affectedArmorLocations)
            {
                Log.Debug?.Write(" " + loc);
            }
            Log.Debug?.Write(" \n");
            if (this.Armor > Core.Epsilon)
            {
                foreach (int Location in affectedArmorLocations)
                {
                    Statistic stat = component.parent.GetArmorStatisticForLocation(Location);
                    if (stat == null)
                    {
                        Log.TWriteCritical(0, "Can't get armor stat " + new Text(component.parent.DisplayName).ToString() + " location:" + Location);
                        continue;
                    }
                    Log.Debug?.TWL(0, "turnsSinceLocationDamage:" + component.parent.turnsSinceLocationDamage(Location) + " component:" + TurnsSinceDamage);
                    if (TurnsSinceDamage >= 0)
                    {
                        if (component.parent.turnsSinceLocationDamage(Location) > TurnsSinceDamage)
                        {
                            Log.WL(1, "damage too long ago. No reparing performed.");
                            continue;
                        }
                    }
                    float maxArmor          = stat.DefaultValue <float>();
                    float currentArmor      = stat.Value <float>();
                    int   StructureLocation = Location;
                    if (mech != null)
                    {
                        StructureLocation = (int)MechStructureRules.GetChassisLocationFromArmorLocation((ArmorLocation)Location);
                    }
                    currentArmor += this.Armor;
                    if (currentArmor > maxArmor)
                    {
                        currentArmor = maxArmor;
                    }
                    ;
                    float delta = currentArmor - component.parent.ArmorForLocation(Location);
                    Log.WL(2, "location:" + Location + " maxArmor:" + maxArmor + " currentArmor:" + currentArmor + "(" + delta + ")");
                    if (delta > Core.Epsilon)
                    {
                        if (mech != null)
                        {
                            Log.Debug?.Write("  mech stat armor location:" + mech.GetStringForArmorLocation((ArmorLocation)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = mech.GetLocationDamageLevel((ChassisLocations)StructureLocation);
                            if (locationDamageLevel >= LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                continue;
                            }
                            armorReparied = true;
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, mech.GetStringForArmorLocation((ArmorLocation)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        if (vehicle != null)
                        {
                            Log.Debug?.Write("  vehicle stat armor location:" + vehicle.GetStringForArmorLocation((VehicleChassisLocations)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = vehicle.GetLocationDamageLevel((VehicleChassisLocations)StructureLocation);
                            if (locationDamageLevel >= LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                continue;
                            }
                            armorReparied = true;
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, vehicle.GetStringForArmorLocation((VehicleChassisLocations)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        if (turret != null)
                        {
                            Log.Debug?.Write("  turret stat armor location:" + turret.GetStringForArmorLocation((BuildingLocation)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = turret.GetLocationDamageLevel((BuildingLocation)StructureLocation);
                            if (locationDamageLevel >= LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                armorReparied = true;
                                continue;
                            }
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, turret.GetStringForArmorLocation((BuildingLocation)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        {
                            Log.Debug?.Write("  combatant has no armor\n");
                        }
                    }
                }
            }
            Log.Debug?.Write(" Affected inner structure locations:");
            foreach (var loc in affectedISLocations)
            {
                Log.Debug?.Write(" " + loc);
            }
            Log.Debug?.Write(" \n");
            if (this.InnerStructure > Core.Epsilon)
            {
                foreach (int Location in affectedISLocations)
                {
                    float maxStructure     = component.parent.MaxStructureForLocation(Location);
                    float currentStructure = component.parent.StructureForLocation(Location);
                    if (currentStructure < Core.Epsilon)
                    {
                        Log.Debug?.Write(" can't repair locations with zero structure\n");
                        continue;
                    }
                    currentStructure += this.InnerStructure;
                    if (currentStructure > maxStructure)
                    {
                        currentStructure = maxStructure;
                    }
                    ;
                    float delta = currentStructure - component.parent.StructureForLocation(Location);
                    Log.Debug?.Write(" inner structure repair amount:" + delta + "\n");
                    if (delta > Core.Epsilon)
                    {
                        if (mech != null)
                        {
                            Log.Debug?.Write("  mech stat structure location:" + mech.GetStringForStructureLocation((ChassisLocations)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = mech.GetLocationDamageLevel((ChassisLocations)Location);
                            if (locationDamageLevel >= LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                continue;
                            }
                            structureReparied = true;
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, mech.GetStringForStructureLocation((ChassisLocations)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        if (vehicle != null)
                        {
                            Log.Debug?.Write("  vehicle stat structure location:" + vehicle.GetStringForStructureLocation((VehicleChassisLocations)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = vehicle.GetLocationDamageLevel((VehicleChassisLocations)Location);
                            if (locationDamageLevel >= LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                continue;
                            }
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, vehicle.GetStringForStructureLocation((VehicleChassisLocations)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        if (turret != null)
                        {
                            Log.Debug?.Write("  turret stat structure location:" + turret.GetStringForArmorLocation((BuildingLocation)Location) + "\n");
                            LocationDamageLevel locationDamageLevel = turret.GetLocationDamageLevel((BuildingLocation)Location);
                            if (locationDamageLevel == LocationDamageLevel.Destroyed)
                            {
                                Log.Debug?.Write(" can't repair destroyed location\n");
                                continue;
                            }
                            structureReparied = true;
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, turret.GetStringForStructureLocation((BuildingLocation)Location), StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                        else
                        {
                            Log.Debug?.Write("  other structure location:" + "Structure" + "\n");
                            structureReparied = true;
                            component.parent.StatCollection.ModifyStat <float>(component.parent.GUID, stackItemUID, "Structure", StatCollection.StatOperation.Float_Add, delta, -1, true);
                        }
                    }
                }
            }
            if ((armorReparied || structureReparied) && (isFloatieMessage))
            {
                string text = component.Description.UIName + " __/CAE.REPAIRED/__" + (armorReparied ? " __/CAE.REPAIRARMOR/__" : " ") + (structureReparied ? " __/CAE.REPAIRSTRUCTURE/__" : "");
                component.parent.Combat.MessageCenter.PublishMessage((MessageCenterMessage) new FloatieMessage(component.parent.GUID, component.parent.GUID, text, FloatieMessage.MessageNature.Buff));
            }
        }
Example #55
0
 public void spawnDroneTurret(Turret.TurretType t)
 {
     if (hasWeapon)
         return;
     GameObject Weapon;
     switch (t)
     {
         case Turret.TurretType.Laser:
             Weapon = TrashMan.spawn("LaserTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();
             InitializeDroneTurret();
             break;
         case Turret.TurretType.Ion:
             Weapon = TrashMan.spawn("IonTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();
             InitializeDroneTurret();
             break;
         case Turret.TurretType.Railgun:
             Weapon = TrashMan.spawn("RailTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();
             InitializeDroneTurret();
             break;
         case Turret.TurretType.Beam:
             //SPAWN
             Weapon = TrashMan.spawn("chargeBeamTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();
             InitializeDroneTurret();
             break;
         case Turret.TurretType.PowerDrainer:
             //SPAWN
             Weapon = TrashMan.spawn("powerDrainerTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();      
             InitializeDroneTurret();
             break;
         case Turret.TurretType.AOEMissile:
             //SPAWN
             Weapon = TrashMan.spawn("AOEMissileTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();  
             InitializeDroneTurret();
             break;
         case Turret.TurretType.FireMissile:
             
             Weapon = TrashMan.spawn("FireMissileTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>(); hasWeapon = true;
             InitializeDroneTurret();
             break;
         case Turret.TurretType.BallisticMissile:
             //SPAWN
             Weapon = TrashMan.spawn("BallisticMissileTurret", transform.position, transform.rotation);
             Weapon.transform.parent = this.transform;
             attachedWeapon = Weapon.GetComponent<Turret>();
             InitializeDroneTurret();
             break;
     }
 }
Example #56
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            if (overlayColor.A > 0)
            {
                if (overlaySprite != null)
                {
                    GUI.DrawRectangle(spriteBatch, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.Black * (overlayColor.A / 255.0f), isFilled: true);
                    float scale = Math.Max(GameMain.GraphicsWidth / overlaySprite.size.X, GameMain.GraphicsHeight / overlaySprite.size.Y);
                    overlaySprite.Draw(spriteBatch, new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) / 2, overlayColor, overlaySprite.size / 2, scale: scale);
                }
                else
                {
                    GUI.DrawRectangle(spriteBatch, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), overlayColor, isFilled: true);
                }
                if (!string.IsNullOrEmpty(overlayText) && overlayTextColor.A > 0)
                {
                    var     backgroundSprite = GUI.Style.GetComponentStyle("CommandBackground").GetDefaultSprite();
                    Vector2 centerPos        = new Vector2(GameMain.GraphicsWidth, GameMain.GraphicsHeight) / 2;
                    backgroundSprite.Draw(spriteBatch,
                                          centerPos,
                                          Color.White * (overlayTextColor.A / 255.0f),
                                          origin: backgroundSprite.size / 2,
                                          rotate: 0.0f,
                                          scale: new Vector2(1.5f, 0.7f) * (GameMain.GraphicsWidth / 3 / backgroundSprite.size.X));

                    string  wrappedText = ToolBox.WrapText(overlayText, GameMain.GraphicsWidth / 3, GUI.Font);
                    Vector2 textSize    = GUI.Font.MeasureString(wrappedText);
                    Vector2 textPos     = centerPos - textSize / 2;
                    GUI.DrawString(spriteBatch, textPos + Vector2.One, wrappedText, Color.Black * (overlayTextColor.A / 255.0f));
                    GUI.DrawString(spriteBatch, textPos, wrappedText, overlayTextColor);

                    if (!string.IsNullOrEmpty(overlayTextBottom))
                    {
                        Vector2 bottomTextPos = centerPos + new Vector2(0.0f, textSize.Y + 30 * GUI.Scale) - GUI.Font.MeasureString(overlayTextBottom) / 2;
                        GUI.DrawString(spriteBatch, bottomTextPos + Vector2.One, overlayTextBottom, Color.Black * (overlayTextColor.A / 255.0f));
                        GUI.DrawString(spriteBatch, bottomTextPos, overlayTextBottom, overlayTextColor);
                    }
                }
            }

            if (GUI.DisableHUD || GUI.DisableUpperHUD || ForceMapUI || CoroutineManager.IsCoroutineRunning("LevelTransition"))
            {
                endRoundButton.Visible = false;
                return;
            }
            if (Submarine.MainSub == null)
            {
                return;
            }

            endRoundButton.Visible = false;
            var    availableTransition = GetAvailableTransition(out _, out Submarine leavingSub);
            string buttonText          = "";

            switch (availableTransition)
            {
            case TransitionType.ProgressToNextLocation:
            case TransitionType.ProgressToNextEmptyLocation:
                if (Level.Loaded.EndOutpost == null || !Level.Loaded.EndOutpost.DockedTo.Contains(leavingSub))
                {
                    buttonText             = TextManager.GetWithVariable("EnterLocation", "[locationname]", Level.Loaded.EndLocation?.Name ?? "[ERROR]");
                    endRoundButton.Visible = !ForceMapUI && !ShowCampaignUI;
                }
                break;

            case TransitionType.LeaveLocation:
                buttonText             = TextManager.GetWithVariable("LeaveLocation", "[locationname]", Level.Loaded.StartLocation?.Name ?? "[ERROR]");
                endRoundButton.Visible = !ForceMapUI && !ShowCampaignUI;
                break;

            case TransitionType.ReturnToPreviousLocation:
            case TransitionType.ReturnToPreviousEmptyLocation:
                if (Level.Loaded.StartOutpost == null || !Level.Loaded.StartOutpost.DockedTo.Contains(leavingSub))
                {
                    buttonText             = TextManager.GetWithVariable("EnterLocation", "[locationname]", Level.Loaded.StartLocation?.Name ?? "[ERROR]");
                    endRoundButton.Visible = !ForceMapUI && !ShowCampaignUI;
                }

                break;

            case TransitionType.None:
            default:
                if (Level.Loaded.Type == LevelData.LevelType.Outpost &&
                    (Character.Controlled?.Submarine?.Info.Type == SubmarineType.Player || (Character.Controlled?.CurrentHull?.OutpostModuleTags?.Contains("airlock") ?? false)))
                {
                    buttonText             = TextManager.GetWithVariable("LeaveLocation", "[locationname]", Level.Loaded.StartLocation?.Name ?? "[ERROR]");
                    endRoundButton.Visible = !ForceMapUI && !ShowCampaignUI;
                }
                else
                {
                    endRoundButton.Visible = false;
                }
                break;
            }

            if (endRoundButton.Visible)
            {
                if (!AllowedToEndRound())
                {
                    buttonText = TextManager.Get("map");
                }
                endRoundButton.Text = ToolBox.LimitString(buttonText, endRoundButton.Font, endRoundButton.Rect.Width - 5);
                if (endRoundButton.Text != buttonText)
                {
                    endRoundButton.ToolTip = buttonText;
                }
                if (Character.Controlled?.ViewTarget is Item item)
                {
                    Turret turret = item.GetComponent <Turret>();
                    endRoundButton.RectTransform.ScreenSpaceOffset = turret == null ? Point.Zero : new Point(0, (int)(turret.UIElementHeight * 1.25f));
                }
                else if (Character.Controlled?.CharacterHealth?.SuicideButton?.Visible ?? false)
                {
                    endRoundButton.RectTransform.ScreenSpaceOffset = new Point(0, Character.Controlled.CharacterHealth.SuicideButton.Rect.Height);
                }
                else
                {
                    endRoundButton.RectTransform.ScreenSpaceOffset = Point.Zero;
                }
            }
            endRoundButton.DrawManually(spriteBatch);
        }
        public void GetTurrets()
        {
            turrets = new Dictionary <int, Turret>();

            List <IMyRemoteControl>   remCons = new List <IMyRemoteControl>();
            List <IMyMotorStator>     rots = new List <IMyMotorStator>();
            List <IMySmallGatlingGun> gatGuns = new List <IMySmallGatlingGun>(), ctrlGuns;
            List <IMyShipConnector>   conns = new List <IMyShipConnector>();
            Turret turret;

            GridTerminalSystem.GetBlocksOfType(remCons);
            GridTerminalSystem.GetBlocksOfType(rots);
            GridTerminalSystem.GetBlocksOfType(gatGuns);
            GridTerminalSystem.GetBlocksOfType(conns);

            string status = "";
            int    turNo;

            foreach (IMyRemoteControl ctrl in remCons)
            {
                if (ctrl.CustomData.StartsWith(TURRET_BASE))
                {
                    try {
                        turNo = int.Parse(ctrl.CustomData.Substring(TURRET_BASE.Length));
                        if (!turrets.TryGetValue(turNo, out turret))
                        {
                            turret   = new Turret(ctrl);
                            ctrlGuns = new List <IMySmallGatlingGun>();

                            foreach (IMySmallGatlingGun gun in gatGuns)
                            {
                                if (AreOnSameGrid(gun, ctrl))
                                {
                                    ctrlGuns.Add(gun); gun.CustomName = "[" + TURRET_BASE + turNo + "] Gun";
                                }
                            }

                            foreach (IMyShipConnector con in conns)
                            {
                                if (AreOnSameGrid(con, ctrl))
                                {
                                    turret.SetRLCon(con); con.CustomName = "[" + TURRET_BASE + turNo + "] Reload Con"; conns.Remove(con); break;
                                }
                            }

                            if (!turret.HasRLCon())
                            {
                                status += "\n417:The turret does not have a reload connector: " + turNo;
                            }

                            if (ctrlGuns.Count > 0)
                            {
                                turret.AddWeapon(ctrlGuns);
                            }
                            else
                            {
                                status += "\n420:There is a turret without weaponry on it: " + turNo;
                            }

                            turrets.Add(turNo, turret);
                        }
                        else
                        {
                            status += "\n424:There is more than one turret with the same number: " + turNo;
                        }
                    }
                    catch (Exception e) {
                        e.ToString();
                        status += "\n428:There was a parsing error: \"" + ctrl.CustomData.Substring(TURRET_BASE.Length) + "\"";
                        status += "\n" + e.StackTrace;
                    }
                }
            }

            foreach (IMyMotorStator rot in rots)
            {
                if (rot.CustomData.Length <= 0)
                {
                    continue;
                }
                string[] data = rot.CustomData.ToUpper().Split(';');
                if (data.Length < 2)
                {
                    try {
                        turNo = int.Parse(rot.CustomData.Substring(TURRET_BASE.Length));
                    }
                    catch (Exception e) {
                        e.ToString();
                        status += "\n442:There was a parsing error: \"" + rot.CustomData.Substring(TURRET_BASE.Length) + "\"";
                        continue;
                    }
                    status += "\n445:There is no rotor definition for a rotor: " + turNo;
                }
                else
                {
                    try {
                        turNo = int.Parse(data[0].Substring(TURRET_BASE.Length));
                    }
                    catch (Exception e) {
                        e.ToString();
                        status += "\n453:There was a parsing error: \"" + data[0].Substring(TURRET_BASE.Length) + "\"";
                        continue;
                    }

                    if (data[1].ToUpper().Equals("XROT"))
                    {
                        if (turrets.TryGetValue(turNo, out turret))
                        {
                            if (!turret.HasXROT())
                            {
                                turret.SetXROT(rot);
                                rot.CustomName = "[" + TURRET_BASE + turNo + "] XROT";
                            }
                            else
                            {
                                status += "\n463:There is a double-XROT situation going on: " + turNo;
                            }
                        }
                        else
                        {
                            status += "\n465:There is an abandoned XROT rotor for turret no. " + turNo;
                        }
                    }
                    else
                    if (data[1].ToUpper().Equals("YROT"))
                    {
                        if (turrets.TryGetValue(turNo, out turret))
                        {
                            if (!turret.HasYROT())
                            {
                                turret.SetYROT(rot);
                                rot.CustomName = "[" + TURRET_BASE + turNo + "] YROT";
                                if (!turret.HasBSCon())
                                {
                                    foreach (IMyShipConnector con in conns)
                                    {
                                        if (AreOnSameGrid(rot, con))
                                        {
                                            turret.SetBSCon(con); con.CustomName = "[" + TURRET_BASE + turNo + "] Base Con"; break;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                status += "\n475:There is a double-YROT situation going on: " + turNo;
                            }
                        }
                        else
                        {
                            status += "\n477:There is an abandoned YROT rotor for turret no. " + turNo;
                        }
                    }
                    else
                    if (data[1].ToUpper().Equals("YROTA"))
                    {
                        if (turrets.TryGetValue(turNo, out turret))
                        {
                            if (!turret.HasYROTA())
                            {
                                turret.SetYROTA(rot);
                                rot.CustomName = "[" + TURRET_BASE + turNo + "] YROTA";
                                if (!turret.HasBSCon())
                                {
                                    foreach (IMyShipConnector con in conns)
                                    {
                                        if (AreOnSameGrid(rot, con))
                                        {
                                            turret.SetBSCon(con); con.CustomName = "[" + TURRET_BASE + turNo + "] Base Con"; break;
                                        }
                                    }
                                }
                            }
                            else
                            {
                                status += "\n486:There is a double-YROTA situation going on: " + turNo;
                            }
                        }
                        else
                        {
                            status += "\n488:There is an abandoned YROTA rotor for turret no. " + turNo;
                        }
                    }
                    else
                    {
                        status += "\n490:There is an incomprehensible definition for a rotor: " + data[1];
                    }
                }
            }
            Echo(status);
            Me.CustomData = status;
        }
Example #58
0
 public void RemoveCannon()
 {
     currentCannon = tankCannon.GetComponent <Turret>();
     tankCannon.SetActive(true);
 }
Example #59
0
 public void DeReference(Turret turret)
 {
     turrets.Remove(turret);
 }
Example #60
0
        public static async Task <bool> Execute()
        {
            if (BotManager.Current.IsAutonomous)
            {
                if (Core.Me.HasTarget)
                {
                    Movement.NavigateToUnitLos(Core.Me.CurrentTarget, 23);
                }
            }

            if (!Core.Me.HasTarget || !Core.Me.CurrentTarget.ThoroughCanAttack())
            {
                return(false);
            }

            if (await CustomOpenerLogic.Opener())
            {
                return(true);
            }

            if (MachinistSettings.Instance.UseFlameThrower && Core.Me.HasAura(Auras.Flamethrower))
            {
                // Did someone use this manually? Make sure we don't cancel it...
                if (!MachinistSettings.Instance.UseFlameThrower)
                {
                    return(true);
                }

                if (MovementManager.IsMoving)
                {
                    return(false);
                }

                // Keep using it for the AOE benefit if we need to
                if (Core.Me.EnemiesInCone(8) >= MachinistSettings.Instance.FlamethrowerEnemies)
                {
                    return(true);
                }
            }

            if (await PhysicalDps.SecondWind(MachinistSettings.Instance))
            {
                return(true);
            }
            if (await PhysicalDps.Interrupt(MachinistSettings.Instance))
            {
                return(true);
            }

            if (Utilities.Routines.Machinist.OnGcd)
            {
                if (await Buff.BarrelStabilizer())
                {
                    return(true);
                }
                if (await Buff.Wildfire())
                {
                    return(true);
                }
                if (await Buff.Hypercharge())
                {
                    return(true);
                }
                if (await Turret.AutomationQueen())
                {
                    return(true);
                }
                if (await Turret.Rook())
                {
                    return(true);
                }
                if (await Aoe.Flamethrower())
                {
                    return(true);
                }

                if (Core.Me.ClassLevel < Spells.Drill.LevelAcquired)
                {
                    if (await Buff.Reassemble())
                    {
                        return(true);
                    }
                }

                if (await SingleTarget.GaussRound())
                {
                    return(true);
                }

                if (MachinistSettings.Instance.UseAoe)
                {
                    if (await Aoe.Ricochet())
                    {
                        return(true);
                    }
                }

                return(await Buff.Tactician());
            }

            if (MachinistSettings.Instance.UseAoe)
            {
                if (await Aoe.Bioblaster())
                {
                    return(true);
                }
            }

            if (await SingleTarget.Drill())
            {
                return(true);
            }
            if (await SingleTarget.AirAnchor())
            {
                return(true);
            }

            if (MachinistSettings.Instance.UseAoe)
            {
                if (await Aoe.AutoCrossbow())
                {
                    return(true);
                }
                if (await Aoe.SpreadShot())
                {
                    return(true);
                }
            }

            if (await SingleTarget.HeatBlast())
            {
                return(true);
            }
            if (await SingleTarget.HotShot())
            {
                return(true);
            }
            if (await SingleTarget.CleanShot())
            {
                return(true);
            }
            if (await SingleTarget.SlugShot())
            {
                return(true);
            }
            return(await SingleTarget.SplitShot());
        }