Exemple #1
0
        public override void Preload(ISkillCellData cellData, SkillBase skillBase)
        {
            StateParameter stateParm = new StateParameter();

            stateParm.state = ACTOR_STATE.AS_DEATH;
            CompositedSkillCellDesc tmpCellDesc = (CompositedSkillCellDesc)cellData;

            for (int i = 0; i < tmpCellDesc.SkillList.Count; ++i)
            {
                int      skillID   = tmpCellDesc.SkillList[i].SkillId;
                LuaTable skillDesc = ConfigManager.Instance.Skill.GetSkillConfig(skillID);
                if (skillDesc == null)
                {
                    continue;
                }
                SkillClassDisplayDesc skillClass = CoreEntry.gGameDBMgr.GetSkillClassDisplayDesc(skillDesc.Get <int>("skillDisplayID"));
                if (skillClass == null)
                {
                    continue;
                }
                GameObject obj          = CoreEntry.gGameObjPoolMgr.InstantiateSkillBase(skillClass.prefabPath);
                SkillBase  tmpSkillBase = obj.GetComponent <SkillBase>();
                tmpSkillBase.Preload(null, skillID);
                stateParm.skillID = skillID;
                tmpSkillBase.BreakSkill(stateParm);
            }
        }
Exemple #2
0
        public bool CanBeBrokenByHit(StateParameter stateParm, SkillBehitDisplayDesc behitDisplay)
        {
            if (CoreEntry.gGameMgr.IsPvpState())
            {
                bool isBroken = false;
                if (behitDisplay != null)
                {
                    if (m_skillDesc != null)
                    {
                        if (behitDisplay.behitType >= BehitType.BT_HITBACK)
                        {
                            isBroken = true;
                        }
                    }
                }

                if (isBroken)
                {
                    if (m_actor != null)
                    {
                        m_actor.SetFlyText("打断", 0);
                    }
                }
            }
            return(false);
        }
Exemple #3
0
        //public override void FrameUpdate()
        //{

        //}

        public override void OnExit(StateParameter stateParm)
        {
            if (CurParam != null && CurParam.skillID > 0)
            {
                ModuleServer.MS.GSkillCastMgr.HideSkillScope(CurParam.skillID);
            }
        }
Exemple #4
0
        public void BreakSkill(StateParameter stateParm)
        {
            CancelInvoke("StartEndure");
            EndEndure();

            CancelInvoke("AutoCastNextSkill");
            CancelInvoke("SkillCastEnd");

            CancelInvoke("SkillSetAfterAttack");
            CancelInvoke("EndSkillAfterAttack");

            m_curSkillID   = 0;
            m_bAfterAttack = false;

            //技能结束时间
            m_lastestEndTime = Time.time;

            //如果非正常结束
            if (m_curSkillBase != null && m_curSkillBase.CanBeBroke)
            {
                m_curSkillBase.BreakSkill(stateParm);
                m_curSkillBase = null;
            }

            // 删除预警贴花
            if (m_actor != null && m_actor.m_WarningefxObj != null)
            {
                Destroy(m_actor.m_WarningefxObj);
                m_actor.m_WarningefxObj = null;
            }
        }
Exemple #5
0
        public void OnPress(bool isPressed)
        {
            BtnPressedTween(isPressed);
            if (isPressed == false)
            {
                if (m_isPressed && m_isDrag)
                {
                    OnClick(this.gameObject);
                }
                m_isPressed = false;
                //m_isClick = false;
                m_isDrag = false;
            }

            if (isPressed)
            {
                m_isPressed = true;
                m_isDrag    = true;
                //m_sendRatioShowScope = 0.2f;

                if (CoreEntry.gActorMgr.MainPlayer != null)
                {
                    //普攻时不能移动
                    PreProcessWhenNormalAttack(CoreEntry.gActorMgr.MainPlayer);
                    if ((ModuleServer.MS.GSkillCastMgr.InCDCoolState(skillID) == false) && skillDesc != null && SkillBase.GetSkillVersion(CoreEntry.gActorMgr.MainPlayer, skillDesc) == 2)
                    {
                        StateParameter param = new StateParameter();
                        param.state   = ACTOR_STATE.AS_AIMING;
                        param.skillID = skillID;
                        CoreEntry.gActorMgr.MainPlayer.RequestChangeState(param);
                    }
                }
            }
        }
