Implement Honey Gather (#1360)

* Implement Honey Gather

* Updated Ability Description

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
This commit is contained in:
Jakub Hanko 2024-05-25 15:01:08 +02:00 committed by GitHub
parent aaa96ebe0e
commit caeb22c26b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 36 additions and 12 deletions

View File

@ -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<TAttr extends AbAttr>(attrType: { new(...args: any[]): TAttr }, function applyAbAttrsInternal<TAttr extends AbAttr>(attrType: { new(...args: any[]): TAttr },
pokemon: Pokemon, applyFunc: AbAttrApplyFunc<TAttr>, args: any[], isAsync: boolean = false, showAbilityInstant: boolean = false, quiet: boolean = false, passive: boolean = false): Promise<void> { pokemon: Pokemon, applyFunc: AbAttrApplyFunc<TAttr>, args: any[], isAsync: boolean = false, showAbilityInstant: boolean = false, quiet: boolean = false, passive: boolean = false): Promise<void> {
return new Promise(resolve => { return new Promise(resolve => {
@ -3557,7 +3580,7 @@ export function initAbilities() {
.attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SNOW)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SNOW), .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SNOW),
new Ability(Abilities.HONEY_GATHER, 4) new Ability(Abilities.HONEY_GATHER, 4)
.unimplemented(), .attr(MoneyAbAttr),
new Ability(Abilities.FRISK, 4) new Ability(Abilities.FRISK, 4)
.attr(FriskAbAttr), .attr(FriskAbAttr),
new Ability(Abilities.RECKLESS, 4) new Ability(Abilities.RECKLESS, 4)

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "Honigmaul", 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: { frisk: {
name: "Schnüffler", name: "Schnüffler",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "Honey Gather", 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: { frisk: {
name: "Frisk", name: "Frisk",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
"honeyGather": { "honeyGather": {
name: "Recogemiel", 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": { "frisk": {
name: "Cacheo", name: "Cacheo",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "Cherche Miel", 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: { frisk: {
name: "Fouille", name: "Fouille",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "Mielincetta", 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: { frisk: {
name: "Indagine", name: "Indagine",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "Honey Gather", 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: { frisk: {
name: "Frisk", name: "Frisk",

View File

@ -471,7 +471,7 @@ export const ability: AbilityTranslationEntries = {
}, },
honeyGather: { honeyGather: {
name: "采蜜", name: "采蜜",
description: "战斗结束时,有时候会捡来\n甜甜蜜。", description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.",
}, },
frisk: { frisk: {
name: "察觉", name: "察觉",

View File

@ -418,7 +418,7 @@ export const ability: AbilityTranslationEntries = {
snowWarning: { name: "降雪", description: "出場時,會將天氣變爲下雪。" }, snowWarning: { name: "降雪", description: "出場時,會將天氣變爲下雪。" },
honeyGather: { honeyGather: {
name: "採蜜", name: "採蜜",
description: "戰鬥結束時,有時候會撿來\n甜甜蜜。", description: "The Pokémon gathers Honey after a battle. The Honey is then sold for money.",
}, },
frisk: { frisk: {
name: "察覺", name: "察覺",

View File

@ -2301,9 +2301,6 @@ export class BattleEndPhase extends BattlePhase {
super.start(); super.start();
this.scene.currentBattle.addBattleScore(this.scene); this.scene.currentBattle.addBattleScore(this.scene);
if (this.scene.currentBattle.moneyScattered) {
this.scene.currentBattle.pickUpScatteredMoney(this.scene);
}
this.scene.gameData.gameStats.battles++; this.scene.gameData.gameStats.battles++;
if (this.scene.currentBattle.trainer) { if (this.scene.currentBattle.trainer) {
@ -2323,6 +2320,10 @@ export class BattleEndPhase extends BattlePhase {
applyPostBattleAbAttrs(PostBattleAbAttr, pokemon); applyPostBattleAbAttrs(PostBattleAbAttr, pokemon);
} }
if (this.scene.currentBattle.moneyScattered) {
this.scene.currentBattle.pickUpScatteredMoney(this.scene);
}
this.scene.clearEnemyHeldItemModifiers(); this.scene.clearEnemyHeldItemModifiers();
const lapsingModifiers = this.scene.findModifiers(m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier) as (LapsingPersistentModifier | LapsingPokemonHeldItemModifier)[]; const lapsingModifiers = this.scene.findModifiers(m => m instanceof LapsingPersistentModifier || m instanceof LapsingPokemonHeldItemModifier) as (LapsingPersistentModifier | LapsingPokemonHeldItemModifier)[];