Beispiel #1
0
    // Token: 0x06000580 RID: 1408 RVA: 0x00076FDC File Offset: 0x000751DC
    public int Compare(uint x, uint y)
    {
        CurHeroData data  = DataManager.Instance.curHeroData[x];
        CurHeroData data2 = DataManager.Instance.curHeroData[y];
        int         result;

        if (data.Star == data2.Star)
        {
            if (data.Enhance == data2.Enhance)
            {
                if (data.Level == data2.Level)
                {
                    result = this.MyCompare(4, data, data2);
                }
                else
                {
                    result = this.MyCompare(3, data, data2);
                }
            }
            else
            {
                result = this.MyCompare(2, data, data2);
            }
        }
        else
        {
            result = this.MyCompare(1, data, data2);
        }
        return(result);
    }
    // Token: 0x06000588 RID: 1416 RVA: 0x00077698 File Offset: 0x00075898
    public int MyCompare(int state, CurHeroData data1, CurHeroData data2)
    {
        int num  = 0;
        int num2 = 0;

        if (state == 1)
        {
            num  = (int)data1.Star;
            num2 = (int)data2.Star;
        }
        else if (state == 2)
        {
            num  = (int)data1.Enhance;
            num2 = (int)data2.Enhance;
        }
        else if (state == 3)
        {
            num  = (int)data1.Level;
            num2 = (int)data2.Level;
        }
        else if (state == 4)
        {
            num  = (int)data1.ID;
            num2 = (int)data2.ID;
        }
        if (num > num2)
        {
            return(-1);
        }
        return(1);
    }
Beispiel #3
0
    // Token: 0x060005B3 RID: 1459 RVA: 0x0007E0CC File Offset: 0x0007C2CC
    public void UpdateHeroCalData()
    {
        DataManager instance = DataManager.Instance;

        Array.Clear(this.calcHeroData, 0, this.calcHeroData.Length);
        this.HeroNum = 0;
        for (int i = 0; i < instance.curHeroData.Keys.Length; i++)
        {
            if (instance.curHeroData.Keys[i] != 0u)
            {
                CurHeroData curHeroData = instance.curHeroData[instance.curHeroData.Keys[i]];
                this.calcHeroData[(int)this.HeroNum].HeroID = curHeroData.ID;
                this.calcHeroData[(int)this.HeroNum].Rank   = curHeroData.Enhance;
                this.calcHeroData[(int)this.HeroNum].Star   = curHeroData.Star;
                this.HeroNum += 1;
            }
        }
        DataManager.MissionDataManager.SetCompleteWhileLogin(eMissionKind.Record);
    }
Beispiel #4
0
    // Token: 0x06001499 RID: 5273 RVA: 0x0023B418 File Offset: 0x00239618
    public void UpdateHeroEnhance()
    {
        DataManager instance = DataManager.Instance;

        this.MaxEnhanceID = 0;
        Array.Clear(this.HeroEnhanceNum, 0, this.HeroEnhanceNum.Length);
        for (uint num = 0u; num < instance.CurHeroDataCount; num += 1u)
        {
            CurHeroData curHeroData = instance.curHeroData.Find(instance.sortHeroData[(int)((UIntPtr)num)]);
            if (curHeroData.Enhance >= 2 && curHeroData.Enhance <= 12)
            {
                byte[] heroEnhanceNum = this.HeroEnhanceNum;
                byte   b = curHeroData.Enhance - 2;
                heroEnhanceNum[(int)b] = heroEnhanceNum[(int)b] + 1;
            }
        }
        for (int i = this.HeroEnhanceNum.Length - 2; i >= 0; i--)
        {
            this.HeroEnhanceNum[i] = this.HeroEnhanceNum[i] + this.HeroEnhanceNum[i + 1];
        }
    }
    // Token: 0x06000589 RID: 1417 RVA: 0x00077720 File Offset: 0x00075920
    public int Compare(uint x, uint y)
    {
        CurHeroData data     = DataManager.Instance.curHeroData[(uint)((ushort)x)];
        CurHeroData data2    = DataManager.Instance.curHeroData[(uint)((ushort)y)];
        ushort      leaderID = DataManager.Instance.GetLeaderID();

        if (data2.ID == leaderID && data.ID != leaderID)
        {
            return(1);
        }
        if (data.ID == leaderID && data2.ID != leaderID)
        {
            return(-1);
        }
        int result;

        if (data.Star == data2.Star)
        {
            if (data.Enhance == data2.Enhance)
            {
                if (data.Level == data2.Level)
                {
                    result = this.MyCompare(4, data, data2);
                }
                else
                {
                    result = this.MyCompare(3, data, data2);
                }
            }
            else
            {
                result = this.MyCompare(2, data, data2);
            }
        }
        else
        {
            result = this.MyCompare(1, data, data2);
        }
        return(result);
    }
