Skip to content

Commit

Permalink
[Balance] Remove isMax conditions from move and ability effects (#4200
Browse files Browse the repository at this point in the history
)

Co-authored-by: NightKev <[email protected]>
Co-authored-by: Amani H. <[email protected]>
  • Loading branch information
3 people authored Sep 14, 2024
1 parent e6cffc6 commit 8164ec5
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/data/ability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ export class PostDefendMoveDisableAbAttr extends PostDefendAbAttr {

applyPostDefend(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker: Pokemon, move: Move, hitResult: HitResult, args: any[]): boolean {
if (attacker.getTag(BattlerTagType.DISABLED) === null) {
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance) && !attacker.isMax()) {
if (move.checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance)) {
if (simulated) {
return true;
}
Expand Down
16 changes: 0 additions & 16 deletions src/data/battler-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,6 @@ export class FlinchedTag extends BattlerTag {
applyAbAttrs(FlinchEffectAbAttr, pokemon, null);
}

canAdd(pokemon: Pokemon): boolean {
return !pokemon.isMax();
}

/**
* Cancels the Pokemon's next Move on the turn this tag is applied
* @param pokemon The {@linkcode Pokemon} with this tag
Expand Down Expand Up @@ -878,10 +874,6 @@ export class EncoreTag extends BattlerTag {
}

canAdd(pokemon: Pokemon): boolean {
if (pokemon.isMax()) {
return false;
}

const lastMoves = pokemon.getLastXMoves(1);
if (!lastMoves.length) {
return false;
Expand Down Expand Up @@ -1060,19 +1052,11 @@ export class MinimizeTag extends BattlerTag {
super(BattlerTagType.MINIMIZED, BattlerTagLapseType.TURN_END, 1, Moves.MINIMIZE);
}

canAdd(pokemon: Pokemon): boolean {
return !pokemon.isMax();
}

onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
}

lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
//If a pokemon dynamaxes they lose minimized status
if (pokemon.isMax()) {
return false;
}
return lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
}

Expand Down
19 changes: 6 additions & 13 deletions src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5248,7 +5248,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return false;
}

if (!this.user && move.category === MoveCategory.STATUS && (target.hasAbilityWithAttr(ForceSwitchOutImmunityAbAttr) || target.isMax())) {
if (!this.user && move.category === MoveCategory.STATUS && (target.hasAbilityWithAttr(ForceSwitchOutImmunityAbAttr))) {
return false;
}

Expand Down Expand Up @@ -6458,8 +6458,6 @@ const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.

const failOnBossCondition: MoveConditionFunc = (user, target, move) => !target.isBossImmune();

const failOnMaxCondition: MoveConditionFunc = (user, target, move) => !target.isMax();

const failIfSingleBattle: MoveConditionFunc = (user, target, move) => user.scene.currentBattle.double;

const failIfDampCondition: MoveConditionFunc = (user, target, move) => {
Expand Down Expand Up @@ -6855,8 +6853,7 @@ export function initMoves() {
new StatusMove(Moves.DISABLE, Type.NORMAL, 100, 20, -1, 0, 1)
.attr(AddBattlerTagAttr, BattlerTagType.DISABLED, false, true)
.condition((user, target, move) => target.getMoveHistory().reverse().find(m => m.move !== Moves.NONE && m.move !== Moves.STRUGGLE && !m.virtual) !== undefined)
.ignoresSubstitute()
.condition(failOnMaxCondition),
.ignoresSubstitute(),
new AttackMove(Moves.ACID, Type.POISON, MoveCategory.SPECIAL, 40, 100, 30, 10, 0, 1)
.attr(StatStageChangeAttr, [ Stat.SPDEF ], -1)
.target(MoveTarget.ALL_NEAR_ENEMIES),
Expand Down Expand Up @@ -6894,8 +6891,7 @@ export function initMoves() {
.attr(RecoilAttr)
.recklessMove(),
new AttackMove(Moves.LOW_KICK, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 20, -1, 0, 1)
.attr(WeightPowerAttr)
.condition(failOnMaxCondition),
.attr(WeightPowerAttr),
new AttackMove(Moves.COUNTER, Type.FIGHTING, MoveCategory.PHYSICAL, -1, 100, 20, -1, -5, 1)
.attr(CounterDamageAttr, (move: Move) => move.category === MoveCategory.PHYSICAL, 2)
.target(MoveTarget.ATTACKER),
Expand Down Expand Up @@ -8006,8 +8002,7 @@ export function initMoves() {
.target(MoveTarget.ENEMY_SIDE),
new AttackMove(Moves.GRASS_KNOT, Type.GRASS, MoveCategory.SPECIAL, -1, 100, 20, -1, 0, 4)
.attr(WeightPowerAttr)
.makesContact()
.condition(failOnMaxCondition),
.makesContact(),
new AttackMove(Moves.CHATTER, Type.FLYING, MoveCategory.SPECIAL, 65, 100, 20, 100, 0, 4)
.attr(ConfuseAttr)
.soundBased(),
Expand Down Expand Up @@ -8109,8 +8104,7 @@ export function initMoves() {
new AttackMove(Moves.HEAVY_SLAM, Type.STEEL, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 5)
.attr(MinimizeAccuracyAttr)
.attr(CompareWeightPowerAttr)
.attr(HitsTagAttr, BattlerTagType.MINIMIZED, true)
.condition(failOnMaxCondition),
.attr(HitsTagAttr, BattlerTagType.MINIMIZED, true),
new AttackMove(Moves.SYNCHRONOISE, Type.PSYCHIC, MoveCategory.SPECIAL, 120, 100, 10, -1, 0, 5)
.target(MoveTarget.ALL_NEAR_OTHERS)
.condition(unknownTypeCondition)
Expand Down Expand Up @@ -8262,8 +8256,7 @@ export function initMoves() {
new AttackMove(Moves.HEAT_CRASH, Type.FIRE, MoveCategory.PHYSICAL, -1, 100, 10, -1, 0, 5)
.attr(MinimizeAccuracyAttr)
.attr(CompareWeightPowerAttr)
.attr(HitsTagAttr, BattlerTagType.MINIMIZED, true)
.condition(failOnMaxCondition),
.attr(HitsTagAttr, BattlerTagType.MINIMIZED, true),
new AttackMove(Moves.LEAF_TORNADO, Type.GRASS, MoveCategory.SPECIAL, 65, 90, 10, 50, 0, 5)
.attr(StatStageChangeAttr, [ Stat.ACC ], -1),
new AttackMove(Moves.STEAMROLLER, Type.BUG, MoveCategory.PHYSICAL, 65, 100, 20, 30, 0, 5)
Expand Down
3 changes: 1 addition & 2 deletions src/modifier/modifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { Abilities } from "#app/enums/abilities";
import { LearnMovePhase } from "#app/phases/learn-move-phase";
import { LevelUpPhase } from "#app/phases/level-up-phase";
import { PokemonHealPhase } from "#app/phases/pokemon-heal-phase";
import { SpeciesFormKey } from "#app/data/pokemon-species";

export type ModifierPredicate = (modifier: Modifier) => boolean;

Expand Down Expand Up @@ -1086,7 +1085,7 @@ export class EvolutionStatBoosterModifier extends StatBoosterModifier {
* @returns true if the stat boosts can be applied, false otherwise
*/
shouldApply(args: any[]): boolean {
return super.shouldApply(args) && ((args[0] as Pokemon).getFormKey() !== SpeciesFormKey.GIGANTAMAX);
return super.shouldApply(args) && !(args[0] as Pokemon).isMax();
}

/**
Expand Down

0 comments on commit 8164ec5

Please sign in to comment.