Beispiel #1
0
    public override void Act(E_ActionType actionType)
    {
        string areaName = mCharacter.appearArea;

        if (!AreaManager.Instance.IsPositionInArea(areaName, mNextPos))
        {
            AreaManager.Instance.GetExitOrRandPositionInArea(areaName, ref mNextPos, mIndex);
            mNextPos.y = mCharacter.position.y;
        }
        if (ioo.characterSystem.HasNeighbor(mCharacter) && mTimer <= 0)
        {
            mTimer = 2;
            AreaManager.Instance.GetExitOrRandPositionInArea(areaName, ref mNextPos, mIndex);
            mNextPos.y = mCharacter.position.y;
        }
        else
        {
            mTimer -= Time.deltaTime;
        }
        if (mCharacter.MoveTo(mNextPos, 0.25f))
        {
            AreaManager.Instance.GetExitOrRandPositionInArea(areaName, ref mNextPos, mIndex);
            mNextPos.y = mCharacter.position.y;
        }
    }
Beispiel #2
0
 public override void Reason(E_ActionType actionType)
 {
     if (mCitizen.helicopterReached)
     {
         mFSMSystem.PerformTransition(CitizenTransition.AirPlaneReached);
     }
 }
Beispiel #3
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance < 0.2f)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Rescued);
     }
 }
Beispiel #4
0
 public override void Reason(E_ActionType actionType)
 {
     if (mValue >= 1.0f)
     {
         (mCharacter as BullDemonKing).Killed();
     }
 }
 public override void Reason(E_ActionType actionType)
 {
     if (mCitizen.rescued)
     {
         mFSMSystem.PerformTransition(CitizenTransition.Rescued);
     }
 }
Beispiel #6
0
 public override void Reason(E_ActionType actionType)
 {
     if (mNormalTimer > 0.99f)
     {
         mFSMSystem.PerformTransition(BearTransition.Disappear);
     }
 }
Beispiel #7
0
    public override void Act(E_ActionType actionType)
    {
        Vector3 pos;

        mBear.MoveToTarget(mTargetPos, out pos);
        mDistance = Vector3.Distance(mCharacter.position, pos);
    }
Beispiel #8
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDroped)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Hold);
     }
 }
Beispiel #9
0
 public override void Reason(E_ActionType actionType)
 {
     if (mReached)
     {
         mCharacter.Killed();
     }
 }
Beispiel #10
0
    public override void Act(E_ActionType actionType)
    {
        mNormalTimer = mCharacter.AnimNormalizedTime("firecricle");
        mAnimisOver  = mCharacter.AnimIsOver("firecricle");
        if (mNormalTimer < 0.7f)
        {
            if (!mBulldemonKing.IsInvincible)
            {
                mBeBreaked = true;
                mBulldemonKing.OnSkillBreaked();
            }
        }
        else
        {
            if (mBulldemonKing.IsInvincible)
            {
                // 回复正常播放动画速度
                mCharacter.AnimSpeed(1.0f);
                // 清除射击点
                EventDispatcher.TriggerEvent(EventDefine.Event_DisActive_HitPoint);
            }

            if (mAnimisOver)
            {
                // 相机震动
                ioo.cameraManager.BossShortShake();

                mBulldemonKing.CrashPoint.AddScreenCrash();

                // 对玩家造成伤害
                int[] args = new int[] { -1, mCharacter.attr.baseAttr.id, mCharacter.attr.baseAttr.damageValue };
                ioo.gameEventSystem.NotifySubject(GameEventType.PlayerOnDamage, args);
            }
        }
    }
Beispiel #11
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance <= 0.2f)
     {
         mFSMSystem.PerformTransition(BearTransition.Rest);
     }
 }
Beispiel #12
0
 public override void Reason(E_ActionType actionType)
 {
     if (mNormalTime > 0.99f)
     {
         mWolf.Killed();
     }
 }
Beispiel #13
0
 public override void Reason(E_ActionType actionType)
 {
     if (mRecovered)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Success);
     }
 }
 public override void Reason(E_ActionType actionType)
 {
     if (mValue >= 1.0f)
     {
         mCharacter.Killed();
     }
 }
Beispiel #15
0
 public override void Reason(E_ActionType actionType)
 {
     if (mAnimIsOver)
     {
         mFSMSystem.PerformTransition(BearTransition.Rest);
     }
 }
Beispiel #16
0
    //public override void DoBeforeEntering()
    //{
    //    mAttacked = false;
    //    switch (mCharacter.actionType)
    //    {
    //        case E_ActionType.Normal:
    //            mCharacter.PlayAnim("attack0", 2);
    //            break;
    //        case E_ActionType.AttackCitizen:
    //        case E_ActionType.AttackNpc:
    //            mCharacter.PlayAnim("attack1", 3);
    //            break;
    //    }
    //}

    public override void Act(E_ActionType actionType)
    {
        switch (actionType)
        {
        case E_ActionType.Normal:
            mAttacked = mCharacter.AnimIsOver("attack0", 2);
            break;

        case E_ActionType.AttackCitizen:
        case E_ActionType.AttackNpc:
            mAttacked = mCharacter.AnimIsOver("attack1", 3);
            break;
        }

        if (mAttacked)
        {
            switch (actionType)
            {
            case E_ActionType.Normal:
                mCharacter.Hurt();
                break;

            case E_ActionType.AttackCitizen:
            case E_ActionType.AttackNpc:

                break;
            }
        }
    }