Beispiel #6
0
    // Token: 0x060008C5 RID: 2245 RVA: 0x000B4860 File Offset: 0x000B2A60
    public static void GambleGetRandomHero()
    {
        Array.Clear(BattleNetwork.GambleHeroIDTemp, 0, 15);
        Array.Clear(BattleNetwork.GambleHeroCount, 0, 3);
        Array.Clear(BattleNetwork.GambleActionHeroIDTemp, 0, 5);
        GamblingManager instance  = GamblingManager.Instance;
        DataManager     instance2 = DataManager.Instance;
        int             num       = 0;
        int             num2      = 0;

        while ((long)num2 < (long)((ulong)instance2.CurHeroDataCount))
        {
            ushort num3 = (ushort)instance2.sortHeroData[num2];
            int    num4 = BattleNetwork.GambleGetHeroPriority(num3);
            if (num4 != -1 && DataManager.CheckHeroResourceReady(num3))
            {
                BattleNetwork.GambleHeroIDTemp[num4, BattleNetwork.GambleHeroCount[num4]] = num3;
                BattleNetwork.GambleHeroCount[num4]++;
            }
            num2++;
        }
        for (int i = 0; i < 3; i++)
        {
            for (int j = 0; j < BattleNetwork.GambleHeroPriorityCount[i]; j++)
            {
                if (BattleNetwork.GambleHeroCount[i] > 0)
                {
                    int num5 = UnityEngine.Random.Range(0, BattleNetwork.GambleHeroCount[i]);
                    BattleNetwork.GambleActionHeroIDTemp[num] = BattleNetwork.GambleHeroIDTemp[i, num5];
                    num++;
                    BattleNetwork.GambleHeroIDTemp[i, num5] = BattleNetwork.GambleHeroIDTemp[i, BattleNetwork.GambleHeroCount[i] - 1];
                    BattleNetwork.GambleHeroCount[i]--;
                }
            }
        }
        int num6;

        do
        {
            num6 = 0;
            if (BattleNetwork.GambleHeroCount[1] > 0)
            {
                BattleNetwork.GambleHeroIDTemp[0, BattleNetwork.GambleHeroCount[0]] = BattleNetwork.GambleHeroIDTemp[1, 0];
                BattleNetwork.GambleHeroCount[0]++;
                BattleNetwork.GambleHeroCount[1]--;
            }
            else
            {
                num6++;
            }
            if (BattleNetwork.GambleHeroCount[2] > 0)
            {
                BattleNetwork.GambleHeroIDTemp[0, BattleNetwork.GambleHeroCount[0]] = BattleNetwork.GambleHeroIDTemp[2, 0];
                BattleNetwork.GambleHeroCount[0]++;
                BattleNetwork.GambleHeroCount[2]--;
            }
            else
            {
                num6++;
            }
        }while (num6 != 2);
        for (int k = 0; k < 5; k++)
        {
            if (BattleNetwork.GambleActionHeroIDTemp[k] == 0 && BattleNetwork.GambleHeroCount[0] > 0)
            {
                int num7 = UnityEngine.Random.Range(0, BattleNetwork.GambleHeroCount[0]);
                BattleNetwork.GambleActionHeroIDTemp[k] = BattleNetwork.GambleHeroIDTemp[0, num7];
                BattleNetwork.GambleHeroIDTemp[0, num7] = BattleNetwork.GambleHeroIDTemp[0, BattleNetwork.GambleHeroCount[0] - 1];
                BattleNetwork.GambleHeroCount[0]--;
            }
        }
        instance.BattleHeroCount = 0;
        Array.Clear(instance.BattleHeroData, 0, 5);
        for (int l = 0; l < 5; l++)
        {
            if (BattleNetwork.GambleActionHeroIDTemp[l] != 0)
            {
                instance.BattleHeroData[(int)instance.BattleHeroCount].HeroID = BattleNetwork.GambleActionHeroIDTemp[l];
                GamblingManager gamblingManager = instance;
                gamblingManager.BattleHeroCount += 1;
            }
        }
        for (int m = 0; m < (int)instance.BattleHeroCount; m++)
        {
            CurHeroData curHeroData = instance2.curHeroData[(uint)instance.BattleHeroData[m].HeroID];
            instance.BattleHeroData[m].AttrData.SkillLV1 = curHeroData.SkillLV[0];
            instance.BattleHeroData[m].AttrData.SkillLV2 = curHeroData.SkillLV[1];
            instance.BattleHeroData[m].AttrData.SkillLV3 = curHeroData.SkillLV[2];
            instance.BattleHeroData[m].AttrData.SkillLV4 = curHeroData.SkillLV[3];
            instance.BattleHeroData[m].AttrData.LV       = curHeroData.Level;
            instance.BattleHeroData[m].AttrData.Star     = curHeroData.Star;
            instance.BattleHeroData[m].AttrData.Enhance  = curHeroData.Enhance;
            instance.BattleHeroData[m].AttrData.Equip    = curHeroData.Equip;
        }
    }
