Skip to content

Commit

Permalink
Fix shop evolutions not being highlighted during fights and carousels…
Browse files Browse the repository at this point in the history
… rounds (#1371)

Co-authored-by: Keldaan <keldaan.ag@gmail.com>
  • Loading branch information
sylvainpolletvillard and keldaan-ag authored Jan 7, 2024
1 parent 679434c commit d3436cf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/public/dist/client/changelog/patch-4.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- Fix magic bounce procing even when the opponent ability deals no damage

9 changes: 5 additions & 4 deletions app/public/src/pages/component/game/game-pokemon-portrait.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -24,7 +24,6 @@ export default function GamePokemonPortrait(props: {
return <div className="game-pokemon-portrait nes-container empty" />
} else {
const rarityColor = RarityColor[props.pokemon.rarity]
const boardManager = getGameScene()?.board
const pokemonCollection = useAppSelector(
(state) => state.game.pokemonCollection
)
Expand All @@ -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++
}
Expand Down

0 comments on commit d3436cf

Please sign in to comment.