Compare commits

..

No commits in common. "cd7de107221211e09e030e015d4c8eaf02de0383" and "5b4f1da854407d59f83c9fcd8a2cb2b845474d21" have entirely different histories.

6 changed files with 29 additions and 48 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -3707,22 +3707,6 @@ export class LastResortAttr extends MoveAttr {
} }
} }
export class VariableTargetAttr extends MoveAttr {
private targetChangeFunc: (user: Pokemon, target: Pokemon, move: Move) => number;
constructor(targetChange: (user: Pokemon, target: Pokemon, move: Move) => number) {
super();
this.targetChangeFunc = targetChange;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const targetVal = args[0] as Utils.NumberHolder;
targetVal.value = this.targetChangeFunc(user, target, move);
return true;
}
}
const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY); const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY);
const failOnBossCondition: MoveConditionFunc = (user, target, move) => !target.isBossImmune(); const failOnBossCondition: MoveConditionFunc = (user, target, move) => !target.isBossImmune();
@ -3803,10 +3787,7 @@ export type MoveTargetSet = {
} }
export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet { export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet {
const variableTarget = new Utils.NumberHolder(0); const moveTarget = move ? allMoves[move].moveTarget : move === undefined ? MoveTarget.NEAR_ENEMY : [];
user.getOpponents().forEach(p => applyMoveAttrs(VariableTargetAttr, user, p, allMoves[move], variableTarget));
const moveTarget = allMoves[move].getAttrs(VariableTargetAttr).length ? variableTarget.value : move ? allMoves[move].moveTarget : move === undefined ? MoveTarget.NEAR_ENEMY : [];
const opponents = user.getOpponents(); const opponents = user.getOpponents();
let set: Pokemon[] = []; let set: Pokemon[] = [];
@ -6008,8 +5989,7 @@ export function initMoves() {
new AttackMove(Moves.STEEL_BEAM, Type.STEEL, MoveCategory.SPECIAL, 140, 95, 5, -1, 0, 8) new AttackMove(Moves.STEEL_BEAM, Type.STEEL, MoveCategory.SPECIAL, 140, 95, 5, -1, 0, 8)
.attr(HalfSacrificialAttr), .attr(HalfSacrificialAttr),
new AttackMove(Moves.EXPANDING_FORCE, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 8) new AttackMove(Moves.EXPANDING_FORCE, Type.PSYCHIC, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 8)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.PSYCHIC && user.isGrounded() ? 1.5 : 1) .partial(),
.attr(VariableTargetAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.PSYCHIC && user.isGrounded() ? 6 : 3),
new AttackMove(Moves.STEEL_ROLLER, Type.STEEL, MoveCategory.PHYSICAL, 130, 100, 5, -1, 0, 8) new AttackMove(Moves.STEEL_ROLLER, Type.STEEL, MoveCategory.PHYSICAL, 130, 100, 5, -1, 0, 8)
.attr(ClearTerrainAttr) .attr(ClearTerrainAttr)
.condition((user, target, move) => !!user.scene.arena.terrain), .condition((user, target, move) => !!user.scene.arena.terrain),

View File

@ -30,7 +30,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 24, Moves.SWEET_SCENT ], [ 24, Moves.SWEET_SCENT ],
[ 27, Moves.SYNTHESIS ], [ 27, Moves.SYNTHESIS ],
[ 30, Moves.WORRY_SEED ], [ 30, Moves.WORRY_SEED ],
[ 33, Moves.POWER_WHIP ], [ 33, Moves.DOUBLE_EDGE ],
[ 36, Moves.SOLAR_BEAM ], [ 36, Moves.SOLAR_BEAM ],
], ],
[Species.IVYSAUR]: [ [Species.IVYSAUR]: [
@ -47,16 +47,16 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 30, Moves.SWEET_SCENT ], [ 30, Moves.SWEET_SCENT ],
[ 35, Moves.SYNTHESIS ], [ 35, Moves.SYNTHESIS ],
[ 40, Moves.WORRY_SEED ], [ 40, Moves.WORRY_SEED ],
[ 45, Moves.POWER_WHIP ], [ 45, Moves.DOUBLE_EDGE ],
[ 50, Moves.SOLAR_BEAM ], [ 50, Moves.SOLAR_BEAM ],
], ],
[Species.VENUSAUR]: [ [Species.VENUSAUR]: [
[ 0, Moves.PETAL_BLIZZARD ], [ 0, Moves.PETAL_BLIZZARD ],
[ 1, Moves.GROWTH ],
[ 1, Moves.PETAL_DANCE ],
[ 1, Moves.VINE_WHIP ], [ 1, Moves.VINE_WHIP ],
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
[ 1, Moves.GROWL ], [ 1, Moves.GROWL ],
[ 1, Moves.GROWTH ],
[ 1, Moves.PETAL_DANCE ],
[ 9, Moves.LEECH_SEED ], [ 9, Moves.LEECH_SEED ],
[ 12, Moves.RAZOR_LEAF ], [ 12, Moves.RAZOR_LEAF ],
[ 15, Moves.POISON_POWDER ], [ 15, Moves.POISON_POWDER ],
@ -66,7 +66,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 30, Moves.SWEET_SCENT ], [ 30, Moves.SWEET_SCENT ],
[ 37, Moves.SYNTHESIS ], [ 37, Moves.SYNTHESIS ],
[ 44, Moves.WORRY_SEED ], [ 44, Moves.WORRY_SEED ],
[ 51, Moves.POWER_WHIP ], [ 51, Moves.DOUBLE_EDGE ],
[ 58, Moves.SOLAR_BEAM ], [ 58, Moves.SOLAR_BEAM ],
], ],
[Species.CHARMANDER]: [ [Species.CHARMANDER]: [
@ -127,7 +127,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 27, Moves.SHELL_SMASH ], [ 27, Moves.SHELL_SMASH ],
[ 30, Moves.IRON_DEFENSE ], [ 30, Moves.IRON_DEFENSE ],
[ 33, Moves.HYDRO_PUMP ], [ 33, Moves.HYDRO_PUMP ],
[ 36, Moves.WAVE_CRASH ], [ 36, Moves.SKULL_BASH ],
], ],
[Species.WARTORTLE]: [ [Species.WARTORTLE]: [
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
@ -143,7 +143,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 35, Moves.SHELL_SMASH ], [ 35, Moves.SHELL_SMASH ],
[ 40, Moves.IRON_DEFENSE ], [ 40, Moves.IRON_DEFENSE ],
[ 45, Moves.HYDRO_PUMP ], [ 45, Moves.HYDRO_PUMP ],
[ 50, Moves.WAVE_CRASH ], [ 50, Moves.SKULL_BASH ],
], ],
[Species.BLASTOISE]: [ [Species.BLASTOISE]: [
[ 0, Moves.FLASH_CANNON ], [ 0, Moves.FLASH_CANNON ],
@ -160,7 +160,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 35, Moves.SHELL_SMASH ], [ 35, Moves.SHELL_SMASH ],
[ 42, Moves.IRON_DEFENSE ], [ 42, Moves.IRON_DEFENSE ],
[ 49, Moves.HYDRO_PUMP ], [ 49, Moves.HYDRO_PUMP ],
[ 56, Moves.WAVE_CRASH ], [ 56, Moves.SKULL_BASH ],
], ],
[Species.CATERPIE]: [ [Species.CATERPIE]: [
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
@ -341,9 +341,9 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 12, Moves.GLARE ], [ 12, Moves.GLARE ],
[ 17, Moves.SCREECH ], [ 17, Moves.SCREECH ],
[ 20, Moves.ACID ], [ 20, Moves.ACID ],
[ 25, Moves.SWALLOW ],
[ 25, Moves.STOCKPILE ], [ 25, Moves.STOCKPILE ],
[ 25, Moves.SPIT_UP ], [ 25, Moves.SPIT_UP ],
[ 25, Moves.SWALLOW ],
[ 28, Moves.ACID_SPRAY ], [ 28, Moves.ACID_SPRAY ],
[ 33, Moves.SLUDGE_BOMB ], [ 33, Moves.SLUDGE_BOMB ],
[ 36, Moves.GASTRO_ACID ], [ 36, Moves.GASTRO_ACID ],
@ -1780,15 +1780,14 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 4, Moves.DOUBLE_KICK ], [ 4, Moves.DOUBLE_KICK ],
[ 8, Moves.LOW_KICK ], [ 8, Moves.LOW_KICK ],
[ 12, Moves.ENDURE ], [ 12, Moves.ENDURE ],
[ 16, Moves.SUCKER_PUNCH ], [ 16, Moves.REVENGE ],
[ 21, Moves.WIDE_GUARD ], [ 21, Moves.WIDE_GUARD ],
[ 24, Moves.BLAZE_KICK ], [ 24, Moves.BLAZE_KICK ],
[ 28, Moves.FEINT ], [ 28, Moves.MIND_READER ],
[ 32, Moves.MEGA_KICK ], [ 32, Moves.MEGA_KICK ],
[ 36, Moves.CLOSE_COMBAT ], [ 36, Moves.CLOSE_COMBAT ],
[ 40, Moves.REVERSAL ], [ 40, Moves.REVERSAL ],
[ 44, Moves.HIGH_JUMP_KICK ], [ 44, Moves.HIGH_JUMP_KICK ],
[ 50, Moves.AXE_KICK ],
], ],
[Species.HITMONCHAN]: [ [Species.HITMONCHAN]: [
[ 0, Moves.DRAIN_PUNCH ], [ 0, Moves.DRAIN_PUNCH ],
@ -1797,14 +1796,16 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.FAKE_OUT ], [ 1, Moves.FAKE_OUT ],
[ 1, Moves.HELPING_HAND ], [ 1, Moves.HELPING_HAND ],
[ 1, Moves.FEINT ], [ 1, Moves.FEINT ],
[ 1, Moves.VACUUM_WAVE ],
[ 1, Moves.BULLET_PUNCH ],
[ 4, Moves.MACH_PUNCH ], [ 4, Moves.MACH_PUNCH ],
[ 8, Moves.VACUUM_WAVE ], [ 8, Moves.POWER_UP_PUNCH ],
[ 12, Moves.DETECT ], [ 12, Moves.DETECT ],
[ 16, Moves.BULLET_PUNCH ], [ 16, Moves.REVENGE ],
[ 21, Moves.QUICK_GUARD ], [ 21, Moves.QUICK_GUARD ],
[ 24, Moves.THUNDER_PUNCH ],
[ 24, Moves.ICE_PUNCH ],
[ 24, Moves.FIRE_PUNCH ], [ 24, Moves.FIRE_PUNCH ],
[ 24, Moves.ICE_PUNCH ],
[ 24, Moves.THUNDER_PUNCH ],
[ 28, Moves.AGILITY ], [ 28, Moves.AGILITY ],
[ 32, Moves.MEGA_PUNCH ], [ 32, Moves.MEGA_PUNCH ],
[ 36, Moves.CLOSE_COMBAT ], [ 36, Moves.CLOSE_COMBAT ],

View File

@ -9,7 +9,7 @@ export const battle: SimpleTranslationEntries = {
"trainerComeBack": "{{trainerName}} retire {{pokemonName}} !", "trainerComeBack": "{{trainerName}} retire {{pokemonName}} !",
"playerGo": "{{pokemonName}} ! Go !", "playerGo": "{{pokemonName}} ! Go !",
"trainerGo": "{{pokemonName}} est envoyé par\n{{trainerName}} !", "trainerGo": "{{pokemonName}} est envoyé par\n{{trainerName}} !",
"switchQuestion": "Voulez-vous changer\nvotre {{pokemonName}} ?", "switchQuestion": "Voulez-vous changer\n{{pokemonName}} ?",
"trainerDefeated": `Vous avez battu\n{{trainerName}} !`, "trainerDefeated": `Vous avez battu\n{{trainerName}} !`,
"pokemonCaught": "Vous avez attrapé {{pokemonName}} !", "pokemonCaught": "Vous avez attrapé {{pokemonName}} !",
"pokemon": "Pokémon", "pokemon": "Pokémon",

View File

@ -1151,7 +1151,7 @@ const enemyBuffModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_FREEZE_CHANCE, 2), new WeightedModifierType(modifierTypes.ENEMY_ATTACK_FREEZE_CHANCE, 2),
new WeightedModifierType(modifierTypes.ENEMY_ATTACK_BURN_CHANCE, 2), new WeightedModifierType(modifierTypes.ENEMY_ATTACK_BURN_CHANCE, 2),
new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 10), new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 10),
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5), new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 10000),
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
].map(m => { m.setTier(ModifierTier.COMMON); return m; }), ].map(m => { m.setTier(ModifierTier.COMMON); return m; }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
@ -1162,12 +1162,12 @@ const enemyBuffModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
].map(m => { m.setTier(ModifierTier.GREAT); return m; }), ].map(m => { m.setTier(ModifierTier.GREAT); return m; }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 10), new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 5),
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_REDUCTION, 10), new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_REDUCTION, 5),
new WeightedModifierType(modifierTypes.ENEMY_HEAL, 10), new WeightedModifierType(modifierTypes.ENEMY_HEAL, 5),
new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 10), new WeightedModifierType(modifierTypes.ENEMY_STATUS_EFFECT_HEAL_CHANCE, 5),
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 10), new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5),
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 5) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 300)
].map(m => { m.setTier(ModifierTier.ULTRA); return m; }), ].map(m => { m.setTier(ModifierTier.ULTRA); return m; }),
[ModifierTier.ROGUE]: [ ].map(m => { m.setTier(ModifierTier.ROGUE); return m; }), [ModifierTier.ROGUE]: [ ].map(m => { m.setTier(ModifierTier.ROGUE); return m; }),
[ModifierTier.MASTER]: [ ].map(m => { m.setTier(ModifierTier.MASTER); return m; }) [ModifierTier.MASTER]: [ ].map(m => { m.setTier(ModifierTier.MASTER); return m; })

