示例#1
0
 private void InitBuffItem(CUIFormScript formScript, SLevelContext curLevelContext)
 {
     this.m_iLevelID        = curLevelContext.m_mapID;
     this.m_CurDifficulType = curLevelContext.m_levelDifficulty;
     for (int i = 0; i < 3; i++)
     {
         string     name       = "buffInfoPanel/buffItem" + i;
         GameObject gameObject = this.m_form.transform.Find(name).gameObject;
         this.UpdateBuffItemChooseStat(i, i == (int)this.m_iSelectedBuffItem);
         uint num = curLevelContext.m_reviveInfo[curLevelContext.m_levelDifficulty].ReviveBuff[i];
         this.m_WishBuffId[i] = num;
         ResSkillCombineCfgInfo dataByKey = GameDataMgr.skillCombineDatabin.GetDataByKey(num);
         if (dataByKey != null)
         {
             if (dataByKey.szIconPath.get_Chars(0) != '\0')
             {
                 Image      component    = gameObject.transform.Find("imageIcon").GetComponent <Image>();
                 string     prefebPath   = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Skill_Dir, Utility.UTF8Convert(dataByKey.szIconPath));
                 GameObject spritePrefeb = CUIUtility.GetSpritePrefeb(prefebPath, true, true);
                 component.SetSprite(spritePrefeb, false);
             }
             Text component2 = gameObject.transform.Find("buffNameText").GetComponent <Text>();
             component2.text = StringHelper.UTF8BytesToString(ref dataByKey.szSkillCombineDesc);
         }
     }
 }
        public void Init()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaMode())
            {
                this.m_bIsMobaMode = true;
                this.m_hostActor   = Singleton <GamePlayerCenter> .instance.GetHostPlayer().Captain;

                for (int i = 0; i < 4; i++)
                {
                    this.m_Skill_HurtType_Name[i] = Singleton <CTextManager> .instance.GetText("Skill_Common_Effect_Type_" + (i + 1));
                }
                this.m_strHeroPassiveSkillName = Singleton <CTextManager> .instance.GetText("HeroDeadInfo_PassiveSkill_Name");

                this.m_strHeroEquipSkillName = Singleton <CTextManager> .instance.GetText("HeroDeadInfo_EquipSkill_Name");

                this.m_strAtkSkill0Name = Singleton <CTextManager> .instance.GetText("HeroDeadInfo_Skill0_Name");

                Singleton <GameEventSys> .instance.AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorRevive, new RefAction <DefaultGameEventParam>(this.OnActorRevive));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_DeadInfo_Click, new CUIEventManager.OnUIEventHandler(this.OnDeadInfoFormOpen));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_DeadInfoForm_Close_Click, new CUIEventManager.OnUIEventHandler(this.OnDeadInfoFormClose));
            }
        }
        public static SLevelContext CreatePvpLevelContext(byte mapType, uint mapID, COM_GAME_TYPE GameType, int difficult)
        {
            SLevelContext sLevelContext = new SLevelContext();

            sLevelContext.SetGameType(GameType);
            sLevelContext.m_mapType             = (int)mapType;
            sLevelContext.m_levelDifficulty     = difficult;
            sLevelContext.m_horizonEnableMethod = Horizon.EnableMethod.EnableAll;
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapID);

            sLevelContext.InitPvpData(pvpMapCommonInfo, mapID);
            if (mapType != 1)
            {
                if (mapType != 3)
                {
                    if (mapType == 4)
                    {
                        ResEntertainmentLevelInfo dataByKey = GameDataMgr.entertainLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_entertainmentSubMapType = (int)dataByKey.bEntertainmentSubType;
                    }
                    else if (mapType == 5)
                    {
                        ResRewardMatchLevelInfo dataByKey2 = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(mapID);
                        sLevelContext.m_SecondName = dataByKey2.szMatchName;
                    }
                    else if (mapType == 2)
                    {
                    }
                }
            }
            return(sLevelContext);
        }
