Beispiel #1
0
        public static string Get_Settle_MapName(this ModelManager mmng)
        {
            string           curLevelId = LevelManager.CurLevelId;
            SysBattleSceneVo dataById   = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(curLevelId);

            return(LanguageManager.Instance.GetStringById(dataById.scene_map_id));
        }
Beispiel #2
0
        public void ChooseSingleGame(string battleId, string hintText = "排队中")
        {
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);

            if (dataById == null)
            {
                Singleton <TipView> .Instance.ShowViewSetText("battleId[" + battleId + "] don't has config. error", 1f);

                return;
            }
            this.TeamCountMax = dataById.hero1_number_cap;
            this.ClearState();
            PvpLevelStorage.JoinAsSingle();
            this.SetBattleInfo(int.Parse(battleId), PvpJoinType.Single);
            if (GlobalSettings.Instance.PvpSetting.DirectLinkLobby)
            {
                NetWorkHelper.Instance.ConnectToLobbyServer();
            }
            else
            {
                SendMsgManager.Instance.SendGateLobbyMessage(LobbyCode.C2L_JoinQueue, new SendMsgManager.SendMsgParam(true, hintText, true, 15f), new object[]
                {
                    this.BattleInfo.BattleId,
                    "10.10.10.87-23000-23001"
                });
            }
        }
Beispiel #3
0
        private TimeSpan GetMinSurrenderTime()
        {
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurBattleId);

            ClientLogger.AssertNotNull(dataById, "vo is null");
            return(TimeSpan.FromMinutes((double)dataById.surrender_time));
        }
Beispiel #4
0
    private string GetBattleSceneMapName()
    {
        string curLevelId = LevelManager.CurLevelId;

        if (string.IsNullOrEmpty(curLevelId))
        {
            UnityEngine.Debug.LogError("GetBattleSceneMapName empty or null, leevelId: " + LevelManager.CurLevelId);
            return(string.Empty);
        }
        SysBattleSceneVo            dataById  = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(curLevelId);
        Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysMapChangeVo>();
        string scene_map_id = dataById.scene_map_id;

        foreach (KeyValuePair <string, object> current in dicByType)
        {
            SysMapChangeVo sysMapChangeVo = current.Value as SysMapChangeVo;
            if (!(sysMapChangeVo.id != dataById.scene_map_id))
            {
                DateTime dateTime  = ActivityTools.GetDateTime(sysMapChangeVo.start_time, true);
                DateTime dateTime2 = ActivityTools.GetDateTime(sysMapChangeVo.end_time, true);
                if (ToolsFacade.Instance.IsInTimeInterval(dateTime, dateTime2))
                {
                    return(sysMapChangeVo.id2);
                }
            }
        }
        return(dataById.scene_map_id);
    }
        public override void Init()
        {
            base.Init();
            Transform transform = this.transform.FindChild("ParentNode");

            this.mTweenPos = transform.GetComponent <TweenPosition>();
            this.mTime     = transform.FindChild("Time/TimeLabel").GetComponent <UILabel>();
            this.mTeam1    = transform.FindChild("TeamScore/Team1").GetComponent <UILabel>();
            this.mTeam2    = transform.FindChild("TeamScore/Team2").GetComponent <UILabel>();
            this.mKill     = transform.FindChild("Kill/KillNumLabel").GetComponent <UILabel>();
            this.mDeath    = transform.FindChild("Death/DeathNumLabel").GetComponent <UILabel>();
            this.mAssists  = transform.FindChild("Assists/AssistsNumLabel").GetComponent <UILabel>();
            this.mBoss     = transform.FindChild("Boss/BossNumLabel").GetComponent <UILabel>();
            string           level_id = LevelManager.m_CurLevel.level_id;
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(level_id);

            if (dataById != null)
            {
                if (dataById.scene_map_id.Equals("Map21"))
                {
                    transform.FindChild("TeamScore").gameObject.SetActive(false);
                    transform.FindChild("Kill").gameObject.SetActive(false);
                    transform.FindChild("Death").gameObject.SetActive(false);
                    transform.FindChild("Assists").gameObject.SetActive(false);
                    transform.FindChild("Boss").gameObject.SetActive(false);
                }
                else
                {
                    this.listener = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateGoldView));
                }
            }
        }
