예제 #1
0
        private void AddSpawnGroupCounter(int inCountdown, int inAlertPreroll, Vector3 inInitPos, SpawnerWrapper.ESpawnObjectType inObjType)
        {
            this.m_spawnGroupCounterContainer = this.GetSpawnGroupTextContainer();
            if (this.m_spawnGroupCounterContainer != null)
            {
                int element = this.m_spawnGroupCounterContainer.GetElement();
                if (element >= 0)
                {
                    SpawnGroupCounter counter;
                    counter = new SpawnGroupCounter {
                        CountdownTime = inCountdown,
                        timer         = counter.CountdownTime,
                        AlertTime     = counter.timer - inAlertPreroll,
                        bAlertPreroll = inAlertPreroll > 0,
                        bDidAlert     = false
                    };
                    RectTransform mapPointerRectTransform = null;
                    GameObject    p = this.m_spawnGroupCounterContainer.GetElement(element);
                    if (p != null)
                    {
                        mapPointerRectTransform = p.transform as RectTransform;
                        counter.TextObj         = p;
                        counter.timerText       = Utility.FindChild(p, "TimerText").GetComponent <Text>();
                    }
                    if (mapPointerRectTransform != null)
                    {
                        mapPointerRectTransform.SetAsFirstSibling();
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                    if ((curLvelContext != null) && curLvelContext.IsMobaMode())
                    {
                        this.UpdateUIMap(mapPointerRectTransform, inInitPos, (float)curLvelContext.m_mapWidth, (float)curLvelContext.m_mapHeight);
                    }
                    this.m_spawnGroupCounter.Add(counter);
                }
            }
        }
예제 #2
0
        public void Init(GameObject obj)
        {
            this.m_Obj = obj;
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if ((curLvelContext.IsMobaMode() || curLvelContext.IsGameTypeGuide()) || (curLvelContext.IsGameTypeBurning() || curLvelContext.IsGameTypeArena()))
            {
                this.Hide();
            }
            else
            {
                this.Show();
                this.bPanelOpen = false;
                this.taskPanel  = this.m_Obj.transform.Find("TaskPanel").gameObject;
                this.arrowIcon  = this.m_Obj.transform.Find("Image").gameObject;
                this.taskPanel.CustomSetActive(false);
                this.PanelIcon = this.m_Obj.transform.Find("icon").GetComponent <Image>();
                this.initEvent();
                UT.If_Null_Error <GameObject>(this.m_Obj);
                UT.If_Null_Error <GameObject>(this.taskPanel);
                UT.If_Null_Error <Image>(this.PanelIcon);
            }
        }
예제 #3
0
        private void AddCharmIcon(CTailsman inCharm)
        {
            if ((inCharm != null) && !this.m_mapPointer.ContainsKey(inCharm))
            {
                this.m_mapPointerContainer = this.GetMapPointerContainer();
                if (this.m_mapPointerContainer != null)
                {
                    int element = this.m_mapPointerContainer.GetElement();
                    if (element >= 0)
                    {
                        RectTransform mapPointerRectTransform = null;
                        GameObject    obj2 = this.m_mapPointerContainer.GetElement(element);
                        if (obj2 != null)
                        {
                            mapPointerRectTransform = obj2.transform as RectTransform;
                            obj2.GetComponent <Image>().SetSprite(string.Format("{0}{1}", "UGUI/Sprite/Battle/", "Img_Map_Base_Green"), Singleton <CBattleSystem> .instance.FormScript, true, false, false);
                        }
                        if (mapPointerRectTransform != null)
                        {
                            mapPointerRectTransform.SetAsFirstSibling();
                        }
                        Vector3 zero = Vector3.zero;
                        if (inCharm.Presentation != null)
                        {
                            zero = inCharm.Presentation.transform.position;
                        }
                        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                        if ((curLvelContext != null) && curLvelContext.IsMobaMode())
                        {
                            this.UpdateUIMap(mapPointerRectTransform, zero, (float)curLvelContext.m_mapWidth, (float)curLvelContext.m_mapHeight);
                        }
                        this.m_mapPointer.Add(inCharm, obj2);
                    }
                }
            }
        }
예제 #4
0
        public void OpenForm(CBattleSystem.FormType formType)
        {
            if (formType == CBattleSystem.FormType.Fight)
            {
                this._battle3DTouch = new InBattle3DTouch();
                this._battle3DTouch.Init();
                this._battleForm = new FightForm();
            }
            else if (formType == CBattleSystem.FormType.Watch)
            {
                this._battleForm = new WatchForm();
            }
            if (this._battleForm == null || !this._battleForm.OpenForm())
            {
                this._battleForm = null;
                return;
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            this.m_battleEquipSystem.Initialize(this.FightFormScript, hostPlayer.Captain, curLvelContext.IsMobaMode(), curLvelContext.m_isBattleEquipLimit);
            this._miniMapSys = new MinimapSys();
            this._miniMapSys.Init(this.FormScript, curLvelContext);
            this._killNotify = new KillNotify();
            this._killNotify.Init();
            this._killNotify.Hide();
            this.m_towerHitMgr = new TowerHitMgr();
            this.m_towerHitMgr.Init();
            if (curLvelContext.IsMobaMode())
            {
                this._battleStatView = new BattleStatView();
                this._battleStatView.Init();
            }
            this.pauseControl = new PauseControl(this.FormScript);
            this.RegisterEvents();
        }
예제 #5
0
        private void AddSpawnGroupCounter(int inCountdown, int inAlertPreroll, Vector3 inInitPos, SpawnerWrapper.ESpawnObjectType inObjType)
        {
            this.m_spawnGroupCounterContainer = this.GetSpawnGroupTextContainer();
            if (this.m_spawnGroupCounterContainer != null)
            {
                int element = this.m_spawnGroupCounterContainer.GetElement();
                if (element >= 0)
                {
                    MinimapView.SpawnGroupCounter spawnGroupCounter = new MinimapView.SpawnGroupCounter();
                    spawnGroupCounter.CountdownTime = inCountdown;
                    spawnGroupCounter.timer         = spawnGroupCounter.CountdownTime;
                    spawnGroupCounter.AlertTime     = spawnGroupCounter.timer - inAlertPreroll;
                    spawnGroupCounter.bAlertPreroll = (inAlertPreroll > 0);
                    spawnGroupCounter.bDidAlert     = false;
                    RectTransform rectTransform = null;
                    GameObject    element2      = this.m_spawnGroupCounterContainer.GetElement(element);
                    if (element2 != null)
                    {
                        rectTransform               = (element2.transform as RectTransform);
                        spawnGroupCounter.TextObj   = element2;
                        spawnGroupCounter.timerText = Utility.FindChild(element2, "TimerText").GetComponent <Text>();
                    }
                    if (rectTransform != null)
                    {
                        rectTransform.SetAsFirstSibling();
                    }
                    SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                    if (curLvelContext != null && curLvelContext.IsMobaMode())
                    {
                        this.UpdateUIMap(rectTransform, inInitPos, (float)curLvelContext.m_mapWidth, (float)curLvelContext.m_mapHeight);
                    }
                    this.m_spawnGroupCounter.Add(spawnGroupCounter);
                }
            }
        }
예제 #6
0
        public void InitReplayKit(Transform container, bool autoRecord = false, bool autoPreview = false)
        {
            if (container == null)
            {
                return;
            }
            if (!this.Cap)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            if (!GameSettings.EnableReplayKit)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            CReplayKitSys.StorageStatus storageStatus  = this.CheckStorage(false);
            CReplayKitSys.StorageStatus storageStatus2 = storageStatus;
            if (storageStatus2 == CReplayKitSys.StorageStatus.Disable)
            {
                container.gameObject.CustomSetActive(false);
                CUIEvent cUIEvent = new CUIEvent();
                cUIEvent.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                cUIEvent.m_eventParams.tag2 = 1;
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent);

                return;
            }
            if (Singleton <BattleLogic> .GetInstance().isRuning)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null && (curLvelContext.IsGameTypeGuide() || !curLvelContext.IsMobaMode()))
                {
                    container.gameObject.CustomSetActive(false);
                    CUIEvent cUIEvent2 = new CUIEvent();
                    cUIEvent2.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                    cUIEvent2.m_eventParams.tag2 = 1;
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent2);

                    return;
                }
            }
            else if (Singleton <CHeroSelectBaseSystem> .get_instance().m_isInHeroSelectState&& (Singleton <CHeroSelectBaseSystem> .GetInstance().IsSpecTraingMode() || !Singleton <CHeroSelectBaseSystem> .GetInstance().IsMobaMode()))
            {
                container.gameObject.CustomSetActive(false);
                CUIEvent cUIEvent3 = new CUIEvent();
                cUIEvent3.m_eventID          = enUIEventID.ReplayKit_Pause_Recording;
                cUIEvent3.m_eventParams.tag2 = 1;
                Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(cUIEvent3);

                return;
            }
            Transform transform  = container.transform.Find("Recording");
            Transform transform2 = container.transform.Find("Paused");
            Transform transform3 = container.transform.Find("Transition");

            if (transform == null || transform2 == null)
            {
                container.gameObject.CustomSetActive(false);
                return;
            }
            CUIEventScript component  = transform.GetComponent <CUIEventScript>();
            CUIEventScript component2 = transform2.GetComponent <CUIEventScript>();

            if (component != null)
            {
                component.m_onClickEventID = enUIEventID.ReplayKit_Pause_Recording;
                if (autoPreview)
                {
                    component.m_onClickEventParams.tag = 1;
                }
            }
            if (component2 != null)
            {
                component2.m_onClickEventID = enUIEventID.ReplayKit_Start_Recording;
            }
            if (autoRecord)
            {
                if (GameSettings.EnableReplayKitAutoMode)
                {
                    transform.gameObject.CustomSetActive(true);
                    transform2.gameObject.CustomSetActive(false);
                    transform3.gameObject.CustomSetActive(false);
                    Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.ReplayKit_Start_Recording);
                }
                else if (this.IsRecording())
                {
                    transform.gameObject.CustomSetActive(true);
                    transform2.gameObject.CustomSetActive(false);
                    transform3.gameObject.CustomSetActive(false);
                }
                else
                {
                    transform.gameObject.CustomSetActive(false);
                    transform2.gameObject.CustomSetActive(true);
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            else if (this.IsRecording())
            {
                transform.gameObject.CustomSetActive(true);
                transform2.gameObject.CustomSetActive(false);
                transform3.gameObject.CustomSetActive(false);
            }
            else
            {
                transform.gameObject.CustomSetActive(false);
                transform2.gameObject.CustomSetActive(true);
                transform3.gameObject.CustomSetActive(false);
            }
        }