示例#4
0
        public void Init(GameObject obj)
        {
            this.IsPlaying = false;
            Singleton <EventRouter> .instance.AddEventHandler <KillDetailInfo>(EventID.AchievementRecorderEvent, new Action <KillDetailInfo>(this.OnAchievementEvent));

            this.node           = obj;
            this.animatorScript = Utility.GetComponetInChild <CUIAnimatorScript>(this.node, "KillNotify_Sub");
            this.KillerImg      = Utility.GetComponetInChild <Image>(this.node, "KillNotify_Sub/KillerHead/KillerImg");
            this.VictimImg      = Utility.GetComponetInChild <Image>(this.node, "KillNotify_Sub/VictimHead/VictimImg");
            this.killerHead     = Utility.FindChild(this.node, "KillNotify_Sub/KillerHead");
            this.VictimHead     = Utility.FindChild(this.node, "KillNotify_Sub/VictimHead");
            this.Hide();
            this.hideTimer = Singleton <CTimerManager> .GetInstance().AddTimer(HideTime, -1, new CTimer.OnTimeUpHandler(this.OnPlayEnd));

            Singleton <CTimerManager> .GetInstance().PauseTimer(this.hideTimer);

            this.play_delta_timer = Singleton <CTimerManager> .GetInstance().AddTimer(s_play_deltaTime, -1, new CTimer.OnTimeUpHandler(this.On_Play_DeltaEnd));

            Singleton <CTimerManager> .GetInstance().PauseTimer(this.play_delta_timer);

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

            if ((curLvelContext != null) && (curLvelContext.iLevelID == 0x4e29))
            {
                this.sub_sys = new FireHoleKillNotify();
            }
        }
示例#5
0
        private void OnBattleScoreChange(ref SCampScoreUpdateParam param)
        {
            if (this._root == null)
            {
                this.Clear();
            }
            else if (param.HeadPoints >= 0)
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                if (param.CampType == COM_PLAYERCAMP.COM_PLAYERCAMP_1)
                {
                    if (curLvelContext.m_headPtsUpperLimit > 0)
                    {
                        this._campScoreText_1.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ScoreBoard_FireHole_1"), param.HeadPoints, curLvelContext.m_headPtsUpperLimit);
                    }
                    else
                    {
                        this._campScoreText_1.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ScoreBoard_Normal_1"), param.HeadPoints);
                    }
                }
                else if (param.CampType == COM_PLAYERCAMP.COM_PLAYERCAMP_2)
                {
                    if (curLvelContext.m_headPtsUpperLimit > 0)
                    {
                        this._campScoreText_2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ScoreBoard_FireHole_2"), param.HeadPoints, curLvelContext.m_headPtsUpperLimit);
                    }
                    else
                    {
                        this._campScoreText_2.text = string.Format(Singleton <CTextManager> .GetInstance().GetText("ScoreBoard_Normal_2"), param.HeadPoints);
                    }
                }
            }
        }
    private void OnHostPlayerHPChange()
    {
        int currentUTCTime = CRoleInfo.GetCurrentUTCTime();

        if (currentUTCTime - this.lastChangeTime < 2)
        {
            return;
        }
        this.lastChangeTime = currentUTCTime;
        Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

        if (hostPlayer == null || !hostPlayer.Captain || hostPlayer.Captain.get_handle().ActorControl == null || hostPlayer.Captain.get_handle().ValueComponent == null)
        {
            return;
        }
        int roundInt = (hostPlayer.Captain.get_handle().ValueComponent.GetHpRate() * 100L).get_roundInt();

        if (this.lastRate < roundInt)
        {
            this.lastRate = roundInt;
            return;
        }
        this.lastRate = roundInt;
        if (roundInt < 40)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide())
            {
                this.CheckTriggerTime(NewbieGuideTriggerTimeType.onHostPlayerLowHp, new uint[0]);
            }
        }
    }
示例#7
0
        public static void OnSelfLoadProcess(float progress)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null)
            {
                if (curLvelContext.IsMobaModeWithOutGuide())
                {
                    Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                    if (hostPlayer != null)
                    {
                        GameObject memberItem = GetMemberItem(hostPlayer.PlayerId);
                        if (memberItem != null)
                        {
                            Transform transform = memberItem.transform.Find("Txt_LoadingPct");
                            if (transform != null)
                            {
                                transform.GetComponent <Text>().text = string.Format("{0}%", Convert.ToUInt16((float)(progress * 100f)));
                            }
                        }
                    }
                    if (curLvelContext.m_isWarmBattle)
                    {
                        CFakePvPHelper.FakeLoadProcess(progress);
                    }
                }
                else if (_singlePlayerLoading != null)
                {
                    _singlePlayerLoading.m_formWidgets[2].GetComponent <Text>().text = string.Format("{0}%", (int)(Mathf.Clamp(progress, 0f, 1f) * 100f));
                    _singlePlayerLoading.m_formWidgets[3].GetComponent <Image>().CustomFillAmount(Mathf.Clamp(progress, 0f, 1f));
                }
            }
        }