Beispiel #6
0
 public SceneInfo(SysBattleSceneVo scene)
 {
     this.IsOpenAdditionFactor = (scene.isOpenAddiionFactor >= 101);
     if (this.IsOpenAdditionFactor)
     {
         this.BattleAttrIndex = scene.isOpenAddiionFactor;
     }
 }
Beispiel #7
0
    public static void updataMusicState(TeamType team)
    {
        bool             flag     = false;
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);

        string[] array = new string[]
        {
            "Play_Amb_1v1_map16",
            "Play_Amb_2v2_map11",
            "Play_Amb_2v2_map13",
            "Play_Amb_2v2_map14",
            "Play_Amb_5v5_map17"
        };
        string text = dataById.scene_map_id;

        text = text.ToLower();
        for (int i = 0; i < array.Length; i++)
        {
            if (array[i].Contains(text))
            {
                if (array[i].Contains("1v1"))
                {
                    text = "1v1";
                }
                else if (array[i].Contains("5v5"))
                {
                    text = "3v3";
                }
                break;
            }
        }
        if (text.Contains("3v3"))
        {
            flag = true;
        }
        if (flag)
        {
            if (TeamManager.MyTeam == team)
            {
                if (team == TeamType.LM && AchieveData.TowerDestrouByLm == 1)
                {
                    BgmPlayer.OnFirstTowerBePullbyUS();
                }
                else if (team == TeamType.BL && AchieveData.TowerDestroyByBl == 1)
                {
                    BgmPlayer.OnFirstTowerBePullbyUS();
                }
            }
            if (AchieveData.TowerDestroyByBl == 2 || AchieveData.TowerDestrouByLm == 2)
            {
                BgmPlayer.OnFstOr2ndTowerBePullDown();
            }
        }
        else if (AchieveData.TowerDestrouByLm == 1 || AchieveData.TowerDestroyByBl == 1)
        {
            BgmPlayer.OnFstOr2ndTowerBePullDown();
        }
    }
