Esempio n. 1
0
 protected virtual void SpecialAttack()
 {
     if(Mathf.Abs(Input.GetAxis(controllerLeftHorizontal)) > 0.2f)
         character.Action(specialForwardAttack);
     else
         character.Action(specialAttack);
     StopBuffer();
 }
Esempio n. 2
0
 public override float StartBehavior(EnemyController enemyController, Character character)
 {
     if (lookAtPlayer == true)
     {
         character.LookAt(character.Target.transform);
     }
     character.SetAutoCombo(autoCombo);
     character.Action(attackController);
     return(Mathf.Max(0.01f, base.StartBehavior(enemyController, character)));
     //return base.StartBehavior(enemyController, character);
 }
Esempio n. 3
0
        public void HasHit(Character target)
        {
            target.PlaySound(attackBehavior.OnHitSound);
            //user.SetTarget(target);
            user.HitConfirm();
            if (attackBehavior.OnHitCombo != null)
                user.Action(attackBehavior.OnHitCombo);
            if (attackBehavior.UserKnockbackX != 0 || attackBehavior.UserKnockbackZ != 0)
            {
                user.SetSpeed(attackBehavior.UserKnockbackX * -direction, 0);
                user.Jump(attackBehavior.UserKnockbackZ);
            }

            //Feedback
            if (attackBehavior.OnHitAnimation != null)
                Instantiate(attackBehavior.OnHitAnimation, target.ParticlePoint.position, Quaternion.identity);
            if (attackBehavior.HitStopGlobal == false && attackBehavior.HitStop > 0) 
            {
                target.SetCharacterMotionSpeed(0, attackBehavior.HitStop);
                if(attackBehavior.HitStopUser == true)
                    user.SetCharacterMotionSpeed(0, attackBehavior.HitStop);
                else if (attackBehavior.HitStopProjectile == true)
                {
                    AttackMotionSpeed(0);
                    StartCoroutine(MotionSpeedCoroutine(attackBehavior.HitStop));
                }
            }

            if (attackBehavior.ThrowState == true)
            {
                target.Throw(user.ThrowPoint, direction, user.SpriteRenderer.transform.localScale.x);
                user.SetCharacterToThrow(target);
            }
            if (attackBehavior.IsMultiHit == false)
            {
                ActionEnd();
            }
            else
            {
                ActionUnactive();
            }
        }
Esempio n. 4
0
        protected virtual void NormalAttack(Character character)
        {
            // Aerien
            if (character.InAir == true && Mathf.Abs(Input.GetAxis(controllerLeftHorizontal)) > 0.2f)
            {
                character.Action(jumpForwardAttack);
            }
            else if (character.InAir == true && Input.GetAxis(controllerLeftVertical) > 0.2f)
            {
                character.Action(jumpUpAttack);
            }
            else if (character.InAir == true && Input.GetAxis(controllerLeftVertical) < -0.2f)
            {
                character.Action(jumpDownAttack);
            }
            else if (character.InAir == true)
            {
                character.Action(jumpDefaultAttack);
            }

            // Ground
            else if (isRunning == true)
            {
                runInput = 0;
                isRunning = false;
                character.Action(groundRunAttack);
            }
            else if(Mathf.Abs(Input.GetAxis(controllerLeftHorizontal)) > 0.2f)
            {
                character.Action(groundDefaultAttack);
            }
            else
            {
                character.Action(groundDefaultAttack);
            }
            StopBuffer();
        }