示例#8
0
    public static void UpdateMain()
    {
        BattleLogic instance = Singleton <BattleLogic> .instance;

        if (!FogOfWar.enable || !instance.isFighting)
        {
            return;
        }
        SLevelContext curLvelContext = instance.GetCurLvelContext();

        if (curLvelContext == null || curLvelContext.m_horizonEnableMethod != Horizon.EnableMethod.EnableAll)
        {
            return;
        }
        GameFowManager instance2 = Singleton <GameFowManager> .instance;

        if (Singleton <FrameSynchr> .instance.CurFrameNum % instance2.GPUInterpolateFrameInterval == 0u)
        {
            FogOfWar.CopyBitmap();
            FogOfWar.CommitToMaterials();
        }
        GameFowCollector collector = instance2.m_collector;

        collector.UpdateFowVisibility(false);
        collector.CollectExplorer(false);
        instance2.UpdateComputing();
    }
示例#9
0
        public PauseControl(CUIFormScript rootForm)
        {
            GameObject gameObject = Utility.FindChild(rootForm.gameObject, "PauseResume");

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

            this.MaxAllowTimes = ((!curLvelContext.IsGameTypePvpRoom()) ? 0 : ((!Singleton <WatchController> .GetInstance().IsLiveCast) ? curLvelContext.m_pauseTimes : 255));
            if (this.MaxAllowTimes == 0)
            {
                this._root = null;
                return;
            }
            this.CurPauseTimes = ((Singleton <LobbyLogic> .GetInstance().reconnGameInfo == null) ? 0 : Singleton <LobbyLogic> .GetInstance().reconnGameInfo.bPauseNum);
            this._root         = gameObject;
            if (this._root)
            {
                this._pauseNode      = Utility.FindChild(this._root, "PauseNode");
                this._resumeNode     = Utility.FindChild(this._root, "ResumeNode");
                this._passedTimeTxt  = Utility.GetComponetInChild <Text>(this._pauseNode, "PassedTime");
                this._pauseCampTxt   = Utility.GetComponetInChild <Text>(this._pauseNode, "PauseCamp");
                this._resumeButton   = Utility.GetComponetInChild <Button>(this._pauseNode, "ResumeButton");
                this._resumeTimerTxt = Utility.GetComponetInChild <Text>(this._pauseNode, "ResumeButton/Text");
                this._remainNode     = Utility.FindChild(this._pauseNode, "RemainTimes");
                this._remainTimesTxt = Utility.GetComponetInChild <Text>(this._remainNode, "Times");
                this._root.CustomSetActive(false);
            }
            this._pauseTimer = 0;
            Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_ResumeMultiGame, new CUIEventManager.OnUIEventHandler(this.OnResumeMultiGame));
        }
示例#10
0
        public void ExecPauseCommand(byte pauseCommand, byte pauseByCamp, byte[] campPauseTimes)
        {
            bool flag = pauseCommand == 1;

            if (Singleton <WatchController> .GetInstance().IsWatching)
            {
                Singleton <WatchController> .GetInstance().IsRunning = !flag;
            }
            else
            {
                Singleton <FrameSynchr> .GetInstance().SetSynchrRunning(!flag);

                Singleton <FrameSynchr> .GetInstance().ResetStartTime();
            }
            if (this._root)
            {
                this._root.CustomSetActive(flag);
                if (flag)
                {
                    Singleton <CBattleSystem> .GetInstance().ClosePopupForms();

                    this._pauseNode.CustomSetActive(true);
                    this._resumeNode.CustomSetActive(false);
                    COM_PLAYERCAMP cOM_PLAYERCAMP = Singleton <WatchController> .GetInstance().IsWatching ? COM_PLAYERCAMP.COM_PLAYERCAMP_MID : Singleton <GamePlayerCenter> .GetInstance().hostPlayerCamp;

                    this._pauseCampTxt.set_text(Singleton <CTextManager> .GetInstance().GetText(string.Format("PauseTips_{0}Look{1}", (int)cOM_PLAYERCAMP, (int)pauseByCamp)));
                    this._passedSecond = 0;
                    if ((COM_PLAYERCAMP)pauseByCamp == cOM_PLAYERCAMP)
                    {
                        this._waitResumeSecond = 0;
                    }
                    else
                    {
                        ResGlobalInfo dataByKey = GameDataMgr.globalInfoDatabin.GetDataByKey(242u);
                        this._waitResumeSecond = (int)((dataByKey != null) ? dataByKey.dwConfValue : 60u);
                    }
                    this.ValidateTimerState();
                    if (cOM_PLAYERCAMP != COM_PLAYERCAMP.COM_PLAYERCAMP_MID)
                    {
                        this._remainNode.CustomSetActive(true);
                        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                        int num = curLvelContext.m_pvpPlayerNum / 2 * (int)this.MaxAllowTimes;
                        this._remainTimesTxt.set_text((num - (int)campPauseTimes[(int)cOM_PLAYERCAMP]).ToString());
                    }
                    else
                    {
                        this._remainNode.CustomSetActive(false);
                    }
                    if (this._pauseTimer == 0)
                    {
                        this._pauseTimer = Singleton <CTimerManager> .GetInstance().AddTimer(1000, -1, new CTimer.OnTimeUpHandler(this.OnPauseTimer), false);
                    }
                }
                else
                {
                    Singleton <CTimerManager> .GetInstance().RemoveTimerSafely(ref this._pauseTimer);
                }
            }
        }
