From d3436cfc9ae7b4a44cbcf30e092c8b0175d5e5a6 Mon Sep 17 00:00:00 2001 From: Sylvain Pollet-Villard Date: Sun, 7 Jan 2024 09:40:29 +0100 Subject: [PATCH] Fix shop evolutions not being highlighted during fights and carousels rounds (#1371) Co-authored-by: Keldaan --- app/public/dist/client/changelog/patch-4.6.md | 4 +++- .../src/pages/component/game/game-pokemon-portrait.tsx | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/public/dist/client/changelog/patch-4.6.md b/app/public/dist/client/changelog/patch-4.6.md index 01e74745d8..3e178d4ac8 100644 --- a/app/public/dist/client/changelog/patch-4.6.md +++ b/app/public/dist/client/changelog/patch-4.6.md @@ -107,5 +107,7 @@ Added artificial items, obtained through Artificial synergy: - Shiny Mewtwo at round 15 will give an artificial item - Increase chances to get shiny wild pokemons on PVE stages (1/20 chance) - Light cell is now on a fixed position for bots, indicated in bot builder +- Fix Shop evolutions not being highlighted during fights and carousels rounds - Fix Comfey applying twice the on-cast effects and the skill animation for its holder -- Fix magic bounce procing even when the opponent ability deals no damage \ No newline at end of file +- Fix magic bounce procing even when the opponent ability deals no damage + diff --git a/app/public/src/pages/component/game/game-pokemon-portrait.tsx b/app/public/src/pages/component/game/game-pokemon-portrait.tsx index ce85717a94..73e97822a1 100644 --- a/app/public/src/pages/component/game/game-pokemon-portrait.tsx +++ b/app/public/src/pages/component/game/game-pokemon-portrait.tsx @@ -6,13 +6,13 @@ import { RarityColor } from "../../../../../types/Config" import { getPortraitSrc } from "../../../utils" import { GamePokemonDetail } from "./game-pokemon-detail" import SynergyIcon from "../icons/synergy-icon" -import { getGameScene } from "../../game" import { Pkm, PkmIndex } from "../../../../../types/enum/Pokemon" import { Money } from "../icons/money" import { useAppSelector } from "../../../hooks" import "./game-pokemon-portrait.css" import PokemonFactory from "../../../../../models/pokemon-factory" import { CountEvolutionRule } from "../../../../../core/evolution-rules" +import store from "../../../stores" export default function GamePokemonPortrait(props: { index: number @@ -24,7 +24,6 @@ export default function GamePokemonPortrait(props: { return
} else { const rarityColor = RarityColor[props.pokemon.rarity] - const boardManager = getGameScene()?.board const pokemonCollection = useAppSelector( (state) => state.game.pokemonCollection ) @@ -37,14 +36,16 @@ export default function GamePokemonPortrait(props: { (state) => state.game.currentPlayerId ) const isOnAnotherBoard = currentPlayerId !== uid + const state = store.getState() + const player = state.game.players.find((p) => p.id === uid) let count = 0 let countEvol = 0 let pokemonEvolution = props.pokemon.evolution let pokemonEvolution2 = Pkm.DEFAULT - if (boardManager && !isOnAnotherBoard) { - boardManager.pokemons.forEach((p) => { + if (player && !isOnAnotherBoard) { + player.board.forEach((p) => { if (p.index === props.pokemon!.index && p.evolution !== Pkm.DEFAULT) { count++ }