View File

@ -2,7 +2,7 @@ import BattleScene, { bypassLogin, startingWave } from "./battle-scene";
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon"; import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
import * as Utils from './utils'; import * as Utils from './utils';
import { Moves } from "./data/enums/moves"; import { Moves } from "./data/enums/moves";
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr } from "./data/move"; import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr } from "./data/move";
import { Mode } from './ui/ui'; import { Mode } from './ui/ui';
import { Command } from "./ui/command-ui-handler"; import { Command } from "./ui/command-ui-handler";
import { Stat } from "./data/pokemon-stat"; import { Stat } from "./data/pokemon-stat";
@ -2400,7 +2400,7 @@ export class MoveEffectPhase extends PokemonPhase {
const targetHitChecks = Object.fromEntries(targets.map(p => [ p.getBattlerIndex(), this.hitCheck(p) ])); const targetHitChecks = Object.fromEntries(targets.map(p => [ p.getBattlerIndex(), this.hitCheck(p) ]));
const activeTargets = targets.map(t => t.isActive(true)); const activeTargets = targets.map(t => t.isActive(true));
if (!activeTargets.length || (!this.move.getMove().getAttrs(VariableTargetAttr).length && !this.move.getMove().isMultiTarget() && !targetHitChecks[this.targets[0]])) { if (!activeTargets.length || (!this.move.getMove().isMultiTarget() && !targetHitChecks[this.targets[0]])) {
user.turnData.hitCount = 1; user.turnData.hitCount = 1;
user.turnData.hitsLeft = 1; user.turnData.hitsLeft = 1;
if (activeTargets.length) { if (activeTargets.length) {