示例#11
0
        private void UpdateMVPHonor()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext == null || !curLvelContext.m_isShowHonor)
            {
                return;
            }
            if (Singleton <BattleLogic> .GetInstance().battleStat.m_playerKDAStat == null)
            {
                return;
            }
            uint lastBestPlayer = Singleton <BattleStatistic> .GetInstance().GetLastBestPlayer();

            uint bestPlayer = Singleton <BattleStatistic> .GetInstance().GetBestPlayer();

            if (bestPlayer != lastBestPlayer)
            {
                Player player = Singleton <GamePlayerCenter> .instance.GetPlayer(lastBestPlayer);

                if (player != null)
                {
                    ActorRoot actorRoot = player.Captain;
                    actorRoot.HudControl.EndHonorAni();
                }
            }
            Player player2 = Singleton <GamePlayerCenter> .instance.GetPlayer(bestPlayer);

            if (player2 != null)
            {
                ActorRoot actorRoot2 = player2.Captain;
                actorRoot2.HudControl.PlayHonorAni(player2.HonorId, player2.HonorLevel);
            }
        }
示例#12
0
        public static bool DebugBattleMiniMapConfigInfo(SLevelContext data)
        {
            if (data == null)
            {
                return(false);
            }
            if (!data.IsMobaMode())
            {
                return(false);
            }
            bool   flag = true;
            string text = string.Format("---地图,id:{0},name:{1},", data.m_mapID, data.m_levelName);

            if (string.IsNullOrEmpty(data.m_miniMapPath))
            {
                text += string.Format("缩略图路径配置为空,", new object[0]);
                flag  = false;
            }
            if (string.IsNullOrEmpty(data.m_bigMapPath))
            {
                text += string.Format("地图路径配置为空,", new object[0]);
                flag  = false;
            }
            if (data.m_mapWidth == 0)
            {
                text += string.Format("地图宽度配置为空,", new object[0]);
                flag  = false;
            }
            if (data.m_mapHeight == 0)
            {
                text += string.Format("地图高度配置为空,", new object[0]);
                flag  = false;
            }
            return(flag && flag);
        }
示例#13
0
        public void Init(GameObject objPanelEnemyHeroAtk)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.IsMobaMode())
            {
                this.m_bIsMobaMode = true;
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Down, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnDown));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Battle_EnemyHeroAtkBtn_Up, new CUIEventManager.OnUIEventHandler(this.OnEnemyHeroAtkBtnUp));

                Singleton <EventRouter> .GetInstance().AddEventHandler <uint, bool>("ActorVisibleToHostPlayerChnage", new Action <uint, bool>(this.OnActorVisibleToHostPlayerChance));

                Singleton <EventRouter> .GetInstance().AddEventHandler <PoolObjHandle <ActorRoot>, int, int>("HeroHpChange", new Action <PoolObjHandle <ActorRoot>, int, int>(this.OnHeroHpChange));

                Singleton <GameEventSys> .get_instance().AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_ActorRevive, new RefAction <DefaultGameEventParam>(this.OnActorRevive));

                Singleton <GameEventSys> .get_instance().AddEventHandler <DefaultGameEventParam>(GameEventDef.Event_FightStart, new RefAction <DefaultGameEventParam>(this.OnFightStart));

                this.m_objPanelEnemyHeroAtk = objPanelEnemyHeroAtk;
                this.m_hostActor            = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().Captain;

                this.m_iEnemyDistanceMax = (int)GameDataMgr.GetGlobeValue(245);
                int globeValue = (int)GameDataMgr.GetGlobeValue(56);
                this.m_iEnemyDistanceMax             = ((this.m_iEnemyDistanceMax >= globeValue) ? globeValue : this.m_iEnemyDistanceMax);
                this.m_iCurTargetEnemyBtnIndex       = -1;
                this.m_iLastTargetEnemyBtnIndex      = -1;
                this.m_iLastSkillTargetEnemyBtnIndex = -1;
                this.m_bLastSkillUsed = true;
            }
        }
示例#14
0
    public void SetFocusActor(PoolObjHandle <ActorRoot> focus)
    {
        if (this.MobaCamera == null)
        {
            GameObject obj2 = GameObject.Find("MainCamera");
            if (obj2 != null)
            {
                this.MobaCamera = obj2.GetComponent <Moba_Camera>();
                SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                if ((curLvelContext != null) && curLvelContext.bCameraFlip)
                {
                    this.MobaCamera.settings.rotation.defualtRotation = new Vector2(this.MobaCamera.settings.rotation.defualtRotation.x, 180f);
                    this.MobaCamera.currentCameraRotation             = (Vector3)this.MobaCamera.settings.rotation.defualtRotation;
                }
                this.MobaCamera.currentZoomRate = GameSettings.CameraHeightRateValue;
            }
        }
        if (this.MobaCamera != null)
        {
            this.MobaCamera.SetTargetTransform(focus);
            this.MobaCamera.SetCameraLocked(true);
        }
        Singleton <CBattleSystem> .GetInstance().EndCameraDrag();
    }
示例#15
0
        public void Clear()
        {
            int num  = this._duration / 60;
            int num2 = this._duration - (num * 60);

            if (num2 < 0)
            {
                num2 = 0;
            }
            string timeStr = string.Format("{0:D2}:{1:D2}", num, num2);

            Singleton <SettlementSystem> .instance.SetLastMatchDuration(timeStr);

            this._duration = 0;
            DictionaryView <uint, CampInfo> campStat = Singleton <BattleLogic> .GetInstance().battleStat.GetCampStat();

            if (campStat.ContainsKey(1))
            {
                campStat[1].onCampScoreChanged -= new CampInfo.CampInfoValueChanged(this.validateScore);
            }
            if (campStat.ContainsKey(2))
            {
                campStat[2].onCampScoreChanged -= new CampInfo.CampInfoValueChanged(this.validateScore);
            }
            Singleton <EventRouter> .instance.RemoveEventHandler(EventID.BATTLE_KDA_CHANGED, new Action(this, (IntPtr)this.OnBattleKDAChanged));

            this._root        = null;
            this._leftScore   = null;
            this._rightScore  = null;
            this._txtTime     = null;
            this.levelContext = null;
            this.m_kingActor.Release();
            this.m_lastMostKill = 0;
        }
示例#16
0
        private RectTransform initMap(enBattleFormWidget mapIndex, SLevelContext levelContext, bool bMinimap, out float preWidth)
        {
            preWidth = 0f;
            GameObject widget = this.m_FormScript.GetWidget((int)mapIndex);

            DebugHelper.Assert(widget != null, "initMap GetWidget is null");
            if (widget == null)
            {
                return(null);
            }
            Image component = widget.GetComponent <Image>();

            DebugHelper.Assert(component != null, "initMap map.GetComponent<Image>() is null");
            if (component == null)
            {
                return(null);
            }
            RectTransform transform = widget.transform as RectTransform;

            preWidth = transform.rect.width;
            Vector2 sizeDelta = transform.sizeDelta;

            widget.CustomSetActive(bMinimap);
            string prefabPath = CUIUtility.s_Sprite_Dynamic_Map_Dir + (!bMinimap ? levelContext.bigMapPath : levelContext.miniMapPath);

            component.SetSprite(prefabPath, this.m_FormScript, true, false, false);
            component.SetNativeSize();
            if (bMinimap)
            {
                this.initWorldUITransformFactor(sizeDelta, levelContext, bMinimap, out Singleton <CBattleSystem> .instance.world_UI_Factor_Small, out Singleton <CBattleSystem> .instance.UI_world_Factor_Small);
                return(transform);
            }
            this.initWorldUITransformFactor(sizeDelta, levelContext, bMinimap, out Singleton <CBattleSystem> .instance.world_UI_Factor_Big, out Singleton <CBattleSystem> .instance.UI_world_Factor_Big);
            return(transform);
        }
示例#17
0
    private void OnFightStart(ref DefaultGameEventParam param)
    {
        if (!MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.onBattleStart, new uint[0]) && Singleton <CBattleSystem> .GetInstance().FightForm != null)
        {
            Singleton <CBattleSystem> .GetInstance().FightForm.ShowVoiceTips();
        }
        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

        if (curLvelContext != null && !this.IsLowHPGuideComplete() && curLvelContext.IsMobaMode())
        {
            ReadonlyContext <PoolObjHandle <ActorRoot> > allHeroes = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().GetAllHeroes();

            DebugHelper.Assert(allHeroes.get_isValidReference(), "newbie guide manager invalid all heros list.");
            if (allHeroes.get_isValidReference())
            {
                for (int i = 0; i < allHeroes.get_Count(); i++)
                {
                    if (allHeroes.get_Item(i) && allHeroes.get_Item(i).get_handle().ValueComponent != null)
                    {
                        allHeroes.get_Item(i).get_handle().ValueComponent.HpChgEvent -= new ValueChangeDelegate(this.OnHostPlayerHPChange);
                    }
                }
            }
            Player hostPlayer = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer();

            if (hostPlayer != null && hostPlayer.Captain && hostPlayer.Captain.get_handle().ValueComponent != null)
            {
                hostPlayer.Captain.get_handle().ValueComponent.HpChgEvent += new ValueChangeDelegate(this.OnHostPlayerHPChange);
            }
        }
    }
