private void FinishEvolution() { evolved = true; storyboard.Stop(this); if (playerCry != null) { playerCry.Stop(); } playerMusic.Stop(); evolutionState = 4; // Make sure everything looks correct imagePrevolution.Visibility = Visibility.Hidden; rectMaskPrevolution.Visibility = Visibility.Hidden; rectMaskEvolution.Visibility = Visibility.Hidden; rectGlow.Visibility = Visibility.Hidden; rectBlackCover.Visibility = Visibility.Hidden; ((imageEvolution.RenderTransform as TransformGroup).Children[1] as ScaleTransform).ScaleX = 1; ((imageEvolution.RenderTransform as TransformGroup).Children[1] as ScaleTransform).ScaleY = 1; // Setup correct controls this.textBlockMessage.Text = "Congratulations!\nYour " + pokemon.Nickname + " evolved into " + EvolutionData.Name + "!"; this.gridControlButtons.Visibility = Visibility.Hidden; this.buttonClose.Visibility = Visibility.Visible; if (!pokemon.HasNickname) { pokemon.Nickname = EvolutionData.Name.ToUpper(); } pokemon.DexID = evolutionDexID; pokemon.RecalculateStats(); if (evolutionDexID == 291) { IPokemon shedinja = pokemon.Clone(); shedinja.DexID = 292; shedinja.RemoveNickname(); shedinja.RecalculateStats(); if (pokemon.PokePC.HasRoomForPokemon(1)) { shedinjaAdded = true; pokemon.PokePC.PlacePokemonInNextAvailableSlot(pokemon.PokeContainer is IPokeBox ? (int)(pokemon.PokeContainer as IPokeBox).BoxNumber : -1, pokemon.ContainerIndex, shedinja); } } pokemon.GameSave.IsChanged = true; PokeManager.RefreshUI(); }