mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-08 17:32:18 +02:00
Prevent disabling STRUGGLE
This commit is contained in:
parent
a628f77547
commit
534ebceabb
@ -163,7 +163,7 @@ export class DisabledTag extends DisablingBattlerTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const move = history.find(m => m.move !== Moves.NONE);
|
const move = history.find(m => m.move !== Moves.NONE);
|
||||||
if (move === undefined) {
|
if (move === undefined || move.move === Moves.STRUGGLE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6006,6 +6006,7 @@ const unknownTypeCondition: MoveConditionFunc = (user, target, move) => !user.ge
|
|||||||
|
|
||||||
/** Ensures that the target has at least one non-virtual, non-NONE move in its history. */
|
/** Ensures that the target has at least one non-virtual, non-NONE move in its history. */
|
||||||
const targetHasMoveHistoryCondition: MoveConditionFunc = (user, target, move) => target.getLastXMoves().filter(m => m.move !== Moves.NONE && !m.virtual).length >= 1;
|
const targetHasMoveHistoryCondition: MoveConditionFunc = (user, target, move) => target.getLastXMoves().filter(m => m.move !== Moves.NONE && !m.virtual).length >= 1;
|
||||||
|
const targetLastMoveIsNotStruggleCondition: MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => target.getLastXMoves(1).at(0)?.move !== Moves.STRUGGLE;
|
||||||
|
|
||||||
export type MoveTargetSet = {
|
export type MoveTargetSet = {
|
||||||
targets: BattlerIndex[];
|
targets: BattlerIndex[];
|
||||||
@ -6212,6 +6213,7 @@ export function initMoves() {
|
|||||||
new StatusMove(Moves.DISABLE, Type.NORMAL, 100, 20, -1, 0, 1)
|
new StatusMove(Moves.DISABLE, Type.NORMAL, 100, 20, -1, 0, 1)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.DISABLED, false, true)
|
.attr(AddBattlerTagAttr, BattlerTagType.DISABLED, false, true)
|
||||||
.condition(targetHasMoveHistoryCondition)
|
.condition(targetHasMoveHistoryCondition)
|
||||||
|
.condition(targetLastMoveIsNotStruggleCondition)
|
||||||
.condition(failOnMaxCondition),
|
.condition(failOnMaxCondition),
|
||||||
new AttackMove(Moves.ACID, Type.POISON, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1)
|
new AttackMove(Moves.ACID, Type.POISON, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1)
|
||||||
.attr(StatChangeAttr, BattleStat.SPDEF, -1)
|
.attr(StatChangeAttr, BattleStat.SPDEF, -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user