示例#18
0
        public void ShowLoading()
        {
            Singleton <BurnExpeditionController> .instance.Clear();

            MonoSingleton <ShareSys> .instance.m_bShowTimeline = false;
            Singleton <CUIManager> .GetInstance().CloseAllForm(null, true, true);

            if (Singleton <LobbyLogic> .instance.inMultiGame)
            {
                ShowMultiLoading();
            }
            else
            {
                SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

                if (curLvelContext != null)
                {
                    if (curLvelContext.IsMobaModeWithOutGuide())
                    {
                        ShowMultiLoading();
                    }
                    else
                    {
                        this.ShowPveLoading();
                    }
                }
            }
        }
示例#19
0
        private void updateFloatDigitInLastFrame()
        {
            if (MonoSingleton <Reconnection> .GetInstance().isProcessingRelayRecover)
            {
                return;
            }
            if (this.m_floatDigitInfoList == null || this.m_floatDigitInfoList.get_Count() == 0)
            {
                return;
            }
            for (int i = 0; i < this.m_floatDigitInfoList.get_Count(); i++)
            {
                FloatDigitInfo floatDigitInfo = this.m_floatDigitInfoList.get_Item(i);
                if (floatDigitInfo.m_attacker && floatDigitInfo.m_target)
                {
                    if (floatDigitInfo.m_digitType == DIGIT_TYPE.ReviveHp)
                    {
                        Vector3 position = floatDigitInfo.m_target.handle.myTransform.position;
                        this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref position);
                    }
                    else
                    {
                        Vector3       position2      = floatDigitInfo.m_target.handle.myTransform.position;
                        Vector3       position3      = floatDigitInfo.m_attacker.handle.myTransform.position;
                        SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                        Vector3 a;
                        Vector3 b;
                        float   num;
                        float   num2;
                        if (curLvelContext != null && curLvelContext.m_isCameraFlip)
                        {
                            a    = position2;
                            b    = position3;
                            num  = Random.Range(0.5f, 1f);
                            num2 = Random.Range(-1f, -0.5f);
                        }
                        else
                        {
                            a    = position3;
                            b    = position2;
                            num  = Random.Range(-1f, -0.5f);
                            num2 = Random.Range(0.5f, 1f);
                        }
                        if ((a - b).x > 0f)
                        {
                            Vector3 vector = new Vector3(position2.x + num, position2.y + Math.Abs(num), position2.z);
                            this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref vector, 1);
                        }
                        else
                        {
                            Vector3 vector2 = new Vector3(position2.x + num2, position2.y + Math.Abs(num2), position2.z);
                            this.CreateBattleFloatDigit(floatDigitInfo.m_value, floatDigitInfo.m_digitType, ref vector2, 0);
                        }
                    }
                }
            }
            this.m_floatDigitInfoList.Clear();
        }
示例#20
0
        private bool IsHostTask(GameTask gt)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            int playerCamp = (int)Singleton <GamePlayerCenter> .instance.GetHostPlayer().PlayerCamp;

            return((((curLvelContext != null) && (playerCamp >= 0)) && (playerCamp < curLvelContext.battleTaskOfCamps.Length)) && (gt.ID == curLvelContext.battleTaskOfCamps[playerCamp]));
        }
示例#21
0
        private bool IsHostTask(GameTask gt)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            int playerCamp = Singleton <GamePlayerCenter> .get_instance().GetHostPlayer().PlayerCamp;

            return(curLvelContext != null && playerCamp >= 0 && playerCamp < curLvelContext.m_battleTaskOfCamps.Length && gt.ID == curLvelContext.m_battleTaskOfCamps[playerCamp]);
        }
        internal DynamicAttributeInfo ConsiderMonsterDynamicInfo(ResMonsterCfgInfo monsterCfg)
        {
            int dwAIPlayerLevel = 0;

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

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

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

            case 2:
                return(dataByKey.stRemote);

            case 3:
                return(dataByKey.stSuper);

            case 4:
                return(dataByKey.stAnYingDaJiang);

            case 5:
                return(dataByKey.stHeiAnXianFeng);

            case 6:
                return(dataByKey.stBaoZouJiangShi);

            case 7:
            case 8:
                return(dataByKey.stBaoJun);
            }
            return(null);
        }
