Esempio n. 1
0
        virtual public void OnHitnew(int _actionID, uint _attackerID, uint woundId, List <int> harm)
        {//新版受击表现处理,目前未接入系统
            if (theOwner.CurrentMotionState == MotionState.DEAD)
            {
                return;
            }
            if (!HitState.dataMap.ContainsKey(theOwner.hitStateID))
            {
                //OnHitold(_actionID, _attackerID, woundId, harm);
                return;
            }
            SkillAction action = SkillAction.dataMap[_actionID];

            if (action.hitSfx != null && action.hitSfx[0] > 0 && MogoWorld.showSkillFx)
            {
                theOwner.PlayFx((int)action.hitSfx[0]);
            }
            List <int> hitAction = action.hitAction;

            if (hitAction == null || hitAction.Count == 0)
            {
                return;
            }
            int  _act    = Utils.Choice <int>(hitAction);
            bool cfgShow = true;

            if (((theOwner is EntityMonster) && (theOwner as EntityMonster).ShowHitAct != 0) ||
                ((theOwner is EntityDummy) && (theOwner as EntityDummy).ShowHitAct != 0) ||
                ((theOwner is EntityMercenary) && (theOwner as EntityMercenary).ShowHitAct != 0))
            {
                cfgShow = false;
            }
            //string actName = theOwner.CurrActStateName();
            if (_act > 0 && theOwner.curHp > 0 && cfgShow)
            {//如果没填就不做受击表现
                theOwner.ChangeMotionState(MotionState.HIT, _actionID, _attackerID);
            }
            if (!(theOwner is EntityMonster) && action.hitExtraSpeed != 0)
            {
                theOwner.motor.SetExrtaSpeed(-action.hitExtraSpeed);
                theOwner.motor.SetMoveDirection(theOwner.Transform.forward);
                TimerHeap.AddTimer <EntityParent>((uint)(action.hitExtraSl * 1000), 0, (e) => { e.motor.SetExrtaSpeed(0); }, theOwner);
            }
        }