Exemplo n.º 1
0
        public void UpdateTauntState(TauntState state = TauntState.None)
        {
            // Check for SPELL_AURA_MOD_DETAUNT (applied from owner to victim)
            if (state < TauntState.Taunt && _victim.HasAuraTypeWithCaster(AuraType.ModDetaunt, _owner.GetGUID()))
            {
                state = TauntState.Detaunt;
            }

            if (state == _taunted)
            {
                return;
            }

            Extensions.Swap(ref state, ref _taunted);

            ListNotifyChanged();
            _mgr.NeedClientUpdate = true;
        }
Exemplo n.º 2
0
    void MakeFSM()
    {
        m_fsm                     = new FiniteStateMachine <VFCharacter, RoleState>(this);
        m_attack1State            = new Attack1State(); m_fsm.RegisterState(m_attack1State);
        m_attack2State            = new Attack2State(); m_fsm.RegisterState(m_attack2State);
        m_attack3State            = new Attack3State(); m_fsm.RegisterState(m_attack3State);
        m_battleWalkBackwardState = new BattleWalkBackwardState(); m_fsm.RegisterState(m_battleWalkBackwardState);
        m_battleWalkForwardState  = new BattleWalkForwardState(); m_fsm.RegisterState(m_battleWalkForwardState);
        m_battleWalkLeftState     = new BattleWalkLeftState(); m_fsm.RegisterState(m_battleWalkLeftState);
        m_battleWalkRightState    = new BattleWalkRightState(); m_fsm.RegisterState(m_battleWalkRightState);
        m_defineState             = new DefendState(); m_fsm.RegisterState(m_defineState);
        m_dieState                = new DieState(); m_fsm.RegisterState(m_dieState);
        m_hitState                = new HitState(); m_fsm.RegisterState(m_hitState);
        m_idleState               = new IdleState(); m_fsm.RegisterState(m_idleState);
        m_jumpState               = new JumpState(); m_fsm.RegisterState(m_jumpState);
        m_runState                = new RunState(); m_fsm.RegisterState(m_runState);
        m_walkState               = new WalkState(); m_fsm.RegisterState(m_walkState);
        m_tauntState              = new TauntState(); m_fsm.RegisterState(m_tauntState);

        m_fsm.ChangeState(RoleState.idle02);
    }
Exemplo n.º 3
0
        public void UpdateTauntState(bool victimIsTaunting)
        {
            if (victimIsTaunting)
            {
                _taunted = TauntState.Taunt;
                ListNotifyChanged();
                return;
            }

            // Check for SPELL_AURA_MOD_DETAUNT (applied from owner to victim)
            foreach (AuraEffect eff in _victim.GetAuraEffectsByType(AuraType.ModDetaunt))
            {
                if (eff.GetCasterGUID() == _owner.GetGUID())
                {
                    _taunted = TauntState.Detaunt;
                    ListNotifyChanged();
                    return;
                }
            }

            _taunted = TauntState.None;
            ListNotifyChanged();
        }
Exemplo n.º 4
0
    void Start()
    {
        playerModelDefaultRotation = playerModel.transform.localRotation;
        playerModelClimbRotation   = Quaternion.identity;
        playerModelTauntRotation.SetLookRotation(new Vector3(0, 0, -1), new Vector3(0, 1, 0));

        attackCollider.enabled = false;
        lightningGenerator.SetActive(false);    // temp
        dashAttackCollider.enabled = false;

        shieldCollider.enabled = false;
        ShowShield(false);

        ShowHorn(false);

        playerAnimator = GetComponent <Animator>();

        GameObject.FindGameObjectWithTag("GameSession").GetComponent <SavePlayerState>().RecoverPlayerStatusValues(this);
        staminaRecovery     = 0.0f;
        fullStaminaRecovery = false;

        GameObject guiObject = GameObject.Find("GUI");

        if (guiObject)
        {
            guiManager = guiObject.GetComponent <GUIManager>();
        }

        activeRespawnPoint = initialPosition;
        cameraFade         = GameObject.Find("PlayerCamera").GetComponent <CameraFade>();

        attack    = new AttackState(CalculateFramesFromTime(attackDuration));
        cast      = new CastState(CalculateFramesFromTime(castDuration));
        climb     = new ClimbState();
        dash      = new DashState(CalculateFramesFromTime(dashDuration));
        dead      = new DeadState(CalculateFramesFromTime(deadDuration));
        defense   = new DefenseState();
        drink     = new DrinkState(CalculateFramesFromTime(drinkDuration));
        fall      = new FallState();
        fallcloud = new FallCloudState(CalculateFramesFromTime(fallCloudDuration));
        hit       = new HitState(CalculateFramesFromTime(hitDuration));
        idle      = new IdleState();
        jump      = new JumpState(CalculateFramesFromTime(GetComponent <PlayerMove>().timeToJumpApex));
        refill    = new RefillState(CalculateFramesFromTime(refillDuration));
        taunt     = new TauntState(CalculateFramesFromTime(tauntDuration));
        walk      = new WalkState();
        SetState(idle);

        facingRight          = true;
        jumpAvailable        = true;
        climbLadderAvailable = false;
        beerRefillAvailable  = false;

        justHit            = false;
        jumpFrames         = 0;
        framesInDelayCount = 0;

        camFollow = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraFollow>();

        colliderSize = GetComponent <BoxCollider>().size;

        godMode = false;
    }