diff --git a/src/data/battler-tags.ts b/src/data/battler-tags.ts index 90f0cedbbb8..104eca0e407 100644 --- a/src/data/battler-tags.ts +++ b/src/data/battler-tags.ts @@ -2331,10 +2331,10 @@ export class CritBoostTag extends SerializableBattlerTag { super.onAdd(pokemon); // Dragon cheer adds +2 crit stages if the pokemon is a Dragon type when the tag is added - if (this.tagType === BattlerTagType.DRAGON_CHEER && pokemon.getTypes(true).includes(PokemonType.DRAGON)) { - (this as Mutable).critStages = 2; - } else { + if (this.tagType === BattlerTagType.DRAGON_CHEER && !pokemon.getTypes(true, true).includes(PokemonType.DRAGON)) { (this as Mutable).critStages = 1; + } else { + (this as Mutable).critStages = 2; } globalScene.phaseManager.queueMessage( diff --git a/src/data/moves/move.ts b/src/data/moves/move.ts index 4083bfa39b5..6f5bd946acf 100644 --- a/src/data/moves/move.ts +++ b/src/data/moves/move.ts @@ -4004,22 +4004,36 @@ export class BeatUpAttr extends VariablePowerAttr { } } -const doublePowerChanceMessageFunc = (user: Pokemon, target: Pokemon, move: Move) => { - let message: string = ""; - globalScene.executeWithSeedOffset(() => { - const rand = randSeedInt(100); - if (rand < move.chance) { - message = i18next.t("moveTriggers:goingAllOutForAttack", { pokemonName: getPokemonNameWithAffix(user) }); - } - }, globalScene.currentBattle.turn << 6, globalScene.waveSeed); - return message; -}; +/** + * Message function for {@linkcode MoveId.FICKLE_BEAM} that shows a message before move use if + * the move's power would be boosted. + * @todo Find another way to synchronize the RNG calls of Fickle Beam with its message + * than using a seed offset + */ +function doublePowerChanceMessageFunc(chance: number) { + return (user: Pokemon, target: Pokemon, move: Move) => { + let message: string = ""; + globalScene.executeWithSeedOffset(() => { + const rand = randSeedInt(100); + if (rand < chance) { + message = i18next.t("moveTriggers:goingAllOutForAttack", { pokemonName: getPokemonNameWithAffix(user) }); + } + }, globalScene.currentBattle.turn << 6, globalScene.waveSeed); + return message; + }; +} export class DoublePowerChanceAttr extends VariablePowerAttr { + private chance: number; + constructor(chance: number) { + super(false) + this.chance = chance + } + apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { - let rand: number; + let rand = 0; globalScene.executeWithSeedOffset(() => rand = randSeedInt(100), globalScene.currentBattle.turn << 6, globalScene.waveSeed); - if (rand! < move.chance) { + if (rand < this.chance) { const power = args[0] as NumberHolder; power.value *= 2; return true; @@ -11557,10 +11571,9 @@ export function initMoves() { .attr(TeraStarstormTypeAttr) .attr(VariableTargetAttr, (user, target, move) => user.hasSpecies(SpeciesId.TERAPAGOS) && (user.isTerastallized || globalScene.currentBattle.preTurnCommands[user.getFieldIndex()]?.command === Command.TERA) ? MoveTarget.ALL_NEAR_ENEMIES : MoveTarget.NEAR_OTHER) .partial(), /** Does not ignore abilities that affect stats, relevant in determining the move's category {@see TeraMoveCategoryAttr} */ - new AttackMove(MoveId.FICKLE_BEAM, PokemonType.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, 30, 0, 9) - .attr(PreMoveMessageAttr, doublePowerChanceMessageFunc) - .attr(DoublePowerChanceAttr) - .edgeCase(), // Should not interact with Sheer Force + new AttackMove(MoveId.FICKLE_BEAM, PokemonType.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, -1, 0, 9) + .attr(PreMoveMessageAttr, doublePowerChanceMessageFunc(30)) + .attr(DoublePowerChanceAttr, 30), new SelfStatusMove(MoveId.BURNING_BULWARK, PokemonType.FIRE, -1, 10, -1, 4, 9) .attr(ProtectAttr, BattlerTagType.BURNING_BULWARK) .condition(failIfLastCondition),