Exemple #6
0
        public behaviac.EBTStatus Stand()
        {
            if (m_actor.IsMainPlayer())
            {
                if (CoreEntry.gActorMgr.MainPlayer.m_bUseAI == false)
                {
                    return(behaviac.EBTStatus.BT_FAILURE);
                }
            }

            if (m_actor.IsNonControl || m_actor.IsHitDownState())
            {
                return(behaviac.EBTStatus.BT_FAILURE);
            }



            StateParameter param = new StateParameter();

            param.state = ACTOR_STATE.AS_STAND;

            m_actor.RequestChangeState(param);

            return(behaviac.EBTStatus.BT_SUCCESS);
        }
Exemple #7
0
        public bool TestCanDo(StateParameter param)
        {
            if (ACTOR_STATE.AS_RUN == param.state && (iState == (int)limitType.Move))
            {
                return(false);
            }

            if (ACTOR_STATE.AS_ATTACK == param.state)
            {
                LuaTable desc = ConfigManager.Instance.Skill.GetSkillConfig(param.skillID);
                if (desc != null)
                {
                    if (desc.Get <int>("showtype") == 2) // 普攻
                    {
                        if ((iState == (int)limitType.Attack))
                        {
                            return(false);
                        }
                    }
                    else // 技能
                    {
                        if ((iState == (int)limitType.Skill))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }
Exemple #8
0
        public override bool CanChangeState(StateParameter stateParm)
        {
            bool rel = !m_isNonControl;

            //是否是特殊状态下改变的
            bool specialFlag = false;

            if (stateParm.state == ACTOR_STATE.AS_DEATH)
            {
                specialFlag = true;
            }

            if (stateParm.state == ACTOR_STATE.AS_BEHIT) // 受击可以打断睡眠
            {
                if (m_actor.limitParam.iState == (int)limitType.Sleep)
                {
                    specialFlag = true;
                }
            }

            if (specialFlag && stateParm.state != ACTOR_STATE.AS_LIMIT) // 受击可以打断睡眠
            {
                m_actor.limitParam.iState = 0;
            }

            //如果设置了特殊标志位,也要返回成功
            if (specialFlag)
            {
                rel = true;
            }

            return(rel);
        }
Exemple #9
0
        public override bool CanChangeState(StateParameter stateParm)
        {
            //死亡状态,只有复活技能可用
            switch (stateParm.state)
            {
            case ACTOR_STATE.AS_DEATH:
            case ACTOR_STATE.AS_RUN:
            case ACTOR_STATE.AS_BEHIT:
            case ACTOR_STATE.AS_ATTACK:
            {
                return(false);
            }

            case ACTOR_STATE.AS_STAND:
                if (stateParm.skillID == 1)
                {
                    return(true);
                }
                break;

            default:
                break;
            }

            return(false);
        }
Exemple #10
0
        public void DoRevive()
        {
            StateParameter param = new StateParameter();

            param.state   = ACTOR_STATE.AS_STAND;
            param.skillID = 1;

            bool ret = RequestChangeState(param);

            // LogMgr.ErrorLog("DoRevive22222+++++++++ :" + m_actor.mBaseAttr.CardRecord.name);

            if (ret)
            {
                //   LogMgr.ErrorLog("DoRevive333333 :" + m_actor.mBaseAttr.CardRecord.name);

                //todo,属性恢复
                Recover();

                //ui恢复
                if (mHealth != null)
                {
                    mHealth.OnResetHP();
                }
            }
            else
            {
                //int nBreak = 1;
            }
        }
Exemple #11
0
        //技能被打断
        public void BreakSkill(StateParameter stateParm)
        {
            if (null != m_skillDesc && (int)SkillType.SKILL_XUANFANZHAN == m_skillDesc.Get <int>("subtype"))
            {
                return;
            }

            if (m_bSendAttackEven && m_actor != null)
            {
                EventParameter eventBuffParam = EventParameter.Get();
                eventBuffParam.intParameter = m_skillID;
                eventBuffParam.goParameter  = m_actor.gameObject;
                eventBuffParam.objParameter = m_actor;
                if (m_hitActor != null)
                {
                    eventBuffParam.goParameter1  = m_hitActor.gameObject;
                    eventBuffParam.objParameter1 = m_hitActor;
                }
                CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_EVENT_ATTACK, eventBuffParam);
                m_bSendAttackEven = false;
            }

            CancelInvoke("AutoLookatTarget");
            CancelInvoke("HideSelf");

            CancelInvoke("CastSkill");
            CancelInvoke("SkillEnd");
            CancelInvoke("Start");

            SkillIsOver();

            //清除skill所有的skillcell
            for (int i = 0; i < m_skillCellObjectlist.Count; ++i)
            {
                m_skillCellObjectlist[i].SetActive(false);
            }

            DestroyEfx();

            if (stateParm != null)
            {
                //死亡,被击状态,删除对应的特效
                if (stateParm.state == ACTOR_STATE.AS_DEATH ||
                    stateParm.state == ACTOR_STATE.AS_BEHIT)
                {
                    if (m_actionEfx != null)
                    {
                        m_actionEfx.DestoryObject();
                    }

                    SendEvent(SkillCellEventType.SE_DESTROY_ACTION_EFX, null);
                }
            }


            CoreEntry.gGameObjPoolMgr.Destroy(this.gameObject);
        }
Exemple #12
0
        public override bool CanChangeState(StateParameter stateParm)
        {
            if (stateParm.state == ACTOR_STATE.AS_DEATH || stateParm.state == ACTOR_STATE.AS_STONE)
            {
                return(true);
            }

            return(!m_isNonControl);
        }
Exemple #13
0
        protected void ExitingTimer()
        {
            PreExiting();

            StateParameter param = new StateParameter();

            param.state = ACTOR_STATE.AS_STAND;
            m_actor.RequestChangeState(param);
        }
Exemple #14
0
        //public override void FrameUpdate()
        //{

        //}

        public override void OnExit(StateParameter stateParm)
        {
            ////入场结束,去掉对应的绳子
            //if (m_cylinderObj != null)
            //{
            //    m_cylinderObj.active = false;
            //}
            //去掉碰撞
            m_actor.RecoverCollider();
        }
Exemple #15
0
        public override void OnExit(StateParameter stateParm)
        {
            //退出跑步
            if (stateParm.state == ACTOR_STATE.AS_RUN || stateParm.state == ACTOR_STATE.AS_RUN_TO_ATTACK)
            {
                return;
            }

            m_actor.StopMove(false);
        }
Exemple #16
0
        void AutoExitState()
        {
            LogMgr.LogError("DizzState, AutoExitState");
            CancelInvoke("ExitBehitState");
            CancelInvoke("AutoExitState");
            m_isNonControl = false;

            StateParameter param = new StateParameter();

            param.state = ACTOR_STATE.AS_STAND;
            m_actor.RequestChangeState(param);
        }
Exemple #17
0
 // 保证受击动作播完
 public void ExitBehitState()
 {
     CancelInvoke("ExitBehitState");
     if (m_beHitState)
     {
         StateParameter stateParm = new StateParameter();
         m_beHitState.OnExit(stateParm);
         m_actor.StopAll(); // 当前动作
         m_actor.PlayAction(dizzyAction);
         m_beHitState = null;
     }
 }
Exemple #18
0
        public override void OnExit(StateParameter stateParm)
        {
            CancelInvoke("ExitBehitState");
            CancelInvoke("AutoExitState");

            if (stateParm.state != m_state)
            {
                if (efxObj)
                {
                    Destroy(efxObj);
                }
            }
        }
Exemple #19
0
        //能否切换状态
        public override bool CanChangeState(StateParameter stateParm)
        {
            if (stateParm.state == ACTOR_STATE.AS_BEHIT)
            {
                return(true);
            }
            else if (stateParm.state == ACTOR_STATE.AS_ATTACK)
            {
                return(true);
            }

            return(false);
        }
Exemple #20
0
        public void DoRevive()
        {
            StateParameter param = new StateParameter();

            param.state   = ACTOR_STATE.AS_STAND;
            param.skillID = 1;

            bool ret = RequestChangeState(param);

            if (ret)
            {
                Recover();
            }
        }
Exemple #21
0
        public override void OnExit(StateParameter stateParm)
        {
            //退出跑步
            if (stateParm.state == ACTOR_STATE.AS_RUN)
            {
                //AS_RUN状态,就不stopmove了
                return;
            }

            ActorObj actorObj = m_actor.GetOwnObject().GetComponent <ActorObj>();

            actorObj.StopMove(false);
            actorObj.OnExitState(ACTOR_STATE.AS_RUN);
        }
Exemple #22
0
        private void AutoExitState()
        {
            CancelInvoke("AutoExitState");

            if (null == m_actor)
            {
                return;
            }

            StateParameter param = new StateParameter();

            param.state = ACTOR_STATE.AS_STAND;
            m_actor.RequestChangeState(param);
        }
Exemple #23
0
        public override void ForceToRevive()
        {
            base.ForceToRevive();
            StateParameter param = new StateParameter();

            param.state   = ACTOR_STATE.AS_STAND;
            param.skillID = 1;
            EnterState(param);
            Recover(false);
            if (mHealth != null)
            {
                mHealth.OnCreateHPBar();
            }
        }
Exemple #24
0
        private void PreLoadSkill(int skillID)
        {
            StateParameter sp = new StateParameter();

            sp.state = ACTOR_STATE.AS_DEATH;
            GameObject obj = CoreEntry.gGameObjPoolMgr.InstantiateSkillBase("Skill/SkillBase");

            if (null != obj)
            {
                SkillBase skillBase = obj.GetComponent <SkillBase>();
                skillBase.Preload(null, skillID);
                sp.skillID = skillID;
                skillBase.BreakSkill(sp);
            }
        }
Exemple #25
0
        public override void OnExit(StateParameter stateParm)
        {
            m_actor.StopAction(m_dieAction);

            //死亡复活,保护时间
            m_actor.RecoverHealth(3);

            CancelInvoke("AutoDestory");
            if (null != tp)
            {
                Destroy(tp);
            }
            CancelInvoke("DeathEnd");
            m_isDeathEnd = true;
        }
Exemple #26
0
        void EventFunction(GameEvent ge, EventParameter parameter)
        {
            switch (ge)
            {
            case GameEvent.GE_PLAYER_RECOVER:
            {
                if (parameter.intParameter != entityid)
                {
                    break;
                }

                StateParameter param = new StateParameter();
                param.state   = ACTOR_STATE.AS_STAND;
                param.skillID = 1;

                bool ret = RequestChangeState(param);
                if (ret)
                {
                    Recover();
                }
            }
            break;

            case GameEvent.GE_PLAYER_RESET_HP:
            {
                //todo,属性恢复  --- 喝血瓶
                Recover();
            }
            break;

            case GameEvent.GE_BOSS_SKILL:
            {
                m_bBossSkill = true;
            }
            break;

            case GameEvent.GE_BOSS_SKILL_END:
            {
                m_bBossSkill = false;

                IsEscapeBoss = false;
            }
            break;

            default:
                break;
            }
        }
Exemple #27
0
        public override bool CanChangeState(StateParameter stateParm)
        {
            if (stateParm.state == ACTOR_STATE.AS_DEATH)
            {
                return(true);
            }

            //if (stateParm.state == ACTOR_STATE.AS_RUN) // 移动
            //    OnRun();

            if (stateParm.state == ACTOR_STATE.AS_BEHIT) // 受击
            {
                OnBeHit();
            }

            return(Param == null || Param.iState == 0);
        }
Exemple #28
0
        public void EndEnterState()
        {
            CancelInvoke("EndEnterState");

            m_isNonControl = false;

            StateParameter param = new StateParameter();

            param.state = ACTOR_STATE.AS_STAND;
            m_actor.RequestChangeState(param);

            //发送消息,激活状态
            EventParameter eventParam = EventParameter.Get();

            eventParam.intParameter = m_actor.entityid;
            CoreEntry.gEventMgr.TriggerEvent(GameEvent.GE_ACTOR_CAN_BEHIT, eventParam);
        }
Exemple #29
0
        public override void ForceToRevive()
        {
            base.ForceToRevive();
            StateParameter param = new StateParameter();

            param.state   = ACTOR_STATE.AS_STAND;
            param.skillID = 1;

            EnterState(param);

            // LogMgr.ErrorLog("DoRevive22222+++++++++ :" + m_actor.mBaseAttr.CardRecord.name);


            //   LogMgr.ErrorLog("DoRevive333333 :" + m_actor.mBaseAttr.CardRecord.name);

            //todo,属性恢复
            Recover(false);
        }
Exemple #30
0
        void SetTakeAwayTarget(DamageParam damageParam, bool bIsMonster)
        {
            if (bIsMonster)
            {
                if (damageParam.behitActor != null)
                {
                    ActorObj actor = damageParam.behitActor;
                    if (actor != null && actor.IsDeath() == false && actor.IsGod == false && actor.CanKnock == 0)
                    {
                        //只能被带走一次
                        if (actor.BeTakenAway == false)
                        {
                            if (!m_TakeAwayGameObjectMap.ContainsKey(actor.entityid))
                            {
                                m_TakeAwayGameObjectMap.Add(actor.entityid, damageParam.behitActor.gameObject);
                                actor.CanotCurveMove();

                                actor.BeTakenAway      = true;
                                actor.BeTakenAwayOwner = gameObject;

                                //带走的时候是否不能动
                                if (m_param.bCanNotMoveWhenTakenAway)
                                {
                                    actor.IgnoredGravityMotion = true;

                                    //需要打断技能
                                    StateParameter stateParm = new StateParameter();
                                    stateParm.state       = ACTOR_STATE.AS_BEHIT;
                                    stateParm.AttackActor = actor;

                                    actor.m_AttackState.BreakSkill(stateParm);

                                    //能否切换到被击状态
                                    actor.RequestChangeState(stateParm);

                                    actor.StopAll();
                                    actor.PlayAction("hit011", false);
                                }
                            }
                        }
                    }
                }
            }
        }