simplify logic for ignoretypeimmunityabattr
parent
0ee76e3019
commit
78d3bf7779
|
|
@ -2483,7 +2483,7 @@ export class IgnoreTypeImmunityAbAttr extends AbAttr {
|
|||
}
|
||||
|
||||
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
|
||||
if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.some(type => type === (args[0] as Type))) {
|
||||
if (this.defenderType === (args[1] as Type) && this.allowedMoveTypes.includes(args[0] as Type)) {
|
||||
cancelled.value = true;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -902,7 +902,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
const types = this.getTypes(true, true);
|
||||
|
||||
let multiplier = types.map(defType => {
|
||||
if (source && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) {
|
||||
if (source) {
|
||||
const ignoreImmunity = new Utils.BooleanHolder(false);
|
||||
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType);
|
||||
if (ignoreImmunity.value)
|
||||
|
|
|
|||
Loading…
Reference in New Issue