Grass types are immune to powder moves
parent
bb185d9845
commit
b85f093674
|
@ -161,6 +161,16 @@ export default class Move {
|
|||
return false;
|
||||
}
|
||||
|
||||
isTypeImmune(type: Type): boolean {
|
||||
switch (type) {
|
||||
case Type.GRASS:
|
||||
if (this.hasFlag(MoveFlags.POWDER_MOVE))
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
condition(condition: MoveCondition | MoveConditionFunc): this {
|
||||
if (typeof condition === 'function')
|
||||
condition = new MoveCondition(condition as MoveConditionFunc);
|
||||
|
|
|
@ -1044,6 +1044,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||
: 1);
|
||||
if (typeless)
|
||||
typeMultiplier.value = 1;
|
||||
if (this.getTypes(true, true).find(t => move.isTypeImmune(t)))
|
||||
typeMultiplier.value = 0;
|
||||
|
||||
switch (moveCategory) {
|
||||
case MoveCategory.PHYSICAL:
|
||||
|
|
Loading…
Reference in New Issue