diff --git a/src/data/ability.ts b/src/data/ability.ts index 0bfc85fa363..da68f9271f9 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -3012,6 +3012,29 @@ export class IgnoreTypeStatusEffectImmunityAbAttr extends AbAttr { } } +/** + * Gives money to the user after the battle. + * + * @extends PostBattleAbAttr + * @see {@linkcode applyPostBattle} + */ +export class MoneyAbAttr extends PostBattleAbAttr { + constructor() { + super(); + } + + /** + * @param pokemon {@linkcode Pokemon} that is the user of this ability. + * @param passive N/A + * @param args N/A + * @returns true + */ + applyPostBattle(pokemon: Pokemon, passive: boolean, args: any[]): boolean { + pokemon.scene.currentBattle.moneyScattered += pokemon.scene.getWaveMoneyAmount(0.2); + return true; + } +} + function applyAbAttrsInternal(attrType: { new(...args: any[]): TAttr }, pokemon: Pokemon, applyFunc: AbAttrApplyFunc, args: any[], isAsync: boolean = false, showAbilityInstant: boolean = false, quiet: boolean = false, passive: boolean = false): Promise { return new Promise(resolve => { @@ -3557,7 +3580,7 @@ export function initAbilities() { .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SNOW), new Ability(Abilities.HONEY_GATHER, 4) - .unimplemented(), + .attr(MoneyAbAttr), new Ability(Abilities.FRISK, 4) .attr(FriskAbAttr), new Ability(Abilities.RECKLESS, 4) diff --git a/src/locales/de/ability.ts b/src/locales/de/ability.ts index 17472339717..cd1a15f194a 100644 --- a/src/locales/de/ability.ts +++ b/src/locales/de/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "Honigmaul", - description: "Das Pokémon sammelt nach Kämpfen eventuell Honig auf.", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "Schnüffler", diff --git a/src/locales/en/ability.ts b/src/locales/en/ability.ts index 2ba837f8c69..aff5d95405e 100644 --- a/src/locales/en/ability.ts +++ b/src/locales/en/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "Honey Gather", - description: "The Pokémon may gather Honey after a battle.", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "Frisk", diff --git a/src/locales/es/ability.ts b/src/locales/es/ability.ts index cb6e4836ed5..56f3afe6b02 100644 --- a/src/locales/es/ability.ts +++ b/src/locales/es/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, "honeyGather": { name: "Recogemiel", - description: "Puede que encuentre Miel una vez concluido el combate." + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money." }, "frisk": { name: "Cacheo", diff --git a/src/locales/fr/ability.ts b/src/locales/fr/ability.ts index 49bfeb53acf..83bb46c7408 100644 --- a/src/locales/fr/ability.ts +++ b/src/locales/fr/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "Cherche Miel", - description: "Le Pokémon peut parfois trouver du Miel après un combat.", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "Fouille", diff --git a/src/locales/it/ability.ts b/src/locales/it/ability.ts index e0e827ff27c..9eb9480f771 100644 --- a/src/locales/it/ability.ts +++ b/src/locales/it/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "Mielincetta", - description: "Il Pokémon può raccogliere del Miele alla fine della lotta.", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "Indagine", diff --git a/src/locales/pt_BR/ability.ts b/src/locales/pt_BR/ability.ts index 060a8b7611e..05ef735bfde 100644 --- a/src/locales/pt_BR/ability.ts +++ b/src/locales/pt_BR/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "Honey Gather", - description: "O Pokémon pode coletar Mel ao final de uma batalha.", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "Frisk", diff --git a/src/locales/zh_CN/ability.ts b/src/locales/zh_CN/ability.ts index cdeb91b0e8f..77034d61743 100644 --- a/src/locales/zh_CN/ability.ts +++ b/src/locales/zh_CN/ability.ts @@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = { }, honeyGather: { name: "采蜜", - description: "战斗结束时,有时候会捡来\n甜甜蜜。", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "察觉", diff --git a/src/locales/zh_TW/ability.ts b/src/locales/zh_TW/ability.ts index bf374c28f06..f760a9614f6 100644 --- a/src/locales/zh_TW/ability.ts +++ b/src/locales/zh_TW/ability.ts @@ -418,7 +418,7 @@ export const ability: AbilityTranslationEntries = { snowWarning: { name: "降雪", description: "出場時,會將天氣變爲下雪。" }, honeyGather: { name: "採蜜", - description: "戰鬥結束時,有時候會撿來\n甜甜蜜。", + description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.", }, frisk: { name: "察覺", diff --git a/src/phases.ts b/src/phases.ts index 6d0eb29c707..053f5774ac7 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -2301,9 +2301,6 @@ export class BattleEndPhase extends BattlePhase { super.start(); this.scene.currentBattle.addBattleScore(this.scene); - if (this.scene.currentBattle.moneyScattered) { - this.scene.currentBattle.pickUpScatteredMoney(this.scene); - } this.scene.gameData.gameStats.battles++; if (this.scene.currentBattle.trainer) { @@ -2323,6 +2320,10 @@ export class BattleEndPhase extends BattlePhase { applyPostBattleAbAttrs(PostBattleAbAttr, pokemon); } + if (this.scene.currentBattle.moneyScattered) { + this.scene.currentBattle.pickUpScatteredMoney(this.scene); + } + this.scene.clearEnemyHeldItemModifiers(); const lapsingModifiers = this.scene.findModifiers(m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier) as (LapsingPersistentModifier | LapsingPokemonHeldItemModifier)[];