// Will cause double load for some cases (like status2 updating)
        // Because new animated image is created
        public void UpdateSprites(PkmnPosition pos, bool paused)
        {
            Mini = PokemonImageUtils.GetMini(Pkmn.KnownSpecies, Pkmn.KnownForm, Pkmn.KnownGender, Pkmn.KnownShiny, PartyPkmn.IsEgg);
            PBEStatus2 status2 = _useKnownInfo ? Pkmn.KnownStatus2 : Pkmn.Status2;

            AnimImage = PokemonImageUtils.GetPokemonImage(Pkmn.KnownSpecies, Pkmn.KnownForm, Pkmn.KnownGender, Pkmn.KnownShiny, _backImage,
                                                          status2.HasFlag(PBEStatus2.Substitute), status2.HasFlag(PBEStatus2.Disguised) ? DisguisedPID : PartyPkmn.PID, PartyPkmn.IsEgg);
            AnimImage.IsPaused = paused;
            if (pos is null)
            {
                return; // Only for updating visibility below
            }
            if (!status2.HasFlag(PBEStatus2.Substitute))
            {
                if (status2.HasFlag(PBEStatus2.Airborne) ||
                    status2.HasFlag(PBEStatus2.ShadowForce) ||
                    status2.HasFlag(PBEStatus2.Underground) ||
                    status2.HasFlag(PBEStatus2.Underwater))
                {
                    pos.PkmnVisible = false;
                }
                else
                {
                    pos.PkmnVisible = true;
                }
            }
        }
Beispiel #2
0
        private void LoadPkmnImage()
        {
            PBESpecies species;
            PBEForm    form;
            PBEGender  gender;
            bool       shiny;
            uint       pid;
            bool       egg;

            if (_pPkmn is not null)
            {
                species = _pPkmn.Species;
                form    = _pPkmn.Form;
                gender  = _pPkmn.Gender;
                shiny   = _pPkmn.Shiny;
                pid     = _pPkmn.PID;
                egg     = _pPkmn.IsEgg;
            }
            else if (_pcPkmn is not null)
            {
                species = _pcPkmn.Species;
                form    = _pcPkmn.Form;
                gender  = _pcPkmn.Gender;
                shiny   = _pcPkmn.Shiny;
                pid     = _pcPkmn.PID;
                egg     = _pcPkmn.IsEgg;
            }
            else
            {
                PartyPokemon     pPkmn = _bPkmn.PartyPkmn;
                PBEBattlePokemon bPkmn = _bPkmn.Pkmn;
                species = pPkmn.Species;
                form    = bPkmn.RevertForm;
                gender  = pPkmn.Gender;
                shiny   = pPkmn.Shiny;
                pid     = pPkmn.PID;
                egg     = pPkmn.IsEgg;
            }
            _pkmnImage = PokemonImageUtils.GetPokemonImage(species, form, gender, shiny, false, false, pid, egg);
        }
 private void LoadPkmnImage()
 {
     _img  = PokemonImageUtils.GetPokemonImage(_pkmn.Species, _pkmn.Form, _pkmn.Gender, _pkmn.Shiny, false, false, _pkmn.PID, _pkmn.IsEgg);
     _imgX = RenderUtils.GetCoordinatesForCentering(Program.RenderWidth, _img.Width, 0.5f);
     _imgY = RenderUtils.GetCoordinatesForCentering(Program.RenderHeight, _img.Height, 0.5f);
 }