예제 #7
0
        public void Init(CUIFormScript formObj, SLevelContext levelContext)
        {
            if (formObj != null)
            {
                this._ownerForm = formObj;
                this.mmRoot     = Utility.FindChild(formObj.gameObject, "MapPanel/Mini");
                this.bmRoot     = Utility.FindChild(formObj.gameObject, "MapPanel/Big");
                if ((this.mmRoot != null) && (this.bmRoot != null))
                {
                    if (!levelContext.IsMobaMode())
                    {
                        this.mmRoot.SetActive(false);
                        this.bmRoot.SetActive(false);
                    }
                    else if (levelContext != null)
                    {
                        this.regEvent();
                        this.mmpcAlies  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Alies");
                        this.mmpcHero   = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Hero");
                        this.mmpcEnemy  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Enemy");
                        this.mmpcOrgan  = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Organ");
                        this.mmpcSignal = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Signal");
                        this.mmpcDragon = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Dragon");
                        this.mmpcEffect = Utility.FindChild(this.mmRoot, "BigMapEffectRoot");
                        this.mmpcEye    = Utility.FindChild(this.mmRoot, "Container_MiniMapPointer_Eye");
                        this.bmpcAlies  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Alies");
                        this.bmpcHero   = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Hero");
                        this.bmpcEnemy  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Enemy");
                        this.bmpcOrgan  = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Organ");
                        this.bmpcSignal = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Signal");
                        this.bmpcDragon = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Dragon");
                        this.mmpcEffect = Utility.FindChild(this.bmRoot, "BigMapEffectRoot");
                        this.bmpcEye    = Utility.FindChild(this.bmRoot, "Container_BigMapPointer_Eye");
                        this.mmRoot.CustomSetActive(true);
                        this.bmRoot.CustomSetActive(true);
                        RectTransform transform = null;
                        if (levelContext.IsMobaMode())
                        {
                            float num;
                            this.Switch(EMapType.Mini);
                            transform = this.initMap(this.bmRoot, levelContext, false, out num);
                            transform.anchoredPosition = new Vector2(transform.rect.width * 0.5f, -transform.rect.height * 0.5f);
                            transform = this.initMap(this.mmRoot, levelContext, true, out num);
                            if (levelContext.m_pvpPlayerNum == 6)
                            {
                                transform.anchoredPosition = new Vector2(transform.anchoredPosition.x + ((transform.rect.width * 0.5f) - (num * 0.5f)), transform.anchoredPosition.y);
                                GameObject obj2 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/DragonInfo");
                                GameObject obj3 = Utility.FindChild(this._ownerForm.gameObject, "MapPanel/Button_Signal_1");
                                if (obj2 != null)
                                {
                                    RectTransform transform2 = obj2.gameObject.transform as RectTransform;
                                    transform2.anchoredPosition = new Vector2(transform.anchoredPosition.x, transform2.anchoredPosition.y);
                                }
                                if (obj3 != null)
                                {
                                    RectTransform transform3 = obj3.gameObject.transform as RectTransform;
                                    transform3.anchoredPosition = new Vector2((transform.rect.width - (transform3.rect.width * 0.5f)) + 43f, transform3.anchoredPosition.y);
                                }
                            }
                        }
                        else
                        {
                            this.Switch(EMapType.None);
                        }
                        this.curMapType = EMapType.Mini;
                        bool flag  = false;
                        bool flag2 = false;
                        if (levelContext.m_pveLevelType == RES_LEVEL_TYPE.RES_LEVEL_TYPE_GUIDE)
                        {
                            switch (levelContext.m_mapID)
                            {
                            case 2:
                                flag  = true;
                                flag2 = false;
                                break;

                            case 3:
                            case 6:
                            case 7:
                                flag  = true;
                                flag2 = true;
                                break;
                            }
                        }
                        else if ((levelContext.m_pvpPlayerNum == 6) || (levelContext.m_pvpPlayerNum == 10))
                        {
                            flag  = true;
                            flag2 = levelContext.m_pvpPlayerNum == 10;
                        }
                        if (flag && (this.mmpcDragon != null))
                        {
                            this.m_dragonIcon = new DragonIcon();
                            this.m_dragonIcon.Init(this.mmpcDragon, this.bmpcDragon, flag2);
                        }
                        GameObject gameObject = this.mmRoot.transform.Find("CameraFrame").gameObject;
                        if (gameObject != null)
                        {
                            this.m_miniMapCameraFrame = new MiniMapCameraFrame(gameObject, transform.sizeDelta.x, transform.sizeDelta.y);
                            this.m_miniMapCameraFrame.SetFrameSize((CameraHeightType)GameSettings.CameraHeight);
                        }
                    }
                }
            }
        }
