Merge branch 'main' into teatime
|
@ -7,8 +7,11 @@ PokéRogue is a browser based Pokémon fangame heavily inspired by the roguelite
|
||||||
If you have the motivation and experience with Typescript/Javascript (or are willing to learn) please feel free to fork the repository and make pull requests with contributions. If you don't know what to work on but want to help, reference the below **To-Do** section or the **#vote** channel in the discord.
|
If you have the motivation and experience with Typescript/Javascript (or are willing to learn) please feel free to fork the repository and make pull requests with contributions. If you don't know what to work on but want to help, reference the below **To-Do** section or the **#vote** channel in the discord.
|
||||||
|
|
||||||
### 💻 Environment Setup
|
### 💻 Environment Setup
|
||||||
node: 18.3.0
|
#### Prerequisites
|
||||||
|
- node: 18.3.0
|
||||||
|
- npm: [how to install](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
|
||||||
|
|
||||||
|
#### Running Locally
|
||||||
1. Clone the repo and in the root directory run `npm install`
|
1. Clone the repo and in the root directory run `npm install`
|
||||||
- *if you run into any errors, reach out in the **#dev-corner** channel in discord*
|
- *if you run into any errors, reach out in the **#dev-corner** channel in discord*
|
||||||
2. Run `npm run start:dev` to locally run the project in `localhost:8000`
|
2. Run `npm run start:dev` to locally run the project in `localhost:8000`
|
||||||
|
|
|
@ -4,30 +4,30 @@
|
||||||
"image": "1024-stellar.png",
|
"image": "1024-stellar.png",
|
||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {
|
"size": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"scale": 0.5,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
{
|
{
|
||||||
"filename": "0001.png",
|
"filename": "0001.png",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"trimmed": false,
|
"trimmed": false,
|
||||||
"sourceSize": {
|
"sourceSize": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"spriteSourceSize": {
|
"spriteSourceSize": {
|
||||||
"x": 9,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 78,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"frame": {
|
"frame": {
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 78,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -36,6 +36,6 @@
|
||||||
"meta": {
|
"meta": {
|
||||||
"app": "https://www.codeandweb.com/texturepacker",
|
"app": "https://www.codeandweb.com/texturepacker",
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:c9ee64bda72f2dadb06109338796ccac:1313f1218b7da2c57ad9f290d1323840:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
"smartupdate": "$TexturePacker:SmartUpdate:bc663acf2e62803fce6c3a525dc8dd98:ccd7d0de8a487235cfbd6f372afa931f:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
@ -4,30 +4,30 @@
|
||||||
"image": "1024-stellar.png",
|
"image": "1024-stellar.png",
|
||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {
|
"size": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"scale": 0.333,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
{
|
{
|
||||||
"filename": "0001.png",
|
"filename": "0001.png",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"trimmed": false,
|
"trimmed": false,
|
||||||
"sourceSize": {
|
"sourceSize": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"spriteSourceSize": {
|
"spriteSourceSize": {
|
||||||
"x": 5,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 86,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"frame": {
|
"frame": {
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 86,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -36,6 +36,6 @@
|
||||||
"meta": {
|
"meta": {
|
||||||
"app": "https://www.codeandweb.com/texturepacker",
|
"app": "https://www.codeandweb.com/texturepacker",
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:ac5e775f77477eeabd029932804747c4:f7a112a87c35dc81cb0da88b7cbb39e8:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
"smartupdate": "$TexturePacker:SmartUpdate:210ba1c2e6e58501571ae226d073a3c5:f12bdf191842f7ec3a4be98a43fb8121:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.3 KiB |
|
@ -4,30 +4,30 @@
|
||||||
"image": "1024-stellar.png",
|
"image": "1024-stellar.png",
|
||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {
|
"size": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"scale": 0.333,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
{
|
{
|
||||||
"filename": "0001.png",
|
"filename": "0001.png",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"trimmed": false,
|
"trimmed": false,
|
||||||
"sourceSize": {
|
"sourceSize": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"spriteSourceSize": {
|
"spriteSourceSize": {
|
||||||
"x": 5,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 86,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"frame": {
|
"frame": {
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 86,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -36,6 +36,6 @@
|
||||||
"meta": {
|
"meta": {
|
||||||
"app": "https://www.codeandweb.com/texturepacker",
|
"app": "https://www.codeandweb.com/texturepacker",
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:2bd25bae0fabcfbc35e24bd578a7b4b5:aec60788a0d77f38fb599d721e41a0d6:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
"smartupdate": "$TexturePacker:SmartUpdate:210ba1c2e6e58501571ae226d073a3c5:f12bdf191842f7ec3a4be98a43fb8121:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 3.3 KiB |
|
@ -4,30 +4,30 @@
|
||||||
"image": "1024-stellar.png",
|
"image": "1024-stellar.png",
|
||||||
"format": "RGBA8888",
|
"format": "RGBA8888",
|
||||||
"size": {
|
"size": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"scale": 0.5,
|
"scale": 1,
|
||||||
"frames": [
|
"frames": [
|
||||||
{
|
{
|
||||||
"filename": "0001.png",
|
"filename": "0001.png",
|
||||||
"rotated": false,
|
"rotated": false,
|
||||||
"trimmed": false,
|
"trimmed": false,
|
||||||
"sourceSize": {
|
"sourceSize": {
|
||||||
"w": 96,
|
"w": 119,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"spriteSourceSize": {
|
"spriteSourceSize": {
|
||||||
"x": 9,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 78,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
},
|
},
|
||||||
"frame": {
|
"frame": {
|
||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 0,
|
"y": 0,
|
||||||
"w": 78,
|
"w": 115,
|
||||||
"h": 96
|
"h": 119
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -36,6 +36,6 @@
|
||||||
"meta": {
|
"meta": {
|
||||||
"app": "https://www.codeandweb.com/texturepacker",
|
"app": "https://www.codeandweb.com/texturepacker",
|
||||||
"version": "3.0",
|
"version": "3.0",
|
||||||
"smartupdate": "$TexturePacker:SmartUpdate:a7e89af07a22475413df24b510c193f7:45261af90c4a51e3dc73cccb894a2aad:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
"smartupdate": "$TexturePacker:SmartUpdate:3510deaf42eaa3ee2fdfa22c00a2b30b:3beb6b12ca1bb50ad260593b41939f27:c1508f3b01ae78a28a1267fd6caa4f7b$"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
@ -17,7 +17,7 @@ import { TextStyle, addTextObject } from './ui/text';
|
||||||
import { Moves } from "./data/enums/moves";
|
import { Moves } from "./data/enums/moves";
|
||||||
import { allMoves } from "./data/move";
|
import { allMoves } from "./data/move";
|
||||||
import { initMoves } from './data/move';
|
import { initMoves } from './data/move';
|
||||||
import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave } from './modifier/modifier-type';
|
import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave, getModifierPoolForType } from './modifier/modifier-type';
|
||||||
import AbilityBar from './ui/ability-bar';
|
import AbilityBar from './ui/ability-bar';
|
||||||
import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, IncrementMovePriorityAbAttr, applyAbAttrs, initAbilities } from './data/ability';
|
import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, IncrementMovePriorityAbAttr, applyAbAttrs, initAbilities } from './data/ability';
|
||||||
import { Abilities } from "./data/enums/abilities";
|
import { Abilities } from "./data/enums/abilities";
|
||||||
|
@ -37,7 +37,7 @@ import SettingsUiHandler from './ui/settings-ui-handler';
|
||||||
import MessageUiHandler from './ui/message-ui-handler';
|
import MessageUiHandler from './ui/message-ui-handler';
|
||||||
import { Species } from './data/enums/species';
|
import { Species } from './data/enums/species';
|
||||||
import InvertPostFX from './pipelines/invert';
|
import InvertPostFX from './pipelines/invert';
|
||||||
import { Achv, ModifierAchv, achvs } from './system/achv';
|
import { Achv, ModifierAchv, MoneyAchv, achvs } from './system/achv';
|
||||||
import { Voucher, vouchers } from './system/voucher';
|
import { Voucher, vouchers } from './system/voucher';
|
||||||
import { Gender } from './data/gender';
|
import { Gender } from './data/gender';
|
||||||
import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin';
|
import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin';
|
||||||
|
@ -795,7 +795,11 @@ export default class BattleScene extends SceneBase {
|
||||||
this.trainer.setVisible(true);
|
this.trainer.setVisible(true);
|
||||||
|
|
||||||
if (reloadI18n) {
|
if (reloadI18n) {
|
||||||
const localizable: Localizable[] = [ ...allMoves ];
|
const localizable: Localizable[] = [
|
||||||
|
...allSpecies,
|
||||||
|
...allMoves,
|
||||||
|
...Utils.getEnumValues(ModifierPoolType).map(mpt => getModifierPoolForType(mpt)).map(mp => Object.values(mp).flat().map(mt => mt.modifierType).filter(mt => 'localize' in mt).map(lpb => lpb as unknown as Localizable)).flat()
|
||||||
|
];
|
||||||
for (let item of localizable)
|
for (let item of localizable)
|
||||||
item.localize();
|
item.localize();
|
||||||
}
|
}
|
||||||
|
@ -1676,6 +1680,12 @@ export default class BattleScene extends SceneBase {
|
||||||
this.phaseQueue.push(new TurnInitPhase(this));
|
this.phaseQueue.push(new TurnInitPhase(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addMoney(amount: integer): void {
|
||||||
|
this.money = Math.min(this.money + amount, Number.MAX_SAFE_INTEGER);
|
||||||
|
this.updateMoneyText();
|
||||||
|
this.validateAchvs(MoneyAchv);
|
||||||
|
}
|
||||||
|
|
||||||
getWaveMoneyAmount(moneyMultiplier: number): integer {
|
getWaveMoneyAmount(moneyMultiplier: number): integer {
|
||||||
const waveIndex = this.currentBattle.waveIndex;
|
const waveIndex = this.currentBattle.waveIndex;
|
||||||
const waveSetIndex = Math.ceil(waveIndex / 10) - 1;
|
const waveSetIndex = Math.ceil(waveIndex / 10) - 1;
|
||||||
|
|
|
@ -157,10 +157,8 @@ export default class Battle {
|
||||||
const moneyAmount = new Utils.IntegerHolder(scene.currentBattle.moneyScattered);
|
const moneyAmount = new Utils.IntegerHolder(scene.currentBattle.moneyScattered);
|
||||||
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
||||||
|
|
||||||
scene.money += moneyAmount.value;
|
scene.addMoney(moneyAmount.value);
|
||||||
scene.updateMoneyText();
|
|
||||||
|
|
||||||
scene.validateAchvs(MoneyAchv);
|
|
||||||
scene.queueMessage(`You picked up ₽${moneyAmount.value.toLocaleString('en-US')}!`, null, true);
|
scene.queueMessage(`You picked up ₽${moneyAmount.value.toLocaleString('en-US')}!`, null, true);
|
||||||
|
|
||||||
scene.currentBattle.moneyScattered = 0;
|
scene.currentBattle.moneyScattered = 0;
|
||||||
|
|
|
@ -9,7 +9,8 @@ import { BattlerTag } from "./battler-tags";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
import { StatusEffect, getStatusEffectDescriptor, getStatusEffectHealText } from "./status-effect";
|
import { StatusEffect, getStatusEffectDescriptor, getStatusEffectHealText } from "./status-effect";
|
||||||
import { Gender } from "./gender";
|
import { Gender } from "./gender";
|
||||||
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, RecoilAttr, StatusMoveTypeImmunityAttr, FlinchAttr, allMoves } from "./move";
|
import Move, { AttackMove, MoveCategory, MoveFlags, MoveTarget, RecoilAttr, StatusMoveTypeImmunityAttr, FlinchAttr, OneHitKOAttr, HitHealAttr, StrengthSapHealAttr, allMoves } from "./move";
|
||||||
|
import { ArenaTagSide, ArenaTrapTag } from "./arena-tag";
|
||||||
import { ArenaTagType } from "./enums/arena-tag-type";
|
import { ArenaTagType } from "./enums/arena-tag-type";
|
||||||
import { Stat } from "./pokemon-stat";
|
import { Stat } from "./pokemon-stat";
|
||||||
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
||||||
|
@ -520,6 +521,16 @@ export class MoveImmunityStatChangeAbAttr extends MoveImmunityAbAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class ReverseDrainAbAttr extends PostDefendAbAttr {
|
||||||
|
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
||||||
|
if (!!move.getMove().getAttrs(HitHealAttr).length || !!move.getMove().getAttrs(StrengthSapHealAttr).length ) {
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(attacker, ` sucked up the liquid ooze!`));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class PostDefendStatChangeAbAttr extends PostDefendAbAttr {
|
export class PostDefendStatChangeAbAttr extends PostDefendAbAttr {
|
||||||
private condition: PokemonDefendCondition;
|
private condition: PokemonDefendCondition;
|
||||||
private stat: BattleStat;
|
private stat: BattleStat;
|
||||||
|
@ -545,6 +556,29 @@ export class PostDefendStatChangeAbAttr extends PostDefendAbAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class PostDefendApplyArenaTrapTagAbAttr extends PostDefendAbAttr {
|
||||||
|
private condition: PokemonDefendCondition;
|
||||||
|
private tagType: ArenaTagType;
|
||||||
|
|
||||||
|
constructor(condition: PokemonDefendCondition, tagType: ArenaTagType) {
|
||||||
|
super(true);
|
||||||
|
|
||||||
|
this.condition = condition;
|
||||||
|
this.tagType = tagType;
|
||||||
|
}
|
||||||
|
|
||||||
|
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
|
||||||
|
if (this.condition(pokemon, attacker, move.getMove())) {
|
||||||
|
const tag = pokemon.scene.arena.getTag(this.tagType) as ArenaTrapTag;
|
||||||
|
if (!pokemon.scene.arena.getTag(this.tagType) || tag.layers < tag.maxLayers) {
|
||||||
|
pokemon.scene.arena.addTag(this.tagType, 0, undefined, pokemon.id, pokemon.isPlayer() ? ArenaTagSide.ENEMY : ArenaTagSide.PLAYER);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class PostDefendApplyBattlerTagAbAttr extends PostDefendAbAttr {
|
export class PostDefendApplyBattlerTagAbAttr extends PostDefendAbAttr {
|
||||||
private condition: PokemonDefendCondition;
|
private condition: PokemonDefendCondition;
|
||||||
private tagType: BattlerTagType;
|
private tagType: BattlerTagType;
|
||||||
|
@ -1569,6 +1603,43 @@ function getWeatherCondition(...weatherTypes: WeatherType[]): AbAttrCondition {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getAnticipationCondition(): AbAttrCondition {
|
||||||
|
return (pokemon: Pokemon) => {
|
||||||
|
for (let opponent of pokemon.getOpponents()) {
|
||||||
|
for (let move of opponent.moveset) {
|
||||||
|
// move is super effective
|
||||||
|
if (move.getMove() instanceof AttackMove && pokemon.getAttackTypeEffectiveness(move.getMove().type) >= 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// move is a OHKO
|
||||||
|
if (move.getMove().findAttr(attr => attr instanceof OneHitKOAttr)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// edge case for hidden power, type is computed
|
||||||
|
if (move.getMove().id === Moves.HIDDEN_POWER) {
|
||||||
|
const iv_val = Math.floor(((opponent.ivs[Stat.HP] & 1)
|
||||||
|
+(opponent.ivs[Stat.ATK] & 1) * 2
|
||||||
|
+(opponent.ivs[Stat.DEF] & 1) * 4
|
||||||
|
+(opponent.ivs[Stat.SPD] & 1) * 8
|
||||||
|
+(opponent.ivs[Stat.SPATK] & 1) * 16
|
||||||
|
+(opponent.ivs[Stat.SPDEF] & 1) * 32) * 15/63);
|
||||||
|
|
||||||
|
const type = [
|
||||||
|
Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND,
|
||||||
|
Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL,
|
||||||
|
Type.FIRE, Type.WATER, Type.GRASS, Type.ELECTRIC,
|
||||||
|
Type.PSYCHIC, Type.ICE, Type.DRAGON, Type.DARK][iv_val];
|
||||||
|
|
||||||
|
if (pokemon.getAttackTypeEffectiveness(type) >= 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export class PostWeatherChangeAbAttr extends AbAttr {
|
export class PostWeatherChangeAbAttr extends AbAttr {
|
||||||
applyPostWeatherChange(pokemon: Pokemon, passive: boolean, weather: WeatherType, args: any[]): boolean {
|
applyPostWeatherChange(pokemon: Pokemon, passive: boolean, weather: WeatherType, args: any[]): boolean {
|
||||||
return false;
|
return false;
|
||||||
|
@ -2488,7 +2559,8 @@ export function initAbilities() {
|
||||||
new Ability(Abilities.MARVEL_SCALE, "Marvel Scale", "The Pokémon's marvelous scales boost the Defense stat if it has a status condition.", 3)
|
new Ability(Abilities.MARVEL_SCALE, "Marvel Scale", "The Pokémon's marvelous scales boost the Defense stat if it has a status condition.", 3)
|
||||||
.conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.DEF, 1.5)
|
.conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.DEF, 1.5)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
new Ability(Abilities.LIQUID_OOZE, "Liquid Ooze (N)", "The oozed liquid has a strong stench, which damages attackers using any draining move.", 3),
|
new Ability(Abilities.LIQUID_OOZE, "Liquid Ooze", "The oozed liquid has a strong stench, which damages attackers using any draining move.", 3)
|
||||||
|
.attr(ReverseDrainAbAttr),
|
||||||
new Ability(Abilities.OVERGROW, "Overgrow", "Powers up Grass-type moves when the Pokémon's HP is low.", 3)
|
new Ability(Abilities.OVERGROW, "Overgrow", "Powers up Grass-type moves when the Pokémon's HP is low.", 3)
|
||||||
.attr(LowHpMoveTypePowerBoostAbAttr, Type.GRASS),
|
.attr(LowHpMoveTypePowerBoostAbAttr, Type.GRASS),
|
||||||
new Ability(Abilities.BLAZE, "Blaze", "Powers up Fire-type moves when the Pokémon's HP is low.", 3)
|
new Ability(Abilities.BLAZE, "Blaze", "Powers up Fire-type moves when the Pokémon's HP is low.", 3)
|
||||||
|
@ -2595,7 +2667,8 @@ export function initAbilities() {
|
||||||
new Ability(Abilities.AFTERMATH, "Aftermath", "Damages the attacker if it contacts the Pokémon with a finishing hit.", 4)
|
new Ability(Abilities.AFTERMATH, "Aftermath", "Damages the attacker if it contacts the Pokémon with a finishing hit.", 4)
|
||||||
.attr(PostFaintContactDamageAbAttr,4)
|
.attr(PostFaintContactDamageAbAttr,4)
|
||||||
.bypassFaint(),
|
.bypassFaint(),
|
||||||
new Ability(Abilities.ANTICIPATION, "Anticipation (N)", "The Pokémon can sense an opposing Pokémon's dangerous moves.", 4),
|
new Ability(Abilities.ANTICIPATION, "Anticipation", "The Pokémon can sense an opposing Pokémon's dangerous moves.", 4)
|
||||||
|
.conditionalAttr(getAnticipationCondition(), PostSummonMessageAbAttr, (pokemon: Pokemon) => getPokemonMessage(pokemon, ' shuddered!')),
|
||||||
new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of the moves an opposing Pokémon has.", 4),
|
new Ability(Abilities.FOREWARN, "Forewarn (N)", "When it enters a battle, the Pokémon can tell one of the moves an opposing Pokémon has.", 4),
|
||||||
new Ability(Abilities.UNAWARE, "Unaware", "When attacking, the Pokémon ignores the target Pokémon's stat changes.", 4)
|
new Ability(Abilities.UNAWARE, "Unaware", "When attacking, the Pokémon ignores the target Pokémon's stat changes.", 4)
|
||||||
.attr(IgnoreOpponentStatChangesAbAttr)
|
.attr(IgnoreOpponentStatChangesAbAttr)
|
||||||
|
@ -3098,7 +3171,9 @@ export function initAbilities() {
|
||||||
.attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.SLICING_MOVE), 1.5),
|
.attr(MovePowerBoostAbAttr, (user, target, move) => move.hasFlag(MoveFlags.SLICING_MOVE), 1.5),
|
||||||
new Ability(Abilities.SUPREME_OVERLORD, "Supreme Overlord (N)", "When the Pokémon enters a battle, its Attack and Sp. Atk stats are slightly boosted for each of the allies in its party that have already been defeated.", 9),
|
new Ability(Abilities.SUPREME_OVERLORD, "Supreme Overlord (N)", "When the Pokémon enters a battle, its Attack and Sp. Atk stats are slightly boosted for each of the allies in its party that have already been defeated.", 9),
|
||||||
new Ability(Abilities.COSTAR, "Costar (N)", "When the Pokémon enters a battle, it copies an ally's stat changes.", 9),
|
new Ability(Abilities.COSTAR, "Costar (N)", "When the Pokémon enters a battle, it copies an ally's stat changes.", 9),
|
||||||
new Ability(Abilities.TOXIC_DEBRIS, "Toxic Debris (N)", "Scatters poison spikes at the feet of the opposing team when the Pokémon takes damage from physical moves.", 9),
|
new Ability(Abilities.TOXIC_DEBRIS, "Toxic Debris", "Scatters poison spikes at the feet of the opposing team when the Pokémon takes damage from physical moves.", 9)
|
||||||
|
.attr(PostDefendApplyArenaTrapTagAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, ArenaTagType.TOXIC_SPIKES)
|
||||||
|
.bypassFaint(),
|
||||||
new Ability(Abilities.ARMOR_TAIL, "Armor Tail", "The mysterious tail covering the Pokémon's head makes opponents unable to use priority moves against the Pokémon or its allies.", 9)
|
new Ability(Abilities.ARMOR_TAIL, "Armor Tail", "The mysterious tail covering the Pokémon's head makes opponents unable to use priority moves against the Pokémon or its allies.", 9)
|
||||||
.attr(FieldPriorityMoveImmunityAbAttr)
|
.attr(FieldPriorityMoveImmunityAbAttr)
|
||||||
.ignorable(),
|
.ignorable(),
|
||||||
|
|
|
@ -249,7 +249,7 @@ export async function printPokemon() {
|
||||||
Math.max(abilities.indexOf(pokemon.abilities.find(a => a.slot === 3)?.ability.name), 0)
|
Math.max(abilities.indexOf(pokemon.abilities.find(a => a.slot === 3)?.ability.name), 0)
|
||||||
];
|
];
|
||||||
|
|
||||||
const pokemonSpecies = new PokemonSpecies(dexId, species.names.find(n => n.language.name === 'en').name, generationIndex, species.is_legendary && baseTotal < 660, species.is_legendary && baseTotal >= 660, species.is_mythical,
|
const pokemonSpecies = new PokemonSpecies(dexId, generationIndex, species.is_legendary && baseTotal < 660, species.is_legendary && baseTotal >= 660, species.is_mythical,
|
||||||
species.genera.find(g => g.language.name === 'en')?.genus, type1 as Type, type2 > -1 ? type2 as Type : null, pokemon.height / 10, pokemon.weight / 10, ability1 as Abilities, ability2 as Abilities, abilityHidden as Abilities,
|
species.genera.find(g => g.language.name === 'en')?.genus, type1 as Type, type2 > -1 ? type2 as Type : null, pokemon.height / 10, pokemon.weight / 10, ability1 as Abilities, ability2 as Abilities, abilityHidden as Abilities,
|
||||||
baseTotal, baseStats[0], baseStats[1], baseStats[2], baseStats[3], baseStats[4], baseStats[5], species.capture_rate, species.base_happiness, pokemon.base_experience, growthRateMap[species.growth_rate.name],
|
baseTotal, baseStats[0], baseStats[1], baseStats[2], baseStats[3], baseStats[4], baseStats[5], species.capture_rate, species.base_happiness, pokemon.base_experience, growthRateMap[species.growth_rate.name],
|
||||||
species.gender_rate < 9 ? 100 - (species.gender_rate * 12.5) : null, species.has_gender_differences, species.forms_switchable);
|
species.gender_rate < 9 ? 100 - (species.gender_rate * 12.5) : null, species.has_gender_differences, species.forms_switchable);
|
||||||
|
|
|
@ -8,7 +8,7 @@ import * as Utils from "../utils";
|
||||||
import { Moves } from "./enums/moves";
|
import { Moves } from "./enums/moves";
|
||||||
import { ChargeAttr, MoveFlags, allMoves } from "./move";
|
import { ChargeAttr, MoveFlags, allMoves } from "./move";
|
||||||
import { Type } from "./type";
|
import { Type } from "./type";
|
||||||
import { BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, applyAbAttrs } from "./ability";
|
import { BlockNonDirectDamageAbAttr, FlinchEffectAbAttr, ReverseDrainAbAttr, applyAbAttrs } from "./ability";
|
||||||
import { Abilities } from "./enums/abilities";
|
import { Abilities } from "./enums/abilities";
|
||||||
import { BattlerTagType } from "./enums/battler-tag-type";
|
import { BattlerTagType } from "./enums/battler-tag-type";
|
||||||
import { TerrainType } from "./terrain";
|
import { TerrainType } from "./terrain";
|
||||||
|
@ -292,7 +292,11 @@ export class SeedTag extends BattlerTag {
|
||||||
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, source.getBattlerIndex(), pokemon.getBattlerIndex(), CommonAnim.LEECH_SEED));
|
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, source.getBattlerIndex(), pokemon.getBattlerIndex(), CommonAnim.LEECH_SEED));
|
||||||
|
|
||||||
const damage = pokemon.damageAndUpdate(Math.max(Math.floor(pokemon.getMaxHp() / 8), 1));
|
const damage = pokemon.damageAndUpdate(Math.max(Math.floor(pokemon.getMaxHp() / 8), 1));
|
||||||
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, source.getBattlerIndex(), damage, getPokemonMessage(pokemon, '\'s health is\nsapped by Leech Seed!'), false, true));
|
const reverseDrain = pokemon.hasAbilityWithAttr(ReverseDrainAbAttr);
|
||||||
|
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, source.getBattlerIndex(),
|
||||||
|
!reverseDrain ? damage : damage * -1,
|
||||||
|
!reverseDrain ? getPokemonMessage(pokemon, '\'s health is\nsapped by Leech Seed!') : getPokemonMessage(source, '\'s Leech Seed\nsucked up the liquid ooze!'),
|
||||||
|
false, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1017,6 +1021,39 @@ export class SaltCuredTag extends BattlerTag {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class CursedTag extends BattlerTag {
|
||||||
|
private sourceIndex: integer;
|
||||||
|
|
||||||
|
constructor(sourceId: integer) {
|
||||||
|
super(BattlerTagType.CURSED, BattlerTagLapseType.TURN_END, 1, Moves.CURSE, sourceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
onAdd(pokemon: Pokemon): void {
|
||||||
|
super.onAdd(pokemon);
|
||||||
|
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' has been cursed!'));
|
||||||
|
this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
|
||||||
|
const ret = lapseType !== BattlerTagLapseType.CUSTOM || super.lapse(pokemon, lapseType);
|
||||||
|
|
||||||
|
if (ret) {
|
||||||
|
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.getBattlerIndex(), CommonAnim.SALT_CURE));
|
||||||
|
|
||||||
|
const cancelled = new Utils.BooleanHolder(false);
|
||||||
|
applyAbAttrs(BlockNonDirectDamageAbAttr, pokemon, cancelled);
|
||||||
|
|
||||||
|
if (!cancelled.value) {
|
||||||
|
pokemon.damageAndUpdate(Math.floor(pokemon.getMaxHp() / 4));
|
||||||
|
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt by the ${this.getMoveName()}!`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourceMove: Moves, sourceId: integer): BattlerTag {
|
export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourceMove: Moves, sourceId: integer): BattlerTag {
|
||||||
switch (tagType) {
|
switch (tagType) {
|
||||||
case BattlerTagType.RECHARGING:
|
case BattlerTagType.RECHARGING:
|
||||||
|
@ -1114,6 +1151,8 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
|
||||||
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount - 1, sourceMove);
|
return new BattlerTag(tagType, BattlerTagLapseType.TURN_END, turnCount - 1, sourceMove);
|
||||||
case BattlerTagType.SALT_CURED:
|
case BattlerTagType.SALT_CURED:
|
||||||
return new SaltCuredTag(sourceId);
|
return new SaltCuredTag(sourceId);
|
||||||
|
case BattlerTagType.CURSED:
|
||||||
|
return new CursedTag(sourceId);
|
||||||
case BattlerTagType.CHARGED:
|
case BattlerTagType.CHARGED:
|
||||||
return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true);
|
return new TypeBoostTag(tagType, sourceMove, Type.ELECTRIC, 2, true);
|
||||||
case BattlerTagType.NONE:
|
case BattlerTagType.NONE:
|
||||||
|
|
|
@ -49,6 +49,7 @@ export enum BattlerTagType {
|
||||||
BYPASS_SLEEP = "BYPASS_SLEEP",
|
BYPASS_SLEEP = "BYPASS_SLEEP",
|
||||||
IGNORE_FLYING = "IGNORE_FLYING",
|
IGNORE_FLYING = "IGNORE_FLYING",
|
||||||
SALT_CURED = "SALT_CURED",
|
SALT_CURED = "SALT_CURED",
|
||||||
|
CURSED = "CURSED",
|
||||||
CHARGED = "CHARGED",
|
CHARGED = "CHARGED",
|
||||||
GROUNDED = "GROUNDED"
|
GROUNDED = "GROUNDED"
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import * as Utils from "../utils";
|
||||||
import { WeatherType } from "./weather";
|
import { WeatherType } from "./weather";
|
||||||
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 { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, NoTransformAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, PreventBerryUseAbAttr, BlockItemTheftAbAttr } from "./ability";
|
import { UnswappableAbilityAbAttr, UncopiableAbilityAbAttr, UnsuppressableAbilityAbAttr, NoTransformAbilityAbAttr, BlockRecoilDamageAttr, BlockOneHitKOAbAttr, IgnoreContactAbAttr, MaxMultiHitAbAttr, applyAbAttrs, BlockNonDirectDamageAbAttr, applyPreSwitchOutAbAttrs, PreSwitchOutAbAttr, applyPostDefendAbAttrs, PostDefendContactApplyStatusEffectAbAttr, MoveAbilityBypassAbAttr, PreventBerryUseAbAttr, BlockItemTheftAbAttr, ReverseDrainAbAttr } from "./ability";
|
||||||
import { Abilities } from "./enums/abilities";
|
import { Abilities } from "./enums/abilities";
|
||||||
import { allAbilities } from './ability';
|
import { allAbilities } from './ability';
|
||||||
import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier";
|
import { PokemonHeldItemModifier, BerryModifier, PreserveBerryModifier } from "../modifier/modifier";
|
||||||
|
@ -97,9 +97,6 @@ export default class Move implements Localizable {
|
||||||
constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) {
|
constructor(id: Moves, type: Type, category: MoveCategory, defaultMoveTarget: MoveTarget, power: integer, accuracy: integer, pp: integer, chance: integer, priority: integer, generation: integer) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
||||||
const i18nKey = Moves[id].split('_').filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join('') as unknown as string;
|
|
||||||
|
|
||||||
this.name = id ? i18next.t(`move:${i18nKey}.name`).toString() : '';
|
|
||||||
this.nameAppend = '';
|
this.nameAppend = '';
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.category = category;
|
this.category = category;
|
||||||
|
@ -107,7 +104,6 @@ export default class Move implements Localizable {
|
||||||
this.power = power;
|
this.power = power;
|
||||||
this.accuracy = accuracy;
|
this.accuracy = accuracy;
|
||||||
this.pp = pp;
|
this.pp = pp;
|
||||||
this.effect = id ? i18next.t(`move:${i18nKey}.effect`).toString() : '';
|
|
||||||
this.chance = chance;
|
this.chance = chance;
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
this.generation = generation;
|
this.generation = generation;
|
||||||
|
@ -120,9 +116,11 @@ export default class Move implements Localizable {
|
||||||
this.setFlag(MoveFlags.IGNORE_PROTECT, true);
|
this.setFlag(MoveFlags.IGNORE_PROTECT, true);
|
||||||
if (category === MoveCategory.PHYSICAL)
|
if (category === MoveCategory.PHYSICAL)
|
||||||
this.setFlag(MoveFlags.MAKES_CONTACT, true);
|
this.setFlag(MoveFlags.MAKES_CONTACT, true);
|
||||||
|
|
||||||
|
this.localize();
|
||||||
}
|
}
|
||||||
|
|
||||||
localize() {
|
localize(): void {
|
||||||
const i18nKey = Moves[this.id].split('_').filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join('') as unknown as string;
|
const i18nKey = Moves[this.id].split('_').filter(f => f).map((f, i) => i ? `${f[0]}${f.slice(1).toLowerCase()}` : f.toLowerCase()).join('') as unknown as string;
|
||||||
|
|
||||||
this.name = this.id ? `${i18next.t(`move:${i18nKey}.name`).toString()}${this.nameAppend}` : '';
|
this.name = this.id ? `${i18next.t(`move:${i18nKey}.name`).toString()}${this.nameAppend}` : '';
|
||||||
|
@ -847,8 +845,12 @@ export class HitHealAttr extends MoveEffectAttr {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
const healAmount = Math.max(Math.floor(user.turnData.damageDealt * this.healRatio), 1);
|
||||||
|
const reverseDrain = user.hasAbilityWithAttr(ReverseDrainAbAttr);
|
||||||
user.scene.unshiftPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
|
user.scene.unshiftPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
|
||||||
Math.max(Math.floor(user.turnData.damageDealt * this.healRatio), 1), getPokemonMessage(target, ` had its\nenergy drained!`), false, true));
|
!reverseDrain ? healAmount : healAmount * -1,
|
||||||
|
!reverseDrain ? getPokemonMessage(target, ` had its\nenergy drained!`) : undefined,
|
||||||
|
false, true));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -863,9 +865,12 @@ export class StrengthSapHealAttr extends MoveEffectAttr {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
|
const healAmount = target.stats[Stat.ATK] * (Math.max(2, 2 + target.summonData.battleStats[BattleStat.ATK]) / Math.max(2, 2 - target.summonData.battleStats[BattleStat.ATK]));
|
||||||
|
const reverseDrain = user.hasAbilityWithAttr(ReverseDrainAbAttr);
|
||||||
user.scene.unshiftPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
|
user.scene.unshiftPhase(new PokemonHealPhase(user.scene, user.getBattlerIndex(),
|
||||||
target.stats[Stat.ATK] * (Math.max(2, 2 + target.summonData.battleStats[BattleStat.ATK]) / Math.max(2, 2 - target.summonData.battleStats[BattleStat.ATK])),
|
!reverseDrain ? healAmount : healAmount * -1,
|
||||||
getPokemonMessage(user, ` regained\nhealth!`), false, true));
|
!reverseDrain ? getPokemonMessage(user, ` regained\nhealth!`) : undefined,
|
||||||
|
false, true));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2562,6 +2567,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
||||||
return -5;
|
return -5;
|
||||||
case BattlerTagType.SEEDED:
|
case BattlerTagType.SEEDED:
|
||||||
case BattlerTagType.SALT_CURED:
|
case BattlerTagType.SALT_CURED:
|
||||||
|
case BattlerTagType.CURSED:
|
||||||
case BattlerTagType.FRENZY:
|
case BattlerTagType.FRENZY:
|
||||||
case BattlerTagType.TRAPPED:
|
case BattlerTagType.TRAPPED:
|
||||||
case BattlerTagType.BIND:
|
case BattlerTagType.BIND:
|
||||||
|
@ -2596,6 +2602,34 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class CurseAttr extends MoveEffectAttr {
|
||||||
|
|
||||||
|
apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean {
|
||||||
|
// Determine the correct target based on the user's type
|
||||||
|
if (!user.getTypes(true).includes(Type.GHOST)) {
|
||||||
|
// For non-Ghost types, target the user itself
|
||||||
|
target = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.getTypes(true).includes(Type.GHOST)) {
|
||||||
|
if (target.getTag(BattlerTagType.CURSED)) {
|
||||||
|
user.scene.queueMessage('But it failed!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let curseRecoilDamage = Math.floor(user.getMaxHp() / 2);
|
||||||
|
user.damageAndUpdate(curseRecoilDamage, HitResult.OTHER, false, true, true);
|
||||||
|
user.scene.queueMessage(getPokemonMessage(user, ' cut its own HP!'));
|
||||||
|
target.addTag(BattlerTagType.CURSED, 0, move.id, user.id);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
target = user;
|
||||||
|
user.scene.unshiftPhase(new StatChangePhase(user.scene, user.getBattlerIndex(), this.selfTarget, [BattleStat.ATK, BattleStat.DEF], 1));
|
||||||
|
user.scene.unshiftPhase(new StatChangePhase(user.scene, user.getBattlerIndex(), this.selfTarget, [BattleStat.SPD], -1));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class LapseBattlerTagAttr extends MoveEffectAttr {
|
export class LapseBattlerTagAttr extends MoveEffectAttr {
|
||||||
public tagTypes: BattlerTagType[];
|
public tagTypes: BattlerTagType[];
|
||||||
|
|
||||||
|
@ -5604,7 +5638,7 @@ export function initMoves() {
|
||||||
.bitingMove()
|
.bitingMove()
|
||||||
.attr(RemoveScreensAttr),
|
.attr(RemoveScreensAttr),
|
||||||
new AttackMove(Moves.STOMPING_TANTRUM, Type.GROUND, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 7)
|
new AttackMove(Moves.STOMPING_TANTRUM, Type.GROUND, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 7)
|
||||||
.partial(),
|
.attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result == MoveResult.MISS || user.getLastXMoves(2)[1]?.result == MoveResult.FAIL ? 2 : 1),
|
||||||
new AttackMove(Moves.SHADOW_BONE, Type.GHOST, MoveCategory.PHYSICAL, 85, 100, 10, 20, 0, 7)
|
new AttackMove(Moves.SHADOW_BONE, Type.GHOST, MoveCategory.PHYSICAL, 85, 100, 10, 20, 0, 7)
|
||||||
.attr(StatChangeAttr, BattleStat.DEF, -1)
|
.attr(StatChangeAttr, BattleStat.DEF, -1)
|
||||||
.makesContact(false),
|
.makesContact(false),
|
||||||
|
@ -5721,8 +5755,8 @@ export function initMoves() {
|
||||||
.attr(StatChangeAttr, BattleStat.SPD, -1)
|
.attr(StatChangeAttr, BattleStat.SPD, -1)
|
||||||
.partial(),
|
.partial(),
|
||||||
new StatusMove(Moves.MAGIC_POWDER, Type.PSYCHIC, 100, 20, -1, 0, 8)
|
new StatusMove(Moves.MAGIC_POWDER, Type.PSYCHIC, 100, 20, -1, 0, 8)
|
||||||
.powderMove()
|
.attr(ChangeTypeAttr, Type.PSYCHIC)
|
||||||
.unimplemented(),
|
.powderMove(),
|
||||||
new AttackMove(Moves.DRAGON_DARTS, Type.DRAGON, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 8)
|
new AttackMove(Moves.DRAGON_DARTS, Type.DRAGON, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 8)
|
||||||
.attr(MultiHitAttr, MultiHitType._2)
|
.attr(MultiHitAttr, MultiHitType._2)
|
||||||
.makesContact(false)
|
.makesContact(false)
|
||||||
|
@ -6206,7 +6240,7 @@ export function initMoves() {
|
||||||
.slicingMove(),
|
.slicingMove(),
|
||||||
new AttackMove(Moves.HYDRO_STEAM, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 9)
|
new AttackMove(Moves.HYDRO_STEAM, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 9)
|
||||||
.partial(),
|
.partial(),
|
||||||
new AttackMove(Moves.RUINATION, Type.DARK, MoveCategory.SPECIAL, 1, 90, 10, -1, 0, 9)
|
new AttackMove(Moves.RUINATION, Type.DARK, MoveCategory.SPECIAL, -1, 90, 10, -1, 0, 9)
|
||||||
.attr(TargetHalfHpDamageAttr),
|
.attr(TargetHalfHpDamageAttr),
|
||||||
new AttackMove(Moves.COLLISION_COURSE, Type.FIGHTING, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 9)
|
new AttackMove(Moves.COLLISION_COURSE, Type.FIGHTING, MoveCategory.PHYSICAL, 100, 100, 5, -1, 0, 9)
|
||||||
.attr(MovePowerMultiplierAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) >= 2 ? 5461/4096 : 1),
|
.attr(MovePowerMultiplierAttr, (user, target, move) => target.getAttackTypeEffectiveness(move.type) >= 2 ? 5461/4096 : 1),
|
||||||
|
@ -6328,7 +6362,7 @@ export function initMoves() {
|
||||||
new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9)
|
new AttackMove(Moves.ALLURING_VOICE, Type.FAIRY, MoveCategory.SPECIAL, 80, 100, 10, -1, 0, 9)
|
||||||
.partial(),
|
.partial(),
|
||||||
new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9)
|
new AttackMove(Moves.TEMPER_FLARE, Type.FIRE, MoveCategory.PHYSICAL, 75, 100, 10, -1, 0, 9)
|
||||||
.partial(),
|
.attr(MovePowerMultiplierAttr, (user, target, move) => user.getLastXMoves(2)[1]?.result == MoveResult.MISS || user.getLastXMoves(2)[1]?.result == MoveResult.FAIL ? 2 : 1),
|
||||||
new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9)
|
new AttackMove(Moves.SUPERCELL_SLAM, Type.ELECTRIC, MoveCategory.PHYSICAL, 100, 95, 15, -1, 0, 9)
|
||||||
.attr(MissEffectAttr, crashDamageFunc)
|
.attr(MissEffectAttr, crashDamageFunc)
|
||||||
.attr(NoEffectAttr, crashDamageFunc),
|
.attr(NoEffectAttr, crashDamageFunc),
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import BattleScene from "../battle-scene";
|
import BattleScene from "../battle-scene";
|
||||||
|
import i18next from '../plugins/i18n';
|
||||||
|
|
||||||
export enum PokeballType {
|
export enum PokeballType {
|
||||||
POKEBALL,
|
POKEBALL,
|
||||||
|
@ -30,22 +31,22 @@ export function getPokeballName(type: PokeballType): string {
|
||||||
let ret: string;
|
let ret: string;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case PokeballType.POKEBALL:
|
case PokeballType.POKEBALL:
|
||||||
ret = 'Poké Ball';
|
ret = i18next.t('pokeball:pokeBall');
|
||||||
break;
|
break;
|
||||||
case PokeballType.GREAT_BALL:
|
case PokeballType.GREAT_BALL:
|
||||||
ret = 'Great Ball';
|
ret = i18next.t('pokeball:greatBall');
|
||||||
break;
|
break;
|
||||||
case PokeballType.ULTRA_BALL:
|
case PokeballType.ULTRA_BALL:
|
||||||
ret = 'Ultra Ball';
|
ret = i18next.t('pokeball:ultraBall');
|
||||||
break;
|
break;
|
||||||
case PokeballType.ROGUE_BALL:
|
case PokeballType.ROGUE_BALL:
|
||||||
ret = 'Rogue Ball';
|
ret = i18next.t('pokeball:rogueBall');
|
||||||
break;
|
break;
|
||||||
case PokeballType.MASTER_BALL:
|
case PokeballType.MASTER_BALL:
|
||||||
ret = 'Master Ball';
|
ret = i18next.t('pokeball:masterBall');
|
||||||
break;
|
break;
|
||||||
case PokeballType.LUXURY_BALL:
|
case PokeballType.LUXURY_BALL:
|
||||||
ret = 'Luxury Ball';
|
ret = i18next.t('pokeball:luxuryBall');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -917,7 +917,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
|
||||||
new SpeciesEvolution(Species.TRUMBEAK, 14, null, null)
|
new SpeciesEvolution(Species.TRUMBEAK, 14, null, null)
|
||||||
],
|
],
|
||||||
[Species.TRUMBEAK]: [
|
[Species.TRUMBEAK]: [
|
||||||
new SpeciesEvolution(Species.TOUCANNON, 36, null, null)
|
new SpeciesEvolution(Species.TOUCANNON, 28, null, null)
|
||||||
],
|
],
|
||||||
[Species.YUNGOOS]: [
|
[Species.YUNGOOS]: [
|
||||||
new SpeciesEvolution(Species.GUMSHOOS, 20, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DAY), SpeciesWildEvolutionDelay.SHORT)
|
new SpeciesEvolution(Species.GUMSHOOS, 20, null, new SpeciesEvolutionCondition(p => p.scene.arena.getTimeOfDay() === TimeOfDay.DAY), SpeciesWildEvolutionDelay.SHORT)
|
||||||
|
|
|
@ -82,7 +82,11 @@ export class EggHatchPhase extends Phase {
|
||||||
this.eggContainer.add(this.eggLightraysOverlay);
|
this.eggContainer.add(this.eggLightraysOverlay);
|
||||||
this.eggHatchContainer.add(this.eggContainer);
|
this.eggHatchContainer.add(this.eggContainer);
|
||||||
|
|
||||||
const getPokemonSprite = () => this.scene.add.sprite(this.eggHatchBg.displayWidth / 2, this.eggHatchBg.displayHeight / 2, `pkmn__sub`);
|
const getPokemonSprite = () => {
|
||||||
|
const ret = this.scene.add.sprite(this.eggHatchBg.displayWidth / 2, this.eggHatchBg.displayHeight / 2, `pkmn__sub`);
|
||||||
|
ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], ignoreTimeTint: true });
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
this.eggHatchContainer.add((this.pokemonSprite = getPokemonSprite()));
|
this.eggHatchContainer.add((this.pokemonSprite = getPokemonSprite()));
|
||||||
|
|
||||||
|
@ -245,7 +249,7 @@ export class EggHatchPhase extends Phase {
|
||||||
this.scene.validateAchv(achvs.HATCH_SHINY);
|
this.scene.validateAchv(achvs.HATCH_SHINY);
|
||||||
this.eggContainer.setVisible(false);
|
this.eggContainer.setVisible(false);
|
||||||
this.pokemonSprite.play(this.pokemon.getSpriteKey(true));
|
this.pokemonSprite.play(this.pokemon.getSpriteKey(true));
|
||||||
this.pokemonSprite.pipelineData['ignoreTimeTint'] = true;
|
this.pokemonSprite.setPipelineData('ignoreTimeTint', true);
|
||||||
this.pokemonSprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey());
|
this.pokemonSprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey());
|
||||||
this.pokemonSprite.setPipelineData('shiny', this.pokemon.shiny);
|
this.pokemonSprite.setPipelineData('shiny', this.pokemon.shiny);
|
||||||
this.pokemonSprite.setPipelineData('variant', this.pokemon.variant);
|
this.pokemonSprite.setPipelineData('variant', this.pokemon.variant);
|
||||||
|
|
|
@ -71,7 +71,11 @@ export class EvolutionPhase extends Phase {
|
||||||
this.evolutionBgOverlay.setAlpha(0);
|
this.evolutionBgOverlay.setAlpha(0);
|
||||||
this.evolutionContainer.add(this.evolutionBgOverlay);
|
this.evolutionContainer.add(this.evolutionBgOverlay);
|
||||||
|
|
||||||
const getPokemonSprite = () => this.scene.addPokemonSprite(this.pokemon, this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`);
|
const getPokemonSprite = () => {
|
||||||
|
const ret = this.scene.addPokemonSprite(this.pokemon, this.evolutionBaseBg.displayWidth / 2, this.evolutionBaseBg.displayHeight / 2, `pkmn__sub`);
|
||||||
|
ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], ignoreTimeTint: true });
|
||||||
|
return ret;
|
||||||
|
};
|
||||||
|
|
||||||
this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite()));
|
this.evolutionContainer.add((this.pokemonSprite = getPokemonSprite()));
|
||||||
this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite()));
|
this.evolutionContainer.add((this.pokemonTintSprite = getPokemonSprite()));
|
||||||
|
@ -92,7 +96,10 @@ export class EvolutionPhase extends Phase {
|
||||||
[ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
|
[ this.pokemonSprite, this.pokemonTintSprite, this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
|
||||||
sprite.play(this.pokemon.getSpriteKey(true));
|
sprite.play(this.pokemon.getSpriteKey(true));
|
||||||
sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false, teraColor: getTypeRgb(this.pokemon.getTeraType()) });
|
sprite.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: false, teraColor: getTypeRgb(this.pokemon.getTeraType()) });
|
||||||
sprite.pipelineData['ignoreTimeTint'] = true;
|
sprite.setPipelineData('ignoreTimeTint', true);
|
||||||
|
sprite.setPipelineData('spriteKey', this.pokemon.getSpriteKey());
|
||||||
|
sprite.setPipelineData('shiny', this.pokemon.shiny);
|
||||||
|
sprite.setPipelineData('variant', this.pokemon.variant);
|
||||||
[ 'spriteColors', 'fusionSpriteColors' ].map(k => {
|
[ 'spriteColors', 'fusionSpriteColors' ].map(k => {
|
||||||
if (this.pokemon.summonData?.speciesForm)
|
if (this.pokemon.summonData?.speciesForm)
|
||||||
k += 'Base';
|
k += 'Base';
|
||||||
|
|
|
@ -986,11 +986,8 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||||
|
|
||||||
let shinyThreshold = new Utils.IntegerHolder(32);
|
let shinyThreshold = new Utils.IntegerHolder(32);
|
||||||
if (thresholdOverride === undefined) {
|
if (thresholdOverride === undefined) {
|
||||||
if (!this.hasTrainer()) {
|
if (!this.hasTrainer())
|
||||||
if (new Date() < new Date('4/22/2024'))
|
|
||||||
shinyThreshold.value *= 3;
|
|
||||||
this.scene.applyModifiers(ShinyRateBoosterModifier, true, shinyThreshold);
|
this.scene.applyModifiers(ShinyRateBoosterModifier, true, shinyThreshold);
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
shinyThreshold.value = thresholdOverride;
|
shinyThreshold.value = thresholdOverride;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The menu namespace holds most miscellaneous text that isn't directly part of the game's
|
* The menu namespace holds most miscellaneous text that isn't directly part of the game's
|
||||||
* contents or directly related to Pokemon data. This includes menu navigation, settings,
|
* contents or directly related to Pokemon data. This includes menu navigation, settings,
|
||||||
* account interactions, descriptive text, etc.
|
* account interactions, descriptive text, etc.
|
||||||
*/
|
*/
|
||||||
export const menu = {
|
export const menu: SimpleTranslationEntries = {
|
||||||
"cancel": "Cancel",
|
"cancel": "Cancel",
|
||||||
"continue": "Continue",
|
"continue": "Continue",
|
||||||
"dailyRun": "Daily Run (Beta)",
|
"dailyRun": "Daily Run (Beta)",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { MoveTranslations } from "#app/plugins/i18n";
|
import { MoveTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
export const move: MoveTranslations = {
|
export const move: MoveTranslationEntries = {
|
||||||
"pound": {
|
"pound": {
|
||||||
name: "Pound",
|
name: "Pound",
|
||||||
effect: "The target is physically pounded with a long tail, a foreleg, or the like."
|
effect: "The target is physically pounded with a long tail, a foreleg, or the like."
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const pokeball: SimpleTranslationEntries = {
|
||||||
|
"pokeBall": "Poké Ball",
|
||||||
|
"greatBall": "Great Ball",
|
||||||
|
"ultraBall": "Ultra Ball",
|
||||||
|
"rogueBall": "Rogue Ball",
|
||||||
|
"masterBall": "Master Ball",
|
||||||
|
"luxuryBall": "Luxury Ball",
|
||||||
|
} as const;
|
|
@ -1,4 +1,6 @@
|
||||||
export const menu = {
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const menu: SimpleTranslationEntries = {
|
||||||
"cancel": "Annuler",
|
"cancel": "Annuler",
|
||||||
"continue": "Continuer",
|
"continue": "Continuer",
|
||||||
"dailyRun": "Défi du jour (Bêta)",
|
"dailyRun": "Défi du jour (Bêta)",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { MoveTranslations } from "#app/plugins/i18n";
|
import { MoveTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
export const move: MoveTranslations = {
|
export const move: MoveTranslationEntries = {
|
||||||
"pound": {
|
"pound": {
|
||||||
name: "Écras'Face",
|
name: "Écras'Face",
|
||||||
effect: "Le lanceur écrase la cible avec l’un de ses membres, tels qu’une de ses pattes avant ou sa longue queue."
|
effect: "Le lanceur écrase la cible avec l’un de ses membres, tels qu’une de ses pattes avant ou sa longue queue."
|
||||||
|
@ -1443,7 +1443,7 @@ export const move: MoveTranslations = {
|
||||||
},
|
},
|
||||||
"healingWish": {
|
"healingWish": {
|
||||||
name: "Voeu Soin",
|
name: "Voeu Soin",
|
||||||
effect: "Un soin qui permet au lanceur de récupérer jusqu’à la moitié de ses PV max."
|
effect: "Le lanceur tombe K.O. pour soigner les altérations de statut et les PV du Pokémon qui viendra le remplacer sur le terrain."
|
||||||
},
|
},
|
||||||
"brine": {
|
"brine": {
|
||||||
name: "Saumure",
|
name: "Saumure",
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const pokeball: SimpleTranslationEntries = {
|
||||||
|
"pokeBall": "Poké Ball",
|
||||||
|
"greatBall": "Super Ball",
|
||||||
|
"ultraBall": "Hyper Ball",
|
||||||
|
"rogueBall": "Rogue Ball",
|
||||||
|
"masterBall": "Master Ball",
|
||||||
|
"luxuryBall": "Luxe Ball",
|
||||||
|
} as const;
|
|
@ -1,4 +1,6 @@
|
||||||
export const menu = {
|
import { SimpleTranslationEntries } from "#app/plugins/i18n";
|
||||||
|
|
||||||
|
export const menu: SimpleTranslationEntries = {
|
||||||
"cancel": "Annulla",
|
"cancel": "Annulla",
|
||||||
"continue": "Continua",
|
"continue": "Continua",
|
||||||
"newGame": "Nuova Partita",
|
"newGame": "Nuova Partita",
|
||||||
|
|
|
@ -19,6 +19,7 @@ import { VoucherType, getVoucherTypeIcon, getVoucherTypeName } from '../system/v
|
||||||
import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms';
|
import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms';
|
||||||
import { ModifierTier } from './modifier-tier';
|
import { ModifierTier } from './modifier-tier';
|
||||||
import { Nature, getNatureName, getNatureStatMultiplier } from '#app/data/nature';
|
import { Nature, getNatureName, getNatureStatMultiplier } from '#app/data/nature';
|
||||||
|
import { Localizable } from '#app/plugins/i18n';
|
||||||
|
|
||||||
const outputModifierData = false;
|
const outputModifierData = false;
|
||||||
const useMaxWeightForOutput = false;
|
const useMaxWeightForOutput = false;
|
||||||
|
@ -131,10 +132,19 @@ export interface GeneratedPersistentModifierType {
|
||||||
getPregenArgs(): any[];
|
getPregenArgs(): any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
class AddPokeballModifierType extends ModifierType {
|
class AddPokeballModifierType extends ModifierType implements Localizable {
|
||||||
|
private pokeballType: PokeballType;
|
||||||
|
private count: integer;
|
||||||
|
|
||||||
constructor(pokeballType: PokeballType, count: integer, iconImage?: string) {
|
constructor(pokeballType: PokeballType, count: integer, iconImage?: string) {
|
||||||
super(`${count}x ${getPokeballName(pokeballType)}`, `Receive ${getPokeballName(pokeballType)} x${count}\nCatch Rate: ${getPokeballCatchMultiplier(pokeballType) > -1 ? `${getPokeballCatchMultiplier(pokeballType)}x` : 'Certain'}`,
|
super('', '', (_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), iconImage, 'pb', 'pb_bounce_1');
|
||||||
(_type, _args) => new Modifiers.AddPokeballModifier(this, pokeballType, count), iconImage, 'pb', 'pb_bounce_1');
|
this.pokeballType = pokeballType;
|
||||||
|
this.count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
localize(): void {
|
||||||
|
this.name = `${this.count}x ${getPokeballName(this.pokeballType)}`;
|
||||||
|
this.description = `Receive ${getPokeballName(this.pokeballType)} x${this.count}\nCatch Rate: ${getPokeballCatchMultiplier(this.pokeballType) > -1 ? `${getPokeballCatchMultiplier(this.pokeballType)}x` : 'Certain'}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1578,9 +1578,7 @@ export class MoneyRewardModifier extends ConsumableModifier {
|
||||||
|
|
||||||
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
||||||
|
|
||||||
scene.money += moneyAmount.value;
|
scene.addMoney(moneyAmount.value);
|
||||||
scene.updateMoneyText();
|
|
||||||
scene.validateAchvs(MoneyAchv);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1627,9 +1625,7 @@ export class DamageMoneyRewardModifier extends PokemonHeldItemModifier {
|
||||||
const scene = (args[0] as Pokemon).scene;
|
const scene = (args[0] as Pokemon).scene;
|
||||||
const moneyAmount = new Utils.IntegerHolder(Math.floor((args[1] as Utils.IntegerHolder).value * (0.5 * this.getStackCount())));
|
const moneyAmount = new Utils.IntegerHolder(Math.floor((args[1] as Utils.IntegerHolder).value * (0.5 * this.getStackCount())));
|
||||||
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
||||||
scene.money += moneyAmount.value;
|
scene.addMoney(moneyAmount.value);
|
||||||
scene.updateMoneyText();
|
|
||||||
scene.validateAchvs(MoneyAchv);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1651,9 +1647,7 @@ export class MoneyInterestModifier extends PersistentModifier {
|
||||||
apply(args: any[]): boolean {
|
apply(args: any[]): boolean {
|
||||||
const scene = args[0] as BattleScene;
|
const scene = args[0] as BattleScene;
|
||||||
const interestAmount = Math.floor(scene.money * 0.1 * this.getStackCount());
|
const interestAmount = Math.floor(scene.money * 0.1 * this.getStackCount());
|
||||||
scene.money += interestAmount;
|
scene.addMoney(interestAmount);
|
||||||
scene.updateMoneyText();
|
|
||||||
scene.validateAchvs(MoneyAchv);
|
|
||||||
|
|
||||||
scene.queueMessage(`You received interest of ₽${interestAmount.toLocaleString('en-US')}\nfrom the ${this.type.name}!`, null, true);
|
scene.queueMessage(`You received interest of ₽${interestAmount.toLocaleString('en-US')}\nfrom the ${this.type.name}!`, null, true);
|
||||||
|
|
||||||
|
|
|
@ -379,6 +379,33 @@ export class UnavailablePhase extends Phase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class ReloadSessionPhase extends Phase {
|
||||||
|
constructor(scene: BattleScene) {
|
||||||
|
super(scene);
|
||||||
|
}
|
||||||
|
|
||||||
|
start(): void {
|
||||||
|
this.scene.ui.setMode(Mode.SESSION_RELOAD);
|
||||||
|
|
||||||
|
let delayElapsed = false;
|
||||||
|
let loaded = false;
|
||||||
|
|
||||||
|
this.scene.time.delayedCall(Utils.fixedInt(1500), () => {
|
||||||
|
if (loaded)
|
||||||
|
this.end();
|
||||||
|
else
|
||||||
|
delayElapsed = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.scene.gameData.loadSystem().then(() => {
|
||||||
|
if (delayElapsed)
|
||||||
|
this.end();
|
||||||
|
else
|
||||||
|
loaded = true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class OutdatedPhase extends Phase {
|
export class OutdatedPhase extends Phase {
|
||||||
constructor(scene: BattleScene) {
|
constructor(scene: BattleScene) {
|
||||||
super(scene);
|
super(scene);
|
||||||
|
@ -767,7 +794,8 @@ export class EncounterPhase extends BattlePhase {
|
||||||
pokemon.resetBattleData();
|
pokemon.resetBattleData();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.scene.arena.trySetWeather(getRandomWeatherType(this.scene.arena), false);
|
if (!this.loaded)
|
||||||
|
this.scene.arena.trySetWeather(getRandomWeatherType(this.scene.arena), false);
|
||||||
|
|
||||||
const enemyField = this.scene.getEnemyField();
|
const enemyField = this.scene.getEnemyField();
|
||||||
this.scene.tweens.add({
|
this.scene.tweens.add({
|
||||||
|
@ -2267,6 +2295,7 @@ export class MovePhase extends BattlePhase {
|
||||||
this.cancelled = activated;
|
this.cancelled = activated;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activated) {
|
if (activated) {
|
||||||
this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect)));
|
this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect)));
|
||||||
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1)));
|
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1)));
|
||||||
|
@ -2289,6 +2318,7 @@ export class MovePhase extends BattlePhase {
|
||||||
|
|
||||||
showMoveText(): void {
|
showMoveText(): void {
|
||||||
if (this.move.getMove().getAttrs(ChargeAttr).length) {
|
if (this.move.getMove().getAttrs(ChargeAttr).length) {
|
||||||
|
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);
|
||||||
const lastMove = this.pokemon.getLastXMoves() as TurnMove[];
|
const lastMove = this.pokemon.getLastXMoves() as TurnMove[];
|
||||||
if (!lastMove.length || lastMove[0].move !== this.move.getMove().id || lastMove[0].result !== MoveResult.OTHER)
|
if (!lastMove.length || lastMove[0].move !== this.move.getMove().id || lastMove[0].result !== MoveResult.OTHER)
|
||||||
return;
|
return;
|
||||||
|
@ -3284,10 +3314,7 @@ export class MoneyRewardPhase extends BattlePhase {
|
||||||
|
|
||||||
this.scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
this.scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
|
||||||
|
|
||||||
this.scene.money += moneyAmount.value;
|
this.scene.addMoney(moneyAmount.value);
|
||||||
this.scene.updateMoneyText();
|
|
||||||
|
|
||||||
this.scene.validateAchvs(MoneyAchv);
|
|
||||||
|
|
||||||
this.scene.ui.showText(`You got ₽${moneyAmount.value.toLocaleString('en-US')}\nfor winning!`, null, () => this.end(), null, true);
|
this.scene.ui.showText(`You got ₽${moneyAmount.value.toLocaleString('en-US')}\nfor winning!`, null, () => this.end(), null, true);
|
||||||
}
|
}
|
||||||
|
@ -3392,6 +3419,8 @@ export class GameOverPhase extends BattlePhase {
|
||||||
|
|
||||||
handleClearSession(): void {
|
handleClearSession(): void {
|
||||||
this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId).then((success: boolean | [boolean, boolean]) => {
|
this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId).then((success: boolean | [boolean, boolean]) => {
|
||||||
|
if (!success[0])
|
||||||
|
return this.scene.reset(true);
|
||||||
this.scene.time.delayedCall(1000, () => {
|
this.scene.time.delayedCall(1000, () => {
|
||||||
let firstClear = false;
|
let firstClear = false;
|
||||||
if (this.victory && success[1]) {
|
if (this.victory && success[1]) {
|
||||||
|
@ -3767,11 +3796,15 @@ export class PokemonHealPhase extends CommonAnimPhase {
|
||||||
const hasMessage = !!this.message;
|
const hasMessage = !!this.message;
|
||||||
let lastStatusEffect = StatusEffect.NONE;
|
let lastStatusEffect = StatusEffect.NONE;
|
||||||
|
|
||||||
if (!fullHp) {
|
if (!fullHp || this.hpHealed < 0) {
|
||||||
const hpRestoreMultiplier = new Utils.IntegerHolder(1);
|
const hpRestoreMultiplier = new Utils.IntegerHolder(1);
|
||||||
if (!this.revive)
|
if (!this.revive)
|
||||||
this.scene.applyModifiers(HealingBoosterModifier, this.player, hpRestoreMultiplier);
|
this.scene.applyModifiers(HealingBoosterModifier, this.player, hpRestoreMultiplier);
|
||||||
const healAmount = new Utils.NumberHolder(Math.floor(this.hpHealed * hpRestoreMultiplier.value));
|
const healAmount = new Utils.NumberHolder(Math.floor(this.hpHealed * hpRestoreMultiplier.value));
|
||||||
|
if (healAmount.value < 0) {
|
||||||
|
pokemon.damageAndUpdate(healAmount.value * -1, HitResult.HEAL);
|
||||||
|
healAmount.value = 0;
|
||||||
|
}
|
||||||
// Prevent healing to full if specified (in case of healing tokens so Sturdy doesn't cause a softlock)
|
// Prevent healing to full if specified (in case of healing tokens so Sturdy doesn't cause a softlock)
|
||||||
if (this.preventFullHeal && pokemon.hp + healAmount.value >= pokemon.getMaxHp())
|
if (this.preventFullHeal && pokemon.hp + healAmount.value >= pokemon.getMaxHp())
|
||||||
healAmount.value = (pokemon.getMaxHp() - pokemon.hp) - 1;
|
healAmount.value = (pokemon.getMaxHp() - pokemon.hp) - 1;
|
||||||
|
@ -4299,7 +4332,7 @@ export class EggLapsePhase extends Phase {
|
||||||
|
|
||||||
const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => {
|
const eggsToHatch: Egg[] = this.scene.gameData.eggs.filter((egg: Egg) => {
|
||||||
return --egg.hatchWaves < 1
|
return --egg.hatchWaves < 1
|
||||||
})
|
});
|
||||||
|
|
||||||
if (eggsToHatch.length) {
|
if (eggsToHatch.length) {
|
||||||
this.scene.queueMessage('Oh?');
|
this.scene.queueMessage('Oh?');
|
||||||
|
|
|
@ -6,12 +6,22 @@ import { menu as frMenu } from '../locales/fr/menu';
|
||||||
import { move as enMove } from '../locales/en/move';
|
import { move as enMove } from '../locales/en/move';
|
||||||
import { move as frMove } from '../locales/fr/move';
|
import { move as frMove } from '../locales/fr/move';
|
||||||
|
|
||||||
|
import { pokeball as enPokeball } from '../locales/en/pokeball';
|
||||||
|
import { pokeball as frPokeball } from '../locales/fr/pokeball';
|
||||||
|
|
||||||
|
import { pokemon as enPokemon } from '../locales/en/pokemon';
|
||||||
|
import { pokemon as frPokemon } from '../locales/fr/pokemon';
|
||||||
|
|
||||||
|
export interface SimpleTranslationEntries {
|
||||||
|
[key: string]: string
|
||||||
|
}
|
||||||
|
|
||||||
export interface MoveTranslationEntry {
|
export interface MoveTranslationEntry {
|
||||||
name: string,
|
name: string,
|
||||||
effect: string
|
effect: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MoveTranslations {
|
export interface MoveTranslationEntries {
|
||||||
[key: string]: MoveTranslationEntry
|
[key: string]: MoveTranslationEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +60,8 @@ export function initI18n(): void {
|
||||||
en: {
|
en: {
|
||||||
menu: enMenu,
|
menu: enMenu,
|
||||||
move: enMove,
|
move: enMove,
|
||||||
|
pokeball: enPokeball,
|
||||||
|
pokemon: enPokemon,
|
||||||
},
|
},
|
||||||
it: {
|
it: {
|
||||||
menu: itMenu,
|
menu: itMenu,
|
||||||
|
@ -57,6 +69,8 @@ export function initI18n(): void {
|
||||||
fr: {
|
fr: {
|
||||||
menu: frMenu,
|
menu: frMenu,
|
||||||
move: frMove,
|
move: frMove,
|
||||||
|
pokeball: frPokeball,
|
||||||
|
pokemon: frPokemon,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -68,6 +82,8 @@ declare module 'i18next' {
|
||||||
resources: {
|
resources: {
|
||||||
menu: typeof enMenu;
|
menu: typeof enMenu;
|
||||||
move: typeof enMove;
|
move: typeof enMove;
|
||||||
|
pokeball: typeof enPokeball;
|
||||||
|
pokemon: typeof enPokemon;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
|
import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
|
||||||
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
|
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../field/pokemon";
|
||||||
import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions";
|
import { pokemonEvolutions, pokemonPrevolutions } from "../data/pokemon-evolutions";
|
||||||
import PokemonSpecies, { SpeciesFormKey, allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
|
import PokemonSpecies, { allSpecies, getPokemonSpecies, noStarterFormKeys, speciesStarters } from "../data/pokemon-species";
|
||||||
import { Species, defaultStarterSpecies } from "../data/enums/species";
|
import { Species, defaultStarterSpecies } from "../data/enums/species";
|
||||||
import * as Utils from "../utils";
|
import * as Utils from "../utils";
|
||||||
import PokemonData from "./pokemon-data";
|
import PokemonData from "./pokemon-data";
|
||||||
|
@ -27,7 +27,7 @@ import { Moves } from "../data/enums/moves";
|
||||||
import { speciesEggMoves } from "../data/egg-moves";
|
import { speciesEggMoves } from "../data/egg-moves";
|
||||||
import { allMoves } from "../data/move";
|
import { allMoves } from "../data/move";
|
||||||
import { TrainerVariant } from "../field/trainer";
|
import { TrainerVariant } from "../field/trainer";
|
||||||
import { OutdatedPhase, UnavailablePhase } from "#app/phases";
|
import { OutdatedPhase, ReloadSessionPhase } from "#app/phases";
|
||||||
import { Variant, variantData } from "#app/data/variant";
|
import { Variant, variantData } from "#app/data/variant";
|
||||||
|
|
||||||
const saveKey = 'x0i2O7WRiANTqPmZ'; // Temporary; secure encryption is not yet necessary
|
const saveKey = 'x0i2O7WRiANTqPmZ'; // Temporary; secure encryption is not yet necessary
|
||||||
|
@ -280,6 +280,9 @@ export class GameData {
|
||||||
if (error.startsWith('client version out of date')) {
|
if (error.startsWith('client version out of date')) {
|
||||||
this.scene.clearPhaseQueue();
|
this.scene.clearPhaseQueue();
|
||||||
this.scene.unshiftPhase(new OutdatedPhase(this.scene));
|
this.scene.unshiftPhase(new OutdatedPhase(this.scene));
|
||||||
|
} else if (error.startsWith('session out of date')) {
|
||||||
|
this.scene.clearPhaseQueue();
|
||||||
|
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
|
||||||
}
|
}
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
|
@ -340,7 +343,7 @@ export class GameData {
|
||||||
this.starterData[s].eggMoves = starterEggMoveData[s];
|
this.starterData[s].eggMoves = starterEggMoveData[s];
|
||||||
}
|
}
|
||||||
|
|
||||||
this.migrateStarterAbilities(systemData);
|
this.migrateStarterAbilities(systemData, this.starterData);
|
||||||
} else {
|
} else {
|
||||||
if ([ '1.0.0', '1.0.1' ].includes(systemData.gameVersion))
|
if ([ '1.0.0', '1.0.1' ].includes(systemData.gameVersion))
|
||||||
this.migrateStarterAbilities(systemData);
|
this.migrateStarterAbilities(systemData);
|
||||||
|
@ -551,6 +554,10 @@ export class GameData {
|
||||||
.then(response => response.text())
|
.then(response => response.text())
|
||||||
.then(error => {
|
.then(error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
|
if (error.startsWith('session out of date')) {
|
||||||
|
this.scene.clearPhaseQueue();
|
||||||
|
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
|
||||||
|
}
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return resolve(false);
|
return resolve(false);
|
||||||
}
|
}
|
||||||
|
@ -715,9 +722,19 @@ export class GameData {
|
||||||
Utils.apiFetch(`savedata/delete?datatype=${GameDataType.SESSION}&slot=${slotId}`, true).then(response => {
|
Utils.apiFetch(`savedata/delete?datatype=${GameDataType.SESSION}&slot=${slotId}`, true).then(response => {
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
loggedInUser.lastSessionSlot = -1;
|
loggedInUser.lastSessionSlot = -1;
|
||||||
return resolve(true);
|
resolve(true);
|
||||||
}
|
}
|
||||||
resolve(false);
|
return response.text();
|
||||||
|
}).then(error => {
|
||||||
|
if (error) {
|
||||||
|
if (error.startsWith('session out of date')) {
|
||||||
|
this.scene.clearPhaseQueue();
|
||||||
|
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
|
||||||
|
}
|
||||||
|
console.error(error);
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
resolve(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -735,12 +752,19 @@ export class GameData {
|
||||||
return resolve([false, false]);
|
return resolve([false, false]);
|
||||||
const sessionData = this.getSessionSaveData(scene);
|
const sessionData = this.getSessionSaveData(scene);
|
||||||
Utils.apiPost(`savedata/clear?slot=${slotId}`, JSON.stringify(sessionData)).then(response => {
|
Utils.apiPost(`savedata/clear?slot=${slotId}`, JSON.stringify(sessionData)).then(response => {
|
||||||
if (response.ok) {
|
if (response.ok)
|
||||||
loggedInUser.lastSessionSlot = -1;
|
loggedInUser.lastSessionSlot = -1;
|
||||||
return response.json();
|
return response.json();
|
||||||
|
}).then(jsonResponse => {
|
||||||
|
if (!jsonResponse.error)
|
||||||
|
return resolve([true, jsonResponse.success as boolean]);
|
||||||
|
if (jsonResponse && jsonResponse.error.startsWith('session out of date')) {
|
||||||
|
this.scene.clearPhaseQueue();
|
||||||
|
this.scene.unshiftPhase(new ReloadSessionPhase(this.scene));
|
||||||
}
|
}
|
||||||
|
console.error(jsonResponse);
|
||||||
resolve([false, false]);
|
resolve([false, false]);
|
||||||
}).then(jsonResponse => resolve([true, jsonResponse.success as boolean]));
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1207,9 +1231,9 @@ export class GameData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
migrateStarterAbilities(systemData: SystemSaveData): void {
|
migrateStarterAbilities(systemData: SystemSaveData, initialStarterData?: StarterData): void {
|
||||||
const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species);
|
const starterIds = Object.keys(this.starterData).map(s => parseInt(s) as Species);
|
||||||
const starterData = systemData.starterData;
|
const starterData = initialStarterData || systemData.starterData;
|
||||||
const dexData = systemData.dexData;
|
const dexData = systemData.dexData;
|
||||||
for (let s of starterIds) {
|
for (let s of starterIds) {
|
||||||
const dexAttr = dexData[s].caughtAttr;
|
const dexAttr = dexData[s].caughtAttr;
|
||||||
|
|
|
@ -336,10 +336,14 @@ export default class MenuUiHandler extends MessageUiHandler {
|
||||||
case Button.UP:
|
case Button.UP:
|
||||||
if (this.cursor)
|
if (this.cursor)
|
||||||
success = this.setCursor(this.cursor - 1);
|
success = this.setCursor(this.cursor - 1);
|
||||||
|
else
|
||||||
|
success = this.setCursor(this.menuOptions.length - 1);
|
||||||
break;
|
break;
|
||||||
case Button.DOWN:
|
case Button.DOWN:
|
||||||
if (this.cursor + 1 < this.menuOptions.length)
|
if (this.cursor + 1 < this.menuOptions.length)
|
||||||
success = this.setCursor(this.cursor + 1);
|
success = this.setCursor(this.cursor + 1);
|
||||||
|
else
|
||||||
|
success = this.setCursor(0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
import BattleScene from "../battle-scene";
|
||||||
|
import { ModalConfig, ModalUiHandler } from "./modal-ui-handler";
|
||||||
|
import { addTextObject, TextStyle } from "./text";
|
||||||
|
import { Mode } from "./ui";
|
||||||
|
|
||||||
|
export default class SessionReloadModalUiHandler extends ModalUiHandler {
|
||||||
|
constructor(scene: BattleScene, mode?: Mode) {
|
||||||
|
super(scene, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
getModalTitle(): string {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
getWidth(): number {
|
||||||
|
return 160;
|
||||||
|
}
|
||||||
|
|
||||||
|
getHeight(): number {
|
||||||
|
return 32;
|
||||||
|
}
|
||||||
|
|
||||||
|
getMargin(): [number, number, number, number] {
|
||||||
|
return [ 0, 0, 48, 0 ];
|
||||||
|
}
|
||||||
|
|
||||||
|
getButtonLabels(): string[] {
|
||||||
|
return [ ];
|
||||||
|
}
|
||||||
|
|
||||||
|
setup(): void {
|
||||||
|
super.setup();
|
||||||
|
|
||||||
|
const label = addTextObject(this.scene, this.getWidth() / 2, this.getHeight() / 2, 'Your session is out of date.\nYour data will be reloaded…', TextStyle.WINDOW, { fontSize: '48px', align: 'center' });
|
||||||
|
label.setOrigin(0.5, 0.5);
|
||||||
|
|
||||||
|
this.modalContainer.add(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
show(args: any[]): boolean {
|
||||||
|
const config: ModalConfig = {
|
||||||
|
buttonActions: []
|
||||||
|
};
|
||||||
|
|
||||||
|
return super.show([ config ]);
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,6 +34,7 @@ import TitleUiHandler from './title-ui-handler';
|
||||||
import SavingIconHandler from './saving-icon-handler';
|
import SavingIconHandler from './saving-icon-handler';
|
||||||
import UnavailableModalUiHandler from './unavailable-modal-ui-handler';
|
import UnavailableModalUiHandler from './unavailable-modal-ui-handler';
|
||||||
import OutdatedModalUiHandler from './outdated-modal-ui-handler';
|
import OutdatedModalUiHandler from './outdated-modal-ui-handler';
|
||||||
|
import SessionReloadModalUiHandler from './session-reload-modal-ui-handler';
|
||||||
|
|
||||||
export enum Mode {
|
export enum Mode {
|
||||||
MESSAGE,
|
MESSAGE,
|
||||||
|
@ -62,6 +63,7 @@ export enum Mode {
|
||||||
LOGIN_FORM,
|
LOGIN_FORM,
|
||||||
REGISTRATION_FORM,
|
REGISTRATION_FORM,
|
||||||
LOADING,
|
LOADING,
|
||||||
|
SESSION_RELOAD,
|
||||||
UNAVAILABLE,
|
UNAVAILABLE,
|
||||||
OUTDATED
|
OUTDATED
|
||||||
};
|
};
|
||||||
|
@ -90,6 +92,7 @@ const noTransitionModes = [
|
||||||
Mode.LOGIN_FORM,
|
Mode.LOGIN_FORM,
|
||||||
Mode.REGISTRATION_FORM,
|
Mode.REGISTRATION_FORM,
|
||||||
Mode.LOADING,
|
Mode.LOADING,
|
||||||
|
Mode.SESSION_RELOAD,
|
||||||
Mode.UNAVAILABLE,
|
Mode.UNAVAILABLE,
|
||||||
Mode.OUTDATED
|
Mode.OUTDATED
|
||||||
];
|
];
|
||||||
|
@ -141,6 +144,7 @@ export default class UI extends Phaser.GameObjects.Container {
|
||||||
new LoginFormUiHandler(scene),
|
new LoginFormUiHandler(scene),
|
||||||
new RegistrationFormUiHandler(scene),
|
new RegistrationFormUiHandler(scene),
|
||||||
new LoadingModalUiHandler(scene),
|
new LoadingModalUiHandler(scene),
|
||||||
|
new SessionReloadModalUiHandler(scene),
|
||||||
new UnavailableModalUiHandler(scene),
|
new UnavailableModalUiHandler(scene),
|
||||||
new OutdatedModalUiHandler(scene)
|
new OutdatedModalUiHandler(scene)
|
||||||
];
|
];
|
||||||
|
|