Ejemplo n.º 1
0
        public void Debug_Create()
        {
            GameStats       = new GameStats();
            Pokedex         = new Pokedex();
            Flags           = new Flags();
            Vars            = new Vars();
            OT              = new OTInfo("Dawn", true);
            PlayerInventory = Inventory <InventorySlotNew> .CreatePlayerInventory();

            PlayerInventory.Add(ItemType.DuskBall, 995);
            PlayerInventory.Add(ItemType.RockyHelmet, 42);
            PlayerInventory.Add(ItemType.Leftovers, 473);
            PlayerInventory.Add(ItemType.Potion, 123);
            PlayerInventory.Add(ItemType.RedScarf, 230);
            PlayerInventory.Add(ItemType.PokeDoll, 130);
            PlayerInventory.Add(ItemType.XSpDef, 120);
            PlayerInventory.Add(ItemType.AirBalloon, 407);
            PlayerInventory.Add(ItemType.PokeBall, 73);
            PlayerInventory.Add(ItemType.DarkGem, 69);
            PlayerInventory.Add(ItemType.FluffyTail, 888);
            PlayerInventory.Add(ItemType.OvalCharm, 1);
            PlayerInventory.Add(ItemType.ShinyCharm, 1);
            ItemData.Debug_GiveAllTMHMs(PlayerInventory);
            Money = 473_123;
            InitPlayerWithDefaultLocation();
            PCBoxes = new PCBoxes();
            Daycare = new Daycare();
            Daycare.StorePokemon(PartyPokemon.CreatePlayerOwnedMon(PBESpecies.Blissey, 0, 47));
            Daycare.StorePokemon(PartyPokemon.CreatePlayerOwnedMon(PBESpecies.Ditto, 0, 82));
            PlayerParty = new Party();
            {
                // To test evolution
                var evomon = PartyPokemon.CreatePlayerOwnedMon(PBESpecies.Burmy, PBEForm.Burmy_Trash, 19);
                evomon.Item = ItemType.Leftovers;
                evomon.EXP  = PBEEXPTables.GetEXPRequired(BaseStats.Get(evomon.Species, evomon.Form, true).GrowthRate, 20) - 1;
                GivePokemon(evomon);
                // To pummel
                var victini = PartyPokemon.CreatePlayerOwnedMon(PBESpecies.Victini, 0, 67);
                victini.Ability         = PBEAbility.Compoundeyes;
                victini.Item            = ItemType.Leftovers;
                victini.Status1         = PBEStatus1.BadlyPoisoned;
                victini.Moveset[0].Move = PBEMove.Bounce;
                victini.Moveset[1].Move = PBEMove.ZenHeadbutt;
                victini.Moveset[2].Move = PBEMove.Surf;
                victini.Moveset[3].Move = PBEMove.VCreate;
                GivePokemon(victini);
            }
            for (int i = 0; i < 44; i++)
            {
                Debug_GiveRandomPokemon(i == 0 || i == 1 || i == 35);
            }

            Overworld.UpdateGiratinaForms(); // Not really necessary, including for debug though
        }
Ejemplo n.º 2
0
        public static unsafe void EXP_SingleLine(uint *bmpAddress, int bmpWidth, int bmpHeight, int x, int y, int width, uint exp, byte level, PBEGrowthRate gr)
        {
            double percent;

            if (level >= PkmnConstants.MaxLevel)
            {
                percent = 0;
            }
            else
            {
                uint expPrev = PBEEXPTables.GetEXPRequired(gr, level);
                uint expNext = PBEEXPTables.GetEXPRequired(gr, (byte)(level + 1));
                uint expCur  = exp;
                percent = (double)(expCur - expPrev) / (expNext - expPrev);
            }
            EXP_SingleLine(bmpAddress, bmpWidth, bmpHeight, x, y, width, percent);
        }
