From 6ad7fea68b63df2dc21806ea4884852092f3fc78 Mon Sep 17 00:00:00 2001 From: xsn34kzx Date: Thu, 5 Sep 2024 18:47:18 -0400 Subject: [PATCH] Change Descriptions for New Behavior --- src/locales/en/modifier-type.json | 8 +++++-- src/modifier/modifier-type.ts | 36 +++++++++++++++++++------------ src/modifier/modifier.ts | 5 ++--- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/src/locales/en/modifier-type.json b/src/locales/en/modifier-type.json index f73a3dcccae..babad57b81b 100644 --- a/src/locales/en/modifier-type.json +++ b/src/locales/en/modifier-type.json @@ -47,10 +47,14 @@ "description": "Changes a Pokémon's nature to {{natureName}} and permanently unlocks the nature for the starter." }, "DoubleBattleChanceBoosterModifierType": { - "description": "Doubles the chance of an encounter being a double battle for {{battleCount}} battles." + "description": "Quadruples the chance of an encounter being a double battle for up to {{battleCount}} battles." }, "TempStatStageBoosterModifierType": { - "description": "Increases the {{stat}} of all party members by 1 stage for 5 battles." + "description": "Increases the {{stat}} of all party members by {{amount}} for up to 5 battles.", + "extra": { + "stage": "1 stage", + "percentage": "30%" + } }, "AttackTypeBoosterModifierType": { "description": "Increases the power of a Pokémon's {{moveType}}-type moves by 20%." diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 08e19dbd887..d6cfd017829 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -434,38 +434,43 @@ export class RememberMoveModifierType extends PokemonModifierType { export class DoubleBattleChanceBoosterModifierType extends ModifierType { private maxBattles: number; - public battleCount: number; - constructor(localeKey: string, iconImage: string, maxBattles: number, battleCount?: number) { + constructor(localeKey: string, iconImage: string, maxBattles: number) { super(localeKey, iconImage, (_type, _args) => new Modifiers.DoubleBattleChanceBoosterModifier(this, maxBattles), "lure"); this.maxBattles = maxBattles; - this.battleCount = battleCount ?? this.maxBattles; } getDescription(_scene: BattleScene): string { - return i18next.t("modifierType:ModifierType.DoubleBattleChanceBoosterModifierType.description", { battleCount: this.battleCount }); + return i18next.t("modifierType:ModifierType.DoubleBattleChanceBoosterModifierType.description", { + battleCount: this.maxBattles + }); } } export class TempStatStageBoosterModifierType extends ModifierType implements GeneratedPersistentModifierType { private stat: TempBattleStat; - private key: string; + private nameKey: string; + private quantityKey: string; constructor(stat: TempBattleStat) { - const key = TempStatStageBoosterModifierTypeGenerator.items[stat]; - super("", key, (_type, _args) => new Modifiers.TempStatStageBoosterModifier(this, this.stat, 5)); + const nameKey = TempStatStageBoosterModifierTypeGenerator.items[stat]; + super("", nameKey, (_type, _args) => new Modifiers.TempStatStageBoosterModifier(this, this.stat, 5)); this.stat = stat; - this.key = key; + this.nameKey = nameKey; + this.quantityKey = (stat !== Stat.ACC) ? "percentage" : "stage"; } get name(): string { - return i18next.t(`modifierType:TempStatStageBoosterItem.${this.key}`); + return i18next.t(`modifierType:TempStatStageBoosterItem.${this.nameKey}`); } getDescription(_scene: BattleScene): string { - return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { stat: i18next.t(getStatKey(this.stat)) }); + return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { + stat: i18next.t(getStatKey(this.stat)), + amount: i18next.t(`modifierType:ModifierType.TempStatStageBoosterModifierType.extra.${this.quantityKey}`) + }); } getPregenArgs(): any[] { @@ -1350,9 +1355,9 @@ export const modifierTypes = { SUPER_REPEL: () => new DoubleBattleChanceBoosterModifierType('Super Repel', 10), MAX_REPEL: () => new DoubleBattleChanceBoosterModifierType('Max Repel', 25),*/ - LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.LURE", "lure", 5), - SUPER_LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.SUPER_LURE", "super_lure", 10), - MAX_LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.MAX_LURE", "max_lure", 25), + LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.LURE", "lure", 10), + SUPER_LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.SUPER_LURE", "super_lure", 15), + MAX_LURE: () => new DoubleBattleChanceBoosterModifierType("modifierType:ModifierType.MAX_LURE", "max_lure", 30), SPECIES_STAT_BOOSTER: () => new SpeciesStatBoosterModifierTypeGenerator(), @@ -1360,7 +1365,10 @@ export const modifierTypes = { DIRE_HIT: () => new class extends ModifierType { getDescription(_scene: BattleScene): string { - return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { stat: i18next.t("modifierType:ModifierType.DIRE_HIT.extra.raises") }); + return i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.description", { + stat: i18next.t("modifierType:ModifierType.DIRE_HIT.extra.raises"), + amount: i18next.t("modifierType:ModifierType.TempStatStageBoosterModifierType.extra.stage") + }); } }("modifierType:ModifierType.DIRE_HIT", "dire_hit", (type, _args) => new Modifiers.TempCritBoosterModifier(type, 5)), diff --git a/src/modifier/modifier.ts b/src/modifier/modifier.ts index 6a74f7fb8f0..4af12535846 100644 --- a/src/modifier/modifier.ts +++ b/src/modifier/modifier.ts @@ -396,7 +396,7 @@ export class DoubleBattleChanceBoosterModifier extends LapsingPersistentModifier const doubleBattleChance = args[0] as Utils.NumberHolder; // This is divided because the chance is generated as a number from 0 to doubleBattleChance.value using Utils.randSeedInt // A double battle will initiate if the generated number is 0 - doubleBattleChance.value = Math.ceil(doubleBattleChance.value / 2); + doubleBattleChance.value = Math.ceil(doubleBattleChance.value / 4); return true; } @@ -419,10 +419,9 @@ export class TempStatStageBoosterModifier extends LapsingPersistentModifier { this.stat = stat; // Note that, because we want X Accuracy to maintain its original behavior, // it will increment as it did previously, directly to the stat stage. - this.multiplierBoost = stat !== Stat.ACC ? 0.3 : 1; + this.multiplierBoost = (stat !== Stat.ACC) ? 0.3 : 1; } - match(modifier: Modifier): boolean { if (modifier instanceof TempStatStageBoosterModifier) { const modifierInstance = modifier as TempStatStageBoosterModifier;