예제 #8
0
        internal DynamicAttributeInfo ConsiderMonsterDynamicInfo(ResMonsterCfgInfo monsterCfg)
        {
            int num = 0;
            DynamicAttributeInfo result = null;

            if (monsterCfg.iDynamicInfoType == 1)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

                if (curLvelContext != null && !curLvelContext.IsMobaMode())
                {
                    ResLevelCfgInfo dataByKey = GameDataMgr.levelDatabin.GetDataByKey((long)curLvelContext.m_mapID);
                    if (dataByKey == null)
                    {
                        base.ErrorMissingLevelConfig((uint)curLvelContext.m_mapID);
                        return(null);
                    }
                    if (curLvelContext.m_pveLevelType == null)
                    {
                        num = (int)dataByKey.dwAIPlayerLevel;
                    }
                }
            }
            if (num <= 0)
            {
                return(null);
            }
            ResMonsterOrganLevelDynamicInfo dataByKey2 = GameDataMgr.monsterOrganLvDynamicInfobin.GetDataByKey((long)num);

            if (dataByKey2 == null)
            {
                return(null);
            }
            switch (monsterCfg.bSoldierType)
            {
            case 1:
                result = dataByKey2.stMelee;
                break;

            case 2:
                result = dataByKey2.stRemote;
                break;

            case 3:
                result = dataByKey2.stSuper;
                break;

            case 4:
                result = dataByKey2.stAnYingDaJiang;
                break;

            case 5:
                result = dataByKey2.stHeiAnXianFeng;
                break;

            case 6:
                result = dataByKey2.stBaoZouJiangShi;
                break;

            case 7:
            case 8:
                result = dataByKey2.stBaoJun;
                break;
            }
            return(result);
        }
