Пример #1
0
        public void ExecCommand(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && player.Captain)
            {
                player.Captain.get_handle().ActorControl.CmdMoveDirection(cmd, (int)this.Degree);
                if (!player.m_bMoved)
                {
                    player.m_bMoved = true;
                    Singleton <EventRouter> .get_instance().BroadCastEvent <Player>(EventID.FirstMoved, player);
                }
                if (ActorHelper.IsHostCtrlActor(ref player.Captain) && this.nSeq <= 255 && this.nSeq >= 0)
                {
                    Singleton <FrameSynchr> .GetInstance().m_MoveCMDReceiveTime[(int)this.nSeq] = (uint)(Time.realtimeSinceStartup * 1000f);

                    uint num = (uint)(Time.realtimeSinceStartup * 1000f) - Singleton <FrameSynchr> .GetInstance().m_MoveCMDSendTime[(int)this.nSeq];

                    Singleton <FrameSynchr> .GetInstance().m_ExecMoveCmdTotalCount += 1uL;

                    Singleton <FrameSynchr> .GetInstance().m_execMoveCmdAverage = (int)(((float)Singleton <FrameSynchr> .GetInstance().m_execMoveCmdAverage *(Singleton <FrameSynchr> .GetInstance().m_ExecMoveCmdTotalCount - 1f) + num) / Singleton <FrameSynchr> .GetInstance().m_ExecMoveCmdTotalCount);

                    if (num > Singleton <FrameSynchr> .GetInstance().m_execMoveCmdMax)
                    {
                        Singleton <FrameSynchr> .GetInstance().m_execMoveCmdMax = num;
                    }
                }
            }
        }
 public void SendEvent <ParamType>(GameSkillEventDef _event, PoolObjHandle <ActorRoot> _src, ref ParamType _param, GameSkillEventChannel _channel = GameSkillEventChannel.Channel_HostCtrlActor)
 {
     if (!_src)
     {
         return;
     }
     if (_channel == GameSkillEventChannel.Channel_HostCtrlActor)
     {
         if (ActorHelper.IsHostCtrlActor(ref _src) || Singleton <WatchController> .GetInstance().IsWatching)
         {
             this.SendEvent <ParamType>(_event, ref _param);
         }
     }
     else if (_channel == GameSkillEventChannel.Channel_HostActor)
     {
         if (ActorHelper.IsHostActor(ref _src) || Singleton <WatchController> .GetInstance().IsWatching)
         {
             this.SendEvent <ParamType>(_event, ref _param);
         }
     }
     else if (_channel == GameSkillEventChannel.Channel_AllActor)
     {
         this.SendEvent <ParamType>(_event, ref _param);
     }
 }
Пример #3
0
        public void CaptainCallActorSwitch()
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(this.actorPtr.handle.TheActorMeta.PlayerId);

            if (player != null)
            {
                bool flag     = ActorHelper.IsHostCtrlActor(ref this.hostActor);
                bool isAutoAI = this.hostActor.handle.ActorControl.m_isAutoAI;
                player.Captain.handle.ActorControl.ClearMoveCommand();
                player.Captain.handle.ActorControl.SetSelected(false);
                player.Captain.handle.ActorControl.m_isControledByMan = true;
                player.Captain.handle.ActorControl.SetAutoAI(false);
                if (flag)
                {
                    player.Captain.handle.HudControl.SetSelected(false);
                    this.SpawnHostActorFixedHud();
                }
                player.SetCallCaptain((uint)this.actorPtr.handle.TheActorMeta.ConfigId, this.actorPtr.handle.ObjID);
                player.Captain.handle.ActorControl.SetSelected(true);
                player.Captain.handle.ActorControl.SetAutoAI(isAutoAI);
                if (flag)
                {
                    player.Captain.handle.HudControl.SetSelected(true);
                    DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.actorPtr, this.actorPtr);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, ref defaultGameEventParam);
                }
            }
        }
