mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-16 04:19:32 +02:00
Fixed bg
This commit is contained in:
parent
da5c0d2ca8
commit
cf5c6ae58d
@ -164,7 +164,7 @@ export class BattlerTag implements BaseBattlerTag {
|
|||||||
* Unused by default but can be used by subclasses.
|
* Unused by default but can be used by subclasses.
|
||||||
* @param _lapseType - The {@linkcode BattlerTagLapseType} being lapsed.
|
* @param _lapseType - The {@linkcode BattlerTagLapseType} being lapsed.
|
||||||
* Unused by default but can be used by subclasses.
|
* Unused by default but can be used by subclasses.
|
||||||
* @returns `true` if the tag should be kept (`turnCount` > 0`)
|
* @returns `true` if the tag should be kept (`turnCount > 0`)
|
||||||
*/
|
*/
|
||||||
lapse(_pokemon: Pokemon, _lapseType: BattlerTagLapseType): boolean {
|
lapse(_pokemon: Pokemon, _lapseType: BattlerTagLapseType): boolean {
|
||||||
return --this.turnCount > 0;
|
return --this.turnCount > 0;
|
||||||
@ -820,9 +820,7 @@ export class ConfusedTag extends SerializableBattlerTag {
|
|||||||
* @returns Whether the tag should be kept.
|
* @returns Whether the tag should be kept.
|
||||||
*/
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
const shouldRemain = super.lapse(pokemon, lapseType);
|
if (!super.lapse(pokemon, lapseType)) {
|
||||||
|
|
||||||
if (!shouldRemain) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -838,7 +836,6 @@ export class ConfusedTag extends SerializableBattlerTag {
|
|||||||
// 1/3 chance of hitting self with a 40 base power move
|
// 1/3 chance of hitting self with a 40 base power move
|
||||||
const shouldInterruptMove = Overrides.CONFUSION_ACTIVATION_OVERRIDE ?? pokemon.randBattleSeedInt(3) === 0;
|
const shouldInterruptMove = Overrides.CONFUSION_ACTIVATION_OVERRIDE ?? pokemon.randBattleSeedInt(3) === 0;
|
||||||
if (shouldInterruptMove) {
|
if (shouldInterruptMove) {
|
||||||
// TODO: Are these calculations correct? We probably shouldn't hardcode the damage formula here...
|
|
||||||
const atk = pokemon.getEffectiveStat(Stat.ATK);
|
const atk = pokemon.getEffectiveStat(Stat.ATK);
|
||||||
const def = pokemon.getEffectiveStat(Stat.DEF);
|
const def = pokemon.getEffectiveStat(Stat.DEF);
|
||||||
const damage = toDmgValue(
|
const damage = toDmgValue(
|
||||||
|
@ -827,8 +827,8 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
const isOneHitKo = result === HitResult.ONE_HIT_KO;
|
const isOneHitKo = result === HitResult.ONE_HIT_KO;
|
||||||
target.lapseTags(BattlerTagLapseType.HIT);
|
target.lapseTags(BattlerTagLapseType.HIT);
|
||||||
|
|
||||||
const substituteTag = target.getTag(SubstituteTag);
|
const substitute = target.getTag(SubstituteTag);
|
||||||
const isBlockedBySubstitute = substituteTag && this.move.hitsSubstitute(user, target);
|
const isBlockedBySubstitute = !!substitute && this.move.hitsSubstitute(user, target);
|
||||||
if (isBlockedBySubstitute) {
|
if (isBlockedBySubstitute) {
|
||||||
user.turnData.lastMoveDamageDealt[target.getBattlerIndex()] += Math.min(dmg, substitute.hp);
|
user.turnData.lastMoveDamageDealt[target.getBattlerIndex()] += Math.min(dmg, substitute.hp);
|
||||||
substitute.hp -= dmg;
|
substitute.hp -= dmg;
|
||||||
|
@ -112,7 +112,7 @@ describe("Moves - Switching Moves", () => {
|
|||||||
expect(game.scene.currentBattle.trainer).not.toBeNull();
|
expect(game.scene.currentBattle.trainer).not.toBeNull();
|
||||||
const choiceSwitchSpy = vi.spyOn(game.scene.currentBattle.trainer!, "getNextSummonIndex");
|
const choiceSwitchSpy = vi.spyOn(game.scene.currentBattle.trainer!, "getNextSummonIndex");
|
||||||
|
|
||||||
// Grab each trainer's pokemon based on species name
|
// Grab each trainer's pokemon based on trainer slot
|
||||||
const [tateParty, lizaParty] = splitArray(
|
const [tateParty, lizaParty] = splitArray(
|
||||||
game.scene.getEnemyParty(),
|
game.scene.getEnemyParty(),
|
||||||
pkmn => pkmn.trainerSlot === TrainerSlot.TRAINER,
|
pkmn => pkmn.trainerSlot === TrainerSlot.TRAINER,
|
||||||
@ -293,7 +293,7 @@ describe("Moves - Switching Moves", () => {
|
|||||||
const player = game.field.getPlayerPokemon();
|
const player = game.field.getPlayerPokemon();
|
||||||
expect(player).toBe(raichu);
|
expect(player).toBe(raichu);
|
||||||
expect(player).not.toHaveFullHp();
|
expect(player).not.toHaveFullHp();
|
||||||
expect(game.field.getEnemyPokemon().waveData.abilityRevealed).toBe(true); // proxy for asserting ability activated
|
expect(game.field.getEnemyPokemon()).toHaveAbilityApplied(AbilityId.ROUGH_SKIN);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user