Beispiel #8
0
 public SysBattleSceneVo GetLevelCfg(string levelId)
 {
     if (!this.mDicLevelCfg.ContainsKey(levelId))
     {
         SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(levelId);
         this.mDicLevelCfg.Add(levelId, dataById);
     }
     return(this.mDicLevelCfg[levelId]);
 }
        public override void Init()
        {
            base.Init();
            this._center              = this.transform.Find("CenterAnchor");
            this._bg                  = this._center.Find("BG");
            this._allItem             = this._center.Find("AllItem");
            this._kh                  = this.transform.Find("CenterAnchor/AllItem/KH");
            this._khBack              = this._kh.Find("Bg/BackBtn");
            this._khMatchTime         = this._kh.Find("Bg/MatchTime").GetComponent <UILabel>();
            this._khMatchLabel        = this._kh.Find("Bg/MatchLabel").GetComponent <UILabel>();
            this._dp                  = this.transform.Find("CenterAnchor/AllItem/DP");
            this._dpBack              = this._dp.Find("Bg/BackBtn");
            this._dpMatchTime         = this._dp.Find("Bg/MatchTime").GetComponent <UILabel>();
            this._dpMatchLabel        = this._dp.Find("Bg/MatchLabel").GetComponent <UILabel>();
            this._daluandou           = this.transform.Find("CenterAnchor/AllItem/DLD");
            this._daluandouBack       = this._daluandou.Find("Bg/BackBtn");
            this._daluandouMatchTime  = this._daluandou.Find("Bg/MatchTime").GetComponent <UILabel>();
            this._daluandouMatchLabel = this._daluandou.Find("Bg/MatchLabel").GetComponent <UILabel>();
            this._jbs                 = this.transform.TryFindChild("CenterAnchor/AllItem/JBS");
            this._cg                  = this.transform.Find("CenterAnchor/AllItem/CG");
            this._cgBack              = this._cg.Find("Bg/BackBtn");
            this._cgMatchTime         = this._cg.Find("Bg/MatchTime").GetComponent <UILabel>();
            this._cgMatchLabel        = this._cg.Find("Bg/MatchLabel").GetComponent <UILabel>();
            this._jbsBack             = this._jbs.Find("Bg/BackBtn");
            this._jbsMatchLabel       = this._jbs.Find("Bg/MatchLabel").GetComponent <UILabel>();
            this._jbsMatchTime        = this._jbs.Find("Bg/MatchTime").GetComponent <UILabel>();
            UIEventListener.Get(this._kh.gameObject).onClick            = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._dp.gameObject).onClick            = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._cg.gameObject).onClick            = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._cgBack.gameObject).onClick        = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._khBack.gameObject).onClick        = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._dpBack.gameObject).onClick        = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._jbsBack.gameObject).onClick       = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._daluandou.gameObject).onClick     = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._daluandouBack.gameObject).onClick = new UIEventListener.VoidDelegate(this.ClickBtn);
            UIEventListener.Get(this._jbs.gameObject).onClick           = new UIEventListener.VoidDelegate(this.ClickJbs);
            UIEventListener.Get(this._dp.gameObject).onPress            = new UIEventListener.BoolDelegate(this.ShowPressMask);
            UIEventListener.Get(this._jbs.gameObject).onPress           = new UIEventListener.BoolDelegate(this.ShowPressMask);
            UIEventListener.Get(this._cg.gameObject).onPress            = new UIEventListener.BoolDelegate(this.ShowPressMask);
            UIEventListener.Get(this._daluandou.gameObject).onPress     = new UIEventListener.BoolDelegate(this.ShowPressMask);
            UIEventListener.Get(this._kh.gameObject).onPress            = new UIEventListener.BoolDelegate(this.ShowPressMask);
            string           stringById = LanguageManager.Instance.GetStringById("MainUI_Tips_NeedSummonerLevel");
            SysBattleSceneVo dataById   = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80006");

            if (stringById != null && dataById != null)
            {
                this._daluandou.FindChild("Lock/Label").GetComponent <UILabel>().text = stringById.Replace("*", dataById.scene_limit_level.ToString());
            }
            SysBattleSceneVo dataById2 = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80021");

            if (stringById != null && dataById != null)
            {
                this._jbs.FindChild("Lock/Label").GetComponent <UILabel>().text = stringById.Replace("*", dataById2.scene_limit_level.ToString());
            }
            this.transform.GetComponent <UITweenHelper>().NextPlayDelay = 0.5f;
        }
Beispiel #10
0
    public int getScenetype()
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);

        if (dataById != null)
        {
            return(dataById.hero1_number_cap);
        }
        return(-1);
    }
 private void OnSceneLoadComplete(MobaMessage msg)
 {
     GameManager.SetGameState(GameState.Game_Playing);
     AstarPath.active.enabled = false;
     if (GlobalSettings.FogMode >= 2)
     {
         SysBattleSceneVo dataById     = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);
         string           scene_map_id = dataById.scene_map_id;
         FOWSystem.Instance.DoStart(scene_map_id);
     }
 }
Beispiel #12
0
 public static bool GetBattleSceneVo(string levelID, out SysBattleSceneVo battleScene)
 {
     battleScene = null;
     if (!string.IsNullOrEmpty(levelID))
     {
         battleScene = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(levelID);
         if (battleScene == null)
         {
             Reminder.ReminderStr("SysBattleSceneVo配置表 找不到levelID=" + levelID);
         }
     }
     return(null != battleScene);
 }
Beispiel #13
0
    public bool IsFightWithRobot(string battleId)
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);

        if (dataById != null)
        {
            ESceneBelongedBattleType belonged_battletype = (ESceneBelongedBattleType)dataById.belonged_battletype;
            if (belonged_battletype == ESceneBelongedBattleType.FightWithRobotEasy || belonged_battletype == ESceneBelongedBattleType.FightWithRobotNormal || belonged_battletype == ESceneBelongedBattleType.FightWithRobotHard)
            {
                return(true);
            }
        }
        return(false);
    }
