Exemplo n.º 1
0
        public override void Load(BinaryReader reader, long length, Language language)
        {
            long fileStartPos = reader.BaseStream.Position;

            uint count = (uint)reader.ReadUInt64();

            for (uint i = 0; i < count; i++)
            {
                int        id          = reader.ReadInt32();
                DuelSeries series      = (DuelSeries)reader.ReadInt32();
                long       keyOffset   = reader.ReadInt64();
                long       valueOffset = reader.ReadInt64();

                long tempOffset = reader.BaseStream.Position;

                reader.BaseStream.Position = fileStartPos + keyOffset;
                string key = reader.ReadNullTerminatedString(keyEncoding);

                reader.BaseStream.Position = fileStartPos + valueOffset;
                string value = reader.ReadNullTerminatedString(valueEncoding);

                reader.BaseStream.Position = tempOffset;

                Item item;
                if (!Items.TryGetValue(id, out item))
                {
                    item = new Item(id, series);
                    Items.Add(item.Id, item);
                }
                item.Key.SetText(language, key);
                item.Value.SetText(language, value);
            }
        }
Exemplo n.º 2
0
 public Item(int id, DuelSeries series)
 {
     Id     = id;
     Series = series;
     Key    = new LocalizedText();
     Value  = new LocalizedText();
 }
Exemplo n.º 3
0
 public Item(int id, DuelSeries pack, int price, PackType type)
 {
     Id       = id;
     Series   = pack;
     Price    = price;
     Type     = type;
     CodeName = new LocalizedText();
     Name     = new LocalizedText();
     UnkStr   = new LocalizedText();
 }
Exemplo n.º 4
0
 public Item(int id1, int id2, DuelSeries series, int signatureCardId, int deckOwner, int unk1)
 {
     Id1             = id1;
     Id2             = id2;
     Series          = series;
     SignatureCardId = signatureCardId;
     DeckOwnerId     = deckOwner;
     Unk1            = unk1;
     DeckFileName    = new LocalizedText();
     DeckName        = new LocalizedText();
     DeckDescription = new LocalizedText();
     UnkStr1         = new LocalizedText();
 }
Exemplo n.º 5
0
 public Item(int id, DuelSeries series, int challengeDeckId, int unk3, int dlcId, int unk5, long type)
 {
     Id              = id;
     Series          = series;
     ChallengeDeckId = challengeDeckId;
     Unk3            = unk3;
     DlcId           = dlcId;
     Unk5            = unk5;
     Type            = type;
     CodeName        = new LocalizedText();
     Name            = new LocalizedText();
     Bio             = new LocalizedText();
 }
Exemplo n.º 6
0
 private void SetCampaignState(GameSaveData saveData, DuelSeries series, bool p0Available, bool p0, bool p100)
 {
     if (p0Available)
     {
         SetCampaignState(saveData, series, CampaignDuelState.AvailableAttempted);
     }
     else if (p0)
     {
         SetCampaignState(saveData, series, CampaignDuelState.Locked);
     }
     else if (p100)
     {
         SetCampaignState(saveData, series, CampaignDuelState.Complete);
     }
 }
Exemplo n.º 7
0
        public override void Load(BinaryReader reader, long length, Language language)
        {
            long fileStartPos = reader.BaseStream.Position;

            uint count = (uint)reader.ReadUInt64();

            for (uint i = 0; i < count; i++)
            {
                int        id1                   = reader.ReadInt32();
                int        id2                   = reader.ReadInt32();
                DuelSeries series                = (DuelSeries)reader.ReadInt32();
                int        signatureCardId       = reader.ReadInt32();
                int        deckOwner             = reader.ReadInt32();
                int        unk1                  = reader.ReadInt32();
                long       deckFileNameOffset    = reader.ReadInt64();
                long       deckNameOffset        = reader.ReadInt64();
                long       deckDescriptionOffset = reader.ReadInt64();
                long       unkStr1Offset         = reader.ReadInt64();

                long tempOffset = reader.BaseStream.Position;

                reader.BaseStream.Position = fileStartPos + deckFileNameOffset;
                string deckFileName = reader.ReadNullTerminatedString(deckFileNameEncoding);

                reader.BaseStream.Position = fileStartPos + deckNameOffset;
                string deckName = reader.ReadNullTerminatedString(deckNameEncoding);

                reader.BaseStream.Position = fileStartPos + deckDescriptionOffset;
                string deckDescription = reader.ReadNullTerminatedString(deckDescriptionEncoding);

                reader.BaseStream.Position = fileStartPos + unkStr1Offset;
                string unkStr1 = reader.ReadNullTerminatedString(unkStr1Encoding);

                reader.BaseStream.Position = tempOffset;

                Item item;
                if (!Items.TryGetValue(id1, out item))
                {
                    item = new Item(id1, id2, series, signatureCardId, deckOwner, unk1);
                    Items.Add(item.Id1, item);
                }
                item.DeckFileName.SetText(language, deckFileName);
                item.DeckName.SetText(language, deckName);
                item.DeckDescription.SetText(language, deckDescription);
                item.UnkStr1.SetText(language, unkStr1);
            }
        }
