mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Remove now-unnecessary changes to .getTypes()
calls
Revert `overrides.ts` changes
This commit is contained in:
parent
b76db335d9
commit
d253524aab
@ -43,7 +43,6 @@ import { PokemonTransformPhase } from "#app/phases/pokemon-transform-phase";
|
|||||||
import { allAbilities } from "#app/data/data-lists";
|
import { allAbilities } from "#app/data/data-lists";
|
||||||
import { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
import { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
|
||||||
import { Ability } from "#app/data/abilities/ability-class";
|
import { Ability } from "#app/data/abilities/ability-class";
|
||||||
import { TrainerVariant } from "#app/field/trainer";
|
|
||||||
|
|
||||||
// Enum imports
|
// Enum imports
|
||||||
import { Stat, type BattleStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey, type EffectiveStat } from "#enums/stat";
|
import { Stat, type BattleStat, BATTLE_STATS, EFFECTIVE_STATS, getStatKey, type EffectiveStat } from "#enums/stat";
|
||||||
@ -6574,7 +6573,7 @@ export function initAbilities() {
|
|||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.MAGNET_PULL, 3)
|
new Ability(Abilities.MAGNET_PULL, 3)
|
||||||
.attr(ArenaTrapAbAttr, (user, target) => {
|
.attr(ArenaTrapAbAttr, (user, target) => {
|
||||||
if (target.getTypes(true, false, undefined, false).includes(PokemonType.STEEL) || (target.getTypes(true).includes(PokemonType.STELLAR) && target.getTypes().includes(PokemonType.STEEL))) {
|
if (target.getTypes(true).includes(PokemonType.STEEL) || (target.getTypes(true).includes(PokemonType.STELLAR) && target.getTypes().includes(PokemonType.STEEL))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -6976,16 +6975,16 @@ export function initAbilities() {
|
|||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.FLOWER_VEIL, 6)
|
new Ability(Abilities.FLOWER_VEIL, 6)
|
||||||
.attr(ConditionalUserFieldStatusEffectImmunityAbAttr, (target: Pokemon, source: Pokemon | null) => {
|
.attr(ConditionalUserFieldStatusEffectImmunityAbAttr, (target: Pokemon, source: Pokemon | null) => {
|
||||||
return source ? target.getTypes(false, false, undefined, false).includes(PokemonType.GRASS) && target.id !== source.id : false;
|
return source ? target.getTypes().includes(PokemonType.GRASS) && target.id !== source.id : false;
|
||||||
})
|
})
|
||||||
.attr(ConditionalUserFieldBattlerTagImmunityAbAttr,
|
.attr(ConditionalUserFieldBattlerTagImmunityAbAttr,
|
||||||
(target: Pokemon) => {
|
(target: Pokemon) => {
|
||||||
return target.getTypes(false, false, undefined, false).includes(PokemonType.GRASS);
|
return target.getTypes().includes(PokemonType.GRASS);
|
||||||
},
|
},
|
||||||
[ BattlerTagType.DROWSY ],
|
[ BattlerTagType.DROWSY ],
|
||||||
)
|
)
|
||||||
.attr(ConditionalUserFieldProtectStatAbAttr, (target: Pokemon) => {
|
.attr(ConditionalUserFieldProtectStatAbAttr, (target: Pokemon) => {
|
||||||
return target.getTypes(false, false, undefined, false).includes(PokemonType.GRASS);
|
return target.getTypes().includes(PokemonType.GRASS);
|
||||||
})
|
})
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.CHEEK_POUCH, 6)
|
new Ability(Abilities.CHEEK_POUCH, 6)
|
||||||
|
@ -5155,7 +5155,7 @@ export class MatchUserTypeAttr extends VariableMoveTypeAttr {
|
|||||||
if (!(moveType instanceof NumberHolder)) {
|
if (!(moveType instanceof NumberHolder)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const userTypes = user.getTypes(true, false, undefined, false);
|
const userTypes = user.getTypes(true);
|
||||||
|
|
||||||
if (userTypes.includes(PokemonType.STELLAR)) { // will not change to stellar type
|
if (userTypes.includes(PokemonType.STELLAR)) { // will not change to stellar type
|
||||||
const nonTeraTypes = user.getTypes();
|
const nonTeraTypes = user.getTypes();
|
||||||
@ -5670,7 +5670,7 @@ export class JawLockAttr extends AddBattlerTagAttr {
|
|||||||
export class CurseAttr extends MoveEffectAttr {
|
export class CurseAttr extends MoveEffectAttr {
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean {
|
||||||
if (user.getTypes(true, false, undefined, false).includes(PokemonType.GHOST)) {
|
if (user.getTypes(true).includes(PokemonType.GHOST)) {
|
||||||
if (target.getTag(BattlerTagType.CURSED)) {
|
if (target.getTag(BattlerTagType.CURSED)) {
|
||||||
globalScene.queueMessage(i18next.t("battle:attackFailed"));
|
globalScene.queueMessage(i18next.t("battle:attackFailed"));
|
||||||
return false;
|
return false;
|
||||||
@ -6485,7 +6485,7 @@ export class RemoveTypeAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const userTypes = user.getTypes(true, false, undefined, false);
|
const userTypes = user.getTypes(true);
|
||||||
const modifiedTypes = userTypes.filter(type => type !== this.removedType);
|
const modifiedTypes = userTypes.filter(type => type !== this.removedType);
|
||||||
if (modifiedTypes.length === 0) {
|
if (modifiedTypes.length === 0) {
|
||||||
modifiedTypes.push(PokemonType.UNKNOWN);
|
modifiedTypes.push(PokemonType.UNKNOWN);
|
||||||
@ -6512,7 +6512,7 @@ export class CopyTypeAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const targetTypes = target.getTypes(true, false, undefined, false);
|
const targetTypes = target.getTypes(true);
|
||||||
if (targetTypes.includes(PokemonType.UNKNOWN) && targetTypes.indexOf(PokemonType.UNKNOWN) > -1) {
|
if (targetTypes.includes(PokemonType.UNKNOWN) && targetTypes.indexOf(PokemonType.UNKNOWN) > -1) {
|
||||||
targetTypes[targetTypes.indexOf(PokemonType.UNKNOWN)] = PokemonType.NORMAL;
|
targetTypes[targetTypes.indexOf(PokemonType.UNKNOWN)] = PokemonType.NORMAL;
|
||||||
}
|
}
|
||||||
@ -6684,7 +6684,7 @@ export class AddTypeAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCondition(): MoveConditionFunc {
|
getCondition(): MoveConditionFunc {
|
||||||
return (user, target, move) => !target.isTerastallized && !target.getTypes(false, false, undefined, false).includes(this.type);
|
return (user, target, move) => !target.isTerastallized && !target.getTypes().includes(this.type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8055,7 +8055,7 @@ export class UpperHandCondition extends MoveCondition {
|
|||||||
export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const multiplier = args[0] as NumberHolder;
|
const multiplier = args[0] as NumberHolder;
|
||||||
if (!user.getTypes(false, false, undefined, false).some(type => target.getTypes(false, false, undefined, false).includes(type))) {
|
if (!user.getTypes().some(type => target.getTypes().includes(type))) {
|
||||||
multiplier.value = 0;
|
multiplier.value = 0;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -8098,7 +8098,7 @@ export class ResistLastMoveTypeAttr extends MoveEffectAttr {
|
|||||||
if (moveData.type === PokemonType.STELLAR || moveData.type === PokemonType.UNKNOWN) {
|
if (moveData.type === PokemonType.STELLAR || moveData.type === PokemonType.UNKNOWN) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const userTypes = user.getTypes(false, false, undefined, false);
|
const userTypes = user.getTypes();
|
||||||
const validTypes = this.getTypeResistances(globalScene.gameMode, moveData.type).filter(t => !userTypes.includes(t)); // valid types are ones that are not already the user's types
|
const validTypes = this.getTypeResistances(globalScene.gameMode, moveData.type).filter(t => !userTypes.includes(t)); // valid types are ones that are not already the user's types
|
||||||
if (!validTypes.length) {
|
if (!validTypes.length) {
|
||||||
return false;
|
return false;
|
||||||
@ -8239,7 +8239,7 @@ export function getMoveTargets(user: Pokemon, move: Moves, replaceTarget?: MoveT
|
|||||||
break;
|
break;
|
||||||
case MoveTarget.CURSE:
|
case MoveTarget.CURSE:
|
||||||
const extraTargets = !isNullOrUndefined(ally) ? [ ally ] : [];
|
const extraTargets = !isNullOrUndefined(ally) ? [ ally ] : [];
|
||||||
set = user.getTypes(true, false, undefined, false).includes(PokemonType.GHOST) ? (opponents.concat(extraTargets)) : [ user ];
|
set = user.getTypes(true).includes(PokemonType.GHOST) ? (opponents.concat(extraTargets)) : [ user ];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10077,7 +10077,7 @@ export function initMoves() {
|
|||||||
.condition(failIfLastCondition),
|
.condition(failIfLastCondition),
|
||||||
new StatusMove(Moves.FLOWER_SHIELD, PokemonType.FAIRY, -1, 10, -1, 0, 6)
|
new StatusMove(Moves.FLOWER_SHIELD, PokemonType.FAIRY, -1, 10, -1, 0, 6)
|
||||||
.target(MoveTarget.ALL)
|
.target(MoveTarget.ALL)
|
||||||
.attr(StatStageChangeAttr, [ Stat.DEF ], 1, false, { condition: (user, target, move) => target.getTypes(false, false, undefined, false).includes(PokemonType.GRASS) && !target.getTag(SemiInvulnerableTag) }),
|
.attr(StatStageChangeAttr, [ Stat.DEF ], 1, false, { condition: (user, target, move) => target.getTypes().includes(PokemonType.GRASS) && !target.getTag(SemiInvulnerableTag) }),
|
||||||
new StatusMove(Moves.GRASSY_TERRAIN, PokemonType.GRASS, -1, 10, -1, 0, 6)
|
new StatusMove(Moves.GRASSY_TERRAIN, PokemonType.GRASS, -1, 10, -1, 0, 6)
|
||||||
.attr(TerrainChangeAttr, TerrainType.GRASSY)
|
.attr(TerrainChangeAttr, TerrainType.GRASSY)
|
||||||
.target(MoveTarget.BOTH_SIDES),
|
.target(MoveTarget.BOTH_SIDES),
|
||||||
@ -10365,7 +10365,7 @@ export function initMoves() {
|
|||||||
.attr(PositiveStatStagePowerAttr),
|
.attr(PositiveStatStagePowerAttr),
|
||||||
new AttackMove(Moves.BURN_UP, PokemonType.FIRE, MoveCategory.SPECIAL, 130, 100, 5, -1, 0, 7)
|
new AttackMove(Moves.BURN_UP, PokemonType.FIRE, MoveCategory.SPECIAL, 130, 100, 5, -1, 0, 7)
|
||||||
.condition((user) => {
|
.condition((user) => {
|
||||||
const userTypes = user.getTypes(true, false, undefined, false);
|
const userTypes = user.getTypes(true);
|
||||||
return userTypes.includes(PokemonType.FIRE);
|
return userTypes.includes(PokemonType.FIRE);
|
||||||
})
|
})
|
||||||
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
|
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
|
||||||
@ -11150,7 +11150,7 @@ export function initMoves() {
|
|||||||
.triageMove(),
|
.triageMove(),
|
||||||
new AttackMove(Moves.DOUBLE_SHOCK, PokemonType.ELECTRIC, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 9)
|
new AttackMove(Moves.DOUBLE_SHOCK, PokemonType.ELECTRIC, MoveCategory.PHYSICAL, 120, 100, 5, -1, 0, 9)
|
||||||
.condition((user) => {
|
.condition((user) => {
|
||||||
const userTypes = user.getTypes(true, false, undefined, false);
|
const userTypes = user.getTypes(true);
|
||||||
return userTypes.includes(PokemonType.ELECTRIC);
|
return userTypes.includes(PokemonType.ELECTRIC);
|
||||||
})
|
})
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.DOUBLE_SHOCKED, true, false)
|
.attr(AddBattlerTagAttr, BattlerTagType.DOUBLE_SHOCKED, true, false)
|
||||||
|
@ -174,7 +174,7 @@ class DefaultOverrides {
|
|||||||
readonly OPP_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
|
readonly OPP_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
|
||||||
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||||
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
||||||
readonly OPP_MOVESET_OVERRIDE: Moves | Array<Moves> = [Moves.THUNDER_WAVE, Moves.THUNDER_WAVE, Moves.THUNDER_WAVE, Moves.THUNDER_WAVE];
|
readonly OPP_MOVESET_OVERRIDE: Moves | Array<Moves> = [];
|
||||||
readonly OPP_SHINY_OVERRIDE: boolean | null = null;
|
readonly OPP_SHINY_OVERRIDE: boolean | null = null;
|
||||||
readonly OPP_VARIANT_OVERRIDE: Variant | null = null;
|
readonly OPP_VARIANT_OVERRIDE: Variant | null = null;
|
||||||
readonly OPP_IVS_OVERRIDE: number | number[] = [];
|
readonly OPP_IVS_OVERRIDE: number | number[] = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user