예제 #1
0
        private static RaidParameters[] InitializeDenList(RaidSpawnList8 raids, RaidSpawnList8 raidsArmor)
        {
            // current release has these numbers bugged

            var dl       = new RaidParameters[raids.CountUsed + raidsArmor.CountUsed];
            var allRaids = raids.GetAllRaids();

            for (int i = 0; i < raids.CountUsed; i++)
            {
                int idx         = i;
                var currentRaid = allRaids[i];
                var detail      = NestLocations.Nests[i];
                dl[idx] = new RaidParameters(idx, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }

            var allArmorRaids = raidsArmor.GetAllRaids();

            for (int i = 0; i < raidsArmor.CountUsed; i++)
            {
                int idx         = raids.CountUsed + i;
                var currentRaid = allArmorRaids[i];
                var detail      = NestLocations.Nests[idx];
                dl[idx] = new RaidParameters(idx, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }

            return(dl);
        }
예제 #2
0
 public RaidList(RaidSpawnList8 raids, GameVersion game, int badges, int tid, int sid)
 {
     InitializeComponent();
     IVs    = new[] { TB_HP_IV1, TB_ATK_IV1, TB_DEF_IV1, TB_SPA_IV1, TB_SPD_IV1, TB_SPE_IV1 };
     _raids = new RaidManager(raids, game, badges, (uint)tid, (uint)sid);
     CB_Den.SelectedIndex = 0;
     CenterToParent();
 }
예제 #3
0
 public SAV_Raid8(SaveFile sav)
 {
     InitializeComponent();
     WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
     SAV   = (SAV8SWSH)(Origin = sav).Clone();
     Raids = SAV.Blocks.Raid;
     CB_Den.Items.AddRange(Enumerable.Range(1, RaidSpawnList8.RaidCount).Select(z => (object)$"Den {z:000}").ToArray());
     CB_Den.SelectedIndex = 0;
 }
예제 #4
0
        public RaidManager(RaidSpawnList8 raids, GameVersion game, int badges, uint tid, uint sid)
        {
            DenList = InitializeDenList(raids);

            Game       = game;
            BadgeCount = Util.NumberOfSetBits(badges);
            if (BadgeCount == 0)
            {
                BadgeCount = 9; // enable all dens for basically no SaveFile loaded
            }
            TID = tid;
            SID = sid;
        }
예제 #5
0
        private static RaidParameters[] InitializeDenList(RaidSpawnList8 raids)
        {
            var dl       = new RaidParameters[100];
            var allRaids = raids.GetAllRaids();

            for (int i = 0; i < dl.Length; i++)
            {
                int idx         = i;
                var currentRaid = allRaids[idx];
                var detail      = NestLocations.Nests[i];
                dl[i] = new RaidParameters(i, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }
            return(dl);
        }
예제 #6
0
        private void Open(SaveFile sav)
        {
            var game = (GameVersion)sav.Game;

            if (game != GameVersion.SW && game != GameVersion.SH)
            {
                return;
            }
            savegame = (SAV8SWSH)sav;
            raids    = savegame.Blocks.Raid;
            Form1 f = new Form1(raids, game, savegame.Badges, savegame.TID, savegame.SID);

            f.Show();
        }
예제 #7
0
        private static RaidParameters[] InitializeDenList(RaidSpawnList8 raids, RaidSpawnList8 raidsArmor, RaidSpawnList8 raidsCrown)
        {
            // current release has these numbers bugged
            int NormalUsed = raids.CountUsed;
            int ArmorUsed  = raidsArmor.CountUsed;
            int CrownUsed  = 86;

            var dl       = new RaidParameters[NormalUsed + ArmorUsed + CrownUsed];
            var allRaids = raids.GetAllRaids();

            for (int i = 0; i < NormalUsed; i++)
            {
                int idx         = i;
                var currentRaid = allRaids[i];
                var detail      = NestLocations.Nests[i];
                dl[idx] = new RaidParameters(idx, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }

            var allArmorRaids = raidsArmor.GetAllRaids();

            for (int i = 0; i < ArmorUsed; i++)
            {
                int idx         = NormalUsed + i;
                var currentRaid = allArmorRaids[i];
                var detail      = NestLocations.Nests[idx];
                dl[idx] = new RaidParameters(idx, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }

            var allCrownRaids = raidsCrown.GetAllRaids();

            for (int i = 0; i < CrownUsed; i++)
            {
                int idx         = NormalUsed + ArmorUsed + i;
                var currentRaid = allCrownRaids[i];
                var detail      = NestLocations.Nests[idx];
                dl[idx] = new RaidParameters(idx, currentRaid, detail.Location, detail.MapX, detail.MapY);
            }

            return(dl);
        }
예제 #8
0
 public SaveBlockAccessor8SWSH(SAV8SWSH sav)
 {
     BlockInfo   = sav.AllBlocks;
     BoxInfo     = new Box8(sav, GetBlock(KBox));
     PartyInfo   = new Party8(sav, GetBlock(KParty));
     Items       = new MyItem8(sav, GetBlock(KItem));
     Zukan       = new Zukan8(sav, GetBlock(KZukan), GetBlockSafe(KZukanR1), GetBlockSafe(KZukanR2));
     MyStatus    = new MyStatus8(sav, GetBlock(KMyStatus));
     Misc        = new Misc8(sav, GetBlock(KMisc));
     BoxLayout   = new BoxLayout8(sav, GetBlock(KBoxLayout));
     TrainerCard = new TrainerCard8(sav, GetBlock(KTrainerCard));
     Played      = new PlayTime8(sav, GetBlock(KPlayTime));
     Fused       = new Fused8(sav, GetBlock(KFused));
     Daycare     = new Daycare8(sav, GetBlock(KDaycare));
     Records     = new Record8(sav, GetBlock(KRecord), Core.Records.MaxType_SWSH);
     Fashion     = new FashionUnlock8(sav, GetBlock(KFashionUnlock));
     Raid        = new RaidSpawnList8(sav, GetBlock(KRaidSpawnList), RaidSpawnList8.RaidCountLegal_O0);
     RaidArmor   = new RaidSpawnList8(sav, GetBlockSafe(KRaidSpawnListR1), RaidSpawnList8.RaidCountLegal_R1);
     RaidCrown   = new RaidSpawnList8(sav, GetBlockSafe(KRaidSpawnListR2), RaidSpawnList8.RaidCountLegal_R2);
     TitleScreen = new TitleScreen8(sav, GetBlock(KTitleScreenTeam));
     TeamIndexes = new TeamIndexes8(sav, GetBlock(KTeamIndexes));
     FameTime    = new HallOfFameTime8(sav, GetBlock(KEnteredHallOfFame));
 }
예제 #9
0
        public DenManager(RaidSpawnList8 raids, GameVersion game, int badges, uint tid, uint sid)
        {
            this.raids  = raids;
            this.game   = game;
            this.badges = NumberOfSetBits(badges);
            this.tid    = tid;
            this.sid    = sid;

            this.denList = new Den[99];
            var allRaids = raids.GetAllRaids();

            for (int i = 0; i < 99; i++)
            {
                int idx = i;
                if (idx >= 15)
                {
                    idx++;
                }
                var currentRaid = allRaids[idx];
                Den den         = new Den(i, currentRaid.Seed, currentRaid.Stars, currentRaid.RandRoll, currentRaid.Flags, currentRaid.DenType, (int)DenHashes[i][2]);
                this.denList[i] = den;
            }
        }
예제 #10
0
 public Form1(RaidSpawnList8 raids, GameVersion game, int badges, int tid, int sid)
 {
     InitializeComponent();
     dm = new DenManager(raids, game, badges, (uint) tid, (uint) sid);
     denBox.SelectedIndex = 0;
 }