Exemplo n.º 8
0
        public override void Load(BinaryReader reader, long length, Language language)
        {
            long fileStartPos = reader.BaseStream.Position;

            uint count = (uint)reader.ReadUInt64();

            for (uint i = 0; i < count; i++)
            {
                int        id                = reader.ReadInt32();
                DuelSeries series            = (DuelSeries)reader.ReadInt32();
                int        challengeDeckId   = reader.ReadInt32();
                int        unk3              = reader.ReadInt32();
                int        dlcId             = reader.ReadInt32();
                int        unk5              = reader.ReadInt32();
                long       type              = reader.ReadInt64();
                long       keyOffset         = reader.ReadInt64();
                long       valueOffset       = reader.ReadInt64();
                long       descriptionOffset = reader.ReadInt64();

                long tempOffset = reader.BaseStream.Position;

                reader.BaseStream.Position = fileStartPos + keyOffset;
                string codeName = reader.ReadNullTerminatedString(keyEncoding);

                reader.BaseStream.Position = fileStartPos + valueOffset;
                string name = reader.ReadNullTerminatedString(valueEncoding);

                reader.BaseStream.Position = fileStartPos + descriptionOffset;
                string bio = reader.ReadNullTerminatedString(valueEncoding);

                reader.BaseStream.Position = tempOffset;

                Item item;
                if (!Items.TryGetValue(id, out item))
                {
                    item = new Item(id, series, challengeDeckId, unk3, dlcId, unk5, type);
                    Items.Add(item.Id, item);
                }
                item.CodeName.SetText(language, codeName);
                item.Name.SetText(language, name);
                item.Bio.SetText(language, bio);
            }
        }
Exemplo n.º 9
0
 public Item(int id, DuelSeries series, int displayIndex, int playerCharId, int opponentCharId,
             int playerDeckId, int opponentDeckId, int duelArena, int unk8, int dlcId)
 {
     Id                    = id;
     Series                = series;
     DisplayIndex          = displayIndex;
     PlayerCharId          = playerCharId;
     OpponentCharId        = opponentCharId;
     PlayerDeckId          = playerDeckId;
     OpponentDeckId        = opponentDeckId;
     ArenaId               = duelArena;
     Unk8                  = unk8;
     DlcId                 = dlcId;
     CodeName              = new LocalizedText();
     PlayerAlternateSkin   = new LocalizedText();
     OpponentAlternateSkin = new LocalizedText();
     Name                  = new LocalizedText();
     Description           = new LocalizedText();
     Tip                   = new LocalizedText();
 }
Exemplo n.º 10
0
        public override void Load(BinaryReader reader)
        {
            reader.ReadInt32();
            reader.ReadInt32();

            for (int i = 0; i < Constants.NumDuelSeries; i++)
            {
                DuelSeries series = IndexToSeries(i);

                Duel[] duels = DuelsBySeries[series];
                for (int j = 0; j < DuelsPerSeries; j++)
                {
                    duels[j].Read(reader);
                    if (j == 0)
                    {
                        reader.ReadInt32(); // 0?
                        reader.ReadInt32(); // 0?
                    }
                }
            }
        }
Exemplo n.º 11
0
        public override void Load(BinaryReader reader, long length, Language language)
        {
            long fileStartPos = reader.BaseStream.Position;

            uint count = (uint)reader.ReadUInt64();

            for (uint i = 0; i < count; i++)
            {
                int        id             = reader.ReadInt32();
                DuelSeries series         = (DuelSeries)reader.ReadInt32();
                int        price          = reader.ReadInt32();
                PackType   type           = (PackType)reader.ReadInt32();
                long       codeNameOffset = reader.ReadInt64();
                long       nameOffset     = reader.ReadInt64();
                long       unkStrOffset   = reader.ReadInt64();

                long tempOffset = reader.BaseStream.Position;

                reader.BaseStream.Position = fileStartPos + codeNameOffset;
                string codeName = reader.ReadNullTerminatedString(encoding1);

                reader.BaseStream.Position = fileStartPos + nameOffset;
                string name = reader.ReadNullTerminatedString(encoding2);

                reader.BaseStream.Position = fileStartPos + unkStrOffset;
                string unkStr = reader.ReadNullTerminatedString(encoding2);

                reader.BaseStream.Position = tempOffset;

                Item item;
                if (!Items.TryGetValue(id, out item))
                {
                    item = new Item(id, series, price, type);
                    Items.Add(item.Id, item);
                }
                item.CodeName.SetText(language, codeName);
                item.Name.SetText(language, name);
                item.UnkStr.SetText(language, unkStr);
            }
        }