Beispiel #14
0
    public bool IsLevelOpen(string battleId)
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);

        if (dataById == null)
        {
            return(false);
        }
        bool flag = ToolsFacade.Instance.IsRuledDayOfWeek(dataById.scene_open_day);
        bool flag3;
        bool flag2 = ToolsFacade.Instance.IsInTimeInterval(dataById.scene_open_time, out flag3);
        bool flag4 = ToolsFacade.Instance.IsRuledDayOfWeek_Tomorrow(dataById.scene_open_day);

        return((!flag && flag2 && flag3 && flag4) || (flag && flag2 && !flag3));
    }
        public static float GetAttrFactor(TeamType teamType, SysBattleSceneVo myScene)
        {
            float num = 1f;

            if (teamType == TeamType.BL)
            {
                num = myScene.hero2_factor;
            }
            if (num <= 1.401298E-45f)
            {
                ClientLogger.Warn("attrFactor is zero, ignore");
                num = 1f;
            }
            return(num);
        }
Beispiel #16
0
 public void Set(int battle_type, string battle, string level, PvpJoinType inJoinType, int index)
 {
     this.battle_type = battle_type;
     this.battle_id   = battle;
     this.level_id    = level;
     this.level_index = index;
     if (StringUtils.CheckValid(level))
     {
         SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(level);
         if (dataById != null)
         {
             this._isConnectPveServer    = (dataById.is_connect_pveserver > 0);
             this._curBelongedBattleType = (ESceneBelongedBattleType)dataById.belonged_battletype;
         }
     }
     this._curPvpJoinType = inJoinType;
 }
Beispiel #17
0
        public static string Get_Settle_BattleTypeText(this ModelManager mmng)
        {
            string           result   = string.Empty;
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.m_CurLevel.battle_id);

            if (dataById == null)
            {
                return(result);
            }
            switch (dataById.belonged_battletype)
            {
            case 2:
                result = LanguageManager.Instance.GetStringById("BattleSettlement_MatchingMode");
                break;

            case 3:
                result = LanguageManager.Instance.GetStringById("PlayUI_Title_ConfusingCombatants");
                break;

            case 4:
                result = LanguageManager.Instance.GetStringById("PlayUI_Title_Rank");
                break;

            case 5:
                result = LanguageManager.Instance.GetStringById("BattleScene_Name_80007");
                break;

            case 6:
                result = "入门人机对战";
                break;

            case 7:
                result = "一般人机对战";
                break;

            case 8:
                result = "困难人机对战";
                break;

            default:
                result = "魔霸英雄";
                break;
            }
            return(result);
        }
        private List <SkillDataItem> GetSkillListData(string battleId)
        {
            List <SkillDataItem> list     = new List <SkillDataItem>();
            SysBattleSceneVo     dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);
            int userLevel = CharacterDataMgr.instance.GetUserLevel(ModelManager.Instance.Get_userData_filed_X("Exp"));

            string[] array = dataById.summoners_skill.Split(new char[]
            {
                ','
            });
            for (int i = 0; i < array.Length; i++)
            {
                SysSummonersSkillVo dataById2     = BaseDataMgr.instance.GetDataById <SysSummonersSkillVo>(array[i]);
                SysSkillMainVo      skillMainData = BaseDataMgr.instance.GetSkillMainData(dataById2.skill_id);
                SkillDataItem       item          = new SkillDataItem(dataById2.id.ToString(), userLevel, dataById2.level_limit, LanguageManager.Instance.GetStringById(skillMainData.skill_name), ResourceManager.Load <Texture>(skillMainData.skill_icon, true, true, null, 0, false));
                list.Add(item);
            }
            return(list);
        }