Ejemplo n.º 3
0
        private unsafe void DrawInfoPage(uint *bmpAddress, int bmpWidth, int bmpHeight)
        {
            const float winX            = 0.03f;
            const float winY            = 0.15f;
            const float winW            = 0.97f - winX;
            const float winH            = 0.85f - winY;
            const float leftColX        = winX + 0.02f;
            const float rightColX       = winX + 0.52f;
            const float rightColY       = winY + 0.03f;
            const float rightColW       = 0.95f - rightColX;
            const float rightColH       = 0.82f - rightColY;
            const float rightColCenterX = rightColX + (rightColW / 2f);
            const float textStartY      = rightColY + 0.02f;
            const float textSpacingY    = 0.1f;
            int         xpW             = (int)(bmpWidth * 0.3f);
            int         xpX             = RenderUtils.GetCoordinatesForCentering(bmpWidth, xpW, rightColCenterX);
            int         xpY             = (int)(bmpHeight * (rightColY + 0.61f));

            RenderUtils.FillRoundedRectangle(bmpAddress, bmpWidth, bmpHeight, winX, winY, winX + winW, winY + winH, 15, RenderUtils.Color(128, 215, 135, 255));
            RenderUtils.FillRoundedRectangle(bmpAddress, bmpWidth, bmpHeight, rightColX, rightColY, rightColX + rightColW, rightColY + rightColH, 8, RenderUtils.Color(210, 210, 210, 255));

            Font leftColFont = Font.Default;

            uint[] leftColColors = Font.DefaultWhite_DarkerOutline_I;
            Font   rightColFont  = Font.Default;

            uint[] rightColColors = Font.DefaultBlack_I;

            void PlaceLeftCol(int i, string leftColStr)
            {
                float y = textStartY + (i * textSpacingY);

                leftColFont.DrawString(bmpAddress, bmpWidth, bmpHeight, leftColX, y, leftColStr, leftColColors);
            }

            void PlaceRightCol(int i, string rightColStr, uint[] colors)
            {
                float y = textStartY + (i * textSpacingY);

                rightColFont.MeasureString(rightColStr, out int strW, out _);
                rightColFont.DrawString(bmpAddress, bmpWidth, bmpHeight,
                                        RenderUtils.GetCoordinatesForCentering(bmpWidth, strW, rightColCenterX), (int)(bmpHeight * y), rightColStr, colors);
            }

            PlaceLeftCol(0, "Species");
            PlaceLeftCol(1, "Type(s)");
            PlaceLeftCol(2, "OT");
            PlaceLeftCol(3, "OT ID");
            PlaceLeftCol(4, "Exp. Points");
            PlaceLeftCol(5, "Exp. To Next Level");

            PBESpecies species;
            PBEForm    form;
            OTInfo     ot;
            byte       level;
            uint       exp;

            if (_pPkmn is not null)
            {
                species = _pPkmn.Species;
                form    = _pPkmn.Form;
                ot      = _pPkmn.OT;
                level   = _pPkmn.Level;
                exp     = _pPkmn.EXP;
            }
            else if (_pcPkmn is not null)
            {
                species = _pcPkmn.Species;
                form    = _pcPkmn.Form;
                ot      = _pcPkmn.OT;
                level   = _pcPkmn.Level;
                exp     = _pcPkmn.EXP;
            }
            else
            {
                PartyPokemon     pPkmn = _bPkmn.PartyPkmn;
                PBEBattlePokemon bPkmn = _bPkmn.Pkmn;
                species = pPkmn.Species;
                form    = bPkmn.RevertForm;
                ot      = pPkmn.OT;
                level   = bPkmn.Level;
                exp     = bPkmn.EXP;
            }

            var  bs = BaseStats.Get(species, form, true);
            uint toNextLvl;

            if (level >= PkmnConstants.MaxLevel)
            {
                toNextLvl = 0;
                RenderUtils.EXP_SingleLine(bmpAddress, bmpWidth, bmpHeight, xpX, xpY, xpW, 0);
            }
            else
            {
                PBEGrowthRate gr = bs.GrowthRate;
                toNextLvl = PBEEXPTables.GetEXPRequired(gr, (byte)(level + 1)) - exp;
                RenderUtils.EXP_SingleLine(bmpAddress, bmpWidth, bmpHeight, xpX, xpY, xpW, exp, level, gr);
            }

            // Species
            string str = PBELocalizedString.GetSpeciesName(species).English;

            PlaceRightCol(0, str, rightColColors);
            // Types
            str = PBELocalizedString.GetTypeName(bs.Type1).English;
            if (bs.Type2 != PBEType.None)
            {
                str += ' ' + PBELocalizedString.GetTypeName(bs.Type2).English;
            }
            PlaceRightCol(1, str, rightColColors);
            // OT
            str = ot.TrainerName;
            PlaceRightCol(2, str, ot.TrainerIsFemale ? Font.DefaultRed_I : Font.DefaultBlue_I);
            // OT ID
            str = ot.TrainerID.ToString();
            PlaceRightCol(3, str, rightColColors);
            // Exp
            str = exp.ToString();
            PlaceRightCol(4, str, rightColColors);
            // To next level
            str = toNextLvl.ToString();
            PlaceRightCol(5, str, rightColColors);
        }