Пример #4
0
 public void SendEvent <ParamType>(GameSkillEventDef _event, PoolObjHandle <ActorRoot> _src, ref ParamType _param, GameSkillEventChannel _channel = GameSkillEventChannel.Channel_HostCtrlActor)
 {
     if (!_src)
     {
         return;
     }
     if (_channel == GameSkillEventChannel.Channel_HostCtrlActor)
     {
         if (ActorHelper.IsHostCtrlActor(ref _src))
         {
             this.SendEvent <ParamType>(_event, ref _param);
         }
     }
     else if (_channel == GameSkillEventChannel.Channel_HostActor)
     {
         if (ActorHelper.IsHostActor(ref _src))
         {
             this.SendEvent <ParamType>(_event, ref _param);
         }
     }
     else if (_channel == GameSkillEventChannel.Channel_AllActor)
     {
         this.SendEvent <ParamType>(_event, ref _param);
     }
 }
Пример #5
0
 private void OnHostActorClearMove(ref DefaultGameEventParam prm)
 {
     if (ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         this.PreMoveDirection = -2147483648;
     }
 }
        public void ChangeGoldCoinInBattle(int changeValue, bool isIncome, bool floatDigit = false, Vector3 position = default(Vector3), bool isLastHit = false, PoolObjHandle <ActorRoot> target = default(PoolObjHandle <ActorRoot>))
        {
            int num = this.m_goldCoinInBattle;

            this.m_goldCoinInBattle += changeValue;
            if (changeValue > 0 && isIncome)
            {
                this.m_goldCoinIncomeInBattle   += changeValue;
                this.m_MaxGoldCoinIncomeInBattle = ((this.m_MaxGoldCoinIncomeInBattle > changeValue) ? this.m_MaxGoldCoinIncomeInBattle : changeValue);
            }
            DebugHelper.Assert(this.m_goldCoinInBattle >= 0, "Wo ri, zhe zenme keneng");
            bool        flag        = false;
            HeroWrapper heroWrapper = this.actorPtr.handle.ActorControl as HeroWrapper;

            if (heroWrapper != null)
            {
                PoolObjHandle <ActorRoot> callActor = heroWrapper.GetCallActor();
                if (callActor && callActor.handle.Visible && ActorHelper.IsHostCtrlActor(ref callActor))
                {
                    flag = true;
                }
            }
            if (floatDigit && changeValue > 0 && isIncome && ((this.actor.Visible && ActorHelper.IsHostCtrlActor(ref this.actorPtr)) || flag))
            {
                if (position.x == 0f && position.y == 0f && position.z == 0f)
                {
                    position = this.actor.myTransform.position;
                }
                Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(changeValue, isLastHit ? DIGIT_TYPE.ReceiveLastHitGoldCoinInBattle : DIGIT_TYPE.ReceiveGoldCoinInBattle, position);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, bool, PoolObjHandle <ActorRoot> >("HeroGoldCoinInBattleChange", this.actorPtr, changeValue, isIncome, target);
        }
Пример #7
0
        public void OnReceive(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ActorHelper.IsHostCtrlActor(ref player.Captain))
            {
                Singleton <GameInput> .get_instance().OnHostActorRecvMove((int)this.Degree);

                if (this.nSeq <= 255 && this.nSeq >= 0)
                {
                    Singleton <FrameSynchr> .GetInstance().m_MoveCMDReceiveTime[(int)this.nSeq] = (uint)(Time.realtimeSinceStartup * 1000f);

                    uint num = Singleton <FrameSynchr> .GetInstance().m_MoveCMDReceiveTime[(int)this.nSeq] - Singleton <FrameSynchr> .GetInstance().m_MoveCMDSendTime[(int)this.nSeq];

                    Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdtotalCount += 1uL;

                    Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdAverage = (int)(((float)Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdAverage *(Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdtotalCount - 1f) + num) / Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdtotalCount);

                    if (num > Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdMax)
                    {
                        Singleton <FrameSynchr> .GetInstance().m_receiveMoveCmdMax = num;
                    }
                }
            }
        }
