Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
 public override void Reason(E_ActionType actionType)
 {
     if (mCitizen.helicopterReached)
     {
         mFSMSystem.PerformTransition(CitizenTransition.AirPlaneReached);
     }
 }
Exemplo n.º 3
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance < 0.2f)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Rescued);
     }
 }
Exemplo n.º 4
0
 public override void Reason(E_ActionType actionType)
 {
     if (mValue >= 1.0f)
     {
         (mCharacter as BullDemonKing).Killed();
     }
 }
Exemplo n.º 5
0
 public override void Reason(E_ActionType actionType)
 {
     if (mCitizen.rescued)
     {
         mFSMSystem.PerformTransition(CitizenTransition.Rescued);
     }
 }
Exemplo n.º 6
0
 public override void Reason(E_ActionType actionType)
 {
     if (mNormalTimer > 0.99f)
     {
         mFSMSystem.PerformTransition(BearTransition.Disappear);
     }
 }
Exemplo n.º 7
0
    public override void Act(E_ActionType actionType)
    {
        Vector3 pos;

        mBear.MoveToTarget(mTargetPos, out pos);
        mDistance = Vector3.Distance(mCharacter.position, pos);
    }
Exemplo n.º 8
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDroped)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Hold);
     }
 }
Exemplo n.º 9
0
 public override void Reason(E_ActionType actionType)
 {
     if (mReached)
     {
         mCharacter.Killed();
     }
 }
Exemplo n.º 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);
            }
        }
    }
Exemplo n.º 11
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance <= 0.2f)
     {
         mFSMSystem.PerformTransition(BearTransition.Rest);
     }
 }
Exemplo n.º 12
0
 public override void Reason(E_ActionType actionType)
 {
     if (mNormalTime > 0.99f)
     {
         mWolf.Killed();
     }
 }
Exemplo n.º 13
0
 public override void Reason(E_ActionType actionType)
 {
     if (mRecovered)
     {
         mFSMSystem.PerformTransition(HelicopterTransition.Success);
     }
 }
Exemplo n.º 14
0
 public override void Reason(E_ActionType actionType)
 {
     if (mValue >= 1.0f)
     {
         mCharacter.Killed();
     }
 }
Exemplo n.º 15
0
 public override void Reason(E_ActionType actionType)
 {
     if (mAnimIsOver)
     {
         mFSMSystem.PerformTransition(BearTransition.Rest);
     }
 }
Exemplo n.º 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;
            }
        }
    }
Exemplo n.º 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;
        }
    }
Exemplo n.º 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);
            }
        }
    }
Exemplo n.º 19
0
 public override void Reason(E_ActionType actionType)
 {
     if (Vector3.Distance(mCharacter.position, mCharacter.bornPosition) < Define.PATH_STEP)
     {
         mFSM.PerformTransition(HugeFireMonsterTransition.SeaEnemy);
     }
 }
Exemplo n.º 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;
    }
Exemplo n.º 21
0
 public override void Reason(E_ActionType actionType)
 {
     if (mAnimisOver)
     {
         mFSMSystem.PerformTransition(BullDemonKingTransition.Rest);
     }
 }
Exemplo n.º 22
0
 public override void Reason(E_ActionType actionType)
 {
     if (mDistance <= 1.0f)
     {
         mFSMSystem.PerformTransition(BearTransition.SeaEnemy);
     }
 }
Exemplo n.º 23
0
 public override void Reason(E_ActionType actionType)
 {
     if (mReached)
     {
         (mCharacter as BullDemonKing).ReachMiddle();
         mFSMSystem.PerformTransition(BullDemonKingTransition.Rest);
     }
 }
Exemplo n.º 24
0
 public override void Act(E_ActionType actionType)
 {
     if (!mBullDemonKing.IsInvincible)
     {
         mTimer += UnityEngine.Time.deltaTime;
     }
     mCharacter.LookAtCamera();
 }
Exemplo n.º 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);
    }
Exemplo n.º 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;
    }
Exemplo n.º 27
0
 public override void Reason(E_ActionType actionType)
 {
     mDistance = Vector3.Distance(mCharacter.position, mTargetPos);
     if (mDistance < 0.5f)
     {
         mCharacter.Killed();
     }
 }
Exemplo n.º 28
0
 public override void Act(E_ActionType actionType)
 {
     if (!mBear.IsInvincible)
     {
         mTimer += UnityEngine.Time.deltaTime;
     }
     mBear.LookAtCamera();
 }
Exemplo n.º 29
0
 public override void Act(E_ActionType actionType)
 {
     if (mCharacter.MoveTo(mHoldPointList[mIndex].position, 0.01f))
     {
         ++mIndex;
         mIndex %= mHoldPointList.Count;
     }
 }
Exemplo n.º 30
0
 public override void Reason(E_ActionType actionType)
 {
     if (ioo.characterSystem.HasToOrHoldingElite(mCharacter as EliteMonster))
     {
         return;
     }
     mFSMSystem.PerformTransition(EliteMonsterTransition.SeaEnemy);
 }