private void RefreshImage() { var s = Pokemon.IsSubstitute ? Back ? ImageService.GetSpBack("substitute") : ImageService.GetSpFront("substitute") : Back?ImageService.GetPokemonBack(Pokemon.Form, Pokemon.Gender, Pokemon.Shiny) : ImageService.GetPokemonFront(Pokemon.Form, Pokemon.Gender, Pokemon.Shiny); if (s == null) { s = ImageService.GetPokemonIcon(Pokemon.Form, Pokemon.Gender); } Image.Source = s; if (s != null) { double scale; int n = Pokemon.Form.Species.Number; bool gen7 = n >= 722 && n <= 802 || GameHelper.Alola(n) && Pokemon.Form.Index == 1; var o = s.PixelHeight <= 96 || s.PixelHeight == 240 && s.PixelWidth < 320; //gen5 小图 非满下屏的图源为原始尺寸 if (Back && o) { scale = 2; Image.SetValue(RenderOptions.BitmapScalingModeProperty, BitmapScalingMode.NearestNeighbor); } else if (!Back && !o && !gen7) { scale = 0.5; Image.SetValue(RenderOptions.BitmapScalingModeProperty, BitmapScalingMode.Fant); } else { scale = 1; } Image.SetValue(Canvas.LeftProperty, -s.PixelWidth * scale / 2); Image.SetValue(Canvas.BottomProperty, -s.PixelHeight * scale / 2); Image.Width = s.PixelWidth * scale; Image.Height = s.PixelHeight * scale; FaintAnimation.From = Image.Height; } BeginChangeImageAnimation.To = Back ? 30 : 15; }
private void GetLearnset(int number, int form) { if (!(number == Ps.DEOXYS || number == Ps.WORMADAM || number == Ps.ROTOM || number == Ps.KYUREM || number == Ps.FLOETTE && form == 5 || number == Ps.MEOWSTIC || number == Ps.Lycanroc || GameHelper.Alola(number))) { form = 0; } GetGenericLearnset(number, form); switch (number) { case Ps.PIKACHU: //025.01 309:ORAS //025.02 556:ORAS //025.03 577:ORAS //025.04 604:ORAS //025.05 560:ORAS if (form != 0 && form != 6) { GetLearnVM(form == 1 ? Ms.METEOR_MASH : form == 2 ? Ms.ICICLE_CRASH : form == 3 ? Ms.DRAINING_KISS : form == 4 ? Ms.ELECTRIC_TERRAIN : Ms.FLYING_PRESS).AddMethod(LearnCategory.Other); } break; case Ps.SMEARGLE: for (var m = 1; m <= RomData.Moves.Count(); ++m) { if (m != Ms.STRUGGLE && m != Ms.CHATTER && !GameHelper.IsZmove(m)) { GetLearnVM(m).AddMethod(LearnCategory.Other); } } break; case Ps.ROTOM: //479.01 315:Pt //479.02 56:Pt //479.03 59:Pt //479.04 403:Pt //479.05 437:Pt if (form != 0) { GetLearnVM(form == 1 ? Ms.OVERHEAT : form == 2 ? Ms.HYDRO_PUMP : form == 3 ? Ms.BLIZZARD : form == 4 ? Ms.AIR_SLASH : Ms.LEAF_STORM).AddMethod(LearnCategory.Other); } break; case Ps.SHAYMIN: GetGenericLearnset(Ps.SHAYMIN, 1 - form); break; default: if (!(number == Ps.FLOETTE && form == 5)) { foreach (var e1 in RomData.Evolutions) { if (e1.To == number) { int x = 0; if (GameHelper.Alola(number)) { x = form; } GetGenericLearnset(e1.From, x); foreach (var e2 in RomData.Evolutions) { if (e2.To == e1.From) { GetGenericLearnset(e2.From, x); break; } } break; } } } break; } }