-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Move] Fully Implement Uproar #699
Draft
innerthunder
wants to merge
9
commits into
beta
Choose a base branch
from
move/uproar
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f895d15
Fully Implement Uproar
innerthunder 3812132
Another FRENZY replaced
innerthunder c89b9f4
Add Uproar's tag to benefit score func
innerthunder cb1166e
Merge branch 'beta' into move/uproar
innerthunder 8d443e3
Update locales
innerthunder d84f535
Fix status effect checks + test for PP used
innerthunder be8c629
Merge branch 'beta' into move/uproar
innerthunder b933e00
Merge branch 'beta' into move/uproar
innerthunder 5e978f3
Fix uproar tests
innerthunder File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,5 @@ export enum BattlerTagType { | |
SKY_DROP, | ||
CRIT_BOOST_STACKABLE, | ||
RAGE, | ||
UPROAR, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
import { Abilities } from "#enums/abilities"; | ||
import { BattlerIndex } from "#enums/battler-index"; | ||
import { BattlerTagType } from "#enums/battler-tag-type"; | ||
import { MoveId } from "#enums/move-id"; | ||
import { MoveResult } from "#enums/move-result"; | ||
import { Species } from "#enums/species"; | ||
import { StatusEffect } from "#enums/status-effect"; | ||
import { GameManager } from "#test/testUtils/gameManager"; | ||
import Phaser from "phaser"; | ||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest"; | ||
|
||
describe("Moves - Uproar", () => { | ||
let phaserGame: Phaser.Game; | ||
let game: GameManager; | ||
|
||
beforeAll(() => { | ||
phaserGame = new Phaser.Game({ | ||
type: Phaser.HEADLESS, | ||
}); | ||
}); | ||
|
||
afterEach(() => { | ||
game.phaseInterceptor.restoreOg(); | ||
}); | ||
|
||
beforeEach(() => { | ||
game = new GameManager(phaserGame); | ||
game.override | ||
.ability(Abilities.BALL_FETCH) | ||
.battleType("single") | ||
.disableCrits() | ||
.enemySpecies(Species.BLISSEY) | ||
.enemyAbility(Abilities.BALL_FETCH) | ||
.enemyMoveset(MoveId.SPLASH) | ||
.startingLevel(100) | ||
.enemyLevel(100); | ||
}); | ||
|
||
it("should lock the user into using Uproar for the following 2 turns", async () => { | ||
await game.classicMode.startBattle([Species.FEEBAS]); | ||
|
||
const player = game.field.getPlayerPokemon(); | ||
|
||
game.move.use(MoveId.UPROAR); | ||
await game.toNextTurn(); | ||
|
||
expect(player.getTag(BattlerTagType.UPROAR)?.turnCount).toBe(2); | ||
expect(player.getMoveQueue()[0]).toMatchObject({ | ||
move: expect.objectContaining({ id: MoveId.UPROAR }), | ||
ignorePP: true, | ||
innerthunder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}); | ||
|
||
const playerUproar = player.getMoveset().find((mv) => mv.moveId === MoveId.UPROAR); | ||
expect(playerUproar?.ppUsed).toBe(1); | ||
|
||
await game.toNextTurn(); | ||
await game.toNextTurn(); | ||
|
||
expect(player.getTag(BattlerTagType.UPROAR)).toBeUndefined(); | ||
expect(player.getMoveQueue()).toHaveLength(0); | ||
expect(playerUproar?.ppUsed).toBe(1); | ||
}); | ||
|
||
it("should stop execution after using Uproar has no effect", async () => { | ||
await game.classicMode.startBattle([Species.FEEBAS]); | ||
|
||
const player = game.field.getPlayerPokemon(); | ||
|
||
game.move.use(MoveId.UPROAR); | ||
await game.toNextTurn(); | ||
|
||
expect(player.getTag(BattlerTagType.UPROAR)?.turnCount).toBe(2); | ||
expect(player.getMoveQueue()[0]).toMatchObject({ | ||
move: expect.objectContaining({ id: MoveId.UPROAR }), | ||
ignorePP: true, | ||
}); | ||
|
||
game.override.enemyAbility(Abilities.SOUNDPROOF); | ||
|
||
await game.toNextTurn(); | ||
expect(player.getTag(BattlerTagType.UPROAR)).toBeUndefined(); | ||
expect(player.getMoveQueue()).toHaveLength(0); | ||
}); | ||
|
||
it("should wake up all active Pokemon on its initial use", async () => { | ||
game.override.enemyStatusEffect(StatusEffect.SLEEP).battleType("double"); | ||
|
||
await game.classicMode.startBattle([Species.FEEBAS]); | ||
|
||
const enemyPokemon = game.scene.getEnemyField(); | ||
|
||
game.move.use(MoveId.UPROAR, 0); | ||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.ENEMY_2]); | ||
|
||
await game.phaseInterceptor.to("MoveEndPhase"); | ||
enemyPokemon.forEach((p) => expect(p.getStatusEffect()).toBe(StatusEffect.NONE)); | ||
}); | ||
|
||
it("should prevent active Pokemon from falling asleep during its execution", async () => { | ||
game.override.battleType("double"); | ||
await game.classicMode.startBattle([Species.FEEBAS, Species.MAGIKARP]); | ||
|
||
const enemyPokemon = game.scene.getEnemyField(); | ||
|
||
game.move.use(MoveId.UPROAR, 0); | ||
game.move.use(MoveId.SPORE, 1, BattlerIndex.ENEMY_2); | ||
await game.move.forceEnemyMove(MoveId.REST); | ||
await game.move.forceEnemyMove(MoveId.SPLASH); | ||
await game.setTurnOrder([BattlerIndex.PLAYER, BattlerIndex.ENEMY, BattlerIndex.PLAYER_2, BattlerIndex.ENEMY_2]); | ||
|
||
await game.phaseInterceptor.to("BerryPhase", false); | ||
enemyPokemon.forEach((p) => expect(p.getStatusEffect()).toBe(StatusEffect.NONE)); | ||
}); | ||
|
||
it("should not have its execution interrupted by Torment", async () => { | ||
await game.classicMode.startBattle([Species.FEEBAS]); | ||
|
||
const player = game.field.getPlayerPokemon(); | ||
|
||
game.move.use(MoveId.UPROAR); | ||
await game.move.forceEnemyMove(MoveId.TORMENT); | ||
await game.setTurnOrder([BattlerIndex.ENEMY, BattlerIndex.PLAYER]); | ||
|
||
await game.toNextTurn(); | ||
|
||
expect(player.getTag(BattlerTagType.UPROAR)?.turnCount).toBe(2); | ||
expect(player.getMoveQueue()[0]).toMatchObject({ | ||
move: expect.objectContaining({ id: MoveId.UPROAR }), | ||
ignorePP: true, | ||
}); | ||
|
||
await game.toNextTurn(); | ||
await game.toNextTurn(); | ||
|
||
expect(player.getTag(BattlerTagType.UPROAR)).toBeUndefined(); | ||
expect(player.getMoveQueue()).toHaveLength(0); | ||
expect(player.getMoveHistory()).toHaveLength(3); | ||
player.getMoveHistory().forEach((turnMove) => | ||
expect(turnMove).toMatchObject({ | ||
move: expect.objectContaining({ id: MoveId.UPROAR }), | ||
result: MoveResult.SUCCESS, | ||
}), | ||
); | ||
}); | ||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this gives

pokemonNameWithAffix
but the text expects justpokemonName