Beispiel #17
0
    public override void Act(E_ActionType actionType)
    {
        if (mBallType == E_FireBall.Ready)
        {
            mAnimIsOver = mCharacter.AnimIsOver("ball0");
            if (mAnimIsOver)
            {
                mBallType = E_FireBall.Ball;
                mCharacter.PlayAnim("ball1", 9);
                EventDispatcher.TriggerEvent(EventDefine.Event_Bear_Use_Skill_Ball);
                return;
            }
        }

        if (mBallType == E_FireBall.Ball)
        {
            mNormalTimer = mCharacter.AnimNormalizedTime("ball1");
            if (mNormalTimer > 30)
            {
                mBallType = E_FireBall.Success;
                EventDispatcher.TriggerEvent(EventDefine.Event_DisActive_HitPoint);
            }
            else
            {
                if (!mBear.IsInvincible)
                {
                    mBeBreaked = true;
                    mBear.OnSkillBreaked();
                }
            }
            return;
        }
    }
Beispiel #18
0
    public override void Reason(E_ActionType actionType)
    {
        if (mBullDemonKing.isDead)
        {
            mFSMSystem.PerformTransition(BullDemonKingTransition.NoHealth);
            return;
        }

        if (mTimer >= 2.0f)
        {
            if (mBullDemonKing.NeedBack())
            {
                mFSMSystem.PerformTransition(BullDemonKingTransition.NotInRightPosition);
                return;
            }


            bool skillIsOut = mBullDemonKing.CurrentLocationSkillIsOut();
            if (!skillIsOut)
            {
                mBullDemonKing.UseSkill();
            }
            else
            {
                mBullDemonKing.NextLocation();
                mFSMSystem.PerformTransition(BullDemonKingTransition.NotInRightPosition);
            }
        }
    }
Beispiel #19
0
 public override void Reason(E_ActionType actionType)
 {
     if (Vector3.Distance(mCharacter.position, mCharacter.bornPosition) < Define.PATH_STEP)
     {
         mFSM.PerformTransition(HugeFireMonsterTransition.SeaEnemy);
     }
 }
Beispiel #20
0
    public override void Act(E_ActionType actionType)
    {
        Vector3 pos;

        mWolf.MoveToTarget(mTargetPos, out pos);
        mReached = Vector3.Distance(mCharacter.position, pos) < 1.0f ? true : false;
    }
Beispiel #21
0
 public override void Reason(E_ActionType actionType)
 {
     if (mAnimisOver)
     {
         mFSMSystem.PerformTransition(BullDemonKingTransition.Rest);
     }
 }
Beispiel #22
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance <= 1.0f)
     {
         mFSMSystem.PerformTransition(BearTransition.SeaEnemy);
     }
 }
Beispiel #23
0
 public override void Reason(E_ActionType actionType)
 {
     if (mReached)
     {
         (mCharacter as BullDemonKing).ReachMiddle();
         mFSMSystem.PerformTransition(BullDemonKingTransition.Rest);
     }
 }
Beispiel #24
0
 public override void Act(E_ActionType actionType)
 {
     if (!mBullDemonKing.IsInvincible)
     {
         mTimer += UnityEngine.Time.deltaTime;
     }
     mCharacter.LookAtCamera();
 }
Beispiel #25
0
    public override void Act(E_ActionType actionType)
    {
        Vector3 targetPos = ioo.cameraManager.position - ioo.cameraManager.parcentRight * 3 + ioo.cameraManager.parcentForward;
        Vector3 pos;

        mBear.MoveToTarget(targetPos, out pos);
        mDistance = Vector3.Distance(targetPos, mCharacter.position);
    }
Beispiel #26
0
    public override void UpdateFSMAI(E_ActionType actionType)
    {
        float speed         = attr.baseAttr.baseSpeed;
        float rotationSpeed = attr.baseAttr.baseRotationSpeed;

        mGameObject.transform.position         += mDirector.normalized * Time.deltaTime * speed - Vector3.up * 0.4f * Time.deltaTime;
        mGameObject.transform.localEulerAngles += rotationSpeed * Time.deltaTime * Vector3.right;
    }
 public override void Reason(E_ActionType actionType)
 {
     mDistance = Vector3.Distance(mCharacter.position, mTargetPos);
     if (mDistance < 0.5f)
     {
         mCharacter.Killed();
     }
 }
Beispiel #28
0
 public override void Act(E_ActionType actionType)
 {
     if (!mBear.IsInvincible)
     {
         mTimer += UnityEngine.Time.deltaTime;
     }
     mBear.LookAtCamera();
 }
 public override void Act(E_ActionType actionType)
 {
     if (mCharacter.MoveTo(mHoldPointList[mIndex].position, 0.01f))
     {
         ++mIndex;
         mIndex %= mHoldPointList.Count;
     }
 }
 public override void Reason(E_ActionType actionType)
 {
     if (ioo.characterSystem.HasToOrHoldingElite(mCharacter as EliteMonster))
     {
         return;
     }
     mFSMSystem.PerformTransition(EliteMonsterTransition.SeaEnemy);
 }