mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Added documentation to RageTag, fixed open quote, and updates test
This commit is contained in:
parent
cae113c2eb
commit
fdca4359a0
@ -205,10 +205,22 @@ export class ShellTrapTag extends BattlerTag {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BattlerTag implementing Rage
|
||||||
|
* Pokémon with this tag will recieve an attack boost when successfully damaged by an attacking move
|
||||||
|
* This tag will be lost if a target reaches the MOVE_EFFECT lapse condition with a move other than Rage
|
||||||
|
* @see {@link https://bulbapedia.bulbagarden.net/wiki/Rage_(move) | Rage}
|
||||||
|
*/
|
||||||
export class RageTag extends BattlerTag {
|
export class RageTag extends BattlerTag {
|
||||||
constructor() {
|
constructor() {
|
||||||
super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE);
|
super(BattlerTagType.RAGE,[BattlerTagLapseType.MOVE_EFFECT],1,Moves.RAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays a message to show that the user has started Raging.
|
||||||
|
* This is message isn't displayed on cartridge, and was included for clarity during gameplay and while testing.
|
||||||
|
* @param pokemon {@linkcode Pokemon} the Pokémon this tag is being added to.
|
||||||
|
*/
|
||||||
onAdd(pokemon: Pokemon) {
|
onAdd(pokemon: Pokemon) {
|
||||||
super.onAdd(pokemon);
|
super.onAdd(pokemon);
|
||||||
/* This message might not exist on cartridge */
|
/* This message might not exist on cartridge */
|
||||||
@ -216,6 +228,13 @@ export class RageTag extends BattlerTag {
|
|||||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)}));
|
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon)}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to maintain a Pokémon should maintain their rage, and provides an attack boost when hit.
|
||||||
|
* @param pokemon {@linkcode Pokemon} The owner of this tag
|
||||||
|
* @param lapseType {@linkcode BattlerTagLapseType} the type of functionality invoked in battle
|
||||||
|
* @returns `true` if invoked with the MOVE_EFFECT lapse type and {@linkcode pokemon} most recently used Rage,
|
||||||
|
* or if invoked with the CUSTOM lapse type. false otherwise.
|
||||||
|
*/
|
||||||
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
if (lapseType === BattlerTagLapseType.MOVE_EFFECT) {
|
if (lapseType === BattlerTagLapseType.MOVE_EFFECT) {
|
||||||
return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE;
|
return (pokemon.scene.getCurrentPhase() as MovePhase).move.getMove().id === Moves.RAGE;
|
||||||
|
@ -68,7 +68,7 @@ export const battlerTags: SimpleTranslationEntries = {
|
|||||||
"saltCuredOnAdd": "{{pokemonNameWithAffix}} wurde eingepökelt!",
|
"saltCuredOnAdd": "{{pokemonNameWithAffix}} wurde eingepökelt!",
|
||||||
"saltCuredLapse": "{{pokemonNameWithAffix}} wurde durch {{moveName}} verletzt!",
|
"saltCuredLapse": "{{pokemonNameWithAffix}} wurde durch {{moveName}} verletzt!",
|
||||||
"cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!",
|
"cursedOnAdd": "{{pokemonNameWithAffix}} nimmt einen Teil seiner KP und legt einen Fluch auf {{pokemonName}}!",
|
||||||
"stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!"",
|
"stockpilingOnAdd": "{{pokemonNameWithAffix}} hortet {{stockpiledCount}}!",
|
||||||
"rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.",
|
"rageOnAdd": "{{pokemonNameWithAffix}}'s rage is starting to build.",
|
||||||
"rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.",
|
"rageOnHit": "{{pokemonNameWithAffix}}'s rage is building.",
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -9,9 +9,7 @@ import {StatusEffect} from "#enums/status-effect";
|
|||||||
import {RageTag} from "#app/data/battler-tags";
|
import {RageTag} from "#app/data/battler-tags";
|
||||||
import {PlayerPokemon} from "#app/field/pokemon";
|
import {PlayerPokemon} from "#app/field/pokemon";
|
||||||
import {Nature} from "#enums/nature";
|
import {Nature} from "#enums/nature";
|
||||||
import {getMovePosition} from "#test/utils/gameManagerUtils";
|
|
||||||
import {CommandPhase} from "#app/phases/command-phase";
|
import {CommandPhase} from "#app/phases/command-phase";
|
||||||
import {SelectTargetPhase} from "#app/phases/select-target-phase";
|
|
||||||
import {BattlerIndex} from "#app/battle";
|
import {BattlerIndex} from "#app/battle";
|
||||||
import {TurnEndPhase} from "#app/phases/turn-end-phase";
|
import {TurnEndPhase} from "#app/phases/turn-end-phase";
|
||||||
|
|
||||||
@ -42,7 +40,6 @@ describe("Moves - Rage", () => {
|
|||||||
.ability(Abilities.UNNERVE)
|
.ability(Abilities.UNNERVE)
|
||||||
.starterSpecies(Species.BOLTUND)
|
.starterSpecies(Species.BOLTUND)
|
||||||
.moveset([Moves.RAGE, Moves.SPLASH, Moves.SPORE, Moves.VITAL_THROW])
|
.moveset([Moves.RAGE, Moves.SPLASH, Moves.SPORE, Moves.VITAL_THROW])
|
||||||
.enemyAbility(Abilities.NO_GUARD)
|
|
||||||
.startingLevel(100)
|
.startingLevel(100)
|
||||||
.enemyLevel(100)
|
.enemyLevel(100)
|
||||||
.disableCrits();
|
.disableCrits();
|
||||||
@ -70,19 +67,19 @@ describe("Moves - Rage", () => {
|
|||||||
|
|
||||||
// Player Boltund uses Rage. Opponent Shuckle uses Tackle.
|
// Player Boltund uses Rage. Opponent Shuckle uses Tackle.
|
||||||
// Boltund's attack is raised.
|
// Boltund's attack is raised.
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
||||||
|
|
||||||
// Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority).
|
// Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority).
|
||||||
// Boltund's attack is raised.
|
// Boltund's attack is raised.
|
||||||
game.doAttack(3);
|
game.move.select(Moves.VITAL_THROW);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
||||||
|
|
||||||
// Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority).
|
// Opponent Shuckle uses Tackle. Player Boltund uses Vital Throw (Negative Priority).
|
||||||
// Boltund's attack not raised.
|
// Boltund's attack not raised.
|
||||||
game.doAttack(3);
|
game.move.select(Moves.VITAL_THROW);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
||||||
|
|
||||||
@ -107,14 +104,14 @@ describe("Moves - Rage", () => {
|
|||||||
|
|
||||||
// Opponent Shuckle uses Rage. Ally Boltund uses Vital Throw.
|
// Opponent Shuckle uses Rage. Ally Boltund uses Vital Throw.
|
||||||
// Shuckle gets an Attack boost
|
// Shuckle gets an Attack boost
|
||||||
game.doAttack(3);
|
game.move.select(Moves.VITAL_THROW);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
||||||
|
|
||||||
// Ally Boltund uses Spore. Shuckle is asleep.
|
// Ally Boltund uses Spore. Shuckle is asleep.
|
||||||
// Shuckle does not get an attack boost. Shuckle still has the RageTag tag.
|
// Shuckle does not get an attack boost. Shuckle still has the RageTag tag.
|
||||||
game.doAttack(2);
|
game.move.select(Moves.SPORE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
expect(oppPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
||||||
@ -137,7 +134,7 @@ describe("Moves - Rage", () => {
|
|||||||
|
|
||||||
// Boltund uses rage, but it has no effect, Gastly uses Tackle
|
// Boltund uses rage, but it has no effect, Gastly uses Tackle
|
||||||
// Boltund does not have RageTag or Attack boost.
|
// Boltund does not have RageTag or Attack boost.
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(leadPokemon.getTag(RageTag)).toBeNull;
|
expect(leadPokemon.getTag(RageTag)).toBeNull;
|
||||||
@ -153,21 +150,21 @@ describe("Moves - Rage", () => {
|
|||||||
async () => {
|
async () => {
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.REGIELEKI)
|
.enemySpecies(Species.REGIELEKI)
|
||||||
.enemyMoveset(fullOf(Moves.DIVE)); // Has semi-invulnerable turn
|
.enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
// Regieliki uses Dive. Boltund uses Rage, but Regieleki is underwater
|
// Regieliki uses Fly. Boltund uses Rage, but Regieleki is invulnerable
|
||||||
// Boltund does not gain RageTag or Attack boost
|
// Boltund does not gain RageTag or Attack boost
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(leadPokemon.getTag(RageTag)).toBeNull;
|
expect(leadPokemon.getTag(RageTag)).toBeNull;
|
||||||
|
|
||||||
// Regieleki finishes Dive, Boltund uses Rage
|
// Regieleki finishes Fly, Boltund uses Rage
|
||||||
// Boltund gains RageTag, but no boost
|
// Boltund gains RageTag, but no boost
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
||||||
@ -179,21 +176,21 @@ describe("Moves - Rage", () => {
|
|||||||
async () => {
|
async () => {
|
||||||
game.override
|
game.override
|
||||||
.enemySpecies(Species.SHUCKLE)
|
.enemySpecies(Species.SHUCKLE)
|
||||||
.enemyMoveset(fullOf(Moves.FLY)); // Has semi-invulnerable turn
|
.enemyMoveset(fullOf(Moves.PHANTOM_FORCE)); // Has semi-invulnerable turn
|
||||||
await game.startBattle();
|
await game.startBattle();
|
||||||
|
|
||||||
const leadPokemon = game.scene.getPlayerPokemon()!;
|
const leadPokemon = game.scene.getPlayerPokemon()!;
|
||||||
|
|
||||||
// Boltund uses Rage, Shuckle uses Dive
|
// Boltund uses Rage, Shuckle uses Fly
|
||||||
// Boltund gains RageTag
|
// Boltund gains RageTag
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
||||||
|
|
||||||
// Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive
|
// Boltund uses Rage, Shuckle is underwater, Shuckle finishes Dive
|
||||||
// Boltund gains gains boost, does not lose RageTag
|
// Boltund gains gains boost, does not lose RageTag
|
||||||
game.doAttack(0);
|
game.move.select(Moves.RAGE);
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(1);
|
||||||
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
expect(leadPokemon.getTag(RageTag)).toBeTruthy;
|
||||||
@ -217,14 +214,11 @@ describe("Moves - Rage", () => {
|
|||||||
|
|
||||||
const leadPokemon = game.scene.getParty()[0];
|
const leadPokemon = game.scene.getParty()[0];
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE));
|
game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY);
|
||||||
await game.phaseInterceptor.to(SelectTargetPhase, false);
|
|
||||||
game.doSelectTarget(BattlerIndex.ENEMY);
|
|
||||||
await game.phaseInterceptor.to(CommandPhase);
|
await game.phaseInterceptor.to(CommandPhase);
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 1, Moves.MEMENTO));
|
game.move.select(Moves.MEMENTO,1,BattlerIndex.ENEMY_2);
|
||||||
await game.phaseInterceptor.to(SelectTargetPhase, false);
|
|
||||||
game.doSelectTarget(BattlerIndex.ENEMY_2);
|
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase, false);
|
await game.phaseInterceptor.to(TurnEndPhase, false);
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(2);
|
||||||
@ -251,14 +245,10 @@ describe("Moves - Rage", () => {
|
|||||||
leadPokemon.natureOverride = Nature.SASSY;
|
leadPokemon.natureOverride = Nature.SASSY;
|
||||||
game.scene.getParty()[1].natureOverride = Nature.JOLLY;
|
game.scene.getParty()[1].natureOverride = Nature.JOLLY;
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 0, Moves.RAGE));
|
game.move.select(Moves.RAGE,1,BattlerIndex.ENEMY);
|
||||||
await game.phaseInterceptor.to(SelectTargetPhase, false);
|
|
||||||
game.doSelectTarget(BattlerIndex.ENEMY);
|
|
||||||
await game.phaseInterceptor.to(CommandPhase);
|
await game.phaseInterceptor.to(CommandPhase);
|
||||||
|
|
||||||
game.doAttack(getMovePosition(game.scene, 1, Moves.SPORE));
|
game.move.select(Moves.SPORE,1,BattlerIndex.PLAYER);
|
||||||
await game.phaseInterceptor.to(SelectTargetPhase, false);
|
|
||||||
game.doSelectTarget(BattlerIndex.PLAYER);
|
|
||||||
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase, false);
|
await game.phaseInterceptor.to(TurnEndPhase, false);
|
||||||
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
expect(leadPokemon.summonData.battleStats[BattleStat.ATK]).toBe(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user