mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-11 19:02:16 +02:00
simplify logic for ignoretypeimmunityabattr
This commit is contained in:
parent
0ee76e3019
commit
78d3bf7779
@ -2483,7 +2483,7 @@ 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) && 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;
|
cancelled.value = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -902,7 +902,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const types = this.getTypes(true, true);
|
const types = this.getTypes(true, true);
|
||||||
|
|
||||||
let multiplier = types.map(defType => {
|
let multiplier = types.map(defType => {
|
||||||
if (source && source.hasAbilityWithAttr(IgnoreTypeImmunityAbAttr)) {
|
if (source) {
|
||||||
const ignoreImmunity = new Utils.BooleanHolder(false);
|
const ignoreImmunity = new Utils.BooleanHolder(false);
|
||||||
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType);
|
applyAbAttrs(IgnoreTypeImmunityAbAttr, source, ignoreImmunity, moveType, defType);
|
||||||
if (ignoreImmunity.value)
|
if (ignoreImmunity.value)
|
||||||
|
Loading…
Reference in New Issue
Block a user