Пример #8
0
 public void AddSoulExp(int addVal, bool bFloatDigit, AddSoulType type)
 {
     if (!Singleton <BattleLogic> .get_instance().m_LevelContext.IsSoulGrow())
     {
         return;
     }
     this.actorSoulExp += addVal;
     while (this.actorSoulExp >= this.actorSoulMaxExp)
     {
         this.actorSoulExp -= this.actorSoulMaxExp;
         int num        = this.actorSoulLevel + 1;
         int maxSoulLvl = ValueProperty.GetMaxSoulLvl();
         if (num > maxSoulLvl)
         {
             this.actorSoulLevel = maxSoulLvl;
             this.actorSoulExp   = this.actorSoulMaxExp;
             break;
         }
         this.actorSoulLevel = num;
         this.ObjValueStatistic.iSoulExpMax = ((this.ObjValueStatistic.iSoulExpMax <= addVal) ? addVal : this.ObjValueStatistic.iSoulExpMax);
     }
     if (bFloatDigit && addVal > 0 && this.actor.Visible && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
     {
         Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(addVal, DIGIT_TYPE.ReceiveSpirit, this.actor.myTransform.position);
     }
     Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, int, int>("HeroSoulExpChange", this.actorPtr, addVal, this.actorSoulExp, this.actorSoulMaxExp);
 }
Пример #9
0
 private void OnActorDead(ref GameDeadEventParam prm)
 {
     if (!ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         return;
     }
     this.ClearTeleportTarget();
 }
Пример #10
0
        public void OnReceive(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if (player != null && ActorHelper.IsHostCtrlActor(ref player.Captain))
            {
                Singleton <GameInput> .get_instance().OnHostActorRecvMove(2147483647);
            }
        }
Пример #11
0
        public void OnReceive(IFrameCommand cmd)
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(cmd.playerID);

            if ((player != null) && ActorHelper.IsHostCtrlActor(ref player.Captain))
            {
                Singleton <GameInput> .instance.OnHostActorRecvMove(this.Degree);
            }
        }
Пример #12
0
 private void UnInitHostActorFixedHud()
 {
     if (!this.hostActor || !ActorHelper.IsHostCtrlActor(ref this.hostActor))
     {
         return;
     }
     if (this.hostActor.handle.FixedHudControl != null)
     {
         this.hostActor.handle.FixedHudControl.FightOver();
         this.hostActor.handle.FixedHudControl.Uninit();
     }
 }
Пример #13
0
        public void CaptainHostSwitch()
        {
            Player player = Singleton <GamePlayerCenter> .GetInstance().GetPlayer(this.hostActor.handle.TheActorMeta.PlayerId);

            if (player != null)
            {
                bool isAutoAI = this.actor.ActorControl.m_isAutoAI;
                player.SetCaptain((uint)this.hostActor.handle.TheActorMeta.ConfigId);
                player.Captain.handle.ActorControl.SetAutoAI(isAutoAI);
                if (ActorHelper.IsHostCtrlActor(ref this.hostActor))
                {
                    this.hostActor.handle.HudControl.IsFixedBloodPos = false;
                    this.UnInitHostActorFixedHud();
                    DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.hostActor, this.hostActor);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_CaptainSwitch, ref defaultGameEventParam);
                }
            }
        }
Пример #14
0
 private void SpawnHostActorFixedHud()
 {
     if (!this.hostActor || !ActorHelper.IsHostCtrlActor(ref this.hostActor))
     {
         return;
     }
     if (this.hostActor.handle.FixedHudControl == null)
     {
         this.hostActor.handle.FixedHudControl = this.hostActor.handle.CreateLogicComponent <HudComponent3D>(this.hostActor);
     }
     if (this.hostActor.handle.FixedHudControl != null)
     {
         this.hostActor.handle.FixedHudControl.Init();
         this.hostActor.handle.FixedHudControl.Prepare();
         this.hostActor.handle.FixedHudControl.Fight();
         this.hostActor.handle.FixedHudControl.SetSelected(false);
         this.hostActor.handle.FixedHudControl.FixActorBloodPos();
     }
 }
Пример #15
0
 private void onUseSkill(ref ActorSkillEventParam prm)
 {
     if (ActorHelper.IsHostCtrlActor(ref prm.src))
     {
         int length = this.TriggerMatches.Length;
         for (int i = 0; i < length; i++)
         {
             CTriggerMatch match = this.TriggerMatches[i];
             if (match != null)
             {
                 PoolObjHandle<ActorRoot> src = new PoolObjHandle<ActorRoot>(null);
                 PoolObjHandle<ActorRoot> atker = new PoolObjHandle<ActorRoot>(null);
                 if (this.FilterMatch(EGlobalGameEvent.UseSkill, match, src, atker, (ActorSkillEventParam) prm, i))
                 {
                     this.DoTriggering(match, src, atker, (ActorSkillEventParam) prm);
                 }
             }
         }
     }
 }
