[Bug] add condition before applying IgnoreTypeImmunityAbAttr (#2150)

This commit is contained in:
Adrian T 2024-06-13 04:02:28 +08:00 committed by GitHub
parent 777a8ad9ea
commit 8e8b006c49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -1146,7 +1146,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let multiplier = types.map(defType => { let multiplier = types.map(defType => {
if (source) { if (source) {
const ignoreImmunity = new Utils.BooleanHolder(false); const ignoreImmunity = new Utils.BooleanHolder(false);
if (source.isActive(true) && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) {
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType); applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType);
}
if (ignoreImmunity.value) { if (ignoreImmunity.value) {
return 1; return 1;
} }