コード例 #1
0
 private void JumpOrNot()
 {
     if (!_jumpIt)
     {
         _jumpIt   = true;
         _currMove = GhostKingMoves.JumpAttack;
     }
     else
     {
         _attacking = false;
         _jumpIt    = false;
     }
 }
コード例 #2
0
    private void HandAttack()
    {
        if (!_invokeAllowed)
        {
            _invokeAllowed = MoveToCenterRoom(transform, roomCenterOffSet);
        }
        else
        {
            print("entered");
            if (_timeHandAttack <= 0)
            {
                if (!_attackingHand)
                {
                    //animations things;
                    ghostKingAnimator.SetBool("isInvoking", true);
                    ghostKingAnimator.SetBool("isIdle", false);

                    // thrown in the cyclop's throw frame

                    InvokeMonsters();

                    _attackingHand  = true;
                    _timeHandAttack = timeHandAttack;
                }
                else
                {
                    ghostKingAnimator.SetBool("isInvoking", false);
                    ghostKingAnimator.SetBool("isIdle", true);
                    _attackingHand = false;
                    _invokeAllowed = false;
                    _recoverLife   = true;
                    _currMove      = GhostKingMoves.Heal;
                }
            }
            else
            {
                _timeHandAttack -= Time.deltaTime;
            }
        }
    }
コード例 #3
0
    public override void Attack()
    {
        if (stateHasChanged)
        {
            StopMovement();
        }

        if (!_attacking)
        {
            _currMove  = ChooseAttack();
            _attacking = true;
        }
        else
        {
            switch (_currMove)
            {
            case GhostKingMoves.HandAttack:
                HandAttack();
                break;

            case GhostKingMoves.JumpAttack:
                JumpAttack();
                break;

            case GhostKingMoves.SwordAttack:
                SwordAttack();
                break;

            case GhostKingMoves.BreathAttack:
                BreathAttack();
                break;

            case GhostKingMoves.Heal:
                Heal();
                break;
            }
        }
    }