Added function on Explosion moves to force
faint if missing explosion-like movespull/610/head
parent
bc36af7d89
commit
59761dec91
|
|
@ -2557,14 +2557,7 @@ const crashDamageFunc = (user: Pokemon, move: Move) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const explosionDamageFunc = (user: Pokemon, move: Move) => {
|
const explosionDamageFunc = (user: Pokemon, move: Move) => {
|
||||||
const cancelled = new Utils.BooleanHolder(false);
|
user.damageAndUpdate(user.hp, HitResult.OTHER, false, true); // Forces the user to take damage = to it's hp
|
||||||
applyAbAttrs(BlockNonDirectDamageAbAttr, user, cancelled);
|
|
||||||
if (cancelled.value)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
user.damageAndUpdate(user.hp, HitResult.OTHER, false, true);
|
|
||||||
user.turnData.damageTaken += user.hp;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -4295,8 +4288,7 @@ export function initMoves() {
|
||||||
.makesContact(false)
|
.makesContact(false)
|
||||||
.condition(failIfDampCondition)
|
.condition(failIfDampCondition)
|
||||||
.target(MoveTarget.ALL_NEAR_OTHERS)
|
.target(MoveTarget.ALL_NEAR_OTHERS)
|
||||||
.attr(MissEffectAttr, explosionDamageFunc)
|
.attr(MissEffectAttr, explosionDamageFunc),
|
||||||
.attr(NoEffectAttr, explosionDamageFunc),
|
|
||||||
new AttackMove(Moves.EGG_BOMB, Type.NORMAL, MoveCategory.PHYSICAL, 100, 75, 10, -1, 0, 1)
|
new AttackMove(Moves.EGG_BOMB, Type.NORMAL, MoveCategory.PHYSICAL, 100, 75, 10, -1, 0, 1)
|
||||||
.makesContact(false)
|
.makesContact(false)
|
||||||
.ballBombMove(),
|
.ballBombMove(),
|
||||||
|
|
@ -4388,8 +4380,7 @@ export function initMoves() {
|
||||||
.attr(SacrificialAttr)
|
.attr(SacrificialAttr)
|
||||||
.makesContact(false)
|
.makesContact(false)
|
||||||
.target(MoveTarget.ALL_NEAR_OTHERS)
|
.target(MoveTarget.ALL_NEAR_OTHERS)
|
||||||
.attr(MissEffectAttr, explosionDamageFunc)
|
.attr(MissEffectAttr, explosionDamageFunc),
|
||||||
.attr(NoEffectAttr, explosionDamageFunc),
|
|
||||||
new AttackMove(Moves.FURY_SWIPES, Type.NORMAL, MoveCategory.PHYSICAL, 18, 80, 15, -1, 0, 1)
|
new AttackMove(Moves.FURY_SWIPES, Type.NORMAL, MoveCategory.PHYSICAL, 18, 80, 15, -1, 0, 1)
|
||||||
.attr(MultiHitAttr),
|
.attr(MultiHitAttr),
|
||||||
new AttackMove(Moves.BONEMERANG, Type.GROUND, MoveCategory.PHYSICAL, 50, 90, 10, -1, 0, 1)
|
new AttackMove(Moves.BONEMERANG, Type.GROUND, MoveCategory.PHYSICAL, 50, 90, 10, -1, 0, 1)
|
||||||
|
|
@ -6158,8 +6149,7 @@ export function initMoves() {
|
||||||
.target(MoveTarget.ALL_NEAR_OTHERS)
|
.target(MoveTarget.ALL_NEAR_OTHERS)
|
||||||
.attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.MISTY && user.isGrounded() ? 1.5 : 1)
|
.attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.MISTY && user.isGrounded() ? 1.5 : 1)
|
||||||
.condition(failIfDampCondition)
|
.condition(failIfDampCondition)
|
||||||
.attr(MissEffectAttr, explosionDamageFunc)
|
.attr(MissEffectAttr, explosionDamageFunc),
|
||||||
.attr(NoEffectAttr, explosionDamageFunc),
|
|
||||||
new AttackMove(Moves.GRASSY_GLIDE, Type.GRASS, MoveCategory.PHYSICAL, 55, 100, 20, -1, 0, 8)
|
new AttackMove(Moves.GRASSY_GLIDE, Type.GRASS, MoveCategory.PHYSICAL, 55, 100, 20, -1, 0, 8)
|
||||||
.partial(),
|
.partial(),
|
||||||
new AttackMove(Moves.RISING_VOLTAGE, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 8)
|
new AttackMove(Moves.RISING_VOLTAGE, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 8)
|
||||||
|
|
|
||||||
|
|
@ -2252,7 +2252,7 @@ export class MovePhase extends BattlePhase {
|
||||||
|
|
||||||
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
|
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
|
||||||
moveQueue.shift();
|
moveQueue.shift();
|
||||||
if ((this.move.moveId in [Moves.SELF_DESTRUCT,Moves.EXPLOSION,Moves.MISTY_EXPLOSION])){
|
if (!(this.move.moveId in [Moves.SELF_DESTRUCT,Moves.EXPLOSION,Moves.MISTY_EXPLOSION])){
|
||||||
this.cancel();
|
this.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue