mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
[Bug] Sheer Force no longer boosts Fickle Beam; Focus Energy gives +2 crit instead of +1 (#6331)
[Bug] Sheer Force no longer boosts Fickle Beam; Focus Energy correctly gives +2 crit stages instead of +1
This commit is contained in:
parent
9c498003aa
commit
978f06427c
@ -2331,10 +2331,10 @@ export class CritBoostTag extends SerializableBattlerTag {
|
|||||||
super.onAdd(pokemon);
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
// Dragon cheer adds +2 crit stages if the pokemon is a Dragon type when the tag is added
|
// 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)) {
|
if (this.tagType === BattlerTagType.DRAGON_CHEER && !pokemon.getTypes(true, true).includes(PokemonType.DRAGON)) {
|
||||||
(this as Mutable<this>).critStages = 2;
|
|
||||||
} else {
|
|
||||||
(this as Mutable<this>).critStages = 1;
|
(this as Mutable<this>).critStages = 1;
|
||||||
|
} else {
|
||||||
|
(this as Mutable<this>).critStages = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.phaseManager.queueMessage(
|
globalScene.phaseManager.queueMessage(
|
||||||
|
@ -4004,22 +4004,36 @@ export class BeatUpAttr extends VariablePowerAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const doublePowerChanceMessageFunc = (user: Pokemon, target: Pokemon, move: Move) => {
|
/**
|
||||||
|
* 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 = "";
|
let message: string = "";
|
||||||
globalScene.executeWithSeedOffset(() => {
|
globalScene.executeWithSeedOffset(() => {
|
||||||
const rand = randSeedInt(100);
|
const rand = randSeedInt(100);
|
||||||
if (rand < move.chance) {
|
if (rand < chance) {
|
||||||
message = i18next.t("moveTriggers:goingAllOutForAttack", { pokemonName: getPokemonNameWithAffix(user) });
|
message = i18next.t("moveTriggers:goingAllOutForAttack", { pokemonName: getPokemonNameWithAffix(user) });
|
||||||
}
|
}
|
||||||
}, globalScene.currentBattle.turn << 6, globalScene.waveSeed);
|
}, globalScene.currentBattle.turn << 6, globalScene.waveSeed);
|
||||||
return message;
|
return message;
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export class DoublePowerChanceAttr extends VariablePowerAttr {
|
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 {
|
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);
|
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;
|
const power = args[0] as NumberHolder;
|
||||||
power.value *= 2;
|
power.value *= 2;
|
||||||
return true;
|
return true;
|
||||||
@ -11557,10 +11571,9 @@ export function initMoves() {
|
|||||||
.attr(TeraStarstormTypeAttr)
|
.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)
|
.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} */
|
.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)
|
new AttackMove(MoveId.FICKLE_BEAM, PokemonType.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, -1, 0, 9)
|
||||||
.attr(PreMoveMessageAttr, doublePowerChanceMessageFunc)
|
.attr(PreMoveMessageAttr, doublePowerChanceMessageFunc(30))
|
||||||
.attr(DoublePowerChanceAttr)
|
.attr(DoublePowerChanceAttr, 30),
|
||||||
.edgeCase(), // Should not interact with Sheer Force
|
|
||||||
new SelfStatusMove(MoveId.BURNING_BULWARK, PokemonType.FIRE, -1, 10, -1, 4, 9)
|
new SelfStatusMove(MoveId.BURNING_BULWARK, PokemonType.FIRE, -1, 10, -1, 4, 9)
|
||||||
.attr(ProtectAttr, BattlerTagType.BURNING_BULWARK)
|
.attr(ProtectAttr, BattlerTagType.BURNING_BULWARK)
|
||||||
.condition(failIfLastCondition),
|
.condition(failIfLastCondition),
|
||||||
|
Loading…
Reference in New Issue
Block a user