Beispiel #7
0
    // Token: 0x060008C3 RID: 2243 RVA: 0x000B45C0 File Offset: 0x000B27C0
    public static void RecvBattleEnd(MessagePacket MP)
    {
        GUIManager.Instance.HideUILock(EUILock.Battle);
        DataManager instance = DataManager.Instance;
        byte        b        = MP.ReadByte(-1);

        instance.lastBattleResult         = (short)b;
        instance.BattleSeqID              = 0UL;
        BattleNetwork.SendBattleEndStatus = 0;
        if (b != 0)
        {
            instance.RWMoney    = (uint)DataManager.StageDataController.GetLevelBycurrentPointID(0).Money;
            instance.KingOldLv  = instance.RoleAttr.Level;
            instance.KingOldExp = instance.RoleAttr.Exp;
            DataManager.StageDataController.RoleAttrLevelUp(MP, 63);
            byte   b2             = MP.ReadByte(-1);
            ushort in_StageRecord = MP.ReadUShort(-1);
            ushort freq           = MP.ReadUShort(-1);
            b2 -= 1;
            DataManager.StageDataController.SetStagePoint(BattleNetwork.battlePointID, b, freq);
            DataManager.StageDataController.UpdateStageRecord((StageMode)b2, in_StageRecord);
            BattleNetwork.bStageFirstTry[(int)b2] = true;
            for (int i = 0; i < 5; i++)
            {
                ushort num = MP.ReadUShort(-1);
                if (num != 0 && instance.curHeroData.ContainsKey((uint)num))
                {
                    CurHeroData curHeroData = instance.curHeroData[(uint)num];
                    instance.heroLv[i]  = curHeroData.Level;
                    instance.heroExp[i] = curHeroData.Exp;
                    instance.UpdateHeroAttr(num, MP);
                }
                else
                {
                    MP.ReadByte(-1);
                    MP.ReadUInt(-1);
                    MP.ReadUInt(-1);
                }
            }
            int num2 = 0;
            while (num2 < instance.RewardCount && num2 < 128)
            {
                ushort itemID          = instance.RewardData[num2];
                ushort curItemQuantity = instance.GetCurItemQuantity(itemID, 0);
                if (curItemQuantity < 65535)
                {
                    instance.SetCurItemQuantity(itemID, curItemQuantity + 1, 0, 0L);
                }
                num2++;
            }
            GameManager.OnRefresh(NetworkNews.Refresh, null);
            GameManager.OnRefresh(NetworkNews.Refresh_Item, null);
            if (instance.KingOldLv != instance.RoleAttr.Level)
            {
                GameManager.OnRefresh(NetworkNews.Refresh_Attr, null);
            }
            DataManager.msgBuffer[0] = 32;
            DataManager.msgBuffer[1] = 2;
            GameManager.notifyObservers(1, 0, DataManager.msgBuffer);
            AFAdvanceManager.Instance.CheckHeroStageUnbroken();
        }
    }
Beispiel #8
0
    // Token: 0x06001C44 RID: 7236 RVA: 0x0031DF60 File Offset: 0x0031C160
    private void UpdateScrollData()
    {
        Door door = GUIManager.Instance.FindMenu(EGUIWindow.Door) as Door;

        this.FightHeroNum    = DataManager.Instance.FightHeroCount;
        this.NonFightHeroNum = DataManager.Instance.CurHeroDataCount - this.FightHeroNum;
        this.DespawnPool();
        this.m_HeroList_Soldier_Items.Clear();
        this.m_HeroList_Soldier_Items2.Clear();
        this.m_HeroList_Soldier_Items3.Clear();
        this.m_HeroList_Soldier_Items4.Clear();
        this.m_HeroList_Soldier_Items5.Clear();
        this.m_HeightData.Clear();
        if (DataManager.Instance.CurHeroDataCount % 2u == 0u)
        {
            this.DataCount = (int)(DataManager.Instance.CurHeroDataCount + 4u);
        }
        else
        {
            this.DataCount = (int)(DataManager.Instance.CurHeroDataCount + 1u + 4u);
        }
        int num = (int)((this.NonFightHeroNum % 2u != 0u) ? (this.NonFightHeroNum + 1u) : this.NonFightHeroNum);

        for (int i = 0; i < num; i++)
        {
            HeroList_Soldier_Item heroList_Soldier_Item = GUIManager.Instance.m_HeroList_Soldier_ItemDataPool.spawn();
            this.m_HeroList_Soldier_Items.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items2.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items3.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items4.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items5.Add(heroList_Soldier_Item);
            heroList_Soldier_Item.Arms = 0;
            uint        key         = DataManager.Instance.NonFightHeroID[i];
            CurHeroData curHeroData = DataManager.Instance.curHeroData[key];
            heroList_Soldier_Item.Enhance  = curHeroData.Enhance;
            heroList_Soldier_Item.HeroID   = curHeroData.ID;
            heroList_Soldier_Item.MaxNum   = DataManager.Instance.RankSoldiers[(int)curHeroData.Enhance];
            heroList_Soldier_Item.bIsLords = false;
            heroList_Soldier_Item.bSelect  = false;
            heroList_Soldier_Item.bIsFight = false;
            heroList_Soldier_Item.Type     = 0;
            if (i % 2 == 0)
            {
                this.m_HeightData.Add(80f);
            }
        }
        for (int j = 0; j < 2; j++)
        {
            HeroList_Soldier_Item heroList_Soldier_Item = GUIManager.Instance.m_HeroList_Soldier_ItemDataPool.spawn();
            this.m_HeroList_Soldier_Items.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items2.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items3.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items4.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items5.Add(heroList_Soldier_Item);
            heroList_Soldier_Item.Type = 1;
            if (j % 2 == 0)
            {
                this.m_HeightData.Add(40f);
            }
        }
        int num2 = (int)((this.FightHeroNum % 2u != 0u) ? (this.FightHeroNum + 1u) : this.FightHeroNum);

        for (int k = 0; k < num2; k++)
        {
            HeroList_Soldier_Item heroList_Soldier_Item = GUIManager.Instance.m_HeroList_Soldier_ItemDataPool.spawn();
            this.m_HeroList_Soldier_Items.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items2.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items3.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items4.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items5.Add(heroList_Soldier_Item);
            heroList_Soldier_Item.Arms = 0;
            uint        key         = DataManager.Instance.FightHeroID[k];
            CurHeroData curHeroData = DataManager.Instance.curHeroData[key];
            heroList_Soldier_Item.Enhance  = curHeroData.Enhance;
            heroList_Soldier_Item.HeroID   = curHeroData.ID;
            heroList_Soldier_Item.MaxNum   = DataManager.Instance.RankSoldiers[(int)curHeroData.Enhance];
            heroList_Soldier_Item.bIsLords = false;
            heroList_Soldier_Item.bSelect  = false;
            heroList_Soldier_Item.bIsFight = true;
            heroList_Soldier_Item.Type     = 0;
            if (k % 2 == 0)
            {
                this.m_HeightData.Add(80f);
            }
        }
        for (int l = 0; l < 2; l++)
        {
            HeroList_Soldier_Item heroList_Soldier_Item = GUIManager.Instance.m_HeroList_Soldier_ItemDataPool.spawn();
            this.m_HeroList_Soldier_Items.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items2.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items3.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items4.Add(heroList_Soldier_Item);
            this.m_HeroList_Soldier_Items5.Add(heroList_Soldier_Item);
            heroList_Soldier_Item.Type = 2;
            if (l % 2 == 0)
            {
                this.m_HeightData.Add(60f);
            }
        }
    }
