Beispiel #1
0
    public override void UpdateAI()
    {
        if (mCurrentState == AIState.Teleporting && mTeleport.CanTeleport())
        {
            mNumTeleports++;
            mTeleport.Teleport(mNumTeleports == mMaxTeleports);

            if (mNumTeleports == mMaxTeleports)
            {
                mCurrentState = AIState.Throwing;

                mMaxTeleports = Random.Range(4, 7) + mCurrentPhase;
            }
        }
        else if (mCurrentState == AIState.Throwing)
        {
            SimpleMovement.OrientToDirection(mSimpleMovement.subMesh, TowardPlayer());
            mProjectileThrower.ThrowProjectile(20, TowardPlayer());

            mCurrentState = AIState.Delay;

            mNumTeleports = 0;
            mDelayTimer   = 0f;
        }
        else if (mCurrentState == AIState.Delay)
        {
            if (mDelayTimer > 1.5f - mCurrentPhase * 0.5f)
            {
                mCurrentState = AIState.Teleporting;
                mNumTeleports = 0;
            }
        }
    }
Beispiel #2
0
    private void ThrowProjectile()
    {
        SimpleMovement.OrientToDirection(GetComponent <SimpleMovement>().subMesh, TargetDirection());

        int magic = GetComponent <CharacterStatistics>().ModifiedStatValue(CharacterStatType.Magic, gameObject);

        float speedModifier = 1f;

        if (Game.instance.playerStats.IsItemEquipped <BlackCoffee>())
        {
            speedModifier = 0.65f;
        }

        mProjectileThrower.ThrowProjectile(magic, TargetDirection(), null, speedModifier);

        mThrowCounter = 2;
    }