Ejemplo n.º 1
0
        } //Update

        private void Kick()
        {
            //Checks if the player is in range
            var playersInRanger = kickShape.GetCharactersInRange<Player>();

            if (playersInRanger.Length > 0)
            {
                //Hits the player
                currentTarget = playersInRanger[0];

                //Deals damage to the player
                currentTarget.TakeDamage(GetAbility("Kick").GetDamage());
            }

            GetAbility("Kick").Complete(this);
        } //Kick
Ejemplo n.º 2
0
        } //Update

        private void Claw()
        {
            Debug.Log("Im clawing");
            //Checks if the player is in range
            var playersInRange = clawShape.GetCharactersInRange<Player>();

            if (playersInRange.Length > 0)
            {
                //Hits the player
                currentTarget = playersInRange[0];

                //Deals damage to the player
                currentTarget.TakeDamage(GetAbility("Claw").GetDamage());

                //Adds the bleed effect to the player
                currentTarget.AddStatus(new Bleed(3));
            }

            //Set the kick ability cooldown
            GetAbility("Claw").SetCoolDown();

            isCasting = false;
        } //Claw
Ejemplo n.º 3
0
        } //Ice

        private void Spikes()
        {
            // Checking if the player is in range
            var players = spikeDetector.GetCharactersInRange<Player>();

            if (players.Length > 0)
            {
                players[0].TakeDamage(GetAbility("Spikes").GetDamage());
                players[0].AddStatus(new Bleed(2));
            }

            //Begin the wind down timer
            GetAbility("Spikes").Complete(this);
        } //Spikes
Ejemplo n.º 4
0
        } //Update

        private void Hit()
        {
            //Checks if the player is in range
            var playersInRange = hitShape.GetCharactersInRange<Player>();

            if (playersInRange.Length > 0)
            {
                //Hits the player
                currentTarget = playersInRange[0];

                //Deals damage to the player
                currentTarget.TakeDamage(GetAbility("Hit").GetDamage());

                //Give the player the root status
                currentTarget.AddStatus(new Root(1));
            }

            GetAbility("Hit").Complete(this);
        } //Hit
Ejemplo n.º 5
0
        protected void CheckCollision()
        {
            var characters = areaChecker.GetCharactersInRange <Character>();

            // Looping throughout all the characters
            foreach (var character in characters)
            {
                // attacking the character if its against that type
                if (isAgainstPlayer && character is Player ||
                    !isAgainstPlayer && character is Enemy)
                {
                    // Adds all the statuses to the character
                    foreach (var status in statuses)
                    {
                        character.AddStatus(status);
                    }
                    Attack(character);
                }
            }
        }
Ejemplo n.º 6
0
        } //Update

        //This method uses the stab ability
        private void Stab()
        {
            //Checks if the plaeyr is in range
            var playersInRange = stabShape.GetCharactersInRange<Player>();

            if (playersInRange.Length > 0)
            {
                //Hits the player
                currentTarget = playersInRange[0];

                //Deals damage to the player
                currentTarget.TakeDamage(GetAbility("Stab").GetDamage());

                currentTarget.AddStatus(new Bleed(3));
            }

            //Start the hit ability cooldown
            GetAbility("Stab").SetCoolDown();

            isCasting = false;
        } //Stab
Ejemplo n.º 7
0
        } //Update

        //This method uses the backstab ability. 
        private void Backstab()
        {
            //Checks if the plaeyr is in range
            var playersInRange = stabShape.GetCharactersInRange<Player>();

            if (playersInRange.Length > 0)
            {
                //Hits the player
                currentTarget = playersInRange[0];

                //Deals damage to the player
                currentTarget.TakeDamage(GetAbility("Backstab").GetDamage());

                //Give the player the root status
                currentTarget.AddStatus(new Bleed(5));
            }

            //Start the hit ability cooldown
            GetAbility("Backstab").Complete(this);
            animator.SetBool(IsStabbing, false);
            Debug.Log("Done stabbing");
        } //Backstab