Exemplo n.º 12
0
        private void SetCampaignState(GameSaveData saveData, DuelSeries series, CampaignDuelState state)
        {
            CampaignSaveData.Duel[] duels = saveData.Campaign.DuelsBySeries[series];

            // Index 0 is reserved (it should always be "Available" or the series will be broken)
            // - Should we set it to Available here in case something else broke it and the user wants it fixed?

            for (int i = 1; i < duels.Length; i++)
            {
                if (i == 1 && state == CampaignDuelState.Locked)
                {
                    // Set the first item to Available or nothing in the series will be playable
                    duels[i].State            = CampaignDuelState.Available;
                    duels[i].ReverseDuelState = state;
                }
                else
                {
                    duels[i].State            = state;
                    duels[i].ReverseDuelState = state;
                }
            }
        }
Exemplo n.º 13
0
        public override void Save(BinaryWriter writer)
        {
            writer.Write(0); // 0?
            writer.Write(1); // 1 on a clean save (2 on first series complete?)

            for (int i = 0; i < Constants.NumDuelSeries; i++)
            {
                DuelSeries series = IndexToSeries(i);

                Duel[] duels;
                DuelsBySeries.TryGetValue(series, out duels);

                for (int j = 0; j < DuelsPerSeries; j++)
                {
                    duels[j].Write(writer);
                    if (j == 0)
                    {
                        writer.Write((uint)0);
                        writer.Write((uint)0);
                    }
                }
            }
        }
Exemplo n.º 14
0
        public override void Load(BinaryReader reader, long length, Language language)
        {
            long fileStartPos = reader.BaseStream.Position;

            uint count = (uint)reader.ReadUInt64();

            for (uint i = 0; i < count; i++)
            {
                int        id                          = reader.ReadInt32();
                DuelSeries series                      = (DuelSeries)reader.ReadInt32();
                int        displayIndex                = reader.ReadInt32();
                int        playerCharId                = reader.ReadInt32();
                int        opponentCharId              = reader.ReadInt32();
                int        playerDeckId                = reader.ReadInt32();
                int        opponentDeckId              = reader.ReadInt32();
                int        arenaId                     = reader.ReadInt32();
                int        unk8                        = reader.ReadInt32();
                int        dlcId                       = reader.ReadInt32();
                long       codeNameOffset              = reader.ReadInt64();
                long       playerAlternateSkinOffset   = reader.ReadInt64();
                long       opponentAlternateSkinOffset = reader.ReadInt64();
                long       nameOffset                  = reader.ReadInt64();
                long       descriptionOffset           = reader.ReadInt64();
                long       tipOffset                   = reader.ReadInt64();

                long tempOffset = reader.BaseStream.Position;

                reader.BaseStream.Position = fileStartPos + codeNameOffset;
                string codeName = reader.ReadNullTerminatedString(encoding1);

                reader.BaseStream.Position = fileStartPos + playerAlternateSkinOffset;
                string playerAlternateSkin = reader.ReadNullTerminatedString(encoding1);

                reader.BaseStream.Position = fileStartPos + opponentAlternateSkinOffset;
                string opponentAlternateSkin = reader.ReadNullTerminatedString(encoding1);

                reader.BaseStream.Position = fileStartPos + nameOffset;
                string name = reader.ReadNullTerminatedString(encoding2);

                reader.BaseStream.Position = fileStartPos + descriptionOffset;
                string description = reader.ReadNullTerminatedString(encoding2);

                reader.BaseStream.Position = fileStartPos + tipOffset;
                string tipStr = reader.ReadNullTerminatedString(encoding2);

                reader.BaseStream.Position = tempOffset;

                Item item;
                if (!Items.TryGetValue(id, out item))
                {
                    item = new Item(id, series, displayIndex, playerCharId, opponentCharId, playerDeckId, opponentDeckId, arenaId, unk8, dlcId);
                    Items.Add(item.Id, item);
                }
                item.CodeName.SetText(language, codeName);
                item.PlayerAlternateSkin.SetText(language, playerAlternateSkin);
                item.OpponentAlternateSkin.SetText(language, opponentAlternateSkin);
                item.Name.SetText(language, name);
                item.Description.SetText(language, description);
                item.Tip.SetText(language, tipStr);
            }
        }
Exemplo n.º 15
0
 private int SeriesToIndex(DuelSeries series)
 {
     return((int)(series));
 }