mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 10:42:25 +02:00
Cleanup species inclusivity check
This commit is contained in:
parent
9fdcf31c0b
commit
aee3dd8b24
@ -4644,30 +4644,6 @@ export class VariableMoveTypeAttr extends MoveAttr {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Attribute used for Tera Starstorm that changes the move type to Stellar
|
||||
* @extends VariableMoveTypeAttr
|
||||
*/
|
||||
export class TeraStarstormTypeAttr extends VariableMoveTypeAttr {
|
||||
/**
|
||||
*
|
||||
* @param user the {@linkcode Pokemon} using the move
|
||||
* @param target n/a
|
||||
* @param move n/a
|
||||
* @param args[0] {@linkcode Utils.NumberHolder} the move type
|
||||
* @returns `true` if the move type is changed to {@linkcode Type.STELLAR}, `false` otherwise
|
||||
*/
|
||||
override apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
if (user.isTerastallized && (user.hasFusionSpecies(Species.TERAPAGOS) || user.species.speciesId === Species.TERAPAGOS)) {
|
||||
const moveType = args[0] as Utils.NumberHolder;
|
||||
|
||||
moveType.value = Type.STELLAR;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export class FormChangeItemTypeAttr extends VariableMoveTypeAttr {
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const moveType = args[0];
|
||||
@ -11102,8 +11078,7 @@ export function initMoves() {
|
||||
.chargeAttr(WeatherInstantChargeAttr, [ WeatherType.RAIN, WeatherType.HEAVY_RAIN ]),
|
||||
new AttackMove(Moves.TERA_STARSTORM, Type.NORMAL, MoveCategory.SPECIAL, 120, 100, 5, -1, 0, 9)
|
||||
.attr(TeraMoveCategoryAttr)
|
||||
.attr(TeraStarstormTypeAttr)
|
||||
.attr(VariableTargetAttr, (user, target, move) => (user.hasFusionSpecies(Species.TERAPAGOS) || user.species.speciesId === Species.TERAPAGOS) && user.isTerastallized ? MoveTarget.ALL_NEAR_ENEMIES : MoveTarget.NEAR_OTHER)
|
||||
.attr(VariableTargetAttr, (user, target, move) => user.hasSpecies(Species.TERAPAGOS) && user.isTerastallized ? MoveTarget.ALL_NEAR_ENEMIES : MoveTarget.NEAR_OTHER)
|
||||
.partial(), /** Does not ignore abilities that affect stats, relevant in determining the move's category {@see TeraMoveCategoryAttr} */
|
||||
new AttackMove(Moves.FICKLE_BEAM, Type.DRAGON, MoveCategory.SPECIAL, 80, 100, 5, 30, 0, 9)
|
||||
.attr(PreMoveMessageAttr, doublePowerChanceMessageFunc)
|
||||
|
@ -1182,6 +1182,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
return this.fusionSpecies?.speciesId === species;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the {@linkcode Pokemon} has is the specified {@linkcode Species} or is fused with it.
|
||||
* @param species the pokemon {@linkcode Species} to check
|
||||
* @returns `true` if the pokemon is the species or is fused with it, `false` otherwise
|
||||
*/
|
||||
hasSpecies(species: Species): boolean {
|
||||
return this.species.speciesId === species || this.fusionSpecies?.speciesId === species;
|
||||
}
|
||||
|
||||
abstract isBoss(): boolean;
|
||||
|
||||
getMoveset(ignoreOverride?: boolean): (PokemonMove | null)[] {
|
||||
@ -1553,9 +1562,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
* @returns the pokemon's current tera {@linkcode Type}, or `Type.UNKNOWN` if the pokemon is not terastallized
|
||||
*/
|
||||
getTeraType(): Type {
|
||||
if (this.species.speciesId === Species.TERAPAGOS || this.fusionSpecies?.speciesId === Species.TERAPAGOS) {
|
||||
if (this.hasSpecies(Species.TERAPAGOS)) {
|
||||
return Type.STELLAR;
|
||||
} else if (this.species.speciesId === Species.OGERPON || this.fusionSpecies?.speciesId === Species.OGERPON) {
|
||||
} else if (this.hasSpecies(Species.OGERPON)) {
|
||||
const ogerponForm = this.species.speciesId === Species.OGERPON ? this.formIndex : this.fusionFormIndex;
|
||||
switch (ogerponForm) {
|
||||
case 0:
|
||||
@ -1571,7 +1580,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
case 7:
|
||||
return Type.ROCK;
|
||||
}
|
||||
} else if (this.species.speciesId === Species.SHEDINJA || this.fusionSpecies?.speciesId === Species.SHEDINJA) {
|
||||
} else if (this.hasSpecies(Species.SHEDINJA)) {
|
||||
return Type.BUG;
|
||||
}
|
||||
return this.teraType;
|
||||
|
Loading…
Reference in New Issue
Block a user