public void LoadPokemon(IPokemon pokemon) { if (pokemon == null) { UnloadPokemon(); return; } this.pokemon = pokemon; if (PokeManager.IsAprilFoolsMode && !pokemon.IsEgg) { this.imagePokemon.Source = PokemonDatabase.GetPokemonImageFromDexID(41, pokemon.IsShiny); } else { this.imagePokemon.Source = pokemon.Sprite; } if (pokemon.IsShadowPokemon) { this.rectShadowMask.OpacityMask = new ImageBrush(this.imagePokemon.Source); this.rectShadowMask.Visibility = Visibility.Visible; this.imageShadowAura.Visibility = Visibility.Visible; } else { this.rectShadowMask.Visibility = Visibility.Hidden; this.imageShadowAura.Visibility = Visibility.Hidden; } if (pokemon.IsEgg) { this.labelNickname.Content = "EGG"; } else { this.labelNickname.Content = pokemon.Nickname; } this.labelLevel.Content = "Lv " + pokemon.Level.ToString(); if (pokemon.IsEgg && PokeManager.Settings.MysteryEggs) { this.labelGender.Content = ""; } else if (pokemon.Gender == Genders.Male) { this.labelGender.Content = "♂"; this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(0, 136, 184)); } else if (pokemon.Gender == Genders.Female) { this.labelGender.Content = "♀"; this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(184, 88, 80)); } else { this.labelGender.Content = ""; } Brush unmarkedBrush = new SolidColorBrush(Color.FromRgb(200, 200, 200)); Brush markedBrush = new SolidColorBrush(Color.FromRgb(0, 0, 0)); markCircle.Foreground = (pokemon.IsCircleMarked ? markedBrush : unmarkedBrush); markSquare.Foreground = (pokemon.IsSquareMarked ? markedBrush : unmarkedBrush); markTriangle.Foreground = (pokemon.IsTriangleMarked ? markedBrush : unmarkedBrush); markHeart.Foreground = (pokemon.IsHeartMarked ? markedBrush : unmarkedBrush); if (pokemon.IsHoldingItem) { imageHeldItem.Source = ItemDatabase.GetItemImageFromID(pokemon.HeldItemID); } else { imageHeldItem.Source = null; } }
public void LoadPokemon(IPokemon pokemon) { this.pokemon = pokemon; if (PokeManager.IsAprilFoolsMode && !pokemon.IsEgg) { this.imagePokemon.Source = PokemonDatabase.GetPokemonImageFromDexID(41, pokemon.IsShiny); } else { this.imagePokemon.Source = pokemon.Sprite; } if (pokemon.IsShadowPokemon) { this.rectShadowMask.OpacityMask = new ImageBrush(this.imagePokemon.Source); this.rectShadowMask.Visibility = Visibility.Visible; this.imageShadowAura.Visibility = Visibility.Visible; } else { this.rectShadowMask.Visibility = Visibility.Hidden; this.imageShadowAura.Visibility = Visibility.Hidden; } this.imageShinyStar.Visibility = (pokemon.IsShiny && (!pokemon.IsEgg || !PokeManager.Settings.MysteryEggs) ? Visibility.Visible : Visibility.Hidden); this.imageBallCaught.Source = (!pokemon.IsEgg ? PokemonDatabase.GetBallCaughtImageFromID(pokemon.BallCaughtID) : null); if (pokemon.IsEgg) { this.labelNickname.Content = "EGG"; } else { this.labelNickname.Content = pokemon.Nickname; } if (pokemon.HasForm) { this.labelSpecies.Content = pokemon.PokemonFormData.Name; } else { this.labelSpecies.Content = pokemon.PokemonData.Name; } if (pokemon.DexID == 265 && (!pokemon.IsEgg || !PokeManager.Settings.MysteryEggs)) { this.labelSpecies.Content += " " + (pokemon.WurpleIsCascoon ? "(Cas)" : "(Sil)"); } this.labelLevel.Content = "Lv " + pokemon.Level.ToString(); if (pokemon.IsEgg && PokeManager.Settings.MysteryEggs) { this.labelGender.Content = ""; } else if (pokemon.Gender == Genders.Male) { this.labelGender.Content = "♂"; this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(0, 136, 184)); } else if (pokemon.Gender == Genders.Female) { this.labelGender.Content = "♀"; this.labelGender.Foreground = new SolidColorBrush(Color.FromRgb(184, 88, 80)); } else { this.labelGender.Content = ""; } Brush unmarkedBrush = new SolidColorBrush(Color.FromRgb(200, 200, 200)); Brush markedBrush = new SolidColorBrush(Color.FromRgb(0, 0, 0)); markCircle.Foreground = (pokemon.IsCircleMarked ? markedBrush : unmarkedBrush); markSquare.Foreground = (pokemon.IsSquareMarked ? markedBrush : unmarkedBrush); markTriangle.Foreground = (pokemon.IsTriangleMarked ? markedBrush : unmarkedBrush); markHeart.Foreground = (pokemon.IsHeartMarked ? markedBrush : unmarkedBrush); if (pokemon.IsHoldingItem) { imageHeldItem.Source = ItemDatabase.GetItemImageFromID(pokemon.HeldItemID); } else { imageHeldItem.Source = null; } }
public void UnloadPokemon() { this.currentMoveIndex = -1; this.pokemon = null; this.imagePokemon.Source = PokemonDatabase.GetPokemonImageFromDexID(0, false); this.imagePokemon2.Source = PokemonDatabase.GetPokemonImageFromDexID(0, false); this.rectShadowMask.Visibility = Visibility.Hidden; this.rectShadowMask2.Visibility = Visibility.Hidden; this.imageShadowAura.Visibility = Visibility.Hidden; this.imageShadowAura2.Visibility = Visibility.Hidden; this.imageShinyStar.Visibility = Visibility.Hidden; this.imageShinyStar2.Visibility = Visibility.Hidden; this.imageBallCaught.Source = null; this.imageBallCaught2.Source = null; this.labelNickname.Content = ""; this.labelLevel.Content = ""; this.labelGender.Content = ""; this.labelOTName.Content = ""; this.labelOTID.Content = ""; this.labelSecretID.Content = ""; this.labelMetAtLevel.Content = ""; this.labelMetAtLocation.Content = ""; this.labelGame.Content = ""; this.labelNature.Content = ""; this.labelNatureRaised.Content = ""; this.labelNatureLowered.Content = ""; this.labelHeldItem.Content = ""; this.imageHeldItem.Source = null; this.labelSpeciesName.Content = ""; this.labelSpeciesNumber.Content = "No. 000"; this.labelHPIV.Content = "0"; this.labelAttackIV.Content = "0"; this.labelDefenseIV.Content = "0"; this.labelSpAttackIV.Content = "0"; this.labelSpDefenseIV.Content = "0"; this.labelSpeedIV.Content = "0"; this.labelHPEV.Content = "0"; this.labelAttackEV.Content = "0"; this.labelDefenseEV.Content = "0"; this.labelSpAttackEV.Content = "0"; this.labelSpDefenseEV.Content = "0"; this.labelSpeedEV.Content = "0"; this.labelHPStat.Content = "0"; this.labelAttackStat.Content = "0"; this.labelDefenseStat.Content = "0"; this.labelSpAttackStat.Content = "0"; this.labelSpDefenseStat.Content = "0"; this.labelSpeedStat.Content = "0"; this.labelCool.Content = "0"; this.labelBeauty.Content = "0"; this.labelCute.Content = "0"; this.labelSmart.Content = "0"; this.labelTough.Content = "0"; this.labelFeel.Content = "0"; this.labelMove1Name.Content = "-"; this.labelMove1PP.Content = "--"; this.typeMove1.Visibility = Visibility.Hidden; this.labelContestMove1Name.Content = "-"; this.labelContestMove1PP.Content = "--"; this.conditionMove1.Visibility = Visibility.Hidden; this.labelMove2Name.Content = "-"; this.labelMove2PP.Content = "--"; this.typeMove2.Visibility = Visibility.Hidden; this.labelContestMove2Name.Content = "-"; this.labelContestMove2PP.Content = "--"; this.conditionMove2.Visibility = Visibility.Hidden; this.labelMove3Name.Content = "-"; this.labelMove3PP.Content = "--"; this.typeMove3.Visibility = Visibility.Hidden; this.labelContestMove3Name.Content = "-"; this.labelContestMove3PP.Content = "--"; this.conditionMove3.Visibility = Visibility.Hidden; this.labelMove4Name.Content = "-"; this.labelMove4PP.Content = "--"; this.typeMove4.Visibility = Visibility.Hidden; this.labelContestMove4Name.Content = "-"; this.labelContestMove4PP.Content = "--"; this.conditionMove4.Visibility = Visibility.Hidden; this.labelExperienceText.Content = "Experience"; this.labelNextLevelText.Content = "Next Level"; this.labelExperienceText2.Content = ""; this.labelTotalExperience2.Content = ""; this.labelTotalExperience.Content = ""; this.labelNextLevel.Content = ""; this.rectExperienceBar.Fill = new SolidColorBrush(Color.FromRgb(100, 100, 100)); this.rectPurificationBorder1.Visibility = Visibility.Hidden; this.rectPurificationBorder2.Visibility = Visibility.Hidden; this.labelPokerus.Content = ""; this.type1Pokemon.Type = PokemonTypes.None; //this.type2Pokemon.Type = PokemonTypes.None; this.type2Pokemon.Visibility = Visibility.Hidden; Brush unmarkedBrush = new SolidColorBrush(Color.FromRgb(200, 200, 200)); markCircle.Foreground = unmarkedBrush; markSquare.Foreground = unmarkedBrush; markTriangle.Foreground = unmarkedBrush; markHeart.Foreground = unmarkedBrush; stackPanelRibbons.Children.Clear(); this.labelFriendship.Content = ""; this.labelFriendshipText.Content = "Friendship"; this.labelMetAtText.Content = "Met At"; this.labelAbility.Content = ""; this.textBlockAbilityDescription.Text = ""; this.textBlockContestMoveDescription.Text = ""; this.textBlockMoveDescription.Text = ""; this.textBlockRibbonDescription.Text = ""; this.labelMoveJam.Content = ""; this.labelMoveAppeal.Content = ""; this.labelMoveCategory.Content = ""; this.labelMovePower.Content = ""; this.labelMoveAccuracy.Content = ""; buttonBall.IsEnabled = false; buttonNickname.IsEnabled = false; buttonDeoxys.IsEnabled = false; ButtonEVs.IsEnabled = false; buttonMarkings.IsEnabled = false; buttonMoves.IsEnabled = false; buttonGive.IsEnabled = false; buttonTake.IsEnabled = false; }
public EvolutionWindow(IPokemon pokemon, ushort evolutionDexID) { InitializeComponent(); this.pokemon = pokemon; this.evolutionDexID = evolutionDexID; this.evolved = false; this.evolutionState = 0; this.timer = new DispatcherTimer(); this.timer.Tick += OnTick; this.timer.Interval = TimeSpan.FromSeconds(1.5); this.timer.Start(); this.storyboard = new Storyboard(); this.storyboard.Completed += OnStoryboardCompleted; this.imagePrevolution.Source = PokemonDatabase.GetPokemonImageFromDexID(pokemon.DexID, pokemon.IsShiny); this.imageEvolution.Source = PokemonDatabase.GetPokemonImageFromDexID(evolutionDexID, pokemon.IsShiny); this.rectMaskPrevolution.OpacityMask = new ImageBrush(PokemonDatabase.GetPokemonImageFromDexID(pokemon.DexID, pokemon.IsShiny)); this.rectMaskEvolution.OpacityMask = new ImageBrush(PokemonDatabase.GetPokemonImageFromDexID(evolutionDexID, pokemon.IsShiny)); this.rectMaskPrevolution.Opacity = 0; this.textBlockMessage.Text = "What?\nYour " + pokemon.Nickname + " is evolving!"; playerCry = new MediaPlayer(); playerCry.MediaEnded += OnMediaEnded; playerCry.Volume = PokeManager.Settings.MutedVolume; playerEvolutionCry = new MediaPlayer(); playerEvolutionCry.MediaEnded += OnMediaEnded; playerEvolutionCry.Volume = PokeManager.Settings.MutedVolume; playerMusic = new MediaPlayer(); playerMusic.MediaEnded += OnMediaEnded; playerMusic.Volume = PokeManager.Settings.MutedVolume; if (PokeManager.Settings.IsMuted) { imageVolume.Source = ResourceDatabase.GetImageFromName("IconVolumeMute"); } else { imageVolume.Source = ResourceDatabase.GetImageFromName("IconVolumeOn"); } CreateAnimation(); string cryFile = PokemonDatabase.FindCryFile(pokemon.DexID); try { if (cryFile != null) { playerCry.Open(new Uri(cryFile)); } else { playerCry = null; } } catch (Exception) { playerCry = null; } cryFile = PokemonDatabase.FindCryFile(evolutionDexID); try { if (cryFile != null) { playerEvolutionCry.Open(new Uri(cryFile)); } else { playerEvolutionCry = null; } } catch (Exception) { playerEvolutionCry = null; } playerMusic.Open(new Uri(System.IO.Path.Combine(PokeManager.ApplicationDirectory, "Resources", "Audio", "Evolution.wav"))); }