This commit is contained in:
Akuma-Reiki 2024-05-08 12:32:47 -05:00
commit 40392a9aa2
4 changed files with 19 additions and 17 deletions

View File

@ -2496,11 +2496,11 @@ export class IgnoreTypeImmunityAbAttr extends AbAttr {
} }
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
if (this.defenderType !== (args[1] as Type)) { if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.includes(args[0] as Type)) {
return false; cancelled.value = true;
return true;
} }
return false;
return this.allowedMoveTypes.some(type => type === (args[0] as Type));
} }
} }
@ -3606,7 +3606,8 @@ export function initAbilities() {
.partial(), .partial(),
new Ability(Abilities.MINDS_EYE, 9) new Ability(Abilities.MINDS_EYE, 9)
.attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING]) .attr(IgnoreTypeImmunityAbAttr, Type.GHOST, [Type.NORMAL, Type.FIGHTING])
.ignorable(), // TODO: evasiveness bypass should not be ignored, but accuracy immunity should .ignorable() // TODO: evasiveness bypass should not be ignored, but accuracy immunity should
.partial(),
new Ability(Abilities.SUPERSWEET_SYRUP, 9) new Ability(Abilities.SUPERSWEET_SYRUP, 9)
.attr(PostSummonStatChangeAbAttr, BattleStat.EVA, -1) .attr(PostSummonStatChangeAbAttr, BattleStat.EVA, -1)
.condition(getOncePerBattleCondition(Abilities.SUPERSWEET_SYRUP)), .condition(getOncePerBattleCondition(Abilities.SUPERSWEET_SYRUP)),

View File

@ -5132,7 +5132,6 @@ export function initMoves() {
.attr(RecoilAttr, false, 0.33) .attr(RecoilAttr, false, 0.33)
.attr(HealStatusEffectAttr, true, StatusEffect.FREEZE) .attr(HealStatusEffectAttr, true, StatusEffect.FREEZE)
.attr(StatusEffectAttr, StatusEffect.BURN) .attr(StatusEffectAttr, StatusEffect.BURN)
.condition(failOnGravityCondition)
.recklessMove(), .recklessMove(),
new AttackMove(Moves.FORCE_PALM, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, 30, 0, 4) new AttackMove(Moves.FORCE_PALM, Type.FIGHTING, MoveCategory.PHYSICAL, 60, 100, 10, 30, 0, 4)
.attr(StatusEffectAttr, StatusEffect.PARALYSIS), .attr(StatusEffectAttr, StatusEffect.PARALYSIS),

View File

@ -908,14 +908,16 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.isTerastallized() ? 2 : 1; return this.isTerastallized() ? 2 : 1;
const types = this.getTypes(true, true); const types = this.getTypes(true, true);
const ignorableImmunities = source?.getAbility()?.getAttrs(IgnoreTypeImmunityAbAttr) || []; let multiplier = types.map(defType => {
const cancelled = new Utils.BooleanHolder(false); if (source) {
const ignoreImmunity = new Utils.BooleanHolder(false);
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType);
if (ignoreImmunity.value)
return 1;
}
let multiplier = types.map(defType => return getTypeDamageMultiplier(moveType, defType);
ignorableImmunities.some(attr => attr.apply(source, false, cancelled, [moveType, defType])) }).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier;
? 1
: getTypeDamageMultiplier(moveType, defType)
).reduce((acc, cur) => acc * cur, 1) as TypeDamageMultiplier;
// Handle strong winds lowering effectiveness of types super effective against pure flying // Handle strong winds lowering effectiveness of types super effective against pure flying
if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2) if (this.scene.arena.weather?.weatherType === WeatherType.STRONG_WINDS && !this.scene.arena.weather.isEffectSuppressed(this.scene) && multiplier >= 2 && this.isOfType(Type.FLYING) && getTypeDamageMultiplier(moveType, Type.FLYING) === 2)

View File

@ -183,19 +183,19 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
handler: () => changeLocaleHandler('en') handler: () => changeLocaleHandler('en')
}, },
{ {
label: 'Spanish', label: 'Español',
handler: () => changeLocaleHandler('es') handler: () => changeLocaleHandler('es')
}, },
{ {
label: 'Italian', label: 'Italiano',
handler: () => changeLocaleHandler('it') handler: () => changeLocaleHandler('it')
}, },
{ {
label: 'French', label: 'Français',
handler: () => changeLocaleHandler('fr') handler: () => changeLocaleHandler('fr')
}, },
{ {
label: 'German', label: 'Deutsch',
handler: () => changeLocaleHandler('de') handler: () => changeLocaleHandler('de')
}, },
{ {