예제 #9
0
        private void DoCheatAction(CTrainingHelper.ECheatAct inAct, CTrainingHelper.EActTarget inTar, int inParam)
        {
            Player hostPlayer = Singleton <GamePlayerCenter> .instance.GetHostPlayer();

            COM_PLAYERCAMP playerCamp     = hostPlayer.PlayerCamp;
            COM_PLAYERCAMP cOM_PLAYERCAMP = (playerCamp == COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? COM_PLAYERCAMP.COM_PLAYERCAMP_2 : COM_PLAYERCAMP.COM_PLAYERCAMP_1;
            COM_PLAYERCAMP inCamp         = (inTar == CTrainingHelper.EActTarget.Hostile) ? cOM_PLAYERCAMP : playerCamp;

            switch (inAct)
            {
            case CTrainingHelper.ECheatAct.LevelUp:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.LevelUp));
                break;

            case CTrainingHelper.ECheatAct.SetLevel:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ResetSkillLevel));
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.SetLevel));
                break;

            case CTrainingHelper.ECheatAct.FullHp:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.FullHp));
                break;

            case CTrainingHelper.ECheatAct.FullEp:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.FullEp));
                break;

            case CTrainingHelper.ECheatAct.ToggleInvincible:
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                bool   arg_F7_0    = curLvelContext != null && curLvelContext.IsMobaMode();
                Player hostPlayer2 = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer2 != null && hostPlayer2.Captain && hostPlayer2.Captain.handle.ActorControl is HeroWrapper)
                {
                    HeroWrapper heroWrapper = (HeroWrapper)hostPlayer2.Captain.handle.ActorControl;
                    heroWrapper.bGodMode = !heroWrapper.bGodMode;
                }
                this.m_invincibleToggleFlag = !this.m_invincibleToggleFlag;
                this.RefreshBtnToggleInvincible();
                break;
            }

            case CTrainingHelper.ECheatAct.ToggleAi:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ToggleAi));
                this.m_aiToggleFlag = !this.m_aiToggleFlag;
                this.RefreshBtnToggleAi();
                break;

            case CTrainingHelper.ECheatAct.ToggleSoldier:
                Singleton <BattleLogic> .GetInstance().mapLogic.EnableSoldierRegion(this.m_soldierToggleFlag);

                this.m_soldierToggleFlag = !this.m_soldierToggleFlag;
                this.RefreshBtnToggleSoldier();
                break;

            case CTrainingHelper.ECheatAct.ResetSoldier:
            {
                Singleton <BattleLogic> .instance.mapLogic.ResetSoldierRegion();

                Singleton <BattleLogic> .instance.dynamicProperty.ResetTimer();

                Singleton <GameObjMgr> .GetInstance().KillSoldiers();

                CTrainingHelper.OrganVisiter(COM_PLAYERCAMP.COM_PLAYERCAMP_1, inParam, new Action <ActorRoot, int>(CTrainingHelper.ReviveTower));
                CTrainingHelper.OrganVisiter(COM_PLAYERCAMP.COM_PLAYERCAMP_2, inParam, new Action <ActorRoot, int>(CTrainingHelper.ReviveTower));
                AttackOrder attackOrder = Singleton <BattleLogic> .instance.attackOrder;
                if (attackOrder != null)
                {
                    attackOrder.FightOver();
                    attackOrder.FightStart();
                }
                break;
            }

            case CTrainingHelper.ECheatAct.AddGold:
            {
                SLevelContext curLvelContext2 = Singleton <BattleLogic> .instance.GetCurLvelContext();

                bool   arg_268_0   = curLvelContext2 != null && curLvelContext2.IsMobaMode();
                Player hostPlayer3 = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer3 != null && hostPlayer3.Captain)
                {
                    if (hostPlayer3.Captain.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Call)
                    {
                        CallActorWrapper callActorWrapper = hostPlayer3.Captain.handle.ActorControl as CallActorWrapper;
                        if (callActorWrapper != null && callActorWrapper.hostActor)
                        {
                            callActorWrapper.hostActor.handle.ValueComponent.ChangeGoldCoinInBattle(1000, true, true, default(Vector3), false, default(PoolObjHandle <ActorRoot>));
                        }
                    }
                    else if (hostPlayer3.Captain.handle.ValueComponent != null)
                    {
                        hostPlayer3.Captain.handle.ValueComponent.ChangeGoldCoinInBattle(1000, true, true, default(Vector3), false, default(PoolObjHandle <ActorRoot>));
                    }
                }
                break;
            }

            case CTrainingHelper.ECheatAct.ToggleZeroCd:
                CTrainingHelper.HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ToggleZeroCd));
                this.m_cdToggleFlag = !this.m_cdToggleFlag;
                this.RefreshBtnToggleCd();
                break;
            }
        }
