Added function on Explosion moves to force

faint if missing explosion-like moves
pull/610/head
Tiduzz 2024-05-07 17:02:40 -03:00
parent bc36af7d89
commit 59761dec91
2 changed files with 5 additions and 15 deletions

View File

@ -2557,14 +2557,7 @@ const crashDamageFunc = (user: Pokemon, move: Move) => {
};
const explosionDamageFunc = (user: Pokemon, move: Move) => {
const cancelled = new Utils.BooleanHolder(false);
applyAbAttrs(BlockNonDirectDamageAbAttr, user, cancelled);
if (cancelled.value)
return false;
user.damageAndUpdate(user.hp, HitResult.OTHER, false, true);
user.turnData.damageTaken += user.hp;
user.damageAndUpdate(user.hp, HitResult.OTHER, false, true); // Forces the user to take damage = to it's hp
return true;
};
@ -4295,8 +4288,7 @@ export function initMoves() {
.makesContact(false)
.condition(failIfDampCondition)
.target(MoveTarget.ALL_NEAR_OTHERS)
.attr(MissEffectAttr, explosionDamageFunc)
.attr(NoEffectAttr, explosionDamageFunc),
.attr(MissEffectAttr, explosionDamageFunc),
new AttackMove(Moves.EGG_BOMB, Type.NORMAL, MoveCategory.PHYSICAL, 100, 75, 10, -1, 0, 1)
.makesContact(false)
.ballBombMove(),
@ -4388,8 +4380,7 @@ export function initMoves() {
.attr(SacrificialAttr)
.makesContact(false)
.target(MoveTarget.ALL_NEAR_OTHERS)
.attr(MissEffectAttr, explosionDamageFunc)
.attr(NoEffectAttr, explosionDamageFunc),
.attr(MissEffectAttr, explosionDamageFunc),
new AttackMove(Moves.FURY_SWIPES, Type.NORMAL, MoveCategory.PHYSICAL, 18, 80, 15, -1, 0, 1)
.attr(MultiHitAttr),
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)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.MISTY && user.isGrounded() ? 1.5 : 1)
.condition(failIfDampCondition)
.attr(MissEffectAttr, explosionDamageFunc)
.attr(NoEffectAttr, explosionDamageFunc),
.attr(MissEffectAttr, explosionDamageFunc),
new AttackMove(Moves.GRASSY_GLIDE, Type.GRASS, MoveCategory.PHYSICAL, 55, 100, 20, -1, 0, 8)
.partial(),
new AttackMove(Moves.RISING_VOLTAGE, Type.ELECTRIC, MoveCategory.SPECIAL, 70, 100, 20, -1, 0, 8)

View File

@ -2252,7 +2252,7 @@ export class MovePhase extends BattlePhase {
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
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();
}
}