Beispiel #9
0
    // Token: 0x0600109E RID: 4254 RVA: 0x001D80F0 File Offset: 0x001D62F0
    public void RecvArena_Challenge(MessagePacket MP)
    {
        GUIManager.Instance.HideUILock(EUILock.Arena);
        byte b = MP.ReadByte(-1);

        if (b == 0)
        {
            this.BattleResult             = MP.ReadByte(-1);
            this.m_ArenaPlace             = MP.ReadUInt(-1);
            this.m_ArenaTodayChallenge    = MP.ReadByte(-1);
            this.m_ArenaLastChallengeTime = MP.ReadLong(-1);
            DataManager dataManager = DataManager.Instance;
            dataManager.KingOldLv  = dataManager.RoleAttr.Level;
            dataManager.KingOldExp = dataManager.RoleAttr.Exp;
            DataManager.StageDataController.UpdateRoleAttrLevel(MP.ReadByte(-1));
            DataManager.StageDataController.UpdateRoleAttrExp(MP.ReadUInt(-1));
            MP.ReadUInt(-1);
            for (int i = 0; i < 5; i++)
            {
                ushort num = MP.ReadUShort(-1);
                if (num != 0 && dataManager.curHeroData.ContainsKey((uint)num))
                {
                    CurHeroData curHeroData = dataManager.curHeroData[(uint)num];
                    dataManager.heroLv[i]  = curHeroData.Level;
                    dataManager.heroExp[i] = curHeroData.Exp;
                    dataManager.UpdateHeroAttr(num, MP);
                }
                else
                {
                    MP.ReadByte(-1);
                    MP.ReadUInt(-1);
                    MP.ReadUInt(-1);
                }
            }
            ArenaReportDataType arenaReportDataType = default(ArenaReportDataType);
            arenaReportDataType.MyHeroData            = new ArenaHeroDataType[5];
            arenaReportDataType.EnemyHeroData         = new ArenaHeroDataType[5];
            arenaReportDataType.TopicID               = new byte[2];
            arenaReportDataType.TopicEffect           = new ArenaTopicEffectDataType[2];
            arenaReportDataType.SimulatorVersion      = MP.ReadUInt(-1);
            arenaReportDataType.SimulatorPatchNo      = MP.ReadUInt(-1);
            arenaReportDataType.Flag                  = MP.ReadByte(-1);
            arenaReportDataType.TopicID[0]            = MP.ReadByte(-1);
            arenaReportDataType.TopicID[1]            = MP.ReadByte(-1);
            arenaReportDataType.TopicEffect[0].Effect = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[0].Value  = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[1].Effect = MP.ReadUShort(-1);
            arenaReportDataType.TopicEffect[1].Value  = MP.ReadUShort(-1);
            arenaReportDataType.ChangePlace           = MP.ReadUInt(-1);
            for (int j = 0; j < 5; j++)
            {
                arenaReportDataType.MyHeroData[j].SkillLV = new byte[4];
                arenaReportDataType.MyHeroData[j].ID      = MP.ReadUShort(-1);
                arenaReportDataType.MyHeroData[j].Level   = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Rank    = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Star    = MP.ReadByte(-1);
                arenaReportDataType.MyHeroData[j].Equip   = MP.ReadByte(-1);
                for (int k = 0; k < 4; k++)
                {
                    arenaReportDataType.MyHeroData[j].SkillLV[k] = MP.ReadByte(-1);
                }
            }
            arenaReportDataType.EnemyHead        = MP.ReadUShort(-1);
            arenaReportDataType.EnemyName        = MP.ReadString(13, -1);
            arenaReportDataType.EnemyAllianceTag = MP.ReadString(3, -1);
            for (int l = 0; l < 5; l++)
            {
                arenaReportDataType.EnemyHeroData[l].SkillLV = new byte[4];
                arenaReportDataType.EnemyHeroData[l].ID      = MP.ReadUShort(-1);
                arenaReportDataType.EnemyHeroData[l].Level   = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Rank    = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Star    = MP.ReadByte(-1);
                arenaReportDataType.EnemyHeroData[l].Equip   = MP.ReadByte(-1);
                for (int m = 0; m < 4; m++)
                {
                    arenaReportDataType.EnemyHeroData[l].SkillLV[m] = MP.ReadByte(-1);
                }
            }
            arenaReportDataType.RandomSeed  = MP.ReadUShort(-1);
            arenaReportDataType.RandomGap   = MP.ReadByte(-1);
            arenaReportDataType.PrimarySide = MP.ReadByte(-1);
            arenaReportDataType.Time        = MP.ReadLong(-1);
            if (!this.bArenaOpenGet)
            {
                if (this.m_ArenaReportData.Count == 20)
                {
                    this.m_ArenaReportData.RemoveAt(0);
                }
                bool flag = false;
                if (this.RepoetUnReadCount > 0 && this.RepoetUnRead[0] == 0)
                {
                    flag = true;
                    this.RepoetUnReadCount -= 1;
                }
                if (flag)
                {
                    int num2 = 0;
                    while (num2 < (int)this.RepoetUnReadCount && this.RepoetUnReadCount < 19)
                    {
                        byte[] repoetUnRead  = this.RepoetUnRead;
                        int    num3          = num2;
                        byte[] repoetUnRead2 = this.RepoetUnRead;
                        int    num4          = num2 + 1;
                        repoetUnRead[num3] = (repoetUnRead2[num4] -= 1);
                        num2++;
                    }
                }
                else
                {
                    int num5 = 0;
                    while (num5 < (int)this.RepoetUnReadCount && num5 < this.RepoetUnRead.Length)
                    {
                        byte[] repoetUnRead3 = this.RepoetUnRead;
                        int    num6          = num5;
                        byte[] repoetUnRead4 = this.RepoetUnRead;
                        int    num7          = num5;
                        repoetUnRead3[num6] = (repoetUnRead4[num7] -= 1);
                        num5++;
                    }
                }
                this.m_ArenaReportData.Add(arenaReportDataType);
            }
            this.m_ArenaHistoryPlace = MP.ReadUInt(-1);
            GUIManager.Instance.BuildingData.UpdateBuildState(5, 255);
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_Arena, 2, 0);
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_TreasureBox, 5, 0);
            if (this.m_ArenaHistoryPlace > 0u && this.m_ArenaHistoryPlace < 65535u)
            {
                DataManager.MissionDataManager.CheckChanged(eMissionKind.Record, 29, (ushort)(65535u - this.m_ArenaHistoryPlace));
            }
            if ((arenaReportDataType.Flag & 2) != 0 && GUIManager.Instance.FindMenu(EGUIWindow.UI_BattleHeroSelect) != null)
            {
                if (WarManager.CheckVersion(arenaReportDataType.SimulatorVersion, arenaReportDataType.SimulatorPatchNo, true))
                {
                    this.ArenaPlayingData                 = arenaReportDataType;
                    BattleController.BattleMode           = EBattleMode.PVP;
                    GUIManager.Instance.bClearWindowStack = false;
                    if (GUIManager.Instance.m_WindowStack.Count > 0)
                    {
                        GUIManager.Instance.m_WindowStack.RemoveAt(GUIManager.Instance.m_WindowStack.Count - 1);
                    }
                    GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 0, 0);
                    DataManager.Instance.SetArenaHeroBattleDataSave();
                }
                else
                {
                    GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 6, 0);
                }
            }
            FBAdvanceManager.Instance.TriggerFbUniqueEvent(EFBEvent.FIRST_COLOSSEUM_BATTLE);
        }
        else
        {
            if (b == 6)
            {
                GUIManager.Instance.AddHUDMessage(DataManager.Instance.mStringTable.GetStringByID(9157u), 255, true);
            }
            GUIManager.Instance.UpdateUI(EGUIWindow.UI_BattleHeroSelect, 6, 0);
        }
    }
Beispiel #10
0
    // Token: 0x06001F1A RID: 7962 RVA: 0x003BADEC File Offset: 0x003B8FEC
    private void SetSkillHint(ushort heroID, byte enhance, int MaxNum, byte Arms)
    {
        byte[] array = new byte[]
        {
            1,
            2,
            4,
            8,
            20
        };
        Hero recordByKey = this.DM.HeroTable.GetRecordByKey(heroID);

        ushort[] array2 = new ushort[]
        {
            recordByKey.GroupSkill1,
            recordByKey.GroupSkill2,
            recordByKey.GroupSkill3,
            recordByKey.GroupSkill4
        };
        CurHeroData curHeroData = this.DM.curHeroData[(uint)heroID];

        this.GM.ChangeHeroItemImg(this.m_HeroIcon.transform, eHeroOrItem.Hero, heroID, curHeroData.Star, 0, 0);
        this.m_HeroNameText.text      = this.DM.mStringTable.GetStringByID((uint)recordByKey.HeroTitle);
        this.m_HeroArmsText.text      = this.GetArmsStr(Arms);
        this.m_HeroEnhanceIcon.sprite = this.GetEnhanceIcon(enhance);
        this.m_HeroMaxNumStr.ClearString();
        StringManager.Instance.IntToFormat((long)MaxNum, 1, true);
        this.m_HeroMaxNumStr.AppendFormat("{0}");
        this.m_HeroMaxNum.text = this.m_HeroMaxNumStr.ToString();
        for (int i = 0; i < 4; i++)
        {
            Skill   recordByKey2 = this.DM.SkillTable.GetRecordByKey(array2[i]);
            CString cstring      = StringManager.Instance.StaticString1024();
            cstring.ClearString();
            cstring.IntToFormat((long)recordByKey2.SkillIcon, 5, false);
            cstring.AppendFormat("s{0}");
            this.m_SkillImage[i].sprite   = this.GM.LoadSkillSprite(cstring);
            this.m_SkillImage[i].material = this.GM.GetSkillMaterial();
            this.m_SkillFrame[i].sprite   = this.GM.LoadFrameSprite("sk");
            this.m_SkillFrame[i].material = this.GM.GetFrameMaterial();
            this.m_SkliiNameText[i].text  = this.DM.mStringTable.GetStringByID((uint)recordByKey2.SkillName);
            this.m_SkillInfoStr[i].ClearString();
            float num = (float)recordByKey2.HurtValue + (float)((ushort)array[(int)(curHeroData.Star - 1)] * recordByKey2.HurtIncreaseValue) / 1000f;
            if (recordByKey2.HurtKind == 1)
            {
                GameConstants.GetEffectValue(this.m_SkillInfoStr[i], recordByKey2.HurtAddition, 0u, 7, 0f);
                this.m_SkillInfoStr[i].IntToFormat((long)((ushort)array[(int)(curHeroData.Star - 1)] * recordByKey2.HurtIncreaseValue), 1, false);
                this.m_SkillInfoStr[i].AppendFormat("{0}");
                this.m_SkillInfoText[i].text = this.m_SkillInfoStr[i].ToString();
            }
            else
            {
                if (recordByKey2.SkillType == 10)
                {
                    GameConstants.GetEffectValue(this.m_SkillInfoStr[i], recordByKey2.HurtAddition, (uint)num, 1, 0f);
                }
                else
                {
                    GameConstants.GetEffectValue(this.m_SkillInfoStr[i], recordByKey2.HurtAddition, 0u, 6, num * 100f);
                }
                this.m_SkillInfoText[i].text = this.m_SkillInfoStr[i].ToString();
            }
            if (curHeroData.SkillLV[i] == 0)
            {
                this.SetMaskColor(i, true);
                this.m_SkillMaskTf[i].gameObject.SetActive(true);
            }
            else
            {
                this.SetMaskColor(i, false);
                this.m_SkillMaskTf[i].gameObject.SetActive(false);
            }
        }
    }
