Exemplo n.º 1
0
        private void CopyActorInfoData(List <ACTOR_INFO> actorInfoList)
        {
            int dataSize      = ACTOR_INFO.GetDataSize();
            int num           = dataSize * 80;
            int dataSizeBytes = ACTOR_INFO.GetDataSizeBytes();
            int num2          = dataSizeBytes * 80;

            if (this.ms_Actor_Info_Data == null)
            {
                this.ms_Actor_Info_Data = new int[num];
            }
            if (this.ActorInfoDataExtra_ == null)
            {
                this.ActorInfoDataExtra_ = new byte[num2];
            }
            int num3 = actorInfoList.get_Count();

            if (num3 > 80)
            {
                num3 = 80;
            }
            for (int i = 0; i < num3; i++)
            {
                int num4 = i * dataSize;
                int num5 = HorizonMarkerByFow.TranslateCampToIndex(COM_PLAYERCAMP.COM_PLAYERCAMP_1);
                this.ms_Actor_Info_Data[num4]     = actorInfoList.get_Item(i).location[num5].x;
                this.ms_Actor_Info_Data[num4 + 1] = actorInfoList.get_Item(i).location[num5].y;
                this.ms_Actor_Info_Data[num4 + 4] = actorInfoList.get_Item(i).camps[num5];
                int num6 = HorizonMarkerByFow.TranslateCampToIndex(COM_PLAYERCAMP.COM_PLAYERCAMP_2);
                this.ms_Actor_Info_Data[num4 + 2] = actorInfoList.get_Item(i).location[num6].x;
                this.ms_Actor_Info_Data[num4 + 3] = actorInfoList.get_Item(i).location[num6].y;
                this.ms_Actor_Info_Data[num4 + 5] = actorInfoList.get_Item(i).camps[num6];
                int num7 = i * dataSizeBytes;
                this.ActorInfoDataExtra_[num7] = (actorInfoList.get_Item(i).bDistOnly ? 1 : 0);
            }
            if (IntPtr.Zero == this.m_tempCpyActorDataPtr)
            {
                int num8 = num * 4;
                this.m_tempCpyActorDataPtr = Marshal.AllocHGlobal(num8);
            }
            if (IntPtr.Zero == this.ActorInfoDataExtraPtr_)
            {
                this.ActorInfoDataExtraPtr_ = Marshal.AllocHGlobal(num2);
            }
            if (num3 > 0)
            {
                Marshal.Copy(this.ms_Actor_Info_Data, 0, this.m_tempCpyActorDataPtr, num);
                Marshal.Copy(this.ActorInfoDataExtra_, 0, this.ActorInfoDataExtraPtr_, num2);
            }
            GameFowManager.MemCopyActorInfoData(num3, dataSize, this.m_tempCpyActorDataPtr, dataSizeBytes, this.ActorInfoDataExtraPtr_);
        }
        public void CollectExplorer(bool bForce)
        {
            GameObjMgr     instance  = Singleton <GameObjMgr> .instance;
            GameFowManager instance2 = Singleton <GameFowManager> .instance;
            uint           num       = Singleton <FrameSynchr> .instance.CurFrameNum % instance2.InterpolateFrameInterval;
            uint           num2      = Singleton <FrameSynchr> .instance.CurFrameNum % instance2.InterpolateFrameIntervalBullet(true);
            uint           num3      = Singleton <FrameSynchr> .instance.CurFrameNum % instance2.InterpolateFrameIntervalBullet(false);
            uint           num4      = Singleton <FrameSynchr> .instance.CurFrameNum % instance2.InterpolateFrameIntervalHero;

            this.ClearExplorerPosList();
            int count = instance.GameActors.get_Count();

            for (int i = 0; i < count; i++)
            {
                PoolObjHandle <ActorRoot> ptr = instance.GameActors.get_Item(i);
                if (ptr)
                {
                    ActorRoot    handle    = ptr.handle;
                    ActorTypeDef actorType = handle.TheActorMeta.ActorType;
                    if (actorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        if (handle.ObjID % instance2.InterpolateFrameIntervalHero != num4 && !bForce)
                        {
                            goto IL_191;
                        }
                    }
                    else if (handle.ObjID % instance2.InterpolateFrameInterval != num && !bForce)
                    {
                        goto IL_191;
                    }
                    if (actorType != ActorTypeDef.Actor_Type_Organ && (!handle.ActorControl.IsDeadState || handle.TheStaticData.TheBaseAttribute.DeadControl))
                    {
                        VInt3 vInt = new VInt3(handle.location.x, handle.location.z, 0);
                        if (handle.HorizonMarker != null)
                        {
                            int[]      exposedCamps = handle.HorizonMarker.GetExposedCamps();
                            ACTOR_INFO aCTOR_INFO   = ClassObjPool <ACTOR_INFO> .Get();

                            aCTOR_INFO.camps    = exposedCamps;
                            aCTOR_INFO.location = handle.HorizonMarker.GetExposedPos();
                            this.m_explorerPosList.Add(aCTOR_INFO);
                        }
                    }
                }
                IL_191 :;
            }
            this.ClearExplorerBulletList();
            for (int j = 1; j < 3; j++)
            {
                List <PoolObjHandle <ActorRoot> > campBullet = Singleton <GameObjMgr> .instance.GetCampBullet((COM_PLAYERCAMP)j);

                int count2 = campBullet.get_Count();
                for (int k = 0; k < count2; k++)
                {
                    PoolObjHandle <ActorRoot> ptr2 = campBullet.get_Item(k);
                    if (ptr2)
                    {
                        ActorRoot     handle2       = ptr2.handle;
                        BulletWrapper bulletWrapper = handle2.ActorControl as BulletWrapper;
                        if (0 < bulletWrapper.SightRadius)
                        {
                            if (!bForce)
                            {
                                if (bulletWrapper.GetMoveDelta() > 0)
                                {
                                    if (handle2.ObjID % instance2.InterpolateFrameIntervalBullet(true) != num2)
                                    {
                                        goto IL_2AD;
                                    }
                                }
                                else if (handle2.ObjID % instance2.InterpolateFrameIntervalBullet(false) != num3)
                                {
                                    goto IL_2AD;
                                }
                            }
                            VInt3       location    = new VInt3(handle2.location.x, handle2.location.z, 0);
                            BULLET_INFO bULLET_INFO = ClassObjPool <BULLET_INFO> .Get();

                            bULLET_INFO.radius   = bulletWrapper.SightRange;
                            bULLET_INFO.location = location;
                            this.m_explorerBulletList[j - 1].Add(bULLET_INFO);
                        }
                    }
                    IL_2AD :;
                }
            }
        }