Using held items in some places

This commit is contained in:
Wlowscha 2025-06-08 20:15:56 +02:00
parent 1cb956e872
commit 2b077151ef
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 5 additions and 12 deletions

View File

@ -52,11 +52,7 @@ import { type DamageResult, PokemonMove, type TurnMove } from "#app/field/pokemo
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { HitResult, MoveResult } from "#app/field/pokemon"; import { HitResult, MoveResult } from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import { import { EnemyAttackStatusEffectChanceModifier, EnemyEndureChanceModifier } from "#app/modifier/modifier";
ContactHeldItemTransferChanceModifier,
EnemyAttackStatusEffectChanceModifier,
EnemyEndureChanceModifier,
} from "#app/modifier/modifier";
import { PokemonPhase } from "#app/phases/pokemon-phase"; import { PokemonPhase } from "#app/phases/pokemon-phase";
import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils/common"; import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils/common";
import type { nil } from "#app/utils/common"; import type { nil } from "#app/utils/common";
@ -999,7 +995,7 @@ export class MoveEffectPhase extends PokemonPhase {
// Apply Grip Claw's chance to steal an item from the target // Apply Grip Claw's chance to steal an item from the target
if (this.move instanceof AttackMove) { if (this.move instanceof AttackMove) {
globalScene.applyModifiers(ContactHeldItemTransferChanceModifier, this.player, user, target); applyHeldItems(ITEM_EFFECT.CONTACT_ITEM_STEAL_CHANCE, { pokemon: user, target: target });
} }
} }
} }

View File

@ -5,11 +5,7 @@ import { WeatherType } from "#app/enums/weather-type";
import { TurnEndEvent } from "#app/events/battle-scene"; import { TurnEndEvent } from "#app/events/battle-scene";
import type Pokemon from "#app/field/pokemon"; import type Pokemon from "#app/field/pokemon";
import { getPokemonNameWithAffix } from "#app/messages"; import { getPokemonNameWithAffix } from "#app/messages";
import { import { EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier } from "#app/modifier/modifier";
EnemyTurnHealModifier,
EnemyStatusEffectHealChanceModifier,
TurnHeldItemTransferModifier,
} from "#app/modifier/modifier";
import i18next from "i18next"; import i18next from "i18next";
import { FieldPhase } from "./field-phase"; import { FieldPhase } from "./field-phase";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
@ -53,7 +49,8 @@ export class TurnEndPhase extends FieldPhase {
} }
applyHeldItems(ITEM_EFFECT.TURN_END_STATUS, { pokemon: pokemon }); applyHeldItems(ITEM_EFFECT.TURN_END_STATUS, { pokemon: pokemon });
globalScene.applyModifiers(TurnHeldItemTransferModifier, pokemon.isPlayer(), pokemon);
applyHeldItems(ITEM_EFFECT.TURN_END_ITEM_STEAL, { pokemon: pokemon });
pokemon.tempSummonData.turnCount++; pokemon.tempSummonData.turnCount++;
pokemon.tempSummonData.waveTurnCount++; pokemon.tempSummonData.waveTurnCount++;