mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
Fixed a few outstanding issues with documentation
This commit is contained in:
parent
f44aa80a4b
commit
33c7971b91
@ -1 +1 @@
|
|||||||
Subproject commit e98f0eb9c2022bc78b53f0444424c636498e725a
|
Subproject commit 833dc40ec7409031fcea147ccbc45ec9c0ba0213
|
@ -7,6 +7,7 @@ import type { Nature } from "#enums/nature";
|
|||||||
* Includes abilities, nature, changed types, etc.
|
* Includes abilities, nature, changed types, etc.
|
||||||
*/
|
*/
|
||||||
export class CustomPokemonData {
|
export class CustomPokemonData {
|
||||||
|
/** The scale at which to render this Pokemon's sprite. */
|
||||||
public spriteScale = 1;
|
public spriteScale = 1;
|
||||||
public ability: Abilities | -1;
|
public ability: Abilities | -1;
|
||||||
public passive: Abilities | -1;
|
public passive: Abilities | -1;
|
||||||
|
@ -8003,13 +8003,18 @@ export class MoveCondition {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Condition to allow a move's use only on the first turn this Pokemon is sent into battle
|
||||||
|
* (or the start of a new wave, whichever comes first).
|
||||||
|
*/
|
||||||
|
|
||||||
export class FirstMoveCondition extends MoveCondition {
|
export class FirstMoveCondition extends MoveCondition {
|
||||||
constructor() {
|
constructor() {
|
||||||
super((user, target, move) => user.summonData.waveTurnCount === 1);
|
super((user, _target, _move) => user.summonData.waveTurnCount === 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
getUserBenefitScore(user: Pokemon, _target: Pokemon, _move: Move): number {
|
||||||
return this.apply(user, target, move) ? 10 : -20;
|
return this.apply(user, _target, _move) ? 10 : -20;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7791,7 +7791,6 @@ export class PokemonSummonData {
|
|||||||
constructor(source?: PokemonSummonData | Partial<PokemonSummonData>) {
|
constructor(source?: PokemonSummonData | Partial<PokemonSummonData>) {
|
||||||
if (!isNullOrUndefined(source)) {
|
if (!isNullOrUndefined(source)) {
|
||||||
Object.assign(this, source)
|
Object.assign(this, source)
|
||||||
this.moveset &&= this.moveset.map(m => PokemonMove.loadMove(m))
|
|
||||||
this.tags &&= this.tags.map(t => loadBattlerTag(t))
|
this.tags &&= this.tags.map(t => loadBattlerTag(t))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,16 +36,18 @@ export class BerryPhase extends FieldPhase {
|
|||||||
* @param pokemon - The {@linkcode Pokemon} to check
|
* @param pokemon - The {@linkcode Pokemon} to check
|
||||||
*/
|
*/
|
||||||
eatBerries(pokemon: Pokemon): void {
|
eatBerries(pokemon: Pokemon): void {
|
||||||
const hasUsableBerry = !!globalScene.findModifier(m => {
|
const hasUsableBerry = !!globalScene.findModifier(
|
||||||
return m instanceof BerryModifier && m.shouldApply(pokemon);
|
m => m instanceof BerryModifier && m.shouldApply(pokemon),
|
||||||
}, pokemon.isPlayer());
|
pokemon.isPlayer(),
|
||||||
|
);
|
||||||
|
|
||||||
if (!hasUsableBerry) {
|
if (!hasUsableBerry) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: If both opponents on field have unnerve, which one displays its message?
|
||||||
const cancelled = new BooleanHolder(false);
|
const cancelled = new BooleanHolder(false);
|
||||||
pokemon.getOpponents().map(opp => applyAbAttrs(PreventBerryUseAbAttr, opp, cancelled));
|
pokemon.getOpponents().forEach(opp => applyAbAttrs(PreventBerryUseAbAttr, opp, cancelled));
|
||||||
if (cancelled.value) {
|
if (cancelled.value) {
|
||||||
globalScene.queueMessage(
|
globalScene.queueMessage(
|
||||||
i18next.t("abilityTriggers:preventBerryUse", {
|
i18next.t("abilityTriggers:preventBerryUse", {
|
||||||
@ -60,11 +62,11 @@ export class BerryPhase extends FieldPhase {
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const berryModifier of globalScene.applyModifiers(BerryModifier, pokemon.isPlayer(), pokemon)) {
|
for (const berryModifier of globalScene.applyModifiers(BerryModifier, pokemon.isPlayer(), pokemon)) {
|
||||||
|
// No need to track berries being eaten; already done inside applyModifiers
|
||||||
if (berryModifier.consumed) {
|
if (berryModifier.consumed) {
|
||||||
berryModifier.consumed = false;
|
berryModifier.consumed = false;
|
||||||
pokemon.loseHeldItem(berryModifier);
|
pokemon.loseHeldItem(berryModifier);
|
||||||
}
|
}
|
||||||
// No need to track berries being eaten; already done inside applyModifiers
|
|
||||||
globalScene.eventTarget.dispatchEvent(new BerryUsedEvent(berryModifier));
|
globalScene.eventTarget.dispatchEvent(new BerryUsedEvent(berryModifier));
|
||||||
}
|
}
|
||||||
globalScene.updateModifiers(pokemon.isPlayer());
|
globalScene.updateModifiers(pokemon.isPlayer());
|
||||||
|
@ -241,7 +241,7 @@ export class SwitchSummonPhase extends SummonPhase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need (or particular use) resetting turn data here on initial send in
|
// Reset turn data if not initial switch (since it gets initialized to an empty object by default)
|
||||||
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
|
if (this.switchType !== SwitchType.INITIAL_SWITCH) {
|
||||||
pokemon.resetTurnData();
|
pokemon.resetTurnData();
|
||||||
pokemon.turnData.switchedInThisTurn = true;
|
pokemon.turnData.switchedInThisTurn = true;
|
||||||
|
@ -21,11 +21,11 @@ const migratePartyData: SessionSaveMigrator = {
|
|||||||
pkmnData.status.sleepTurnsRemaining,
|
pkmnData.status.sleepTurnsRemaining,
|
||||||
);
|
);
|
||||||
// remove empty moves from moveset
|
// remove empty moves from moveset
|
||||||
pkmnData.moveset = (pkmnData.moveset ?? [new PokemonMove(Moves.TACKLE), new PokemonMove(Moves.GROWL)]).filter(
|
pkmnData.moveset = (pkmnData.moveset ?? [new PokemonMove(Moves.TACKLE), new PokemonMove(Moves.GROWL)])
|
||||||
m => !!m,
|
.filter(m => !!m)
|
||||||
);
|
.map(m => PokemonMove.loadMove(m));
|
||||||
// only edit summondata moveset if exists
|
// only edit summondata moveset if exists
|
||||||
pkmnData.summonData.moveset &&= pkmnData.summonData.moveset.filter(m => !!m);
|
pkmnData.summonData.moveset &&= pkmnData.summonData.moveset.filter(m => !!m).map(m => PokemonMove.loadMove(m));
|
||||||
|
|
||||||
if (pkmnData.customPokemonData) {
|
if (pkmnData.customPokemonData) {
|
||||||
// revert all "-1" sprite scales to a minimum value of 1
|
// revert all "-1" sprite scales to a minimum value of 1
|
||||||
|
Loading…
Reference in New Issue
Block a user