예제 #10
0
        private void DoCheatAction(ECheatAct inAct, EActTarget inTar, int inParam)
        {
            COM_PLAYERCAMP playerCamp = Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp;

            COM_PLAYERCAMP com_playercamp2 = (playerCamp != COM_PLAYERCAMP.COM_PLAYERCAMP_1) ? COM_PLAYERCAMP.COM_PLAYERCAMP_1 : COM_PLAYERCAMP.COM_PLAYERCAMP_2;
            COM_PLAYERCAMP inCamp          = (inTar != EActTarget.Hostile) ? playerCamp : com_playercamp2;

            switch (inAct)
            {
            case ECheatAct.LevelUp:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.LevelUp));
                break;

            case ECheatAct.SetLevel:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ResetSkillLevel));
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.SetLevel));
                break;

            case ECheatAct.FullHp:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.FullHp));
                break;

            case ECheatAct.FullEp:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.FullEp));
                break;

            case ECheatAct.ToggleInvincible:
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                bool   flag       = (curLvelContext != null) && curLvelContext.IsMobaMode();
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (((hostPlayer != null) && (hostPlayer.Captain != 0)) && (hostPlayer.Captain.handle.ActorControl is HeroWrapper))
                {
                    HeroWrapper actorControl = (HeroWrapper)hostPlayer.Captain.handle.ActorControl;
                    actorControl.bGodMode = !actorControl.bGodMode;
                }
                this.m_invincibleToggleFlag = !this.m_invincibleToggleFlag;
                this.RefreshBtnToggleInvincible();
                break;
            }

            case ECheatAct.ToggleAi:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ToggleAi));
                this.m_aiToggleFlag = !this.m_aiToggleFlag;
                this.RefreshBtnToggleAi();
                break;

            case ECheatAct.ToggleSoldier:
                Singleton <BattleLogic> .GetInstance().mapLogic.EnableSoldierRegion(this.m_soldierToggleFlag);

                this.m_soldierToggleFlag = !this.m_soldierToggleFlag;
                this.RefreshBtnToggleSoldier();
                break;

            case ECheatAct.ResetSoldier:
                Singleton <BattleLogic> .instance.mapLogic.ResetSoldierRegion();

                Singleton <BattleLogic> .instance.dynamicProperty.ResetTimer();

                Singleton <GameObjMgr> .GetInstance().KillSoldiers();

                OrganVisiter(COM_PLAYERCAMP.COM_PLAYERCAMP_1, inParam, new Action <ActorRoot, int>(CTrainingHelper.ReviveTower));
                OrganVisiter(COM_PLAYERCAMP.COM_PLAYERCAMP_2, inParam, new Action <ActorRoot, int>(CTrainingHelper.ReviveTower));
                break;

            case ECheatAct.AddGold:
            {
                SLevelContext context2 = Singleton <BattleLogic> .instance.GetCurLvelContext();

                bool   flag2   = (context2 != null) && context2.IsMobaMode();
                Player player3 = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (((player3 != null) && (player3.Captain != 0)) && (player3.Captain.handle.ValueComponent != null))
                {
                    player3.Captain.handle.ValueComponent.ChangeGoldCoinInBattle(0x3e8, true, true, new Vector3(), false);
                }
                break;
            }

            case ECheatAct.ToggleZeroCd:
                HeroVisiter(inCamp, inParam, new Action <ActorRoot, int>(CTrainingHelper.ToggleZeroCd));
                this.m_cdToggleFlag = !this.m_cdToggleFlag;
                this.RefreshBtnToggleCd();
                break;
            }
        }