Beispiel #19
0
        public override void HandleAfterOpenModule()
        {
            this.isReplayMode = GameManager.Instance.ReplayController.IsReplayStart;
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>("80007");

            if (dataById != null)
            {
                this.battleTime = (int)dataById.hero2_nb_time;
            }
            if (this.cMgr == null)
            {
                this.cMgr = new CoroutineManager();
            }
            this.dataReady = false;
            MobaMessageManager.RegistMessage((ClientMsg)25038, new MobaMessageFunc(this.DoWhenSpawnFinished));
            this.cMgr.StartCoroutine(this.DoInitComps(), true);
            this.mTimeTask = this.cMgr.StartCoroutine(this.RecordTime(), true);
            this.listener  = TriggerManager.CreateGameEventTrigger(GameEvent.UpdateView, null, new TriggerAction(this.UpdateView));
        }
Beispiel #20
0
    public static string GetCurLevelMapName()
    {
        string curLevelId = LevelManager.CurLevelId;

        if (!StringUtils.CheckValid(curLevelId))
        {
            return(string.Empty);
        }
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(curLevelId);

        if (dataById == null)
        {
            return(string.Empty);
        }
        if (StringUtils.CheckValid(dataById.scene_map_id))
        {
            return(dataById.scene_map_id);
        }
        return(string.Empty);
    }
        private void OnGetMsg_LobbyCode(OperationResponse operationResponse)
        {
            if (operationResponse.Parameters.Count < 3)
            {
                return;
            }
            string   arg       = (string)operationResponse.Parameters[0];
            string   unikey    = (string)operationResponse.Parameters[1];
            int      num       = (int)operationResponse.Parameters[2];
            KillType killType  = (KillType)num;
            string   arg2      = string.Empty;
            KillType killType2 = killType;

            switch (killType2)
            {
            case KillType.TripleKill:
                arg2 = "[2EB1F7]三杀";
                break;

            case KillType.QuadraKill:
                arg2 = "[ECC16F]四杀";
                break;

            case KillType.PentaKill:
                arg2 = "[f81841]五杀";
                break;

            default:
                if (killType2 == KillType.GodLike)
                {
                    arg2 = "[C138F9]超神";
                }
                break;
            }
            SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(unikey);

            this.data.otherMsgQueue.Enqueue(string.Format("杀神附体![e3905b]{0}[-]在{1}中获得{2}", arg, LanguageManager.Instance.GetStringById(dataById.scene_map_id), arg2));
        }
Beispiel #22
0
 public void StartBattleRefresh()
 {
     this._startTime = Time.time;
     this._battleRefreshList.Clear();
     this._battleTriggerList.Clear();
     this._battleTimeTrigger.Clear();
     if (GlobalSettings.TestBattleRefresh)
     {
         VTrigger vTrigger = this.CreateTriger(new BattleRefreshVo("110"));
         if (vTrigger != null)
         {
             this._spawnerTriggers.Add(vTrigger);
         }
     }
     else
     {
         string           curLevelId = LevelManager.CurLevelId;
         SysBattleSceneVo dataById   = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(curLevelId);
         if (dataById == null)
         {
             return;
         }
         if (dataById.refreshid != "[]")
         {
             string[] array = StringUtils.SplitVoString(dataById.refreshid, ",");
             for (int i = 0; i < array.Length; i++)
             {
                 VTrigger vTrigger2 = this.CreateTriger(new BattleRefreshVo(array[i]));
                 if (vTrigger2 != null)
                 {
                     this._spawnerTriggers.Add(vTrigger2);
                 }
                 StrategyManager.Instance.UpdateStrategyRecovery(array[i]);
             }
         }
     }
 }
