// 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 static PBEGender[] GetGenderKeys(PBESpecies species)
 {
     if (PokemonImageUtils.HasFemaleVersion(species, false))
     {
         return(new[] { PBEGender.Male, PBEGender.Female });
     }
     return(new[] { PBEGender.MAX });
 }
 public PartyGUIMember(PartyPokemon pkmn, SpriteList sprites)
 {
     _usePartyPkmn = true;
     _partyPkmn    = pkmn;
     _color        = GetColor();
     _mini         = new Sprite()
     {
         Image    = PokemonImageUtils.GetMini(pkmn.Species, pkmn.Form, pkmn.Gender, pkmn.Shiny, pkmn.IsEgg),
         Y        = Sprite_BounceDefY,
         Callback = Sprite_Bounce,
         Data     = new Sprite_BounceData()
     };
     sprites.Add(_mini);
     _background = new Image((UI.Program.RenderWidth / 2) - (UI.Program.RenderWidth / 20), (UI.Program.RenderHeight / 4) - (UI.Program.RenderHeight / 20));
     UpdateBackground();
 }
Beispiel #4
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);
 }
Beispiel #6
0
 private static PBEGender GetGenderKey(PBESpecies species, PBEGender gender)
 {
     return(PokemonImageUtils.HasFemaleVersion(species, false) ? gender : PBEGender.MAX);
 }