add shorthand for setting a moveset to all one move
This commit is contained in:
parent
c6e93985ca
commit
eb1d195866
|
@ -111,7 +111,10 @@ export class OverridesHelper extends GameManagerHelper {
|
|||
* @param moveset the {@linkcode Moves | moves}set to set
|
||||
* @returns this
|
||||
*/
|
||||
moveset(moveset: Moves[]): this {
|
||||
moveset(moveset: Moves[] | Moves): this {
|
||||
if (!Array.isArray(moveset)) {
|
||||
moveset = new Array(4).fill(moveset);
|
||||
}
|
||||
vi.spyOn(Overrides, "MOVESET_OVERRIDE", "get").mockReturnValue(moveset);
|
||||
const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", ");
|
||||
this.log(`Player Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`);
|
||||
|
@ -230,7 +233,10 @@ export class OverridesHelper extends GameManagerHelper {
|
|||
* @param moveset the {@linkcode Moves | moves}set to set
|
||||
* @returns this
|
||||
*/
|
||||
enemyMoveset(moveset: Moves[]): this {
|
||||
enemyMoveset(moveset: Moves[] | Moves): this {
|
||||
if (!Array.isArray(moveset)) {
|
||||
moveset = new Array(4).fill(moveset);
|
||||
}
|
||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(moveset);
|
||||
const movesetStr = moveset.map((moveId) => Moves[moveId]).join(", ");
|
||||
this.log(`Enemy Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`);
|
||||
|
|
Loading…
Reference in New Issue