Beispiel #11
0
    // Token: 0x06001F11 RID: 7953 RVA: 0x003BA240 File Offset: 0x003B8440
    private void SetData(ushort SelectHeroID = 0)
    {
        SoldierScrollItem soldierScrollItem = null;
        ushort            leaderID          = this.DM.GetLeaderID();

        this.m_Data.Clear();
        this.bLordIsFight = false;
        int num = 0;

        while ((long)num < (long)((ulong)this.DM.NonFightHeroCount))
        {
            int  num2 = num % 2;
            uint num3 = this.DM.SortNonFightHeroID[num];
            if (num2 == 0)
            {
                soldierScrollItem = this.GM.m_HeroList_Soldier_ItemDataPool2.spawn();
                soldierScrollItem.Item[0].Enable   = false;
                soldierScrollItem.Item[0].Type     = 0;
                soldierScrollItem.Item[1].Enable   = false;
                soldierScrollItem.Item[1].Type     = 0;
                soldierScrollItem.Item[0].HeroID   = 0;
                soldierScrollItem.Item[1].HeroID   = 0;
                soldierScrollItem.Item[0].bIsLords = false;
                soldierScrollItem.Item[1].bIsLords = false;
            }
            soldierScrollItem.Height = 80f;
            if (DataManager.Instance.curHeroData.ContainsKey(num3))
            {
                Hero recordByKey = this.DM.HeroTable.GetRecordByKey((ushort)num3);
                soldierScrollItem.Item[num2].HeroID = (ushort)num3;
                soldierScrollItem.Item[num2].Enable = true;
                CurHeroData curHeroData = DataManager.Instance.curHeroData[num3];
                soldierScrollItem.Item[num2].Lv       = curHeroData.Level;
                soldierScrollItem.Item[num2].Enhance  = curHeroData.Enhance;
                soldierScrollItem.Item[num2].Arms     = recordByKey.SoldierKind;
                soldierScrollItem.Item[num2].Star     = curHeroData.Star;
                soldierScrollItem.Item[num2].MaxNum   = this.DM.RankSoldiers[(int)curHeroData.Enhance];
                soldierScrollItem.Item[num2].bIsLords = false;
                soldierScrollItem.Item[num2].bSelect  = false;
                soldierScrollItem.Item[num2].bIsFight = false;
                soldierScrollItem.Item[num2].Type     = 0;
                if (num3 == (uint)leaderID)
                {
                    soldierScrollItem.Item[num2].bIsLords = true;
                    this.SetOriginalLord((ushort)num3, soldierScrollItem.Item[num2].Arms, soldierScrollItem.Item[num2].Enhance, soldierScrollItem.Item[num2].MaxNum, soldierScrollItem.Item[num2].Star, soldierScrollItem.Item[num2].Lv);
                }
                if ((uint)SelectHeroID == num3)
                {
                    soldierScrollItem.Item[num2].bSelect = true;
                    this.SetChangeLord((ushort)num3, soldierScrollItem.Item[num2].Arms, soldierScrollItem.Item[num2].Enhance, soldierScrollItem.Item[num2].MaxNum, soldierScrollItem.Item[num2].Star, soldierScrollItem.Item[num2].Lv);
                    this.NowSelectIdx = this.m_Data.Count;
                    this.NowLeft      = num2;
                }
                if (num2 == 1 || (long)num == (long)((ulong)(this.DM.NonFightHeroCount - 1u)))
                {
                    this.m_Data.Add(soldierScrollItem);
                }
            }
            else if (num2 == 1 || (long)num == (long)((ulong)(this.DM.NonFightHeroCount - 1u)))
            {
                this.GM.m_HeroList_Soldier_ItemDataPool2.despawn(soldierScrollItem);
            }
            num++;
        }
        if (this.DM.FightHeroCount > 0u)
        {
            soldierScrollItem = this.GM.m_HeroList_Soldier_ItemDataPool2.spawn();
            soldierScrollItem.Item[0].Type     = 1;
            soldierScrollItem.Item[1].Type     = 1;
            soldierScrollItem.Item[0].HeroID   = 0;
            soldierScrollItem.Item[1].HeroID   = 0;
            soldierScrollItem.Item[0].Enable   = true;
            soldierScrollItem.Item[1].Enable   = true;
            soldierScrollItem.Item[0].bIsLords = false;
            soldierScrollItem.Item[1].bIsLords = false;
            soldierScrollItem.Height           = 50f;
            this.m_Data.Add(soldierScrollItem);
        }
        int num4 = 0;

        while ((long)num4 < (long)((ulong)this.DM.FightHeroCount))
        {
            int  num2 = num4 % 2;
            uint num3 = this.DM.SortFightHeroID[num4];
            if (num2 == 0)
            {
                soldierScrollItem = this.GM.m_HeroList_Soldier_ItemDataPool2.spawn();
                soldierScrollItem.Item[0].Enable   = false;
                soldierScrollItem.Item[0].Type     = 0;
                soldierScrollItem.Item[1].Enable   = false;
                soldierScrollItem.Item[1].Type     = 0;
                soldierScrollItem.Item[0].HeroID   = 0;
                soldierScrollItem.Item[1].HeroID   = 0;
                soldierScrollItem.Item[0].bIsLords = false;
                soldierScrollItem.Item[1].bIsLords = false;
            }
            soldierScrollItem.Item[num2].Type   = 0;
            soldierScrollItem.Item[num2].HeroID = (ushort)num3;
            soldierScrollItem.Height            = 80f;
            if (DataManager.Instance.curHeroData.ContainsKey(num3))
            {
                soldierScrollItem.Item[num2].HeroID = (ushort)num3;
                Hero recordByKey = this.DM.HeroTable.GetRecordByKey((ushort)num3);
                soldierScrollItem.Item[num2].Enable = true;
                CurHeroData curHeroData = DataManager.Instance.curHeroData[num3];
                soldierScrollItem.Item[num2].Lv       = curHeroData.Level;
                soldierScrollItem.Item[num2].Enhance  = curHeroData.Enhance;
                soldierScrollItem.Item[num2].Arms     = recordByKey.SoldierKind;
                soldierScrollItem.Item[num2].Star     = curHeroData.Star;
                soldierScrollItem.Item[num2].MaxNum   = this.DM.RankSoldiers[(int)curHeroData.Enhance];
                soldierScrollItem.Item[num2].bIsLords = false;
                soldierScrollItem.Item[num2].bSelect  = false;
                soldierScrollItem.Item[num2].bIsFight = true;
                soldierScrollItem.Item[num2].Type     = 0;
                if (num3 == (uint)leaderID)
                {
                    this.bLordIsFight = true;
                    soldierScrollItem.Item[num2].bIsLords = true;
                    this.m_OriginaHIBtn.gameObject.SetActive(true);
                    this.SetOriginalLord((ushort)num3, soldierScrollItem.Item[num2].Arms, soldierScrollItem.Item[num2].Enhance, soldierScrollItem.Item[num2].MaxNum, soldierScrollItem.Item[num2].Star, soldierScrollItem.Item[num2].Lv);
                }
                if (num2 == 1 || (long)num4 == (long)((ulong)(this.DM.FightHeroCount - 1u)))
                {
                    this.m_Data.Add(soldierScrollItem);
                }
            }
            else if (num2 == 1 || (long)num4 == (long)((ulong)(this.DM.FightHeroCount - 1u)))
            {
                this.GM.m_HeroList_Soldier_ItemDataPool2.despawn(soldierScrollItem);
            }
            num4++;
        }
    }