Пример #16
0
        private void onUseSkill(ref ActorSkillEventParam prm)
        {
            if (!ActorHelper.IsHostCtrlActor(ref prm.src))
            {
                return;
            }
            int num = this.TriggerMatches.Length;
            SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam);

            sFilterMatchParam.slot = prm.slot;
            for (int i = 0; i < num; i++)
            {
                CTriggerMatch cTriggerMatch = this.TriggerMatches[i];
                if (cTriggerMatch != null)
                {
                    PoolObjHandle <ActorRoot> src   = new PoolObjHandle <ActorRoot>(null);
                    PoolObjHandle <ActorRoot> atker = new PoolObjHandle <ActorRoot>(null);
                    if (this.FilterMatch(EGlobalGameEvent.UseSkill, cTriggerMatch, src, atker, ref sFilterMatchParam, i))
                    {
                        this.DoTriggering(cTriggerMatch, src, atker);
                    }
                }
            }
        }
Пример #17
0
        public void ChangeGoldCoinInBattle(int changeValue, bool isIncome, bool floatDigit = false, [Optional] Vector3 position, bool isLastHit = false)
        {
            int goldCoinInBattle = (int)this.m_goldCoinInBattle;

            this.m_goldCoinInBattle += changeValue;
            if ((changeValue > 0) && isIncome)
            {
                this.m_goldCoinIncomeInBattle   += changeValue;
                this.m_MaxGoldCoinIncomeInBattle = (this.m_MaxGoldCoinIncomeInBattle <= changeValue) ? changeValue : this.m_MaxGoldCoinIncomeInBattle;
            }
            DebugHelper.Assert(this.m_goldCoinInBattle >= 0, "Wo ri, zhe zenme keneng");
            if (((floatDigit && (changeValue > 0)) && (isIncome && base.actor.Visible)) && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
            {
                if (((position.x == 0f) && (position.y == 0f)) && (position.z == 0f))
                {
                    position = base.actor.gameObject.transform.position;
                }
                Singleton <CBattleSystem> .GetInstance().CreateBattleFloatDigit(changeValue, !isLastHit ? DIGIT_TYPE.ReceiveGoldCoinInBattle : DIGIT_TYPE.ReceiveLastHitGoldCoinInBattle, position);
            }
            Singleton <EventRouter> .GetInstance().BroadCastEvent <PoolObjHandle <ActorRoot>, int, int, bool>("HeroGoldCoinInBattleChange", base.actorPtr, changeValue, (int)this.m_goldCoinInBattle, isIncome);
        }
Пример #18
0
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, object param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (((this.GlobalVariable != 0) && (Singleton <BattleLogic> .instance.m_globalTrigger != null)) && (this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable))
            {
                return(false);
            }
            if (this.bCaptainSrc && ((src == 0) || (src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.bCaptainAtker && ((atker == 0) || (atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                foreach (STriggerCondActor actor in this.SrcActorCond)
                {
                    if (!actor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                foreach (STriggerCondActor actor2 in this.AtkerActorCond)
                {
                    if (!actor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
            {
                if (match.Originator == null)
                {
                    break;
                }
                CommonSpawnGroup component = match.Originator.GetComponent <CommonSpawnGroup>();
                SpawnGroup       group2    = match.Originator.GetComponent <SpawnGroup>();
                if ((component == null) || (component == (param as CommonSpawnGroup)))
                {
                    if ((group2 == null) || (group2 == (param as SpawnGroup)))
                    {
                        break;
                    }
                    return(false);
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDead:
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator);
                if ((actorRoot == 0) || !(actorRoot != src))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDamage:
            {
                HurtEventResultInfo inHurtInfo = (HurtEventResultInfo)param;
                if (this.FilterMatchDamage(ref inHurtInfo))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.UseSkill:
            {
                ActorSkillEventParam param2 = (ActorSkillEventParam)param;
                if (param2.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.TalentLevelChange:
            {
                TalentLevelChangeParam param4 = (TalentLevelChangeParam)param;
                if (match.Condition.TalentLevel == param4.TalentLevel)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.BattleGoldChange:
                if ((src != 0) && ActorHelper.IsHostCtrlActor(ref src))
                {
                    int currentGold = (int)param;
                    if (!this.FilterBattleGoldNum(currentGold))
                    {
                        return(false);
                    }
                    break;
                }
                return(false);

            case EGlobalGameEvent.SkillUseCanceled:
            {
                DefaultSkillEventParam param3 = (DefaultSkillEventParam)param;
                if (param3.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }
            }
            return(true);
        }
Пример #19
0
 private void OnAchievementEvent(KillDetailInfo KillDetail)
 {
     if ((((KillDetail.Killer != 0) && (KillDetail.Killer.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)) && ActorHelper.IsHostCtrlActor(ref KillDetail.Killer)) && ((KillDetail.HeroContiKillType == this.targetAchievementType) || (KillDetail.HeroMultiKillType == this.targetAchievementType)))
     {
         this.CompleteCount++;
         if (!this.bHasComplete && (this.status == StarEvaluationStatus.Success))
         {
             this.bHasComplete = true;
             this.TriggerChangedEvent();
         }
     }
 }
Пример #20
0
 private void Update()
 {
     if ((Singleton <BattleLogic> .instance.isFighting && (this.ActorObj != null)) && this.ActorObj.Visible)
     {
         bool flag   = (!Singleton <FrameSynchr> .instance.bEscape && this.bNeedLerp) && (this.ActorObj.InCamera || (this.ActorObj.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet));
         uint nDelta = (uint)(Time.deltaTime * 1000f);
         bool bReset = false;
         if ((this.CustomMoveLerp != null) && flag)
         {
             this.CustomMoveLerp(this.ActorObj, nDelta, false);
         }
         else
         {
             VInt    num2;
             Vector3 vector;
             if (((flag && (this.ActorControl != null)) && this.ActorControl.CanMove) && (this.ActorMovement.isMoving || (this.ActorMovement.nLerpStep > 0)))
             {
                 vector = this.NormalMoveLerp(nDelta);
                 if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out num2))
                 {
                     vector.y = (float)num2;
                 }
                 base.gameObject.transform.position = vector;
                 this.ActorMovement.nLerpStep--;
             }
             else if (this.oldLocation != this.ActorObj.location)
             {
                 this.oldLocation = this.ActorObj.location;
                 Vector3 oldLocation = (Vector3)this.oldLocation;
                 Vector3 position    = base.gameObject.transform.position;
                 oldLocation.y = position.y;
                 Vector3 vector4 = oldLocation - position;
                 float   num3    = 0f;
                 if (((this.groundSpeed <= 0) || !flag) || ((num3 = vector4.magnitude) > (this.maxFrameMove * Singleton <FrameSynchr> .instance.PreActFrames)))
                 {
                     base.gameObject.transform.position = (Vector3)this.ActorObj.location;
                     if (this.CustomMoveLerp != null)
                     {
                         this.CustomMoveLerp(this.ActorObj, 0, true);
                     }
                     bReset = true;
                 }
                 else if ((num3 > 0.1f) && !ActorHelper.IsHostCtrlActor(ref this.ActorPtr))
                 {
                     float distance = this.ActorObj.MovementComponent.GetDistance(nDelta);
                     vector = Vector3.Lerp(position, oldLocation, distance / num3);
                     if (!this.ActorObj.MovementComponent.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out num2))
                     {
                         vector.y = (float)num2;
                     }
                     base.gameObject.transform.position = vector;
                     this.oldLocation = (VInt3)vector;
                 }
             }
         }
         if (flag && (this.ActorObj.MovementComponent != null))
         {
             this.ActorObj.MovementComponent.GravityModeLerp(nDelta, bReset);
         }
         if ((flag && (this.ActorControl != null)) && this.ActorControl.CanRotate)
         {
             if (base.gameObject.transform.rotation != this.tarRotation)
             {
                 base.gameObject.transform.rotation = this.ObjRotationLerp();
             }
         }
         else if (base.gameObject.transform.rotation != this.ActorObj.rotation)
         {
             base.gameObject.transform.rotation = this.ActorObj.rotation;
         }
     }
 }
 private void Update()
 {
     if (this.ActorObj != null && this.ActorObj.Visible && Singleton <BattleLogic> .instance.isFighting && Singleton <FrameSynchr> .GetInstance().isRunning)
     {
         try
         {
             bool flag   = Singleton <FrameSynchr> .instance.FrameSpeed == 1 && this.bNeedLerp && (this.ActorObj.InCamera || this.ActorObj.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Bullet);
             uint num    = (uint)(Time.deltaTime * 1000f);
             bool bReset = false;
             if (this.CustomMoveLerp != null && flag)
             {
                 this.CustomMoveLerp(this.ActorObj, num, false);
             }
             else if (flag && this.ActorControl != null && this.ActorControl.CanMove && this.ActorMovement != null && (this.ActorMovement.isMoving || this.ActorMovement.nLerpStep > 0))
             {
                 Vector3 vector = this.NormalMoveLerp(num);
                 VInt    ob;
                 if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector, out ob))
                 {
                     vector.y = (float)ob;
                 }
                 this.myTransform.position    = vector;
                 this.ActorMovement.nLerpStep = this.ActorMovement.nLerpStep - 1;
             }
             else if (this.oldLocation != this.ActorObj.location)
             {
                 this.oldLocation = this.ActorObj.location;
                 Vector3 vector2  = (Vector3)this.oldLocation;
                 Vector3 position = this.myTransform.position;
                 vector2.y = position.y;
                 Vector3 vector3 = vector2 - position;
                 float   magnitude;
                 if (this.groundSpeed <= 0 || !flag || (magnitude = vector3.magnitude) > this.maxFrameMove * Singleton <FrameSynchr> .instance.PreActFrames)
                 {
                     this.myTransform.position = (Vector3)this.ActorObj.location;
                     if (this.CustomMoveLerp != null)
                     {
                         this.CustomMoveLerp(this.ActorObj, 0u, true);
                     }
                     bReset = true;
                 }
                 else if (magnitude > 0.1f && !ActorHelper.IsHostCtrlActor(ref this.ActorPtr) && this.ActorMovement != null)
                 {
                     float   distance = this.ActorMovement.GetDistance(num);
                     Vector3 vector4  = Vector3.Lerp(position, vector2, distance / magnitude);
                     VInt    ob2;
                     if (!this.ActorMovement.isLerpFlying && PathfindingUtility.GetGroundY((VInt3)vector4, out ob2))
                     {
                         vector4.y = (float)ob2;
                     }
                     this.myTransform.position = vector4;
                     this.oldLocation          = (VInt3)vector4;
                 }
             }
             if (flag && this.ActorMovement != null)
             {
                 this.ActorMovement.GravityModeLerp(num, bReset);
             }
             if (this.CustomRotateLerp != null && flag)
             {
                 this.CustomRotateLerp(this.ActorObj, num);
             }
             else if (flag && this.ActorControl != null && this.ActorControl.CanRotate)
             {
                 if (this.myTransform.rotation != this.tarRotation)
                 {
                     this.myTransform.rotation = this.ObjRotationLerp();
                 }
             }
             else if (this.myTransform.rotation != this.ActorObj.rotation)
             {
                 this.myTransform.rotation = this.ActorObj.rotation;
             }
             if (flag && this.ActorObj.ChildUpdate)
             {
                 this.ActorObj.UpdateLerpActorRootSlot();
             }
         }
         catch (Exception var_12_3BB)
         {
         }
     }
 }
        private void OnActorDeadIncomeGoldCoinInBattle(ref PoolObjHandle <ActorRoot> target, ref PoolObjHandle <ActorRoot> attacker)
        {
            if (!target || !attacker)
            {
                return;
            }
            if (ActorHelper.IsHostCtrlActor(ref attacker) && (target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Monster || target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
            {
                if (attacker.handle.EffectControl != null)
                {
                    attacker.handle.EffectControl.PlayDyingGoldEffect(target);
                }
                Singleton <CSoundManager> .GetInstance().PlayBattleSound("Glod_Get", target, target.handle.gameObject);
            }
            ResIncomeAllocRule resIncomeAllocRule = null;

            switch (target.handle.TheActorMeta.ActorType)
            {
            case ActorTypeDef.Actor_Type_Hero:
                resIncomeAllocRule = this.m_incomeAllocRules[2][3];
                break;

            case ActorTypeDef.Actor_Type_Monster:
            {
                MonsterWrapper monsterWrapper = target.handle.AsMonster();
                if (monsterWrapper != null)
                {
                    RES_MONSTER_TYPE bMonsterType = (RES_MONSTER_TYPE)monsterWrapper.cfgInfo.bMonsterType;
                    if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_JUNGLE)
                    {
                        byte actorSubSoliderType = monsterWrapper.GetActorSubSoliderType();
                        if (actorSubSoliderType == 7 || actorSubSoliderType == 8 || actorSubSoliderType == 9)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][5];
                        }
                        else if (actorSubSoliderType == 15)
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][7];
                        }
                        else
                        {
                            resIncomeAllocRule = this.m_incomeAllocRules[2][4];
                        }
                    }
                    else if (bMonsterType == RES_MONSTER_TYPE.RES_MONSTER_TYPE_SOLDIERLINE)
                    {
                        resIncomeAllocRule = this.m_incomeAllocRules[2][2];
                    }
                }
                break;
            }

            case ActorTypeDef.Actor_Type_Organ:
                resIncomeAllocRule = this.m_incomeAllocRules[2][1];
                break;

            case ActorTypeDef.Actor_Type_EYE:
                resIncomeAllocRule = this.m_incomeAllocRules[2][6];
                break;
            }
            if (resIncomeAllocRule != null)
            {
                ResDT_IncomeAttackRule incomeAllocRuleByAtker = this.GetIncomeAllocRuleByAtker(ref attacker, resIncomeAllocRule);
                if (incomeAllocRuleByAtker != null)
                {
                    this.AllocIncome(ref target, ref attacker, incomeAllocRuleByAtker, enIncomeType.GoldCoinInBattle, resIncomeAllocRule.IncomeChangeRate, resIncomeAllocRule.iComputerChangeRate);
                }
            }
        }
 public override void LateUpdate(int nDelta)
 {
     if ((this.actorPtr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero || this.actorPtr.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call) && ActorHelper.IsHostCtrlActor(ref this.actorPtr))
     {
         for (int i = 0; i < 10; i++)
         {
             SkillSlot skillSlot = this.SkillSlotArray[i];
             if (skillSlot != null)
             {
                 skillSlot.LateUpdate(nDelta);
             }
         }
     }
 }
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ref SFilterMatchParam param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (this.GlobalVariable != 0 && Singleton <BattleLogic> .instance.m_globalTrigger != null && this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable)
            {
                return(false);
            }
            if (this.bCaptainSrc && (!src || src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain))
            {
                return(false);
            }
            if (this.bCaptainAtker && (!atker || atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                STriggerCondActor[] srcActorCond = this.SrcActorCond;
                for (int i = 0; i < srcActorCond.Length; i++)
                {
                    STriggerCondActor sTriggerCondActor = srcActorCond[i];
                    if (!sTriggerCondActor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                STriggerCondActor[] atkerActorCond = this.AtkerActorCond;
                for (int j = 0; j < atkerActorCond.Length; j++)
                {
                    STriggerCondActor sTriggerCondActor2 = atkerActorCond[j];
                    if (!sTriggerCondActor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
                if (match.Originator != null)
                {
                    CommonSpawnGroup component  = match.Originator.GetComponent <CommonSpawnGroup>();
                    SpawnGroup       component2 = match.Originator.GetComponent <SpawnGroup>();
                    if (component != null && component != param.csg)
                    {
                        return(false);
                    }
                    if (component2 != null && component2 != param.sg)
                    {
                        return(false);
                    }
                }
                break;

            case EGlobalGameEvent.ActorDead:
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator);
                if (actorRoot && actorRoot != src)
                {
                    return(false);
                }
                break;
            }

            case EGlobalGameEvent.ActorDamage:
                if (!this.FilterMatchDamage(ref param.hurtInfo))
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.UseSkill:
                if (param.slot != (SkillSlotType)this.skillSlot)
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.TalentLevelChange:
                if (match.Condition.TalentLevel != param.intParam)
                {
                    return(false);
                }
                break;

            case EGlobalGameEvent.BattleGoldChange:
            {
                if (!src || !ActorHelper.IsHostCtrlActor(ref src))
                {
                    return(false);
                }
                int intParam = param.intParam;
                if (!this.FilterBattleGoldNum(intParam))
                {
                    return(false);
                }
                break;
            }

            case EGlobalGameEvent.SkillUseCanceled:
                if (param.slot != (SkillSlotType)this.skillSlot)
                {
                    return(false);
                }
                break;
            }
            return(true);
        }
Пример #25
0
 public void onActorDamage(ref HurtEventResultInfo info)
 {
     if (info.hurtInfo.hurtType != HurtTypeDef.Therapic && info.hurtInfo.hurtCount == 0 && ActorHelper.IsHostCtrlActor(ref info.atker) && info.src.get_handle().MatHurtEffect != null)
     {
         info.src.get_handle().MatHurtEffect.PlayHurtEffect();
     }
 }