Beispiel #23
0
    public void Init(HeroData herosData, NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, bool useShowFrame = true, bool changeStarDepth = true)
    {
        this.useShowFrame           = useShowFrame;
        this.m_changeStarDepth      = changeStarDepth;
        this.m_HeroTexture.material = CharacterDataMgr.instance.ReturnMaterialType(1);
        if (cardType == NewHeroItem.CardType.NullObject)
        {
            this.ShowAlphItem();
            return;
        }
        if (this.m_Frame && this.m_Frame.gameObject)
        {
            this.m_Frame.gameObject.SetActive(true);
        }
        if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject)
        {
            this.m_CenterCanChange.gameObject.SetActive(false);
        }
        this.heroData       = herosData;
        this.cardTypeRecord = cardType;
        this.InitHeroItem();
        if (herosData != null)
        {
            this.ShowQuality(herosData.Quality);
            this.ShowStars(cardType, herosData.Stars);
            SysHeroMainVo heroMainData = BaseDataMgr.instance.GetHeroMainData(herosData.HeroID);
            if (heroMainData == null)
            {
                ClientLogger.Error("HeroMain中查找" + herosData.HeroID + "结果为空,联系策划");
                return;
            }
            if (this.cardTypeRecord == NewHeroItem.CardType.HeroCardLeft || this.cardTypeRecord == NewHeroItem.CardType.HeroCardRight)
            {
                SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);
                if (this.cardTypeRecord == NewHeroItem.CardType.HeroCardRight && dataById != null && dataById.show_enemy_squad == 0)
                {
                    if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject)
                    {
                        this.m_CenterCanChange.gameObject.SetActive(true);
                    }
                }
                else
                {
                    this.m_HeroTexture.material    = CharacterDataMgr.instance.ReturnMaterialType(1);
                    this.m_HeroTexture.mainTexture = ResourceManager.Load <Texture>(heroMainData.longAvatar_icon, true, true, null, 0, false);
                }
            }
            else
            {
                this.m_HeroTexture.mainTexture = ResourceManager.Load <Texture>(heroMainData.avatar_icon, true, true, null, 0, false);
            }
            this.m_LV.text      = herosData.LV.ToString();
            base.transform.name = herosData.HeroID;
        }
        else
        {
            base.transform.name = string.Empty;
        }
        if (this.m_Center && this.m_Center.gameObject)
        {
            this.m_Center.gameObject.SetActive(true);
        }
        switch (cardType)
        {
        case NewHeroItem.CardType.None:
            this.ShowItem(false);
            if (this.m_CenterCanChange && this.m_CenterCanChange.gameObject)
            {
                this.m_CenterCanChange.gameObject.SetActive(true);
            }
            if (this.m_Center && this.m_Center.gameObject)
            {
                this.m_Center.gameObject.SetActive(false);
            }
            break;

        case NewHeroItem.CardType.Lock:
            this.ShowItem(false);
            this.ShowFrame(0, 0, "PVP_select_hero_03");
            if (this.m_None && this.m_None.gameObject)
            {
                this.m_None.gameObject.SetActive(true);
            }
            break;

        case NewHeroItem.CardType.HeroAvator:
            if (this.m_BottomRight && this.m_BottomRight.gameObject)
            {
                this.m_BottomRight.gameObject.SetActive(false);
            }
            this.ShowFrame(218, 218, "PVP_select_hero_04");
            this.m_LV.SetActive(false);
            break;

        case NewHeroItem.CardType.HeroCardLeft:
            this.ShowFrame(420, 140, "PVP_select_hero_01");
            if (this.m_Bottom && this.m_Bottom.gameObject)
            {
                this.m_Bottom.gameObject.SetActive(false);
            }
            break;

        case NewHeroItem.CardType.HeroCardRight:
            this.ShowCardLeftOrRight(false);
            this.ShowFrame(420, 140, "PVP_select_hero_02");
            if (this.m_Bottom && this.m_Bottom.gameObject)
            {
                this.m_Bottom.gameObject.SetActive(false);
            }
            break;
        }
        UIEventListener.Get(base.gameObject).onClick = new UIEventListener.VoidDelegate(this.OnSelectHero);
    }