示例#23
0
        public static void SetPvpLevelInfo(GameObject root)
        {
            root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpLevelNode").gameObject.CustomSetActive(true);
            Text   component = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpLevelNode/GameType").GetComponent <Text>();
            Text   text2     = root.transform.Find("PanelA/Award/Panel_PlayerExp/PvpLevelNode/PvpLevel").GetComponent <Text>();
            string text      = Singleton <CTextManager> .instance.GetText("Battle_Settle_Game_Type_Single");

            string        str2           = string.Empty;
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            DebugHelper.Assert(curLvelContext != null, "Battle Level Context is NULL!!");
            uint iLevelID = (uint)curLvelContext.iLevelID;

            if (curLvelContext.isPVPLevel)
            {
                if (((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_MATCH) || (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)) || ((curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_PVP_ROOM) || (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_ENTERTAINMENT)))
                {
                    ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(iLevelID);
                    if (dataByKey == null)
                    {
                        ResCounterPartLevelInfo info2 = GameDataMgr.cpLevelDatabin.GetDataByKey(iLevelID);
                        object[] inParameters         = new object[] { iLevelID };
                        DebugHelper.Assert(info2 != null, "Failed find counterpart level config for id {0}", inParameters);
                        str2 = Utility.UTF8Convert(info2.stLevelCommonInfo.szName);
                        text = Singleton <CTextManager> .instance.GetText(string.Format("Battle_Settle_Game_Type{0}", info2.stLevelCommonInfo.bMaxAcntNum / 2));
                    }
                    else
                    {
                        str2 = Utility.UTF8Convert(dataByKey.stLevelCommonInfo.szName);
                        text = Singleton <CTextManager> .instance.GetText(string.Format("Battle_Settle_Game_Type{0}", dataByKey.stLevelCommonInfo.bMaxAcntNum / 2));
                    }
                }
                else if (curLvelContext.GameType == COM_GAME_TYPE.COM_MULTI_GAME_OF_LADDER)
                {
                    ResRankLevelInfo info3 = GameDataMgr.rankLevelDatabin.GetDataByKey(iLevelID);
                    DebugHelper.Assert(info3 != null);
                    str2 = Utility.UTF8Convert(info3.stLevelCommonInfo.szName);
                    text = Singleton <CTextManager> .instance.GetText(string.Format("Battle_Settle_Game_Type{0}", info3.stLevelCommonInfo.bMaxAcntNum / 2));
                }
            }
            else if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_ARENA)
            {
                ResLevelCfgInfo info4     = GameDataMgr.arenaLevelDatabin.GetDataByKey((int)iLevelID);
                object[]        objArray2 = new object[] { iLevelID };
                DebugHelper.Assert(info4 != null, "Failed find level config for id {0}", objArray2);
                str2 = Utility.UTF8Convert(info4.szName);
            }
            else if (curLvelContext.GameType == COM_GAME_TYPE.COM_SINGLE_GAME_OF_COMBAT)
            {
                ResAcntBattleLevelInfo info5 = GameDataMgr.pvpLevelDatabin.GetDataByKey(iLevelID);
                object[] objArray3           = new object[] { iLevelID };
                DebugHelper.Assert(info5 != null, "Failed find level config for id {0}", objArray3);
                str2 = Utility.UTF8Convert(info5.stLevelCommonInfo.szName);
            }
            component.text = text;
            text2.text     = str2;
        }
示例#24
0
        private void OnAchievementEvent(KillDetailInfo DetailInfo)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if ((curLvelContext != null) && curLvelContext.IsMobaMode())
            {
                this.AddKillInfo(DetailInfo);
            }
        }
