Compare commits

..

No commits in common. "80eb86a76caa1263712c2472cbd0260b08682d46" and "2a6ef08cffbe2347a525bc553945241c05a21602" have entirely different histories.

15 changed files with 183 additions and 382 deletions

View File

@ -12,7 +12,7 @@ import { Gender } from "./gender";
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, StatusMoveTypeImmunityAttr, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr } from "./move"; import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, StatusMoveTypeImmunityAttr, FlinchAttr, OneHitKOAttr, HitHealAttr, allMoves, StatusMove, SelfStatusMove, VariablePowerAttr, applyMoveAttrs, IncrementMovePriorityAttr } from "./move";
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag"; import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
import { ArenaTagType } from "./enums/arena-tag-type"; import { ArenaTagType } from "./enums/arena-tag-type";
import { Stat, getStatName } from "./pokemon-stat"; import { Stat } from "./pokemon-stat";
import { BerryModifier, PokemonHeldItemModifier } from "../modifier/modifier"; import { BerryModifier, PokemonHeldItemModifier } from "../modifier/modifier";
import { Moves } from "./enums/moves"; import { Moves } from "./enums/moves";
import { TerrainType } from "./terrain"; import { TerrainType } from "./terrain";
@ -1032,52 +1032,6 @@ export class FieldPreventExplosiveMovesAbAttr extends AbAttr {
} }
} }
/**
* Multiplies a BattleStat if the checked Pokemon lacks this ability.
* If this ability cannot stack, a BooleanHolder can be used to prevent this from stacking.
* @see {@link applyFieldBattleStatMultiplierAbAttrs}
* @see {@link applyFieldBattleStat}
* @see {@link Utils.BooleanHolder}
*/
export class FieldMultiplyBattleStatAbAttr extends AbAttr {
private stat: Stat;
private multiplier: number;
private canStack: boolean;
constructor(stat: Stat, multiplier: number, canStack: boolean = false) {
super(false);
this.stat = stat;
this.multiplier = multiplier;
this.canStack = canStack;
}
/**
* applyFieldBattleStat: Tries to multiply a Pokemon's BattleStat
* @param pokemon {@linkcode Pokemon} the Pokemon using this ability
* @param passive {@linkcode boolean} unused
* @param stat {@linkcode Stat} the type of the checked stat
* @param statValue {@linkcode Utils.NumberHolder} the value of the checked stat
* @param checkedPokemon {@linkcode Pokemon} the Pokemon this ability is targeting
* @param hasApplied {@linkcode Utils.BooleanHolder} whether or not another multiplier has been applied to this stat
* @param args {any[]} unused
* @returns true if this changed the checked stat, false otherwise.
*/
applyFieldBattleStat(pokemon: Pokemon, passive: boolean, stat: Stat, statValue: Utils.NumberHolder, checkedPokemon: Pokemon, hasApplied: Utils.BooleanHolder, args: any[]): boolean {
if (!this.canStack && hasApplied.value) {
return false;
}
if (this.stat === stat && checkedPokemon.getAbilityAttrs(FieldMultiplyBattleStatAbAttr).every(attr => (attr as FieldMultiplyBattleStatAbAttr).stat !== stat)) {
statValue.value *= this.multiplier;
hasApplied.value = true;
return true;
}
return false;
}
}
export class MoveTypeChangeAttr extends PreAttackAbAttr { export class MoveTypeChangeAttr extends PreAttackAbAttr {
private newType: Type; private newType: Type;
private powerMultiplier: number; private powerMultiplier: number;
@ -1625,9 +1579,7 @@ export class PostSummonStatChangeAbAttr extends PostSummonAbAttr {
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
queueShowAbility(pokemon, passive); // TODO: Better solution than manually showing the ability here queueShowAbility(pokemon, passive); // TODO: Better solution than manually showing the ability here
if (this.selfTarget) { if (this.selfTarget) {
// we unshift the StatChangePhase to put it right after the showAbility and not at the end of the pokemon.scene.pushPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels));
// phase list (which could be after CommandPhase for example)
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, this.stats, this.levels));
return true; return true;
} }
for (const opponent of pokemon.getOpponents()) { for (const opponent of pokemon.getOpponents()) {
@ -3621,21 +3573,6 @@ export function applyBattleStatMultiplierAbAttrs(attrType: { new(...args: any[])
return applyAbAttrsInternal<BattleStatMultiplierAbAttr>(attrType, pokemon, (attr, passive) => attr.applyBattleStat(pokemon, passive, battleStat, statValue, args), args); return applyAbAttrsInternal<BattleStatMultiplierAbAttr>(attrType, pokemon, (attr, passive) => attr.applyBattleStat(pokemon, passive, battleStat, statValue, args), args);
} }
/**
* Applies a field Battle Stat multiplier attribute
* @param attrType {@linkcode FieldMultiplyBattleStatAbAttr} should always be FieldMultiplyBattleStatAbAttr for the time being
* @param pokemon {@linkcode Pokemon} the Pokemon applying this ability
* @param stat {@linkcode Stat} the type of the checked stat
* @param statValue {@linkcode Utils.NumberHolder} the value of the checked stat
* @param checkedPokemon {@linkcode Pokemon} the Pokemon with the checked stat
* @param hasApplied {@linkcode Utils.BooleanHolder} whether or not a FieldMultiplyBattleStatAbAttr has already affected this stat
* @param args unused
*/
export function applyFieldBattleStatMultiplierAbAttrs(attrType: { new(...args: any[]): FieldMultiplyBattleStatAbAttr },
pokemon: Pokemon, stat: Stat, statValue: Utils.NumberHolder, checkedPokemon: Pokemon, hasApplied: Utils.BooleanHolder, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<FieldMultiplyBattleStatAbAttr>(attrType, pokemon, (attr, passive) => attr.applyFieldBattleStat(pokemon, passive, stat, statValue, checkedPokemon, hasApplied, args), args);
}
export function applyPreAttackAbAttrs(attrType: { new(...args: any[]): PreAttackAbAttr }, export function applyPreAttackAbAttrs(attrType: { new(...args: any[]): PreAttackAbAttr },
pokemon: Pokemon, defender: Pokemon, move: Move, ...args: any[]): Promise<void> { pokemon: Pokemon, defender: Pokemon, move: Move, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<PreAttackAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPreAttack(pokemon, passive, defender, move, args), args); return applyAbAttrsInternal<PreAttackAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPreAttack(pokemon, passive, defender, move, args), args);
@ -4659,21 +4596,17 @@ export function initAbilities() {
.ignorable() .ignorable()
.partial(), .partial(),
new Ability(Abilities.VESSEL_OF_RUIN, 9) new Ability(Abilities.VESSEL_OF_RUIN, 9)
.attr(FieldMultiplyBattleStatAbAttr, Stat.SPATK, 0.75) .ignorable()
.attr(PostSummonMessageAbAttr, (user) => getPokemonMessage(user, `'s Vessel of Ruin lowered the ${getStatName(Stat.SPATK)}\nof all surrounding Pokémon!`)) .unimplemented(),
.ignorable(),
new Ability(Abilities.SWORD_OF_RUIN, 9) new Ability(Abilities.SWORD_OF_RUIN, 9)
.attr(FieldMultiplyBattleStatAbAttr, Stat.DEF, 0.75) .ignorable()
.attr(PostSummonMessageAbAttr, (user) => getPokemonMessage(user, `'s Sword of Ruin lowered the ${getStatName(Stat.DEF)}\nof all surrounding Pokémon!`)) .unimplemented(),
.ignorable(),
new Ability(Abilities.TABLETS_OF_RUIN, 9) new Ability(Abilities.TABLETS_OF_RUIN, 9)
.attr(FieldMultiplyBattleStatAbAttr, Stat.ATK, 0.75) .ignorable()
.attr(PostSummonMessageAbAttr, (user) => getPokemonMessage(user, `'s Tablets of Ruin lowered the ${getStatName(Stat.ATK)}\nof all surrounding Pokémon!`)) .unimplemented(),
.ignorable(),
new Ability(Abilities.BEADS_OF_RUIN, 9) new Ability(Abilities.BEADS_OF_RUIN, 9)
.attr(FieldMultiplyBattleStatAbAttr, Stat.SPDEF, 0.75) .ignorable()
.attr(PostSummonMessageAbAttr, (user) => getPokemonMessage(user, `'s Beads of Ruin lowered the ${getStatName(Stat.SPDEF)}\nof all surrounding Pokémon!`)) .unimplemented(),
.ignorable(),
new Ability(Abilities.ORICHALCUM_PULSE, 9) new Ability(Abilities.ORICHALCUM_PULSE, 9)
.attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostSummonWeatherChangeAbAttr, WeatherType.SUNNY)
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY) .attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.SUNNY)

View File

@ -27,7 +27,7 @@ import { TempBattleStat } from "../data/temp-battle-stat";
import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from "../data/arena-tag"; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from "../data/arena-tag";
import { ArenaTagType } from "../data/enums/arena-tag-type"; import { ArenaTagType } from "../data/enums/arena-tag-type";
import { Biome } from "../data/enums/biome"; import { Biome } from "../data/enums/biome";
import { Ability, AbAttr, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr, applyFieldBattleStatMultiplierAbAttrs, FieldMultiplyBattleStatAbAttr } from "../data/ability"; import { Ability, AbAttr, BattleStatMultiplierAbAttr, MoveTypeChangeAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, FieldPriorityMoveImmunityAbAttr, FieldVariableMovePowerAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, PreApplyBattlerTagAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, ReduceStatusEffectDurationAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs, UnsuppressableAbilityAbAttr, SuppressFieldAbilitiesAbAttr, NoFusionAbilityAbAttr, MultCritAbAttr, IgnoreTypeImmunityAbAttr, DamageBoostAbAttr, IgnoreTypeStatusEffectImmunityAbAttr, ConditionalCritAbAttr } from "../data/ability";
import { Abilities } from "#app/data/enums/abilities"; import { Abilities } from "#app/data/enums/abilities";
import PokemonData from "../system/pokemon-data"; import PokemonData from "../system/pokemon-data";
import { BattlerIndex } from "../battle"; import { BattlerIndex } from "../battle";
@ -656,13 +656,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.scene.applyModifiers(TempBattleStatBoosterModifier, this.isPlayer(), battleStat as integer as TempBattleStat, statLevel); this.scene.applyModifiers(TempBattleStatBoosterModifier, this.isPlayer(), battleStat as integer as TempBattleStat, statLevel);
} }
const statValue = new Utils.NumberHolder(this.getStat(stat)); const statValue = new Utils.NumberHolder(this.getStat(stat));
const fieldApplied = new Utils.BooleanHolder(false);
for (const pokemon of this.scene.getField(true)) {
applyFieldBattleStatMultiplierAbAttrs(FieldMultiplyBattleStatAbAttr, pokemon, stat, statValue, this, fieldApplied);
if (fieldApplied.value) {
break;
}
}
applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, this, battleStat, statValue); applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, this, battleStat, statValue);
let ret = statValue.value * (Math.max(2, 2 + statLevel.value) / Math.max(2, 2 - statLevel.value)); let ret = statValue.value * (Math.max(2, 2 + statLevel.value) / Math.max(2, 2 - statLevel.value));
switch (stat) { switch (stat) {
@ -958,29 +951,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return allAbilities[starterPassiveAbilities[starterSpeciesId]]; return allAbilities[starterPassiveAbilities[starterSpeciesId]];
} }
/**
* Gets a list of all instances of a given ability attribute among abilities this pokemon has.
* Accounts for all the various effects which can affect whether an ability will be present or
* in effect, and both passive and non-passive.
* @param attrType {@linkcode AbAttr} The ability attribute to check for.
* @param canApply {@linkcode Boolean} If false, it doesn't check whether the ability is currently active
* @param ignoreOverride {@linkcode Boolean} If true, it ignores ability changing effects
* @returns {AbAttr[]} A list of all the ability attributes on this ability.
*/
getAbilityAttrs(attrType: { new(...args: any[]): AbAttr }, canApply: boolean = true, ignoreOverride?: boolean): AbAttr[] {
const abilityAttrs: AbAttr[] = [];
if (!canApply || this.canApplyAbility()) {
abilityAttrs.push(...this.getAbility(ignoreOverride).getAttrs(attrType));
}
if (!canApply || this.canApplyAbility(true)) {
abilityAttrs.push(...this.getPassiveAbility().getAttrs(attrType));
}
return abilityAttrs;
}
/** /**
* Checks if a pokemon has a passive either from: * Checks if a pokemon has a passive either from:
* - bought with starter candy * - bought with starter candy

View File

@ -15,7 +15,7 @@ export const nature: SimpleTranslationEntries = {
"Hasty": "Lesta", "Hasty": "Lesta",
"Serious": "Seria", "Serious": "Seria",
"Jolly": "Allegra", "Jolly": "Allegra",
"Naive": "Ingenua", "Naive": "Ingenuaa",
"Modest": "Modesta", "Modest": "Modesta",
"Mild": "Mite", "Mild": "Mite",
"Quiet": "Quieta", "Quiet": "Quieta",

View File

@ -60,86 +60,86 @@ export const PGMdialogue: DialogueTranslationEntries = {
}, },
"breeder": { "breeder": {
"encounter": { "encounter": {
1: "순종적인 포켓몬, 이기적인 포켓몬… 포켓몬들은 각기 다른 성격을 가지고 있지.", 1: "Obedient Pokémon, selfish Pokémon… Pokémon have unique characteristics.",
2: "내 태도가 그렇게 좋진 않아도, 내 포켓몬들은 잘 키웠어.", 2: "Even though my upbringing and behavior are poor, I've raised my Pokémon well.",
3: "음, 넌 포켓몬들을 훈육하니? 너무 심하게 하는 것은 좋지 않다고.", 3: "Hmm, do you discipline your Pokémon? Pampering them too much is no good.",
}, },
"victory": { "victory": {
1: "각 포켓몬의 성격을 이해하고 육성하는 건 중요해.", 1: "It is important to nurture and train each Pokémon's characteristics.",
2: "사악한 나와는 달리 좋은 포켓몬들도 있지.", 2: "Unlike my diabolical self, these are some good Pokémon.",
3: "과도한 칭찬은 사람과 포켓몬 모두에게 독이 될 수 있어.", 3: "Too much praise can spoil both Pokémon and people.",
}, },
"defeat": { "defeat": {
1: "배틀에서 지더라도 포켓몬에게 화를 내면 안돼.", 1: "You should not get angry at your Pokémon, even if you lose a battle.",
2: "어때? 꽤 괜찮은 포켓몬이지? 난 무언가 기르는 게 꽤 잘 맞더라고.", 2: "Right? Pretty good Pokémon, huh? I'm suited to raising things.",
3: "네가 포켓몬을 얼마나 사랑하는지와 관계없이, 그들이 잘못을 저지르면 바로잡아야 해." 3: "No matter how much you love your Pokémon, you still have to discipline them when they misbehave."
} }
}, },
"breeder_female": { "breeder_female": {
"encounter": { "encounter": {
1: "포켓몬은 절대 널 배신하지 않아. 네가 주는 사랑을 고스란히 되돌려 준다구.", 1: "Pokémon never betray you. They return all the love you give them.",
2: "좋은 포켓몬을 키우는 팁을 알려줄까?", 2: "Shall I give you a tip for training good Pokémon?",
3: "난 아주 특별한 방법으로 아주 특별한 포켓몬들을 키웠지!" 3: "I have raised these very special Pokémon using a special method."
}, },
"victory": { "victory": {
1: "이런… 이렇게 될 리가 없는데. 내가 블렌딩을 잘못 썼나?", 1: "Ugh… It wasn't supposed to be like this. Did I administer the wrong blend?",
2: "내 포켓몬에게 이런 일이… 넌 네 포켓몬에게 뭘 먹이는 거야?", 2: "How could that happen to my Pokémon… What are you feeding your Pokémon?",
3: "내가 지는 건 그저 내가 시간을 때우고 있었다는 걸 알려주는 거지. 내 자존심엔 전혀 상처가 되지 않는다구." 3: "If I lose, that tells you I was just killing time. It doesn't damage my ego at all."
}, },
"defeat": { "defeat": {
1: "이건 내 포켓몬들이 내 사랑을 받아들였다는 걸 입증하지.", 1: "This proves my Pokémon have accepted my love.",
2: "좋은 포켓몬을 키우는 진짜 비결은 좋은 포켓몬을 잡는 거야.", 2: "The real trick behind training good Pokémon is catching good Pokémon.",
3: "포켓몬의 강함과 약함은 네가 어떻게 키우느냐에 따라 결정되지." 3: "Pokémon will be strong or weak depending on how you raise them."
} }
}, },
"fisherman": { "fisherman": {
"encounter": { "encounter": {
1: "앗! 너 때문에 한 마리 놓쳤잖아! 어떻게 할 거야?", 1: "Aack! You made me lose a bite!\nWhat are you going to do about it?",
2: "저리 가! 네가 포켓몬들을 놀래키고 있잖아!", 2: "Go away! You're scaring the Pokémon!",
3: "네가 승리를 낚을 수 있을지 한번 보자고!", 3: "Let's see if you can reel in a victory!",
}, },
"victory": { "victory": {
1: "그냥 잊어버려.", 1: "Just forget about it.",
2: "다음 번엔 내가 승리의 나팔을 울리고 있을거다!", 2: "Next time, I'll be reelin' in the triumph!",
3: "이번엔 내가 물살을 과소평가했나보군.", 3: "Guess I underestimated the currents this time.",
}, },
}, },
"fisherman_female": { "fisherman_female": {
"encounter": { "encounter": {
1: "월척이다!", 1: "Woah! I've hooked a big one!",
2: "낚시대는 던져졌고, 이젠 성공을 끌어올리는 일만 남았다!", 2: "Line's in, ready to reel in success!",
3: "파도를 일으킬 준비는 끝났어!" 3: "Ready to make waves!"
}, },
"victory": { "victory": {
1: "더 튼튼한 바늘을 가지고 돌아올테다.", 1: "I'll be back with a stronger hook.",
2: "다음번엔 꼭 성공을 낚을 거야!", 2: "I'll reel in victory next time.",
3: "다시 돌아올 날을 기다리며 바늘을 다듬고 있을게!" 3: "I'm just sharpening my hooks for the comeback!"
}, },
}, },
"swimmer": { "swimmer": {
"encounter": { "encounter": {
1: "뛰어들 시간이다!", 1: "Time to dive in!",
2: "승리의 파도 속으로!", 2: "Let's ride the waves of victory!",
3: "첨벙댈 준비는 끝났어!", 3: "Ready to make a splash!",
}, },
"victory": { "victory": {
1: "패배에 젖어버렸어…", 1: "Drenched in defeat!",
2: "패배의 파도였군.", 2: "A wave of defeat!",
3: "해변으로 돌아갈 시간이군.", 3: "Back to shore, I guess.",
}, },
}, },
"backpacker": { "backpacker": {
"encounter": { "encounter": {
1: "게임 시작이야! 짐 단단히 싸놓으라구!", 1: "Pack up, game on!",
2: "네가 속도를 유지할 수 있을지 보자!", 2: "Let's see if you can keep pace!",
3: "각오 단단히 하라고!", 3: "Gear up, challenger!",
4: "20년 동안 나 자신을 찾기 위해 헤매왔어… 근데 내가 어디 있지?" 4: "I've spent 20 years trying to find myself… But where am I?"
}, },
"victory": { "victory": {
1: "이번엔 걸려 넘어져 버렸네!", 1: "Tripped up this time!",
2: "내가 속도를 잃어버렸잖아!", 2: "Oh, I think I'm lost.",
3: "막다른 길이야!", 3: "Dead end!",
4: "잠깐! 그래 거기, 혹시 내가 누군지 아나?" 4: "Wait up a second! Hey! Don't you know who I am?"
}, },
}, },
"ace_trainer": { "ace_trainer": {

View File

@ -16,26 +16,26 @@ export const PGMachv: AchievementTranslationEntries = {
name: "小有积蓄", name: "小有积蓄",
}, },
"100K_MONEY": { "100K_MONEY": {
name: "大户人家", name: "富裕",
}, },
"1M_MONEY": { "1M_MONEY": {
name: "百万富翁", name: "百万富翁",
}, },
"10M_MONEY": { "10M_MONEY": {
name: "暴发户", name: "百分之一",
}, },
"DamageAchv": { "DamageAchv": {
description: "在单次攻击中造成 {{damageAmount}} 点伤害", description: "在单次攻击中造成 {{damageAmount}} 点伤害",
}, },
"250_DMG": { "250_DMG": {
name: "重拳出击", name: "强力攻击者",
}, },
"1000_DMG": { "1000_DMG": {
name: "神拳猛击", name: "更强力攻击者",
}, },
"2500_DMG": { "2500_DMG": {
name: "夺少?", name: "伤害真高!",
}, },
"10000_DMG": { "10000_DMG": {
name: "一拳超人", name: "一拳超人",
@ -45,68 +45,68 @@ export const PGMachv: AchievementTranslationEntries = {
description: "通过技能、能力或携带的道具一次性治疗 {{healAmount}} {{HP}}点", description: "通过技能、能力或携带的道具一次性治疗 {{healAmount}} {{HP}}点",
}, },
"250_HEAL": { "250_HEAL": {
name: "新手奶妈", name: "新手治疗师",
}, },
"1000_HEAL": { "1000_HEAL": {
name: "治疗担当", name: "高阶治疗师",
}, },
"2500_HEAL": { "2500_HEAL": {
name: "牧师", name: "牧师",
}, },
"10000_HEAL": { "10000_HEAL": {
name: "泉水", name: "恢复大师",
}, },
"LevelAchv": { "LevelAchv": {
description: "将一只宝可梦提升到 Lv{{level}}", description: "将一只宝可梦提升到 Lv{{level}}",
}, },
"LV_100": { "LV_100": {
name: "别急,后面还有", name: "不止于此, 还有更多!",
}, },
"LV_250": { "LV_250": {
name: "精英", name: "精英",
}, },
"LV_1000": { "LV_1000": {
name: "天外有天", name: "超越极限",
}, },
"RibbonAchv": { "RibbonAchv": {
description: "累计获得 {{ribbonAmount}} 个勋章", description: "累计获得 {{ribbonAmount}} 个勋章",
}, },
"10_RIBBONS": { "10_RIBBONS": {
name: "宝可梦联冠军", name: "宝可梦联冠军",
}, },
"25_RIBBONS": { "25_RIBBONS": {
name: "超级球联盟冠军", name: "超级联赛冠军",
}, },
"50_RIBBONS": { "50_RIBBONS": {
name: "高级球联盟冠军", name: "至尊联赛冠军",
}, },
"75_RIBBONS": { "75_RIBBONS": {
name: "肉鸽球联盟冠军", name: "肉鸽联赛冠军",
}, },
"100_RIBBONS": { "100_RIBBONS": {
name: "大师球联盟冠军", name: "大师联赛冠军",
}, },
"TRANSFER_MAX_BATTLE_STAT": { "TRANSFER_MAX_BATTLE_STAT": {
name: "团队协作", name: "团队协作",
description: "在一项属性强化至最大时用接力棒传递给其他宝可梦", description: "Baton pass to another party member with at least one stat maxed out",
}, },
"MAX_FRIENDSHIP": { "MAX_FRIENDSHIP": {
name: "亲密无间", name: "亲密度最大化",
description: "使一只宝可梦的亲密度达到最大值", description: "使一只宝可梦的亲密度达到最大值",
}, },
"MEGA_EVOLVE": { "MEGA_EVOLVE": {
name: "大变身", name: "Mega进化",
description: "超级进化一只宝可梦", description: "Mega进化一只宝可梦",
}, },
"GIGANTAMAX": { "GIGANTAMAX": {
name: "这位更是重量级", name: "极巨化",
description: "极巨化一只宝可梦", description: "极巨化一只宝可梦",
}, },
"TERASTALLIZE": { "TERASTALLIZE": {
name: "本系爱好者", name: "太晶狂热者",
description: "太晶化一只宝可梦", description: "太晶化一只宝可梦",
}, },
"STELLAR_TERASTALLIZE": { "STELLAR_TERASTALLIZE": {
@ -118,60 +118,60 @@ export const PGMachv: AchievementTranslationEntries = {
description: "使用基因之楔将两只宝可梦融合在一起", description: "使用基因之楔将两只宝可梦融合在一起",
}, },
"MINI_BLACK_HOLE": { "MINI_BLACK_HOLE": {
name: "一大洞的道具", name: "巨量道具",
description: "获得一个迷你黑洞", description: "获得一个迷你黑洞",
}, },
"CATCH_MYTHICAL": { "CATCH_MYTHICAL": {
name: "神秘礼物", name: "幻之宝可梦",
description: "捕捉一只幻之宝可梦", description: "捕捉一只幻之宝可梦",
}, },
"CATCH_SUB_LEGENDARY": { "CATCH_SUB_LEGENDARY": {
name: "二级传说", name: "准-传说宝可梦",
description: "捕捉一只准传说宝可梦", description: "捕捉一只准传说宝可梦",
}, },
"CATCH_LEGENDARY": { "CATCH_LEGENDARY": {
name: "传说", name: "传说宝可梦",
description: "捕捉一只传说宝可梦", description: "捕捉一只传说宝可梦",
}, },
"SEE_SHINY": { "SEE_SHINY": {
name: "闪耀夺目", name: "异色宝可梦",
description: "在野外找到一只闪光宝可梦", description: "在野外找到一只异色宝可梦",
}, },
"SHINY_PARTY": { "SHINY_PARTY": {
name: "呕心沥血", name: "全队异色",
description: "拥有一支由闪光宝可梦组成的满员队伍", description: "拥有一支由异色宝可梦组成的满员队伍",
}, },
"HATCH_MYTHICAL": { "HATCH_MYTHICAL": {
name: "幻蛋", name: "幻蛋",
description: "从蛋中孵化出一只幻之宝可梦", description: "从蛋中孵化出一只幻之宝可梦",
}, },
"HATCH_SUB_LEGENDARY": { "HATCH_SUB_LEGENDARY": {
name: "二级传说蛋", name: "准-传说蛋",
description: "从蛋中孵化出一只二级传说宝可梦", description: "从蛋中孵化出一只传说宝可梦",
}, },
"HATCH_LEGENDARY": { "HATCH_LEGENDARY": {
name: "传说蛋", name: "传说蛋",
description: "从蛋中孵化出一只传说宝可梦", description: "从蛋中孵化出一只准-传说宝可梦",
}, },
"HATCH_SHINY": { "HATCH_SHINY": {
name: "金色传说!", name: "异色蛋",
description: "从蛋中孵化出一只闪光宝可梦", description: "从蛋中孵化出一只异色宝可梦",
}, },
"HIDDEN_ABILITY": { "HIDDEN_ABILITY": {
name: "隐藏力", name: "隐藏力",
description: "捕捉一只拥有隐藏特性的宝可梦", description: "捕捉一只拥有隐藏特性的宝可梦",
}, },
"PERFECT_IVS": { "PERFECT_IVS": {
name: "合格证", name: "完美个体",
description: "获得一只拥有完美个体值的宝可梦", description: "获得一只拥有完美个体值的宝可梦",
}, },
"CLASSIC_VICTORY": { "CLASSIC_VICTORY": {
name: "战无不胜", name: "经典无敌",
description: "在经典模式中通关游戏", description: "在经典模式中通关游戏",
}, },
"MONO_GEN_ONE": { "MONO_GEN_ONE": {
name: "最初的劲敌", name: "初代劲敌",
description: "完成仅限第一世代的挑战.", description: "完成仅限第一世代的挑战.",
}, },
"MONO_GEN_TWO": { "MONO_GEN_TWO": {
@ -179,31 +179,31 @@ export const PGMachv: AchievementTranslationEntries = {
description: "完成仅限第二世代的挑战.", description: "完成仅限第二世代的挑战.",
}, },
"MONO_GEN_THREE": { "MONO_GEN_THREE": {
name: "“水太多了”", name: "水太多了?",
description: "完成仅限第三世代的挑战.", description: "完成仅限第三世代的挑战.",
}, },
"MONO_GEN_FOUR": { "MONO_GEN_FOUR": {
name: "她真是最强冠军吗?", name: "她真的是最难的吗?",
description: "完成仅限第四世代的挑战.", description: "完成仅限第四世代的挑战.",
}, },
"MONO_GEN_FIVE": { "MONO_GEN_FIVE": {
name: "全原创", name: "原创",
description: "完成仅限第五世代的挑战.", description: "完成仅限第五世代的挑战.",
}, },
"MONO_GEN_SIX": { "MONO_GEN_SIX": {
name: "女大公", name: "近乎贵族",
description: "完成仅限第六世代的挑战.", description: "完成仅限第六世代的挑战.",
}, },
"MONO_GEN_SEVEN": { "MONO_GEN_SEVEN": {
name: "首届冠军", name: "仅技术上(可行)",
description: "完成仅限第七世代的挑战.", description: "完成仅限第七世代的挑战.",
}, },
"MONO_GEN_EIGHT": { "MONO_GEN_EIGHT": {
name: "冠军时刻", name: "冠军时刻!",
description: "完成仅限第八世代的挑战.", description: "完成仅限第八世代的挑战.",
}, },
"MONO_GEN_NINE": { "MONO_GEN_NINE": {
name: "她又放水了", name: "她对你手下留情了",
description: "完成仅限第九世代的挑战.", description: "完成仅限第九世代的挑战.",
}, },
@ -211,58 +211,58 @@ export const PGMachv: AchievementTranslationEntries = {
description: "完成 {{type}} 单属性挑战.", description: "完成 {{type}} 单属性挑战.",
}, },
"MONO_NORMAL": { "MONO_NORMAL": {
name: "异乎寻常的寻常", name: "Mono 一般",
}, },
"MONO_FIGHTING": { "MONO_FIGHTING": {
name: "我有真功夫", name: "功夫高手",
}, },
"MONO_FLYING": { "MONO_FLYING": {
name: "愤怒的小鸟", name: "Mono 飞行",
}, },
"MONO_POISON": { "MONO_POISON": {
name: "关都地区特色", name: "关东的最爱",
}, },
"MONO_GROUND": { "MONO_GROUND": {
name: "地震预报", name: "Mono 地面",
}, },
"MONO_ROCK": { "MONO_ROCK": {
name: "坚如磐石", name: "坚如磐石",
}, },
"MONO_BUG": { "MONO_BUG": {
name: "音箱蟀侠", name: "如大针蜂般刺痛",
}, },
"MONO_GHOST": { "MONO_GHOST": {
name: "捉鬼敢死队", name: "你将要召唤谁?",
}, },
"MONO_STEEL": { "MONO_STEEL": {
name: "铁巨人", name: "Mono 钢",
}, },
"MONO_FIRE": { "MONO_FIRE": {
name: "搓火球解决一切", name: "Mono 火",
}, },
"MONO_WATER": { "MONO_WATER": {
name: "当雨来临,倾盆而下", name: "当雨来临,倾盆而下",
}, },
"MONO_GRASS": { "MONO_GRASS": {
name: "别踏这个青", name: "Mono 草",
}, },
"MONO_ELECTRIC": { "MONO_ELECTRIC": {
name: "瞄准大岩蛇的角!", name: "Mono 电",
}, },
"MONO_PSYCHIC": { "MONO_PSYCHIC": {
name: "脑洞大开", name: "Mono 超能力",
}, },
"MONO_ICE": { "MONO_ICE": {
name: "如履薄冰", name: "Mono 冰",
}, },
"MONO_DRAGON": { "MONO_DRAGON": {
name: "准神俱乐部", name: "Mono 龙",
}, },
"MONO_DARK": { "MONO_DARK": {
name: "总有叛逆期", name: "这只是一个阶段",
}, },
"MONO_FAIRY": { "MONO_FAIRY": {
name: "林克,醒醒!", name: "Mono 妖精",
}, },
} as const; } as const;

View File

@ -4,7 +4,7 @@ export const battle: SimpleTranslationEntries = {
"bossAppeared": "{{bossName}} 出現了.", "bossAppeared": "{{bossName}} 出現了.",
"trainerAppeared": "{{trainerName}}\n想要和你對戰!", "trainerAppeared": "{{trainerName}}\n想要和你對戰!",
"trainerAppearedDouble": "{{trainerName}}\n想要和你對戰!", "trainerAppearedDouble": "{{trainerName}}\n想要和你對戰!",
"singleWildAppeared": "一野生的 {{pokemonName}} 出現了!", "singleWildAppeared": "一野生的 {{pokemonName}} 出現了!",
"multiWildAppeared": "野生的 {{pokemonName1}}\n和 {{pokemonName2}} 出現了!", "multiWildAppeared": "野生的 {{pokemonName1}}\n和 {{pokemonName2}} 出現了!",
"playerComeBack": "回來吧, {{pokemonName}}!", "playerComeBack": "回來吧, {{pokemonName}}!",
"trainerComeBack": "{{trainerName}} 收回了 {{pokemonName}}!", "trainerComeBack": "{{trainerName}} 收回了 {{pokemonName}}!",

View File

@ -153,7 +153,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
SACRED_ASH: { name: "聖灰" }, SACRED_ASH: { name: "聖灰" },
REVIVER_SEED: { REVIVER_SEED: {
name: "復活種子", name: "復活種子",
description: "恢復1瀕死寶可夢的HP至1/2。", description: "恢復1瀕死寶可夢的HP至1/2。",
}, },
ETHER: { name: "PP單項小補劑" }, ETHER: { name: "PP單項小補劑" },
MAX_ETHER: { name: "PP單項全補劑" }, MAX_ETHER: { name: "PP單項全補劑" },

View File

@ -71,7 +71,7 @@ export const move: MoveTranslationEntries = {
}, },
doubleKick: { doubleKick: {
name: "二連踢", name: "二連踢",
effect: "用2腳踢飛對手進行攻擊。\n連續次給予傷害", effect: "用2腳踢飛對手進行攻擊。\n連續次給予傷害",
}, },
megaKick: { megaKick: {
name: "百萬噸重踢", name: "百萬噸重踢",
@ -2886,7 +2886,7 @@ export const move: MoveTranslationEntries = {
}, },
dragonDarts: { dragonDarts: {
name: "龍箭", name: "龍箭",
effect: "讓多龍梅西亞進行2次攻擊。\n如果對手有寶可夢,\n則對它們各進行次攻擊", effect: "讓多龍梅西亞進行2次攻擊。\n如果對手有寶可夢,\n則對它們各進行次攻擊",
}, },
teatime: { teatime: {
name: "茶會", name: "茶會",

View File

@ -1317,7 +1317,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.EVOLUTION_ITEM, (party: Pokemon[]) => { new WeightedModifierType(modifierTypes.EVOLUTION_ITEM, (party: Pokemon[]) => {
return Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 15), 8); return Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 15), 8);
}, 8), }, 8),
new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => party[0].scene.gameMode.isClassic && party[0].scene.currentBattle.waveIndex < 180 ? 1 : 0, 1), new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => party[0].scene.gameMode.isClassic ? 1 : 0, 1),
new WeightedModifierType(modifierTypes.TM_GREAT, 2), new WeightedModifierType(modifierTypes.TM_GREAT, 2),
new WeightedModifierType(modifierTypes.MEMORY_MUSHROOM, (party: Pokemon[]) => { new WeightedModifierType(modifierTypes.MEMORY_MUSHROOM, (party: Pokemon[]) => {
if (!party.find(p => p.getLearnableLevelMoves().length)) { if (!party.find(p => p.getLearnableLevelMoves().length)) {

View File

@ -79,7 +79,7 @@ export const VARIANT_OVERRIDE: Variant = 0;
export const OPP_SPECIES_OVERRIDE: Species | integer = 0; export const OPP_SPECIES_OVERRIDE: Species | integer = 0;
export const OPP_LEVEL_OVERRIDE: number = 0; export const OPP_LEVEL_OVERRIDE: number = 0;
export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE; export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE; export const OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
export const OPP_GENDER_OVERRIDE: Gender = null; export const OPP_GENDER_OVERRIDE: Gender = null;
export const OPP_MOVESET_OVERRIDE: Array<Moves> = []; export const OPP_MOVESET_OVERRIDE: Array<Moves> = [];

View File

@ -1024,6 +1024,7 @@ export class EncounterPhase extends BattlePhase {
}); });
if (this.scene.currentBattle.battleType !== BattleType.TRAINER) { if (this.scene.currentBattle.battleType !== BattleType.TRAINER) {
enemyField.map(p => this.scene.pushPhase(new PostSummonPhase(this.scene, p.getBattlerIndex())));
const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier); const ivScannerModifier = this.scene.findModifier(m => m instanceof IvScannerModifier);
if (ivScannerModifier) { if (ivScannerModifier) {
enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6)))); enemyField.map(p => this.scene.pushPhase(new ScanIvsPhase(this.scene, p.getBattlerIndex(), Math.min(ivScannerModifier.getStackCount() * 2, 6))));
@ -1479,10 +1480,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
if (!this.loaded || this.scene.currentBattle.battleType === BattleType.TRAINER || (this.scene.currentBattle.waveIndex % 10) === 1) { if (!this.loaded || this.scene.currentBattle.battleType === BattleType.TRAINER || (this.scene.currentBattle.waveIndex % 10) === 1) {
this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true); this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeActiveTrigger, true);
}
if (pokemon.isPlayer()) {
// postSummon for player only here, since we want the postSummon from opponent to be call in the turnInitPhase
// covering both wild & trainer battles
this.queuePostSummon(); this.queuePostSummon();
} }
} }
@ -1797,8 +1795,6 @@ export class TurnInitPhase extends FieldPhase {
start() { start() {
super.start(); super.start();
const enemyField = this.scene.getEnemyField().filter(p => p.isActive()) as Pokemon[];
enemyField.map(p => this.scene.unshiftPhase(new PostSummonPhase(this.scene, p.getBattlerIndex())));
this.scene.getPlayerField().forEach(p => { this.scene.getPlayerField().forEach(p => {
// If this pokemon is in play and evolved into something illegal under the current challenge, force a switch // If this pokemon is in play and evolved into something illegal under the current challenge, force a switch

View File

@ -5,11 +5,16 @@ import * as overrides from "#app/overrides";
import {Abilities} from "#app/data/enums/abilities"; import {Abilities} from "#app/data/enums/abilities";
import {Species} from "#app/data/enums/species"; import {Species} from "#app/data/enums/species";
import { import {
CommandPhase, TurnInitPhase CheckSwitchPhase, CommandPhase, MessagePhase,
PostSummonPhase,
ShinySparklePhase,
ShowAbilityPhase,
StatChangePhase,
SummonPhase,
ToggleDoublePositionPhase, TurnInitPhase
} from "#app/phases"; } from "#app/phases";
import {Mode} from "#app/ui/ui"; import {Mode} from "#app/ui/ui";
import {BattleStat} from "#app/data/battle-stat"; import {BattleStat} from "#app/data/battle-stat";
import {Moves} from "#app/data/enums/moves";
describe("Abilities - Intimidate", () => { describe("Abilities - Intimidate", () => {
@ -29,161 +34,50 @@ describe("Abilities - Intimidate", () => {
beforeEach(() => { beforeEach(() => {
game = new GameManager(phaserGame); game = new GameManager(phaserGame);
vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(true); vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.RATTATA); vi.spyOn(overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(Species.MIGHTYENA);
vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); vi.spyOn(overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE);
vi.spyOn(overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.HYDRATION);
vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE); vi.spyOn(overrides, "ABILITY_OVERRIDE", "get").mockReturnValue(Abilities.INTIMIDATE);
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
vi.spyOn(overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([Moves.SPLASH,Moves.SPLASH,Moves.SPLASH,Moves.SPLASH]);
}); });
it("single - wild with switch", async() => { it("INTIMIDATE", async() => {
await game.runToSummon([ await game.runToSummon([
Species.MIGHTYENA, Species.MIGHTYENA,
Species.POOCHYENA, Species.MIGHTYENA,
]); ]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { await game.phaseInterceptor.run(PostSummonPhase);
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to(CommandPhase, false);
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.MIGHTYENA);
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1);
await game.switchPokemon(1);
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.POOCHYENA);
expect(game.scene.getParty()[0].summonData).not.toBeUndefined();
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(0);
await game.phaseInterceptor.run(ShowAbilityPhase);
await game.phaseInterceptor.run(StatChangePhase);
battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1);
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
}, 20000);
it("single - boss should only trigger once then switch", async() => { await game.phaseInterceptor.run(SummonPhase);
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10); await game.phaseInterceptor.run(ShinySparklePhase, () => game.isCurrentPhase(ToggleDoublePositionPhase));
await game.runToSummon([ await game.phaseInterceptor.run(ToggleDoublePositionPhase);
Species.MIGHTYENA,
Species.POOCHYENA,
]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => { game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE); game.setMode(Mode.MESSAGE);
game.endPhase(); game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase)); });
await game.phaseInterceptor.to(CommandPhase, false); await game.phaseInterceptor.run(CheckSwitchPhase);
await game.phaseInterceptor.run(PostSummonPhase);
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; await game.phaseInterceptor.run(ShowAbilityPhase);
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1); game.scene.moveAnimations = null; // Mandatory to avoid crash
await game.switchPokemon(1); await game.phaseInterceptor.run(StatChangePhase);
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.POOCHYENA);
battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1);
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
}, 20000);
it("single - trainer should only trigger once with switch", async() => {
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
await game.runToSummon([
Species.MIGHTYENA,
Species.POOCHYENA,
]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to(CommandPhase, false);
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1); expect(battleStatsOpponent[BattleStat.ATK]).toBe(-1);
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1);
await game.switchPokemon(1);
expect(game.scene.getParty()[0].species.speciesId).toBe(Species.POOCHYENA);
battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-1);
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; await game.phaseInterceptor.run(MessagePhase);
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2); await game.phaseInterceptor.run(TurnInitPhase);
}, 200000); await game.phaseInterceptor.run(CommandPhase);
it("double - trainer should only trigger once per pokemon", async() => {
vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(false);
vi.spyOn(overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(5);
await game.runToSummon([
Species.MIGHTYENA,
Species.POOCHYENA,
]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to(CommandPhase, false);
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats;
expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats;
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
}, 20000);
it("double - wild: should only trigger once per pokemon", async() => {
vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(false);
vi.spyOn(overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(3);
await game.runToSummon([
Species.MIGHTYENA,
Species.POOCHYENA,
]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to(CommandPhase, false);
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats;
expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats;
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
}, 20000);
it("double - boss: should only trigger once per pokemon", async() => {
vi.spyOn(overrides, "SINGLE_BATTLE_OVERRIDE", "get").mockReturnValue(false);
vi.spyOn(overrides, "DOUBLE_BATTLE_OVERRIDE", "get").mockReturnValue(true);
vi.spyOn(overrides, "STARTING_WAVE_OVERRIDE", "get").mockReturnValue(10);
await game.runToSummon([
Species.MIGHTYENA,
Species.POOCHYENA,
]);
game.onNextPrompt("CheckSwitchPhase", Mode.CONFIRM, () => {
game.setMode(Mode.MESSAGE);
game.endPhase();
}, () => game.isCurrentPhase(CommandPhase) || game.isCurrentPhase(TurnInitPhase));
await game.phaseInterceptor.to(CommandPhase, false);
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(-2);
const battleStatsOpponent2 = game.scene.currentBattle.enemyParty[1].summonData.battleStats;
expect(battleStatsOpponent2[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(-2);
const battleStatsPokemon2 = game.scene.getParty()[1].summonData.battleStats;
expect(battleStatsPokemon2[BattleStat.ATK]).toBe(-2);
}, 20000); }, 20000);
}); });

View File

@ -5,7 +5,11 @@ import * as overrides from "#app/overrides";
import {Abilities} from "#app/data/enums/abilities"; import {Abilities} from "#app/data/enums/abilities";
import {Species} from "#app/data/enums/species"; import {Species} from "#app/data/enums/species";
import { import {
CommandPhase, MessagePhase,
PostSummonPhase,
ShowAbilityPhase,
StatChangePhase,
ToggleDoublePositionPhase
} from "#app/phases"; } from "#app/phases";
import {BattleStat} from "#app/data/battle-stat"; import {BattleStat} from "#app/data/battle-stat";
@ -36,10 +40,26 @@ describe("Abilities - Intrepid Sword", () => {
await game.runToSummon([ await game.runToSummon([
Species.ZACIAN, Species.ZACIAN,
]); ]);
await game.phaseInterceptor.to(CommandPhase, false); await game.phaseInterceptor.runFrom(PostSummonPhase).to(PostSummonPhase);
const battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats; expect(game.scene.getParty()[0].summonData).not.toBeUndefined();
let battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(0);
await game.phaseInterceptor.run(ShowAbilityPhase);
await game.phaseInterceptor.run(StatChangePhase);
battleStatsPokemon = game.scene.getParty()[0].summonData.battleStats;
expect(battleStatsPokemon[BattleStat.ATK]).toBe(1); expect(battleStatsPokemon[BattleStat.ATK]).toBe(1);
const battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats; }, 20000);
it("INTREPID SWORD on opponent", async() => {
await game.runToSummon([
Species.ZACIAN,
]);
let battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(0);
await game.phaseInterceptor.runFrom(PostSummonPhase).to(ToggleDoublePositionPhase);
await game.phaseInterceptor.run(StatChangePhase);
await game.phaseInterceptor.run(MessagePhase);
battleStatsOpponent = game.scene.currentBattle.enemyParty[0].summonData.battleStats;
expect(battleStatsOpponent[BattleStat.ATK]).toBe(1); expect(battleStatsOpponent[BattleStat.ATK]).toBe(1);
}, 20000); }, 20000);
}); });

View File

@ -1,6 +1,6 @@
export default class TextInterceptor { export default class TextInterceptor {
private scene; private scene;
public logs = []; private logs = [];
constructor(scene) { constructor(scene) {
this.scene = scene; this.scene = scene;
scene.messageWrapper = this; scene.messageWrapper = this;

View File

@ -28,7 +28,6 @@ import {MockClock} from "#app/test/utils/mocks/mockClock";
import {Command} from "#app/ui/command-ui-handler"; import {Command} from "#app/ui/command-ui-handler";
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler"; import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
import {Button} from "#app/enums/buttons"; import {Button} from "#app/enums/buttons";
import PartyUiHandler, {PartyUiMode} from "#app/ui/party-ui-handler";
/** /**
* Class to manage the game state and transitions between phases. * Class to manage the game state and transitions between phases.
@ -280,15 +279,4 @@ export default class GameManager {
resolve(); resolve();
}); });
} }
async switchPokemon(pokemonIndex: number) {
this.onNextPrompt("CommandPhase", Mode.COMMAND, () => {
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.SWITCH, (this.scene.getCurrentPhase() as CommandPhase).getPokemon().getFieldIndex(), null, PartyUiHandler.FilterNonFainted);
});
this.onNextPrompt("CommandPhase", Mode.PARTY, () => {
(this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.POKEMON, pokemonIndex, false);
});
await this.phaseInterceptor.run(CommandPhase);
await this.phaseInterceptor.to(CommandPhase);
}
} }