public void UpdateFowVisibility(bool bForce)
        {
            GameObjMgr     instance    = Singleton <GameObjMgr> .instance;
            GameFowManager instance2   = Singleton <GameFowManager> .instance;
            COM_PLAYERCAMP horizonCamp = Singleton <WatchController> .instance.HorizonCamp;
            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;
            List <PoolObjHandle <ActorRoot> > gameActors = instance.GameActors;
            int count = gameActors.get_Count();

            for (int i = 0; i < count; i++)
            {
                if (gameActors.get_Item(i))
                {
                    ActorRoot    handle    = gameActors.get_Item(i).handle;
                    ActorTypeDef actorType = handle.TheActorMeta.ActorType;
                    if (actorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        if (handle.ObjID % instance2.InterpolateFrameIntervalHero != num4 && !bForce)
                        {
                            goto IL_219;
                        }
                    }
                    else
                    {
                        if (handle.ObjID % instance2.InterpolateFrameInterval != num && !bForce)
                        {
                            goto IL_219;
                        }
                        if (handle.ActorControl.IsDeadState && !handle.TheStaticData.TheBaseAttribute.DeadControl)
                        {
                            goto IL_219;
                        }
                    }
                    if (actorType != ActorTypeDef.Actor_Type_Organ)
                    {
                        VInt3 worldLoc = new VInt3(handle.location.x, handle.location.z, 0);
                        if (actorType == ActorTypeDef.Actor_Type_Hero || actorType == ActorTypeDef.Actor_Type_Monster)
                        {
                            bool flag = instance2.QueryAttr(handle.location) == FieldObj.EViewBlockType.Grass;
                            handle.HorizonMarker.SetTranslucentMark(HorizonConfig.HideMark.Jungle, flag, false);
                            if (handle.HudControl != null && handle.HudControl.HasStatus(StatusHudType.InJungle) != flag)
                            {
                                if (flag)
                                {
                                    handle.HudControl.ShowStatus(StatusHudType.InJungle);
                                }
                                else
                                {
                                    handle.HudControl.HideStatus(StatusHudType.InJungle);
                                }
                            }
                        }
                        for (int j = 1; j < 3; j++)
                        {
                            COM_PLAYERCAMP cOM_PLAYERCAMP = (COM_PLAYERCAMP)j;
                            if (cOM_PLAYERCAMP != handle.TheActorMeta.ActorCamp)
                            {
                                handle.HorizonMarker.SetHideMark(cOM_PLAYERCAMP, HorizonConfig.HideMark.Jungle, !instance2.IsSurfaceCellVisibleConsiderNeighbor(worldLoc, cOM_PLAYERCAMP));
                            }
                        }
                    }
                }
                IL_219 :;
            }
            Dictionary <int, ShenFuObjects> .Enumerator enumerator = Singleton <ShenFuSystem> .instance._shenFuTriggerPool.GetEnumerator();

            while (enumerator.MoveNext())
            {
                KeyValuePair <int, ShenFuObjects> current = enumerator.get_Current();
                int key = current.get_Key();
                if ((long)key % (long)((ulong)instance2.InterpolateFrameInterval) == (long)((ulong)num))
                {
                    KeyValuePair <int, ShenFuObjects> current2 = enumerator.get_Current();
                    GameObject shenFu = current2.get_Value().ShenFu;
                    GameFowCollector.SetObjVisibleByFow(new PoolObjHandle <ActorRoot>(null), shenFu, instance2, horizonCamp);
                }
            }
            for (int k = 0; k < 3; k++)
            {
                if (Singleton <WatchController> .instance.IsWatching || k != (int)horizonCamp)
                {
                    List <PoolObjHandle <ActorRoot> > campBullet = instance.GetCampBullet((COM_PLAYERCAMP)k);
                    int count2 = campBullet.get_Count();
                    for (int l = 0; l < count2; l++)
                    {
                        PoolObjHandle <ActorRoot> poolObjHandle = campBullet.get_Item(l);
                        if (poolObjHandle)
                        {
                            ActorRoot     handle2       = poolObjHandle.handle;
                            BulletWrapper bulletWrapper = handle2.ActorControl as BulletWrapper;
                            if (bulletWrapper.m_bVisibleByFow)
                            {
                                bool flag2;
                                if (bulletWrapper.GetMoveDelta() > 0)
                                {
                                    flag2 = (handle2.ObjID % instance2.InterpolateFrameIntervalBullet(true) != num2);
                                }
                                else
                                {
                                    flag2 = (handle2.ObjID % instance2.InterpolateFrameIntervalBullet(false) != num3);
                                }
                                if (!flag2)
                                {
                                    if (Singleton <WatchController> .instance.IsWatching && Singleton <WatchController> .instance.CoversCamp(bulletWrapper.actor.TheActorMeta.ActorCamp))
                                    {
                                        bulletWrapper.UpdateSubParObjVisibility(true);
                                    }
                                    else if (bulletWrapper.m_bVisibleByShape)
                                    {
                                        bulletWrapper.UpdateSubParObjVisibility(GameFowCollector.SetObjWithColVisibleByFow(poolObjHandle, instance2, horizonCamp));
                                    }
                                    else
                                    {
                                        bulletWrapper.UpdateSubParObjVisibility(GameFowCollector.SetObjVisibleByFow(poolObjHandle, handle2.gameObject, instance2, horizonCamp));
                                    }
                                }
                            }
                        }
                    }
                }
            }
            int count3 = this.VirtualParentParticles_.get_Count();

            for (int m = 0; m < count3; m++)
            {
                GameFowCollector.VirtualParticleAttachContext virtualParticleAttachContext = this.VirtualParentParticles_.get_Item(m);
                GameObject virtualParticle = this.VirtualParentParticles_.get_Item(m).VirtualParticle;
                if (!(virtualParticle == null) && this.VirtualParentParticles_.get_Item(m).AttachActor)
                {
                    if (this.VirtualParentParticles_.get_Item(m).AttachActor.handle.Visible)
                    {
                        virtualParticle.SetLayer("Actor", "Particles", true);
                    }
                    else
                    {
                        virtualParticle.SetLayer("Hide", true);
                    }
                }
            }
        }
