mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-28 04:22:44 +02:00
Hotfix uturn with kings rock (#2385)
This commit is contained in:
parent
21f1e077fa
commit
04c94fcbba
@ -525,6 +525,10 @@ export abstract class PokemonHeldItemModifier extends PersistentModifier {
|
|||||||
|
|
||||||
//Applies to items with chance of activating secondary effects ie Kings Rock
|
//Applies to items with chance of activating secondary effects ie Kings Rock
|
||||||
getSecondaryChanceMultiplier(pokemon: Pokemon): integer {
|
getSecondaryChanceMultiplier(pokemon: Pokemon): integer {
|
||||||
|
// Temporary quickfix to stop game from freezing when the opponet uses u-turn while holding on to king's rock
|
||||||
|
if (!pokemon.getLastXMoves(0)[0]) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
const sheerForceAffected = allMoves[pokemon.getLastXMoves(0)[0].move].chance >= 0 && pokemon.hasAbility(Abilities.SHEER_FORCE);
|
const sheerForceAffected = allMoves[pokemon.getLastXMoves(0)[0].move].chance >= 0 && pokemon.hasAbility(Abilities.SHEER_FORCE);
|
||||||
|
|
||||||
if (sheerForceAffected) {
|
if (sheerForceAffected) {
|
||||||
|
Loading…
Reference in New Issue
Block a user