mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 13:59:27 +02:00
Compare commits
27 Commits
f86bc385e4
...
6212e918c3
Author | SHA1 | Date | |
---|---|---|---|
|
6212e918c3 | ||
|
46c78a0540 | ||
|
98809c28bd | ||
|
e0559e03ff | ||
|
f6b99780fb | ||
|
19af9bdb8b | ||
|
8e61b642a3 | ||
|
b4d1c39064 | ||
|
5402722468 | ||
|
2480ee2be8 | ||
|
0b2077d036 | ||
|
9ab3009091 | ||
|
776d69fe58 | ||
|
ee59eaba0c | ||
|
d086c69081 | ||
|
113c7bde17 | ||
|
1b2cb1de00 | ||
|
6f3d1b9116 | ||
|
65f28b7dc4 | ||
|
4dda982ff6 | ||
|
caa62987d6 | ||
|
808e29f55e | ||
|
1b9e4e05ee | ||
|
2439754aed | ||
|
065659c396 | ||
|
3a88045871 | ||
|
a6f2e5ba04 |
@ -1 +1 @@
|
|||||||
Subproject commit ab2716d5440c25f73986664aa3f3131821c3c392
|
Subproject commit 1ea8f865e30d1940caa0fceeabf37ae2e4689471
|
@ -45736,6 +45736,285 @@ export const tmSpecies: TmSpecies = {
|
|||||||
SpeciesId.HISUI_ARCANINE,
|
SpeciesId.HISUI_ARCANINE,
|
||||||
SpeciesId.HISUI_AVALUGG,
|
SpeciesId.HISUI_AVALUGG,
|
||||||
],
|
],
|
||||||
|
[MoveId.SHOCK_WAVE]: [
|
||||||
|
SpeciesId.RATTATA,
|
||||||
|
SpeciesId.RATICATE,
|
||||||
|
SpeciesId.PIKACHU,
|
||||||
|
SpeciesId.RAICHU,
|
||||||
|
SpeciesId.NIDORAN_F,
|
||||||
|
SpeciesId.NIDORINA,
|
||||||
|
SpeciesId.NIDOQUEEN,
|
||||||
|
SpeciesId.NIDORAN_M,
|
||||||
|
SpeciesId.NIDORINO,
|
||||||
|
SpeciesId.NIDOKING,
|
||||||
|
SpeciesId.CLEFAIRY,
|
||||||
|
SpeciesId.CLEFABLE,
|
||||||
|
SpeciesId.JIGGLYPUFF,
|
||||||
|
SpeciesId.WIGGLYTUFF,
|
||||||
|
SpeciesId.MEOWTH,
|
||||||
|
SpeciesId.PERSIAN,
|
||||||
|
SpeciesId.ABRA,
|
||||||
|
SpeciesId.KADABRA,
|
||||||
|
SpeciesId.ALAKAZAM,
|
||||||
|
SpeciesId.MAGNEMITE,
|
||||||
|
SpeciesId.MAGNETON,
|
||||||
|
SpeciesId.GRIMER,
|
||||||
|
SpeciesId.MUK,
|
||||||
|
SpeciesId.VOLTORB,
|
||||||
|
SpeciesId.ELECTRODE,
|
||||||
|
SpeciesId.LICKITUNG,
|
||||||
|
SpeciesId.KOFFING,
|
||||||
|
SpeciesId.WEEZING,
|
||||||
|
SpeciesId.RHYHORN,
|
||||||
|
SpeciesId.RHYDON,
|
||||||
|
SpeciesId.CHANSEY,
|
||||||
|
SpeciesId.TANGELA,
|
||||||
|
SpeciesId.KANGASKHAN,
|
||||||
|
SpeciesId.MR_MIME,
|
||||||
|
SpeciesId.ELECTABUZZ,
|
||||||
|
SpeciesId.TAUROS,
|
||||||
|
SpeciesId.LAPRAS,
|
||||||
|
SpeciesId.JOLTEON,
|
||||||
|
SpeciesId.PORYGON,
|
||||||
|
SpeciesId.SNORLAX,
|
||||||
|
SpeciesId.ZAPDOS,
|
||||||
|
SpeciesId.DRATINI,
|
||||||
|
SpeciesId.DRAGONAIR,
|
||||||
|
SpeciesId.DRAGONITE,
|
||||||
|
SpeciesId.MEWTWO,
|
||||||
|
SpeciesId.MEW,
|
||||||
|
SpeciesId.SENTRET,
|
||||||
|
SpeciesId.FURRET,
|
||||||
|
SpeciesId.CHINCHOU,
|
||||||
|
SpeciesId.LANTURN,
|
||||||
|
SpeciesId.PICHU,
|
||||||
|
SpeciesId.CLEFFA,
|
||||||
|
SpeciesId.IGGLYBUFF,
|
||||||
|
SpeciesId.TOGEPI,
|
||||||
|
SpeciesId.TOGETIC,
|
||||||
|
SpeciesId.MAREEP,
|
||||||
|
SpeciesId.FLAAFFY,
|
||||||
|
SpeciesId.AMPHAROS,
|
||||||
|
SpeciesId.AIPOM,
|
||||||
|
SpeciesId.MISDREAVUS,
|
||||||
|
SpeciesId.GIRAFARIG,
|
||||||
|
SpeciesId.DUNSPARCE,
|
||||||
|
SpeciesId.SNUBBULL,
|
||||||
|
SpeciesId.GRANBULL,
|
||||||
|
SpeciesId.QWILFISH,
|
||||||
|
SpeciesId.PORYGON2,
|
||||||
|
SpeciesId.STANTLER,
|
||||||
|
SpeciesId.ELEKID,
|
||||||
|
SpeciesId.MILTANK,
|
||||||
|
SpeciesId.BLISSEY,
|
||||||
|
SpeciesId.RAIKOU,
|
||||||
|
SpeciesId.TYRANITAR,
|
||||||
|
SpeciesId.LUGIA,
|
||||||
|
SpeciesId.HO_OH,
|
||||||
|
SpeciesId.CELEBI,
|
||||||
|
SpeciesId.ZIGZAGOON,
|
||||||
|
SpeciesId.LINOONE,
|
||||||
|
SpeciesId.WINGULL,
|
||||||
|
SpeciesId.PELIPPER,
|
||||||
|
SpeciesId.RALTS,
|
||||||
|
SpeciesId.KIRLIA,
|
||||||
|
SpeciesId.GARDEVOIR,
|
||||||
|
SpeciesId.SLAKOTH,
|
||||||
|
SpeciesId.VIGOROTH,
|
||||||
|
SpeciesId.SLAKING,
|
||||||
|
SpeciesId.WHISMUR,
|
||||||
|
SpeciesId.LOUDRED,
|
||||||
|
SpeciesId.EXPLOUD,
|
||||||
|
SpeciesId.NOSEPASS,
|
||||||
|
SpeciesId.SKITTY,
|
||||||
|
SpeciesId.DELCATTY,
|
||||||
|
SpeciesId.SABLEYE,
|
||||||
|
SpeciesId.ARON,
|
||||||
|
SpeciesId.LAIRON,
|
||||||
|
SpeciesId.AGGRON,
|
||||||
|
SpeciesId.ELECTRIKE,
|
||||||
|
SpeciesId.MANECTRIC,
|
||||||
|
SpeciesId.PLUSLE,
|
||||||
|
SpeciesId.MINUN,
|
||||||
|
SpeciesId.VOLBEAT,
|
||||||
|
SpeciesId.ILLUMISE,
|
||||||
|
SpeciesId.GULPIN,
|
||||||
|
SpeciesId.SWALOT,
|
||||||
|
SpeciesId.SPOINK,
|
||||||
|
SpeciesId.GRUMPIG,
|
||||||
|
SpeciesId.SPINDA,
|
||||||
|
SpeciesId.ZANGOOSE,
|
||||||
|
SpeciesId.CASTFORM,
|
||||||
|
SpeciesId.KECLEON,
|
||||||
|
SpeciesId.SHUPPET,
|
||||||
|
SpeciesId.BANETTE,
|
||||||
|
SpeciesId.CHIMECHO,
|
||||||
|
SpeciesId.ABSOL,
|
||||||
|
SpeciesId.REGIROCK,
|
||||||
|
SpeciesId.REGICE,
|
||||||
|
SpeciesId.REGISTEEL,
|
||||||
|
SpeciesId.LATIAS,
|
||||||
|
SpeciesId.LATIOS,
|
||||||
|
SpeciesId.KYOGRE,
|
||||||
|
SpeciesId.GROUDON,
|
||||||
|
SpeciesId.RAYQUAZA,
|
||||||
|
SpeciesId.JIRACHI,
|
||||||
|
SpeciesId.DEOXYS,
|
||||||
|
SpeciesId.BIDOOF,
|
||||||
|
SpeciesId.BIBAREL,
|
||||||
|
SpeciesId.SHINX,
|
||||||
|
SpeciesId.LUXIO,
|
||||||
|
SpeciesId.LUXRAY,
|
||||||
|
SpeciesId.CRANIDOS,
|
||||||
|
SpeciesId.RAMPARDOS,
|
||||||
|
SpeciesId.SHIELDON,
|
||||||
|
SpeciesId.BASTIODON,
|
||||||
|
SpeciesId.PACHIRISU,
|
||||||
|
SpeciesId.AMBIPOM,
|
||||||
|
SpeciesId.DRIFLOON,
|
||||||
|
SpeciesId.DRIFBLIM,
|
||||||
|
SpeciesId.BUNEARY,
|
||||||
|
SpeciesId.LOPUNNY,
|
||||||
|
SpeciesId.MISMAGIUS,
|
||||||
|
SpeciesId.GLAMEOW,
|
||||||
|
SpeciesId.PURUGLY,
|
||||||
|
SpeciesId.CHINGLING,
|
||||||
|
SpeciesId.MIME_JR,
|
||||||
|
SpeciesId.HAPPINY,
|
||||||
|
SpeciesId.SPIRITOMB,
|
||||||
|
SpeciesId.MUNCHLAX,
|
||||||
|
SpeciesId.MAGNEZONE,
|
||||||
|
SpeciesId.LICKILICKY,
|
||||||
|
SpeciesId.RHYPERIOR,
|
||||||
|
SpeciesId.TANGROWTH,
|
||||||
|
SpeciesId.ELECTIVIRE,
|
||||||
|
SpeciesId.TOGEKISS,
|
||||||
|
SpeciesId.PORYGON_Z,
|
||||||
|
SpeciesId.GALLADE,
|
||||||
|
SpeciesId.PROBOPASS,
|
||||||
|
SpeciesId.FROSLASS,
|
||||||
|
SpeciesId.ROTOM,
|
||||||
|
SpeciesId.UXIE,
|
||||||
|
SpeciesId.MESPRIT,
|
||||||
|
SpeciesId.AZELF,
|
||||||
|
SpeciesId.DIALGA,
|
||||||
|
SpeciesId.PALKIA,
|
||||||
|
SpeciesId.REGIGIGAS,
|
||||||
|
SpeciesId.GIRATINA,
|
||||||
|
SpeciesId.DARKRAI,
|
||||||
|
SpeciesId.ARCEUS,
|
||||||
|
SpeciesId.VICTINI,
|
||||||
|
SpeciesId.PATRAT,
|
||||||
|
SpeciesId.WATCHOG,
|
||||||
|
SpeciesId.LILLIPUP,
|
||||||
|
SpeciesId.HERDIER,
|
||||||
|
SpeciesId.STOUTLAND,
|
||||||
|
SpeciesId.MUNNA,
|
||||||
|
SpeciesId.MUSHARNA,
|
||||||
|
SpeciesId.BLITZLE,
|
||||||
|
SpeciesId.ZEBSTRIKA,
|
||||||
|
SpeciesId.WOOBAT,
|
||||||
|
SpeciesId.SWOOBAT,
|
||||||
|
SpeciesId.SIGILYPH,
|
||||||
|
SpeciesId.YAMASK,
|
||||||
|
SpeciesId.COFAGRIGUS,
|
||||||
|
SpeciesId.MINCCINO,
|
||||||
|
SpeciesId.CINCCINO,
|
||||||
|
SpeciesId.GOTHITA,
|
||||||
|
SpeciesId.GOTHORITA,
|
||||||
|
SpeciesId.GOTHITELLE,
|
||||||
|
SpeciesId.SOLOSIS,
|
||||||
|
SpeciesId.DUOSION,
|
||||||
|
SpeciesId.REUNICLUS,
|
||||||
|
SpeciesId.EMOLGA,
|
||||||
|
SpeciesId.FRILLISH,
|
||||||
|
SpeciesId.JELLICENT,
|
||||||
|
SpeciesId.JOLTIK,
|
||||||
|
SpeciesId.GALVANTULA,
|
||||||
|
SpeciesId.KLINK,
|
||||||
|
SpeciesId.KLANG,
|
||||||
|
SpeciesId.KLINKLANG,
|
||||||
|
SpeciesId.EELEKTRIK,
|
||||||
|
SpeciesId.EELEKTROSS,
|
||||||
|
SpeciesId.ELGYEM,
|
||||||
|
SpeciesId.BEHEEYEM,
|
||||||
|
SpeciesId.LITWICK,
|
||||||
|
SpeciesId.LAMPENT,
|
||||||
|
SpeciesId.CHANDELURE,
|
||||||
|
SpeciesId.AXEW,
|
||||||
|
SpeciesId.FRAXURE,
|
||||||
|
SpeciesId.HAXORUS,
|
||||||
|
SpeciesId.STUNFISK,
|
||||||
|
SpeciesId.DRUDDIGON,
|
||||||
|
SpeciesId.GOLETT,
|
||||||
|
SpeciesId.GOLURK,
|
||||||
|
SpeciesId.DEINO,
|
||||||
|
SpeciesId.ZWEILOUS,
|
||||||
|
SpeciesId.HYDREIGON,
|
||||||
|
SpeciesId.THUNDURUS,
|
||||||
|
SpeciesId.ZEKROM,
|
||||||
|
SpeciesId.MELOETTA,
|
||||||
|
SpeciesId.GENESECT,
|
||||||
|
SpeciesId.BRAIXEN,
|
||||||
|
SpeciesId.DELPHOX,
|
||||||
|
SpeciesId.ESPURR,
|
||||||
|
SpeciesId.MEOWSTIC,
|
||||||
|
SpeciesId.HONEDGE,
|
||||||
|
SpeciesId.DOUBLADE,
|
||||||
|
SpeciesId.AEGISLASH,
|
||||||
|
SpeciesId.SKRELP,
|
||||||
|
SpeciesId.DRAGALGE,
|
||||||
|
SpeciesId.HELIOPTILE,
|
||||||
|
SpeciesId.HELIOLISK,
|
||||||
|
SpeciesId.DEDENNE,
|
||||||
|
SpeciesId.GOOMY,
|
||||||
|
SpeciesId.SLIGGOO,
|
||||||
|
SpeciesId.GOODRA,
|
||||||
|
SpeciesId.ZYGARDE,
|
||||||
|
SpeciesId.HOOPA,
|
||||||
|
SpeciesId.YUNGOOS,
|
||||||
|
SpeciesId.GUMSHOOS,
|
||||||
|
SpeciesId.GRUBBIN,
|
||||||
|
SpeciesId.CHARJABUG,
|
||||||
|
SpeciesId.VIKAVOLT,
|
||||||
|
SpeciesId.PASSIMIAN,
|
||||||
|
SpeciesId.TURTONATOR,
|
||||||
|
SpeciesId.TOGEDEMARU,
|
||||||
|
SpeciesId.DRAMPA,
|
||||||
|
SpeciesId.KOMMO_O,
|
||||||
|
SpeciesId.TAPU_KOKO,
|
||||||
|
SpeciesId.SOLGALEO,
|
||||||
|
SpeciesId.LUNALA,
|
||||||
|
SpeciesId.PHEROMOSA,
|
||||||
|
SpeciesId.XURKITREE,
|
||||||
|
SpeciesId.CELESTEELA,
|
||||||
|
SpeciesId.GUZZLORD,
|
||||||
|
SpeciesId.NECROZMA,
|
||||||
|
SpeciesId.MAGEARNA,
|
||||||
|
SpeciesId.NAGANADEL,
|
||||||
|
SpeciesId.ZERAORA,
|
||||||
|
SpeciesId.TOXTRICITY,
|
||||||
|
SpeciesId.MR_RIME,
|
||||||
|
SpeciesId.REGIELEKI,
|
||||||
|
SpeciesId.WYRDEER,
|
||||||
|
SpeciesId.FARIGIRAF,
|
||||||
|
SpeciesId.DUDUNSPARCE,
|
||||||
|
SpeciesId.MIRAIDON,
|
||||||
|
SpeciesId.RAGING_BOLT,
|
||||||
|
SpeciesId.ALOLA_RATTATA,
|
||||||
|
SpeciesId.ALOLA_RATICATE,
|
||||||
|
SpeciesId.ALOLA_RAICHU,
|
||||||
|
SpeciesId.ALOLA_MEOWTH,
|
||||||
|
SpeciesId.ALOLA_PERSIAN,
|
||||||
|
SpeciesId.ALOLA_GRAVELER,
|
||||||
|
SpeciesId.ALOLA_GOLEM,
|
||||||
|
SpeciesId.ALOLA_GRIMER,
|
||||||
|
SpeciesId.ALOLA_MUK,
|
||||||
|
SpeciesId.GALAR_WEEZING,
|
||||||
|
SpeciesId.GALAR_MR_MIME,
|
||||||
|
SpeciesId.HISUI_SLIGGOO,
|
||||||
|
SpeciesId.HISUI_GOODRA,
|
||||||
|
],
|
||||||
[MoveId.WATER_PULSE]: [
|
[MoveId.WATER_PULSE]: [
|
||||||
SpeciesId.SQUIRTLE,
|
SpeciesId.SQUIRTLE,
|
||||||
SpeciesId.WARTORTLE,
|
SpeciesId.WARTORTLE,
|
||||||
@ -68747,6 +69026,7 @@ export const tmPoolTiers: TmPoolTiers = {
|
|||||||
[MoveId.LEAF_BLADE]: ModifierTier.ULTRA,
|
[MoveId.LEAF_BLADE]: ModifierTier.ULTRA,
|
||||||
[MoveId.DRAGON_DANCE]: ModifierTier.GREAT,
|
[MoveId.DRAGON_DANCE]: ModifierTier.GREAT,
|
||||||
[MoveId.ROCK_BLAST]: ModifierTier.GREAT,
|
[MoveId.ROCK_BLAST]: ModifierTier.GREAT,
|
||||||
|
[MoveId.SHOCK_WAVE]: ModifierTier.GREAT,
|
||||||
[MoveId.WATER_PULSE]: ModifierTier.GREAT,
|
[MoveId.WATER_PULSE]: ModifierTier.GREAT,
|
||||||
[MoveId.ROOST]: ModifierTier.GREAT,
|
[MoveId.ROOST]: ModifierTier.GREAT,
|
||||||
[MoveId.GRAVITY]: ModifierTier.COMMON,
|
[MoveId.GRAVITY]: ModifierTier.COMMON,
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import type { BattlerTag } from "#data/battler-tags";
|
||||||
import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "#abilities/ability";
|
import { AbAttrParamsWithCancel, PreAttackModifyPowerAbAttrParams } from "#abilities/ability";
|
||||||
import {
|
import {
|
||||||
applyAbAttrs
|
applyAbAttrs
|
||||||
@ -1312,10 +1313,8 @@ export class MoveEffectAttr extends MoveAttr {
|
|||||||
* @param args Set of unique arguments needed by this attribute
|
* @param args Set of unique arguments needed by this attribute
|
||||||
* @returns true if basic application of the ability attribute should be possible
|
* @returns true if basic application of the ability attribute should be possible
|
||||||
*/
|
*/
|
||||||
canApply(user: Pokemon, target: Pokemon, move: Move, args?: any[]) {
|
canApply(user: Pokemon, target: Pokemon, move: Move, _args?: any[]) {
|
||||||
return !! (this.selfTarget ? user.hp && !user.getTag(BattlerTagType.FRENZY) : target.hp)
|
return !(this.selfTarget ? user : target).isFainted();
|
||||||
&& (this.selfTarget || !target.getTag(BattlerTagType.PROTECTED) ||
|
|
||||||
move.doesFlagEffectApply({ flag: MoveFlags.IGNORE_PROTECT, user, target }));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Applies move effects so long as they are able based on {@linkcode canApply} */
|
/** Applies move effects so long as they are able based on {@linkcode canApply} */
|
||||||
@ -5614,16 +5613,15 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
|||||||
public tagType: BattlerTagType;
|
public tagType: BattlerTagType;
|
||||||
public turnCountMin: number;
|
public turnCountMin: number;
|
||||||
public turnCountMax: number;
|
public turnCountMax: number;
|
||||||
protected cancelOnFail: boolean;
|
|
||||||
private failOnOverlap: boolean;
|
private failOnOverlap: boolean;
|
||||||
|
|
||||||
constructor(tagType: BattlerTagType, selfTarget: boolean = false, failOnOverlap: boolean = false, turnCountMin: number = 0, turnCountMax?: number, lastHitOnly: boolean = false) {
|
constructor(tagType: BattlerTagType, selfTarget: boolean = false, failOnOverlap = false, turnCountMin = 0, turnCountMax = turnCountMin, lastHitOnly = false) {
|
||||||
super(selfTarget, { lastHitOnly: lastHitOnly });
|
super(selfTarget, { lastHitOnly });
|
||||||
|
|
||||||
this.tagType = tagType;
|
this.tagType = tagType;
|
||||||
this.turnCountMin = turnCountMin;
|
this.turnCountMin = turnCountMin;
|
||||||
this.turnCountMax = turnCountMax !== undefined ? turnCountMax : turnCountMin;
|
this.turnCountMax = turnCountMax;
|
||||||
this.failOnOverlap = !!failOnOverlap;
|
this.failOnOverlap = failOnOverlap;
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
@ -5631,9 +5629,10 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Do any moves actually use chance-based battler tag adding?
|
||||||
const moveChance = this.getMoveChance(user, target, move, this.selfTarget, true);
|
const moveChance = this.getMoveChance(user, target, move, this.selfTarget, true);
|
||||||
if (moveChance < 0 || moveChance === 100 || user.randBattleSeedInt(100) < moveChance) {
|
if (moveChance < 0 || moveChance === 100 || user.randBattleSeedInt(100) < moveChance) {
|
||||||
return (this.selfTarget ? user : target).addTag(this.tagType, user.randBattleSeedIntRange(this.turnCountMin, this.turnCountMax), move.id, user.id);
|
return (this.selfTarget ? user : target).addTag(this.tagType, user.randBattleSeedIntRange(this.turnCountMin, this.turnCountMax), move.id, user.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -5841,32 +5840,14 @@ export class CurseAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class LapseBattlerTagAttr extends MoveEffectAttr {
|
/**
|
||||||
public tagTypes: BattlerTagType[];
|
* Attribute to remove all {@linkcode BattlerTag}s matching one or more tag types.
|
||||||
|
*/
|
||||||
constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false) {
|
|
||||||
super(selfTarget);
|
|
||||||
|
|
||||||
this.tagTypes = tagTypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
|
||||||
if (!super.apply(user, target, move, args)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const tagType of this.tagTypes) {
|
|
||||||
(this.selfTarget ? user : target).lapseTag(tagType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class RemoveBattlerTagAttr extends MoveEffectAttr {
|
export class RemoveBattlerTagAttr extends MoveEffectAttr {
|
||||||
public tagTypes: BattlerTagType[];
|
/** An array of {@linkcode BattlerTagType}s to clear. */
|
||||||
|
public tagTypes: [BattlerTagType, ...BattlerTagType[]];
|
||||||
|
|
||||||
constructor(tagTypes: BattlerTagType[], selfTarget: boolean = false) {
|
constructor(tagTypes: [BattlerTagType, ...BattlerTagType[]], selfTarget = false) {
|
||||||
super(selfTarget);
|
super(selfTarget);
|
||||||
|
|
||||||
this.tagTypes = tagTypes;
|
this.tagTypes = tagTypes;
|
||||||
@ -5877,9 +5858,7 @@ export class RemoveBattlerTagAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const tagType of this.tagTypes) {
|
(this.selfTarget ? user : target).findAndRemoveTags(t => this.tagTypes.includes(t.tagType));
|
||||||
(this.selfTarget ? user : target).removeTag(tagType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -5986,14 +5965,13 @@ export class RemoveAllSubstitutesAttr extends MoveEffectAttr {
|
|||||||
export class HitsTagAttr extends MoveAttr {
|
export class HitsTagAttr extends MoveAttr {
|
||||||
/** The {@linkcode BattlerTagType} this move hits */
|
/** The {@linkcode BattlerTagType} this move hits */
|
||||||
public tagType: BattlerTagType;
|
public tagType: BattlerTagType;
|
||||||
/** Should this move deal double damage against {@linkcode HitsTagAttr.tagType}? */
|
/** Should this move deal double damage against {@linkcode tagType}? */
|
||||||
public doubleDamage: boolean;
|
public doubleDamage = false;
|
||||||
|
|
||||||
constructor(tagType: BattlerTagType, doubleDamage: boolean = false) {
|
constructor(tagType: BattlerTagType) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.tagType = tagType;
|
this.tagType = tagType;
|
||||||
this.doubleDamage = !!doubleDamage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
getTargetBenefitScore(user: Pokemon, target: Pokemon, move: Move): number {
|
||||||
@ -6008,7 +5986,8 @@ export class HitsTagAttr extends MoveAttr {
|
|||||||
*/
|
*/
|
||||||
export class HitsTagForDoubleDamageAttr extends HitsTagAttr {
|
export class HitsTagForDoubleDamageAttr extends HitsTagAttr {
|
||||||
constructor(tagType: BattlerTagType) {
|
constructor(tagType: BattlerTagType) {
|
||||||
super(tagType, true);
|
super(tagType);
|
||||||
|
this.doubleDamage = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6018,11 +5997,11 @@ export class AddArenaTagAttr extends MoveEffectAttr {
|
|||||||
private failOnOverlap: boolean;
|
private failOnOverlap: boolean;
|
||||||
public selfSideTarget: boolean;
|
public selfSideTarget: boolean;
|
||||||
|
|
||||||
constructor(tagType: ArenaTagType, turnCount?: number | null, failOnOverlap: boolean = false, selfSideTarget: boolean = false) {
|
constructor(tagType: ArenaTagType, turnCount = 0, failOnOverlap = false, selfSideTarget: boolean = false) {
|
||||||
super(true);
|
super(true);
|
||||||
|
|
||||||
this.tagType = tagType;
|
this.tagType = tagType;
|
||||||
this.turnCount = turnCount!; // TODO: is the bang correct?
|
this.turnCount = turnCount;
|
||||||
this.failOnOverlap = failOnOverlap;
|
this.failOnOverlap = failOnOverlap;
|
||||||
this.selfSideTarget = selfSideTarget;
|
this.selfSideTarget = selfSideTarget;
|
||||||
}
|
}
|
||||||
@ -6032,6 +6011,7 @@ export class AddArenaTagAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Why does this check effect chance if nothing uses it?
|
||||||
if ((move.chance < 0 || move.chance === 100 || user.randBattleSeedInt(100) < move.chance) && user.getLastXMoves(1)[0]?.result === MoveResult.SUCCESS) {
|
if ((move.chance < 0 || move.chance === 100 || user.randBattleSeedInt(100) < move.chance) && user.getLastXMoves(1)[0]?.result === MoveResult.SUCCESS) {
|
||||||
const side = ((this.selfSideTarget ? user : target).isPlayer() !== (move.hasAttr("AddArenaTrapTagAttr") && target === user)) ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;
|
const side = ((this.selfSideTarget ? user : target).isPlayer() !== (move.hasAttr("AddArenaTrapTagAttr") && target === user)) ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;
|
||||||
globalScene.arena.addTag(this.tagType, this.turnCount, move.id, user.id, side);
|
globalScene.arena.addTag(this.tagType, this.turnCount, move.id, user.id, side);
|
||||||
@ -6043,25 +6023,29 @@ export class AddArenaTagAttr extends MoveEffectAttr {
|
|||||||
|
|
||||||
getCondition(): MoveConditionFunc | null {
|
getCondition(): MoveConditionFunc | null {
|
||||||
return this.failOnOverlap
|
return this.failOnOverlap
|
||||||
? (user, target, move) => !globalScene.arena.getTagOnSide(this.tagType, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)
|
? (_user, target, _move) => !globalScene.arena.getTagOnSide(this.tagType, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY)
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic class for removing arena tags
|
* Attribute to remove one or more arena tags from the field.
|
||||||
* @param tagTypes: The types of tags that can be removed
|
|
||||||
* @param selfSideTarget: Is the user removing tags from its own side?
|
|
||||||
*/
|
*/
|
||||||
export class RemoveArenaTagsAttr extends MoveEffectAttr {
|
export class RemoveArenaTagsAttr extends MoveEffectAttr {
|
||||||
public tagTypes: ArenaTagType[];
|
/** An array containing the tags to be removed. */
|
||||||
public selfSideTarget: boolean;
|
private readonly tagTypes: readonly [ArenaTagType, ...ArenaTagType[]];
|
||||||
|
/**
|
||||||
|
* Whether to remove tags from both sides of the field (`true`) or
|
||||||
|
* the target's side of the field (`false`)
|
||||||
|
* @defaultValue `false`
|
||||||
|
*/
|
||||||
|
private removeAllTags: boolean
|
||||||
|
|
||||||
constructor(tagTypes: ArenaTagType[], selfSideTarget: boolean) {
|
constructor(tagTypes: readonly [ArenaTagType, ...ArenaTagType[]], removeAllTags = false, options?: MoveEffectAttrOptions) {
|
||||||
super(true);
|
super(true, options);
|
||||||
|
|
||||||
this.tagTypes = tagTypes;
|
this.tagTypes = tagTypes;
|
||||||
this.selfSideTarget = selfSideTarget;
|
this.removeAllTags = removeAllTags;
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
@ -6069,11 +6053,9 @@ export class RemoveArenaTagsAttr extends MoveEffectAttr {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const side = (this.selfSideTarget ? user : target).isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;
|
const side = this.removeAllTags ? ArenaTagSide.BOTH : target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY;
|
||||||
|
|
||||||
for (const tagType of this.tagTypes) {
|
globalScene.arena.removeTagsOnSide(this.tagTypes, side);
|
||||||
globalScene.arena.removeTagOnSide(tagType, side);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -6098,6 +6080,7 @@ export class AddArenaTrapTagAttr extends AddArenaTagAttr {
|
|||||||
* @extends AddArenaTagAttr
|
* @extends AddArenaTagAttr
|
||||||
* @see {@linkcode apply}
|
* @see {@linkcode apply}
|
||||||
*/
|
*/
|
||||||
|
// TODO: This has exactly 1 line of code difference from the base attribute wrt. effect chances...
|
||||||
export class AddArenaTrapTagHitAttr extends AddArenaTagAttr {
|
export class AddArenaTrapTagHitAttr extends AddArenaTagAttr {
|
||||||
/**
|
/**
|
||||||
* @param user {@linkcode Pokemon} using this move
|
* @param user {@linkcode Pokemon} using this move
|
||||||
@ -6119,80 +6102,37 @@ export class AddArenaTrapTagHitAttr extends AddArenaTagAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RemoveArenaTrapAttr extends MoveEffectAttr {
|
// TODO: Review if we can remove these attributes
|
||||||
|
const arenaTrapTags = [
|
||||||
|
ArenaTagType.SPIKES,
|
||||||
|
ArenaTagType.TOXIC_SPIKES,
|
||||||
|
ArenaTagType.STEALTH_ROCK,
|
||||||
|
ArenaTagType.STICKY_WEB,
|
||||||
|
] as const;
|
||||||
|
|
||||||
private targetBothSides: boolean;
|
export class RemoveArenaTrapAttr extends RemoveArenaTagsAttr {
|
||||||
|
constructor(targetBothSides = false) {
|
||||||
constructor(targetBothSides: boolean = false) {
|
// TODO: This triggers at a different time than `RemoveArenaTagsAbAttr`...
|
||||||
super(true, { trigger: MoveEffectTrigger.PRE_APPLY });
|
super(arenaTrapTags, targetBothSides, { trigger: MoveEffectTrigger.PRE_APPLY });
|
||||||
this.targetBothSides = targetBothSides;
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
|
||||||
|
|
||||||
if (!super.apply(user, target, move, args)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.targetBothSides) {
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.SPIKES, ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.TOXIC_SPIKES, ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STEALTH_ROCK, ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STICKY_WEB, ArenaTagSide.PLAYER);
|
|
||||||
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.SPIKES, ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.TOXIC_SPIKES, ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STEALTH_ROCK, ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STICKY_WEB, ArenaTagSide.ENEMY);
|
|
||||||
} else {
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.SPIKES, target.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.TOXIC_SPIKES, target.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STEALTH_ROCK, target.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.STICKY_WEB, target.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class RemoveScreensAttr extends MoveEffectAttr {
|
const screenTags = [
|
||||||
|
ArenaTagType.REFLECT,
|
||||||
private targetBothSides: boolean;
|
ArenaTagType.LIGHT_SCREEN,
|
||||||
|
ArenaTagType.AURORA_VEIL
|
||||||
constructor(targetBothSides: boolean = false) {
|
] as const;
|
||||||
super(true, { trigger: MoveEffectTrigger.PRE_APPLY });
|
|
||||||
this.targetBothSides = targetBothSides;
|
|
||||||
}
|
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
|
||||||
|
|
||||||
if (!super.apply(user, target, move, args)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.targetBothSides) {
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.REFLECT, ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.LIGHT_SCREEN, ArenaTagSide.PLAYER);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.AURORA_VEIL, ArenaTagSide.PLAYER);
|
|
||||||
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.REFLECT, ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.LIGHT_SCREEN, ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.AURORA_VEIL, ArenaTagSide.ENEMY);
|
|
||||||
} else {
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.REFLECT, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.LIGHT_SCREEN, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY);
|
|
||||||
globalScene.arena.removeTagOnSide(ArenaTagType.AURORA_VEIL, target.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
export class RemoveScreensAttr extends RemoveArenaTagsAttr {
|
||||||
|
constructor(targetBothSides = false) {
|
||||||
|
// TODO: This triggers at a different time than {@linkcode RemoveArenaTagsAbAttr}...
|
||||||
|
super(screenTags, targetBothSides, { trigger: MoveEffectTrigger.PRE_APPLY });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Swaps arena effects between the player and enemy side
|
/**
|
||||||
* @extends MoveEffectAttr
|
* Swaps arena effects between the player and enemy side
|
||||||
* @see {@linkcode apply}
|
*/
|
||||||
*/
|
|
||||||
export class SwapArenaTagsAttr extends MoveEffectAttr {
|
export class SwapArenaTagsAttr extends MoveEffectAttr {
|
||||||
public SwapTags: ArenaTagType[];
|
public SwapTags: ArenaTagType[];
|
||||||
|
|
||||||
@ -8420,7 +8360,6 @@ const MoveAttrs = Object.freeze({
|
|||||||
GulpMissileTagAttr,
|
GulpMissileTagAttr,
|
||||||
JawLockAttr,
|
JawLockAttr,
|
||||||
CurseAttr,
|
CurseAttr,
|
||||||
LapseBattlerTagAttr,
|
|
||||||
RemoveBattlerTagAttr,
|
RemoveBattlerTagAttr,
|
||||||
FlinchAttr,
|
FlinchAttr,
|
||||||
ConfuseAttr,
|
ConfuseAttr,
|
||||||
@ -10416,7 +10355,7 @@ export function initMoves() {
|
|||||||
.target(MoveTarget.USER_AND_ALLIES)
|
.target(MoveTarget.USER_AND_ALLIES)
|
||||||
.condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => p?.hasAbility(a, false)))),
|
.condition((user, target, move) => !![ user, user.getAlly() ].filter(p => p?.isActive()).find(p => !![ AbilityId.PLUS, AbilityId.MINUS ].find(a => p?.hasAbility(a, false)))),
|
||||||
new StatusMove(MoveId.HAPPY_HOUR, PokemonType.NORMAL, -1, 30, -1, 0, 6) // No animation
|
new StatusMove(MoveId.HAPPY_HOUR, PokemonType.NORMAL, -1, 30, -1, 0, 6) // No animation
|
||||||
.attr(AddArenaTagAttr, ArenaTagType.HAPPY_HOUR, null, true)
|
.attr(AddArenaTagAttr, ArenaTagType.HAPPY_HOUR, 0, true)
|
||||||
.target(MoveTarget.USER_SIDE),
|
.target(MoveTarget.USER_SIDE),
|
||||||
new StatusMove(MoveId.ELECTRIC_TERRAIN, PokemonType.ELECTRIC, -1, 10, -1, 0, 6)
|
new StatusMove(MoveId.ELECTRIC_TERRAIN, PokemonType.ELECTRIC, -1, 10, -1, 0, 6)
|
||||||
.attr(TerrainChangeAttr, TerrainType.ELECTRIC)
|
.attr(TerrainChangeAttr, TerrainType.ELECTRIC)
|
||||||
@ -10694,7 +10633,7 @@ export function initMoves() {
|
|||||||
new AttackMove(MoveId.MALICIOUS_MOONSAULT, PokemonType.DARK, MoveCategory.PHYSICAL, 180, -1, 1, -1, 0, 7)
|
new AttackMove(MoveId.MALICIOUS_MOONSAULT, PokemonType.DARK, MoveCategory.PHYSICAL, 180, -1, 1, -1, 0, 7)
|
||||||
.unimplemented()
|
.unimplemented()
|
||||||
.attr(AlwaysHitMinimizeAttr)
|
.attr(AlwaysHitMinimizeAttr)
|
||||||
.attr(HitsTagAttr, BattlerTagType.MINIMIZED, true)
|
.attr(HitsTagForDoubleDamageAttr, BattlerTagType.MINIMIZED)
|
||||||
.edgeCase(), // I assume it's because it needs darkest lariat and incineroar
|
.edgeCase(), // I assume it's because it needs darkest lariat and incineroar
|
||||||
new AttackMove(MoveId.OCEANIC_OPERETTA, PokemonType.WATER, MoveCategory.SPECIAL, 195, -1, 1, -1, 0, 7)
|
new AttackMove(MoveId.OCEANIC_OPERETTA, PokemonType.WATER, MoveCategory.SPECIAL, 195, -1, 1, -1, 0, 7)
|
||||||
.unimplemented()
|
.unimplemented()
|
||||||
@ -11322,6 +11261,7 @@ export function initMoves() {
|
|||||||
.attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_GET_HIT, true, false, 0, 0, true)
|
.attr(AddBattlerTagAttr, BattlerTagType.ALWAYS_GET_HIT, true, false, 0, 0, true)
|
||||||
.attr(AddBattlerTagAttr, BattlerTagType.RECEIVE_DOUBLE_DAMAGE, true, false, 0, 0, true)
|
.attr(AddBattlerTagAttr, BattlerTagType.RECEIVE_DOUBLE_DAMAGE, true, false, 0, 0, true)
|
||||||
.condition((user, target, move) => {
|
.condition((user, target, move) => {
|
||||||
|
// TODO: This is really really really janky
|
||||||
return !(target.getTag(BattlerTagType.PROTECTED)?.tagType === "PROTECTED" || globalScene.arena.getTag(ArenaTagType.MAT_BLOCK)?.tagType === "MAT_BLOCK");
|
return !(target.getTag(BattlerTagType.PROTECTED)?.tagType === "PROTECTED" || globalScene.arena.getTag(ArenaTagType.MAT_BLOCK)?.tagType === "MAT_BLOCK");
|
||||||
}),
|
}),
|
||||||
new StatusMove(MoveId.REVIVAL_BLESSING, PokemonType.NORMAL, -1, 1, -1, 0, 9)
|
new StatusMove(MoveId.REVIVAL_BLESSING, PokemonType.NORMAL, -1, 1, -1, 0, 9)
|
||||||
@ -11334,7 +11274,7 @@ export function initMoves() {
|
|||||||
new AttackMove(MoveId.TRIPLE_DIVE, PokemonType.WATER, MoveCategory.PHYSICAL, 30, 95, 10, -1, 0, 9)
|
new AttackMove(MoveId.TRIPLE_DIVE, PokemonType.WATER, MoveCategory.PHYSICAL, 30, 95, 10, -1, 0, 9)
|
||||||
.attr(MultiHitAttr, MultiHitType._3),
|
.attr(MultiHitAttr, MultiHitType._3),
|
||||||
new AttackMove(MoveId.MORTAL_SPIN, PokemonType.POISON, MoveCategory.PHYSICAL, 30, 100, 15, 100, 0, 9)
|
new AttackMove(MoveId.MORTAL_SPIN, PokemonType.POISON, MoveCategory.PHYSICAL, 30, 100, 15, 100, 0, 9)
|
||||||
.attr(LapseBattlerTagAttr, [
|
.attr(RemoveBattlerTagAttr, [
|
||||||
BattlerTagType.BIND,
|
BattlerTagType.BIND,
|
||||||
BattlerTagType.WRAP,
|
BattlerTagType.WRAP,
|
||||||
BattlerTagType.FIRE_SPIN,
|
BattlerTagType.FIRE_SPIN,
|
||||||
|
@ -99,6 +99,7 @@ export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder.withE
|
|||||||
MysteryEncounterType.DARK_DEAL,
|
MysteryEncounterType.DARK_DEAL,
|
||||||
)
|
)
|
||||||
.withEncounterTier(MysteryEncounterTier.ROGUE)
|
.withEncounterTier(MysteryEncounterTier.ROGUE)
|
||||||
|
.withDisallowedChallenges(Challenges.HARDCORE)
|
||||||
.withIntroSpriteConfigs([
|
.withIntroSpriteConfigs([
|
||||||
{
|
{
|
||||||
spriteKey: "dark_deal_scientist",
|
spriteKey: "dark_deal_scientist",
|
||||||
|
@ -673,6 +673,8 @@ export async function catchPokemon(
|
|||||||
globalScene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
|
globalScene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
|
const addStatus = new BooleanHolder(true);
|
||||||
|
applyChallenges(ChallengeType.POKEMON_ADD_TO_PARTY, pokemon, addStatus);
|
||||||
const doPokemonCatchMenu = () => {
|
const doPokemonCatchMenu = () => {
|
||||||
const end = () => {
|
const end = () => {
|
||||||
// Ensure the pokemon is in the enemy party in all situations
|
// Ensure the pokemon is in the enemy party in all situations
|
||||||
@ -708,9 +710,7 @@ export async function catchPokemon(
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
||||||
const addStatus = new BooleanHolder(true);
|
if (!(isObtain || addStatus.value)) {
|
||||||
applyChallenges(ChallengeType.POKEMON_ADD_TO_PARTY, pokemon, addStatus);
|
|
||||||
if (!addStatus.value) {
|
|
||||||
removePokemon();
|
removePokemon();
|
||||||
end();
|
end();
|
||||||
return;
|
return;
|
||||||
@ -807,10 +807,16 @@ export async function catchPokemon(
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (showCatchObtainMessage) {
|
if (showCatchObtainMessage) {
|
||||||
|
let catchMessage: string;
|
||||||
|
if (isObtain) {
|
||||||
|
catchMessage = "battle:pokemonObtained";
|
||||||
|
} else if (addStatus.value) {
|
||||||
|
catchMessage = "battle:pokemonCaught";
|
||||||
|
} else {
|
||||||
|
catchMessage = "battle:pokemonCaughtButChallenge";
|
||||||
|
}
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t(isObtain ? "battle:pokemonObtained" : "battle:pokemonCaught", {
|
i18next.t(catchMessage, { pokemonName: pokemon.getNameToRender() }),
|
||||||
pokemonName: pokemon.getNameToRender(),
|
|
||||||
}),
|
|
||||||
null,
|
null,
|
||||||
doPokemonCatchMenu,
|
doPokemonCatchMenu,
|
||||||
0,
|
0,
|
||||||
|
@ -718,7 +718,7 @@ export class Arena {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// creates a new tag object
|
// creates a new tag object
|
||||||
const newTag = getArenaTag(tagType, turnCount || 0, sourceMove, sourceId, side);
|
const newTag = getArenaTag(tagType, turnCount, sourceMove, sourceId, side);
|
||||||
if (newTag) {
|
if (newTag) {
|
||||||
newTag.onAdd(this, quiet);
|
newTag.onAdd(this, quiet);
|
||||||
this.tags.push(newTag);
|
this.tags.push(newTag);
|
||||||
@ -834,6 +834,36 @@ export class Arena {
|
|||||||
return !!tag;
|
return !!tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find and remove all {@linkcode ArenaTag}s with the given tag types on the given side of the field.
|
||||||
|
* @param tagTypes - The {@linkcode ArenaTagType}s to remove
|
||||||
|
* @param side - The {@linkcode ArenaTagSide} to remove the tags from (for side-based tags), or {@linkcode ArenaTagSide.BOTH}
|
||||||
|
* to clear all tags on either side of the field
|
||||||
|
* @param quiet - Whether to suppress removal messages from currently-present tags; default `false`
|
||||||
|
* @todo Review the other tag manipulation functions to see if they can be migrated towards using this (more efficient)
|
||||||
|
*/
|
||||||
|
public removeTagsOnSide(
|
||||||
|
tagTypes: ArenaTagType[] | ReadonlyArray<ArenaTagType>,
|
||||||
|
side: ArenaTagSide,
|
||||||
|
quiet = false,
|
||||||
|
): void {
|
||||||
|
const leftoverTags: ArenaTag[] = [];
|
||||||
|
for (const tag of this.tags) {
|
||||||
|
// Skip tags of different types or on the wrong side of the field
|
||||||
|
if (
|
||||||
|
!tagTypes.includes(tag.tagType) ||
|
||||||
|
!(side === ArenaTagSide.BOTH || tag.side === ArenaTagSide.BOTH || tag.side === side)
|
||||||
|
) {
|
||||||
|
leftoverTags.push(tag);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
tag.onRemove(this, quiet);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.tags = leftoverTags;
|
||||||
|
}
|
||||||
|
|
||||||
removeAllTags(): void {
|
removeAllTags(): void {
|
||||||
while (this.tags.length) {
|
while (this.tags.length) {
|
||||||
this.tags[0].onRemove(this);
|
this.tags[0].onRemove(this);
|
||||||
|
@ -253,8 +253,11 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
|
|
||||||
globalScene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
|
globalScene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
|
||||||
|
|
||||||
|
const addStatus = new BooleanHolder(true);
|
||||||
|
applyChallenges(ChallengeType.POKEMON_ADD_TO_PARTY, pokemon, addStatus);
|
||||||
|
|
||||||
globalScene.ui.showText(
|
globalScene.ui.showText(
|
||||||
i18next.t("battle:pokemonCaught", {
|
i18next.t(addStatus.value ? "battle:pokemonCaught" : "battle:pokemonCaughtButChallenge", {
|
||||||
pokemonName: getPokemonNameWithAffix(pokemon),
|
pokemonName: getPokemonNameWithAffix(pokemon),
|
||||||
}),
|
}),
|
||||||
null,
|
null,
|
||||||
@ -290,8 +293,6 @@ export class AttemptCapturePhase extends PokemonPhase {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
Promise.all([pokemon.hideInfo(), globalScene.gameData.setPokemonCaught(pokemon)]).then(() => {
|
||||||
const addStatus = new BooleanHolder(true);
|
|
||||||
applyChallenges(ChallengeType.POKEMON_ADD_TO_PARTY, pokemon, addStatus);
|
|
||||||
if (!addStatus.value) {
|
if (!addStatus.value) {
|
||||||
removePokemon();
|
removePokemon();
|
||||||
end();
|
end();
|
||||||
|
@ -745,7 +745,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
/**
|
/**
|
||||||
* Applies all move effects that trigger in the event of a successful hit:
|
* Applies all move effects that trigger in the event of a successful hit:
|
||||||
*
|
*
|
||||||
* - {@linkcode MoveEffectTrigger.PRE_APPLY | PRE_APPLY} effects`
|
* - {@linkcode MoveEffectTrigger.PRE_APPLY | PRE_APPLY} effects
|
||||||
* - Applying damage to the target
|
* - Applying damage to the target
|
||||||
* - {@linkcode MoveEffectTrigger.POST_APPLY | POST_APPLY} effects
|
* - {@linkcode MoveEffectTrigger.POST_APPLY | POST_APPLY} effects
|
||||||
* - Invoking {@linkcode applyOnTargetEffects} if the move does not hit a substitute
|
* - Invoking {@linkcode applyOnTargetEffects} if the move does not hit a substitute
|
||||||
|
@ -16,8 +16,10 @@ export class SelectBiomePhase extends BattlePhase {
|
|||||||
|
|
||||||
globalScene.resetSeed();
|
globalScene.resetSeed();
|
||||||
|
|
||||||
|
const gameMode = globalScene.gameMode;
|
||||||
const currentBiome = globalScene.arena.biomeType;
|
const currentBiome = globalScene.arena.biomeType;
|
||||||
const nextWaveIndex = globalScene.currentBattle.waveIndex + 1;
|
const currentWaveIndex = globalScene.currentBattle.waveIndex;
|
||||||
|
const nextWaveIndex = currentWaveIndex + 1;
|
||||||
|
|
||||||
const setNextBiome = (nextBiome: BiomeId) => {
|
const setNextBiome = (nextBiome: BiomeId) => {
|
||||||
if (nextWaveIndex % 10 === 1) {
|
if (nextWaveIndex % 10 === 1) {
|
||||||
@ -26,6 +28,15 @@ export class SelectBiomePhase extends BattlePhase {
|
|||||||
applyChallenges(ChallengeType.PARTY_HEAL, healStatus);
|
applyChallenges(ChallengeType.PARTY_HEAL, healStatus);
|
||||||
if (healStatus.value) {
|
if (healStatus.value) {
|
||||||
globalScene.phaseManager.unshiftNew("PartyHealPhase", false);
|
globalScene.phaseManager.unshiftNew("PartyHealPhase", false);
|
||||||
|
} else {
|
||||||
|
globalScene.phaseManager.unshiftNew(
|
||||||
|
"SelectModifierPhase",
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
gameMode.isFixedBattle(currentWaveIndex)
|
||||||
|
? gameMode.getFixedBattle(currentWaveIndex).customModifierRewardSettings
|
||||||
|
: undefined,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
globalScene.phaseManager.unshiftNew("SwitchBiomePhase", nextBiome);
|
globalScene.phaseManager.unshiftNew("SwitchBiomePhase", nextBiome);
|
||||||
@ -33,12 +44,12 @@ export class SelectBiomePhase extends BattlePhase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (
|
if (
|
||||||
(globalScene.gameMode.isClassic && globalScene.gameMode.isWaveFinal(nextWaveIndex + 9)) ||
|
(gameMode.isClassic && gameMode.isWaveFinal(nextWaveIndex + 9)) ||
|
||||||
(globalScene.gameMode.isDaily && globalScene.gameMode.isWaveFinal(nextWaveIndex)) ||
|
(gameMode.isDaily && gameMode.isWaveFinal(nextWaveIndex)) ||
|
||||||
(globalScene.gameMode.hasShortBiomes && !(nextWaveIndex % 50))
|
(gameMode.hasShortBiomes && !(nextWaveIndex % 50))
|
||||||
) {
|
) {
|
||||||
setNextBiome(BiomeId.END);
|
setNextBiome(BiomeId.END);
|
||||||
} else if (globalScene.gameMode.hasRandomBiomes) {
|
} else if (gameMode.hasRandomBiomes) {
|
||||||
setNextBiome(this.generateNextBiome(nextWaveIndex));
|
setNextBiome(this.generateNextBiome(nextWaveIndex));
|
||||||
} else if (Array.isArray(biomeLinks[currentBiome])) {
|
} else if (Array.isArray(biomeLinks[currentBiome])) {
|
||||||
const biomes: BiomeId[] = (biomeLinks[currentBiome] as (BiomeId | [BiomeId, number])[])
|
const biomes: BiomeId[] = (biomeLinks[currentBiome] as (BiomeId | [BiomeId, number])[])
|
||||||
@ -73,9 +84,6 @@ export class SelectBiomePhase extends BattlePhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generateNextBiome(waveIndex: number): BiomeId {
|
generateNextBiome(waveIndex: number): BiomeId {
|
||||||
if (!(waveIndex % 50)) {
|
return waveIndex % 50 === 0 ? BiomeId.END : globalScene.generateRandomBiome(waveIndex);
|
||||||
return BiomeId.END;
|
|
||||||
}
|
|
||||||
return globalScene.generateRandomBiome(waveIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,9 @@ import { globalScene } from "#app/global-scene";
|
|||||||
import { modifierTypes } from "#data/data-lists";
|
import { modifierTypes } from "#data/data-lists";
|
||||||
import { BattleType } from "#enums/battle-type";
|
import { BattleType } from "#enums/battle-type";
|
||||||
import type { BattlerIndex } from "#enums/battler-index";
|
import type { BattlerIndex } from "#enums/battler-index";
|
||||||
import { ChallengeType } from "#enums/challenge-type";
|
|
||||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||||
import type { CustomModifierSettings } from "#modifiers/modifier-type";
|
|
||||||
import { handleMysteryEncounterVictory } from "#mystery-encounters/encounter-phase-utils";
|
import { handleMysteryEncounterVictory } from "#mystery-encounters/encounter-phase-utils";
|
||||||
import { PokemonPhase } from "#phases/pokemon-phase";
|
import { PokemonPhase } from "#phases/pokemon-phase";
|
||||||
import { applyChallenges } from "#utils/challenge-utils";
|
|
||||||
import { BooleanHolder } from "#utils/common";
|
|
||||||
|
|
||||||
export class VictoryPhase extends PokemonPhase {
|
export class VictoryPhase extends PokemonPhase {
|
||||||
public readonly phaseName = "VictoryPhase";
|
public readonly phaseName = "VictoryPhase";
|
||||||
@ -49,15 +45,19 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
if (globalScene.currentBattle.battleType === BattleType.TRAINER) {
|
if (globalScene.currentBattle.battleType === BattleType.TRAINER) {
|
||||||
globalScene.phaseManager.pushNew("TrainerVictoryPhase");
|
globalScene.phaseManager.pushNew("TrainerVictoryPhase");
|
||||||
}
|
}
|
||||||
if (globalScene.gameMode.isEndless || !globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) {
|
|
||||||
|
const gameMode = globalScene.gameMode;
|
||||||
|
const currentWaveIndex = globalScene.currentBattle.waveIndex;
|
||||||
|
|
||||||
|
if (gameMode.isEndless || !gameMode.isWaveFinal(currentWaveIndex)) {
|
||||||
globalScene.phaseManager.pushNew("EggLapsePhase");
|
globalScene.phaseManager.pushNew("EggLapsePhase");
|
||||||
if (globalScene.gameMode.isClassic) {
|
if (gameMode.isClassic) {
|
||||||
switch (globalScene.currentBattle.waveIndex) {
|
switch (currentWaveIndex) {
|
||||||
case ClassicFixedBossWaves.RIVAL_1:
|
case ClassicFixedBossWaves.RIVAL_1:
|
||||||
case ClassicFixedBossWaves.RIVAL_2:
|
case ClassicFixedBossWaves.RIVAL_2:
|
||||||
// Get event modifiers for this wave
|
// Get event modifiers for this wave
|
||||||
timedEventManager
|
timedEventManager
|
||||||
.getFixedBattleEventRewards(globalScene.currentBattle.waveIndex)
|
.getFixedBattleEventRewards(currentWaveIndex)
|
||||||
.map(r => globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes[r]));
|
.map(r => globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes[r]));
|
||||||
break;
|
break;
|
||||||
case ClassicFixedBossWaves.EVIL_BOSS_2:
|
case ClassicFixedBossWaves.EVIL_BOSS_2:
|
||||||
@ -66,59 +66,53 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const healStatus = new BooleanHolder(globalScene.currentBattle.waveIndex % 10 === 0);
|
if (currentWaveIndex % 10) {
|
||||||
applyChallenges(ChallengeType.PARTY_HEAL, healStatus);
|
|
||||||
if (!healStatus.value) {
|
|
||||||
globalScene.phaseManager.pushNew(
|
globalScene.phaseManager.pushNew(
|
||||||
"SelectModifierPhase",
|
"SelectModifierPhase",
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
this.getFixedBattleCustomModifiers(),
|
gameMode.isFixedBattle(currentWaveIndex)
|
||||||
|
? gameMode.getFixedBattle(currentWaveIndex).customModifierRewardSettings
|
||||||
|
: undefined,
|
||||||
);
|
);
|
||||||
} else if (globalScene.gameMode.isDaily) {
|
} else if (gameMode.isDaily) {
|
||||||
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.EXP_CHARM);
|
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.EXP_CHARM);
|
||||||
if (
|
if (currentWaveIndex > 10 && !gameMode.isWaveFinal(currentWaveIndex)) {
|
||||||
globalScene.currentBattle.waveIndex > 10 &&
|
|
||||||
!globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)
|
|
||||||
) {
|
|
||||||
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.GOLDEN_POKEBALL);
|
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.GOLDEN_POKEBALL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const superExpWave = !globalScene.gameMode.isEndless ? (globalScene.offsetGym ? 0 : 20) : 10;
|
const superExpWave = !gameMode.isEndless ? (globalScene.offsetGym ? 0 : 20) : 10;
|
||||||
if (globalScene.gameMode.isEndless && globalScene.currentBattle.waveIndex === 10) {
|
if (gameMode.isEndless && currentWaveIndex === 10) {
|
||||||
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.EXP_SHARE);
|
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.EXP_SHARE);
|
||||||
}
|
}
|
||||||
if (
|
if (currentWaveIndex <= 750 && (currentWaveIndex <= 500 || currentWaveIndex % 30 === superExpWave)) {
|
||||||
globalScene.currentBattle.waveIndex <= 750 &&
|
|
||||||
(globalScene.currentBattle.waveIndex <= 500 || globalScene.currentBattle.waveIndex % 30 === superExpWave)
|
|
||||||
) {
|
|
||||||
globalScene.phaseManager.pushNew(
|
globalScene.phaseManager.pushNew(
|
||||||
"ModifierRewardPhase",
|
"ModifierRewardPhase",
|
||||||
globalScene.currentBattle.waveIndex % 30 !== superExpWave || globalScene.currentBattle.waveIndex > 250
|
currentWaveIndex % 30 !== superExpWave || currentWaveIndex > 250
|
||||||
? modifierTypes.EXP_CHARM
|
? modifierTypes.EXP_CHARM
|
||||||
: modifierTypes.SUPER_EXP_CHARM,
|
: modifierTypes.SUPER_EXP_CHARM,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (globalScene.currentBattle.waveIndex <= 150 && !(globalScene.currentBattle.waveIndex % 50)) {
|
if (currentWaveIndex <= 150 && !(currentWaveIndex % 50)) {
|
||||||
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.GOLDEN_POKEBALL);
|
globalScene.phaseManager.pushNew("ModifierRewardPhase", modifierTypes.GOLDEN_POKEBALL);
|
||||||
}
|
}
|
||||||
if (globalScene.gameMode.isEndless && !(globalScene.currentBattle.waveIndex % 50)) {
|
if (gameMode.isEndless && !(currentWaveIndex % 50)) {
|
||||||
globalScene.phaseManager.pushNew(
|
globalScene.phaseManager.pushNew(
|
||||||
"ModifierRewardPhase",
|
"ModifierRewardPhase",
|
||||||
!(globalScene.currentBattle.waveIndex % 250) ? modifierTypes.VOUCHER_PREMIUM : modifierTypes.VOUCHER_PLUS,
|
!(currentWaveIndex % 250) ? modifierTypes.VOUCHER_PREMIUM : modifierTypes.VOUCHER_PLUS,
|
||||||
);
|
);
|
||||||
globalScene.phaseManager.pushNew("AddEnemyBuffModifierPhase");
|
globalScene.phaseManager.pushNew("AddEnemyBuffModifierPhase");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (globalScene.gameMode.hasRandomBiomes || globalScene.isNewBiome()) {
|
if (gameMode.hasRandomBiomes || globalScene.isNewBiome()) {
|
||||||
globalScene.phaseManager.pushNew("SelectBiomePhase");
|
globalScene.phaseManager.pushNew("SelectBiomePhase");
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.phaseManager.pushNew("NewBattlePhase");
|
globalScene.phaseManager.pushNew("NewBattlePhase");
|
||||||
} else {
|
} else {
|
||||||
globalScene.currentBattle.battleType = BattleType.CLEAR;
|
globalScene.currentBattle.battleType = BattleType.CLEAR;
|
||||||
globalScene.score += globalScene.gameMode.getClearScoreBonus();
|
globalScene.score += gameMode.getClearScoreBonus();
|
||||||
globalScene.updateScoreText();
|
globalScene.updateScoreText();
|
||||||
globalScene.phaseManager.pushNew("GameOverPhase", true);
|
globalScene.phaseManager.pushNew("GameOverPhase", true);
|
||||||
}
|
}
|
||||||
@ -126,18 +120,4 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
|
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If this wave is a fixed battle with special custom modifier rewards,
|
|
||||||
* will pass those settings to the upcoming {@linkcode SelectModifierPhase}`.
|
|
||||||
*/
|
|
||||||
getFixedBattleCustomModifiers(): CustomModifierSettings | undefined {
|
|
||||||
const gameMode = globalScene.gameMode;
|
|
||||||
const waveIndex = globalScene.currentBattle.waveIndex;
|
|
||||||
if (gameMode.isFixedBattle(waveIndex)) {
|
|
||||||
return gameMode.getFixedBattle(waveIndex).customModifierRewardSettings;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -448,6 +448,8 @@ export function getAchievementDescription(localizationKey: string): string {
|
|||||||
return i18next.t("achv:FLIP_STATS.description", { context: genderStr });
|
return i18next.t("achv:FLIP_STATS.description", { context: genderStr });
|
||||||
case "FLIP_INVERSE":
|
case "FLIP_INVERSE":
|
||||||
return i18next.t("achv:FLIP_INVERSE.description", { context: genderStr });
|
return i18next.t("achv:FLIP_INVERSE.description", { context: genderStr });
|
||||||
|
case "NUZLOCKE":
|
||||||
|
return i18next.t("achv:NUZLOCKE.description", { context: genderStr });
|
||||||
case "BREEDERS_IN_SPACE":
|
case "BREEDERS_IN_SPACE":
|
||||||
return i18next.t("achv:BREEDERS_IN_SPACE.description", {
|
return i18next.t("achv:BREEDERS_IN_SPACE.description", {
|
||||||
context: genderStr,
|
context: genderStr,
|
||||||
|
@ -208,6 +208,26 @@ export class PokedexMonContainer extends Phaser.GameObjects.Container {
|
|||||||
);
|
);
|
||||||
this.checkIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant);
|
this.checkIconId(defaultProps.female, defaultProps.formIndex, defaultProps.shiny, defaultProps.variant);
|
||||||
this.add(this.icon);
|
this.add(this.icon);
|
||||||
|
|
||||||
|
[
|
||||||
|
this.hiddenAbilityIcon,
|
||||||
|
this.favoriteIcon,
|
||||||
|
this.classicWinIcon,
|
||||||
|
this.candyUpgradeIcon,
|
||||||
|
this.candyUpgradeOverlayIcon,
|
||||||
|
this.eggMove1Icon,
|
||||||
|
this.tmMove1Icon,
|
||||||
|
this.eggMove2Icon,
|
||||||
|
this.tmMove2Icon,
|
||||||
|
this.passive1Icon,
|
||||||
|
this.passive2Icon,
|
||||||
|
this.passive1OverlayIcon,
|
||||||
|
this.passive2OverlayIcon,
|
||||||
|
].forEach(icon => {
|
||||||
|
if (icon) {
|
||||||
|
this.bringToTop(icon);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIconId(female, formIndex, shiny, variant) {
|
checkIconId(female, formIndex, shiny, variant) {
|
||||||
|
@ -410,6 +410,11 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
new DropDownLabel(i18next.t("filterBar:hasHiddenAbility"), undefined, DropDownState.ON),
|
new DropDownLabel(i18next.t("filterBar:hasHiddenAbility"), undefined, DropDownState.ON),
|
||||||
new DropDownLabel(i18next.t("filterBar:noHiddenAbility"), undefined, DropDownState.EXCLUDE),
|
new DropDownLabel(i18next.t("filterBar:noHiddenAbility"), undefined, DropDownState.EXCLUDE),
|
||||||
];
|
];
|
||||||
|
const seenSpeciesLabels = [
|
||||||
|
new DropDownLabel(i18next.t("filterBar:seenSpecies"), undefined, DropDownState.OFF),
|
||||||
|
new DropDownLabel(i18next.t("filterBar:isSeen"), undefined, DropDownState.ON),
|
||||||
|
new DropDownLabel(i18next.t("filterBar:isUnseen"), undefined, DropDownState.EXCLUDE),
|
||||||
|
];
|
||||||
const eggLabels = [
|
const eggLabels = [
|
||||||
new DropDownLabel(i18next.t("filterBar:egg"), undefined, DropDownState.OFF),
|
new DropDownLabel(i18next.t("filterBar:egg"), undefined, DropDownState.OFF),
|
||||||
new DropDownLabel(i18next.t("filterBar:eggPurchasable"), undefined, DropDownState.ON),
|
new DropDownLabel(i18next.t("filterBar:eggPurchasable"), undefined, DropDownState.ON),
|
||||||
@ -423,6 +428,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
new DropDownOption("FAVORITE", favoriteLabels),
|
new DropDownOption("FAVORITE", favoriteLabels),
|
||||||
new DropDownOption("WIN", winLabels),
|
new DropDownOption("WIN", winLabels),
|
||||||
new DropDownOption("HIDDEN_ABILITY", hiddenAbilityLabels),
|
new DropDownOption("HIDDEN_ABILITY", hiddenAbilityLabels),
|
||||||
|
new DropDownOption("SEEN_SPECIES", seenSpeciesLabels),
|
||||||
new DropDownOption("EGG", eggLabels),
|
new DropDownOption("EGG", eggLabels),
|
||||||
new DropDownOption("POKERUS", pokerusLabels),
|
new DropDownOption("POKERUS", pokerusLabels),
|
||||||
];
|
];
|
||||||
@ -792,13 +798,15 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
this.starterSelectMessageBoxContainer.setVisible(!!text?.length);
|
this.starterSelectMessageBoxContainer.setVisible(!!text?.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
isSeen(species: PokemonSpecies, dexEntry: DexEntry): boolean {
|
isSeen(species: PokemonSpecies, dexEntry: DexEntry, seenFilter?: boolean): boolean {
|
||||||
if (dexEntry?.seenAttr) {
|
if (dexEntry?.seenAttr) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (!seenFilter) {
|
||||||
const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)];
|
const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)];
|
||||||
return !!starterDexEntry?.caughtAttr;
|
return !!starterDexEntry?.caughtAttr;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1617,6 +1625,21 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Seen Filter
|
||||||
|
const dexEntry = globalScene.gameData.dexData[species.speciesId];
|
||||||
|
const isItSeen = this.isSeen(species, dexEntry, true);
|
||||||
|
const fitsSeen = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
|
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.ON) {
|
||||||
|
return isItSeen;
|
||||||
|
}
|
||||||
|
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.EXCLUDE) {
|
||||||
|
return !isItSeen;
|
||||||
|
}
|
||||||
|
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.OFF) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Egg Purchasable Filter
|
// Egg Purchasable Filter
|
||||||
const isEggPurchasable = this.isSameSpeciesEggAvailable(species.speciesId);
|
const isEggPurchasable = this.isSameSpeciesEggAvailable(species.speciesId);
|
||||||
const fitsEgg = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
const fitsEgg = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
|
||||||
@ -1658,6 +1681,7 @@ export class PokedexUiHandler extends MessageUiHandler {
|
|||||||
fitsFavorite &&
|
fitsFavorite &&
|
||||||
fitsWin &&
|
fitsWin &&
|
||||||
fitsHA &&
|
fitsHA &&
|
||||||
|
fitsSeen &&
|
||||||
fitsEgg &&
|
fitsEgg &&
|
||||||
fitsPokerus
|
fitsPokerus
|
||||||
) {
|
) {
|
||||||
|
@ -210,7 +210,8 @@ export class RunInfoUiHandler extends UiHandler {
|
|||||||
this.runContainer.add(headerText);
|
this.runContainer.add(headerText);
|
||||||
const runName = addTextObject(0, 0, this.runInfo.name, TextStyle.WINDOW);
|
const runName = addTextObject(0, 0, this.runInfo.name, TextStyle.WINDOW);
|
||||||
runName.setOrigin(0, 0);
|
runName.setOrigin(0, 0);
|
||||||
runName.setPositionRelative(headerBg, 60, 4);
|
const runNameX = headerText.width / 6 + headerText.x + 4;
|
||||||
|
runName.setPositionRelative(headerBg, runNameX, 4);
|
||||||
this.runContainer.add(runName);
|
this.runContainer.add(runName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
import { Challenges } from "#enums/challenges";
|
import { Challenges } from "#enums/challenges";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { PokeballType } from "#enums/pokeball";
|
import { PokeballType } from "#enums/pokeball";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
|
import { runMysteryEncounterToEnd } from "#test/mystery-encounter/encounter-test-utils";
|
||||||
import { GameManager } from "#test/test-utils/game-manager";
|
import { GameManager } from "#test/test-utils/game-manager";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
@ -52,4 +54,18 @@ describe("Challenges - Limited Catch", () => {
|
|||||||
|
|
||||||
expect(game.scene.getPlayerParty()).toHaveLength(1);
|
expect(game.scene.getPlayerParty()).toHaveLength(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should allow gift Pokémon from Mystery Encounters to be added to party", async () => {
|
||||||
|
game.override
|
||||||
|
.mysteryEncounterChance(100)
|
||||||
|
.mysteryEncounter(MysteryEncounterType.THE_POKEMON_SALESMAN)
|
||||||
|
.startingWave(12);
|
||||||
|
game.scene.money = 20000;
|
||||||
|
|
||||||
|
await game.challengeMode.runToSummon([SpeciesId.NUZLEAF]);
|
||||||
|
|
||||||
|
await runMysteryEncounterToEnd(game, 1);
|
||||||
|
|
||||||
|
expect(game.scene.getPlayerParty()).toHaveLength(2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -3,6 +3,7 @@ import { Challenges } from "#enums/challenges";
|
|||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
|
import { ExpBoosterModifier } from "#modifiers/modifier";
|
||||||
import { GameManager } from "#test/test-utils/game-manager";
|
import { GameManager } from "#test/test-utils/game-manager";
|
||||||
import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
|
import { ModifierSelectUiHandler } from "#ui/modifier-select-ui-handler";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
@ -75,6 +76,7 @@ describe("Challenges - Limited Support", () => {
|
|||||||
await game.doKillOpponents();
|
await game.doKillOpponents();
|
||||||
await game.toNextWave();
|
await game.toNextWave();
|
||||||
|
|
||||||
|
expect(game.scene.getModifiers(ExpBoosterModifier)).toHaveLength(1);
|
||||||
expect(playerPokemon).not.toHaveFullHp();
|
expect(playerPokemon).not.toHaveFullHp();
|
||||||
|
|
||||||
game.move.use(MoveId.SPLASH);
|
game.move.use(MoveId.SPLASH);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import { SubstituteTag } from "#data/battler-tags";
|
|
||||||
import { AbilityId } from "#enums/ability-id";
|
import { AbilityId } from "#enums/ability-id";
|
||||||
|
import { ArenaTagSide } from "#enums/arena-tag-side";
|
||||||
import { ArenaTagType } from "#enums/arena-tag-type";
|
import { ArenaTagType } from "#enums/arena-tag-type";
|
||||||
|
import { BattlerIndex } from "#enums/battler-index";
|
||||||
|
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||||
import { MoveId } from "#enums/move-id";
|
import { MoveId } from "#enums/move-id";
|
||||||
import { SpeciesId } from "#enums/species-id";
|
import { SpeciesId } from "#enums/species-id";
|
||||||
import { Stat } from "#enums/stat";
|
import { Stat } from "#enums/stat";
|
||||||
import { MoveEndPhase } from "#phases/move-end-phase";
|
|
||||||
import { TurnEndPhase } from "#phases/turn-end-phase";
|
|
||||||
import { GameManager } from "#test/test-utils/game-manager";
|
import { GameManager } from "#test/test-utils/game-manager";
|
||||||
|
import type { ArenaTrapTagType } from "#types/arena-tags";
|
||||||
import Phaser from "phaser";
|
import Phaser from "phaser";
|
||||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||||
|
|
||||||
@ -31,86 +32,65 @@ describe("Moves - Tidy Up", () => {
|
|||||||
.enemySpecies(SpeciesId.MAGIKARP)
|
.enemySpecies(SpeciesId.MAGIKARP)
|
||||||
.enemyAbility(AbilityId.BALL_FETCH)
|
.enemyAbility(AbilityId.BALL_FETCH)
|
||||||
.enemyMoveset(MoveId.SPLASH)
|
.enemyMoveset(MoveId.SPLASH)
|
||||||
.starterSpecies(SpeciesId.FEEBAS)
|
.ability(AbilityId.BALL_FETCH);
|
||||||
.ability(AbilityId.BALL_FETCH)
|
|
||||||
.moveset([MoveId.TIDY_UP])
|
|
||||||
.startingLevel(50);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("spikes are cleared", async () => {
|
it.each<{ name: string; tagType: ArenaTrapTagType }>([
|
||||||
game.override.moveset([MoveId.SPIKES, MoveId.TIDY_UP]).enemyMoveset(MoveId.SPIKES);
|
{ name: "Spikes", tagType: ArenaTagType.SPIKES },
|
||||||
await game.classicMode.startBattle();
|
{ name: "Toxic Spikes", tagType: ArenaTagType.TOXIC_SPIKES },
|
||||||
|
{ name: "Stealth Rock", tagType: ArenaTagType.STEALTH_ROCK },
|
||||||
|
{ name: "Sticky Web", tagType: ArenaTagType.STICKY_WEB },
|
||||||
|
])("should remove $name from both sides of the field", async ({ tagType }) => {
|
||||||
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.SPIKES);
|
// Add tag to both sides of the field
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
game.scene.arena.addTag(tagType, 1, undefined, game.field.getPlayerPokemon().id, ArenaTagSide.PLAYER);
|
||||||
game.move.select(MoveId.TIDY_UP);
|
game.scene.arena.addTag(tagType, 1, undefined, game.field.getPlayerPokemon().id, ArenaTagSide.ENEMY);
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.SPIKES)).toBeUndefined();
|
expect(game.scene.arena.getTag(tagType)).toBeDefined();
|
||||||
|
|
||||||
|
game.move.use(MoveId.TIDY_UP);
|
||||||
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
|
expect(game.scene.arena.getTag(tagType)).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("stealth rocks are cleared", async () => {
|
it("should clear substitutes from all pokemon", async () => {
|
||||||
game.override.moveset([MoveId.STEALTH_ROCK, MoveId.TIDY_UP]).enemyMoveset(MoveId.STEALTH_ROCK);
|
game.override.battleStyle("double");
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle([SpeciesId.CINCCINO, SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
game.move.select(MoveId.STEALTH_ROCK);
|
game.move.use(MoveId.SUBSTITUTE, BattlerIndex.PLAYER);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
game.move.use(MoveId.SUBSTITUTE, BattlerIndex.PLAYER_2);
|
||||||
game.move.select(MoveId.TIDY_UP);
|
await game.move.forceEnemyMove(MoveId.SUBSTITUTE);
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
await game.move.forceEnemyMove(MoveId.SUBSTITUTE);
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.STEALTH_ROCK)).toBeUndefined();
|
await game.toNextTurn();
|
||||||
});
|
|
||||||
|
|
||||||
it("toxic spikes are cleared", async () => {
|
game.scene.getField(true).forEach(p => {
|
||||||
game.override.moveset([MoveId.TOXIC_SPIKES, MoveId.TIDY_UP]).enemyMoveset(MoveId.TOXIC_SPIKES);
|
expect(p).toHaveBattlerTag(BattlerTagType.SUBSTITUTE);
|
||||||
await game.classicMode.startBattle();
|
});
|
||||||
|
|
||||||
game.move.select(MoveId.TOXIC_SPIKES);
|
game.move.use(MoveId.TIDY_UP, BattlerIndex.PLAYER);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
game.move.use(MoveId.SPLASH, BattlerIndex.PLAYER_2);
|
||||||
game.move.select(MoveId.TIDY_UP);
|
await game.move.forceEnemyMove(MoveId.SPLASH);
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
await game.move.forceEnemyMove(MoveId.SPLASH);
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.TOXIC_SPIKES)).toBeUndefined();
|
await game.toEndOfTurn();
|
||||||
});
|
|
||||||
|
|
||||||
it("sticky webs are cleared", async () => {
|
game.scene.getField(true).forEach(p => {
|
||||||
game.override.moveset([MoveId.STICKY_WEB, MoveId.TIDY_UP]).enemyMoveset(MoveId.STICKY_WEB);
|
expect(p).not.toHaveBattlerTag(BattlerTagType.SUBSTITUTE);
|
||||||
|
|
||||||
await game.classicMode.startBattle();
|
|
||||||
|
|
||||||
game.move.select(MoveId.STICKY_WEB);
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
|
||||||
game.move.select(MoveId.TIDY_UP);
|
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
|
||||||
expect(game.scene.arena.getTag(ArenaTagType.STICKY_WEB)).toBeUndefined();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("substitutes are cleared", async () => {
|
|
||||||
game.override.moveset([MoveId.SUBSTITUTE, MoveId.TIDY_UP]).enemyMoveset(MoveId.SUBSTITUTE);
|
|
||||||
|
|
||||||
await game.classicMode.startBattle();
|
|
||||||
|
|
||||||
game.move.select(MoveId.SUBSTITUTE);
|
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
|
||||||
game.move.select(MoveId.TIDY_UP);
|
|
||||||
await game.phaseInterceptor.to(MoveEndPhase);
|
|
||||||
|
|
||||||
const pokemon = [game.field.getPlayerPokemon(), game.field.getEnemyPokemon()];
|
|
||||||
pokemon.forEach(p => {
|
|
||||||
expect(p).toBeDefined();
|
|
||||||
expect(p!.getTag(SubstituteTag)).toBeUndefined();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("user's stats are raised with no traps set", async () => {
|
it("should raise the user's stats even if a tag cannot be removed", async () => {
|
||||||
await game.classicMode.startBattle();
|
await game.classicMode.startBattle([SpeciesId.FEEBAS]);
|
||||||
|
|
||||||
const playerPokemon = game.field.getPlayerPokemon();
|
const feebas = game.field.getPlayerPokemon();
|
||||||
|
expect(feebas).toHaveStatStage(Stat.ATK, 0);
|
||||||
|
expect(feebas).toHaveStatStage(Stat.SPD, 0);
|
||||||
|
|
||||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(0);
|
game.move.use(MoveId.TIDY_UP);
|
||||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(0);
|
await game.toEndOfTurn();
|
||||||
|
|
||||||
game.move.select(MoveId.TIDY_UP);
|
expect(feebas).toHaveStatStage(Stat.ATK, 1);
|
||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
expect(feebas).toHaveStatStage(Stat.SPD, 1);
|
||||||
|
|
||||||
expect(playerPokemon.getStatStage(Stat.ATK)).toBe(1);
|
|
||||||
expect(playerPokemon.getStatStage(Stat.SPD)).toBe(1);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user