Fix some minor bugs

This commit is contained in:
Flashfyre 2023-05-19 16:13:11 -04:00
parent 2c4a90bf1c
commit 5c7b2ccecc
2 changed files with 8 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import { BerryModifier, ContactHeldItemTransferChanceModifier, ExpBalanceModifie
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler"; import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballName, getPokeballTintColor, PokeballType } from "./data/pokeball"; import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballName, getPokeballTintColor, PokeballType } from "./data/pokeball";
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims"; import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
import { Status, StatusEffect, getStatusEffectActivationText, getStatusEffectCatchRateMultiplier, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText } from "./data/status-effect"; import { StatusEffect, getStatusEffectActivationText, getStatusEffectCatchRateMultiplier, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText } from "./data/status-effect";
import { SummaryUiMode } from "./ui/summary-ui-handler"; import { SummaryUiMode } from "./ui/summary-ui-handler";
import EvolutionSceneHandler from "./ui/evolution-scene-handler"; import EvolutionSceneHandler from "./ui/evolution-scene-handler";
import { EvolutionPhase } from "./evolution-phase"; import { EvolutionPhase } from "./evolution-phase";

View File

@ -255,7 +255,7 @@ export class MapModifier extends PersistentModifier {
return true; return true;
} }
getmaxStackCount(): integer { getMaxStackCount(): integer {
return 1; return 1;
} }
} }
@ -426,7 +426,7 @@ export class SurviveDamageModifier extends PokemonHeldItemModifier {
return true; return true;
} }
getmaxStackCount(): integer { getMaxStackCount(): integer {
return 5; return 5;
} }
} }
@ -1003,10 +1003,13 @@ export abstract class HeldItemTransferModifier extends PokemonHeldItemModifier {
apply(args: any[]): boolean { apply(args: any[]): boolean {
const pokemon = args[0] as Pokemon; const pokemon = args[0] as Pokemon;
const targetPokemon = pokemon.getOpponent(args.length > 1 ? args[1] as integer : !pokemon.scene.currentBattle.double ? 0 : Utils.randInt(2)); const opponents = pokemon.getOpponents();
if (!targetPokemon)
if (!opponents.length)
return false; return false;
const targetPokemon = opponents[Utils.randInt(opponents.length)];
const transferredItemCount = this.getTransferredItemCount(); const transferredItemCount = this.getTransferredItemCount();
if (!transferredItemCount) if (!transferredItemCount)
return false; return false;