Beispiel #12
0
    // Token: 0x06001AAC RID: 6828 RVA: 0x002D5CF4 File Offset: 0x002D3EF4
    private void SetData()
    {
        GUIManager  instance  = GUIManager.Instance;
        DataManager instance2 = DataManager.Instance;

        this.CheckFight();
        int i = 0;

        while (i < 5)
        {
            Transform child     = base.transform.GetChild(2).GetChild(i);
            UIHIBtn   component = child.GetChild(1).GetComponent <UIHIBtn>();
            component.m_BtnID1  = i;
            component.m_Handler = this;
            this.m_HiBtn[i]     = component;
            UIButton component2 = child.GetChild(2).GetChild(0).GetComponent <UIButton>();
            component2.m_Handler = this;
            component2.m_BtnID1  = 1;
            if (i < this.MaxDefender)
            {
                if (instance2.m_DefendersID[i] != 0)
                {
                    if (!DataManager.Instance.curHeroData.ContainsKey((uint)instance2.m_DefendersID[i]))
                    {
                        goto IL_49F;
                    }
                    CurHeroData curHeroData = instance2.curHeroData[(uint)instance2.m_DefendersID[i]];
                    Hero        recordByKey = instance2.HeroTable.GetRecordByKey(curHeroData.ID);
                    UIHIBtn     component3  = child.GetChild(1).GetComponent <UIHIBtn>();
                    instance.InitianHeroItemImg(component3.transform, eHeroOrItem.Hero, curHeroData.ID, curHeroData.Star, curHeroData.Enhance, (int)curHeroData.Level, true, false, true, false);
                    this.m_HeroTextTemp1[i]      = child.GetChild(4).GetChild(0).GetComponent <UIText>();
                    this.m_HeroTextTemp1[i]      = child.GetChild(4).GetChild(0).GetComponent <UIText>();
                    this.m_HeroTextTemp1[i].font = this.TTF;
                    this.m_HeroTextTemp1[i].text = instance2.mStringTable.GetStringByID((uint)recordByKey.HeroTitle);
                    eHeroState heroState  = instance2.GetHeroState(recordByKey.HeroKey);
                    Image      component4 = child.GetChild(6).GetComponent <Image>();
                    if (heroState == eHeroState.None)
                    {
                        component4.enabled             = false;
                        component3.HIImage.color       = new Color(1f, 1f, 1f, 1f);
                        component3.CircleImage.color   = new Color(1f, 1f, 1f, 1f);
                        component3.HeroRankImage.color = new Color(1f, 1f, 1f, 1f);
                        component3.LvOrNum.color       = new Color(1f, 1f, 1f, 1f);
                    }
                    else
                    {
                        if (heroState == eHeroState.IsFighting)
                        {
                            component4.sprite = this.m_SpArray.GetSprite(0);
                        }
                        if (heroState == eHeroState.Captured)
                        {
                            component4.sprite = this.m_SpArray.GetSprite(1);
                        }
                        if (heroState == eHeroState.Dead)
                        {
                            component4.sprite = this.m_SpArray.GetSprite(2);
                        }
                        component3.HIImage.color       = new Color(0.5f, 0.5f, 0.5f, 1f);
                        component3.CircleImage.color   = new Color(0.5f, 0.5f, 0.5f, 1f);
                        component3.HeroRankImage.color = new Color(0.5f, 0.5f, 0.5f, 1f);
                        component3.LvOrNum.color       = new Color(0.5f, 0.5f, 0.5f, 1f);
                        component4.enabled             = true;
                    }
                    this.SelectNum++;
                }
                else
                {
                    child.GetChild(1).gameObject.SetActive(false);
                    child.GetChild(4).gameObject.SetActive(false);
                    child.GetChild(2).gameObject.SetActive(true);
                    child.GetChild(2).GetComponent <Image>().material = instance.GetFrameMaterial();
                    child.GetChild(2).GetComponent <Image>().sprite   = instance.LoadFrameSprite("hf000");
                    component2           = child.GetChild(2).GetChild(0).GetComponent <UIButton>();
                    component2.m_BtnID1  = 1;
                    component2.m_Handler = this;
                }
                goto IL_470;
            }
            child.GetChild(1).gameObject.SetActive(false);
            child.GetChild(4).gameObject.SetActive(false);
            child.GetChild(3).gameObject.SetActive(true);
            child.GetChild(3).GetComponent <Image>().material = instance.GetFrameMaterial();
            child.GetChild(3).GetComponent <Image>().sprite   = instance.LoadFrameSprite("hf000");
            component2           = child.GetChild(3).GetComponent <UIButton>();
            component2.m_Handler = this;
            component2.m_BtnID1  = 2;
            goto IL_470;
IL_49F:
            i++;
            continue;
IL_470:
            this.m_HeroTextTemp2[i]      = child.GetChild(4).GetChild(0).GetComponent <UIText>();
            this.m_HeroTextTemp2[i].font = this.TTF;
            goto IL_49F;
        }
        this.m_HeroTextTemp3 = base.transform.GetChild(1).GetChild(3).GetComponent <UIText>();
        this.m_Str           = StringManager.Instance.SpawnString(30);
        this.m_Str.ClearString();
        StringManager.Instance.IntToFormat((long)this.GetCanSelectNum(), 1, false);
        this.m_Str.AppendFormat(instance2.mStringTable.GetStringByID(3753u));
        this.m_HeroTextTemp3.font = this.TTF;
        this.m_HeroTextTemp3.text = this.m_Str.ToString();
    }