[Feature] [Item] Add White Herb item (#2719)
* More work * More work * Should be finished * Fixed an error in checking target * Moved white herb effect to StatChangePhase, 50% chance of consumption * Added graphics for White Herb * Balance and documentation * Add localization entry for White Herb apply msg * Add new keys to other localization files * German translations Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com> * Update item sprite atlas * Redo item atlas * Remove whitespace in move.ts * Moved decrement outside conditional * Fix item atlas --------- Co-authored-by: Jannik Tappert <38758606+CodeTappert@users.noreply.github.com>
This commit is contained in:
parent
9f01b52d6b
commit
3e47881faf
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
Binary file not shown.
After Width: | Height: | Size: 289 B |
Binary file not shown.
After Width: | Height: | Size: 284 B |
|
@ -5898,6 +5898,8 @@ export const allMoves: Move[] = [
|
|||
new SelfStatusMove(Moves.NONE, Type.NORMAL, MoveCategory.STATUS, -1, -1, 0, 1),
|
||||
];
|
||||
|
||||
export const selfStatLowerMoves: Moves[] = [];
|
||||
|
||||
export function initMoves() {
|
||||
allMoves.push(
|
||||
new AttackMove(Moves.POUND, Type.NORMAL, MoveCategory.PHYSICAL, 40, 100, 35, -1, 0, 1),
|
||||
|
@ -8689,4 +8691,9 @@ export function initMoves() {
|
|||
new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9)
|
||||
.attr(StatusEffectAttr, StatusEffect.TOXIC)
|
||||
);
|
||||
allMoves.map(m=>{
|
||||
if (m.getAttrs(StatChangeAttr).some(a=> a.selfTarget && a.levels < 0)) {
|
||||
selfStatLowerMoves.push(m.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Belebersamen", description: "Belebt den Träger mit der Hälfte seiner KP wieder, sollte er durch einen direkten Treffer kampfunfähig werden." },
|
||||
|
||||
"WHITE_HERB": { name: "Schlohkraut", description: "Ein Item zum Tragen. Es hebt einmalig jede negative Statuswertveränderung auf." },
|
||||
|
||||
"ETHER": { name: "Äther" },
|
||||
"MAX_ETHER": { name: "Top-Äther" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!",
|
||||
"hitHealApply": "{{typeName}} von {{pokemonNameWithAffix}} füllt einige KP auf!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} wurde durch {{typeName}} wiederbelebt!",
|
||||
"pokemonResetNegativeStatStageApply": "Die negative Statuswertveränderung von {{pokemonNameWithAffix}} wurde durch {{typeName}} aufgehoben!",
|
||||
"moneyInterestApply": "Du erhählst {{moneyAmount}} ₽ durch das Item {{typeName}}!",
|
||||
"turnHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} absorbiert!",
|
||||
"contactHeldItemTransferApply": "{{itemName}} von {{pokemonNameWithAffix}} wurde durch {{typeName}} von {{pokemonName}} geklaut!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Reviver Seed", description: "Revives the holder for 1/2 HP upon fainting from a direct hit." },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "Ether" },
|
||||
"MAX_ETHER": { name: "Max Ether" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!",
|
||||
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!",
|
||||
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Semilla Revivir", description: "Revive al portador con la mitad de sus PS al debilitarse por un golpe directo." },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "Éter" },
|
||||
"MAX_ETHER": { name: "Éter Máx." },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!",
|
||||
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!",
|
||||
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Résugraine", description: "Réanime et restaure la moitié des PV de son porteur s’il est mis K.O. par une capacité directe." },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "Huile" },
|
||||
"MAX_ETHER": { name: "Huile Max" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "Les PV de {{pokemonNameWithAffix}}\nsont un peu restaurés par les {{typeName}} !",
|
||||
"hitHealApply": "Les PV de {{pokemonNameWithAffix}}\nsont un peu restaurés par le {{typeName}} !",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} a repris connaissance\navec sa {{typeName}} et est prêt à se battre de nouveau !",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "La {{typeName}} vous rapporte\n{{moneyAmount}} ₽ d’intérêts !",
|
||||
"turnHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} est absorbé·e\npar le {{typeName}} de {{pokemonName}} !",
|
||||
"contactHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} est volé·e\npar l’{{typeName}} de {{pokemonName}} !",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Revitalseme", description: "Il possessore recupera 1/2 di PS in caso di KO causato da un colpo diretto." },
|
||||
|
||||
"WHITE_HERB": { name: "Erbachiara", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "Etere" },
|
||||
"MAX_ETHER": { name: "Etere max" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}} restored a little HP using\nits {{typeName}}!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} was revived\nby its {{typeName}}!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "You received interest of ₽{{moneyAmount}}\nfrom the {{typeName}}!",
|
||||
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was absorbed\nby {{pokemonName}}'s {{typeName}}!",
|
||||
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}'s {{itemName}} was snatched\nby {{pokemonName}}'s {{typeName}}!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "부활의씨앗", description: "포켓몬이 공격을 받고 쓰러지려 할 때 HP를 절반 회복한다." },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "PP에이드" },
|
||||
"MAX_ETHER": { name: "PP회복" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}}[[는]]\n{{typeName}}[[로]] 인해 조금 회복했다.",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}}[[는]]\n{{typeName}}[[로]] 인해 조금 회복했다.",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}}[[는]] {{typeName}}[[로]]\n정신을 차려 싸울 수 있게 되었다!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "{{typeName}}[[로]]부터\n₽{{moneyAmount}}[[를]] 받았다!",
|
||||
"turnHeldItemTransferApply": "{{pokemonName}}의 {{typeName}}[[는]]\n{{pokemonNameWithAffix}}의 {{itemName}}[[를]] 흡수했다!",
|
||||
"contactHeldItemTransferApply": "{{pokemonName}}의 {{typeName}}[[는]]\n{{pokemonNameWithAffix}}의 {{itemName}}[[를]] 가로챘다!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "Semente Reanimadora", description: "Após desmaiar por um ataque direto, reanima com 50% de PS." },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "Éter" },
|
||||
"MAX_ETHER": { name: "Éter Máximo" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}} restaurou um pouco de PS usando\nsuas {{typeName}}!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}} restaurou um pouco de PS usando\nsua {{typeName}}!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}} foi revivido\npor sua {{typeName}}!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "Você recebeu um juros de ₽{{moneyAmount}}\nde sua {{typeName}}!",
|
||||
"turnHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} foi absorvido(a)\npelo {{typeName}} de {{pokemonName}}!",
|
||||
"contactHeldItemTransferApply": "{{itemName}} de {{pokemonNameWithAffix}} foi pego(a)\npela {{typeName}} de {{pokemonName}}!",
|
||||
|
|
|
@ -153,6 +153,8 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
|
||||
"REVIVER_SEED": { name: "复活种子", description: "受到技能攻击伤害濒死时,\n恢复该宝可梦的HP至1/2。" },
|
||||
|
||||
"WHITE_HERB": { name: "White Herb", description: "An item to be held by a Pokémon. It will restore any lowered stat in battle." },
|
||||
|
||||
"ETHER": { name: "PP单项小补剂" },
|
||||
"MAX_ETHER": { name: "PP单项全补剂" },
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回复了体力!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回复了体力!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}}用{{typeName}}\n恢复了活力!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "用{{typeName}}\n获得了 ₽{{moneyAmount}} 利息!",
|
||||
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}吸收了!",
|
||||
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}夺取了!",
|
||||
|
|
|
@ -155,6 +155,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
|
|||
name: "復活種子",
|
||||
description: "受到技能攻擊傷害瀕死時,\n恢復該瀕死寶可夢的HP至1/2。",
|
||||
},
|
||||
WHITE_HERB: {
|
||||
name: "White Herb",
|
||||
description: "An item to be held by a Pokémon. It will restore any lowered stat in battle.",
|
||||
},
|
||||
ETHER: { name: "PP單項小補劑" },
|
||||
MAX_ETHER: { name: "PP單項全補劑" },
|
||||
ELIXIR: { name: "PP多項小補劑" },
|
||||
|
|
|
@ -5,6 +5,7 @@ export const modifier: SimpleTranslationEntries = {
|
|||
"turnHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回復了體力!",
|
||||
"hitHealApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回復了體力!",
|
||||
"pokemonInstantReviveApply": "{{pokemonNameWithAffix}}用{{typeName}}\n回復了活力!",
|
||||
"pokemonResetNegativeStatStageApply": "{{pokemonNameWithAffix}}'s lowered stats were restored\nby its {{typeName}}!",
|
||||
"moneyInterestApply": "用{{typeName}}\n獲得了 ₽{{moneyAmount}} 利息!",
|
||||
"turnHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}吸收了!",
|
||||
"contactHeldItemTransferApply": "{{pokemonNameWithAffix}}的{{itemName}}被\n{{pokemonName}}的{{typeName}}奪取了!",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as Modifiers from "./modifier";
|
||||
import { AttackMove, allMoves } from "../data/move";
|
||||
import { AttackMove, allMoves, selfStatLowerMoves } from "../data/move";
|
||||
import { MAX_PER_TYPE_POKEBALLS, PokeballType, getPokeballCatchMultiplier, getPokeballName } from "../data/pokeball";
|
||||
import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from "../field/pokemon";
|
||||
import { EvolutionItem, pokemonEvolutions } from "../data/pokemon-evolutions";
|
||||
|
@ -1252,6 +1252,7 @@ export const modifierTypes = {
|
|||
SACRED_ASH: () => new AllPokemonFullReviveModifierType("modifierType:ModifierType.SACRED_ASH", "sacred_ash"),
|
||||
|
||||
REVIVER_SEED: () => new PokemonHeldItemModifierType("modifierType:ModifierType.REVIVER_SEED", "reviver_seed", (type, args) => new Modifiers.PokemonInstantReviveModifier(type, (args[0] as Pokemon).id)),
|
||||
WHITE_HERB: () => new PokemonHeldItemModifierType("modifierType:ModifierType.WHITE_HERB", "white_herb", (type, args) => new Modifiers.PokemonResetNegativeStatStageModifier(type, (args[0] as Pokemon).id)),
|
||||
|
||||
ETHER: () => new PokemonPpRestoreModifierType("modifierType:ModifierType.ETHER", "ether", 10),
|
||||
MAX_ETHER: () => new PokemonPpRestoreModifierType("modifierType:ModifierType.MAX_ETHER", "max_ether", -1),
|
||||
|
@ -1562,6 +1563,14 @@ const modifierPool: ModifierPool = {
|
|||
// If a party member doesn't already have one of these two orbs and has one of the above moves or abilities, the orb can appear
|
||||
return party.some(p => !p.getHeldItems().some(i => i instanceof Modifiers.TurnStatusEffectModifier) && (checkedAbilities.some(a => p.hasAbility(a, false, true)) || p.getMoveset(true).some(m => checkedMoves.includes(m.moveId)))) ? 10 : 0;
|
||||
}, 10),
|
||||
new WeightedModifierType(modifierTypes.WHITE_HERB, (party: Pokemon[]) => {
|
||||
const checkedAbilities = [Abilities.WEAK_ARMOR, Abilities.CONTRARY, Abilities.MOODY, Abilities.ANGER_SHELL, Abilities.COMPETITIVE, Abilities.DEFIANT];
|
||||
const weightMultiplier = party.filter(
|
||||
p => !p.getHeldItems().some(i => i instanceof Modifiers.PokemonResetNegativeStatStageModifier && i.stackCount >= i.getMaxHeldItemCount(p)) &&
|
||||
(checkedAbilities.some(a => p.hasAbility(a, false, true)) || p.getMoveset(true).some(m => selfStatLowerMoves.includes(m.moveId)))).length;
|
||||
// If a party member has one of the above moves or abilities and doesn't have max herbs, the herb will appear more frequently
|
||||
return 3*(weightMultiplier? 2: 1)+(weightMultiplier? weightMultiplier-1: 0);
|
||||
}, 10),
|
||||
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
|
||||
new WeightedModifierType(modifierTypes.CANDY_JAR, 5),
|
||||
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 9),
|
||||
|
@ -1628,6 +1637,7 @@ const wildModifierPool: ModifierPool = {
|
|||
}),
|
||||
[ModifierTier.ULTRA]: [
|
||||
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10),
|
||||
new WeightedModifierType(modifierTypes.WHITE_HERB, 2)
|
||||
].map(m => {
|
||||
m.setTier(ModifierTier.ULTRA); return m;
|
||||
}),
|
||||
|
@ -1656,7 +1666,8 @@ const trainerModifierPool: ModifierPool = {
|
|||
m.setTier(ModifierTier.GREAT); return m;
|
||||
}),
|
||||
[ModifierTier.ULTRA]: [
|
||||
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 1),
|
||||
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5),
|
||||
new WeightedModifierType(modifierTypes.WHITE_HERB, 1),
|
||||
].map(m => {
|
||||
m.setTier(ModifierTier.ULTRA); return m;
|
||||
}),
|
||||
|
|
|
@ -1391,6 +1391,47 @@ export class PokemonInstantReviveModifier extends PokemonHeldItemModifier {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifier used for White Herb, which resets negative {@linkcode Stat} changes
|
||||
* @extends PokemonHeldItemModifier
|
||||
* @see {@linkcode apply}
|
||||
*/
|
||||
export class PokemonResetNegativeStatStageModifier extends PokemonHeldItemModifier {
|
||||
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
|
||||
super(type, pokemonId, stackCount);
|
||||
}
|
||||
|
||||
matchType(modifier: Modifier) {
|
||||
return modifier instanceof PokemonResetNegativeStatStageModifier;
|
||||
}
|
||||
|
||||
clone() {
|
||||
return new PokemonResetNegativeStatStageModifier(this.type, this.pokemonId, this.stackCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Restores any negative stat stages of the mon to 0
|
||||
* @param args args[0] is the {@linkcode Pokemon} whose stat stages are being checked
|
||||
* @returns true if any stat changes were applied (item was used), false otherwise
|
||||
*/
|
||||
apply(args: any[]): boolean {
|
||||
const pokemon = args[0] as Pokemon;
|
||||
const loweredStats = pokemon.summonData.battleStats.filter(s => s < 0);
|
||||
if (loweredStats.length) {
|
||||
for (let s = 0; s < pokemon.summonData.battleStats.length; s++) {
|
||||
pokemon.summonData.battleStats[s] = Math.max(0, pokemon.summonData.battleStats[s]);
|
||||
}
|
||||
pokemon.scene.queueMessage(i18next.t("modifier:pokemonResetNegativeStatStageApply", { pokemonNameWithAffix: getPokemonNameWithAffix(pokemon), typeName: this.type.name }));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
getMaxHeldItemCount(pokemon: Pokemon): integer {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
export abstract class ConsumablePokemonModifier extends ConsumableModifier {
|
||||
public pokemonId: integer;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMov
|
|||
import { Mode } from "./ui/ui";
|
||||
import { Command } from "./ui/command-ui-handler";
|
||||
import { Stat } from "./data/pokemon-stat";
|
||||
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, overrideModifiers, overrideHeldItems, BypassSpeedChanceModifier, TurnStatusEffectModifier } from "./modifier/modifier";
|
||||
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, overrideModifiers, overrideHeldItems, BypassSpeedChanceModifier, TurnStatusEffectModifier, PokemonResetNegativeStatStageModifier } from "./modifier/modifier";
|
||||
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
||||
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
||||
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
||||
|
@ -3321,6 +3321,21 @@ export class StatChangePhase extends PokemonPhase {
|
|||
|
||||
applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget);
|
||||
|
||||
//Look for any other stat change phases; if this is the last one, do White Herb check
|
||||
const existingPhase = this.scene.findPhase(p => p instanceof StatChangePhase && p.battlerIndex === this.battlerIndex);
|
||||
if (!(existingPhase instanceof StatChangePhase)) {
|
||||
// Apply White Herb if needed
|
||||
const whiteHerb = this.scene.applyModifier(PokemonResetNegativeStatStageModifier, this.player, pokemon) as PokemonResetNegativeStatStageModifier;
|
||||
// If the White Herb was applied, consume it
|
||||
if (whiteHerb) {
|
||||
--whiteHerb.stackCount;
|
||||
if (whiteHerb.stackCount <= 0) {
|
||||
this.scene.removeModifier(whiteHerb);
|
||||
}
|
||||
this.scene.updateModifiers(this.player);
|
||||
}
|
||||
}
|
||||
|
||||
pokemon.updateInfo();
|
||||
|
||||
handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end());
|
||||
|
|
Loading…
Reference in New Issue