예제 #2
0
        public void UpdateFowVisibility(bool bForce)
        {
            GameObjMgr instance = Singleton <GameObjMgr> .get_instance();

            GameFowManager instance2 = Singleton <GameFowManager> .get_instance();

            Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

            COM_PLAYERCAMP playerCamp = hostPlayer.PlayerCamp;
            uint           num        = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameInterval;

            uint num2 = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameIntervalBullet;

            uint num3 = Singleton <FrameSynchr> .get_instance().CurFrameNum % instance2.InterpolateFrameIntervalHero;

            List <PoolObjHandle <ActorRoot> > gameActors = instance.GameActors;
            int count = gameActors.get_Count();

            for (int i = 0; i < count; i++)
            {
                if (gameActors.get_Item(i))
                {
                    ActorRoot    handle    = gameActors.get_Item(i).get_handle();
                    ActorTypeDef actorType = handle.TheActorMeta.ActorType;
                    if (actorType == ActorTypeDef.Actor_Type_Hero)
                    {
                        if (handle.ObjID % instance2.InterpolateFrameIntervalHero != num3 && !bForce)
                        {
                            goto IL_212;
                        }
                    }
                    else if (handle.ObjID % instance2.InterpolateFrameInterval != num && !bForce)
                    {
                        goto IL_212;
                    }
                    if (actorType != ActorTypeDef.Actor_Type_Organ && (!handle.ActorControl.IsDeadState || handle.TheStaticData.TheBaseAttribute.DeadControl))
                    {
                        VInt3 worldLoc = new VInt3(handle.location.x, handle.location.z, 0);
                        if (actorType == ActorTypeDef.Actor_Type_Hero || actorType == ActorTypeDef.Actor_Type_Monster)
                        {
                            bool flag = instance2.QueryAttr(handle.location) == FieldObj.EViewBlockType.Grass;
                            handle.HorizonMarker.SetTranslucentMark(HorizonConfig.HideMark.Jungle, flag, false);
                            if (handle.HudControl != null && handle.HudControl.HasStatus(StatusHudType.InJungle) != flag)
                            {
                                if (flag)
                                {
                                    handle.HudControl.ShowStatus(StatusHudType.InJungle);
                                }
                                else
                                {
                                    handle.HudControl.HideStatus(StatusHudType.InJungle);
                                }
                            }
                        }
                        for (int j = 1; j < 3; j++)
                        {
                            COM_PLAYERCAMP cOM_PLAYERCAMP = j;
                            if (cOM_PLAYERCAMP != handle.TheActorMeta.ActorCamp)
                            {
                                handle.HorizonMarker.SetHideMark(cOM_PLAYERCAMP, HorizonConfig.HideMark.Jungle, !instance2.IsSurfaceCellVisibleConsiderNeighbor(worldLoc, cOM_PLAYERCAMP));
                            }
                        }
                    }
                }
                IL_212 :;
            }
            Dictionary <int, ShenFuObjects> .Enumerator enumerator = Singleton <ShenFuSystem> .get_instance()._shenFuTriggerPool.GetEnumerator();

            while (enumerator.MoveNext())
            {
                KeyValuePair <int, ShenFuObjects> current = enumerator.get_Current();
                int key = current.get_Key();
                if ((long)key % (long)((ulong)instance2.InterpolateFrameInterval) == (long)((ulong)num))
                {
                    KeyValuePair <int, ShenFuObjects> current2 = enumerator.get_Current();
                    GameObject shenFu = current2.get_Value().ShenFu;
                    GameFowCollector.SetObjVisibleByFow(shenFu, instance2, playerCamp);
                }
            }
            for (int k = 0; k < 3; k++)
            {
                if (k != playerCamp)
                {
                    List <PoolObjHandle <ActorRoot> > campBullet = instance.GetCampBullet(k);
                    int count2 = campBullet.get_Count();
                    for (int l = 0; l < count2; l++)
                    {
                        PoolObjHandle <ActorRoot> poolObjHandle = campBullet.get_Item(l);
                        if (poolObjHandle)
                        {
                            ActorRoot     handle2       = poolObjHandle.get_handle();
                            BulletWrapper bulletWrapper = handle2.ActorControl as BulletWrapper;
                            if (bulletWrapper.m_bVisibleByFow)
                            {
                                if (handle2.ObjID % instance2.InterpolateFrameIntervalBullet == num2)
                                {
                                    if (bulletWrapper.m_bVisibleByShape)
                                    {
                                        bulletWrapper.UpdateSubParObjVisibility(GameFowCollector.SetObjWithColVisibleByFow(poolObjHandle, instance2, playerCamp));
                                    }
                                    else
                                    {
                                        bulletWrapper.UpdateSubParObjVisibility(GameFowCollector.SetObjVisibleByFow(handle2.gameObject, instance2, playerCamp));
                                    }
                                }
                            }
                        }
                    }
                }
            }
            int count3 = this.VirtualParentParticles_.get_Count();

            for (int m = 0; m < count3; m++)
            {
                GameFowCollector.VirtualParticleAttachContext virtualParticleAttachContext = this.VirtualParentParticles_.get_Item(m);
                GameObject virtualParticle = this.VirtualParentParticles_.get_Item(m).VirtualParticle;
                if (!(virtualParticle == null))
                {
                    int num4 = virtualParticle.GetInstanceID();
                    if (num4 < 0)
                    {
                        num4 = -num4;
                    }
                    if ((long)num4 % (long)((ulong)instance2.InterpolateFrameIntervalBullet) == (long)((ulong)num))
                    {
                        if (virtualParticleAttachContext.bUseShape)
                        {
                            GameFowCollector.SetObjWithColVisibleByFowAttached(virtualParticle, instance2, playerCamp, this.VirtualParentParticles_.get_Item(m).AttachActor);
                        }
                        else
                        {
                            GameFowCollector.SetObjVisibleByFowAttached(virtualParticle, instance2, playerCamp, this.VirtualParentParticles_.get_Item(m).AttachActor);
                        }
                    }
                }
            }
        }