Beispiel #24
0
    public void InitPVP(ReadyPlayerSampleInfo data, NewHeroItem.CardType cardType = NewHeroItem.CardType.Lock, bool isSelf = false)
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);

        if (dataById == null)
        {
            return;
        }
        this._hideEnemy = (dataById.show_enemy_squad == 0);
        if (Singleton <PvpManager> .Instance.IsObserver)
        {
            this._hideEnemy = false;
        }
        this.ShowAbsent(data, cardType, isSelf);
        HeroData herosData = null;

        if (this.m_UnConnect == null && this.m_CenterCanChange == null)
        {
            return;
        }
        if (data == null || data.heroInfo == null)
        {
            this.m_UnConnect.gameObject.SetActive(true);
            this.m_CenterCanChange.gameObject.SetActive(false);
        }
        if (data != null && data.heroInfo != null && !string.IsNullOrEmpty(data.GetHeroId()))
        {
            herosData = new HeroData
            {
                HeroID  = data.GetHeroId(),
                Stars   = data.heroInfo.star,
                Quality = data.heroInfo.quality,
                LV      = CharacterDataMgr.instance.GetLevel(data.heroInfo.exp)
            };
        }
        this.m_UnConnect.gameObject.SetActive(false);
        this.m_CustomName.text = string.Empty;
        if (cardType == NewHeroItem.CardType.Lock)
        {
            this.Init(null, cardType, true, true);
        }
        else if (cardType == NewHeroItem.CardType.HeroCardLeft)
        {
            this.m_CustomName.text = data.userName;
            if (isSelf)
            {
                this.m_CustomName.color = new Color(0.996078432f, 0.772549033f, 0.003921569f);
            }
            if (data.CharmRankvalue <= 50)
            {
                this.m_CustomName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(data.CharmRankvalue);
            }
            this.Init(herosData, NewHeroItem.CardType.HeroCardLeft, true, true);
            this.m_CenterCanChangeLabel.text = ((!isSelf) ? "?" : LanguageManager.Instance.GetStringById("PVPChooseHeroUI_ChooseHeroHelp"));
            this.m_CenterCanChange.gameObject.SetActive(true);
            this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Left;
            Transform arg_224_0        = this.m_CustomName.transform;
            Vector3   localEulerAngles = Vector3.one;
            this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
            arg_224_0.localEulerAngles = localEulerAngles;
            this.m_BottomLeft.gameObject.SetActive(true);
        }
        else if (cardType == NewHeroItem.CardType.HeroCardRight)
        {
            if (this._hideEnemy)
            {
                this.m_CustomName.text = LanguageManager.Instance.GetStringById("SummonerUI_Title_Summoner") + (base.transform.GetSiblingIndex() + 1);
                this.Init(herosData, NewHeroItem.CardType.HeroCardRight, true, true);
                if (this.m_CenterCanChangeLabel.text != "?")
                {
                    this.m_CenterCanChangeLabel.text = "?";
                }
                this.m_HeroTexture.enabled = false;
                this.m_CenterCanChange.gameObject.SetActive(true);
                this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Right;
                Transform arg_316_0        = this.m_CustomName.transform;
                Vector3   localEulerAngles = new Vector3(0f, 180f, 0f);
                this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
                arg_316_0.localEulerAngles = localEulerAngles;
                this.m_BottomLeft.gameObject.SetActive(true);
            }
            else
            {
                this.m_CustomName.text = data.userName;
                if (data.CharmRankvalue <= 50)
                {
                    this.m_CustomName.gameObject.GetComponent <AllochroicLabelChecker>().RenderLabel(data.CharmRankvalue);
                }
                this.Init(herosData, NewHeroItem.CardType.HeroCardRight, true, true);
                this.m_CenterCanChangeLabel.text = ((!isSelf) ? "?" : LanguageManager.Instance.GetStringById("PVPChooseHeroUI_ChooseHeroHelp"));
                this.m_CenterCanChange.gameObject.SetActive(true);
                this.m_CustomName.GetComponent <UIWidget>().rawPivot = UIWidget.Pivot.Right;
                Transform arg_3F2_0        = this.m_CustomName.transform;
                Vector3   localEulerAngles = new Vector3(0f, 180f, 0f);
                this.m_CenterCanChangeLabel.transform.localEulerAngles = localEulerAngles;
                arg_3F2_0.localEulerAngles = localEulerAngles;
                this.m_BottomLeft.gameObject.SetActive(true);
            }
        }
        if (cardType == NewHeroItem.CardType.HeroCardRight || cardType == NewHeroItem.CardType.HeroCardLeft)
        {
            if (this.heroData == null)
            {
                this.m_TopLeft.gameObject.SetActive(false);
                this.m_TopRight.gameObject.SetActive(false);
            }
            if (this.heroData == null)
            {
                this.GrayHeroItem(this.heroData);
            }
        }
        this._bindedNewUid = ((data == null) ? 0 : data.newUid);
    }
 public SpawnUtility(SysBattleSceneVo myScene)
 {
     this._myScene = myScene;
 }