示例#25
0
    public void On_InBattleMsg_ListElement_Click(CUIEvent uiEvent)
    {
        this.Show(false);
        int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;

        if ((srcWidgetIndexInBelongedList >= 0) && (srcWidgetIndexInBelongedList < Singleton <InBattleMsgMgr> .instance.inbatEntList.Count))
        {
            TabElement element = Singleton <InBattleMsgMgr> .instance.inbatEntList[srcWidgetIndexInBelongedList];
            if (element != null)
            {
                Player hostPlayer = Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer();

                if (hostPlayer != null)
                {
                    ResInBatMsgCfg cfgData = Singleton <InBattleMsgMgr> .instance.GetCfgData(element.cfgId);

                    DebugHelper.Assert(cfgData != null, "InbattleMsgView cfg_data == null");
                    if (cfgData != null)
                    {
                        SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

                        if (curLvelContext != null)
                        {
                            if (!Singleton <InBattleMsgMgr> .instance.ShouldBeThroughNet(curLvelContext))
                            {
                                if ((element.cfgId >= 1) && (element.cfgId <= 15))
                                {
                                    CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)element.cfgId);
                                }
                                this.InnerHandle_InBat_PreConfigMsg((COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId, element.cfgId, hostPlayer.PlayerUId);
                            }
                            else
                            {
                                if ((element.cfgId >= 1) && (element.cfgId <= 15))
                                {
                                    CPlayerBehaviorStat.Plus((CPlayerBehaviorStat.BehaviorType)element.cfgId);
                                }
                                InBattleMsgNetCore.SendInBattleMsg_PreConfig(element.cfgId, (COM_INBATTLE_CHAT_TYPE)cfgData.bShowType, hostPlayer.CaptainId);
                            }
                            if (this.m_cdButton != null)
                            {
                                ResInBatChannelCfg dataByKey = GameDataMgr.inBattleChannelDatabin.GetDataByKey((uint)cfgData.bInBatChannelID);
                                if (dataByKey != null)
                                {
                                    this.m_cdButton.StartCooldown(dataByKey.dwCdTime, null);
                                }
                                else
                                {
                                    this.m_cdButton.StartCooldown(0xfa0, null);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
示例#26
0
    private void OnHostPlayerHitByTower()
    {
        SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

        if (curLvelContext != null && curLvelContext.IsMobaModeWithOutGuide())
        {
            this.CheckTriggerTime(NewbieGuideTriggerTimeType.onHostPlayerHitByTower, new uint[0]);
        }
    }
        private void OnPreDialogStarted(ref PreDialogStartedEventParam eventParam)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            if (curLvelContext != null && curLvelContext.m_preDialogId > 0 && curLvelContext.m_preDialogId == eventParam.PreDialogId)
            {
                this.HideLoading();
            }
        }
示例#28
0
        private void InitFromView(CUIFormScript formScript)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .GetInstance().GetCurLvelContext();

            this.InitBuffItem(formScript, curLvelContext);
            this.m_relivePayType  = CMallSystem.ResBuyTypeToPayType((int)curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].bCostType);
            this.m_relivePayValue = curLvelContext.m_reviveInfo[curLvelContext.m_levelDifficulty].astReviveCost[3 - PVEReviveHeros.m_iRemainReviveNum].dwCostPrice;
            string     text   = string.Format(Singleton <CTextManager> .GetInstance().GetText("ReliveMessage"), Singleton <CTextManager> .GetInstance().GetText(CMallSystem.s_payTypeNameKeys[(int)this.m_relivePayType]));
            GameObject widget = formScript.GetWidget(0);

            if (widget != null)
            {
                Text component = widget.GetComponent <Text>();
                if (component != null)
                {
                    component.text = text;
                }
            }
            GameObject widget2 = formScript.GetWidget(1);

            if (widget2 != null)
            {
                Image component2 = widget2.GetComponent <Image>();
                if (component2 != null)
                {
                    component2.SetSprite(CMallSystem.GetPayTypeIconPath(this.m_relivePayType), formScript, true, false, false, false);
                }
            }
            GameObject widget3 = formScript.GetWidget(2);

            if (widget3 != null)
            {
                Text component3 = widget3.GetComponent <Text>();
                if (component3 != null)
                {
                    component3.text = this.m_relivePayValue.ToString();
                }
            }
            GameObject gameObject = this.m_form.transform.Find("buffInfoPanel").gameObject;

            if (gameObject == null)
            {
                return;
            }
            GameObject gameObject2 = gameObject.transform.Find("ReviveText/NumText").gameObject;

            if (gameObject2 == null)
            {
                return;
            }
            gameObject2.GetComponent <Text>().text = PVEReviveHeros.m_iRemainReviveNum.ToString();
            CUITimerScript component4    = gameObject.transform.Find("Timer").GetComponent <CUITimerScript>();
            byte           reviveTimeMax = curLvelContext.m_reviveTimeMax;

            component4.SetTotalTime((float)reviveTimeMax);
        }
示例#29
0
        private void OnAchievementEvent(KillDetailInfo DetailInfo)
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext == null || !curLvelContext.IsMobaMode())
            {
                return;
            }
            this.AddKillInfo(DetailInfo);
        }
示例#30
0
        public bool IsEnableShortcut()
        {
            SLevelContext curLvelContext = Singleton <BattleLogic> .instance.GetCurLvelContext();

            if (curLvelContext == null)
            {
                return(false);
            }
            return(curLvelContext.m_isWarmBattle || Singleton <LobbyLogic> .instance.inMultiGame);
        }