Fix the way ignore flying tag works

This commit is contained in:
Flashfyre 2024-03-28 10:28:05 -04:00
parent 289969790a
commit cedc1fb3b2
5 changed files with 9 additions and 9 deletions

View File

@ -841,7 +841,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.GOGOAT, 32, null, null)
],
[Species.PANCHAM]: [
new SpeciesEvolution(Species.PANGORO, 32, null, new SpeciesEvolutionCondition(p => !!p.scene.getParty().find(p => p.getTypes(false, true).indexOf(Type.DARK) > -1)), SpeciesWildEvolutionDelay.MEDIUM)
new SpeciesEvolution(Species.PANGORO, 32, null, new SpeciesEvolutionCondition(p => !!p.scene.getParty().find(p => p.getTypes(false, false, true).indexOf(Type.DARK) > -1)), SpeciesWildEvolutionDelay.MEDIUM)
],
[Species.ESPURR]: [
new SpeciesFormEvolution(Species.MEOWSTIC, '', '', 25, null, new SpeciesEvolutionCondition(p => p.gender === Gender.MALE, p => p.gender = Gender.MALE)),

View File

@ -629,7 +629,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.getLevelMoves(1, true).map(lm => lm[1]).filter(lm => !this.moveset.filter(m => m.moveId === lm).length).filter((move: Moves, i: integer, array: Moves[]) => array.indexOf(move) === i);
}
getTypes(includeTeraType = false, ignoreOverride?: boolean): Type[] {
getTypes(includeTeraType = false, forDefend: boolean = false, ignoreOverride?: boolean): Type[] {
const types = [];
if (includeTeraType) {
@ -659,7 +659,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
}
if (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY)) {
if (forDefend && (this.getTag(BattlerTagType.IGNORE_FLYING) || this.scene.arena.getTag(ArenaTagType.GRAVITY))) {
const flyingIndex = types.indexOf(Type.FLYING);
if (flyingIndex > -1)
types.splice(flyingIndex, 1);
@ -735,13 +735,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
getAttackTypeEffectiveness(moveType: Type): TypeDamageMultiplier {
if (moveType === Type.STELLAR)
return this.isTerastallized() ? 2 : 1;
const types = this.getTypes(true);
const types = this.getTypes(true, true);
return getTypeDamageMultiplier(moveType, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(moveType, types[1]) : 1) as TypeDamageMultiplier;
}
getMatchupScore(pokemon: Pokemon): number {
const types = this.getTypes(true);
const enemyTypes = pokemon.getTypes(true);
const enemyTypes = pokemon.getTypes(true, true);
const outspeed = (this.isActive(true) ? this.getBattleStat(Stat.SPD, pokemon) : this.getStat(Stat.SPD)) <= pokemon.getBattleStat(Stat.SPD, this);
let atkScore = pokemon.getAttackTypeEffectiveness(types[0]) * (outspeed ? 1.25 : 1);
let defScore = 1 / Math.max(this.getAttackTypeEffectiveness(enemyTypes[0]), 0.25);
@ -1045,7 +1045,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const cancelled = new Utils.BooleanHolder(false);
const typeless = !!move.getAttrs(TypelessAttr).length;
const types = this.getTypes(true);
const types = this.getTypes(true, true);
const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveCategory.STATUS || move.getAttrs(StatusMoveTypeImmunityAttr).find(attr => (attr as StatusMoveTypeImmunityAttr).immuneType === move.type))
? getTypeDamageMultiplier(move.type, types[0]) * (types.length > 1 ? getTypeDamageMultiplier(move.type, types[1]) : 1)
: 1);

View File

@ -776,7 +776,7 @@ export const modifierTypes = {
return null;
let type: Type;
if (!Utils.randSeedInt(3)) {
const partyMemberTypes = party.map(p => p.getTypes(false, true)).flat();
const partyMemberTypes = party.map(p => p.getTypes(false, false, true)).flat();
type = Utils.randSeedItem(partyMemberTypes);
} else
type = Utils.randSeedInt(64) ? Utils.randSeedInt(18) as Type : Type.STELLAR;

View File

@ -2573,7 +2573,7 @@ export class WeatherEffectPhase extends CommonAnimPhase {
};
this.executeForAll((pokemon: Pokemon) => {
const immune = !pokemon || !!pokemon.getTypes(true).filter(t => this.weather.isTypeDamageImmune(t)).length;
const immune = !pokemon || !!pokemon.getTypes(true, true).filter(t => this.weather.isTypeDamageImmune(t)).length;
if (!immune)
inflictDamage(pokemon);
});

View File

@ -533,7 +533,7 @@ export default class SummaryUiHandler extends UiHandler {
return typeIcon;
};
const types = this.pokemon.getTypes(false, true);
const types = this.pokemon.getTypes(false, false, true);
profileContainer.add(getTypeIcon(0, types[0]));
if (types.length > 1)
profileContainer.add(getTypeIcon(1, types[1]));