Beispiel #26
0
 public SpawnMonsterTask(SysBattleSceneVo scene, EntityVoCreator creator) : base(scene)
 {
     this._creator = creator;
 }
        public bool IsCurSkillCanAdd(int skillIdx, Units target, int skillLevel = -1, int skillMaxLevel = -1)
        {
            if (GlobalSettings.isSkillUnlock || (LevelManager.IsTestingLevel && !LevelManager.Instance.CheckSceneIsTest()))
            {
                return(true);
            }
            if (!SceneInfo.Current.IsOpenAdditionFactor)
            {
                return(true);
            }
            if (target == null)
            {
                return(false);
            }
            TeamType teamType = (TeamType)((!target.MeiHuo.IsInState) ? target.teamType : ((int)this.GetEnemyTeam(target)));

            if (teamType == TeamType.BL)
            {
                Dictionary <int, bool> dictionary = this._blUnlockSkills;
            }
            else
            {
                Dictionary <int, bool> dictionary = this._lmUnlockSkills;
            }
            int num;

            if (this.levelType == 2)
            {
                num = this.GetTeamLevel(teamType);
            }
            else
            {
                num = UtilManager.Instance.GetHerolv(target.unique_id);
            }
            if (skillMaxLevel == 0 || skillLevel == skillMaxLevel)
            {
                return(false);
            }
            int num2;

            if (skillLevel >= 0)
            {
                string           text     = string.Empty;
                string           unikey   = "1";
                SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(LevelManager.CurLevelId);
                if (dataById != null)
                {
                    unikey = dataById.skill_limit;
                }
                switch (skillIdx)
                {
                case 0:
                    text = BaseDataMgr.instance.GetDataById <SysSkillLevelupLimitVo>(unikey).QLevelLimit;
                    break;

                case 1:
                    text = BaseDataMgr.instance.GetDataById <SysSkillLevelupLimitVo>(unikey).WLevelLimit;
                    break;

                case 2:
                    text = BaseDataMgr.instance.GetDataById <SysSkillLevelupLimitVo>(unikey).ELevelLimit;
                    break;

                case 3:
                    text = BaseDataMgr.instance.GetDataById <SysSkillLevelupLimitVo>(unikey).RLevelLimit;
                    break;
                }
                string[] array = text.Split(new char[]
                {
                    ','
                });
                num2 = int.Parse(array[skillLevel]);
            }
            else
            {
                num2 = this.unlockSkillConfigs[skillIdx];
            }
            return(num >= num2 && skillLevel < skillMaxLevel && skillMaxLevel > 0);
        }
 public override void HandleAfterOpenView()
 {
     this.mPanelBtn.gameObject.SetActive(false);
     this.ResetSceneType();
     SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(Singleton <PvpManager> .Instance.BattleId.ToString());
 }
Beispiel #29
0
 public Preloader(SysBattleSceneVo scene, EntityVoCreator entityVoCreator)
 {
     this._entityVoCreator = entityVoCreator;
     this._scene           = scene;
 }
Beispiel #30
0
    public bool IsSolo(string battleId)
    {
        SysBattleSceneVo dataById = BaseDataMgr.instance.GetDataById <SysBattleSceneVo>(battleId);

        return(dataById != null && dataById.hero1_number_cap == 1);
    }