Add generation 8 Pokemon and new biomes

This commit is contained in:
Flashfyre committed 2023-12-14 00:41:35 -05:00
1 parent c07df0db99
commit 47181ea868
152 files changed
+673 -246

No files matched your search

+28 -6
View File
@@ -127,7 +127,7 @@ export class Arena {
switch (this.biomeType) {
case Biome.BEACH:
return 1;
case Biome.CITY:
case Biome.SLUM:
return 2;
}
break;
@@ -145,6 +145,14 @@ export class Arena {
if (!this.isDaytime())
return 1;
}
case Species.CALYREX:
switch (this.biomeType) {
case Biome.SNOWY_FOREST:
return 1;
case Biome.GRAVEYARD:
return 2;
}
break;
}
return 0;
@@ -154,13 +162,14 @@ export class Arena {
switch (this.biomeType) {
case Biome.TOWN:
case Biome.PLAINS:
case Biome.METROPOLIS:
return Type.NORMAL;
case Biome.GRASS:
case Biome.TALL_GRASS:
return Type.GRASS;
case Biome.FOREST:
return Type.BUG;
case Biome.CITY:
case Biome.SLUM:
case Biome.SWAMP:
return Type.POISON;
case Biome.SEA:
@@ -176,6 +185,7 @@ export class Arena {
case Biome.DESERT:
return Type.ROCK;
case Biome.ICE_CAVE:
case Biome.SNOWY_FOREST:
return Type.ICE;
case Biome.MEADOW:
case Biome.FAIRY_CAVE:
@@ -245,7 +255,9 @@ export class Arena {
getTrainerChance(): integer {
switch (this.biomeType) {
case Biome.CITY:
case Biome.METROPOLIS:
return 2;
case Biome.SLUM:
case Biome.BEACH:
case Biome.DOJO:
case Biome.CONSTRUCTION_SITE:
@@ -266,6 +278,7 @@ export class Arena {
case Biome.POWER_PLANT:
case Biome.GRAVEYARD:
case Biome.FACTORY:
case Biome.SNOWY_FOREST:
return 8;
case Biome.ICE_CAVE:
case Biome.VOLCANO:
@@ -289,6 +302,7 @@ export class Arena {
case Biome.TOWN:
case Biome.PLAINS:
case Biome.GRASS:
case Biome.METROPOLIS:
case Biome.SEA:
case Biome.BEACH:
case Biome.LAKE:
@@ -299,6 +313,7 @@ export class Arena {
case Biome.DOJO:
case Biome.CONSTRUCTION_SITE:
case Biome.ISLAND:
case Biome.SNOWY_FOREST:
return true;
}
}
@@ -352,8 +367,8 @@ export class Arena {
return 1.995;
case Biome.TALL_GRASS:
return 9.608;
case Biome.CITY:
return 1.221;
case Biome.METROPOLIS:
return 4.867;
case Biome.FOREST:
return 4.294;
case Biome.SEA:
@@ -408,6 +423,10 @@ export class Arena {
return 2.751;
case Biome.LABORATORY:
return 0.797;
case Biome.SLUM:
return 1.221;
case Biome.SNOWY_FOREST:
return 3.047;
}
}
}
@@ -417,8 +436,9 @@ export function getBiomeKey(biome: Biome): string {
case Biome.POWER_PLANT:
case Biome.TEMPLE:
return 'ruins';
case Biome.METROPOLIS:
case Biome.CONSTRUCTION_SITE:
return 'city';
return 'slum';
case Biome.JUNGLE:
return 'tall_grass';
case Biome.FAIRY_CAVE:
@@ -427,6 +447,8 @@ export function getBiomeKey(biome: Biome): string {
return 'beach';
case Biome.LABORATORY:
return 'factory';
case Biome.SNOWY_FOREST:
return 'ice_cave';
case Biome.END:
return 'wasteland';
}
+4 -4
View File
@@ -132,8 +132,6 @@ export default class BattleScene extends Phaser.Scene {
initSpecies();
initMoves();
initAbilities();
this.gameData = new GameData(this);
this.phaseQueue = [];
this.phaseQueuePrepend = [];
@@ -345,6 +343,8 @@ export default class BattleScene extends Phaser.Scene {
create() {
initGameSpeed.apply(this);
this.gameData = new GameData(this);
this.setupControls();
this.load.setBaseURL();
@@ -854,13 +854,13 @@ export default class BattleScene extends Phaser.Scene {
randomSpecies(waveIndex: integer, level: integer, fromArenaPool?: boolean, speciesFilter?: PokemonSpeciesFilter, filterAllEvolutions?: boolean): PokemonSpecies {
if (fromArenaPool)
return this.arena.randomSpecies(waveIndex, level);
const filteredSpecies = speciesFilter ? [...new Set(allSpecies.filter(s => s.generation <= 7).filter(speciesFilter).map(s => {
const filteredSpecies = speciesFilter ? [...new Set(allSpecies.filter(s => s.generation <= 8).filter(speciesFilter).map(s => {
if (!filterAllEvolutions) {
while (pokemonPrevolutions.hasOwnProperty(s.speciesId))
s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]);
}
return s;
}))] : allSpecies.filter(s => s.generation <= 7);
}))] : allSpecies.filter(s => s.generation <= 8);
let ret = filteredSpecies[Utils.randSeedInt(filteredSpecies.length)];
if (!filterAllEvolutions)
ret = getPokemonSpecies(ret.getSpeciesForLevel(level, true));
+570 -191
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -267,7 +267,7 @@ export const pokemonEvolutions: PokemonEvolutions = {
new SpeciesEvolution(Species.HITMONTOP, 20, null, new SpeciesEvolutionCondition((p: Pokemon) => p.stats[Stat.ATK] === p.stats[Stat.DEF]))
],
[Species.KOFFING]: [
new SpeciesEvolution(Species.GALAR_WEEZING, 35, null, new SpeciesEvolutionCondition((p: Pokemon) => p.scene.arena.biomeType === Biome.CITY), SpeciesWildEvolutionDelay.NEVER),
new SpeciesEvolution(Species.GALAR_WEEZING, 35, null, new SpeciesEvolutionCondition((p: Pokemon) => p.scene.arena.biomeType === Biome.METROPOLIS), SpeciesWildEvolutionDelay.NEVER),
new SpeciesEvolution(Species.WEEZING, 35, null, null)
],
[Species.RHYHORN]: [
+5 -5
View File
@@ -106,7 +106,7 @@ export abstract class PokemonSpeciesForm {
}
isObtainable() {
return (this.generation <= 7 || pokemonPrevolutions.hasOwnProperty(this.speciesId));
return (this.generation <= 8 || pokemonPrevolutions.hasOwnProperty(this.speciesId));
}
getSpriteAtlasPath(female: boolean, formIndex?: integer, shiny?: boolean): string {
@@ -1801,11 +1801,11 @@ export function initSpecies() {
new PokemonSpecies(Species.CLOBBOPUS, "Clobbopus", 8, false, false, false, "Tantrum Pokémon", Type.FIGHTING, null, 0.6, 4, Abilities.LIMBER, Abilities.NONE, Abilities.TECHNICIAN, 310, 50, 68, 60, 50, 50, 32, 180, 50, 62, GrowthRate.MEDIUM_SLOW, 50, false),
new PokemonSpecies(Species.GRAPPLOCT, "Grapploct", 8, false, false, false, "Jujitsu Pokémon", Type.FIGHTING, null, 1.6, 39, Abilities.LIMBER, Abilities.NONE, Abilities.TECHNICIAN, 480, 80, 118, 90, 70, 80, 42, 45, 50, 168, GrowthRate.MEDIUM_SLOW, 50, false),
new PokemonSpecies(Species.SINISTEA, "Sinistea", 8, false, false, false, "Black Tea Pokémon", Type.GHOST, null, 0.1, 0.2, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 308, 40, 45, 45, 74, 54, 50, 120, 50, 62, GrowthRate.MEDIUM_FAST, null, false, false,
new PokemonForm("Phony Form", "phony", Type.GHOST, null, 0.1, 0.2, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 308, 40, 45, 45, 74, 54, 50, 120, 50, 62),
new PokemonForm("Phony Form", "phony", Type.GHOST, null, 0.1, 0.2, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 308, 40, 45, 45, 74, 54, 50, 120, 50, 62, false, ""),
new PokemonForm("Antique Form", "antique", Type.GHOST, null, 0.1, 0.2, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 308, 40, 45, 45, 74, 54, 50, 120, 50, 62, false, ""),
),
new PokemonSpecies(Species.POLTEAGEIST, "Polteageist", 8, false, false, false, "Black Tea Pokémon", Type.GHOST, null, 0.2, 0.4, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 508, 60, 65, 65, 134, 114, 70, 60, 50, 178, GrowthRate.MEDIUM_FAST, null, false, false,
new PokemonForm("Phony Form", "phony", Type.GHOST, null, 0.2, 0.4, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 508, 60, 65, 65, 134, 114, 70, 60, 50, 178),
new PokemonForm("Phony Form", "phony", Type.GHOST, null, 0.2, 0.4, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 508, 60, 65, 65, 134, 114, 70, 60, 50, 178, false, ""),
new PokemonForm("Antique Form", "antique", Type.GHOST, null, 0.2, 0.4, Abilities.WEAK_ARMOR, Abilities.NONE, Abilities.CURSED_BODY, 508, 60, 65, 65, 134, 114, 70, 60, 50, 178, false, ""),
),
new PokemonSpecies(Species.HATENNA, "Hatenna", 8, false, false, false, "Calm Pokémon", Type.PSYCHIC, null, 0.4, 3.4, Abilities.HEALER, Abilities.ANTICIPATION, Abilities.MAGIC_BOUNCE, 265, 42, 30, 45, 56, 53, 39, 235, 50, 53, GrowthRate.SLOW, 0, false),
@@ -2701,7 +2701,7 @@ export const speciesStarters = {
{
//setTimeout(() => {
/*for (let tc of Object.keys(trainerConfigs)) {
console.log(TrainerType[tc], !trainerConfigs[tc].speciesFilter ? 'all' : [...new Set(allSpecies.filter(s => s.generation <= 7).filter(trainerConfigs[tc].speciesFilter).map(s => {
console.log(TrainerType[tc], !trainerConfigs[tc].speciesFilter ? 'all' : [...new Set(allSpecies.filter(s => s.generation <= 8).filter(trainerConfigs[tc].speciesFilter).map(s => {
while (pokemonPrevolutions.hasOwnProperty(s.speciesId))
s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]);
return s;
@@ -2709,7 +2709,7 @@ export const speciesStarters = {
}
const speciesFilter = (species: PokemonSpecies) => !species.legendary && !species.pseudoLegendary && !species.mythical && species.baseTotal >= 540;
console.log(!speciesFilter ? 'all' : [...new Set(allSpecies.filter(s => s.generation <= 7).filter(speciesFilter).map(s => {
console.log(!speciesFilter ? 'all' : [...new Set(allSpecies.filter(s => s.generation <= 8).filter(speciesFilter).map(s => {
while (pokemonPrevolutions.hasOwnProperty(s.speciesId))
s = getPokemonSpecies(pokemonPrevolutions[s.speciesId]);
return s;
+33 -27
View File
@@ -10,7 +10,8 @@ import { tmSpecies } from "./tms";
import { Type } from "./type";
export enum TrainerType {
ACE_TRAINER = 1,
UNKNOWN,
ACE_TRAINER,
ARTIST,
BACKERS,
BACKPACKER,
@@ -59,7 +60,7 @@ export enum TrainerType {
WORKER,
YOUNGSTER,
BROCK,
BROCK = 200,
MISTY,
LT_SURGE,
ERIKA,
@@ -106,12 +107,12 @@ export enum TrainerType {
DRAYDEN,
MARLON,
SHAUNTAL,
SHAUNTAL = 300,
MARSHAL,
GRIMSLEY,
CAITLIN,
BLUE,
BLUE = 325,
RED,
LANCE,
STEVEN,
@@ -120,7 +121,7 @@ export enum TrainerType {
ALDER,
IRIS,
RIVAL,
RIVAL = 350,
RIVAL_2,
RIVAL_3,
RIVAL_4,
@@ -134,7 +135,7 @@ export enum TrainerPoolTier {
RARE,
SUPER_RARE,
ULTRA_RARE
};
}
export interface TrainerTierPools {
[key: integer]: Species[]
@@ -560,6 +561,7 @@ function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilt
}
export const trainerConfigs: TrainerConfigs = {
[TrainerType.UNKNOWN]: new TrainerConfig(0).setHasGenders(),
[TrainerType.ACE_TRAINER]: new TrainerConfig(++t).setHasGenders().setMoneyMultiplier(2.25).setEncounterBgm(TrainerType.ACE_TRAINER)
.setPartyTemplateFunc(scene => getWavePartyTemplate(scene, trainerPartyTemplates.THREE_WEAK_BALANCED, trainerPartyTemplates.FOUR_WEAK_BALANCED, trainerPartyTemplates.FIVE_WEAK_BALANCED, trainerPartyTemplates.SIX_WEAK_BALANCED)),
[TrainerType.ARTIST]: new TrainerConfig(++t).setEncounterBgm(TrainerType.RICH).setPartyTemplates(trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.THREE_AVG)
@@ -568,10 +570,10 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.BACKPACKER]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => s.isOfType(Type.FLYING) || s.isOfType(Type.ROCK)).setEncounterBgm(TrainerType.BACKPACKER)
.setPartyTemplates(trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.ONE_WEAK_ONE_STRONG, trainerPartyTemplates.ONE_AVG_ONE_STRONG)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.RHYHORN, Species.AIPOM, Species.MAKUHITA, Species.MAWILE, Species.NUMEL, Species.LILLIPUP, Species.SANDILE, /* Species.WOOLOO */ ],
[TrainerPoolTier.COMMON]: [ Species.RHYHORN, Species.AIPOM, Species.MAKUHITA, Species.MAWILE, Species.NUMEL, Species.LILLIPUP, Species.SANDILE, Species.WOOLOO ],
[TrainerPoolTier.UNCOMMON]: [ Species.GIRAFARIG, Species.ZANGOOSE, Species.SEVIPER, Species.CUBCHOO, Species.PANCHAM, Species.SKIDDO, Species.MUDBRAY ],
[TrainerPoolTier.RARE]: [ Species.TAUROS, Species.STANTLER, Species.DARUMAKA, Species.BOUFFALANT, Species.DEERLING, /*Species.IMPIDIMP, */ ],
[TrainerPoolTier.SUPER_RARE]: [ /* Species.GALAR_DARUMAKA */ /* Species.TEDDIURSA */ ]
[TrainerPoolTier.RARE]: [ Species.TAUROS, Species.STANTLER, Species.DARUMAKA, Species.BOUFFALANT, Species.DEERLING, Species.IMPIDIMP ],
[TrainerPoolTier.SUPER_RARE]: [ Species.GALAR_DARUMAKA, Species.TEDDIURSA ]
}),
[TrainerType.BAKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setMoneyMultiplier(1.35).setSpeciesFilter(s => s.isOfType(Type.GRASS) || s.isOfType(Type.FIRE)),
[TrainerType.BEAUTY]: new TrainerConfig(++t).setMoneyMultiplier(1.55).setEncounterBgm(TrainerType.PARASOL_LADY),
@@ -597,10 +599,10 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.CYCLIST]: new TrainerConfig(++t).setMoneyMultiplier(1.3).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setSpeciesFilter(s => !!s.getLevelMoves().find(plm => plm[1] === Moves.QUICK_ATTACK))
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.ONE_AVG)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.PICHU, Species.STARLY, Species.TAILLOW, /* Species.BOLTUND */ ],
[TrainerPoolTier.COMMON]: [ Species.PICHU, Species.STARLY, Species.TAILLOW, Species.BOLTUND ],
[TrainerPoolTier.UNCOMMON]: [ Species.DODUO, Species.ELECTRIKE, Species.BLITZLE, /* Species.WATTREL */],
[TrainerPoolTier.RARE]: [ Species.YANMA, Species.NINJASK, Species.WHIRLIPEDE, Species.EMOLGA ],
[TrainerPoolTier.SUPER_RARE]: [ Species.ACCELGOR, /* Species.DREEPY */ ]
[TrainerPoolTier.SUPER_RARE]: [ Species.ACCELGOR, Species.DREEPY ]
}),
[TrainerType.DANCER]: new TrainerConfig(++t).setMoneyMultiplier(1.55).setEncounterBgm(TrainerType.CYCLIST)
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_SAME_TWO_WEAK_SAME)
@@ -615,7 +617,7 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.FISHERMAN]: new TrainerConfig(++t).setMoneyMultiplier(1.25).setEncounterBgm(TrainerType.BACKPACKER)
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG, trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.THREE_WEAK_SAME, trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.SIX_WEAKER)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.TENTACOOL, Species.MAGIKARP, Species.GOLDEEN, Species.STARYU, Species.REMORAID, Species.SKRELP, Species.CLAUNCHER, /* Species.ARROKUDA */ ],
[TrainerPoolTier.COMMON]: [ Species.TENTACOOL, Species.MAGIKARP, Species.GOLDEEN, Species.STARYU, Species.REMORAID, Species.SKRELP, Species.CLAUNCHER, Species.ARROKUDA ],
[TrainerPoolTier.UNCOMMON]: [ Species.POLIWAG, Species.SHELLDER, Species.KRABBY, Species.HORSEA, Species.CARVANHA, Species.BARBOACH, Species.CORPHISH, Species.FINNEON, Species.TYMPOLE, Species.BASCULIN, Species.FRILLISH, Species.INKAY ],
[TrainerPoolTier.RARE]: [ Species.CHINCHOU, Species.CORSOLA, Species.WAILMER, Species.BARBOACH, Species.CLAMPERL, Species.LUVDISC, Species.MANTYKE, Species.ALOMOMOLA, /* Species.TATSUGIRI */ /* Species.VELUZA */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.LAPRAS, Species.FEEBAS, Species.RELICANTH, /* Species.DONDOZO */ ]
@@ -627,7 +629,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.SANDSHREW, Species.DIGLETT, Species.GEODUDE, Species.MACHOP, Species.ARON, Species.ROGGENROLA, Species.DRILBUR, /* Species.NACLI */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.ZUBAT, Species.RHYHORN, Species.ONIX, Species.CUBONE, Species.WOOBAT, Species.SWINUB, Species.NOSEPASS, Species.HIPPOPOTAS, Species.DWEBBLE, /* Species.KLAWF */ /* Species.TOEDSCOOL */ ],
[TrainerPoolTier.RARE]: [ Species.TORKOAL, Species.TRAPINCH, Species.BARBOACH, Species.GOLETT, Species.ALOLA_DIGLETT, Species.ALOLA_GEODUDE, /* Species.GALAR_STUNFISK */ /* Species.PALDEA_WOOPER */ ],
[TrainerPoolTier.RARE]: [ Species.TORKOAL, Species.TRAPINCH, Species.BARBOACH, Species.GOLETT, Species.ALOLA_DIGLETT, Species.ALOLA_GEODUDE, Species.GALAR_STUNFISK /* Species.PALDEA_WOOPER */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.MAGBY, Species.LARVITAR ]
}),
[TrainerType.HOOLIGANS]: new TrainerConfig(++t).setDouble().setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.POISON) || s.isOfType(Type.DARK)),
@@ -642,7 +644,7 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.OFFICER]: new TrainerConfig(++t).setMoneyMultiplier(1.55).setEncounterBgm(TrainerType.CLERK)
.setPartyTemplates(trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG, )
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP, /* Species.YAMPER */ /* , Species.FIDOUGH */ ],
[TrainerPoolTier.COMMON]: [ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP, Species.YAMPER /* , Species.FIDOUGH */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.HOUNDOUR, Species.ROCKRUFF /*, Species.MASCHIFF */ ],
[TrainerPoolTier.RARE]: [ Species.JOLTEON, Species.RIOLU ],
[TrainerPoolTier.SUPER_RARE]: [],
@@ -655,23 +657,23 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t).setMoneyMultiplier(0.2).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders(undefined, 'lass')
.setPartyTemplates(trainerPartyTemplates.THREE_WEAK, trainerPartyTemplates.FOUR_WEAKER, trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG, trainerPartyTemplates.FIVE_WEAKER)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.CATERPIE, Species.PICHU, Species.SANDSHREW, Species.LEDYBA, Species.BUDEW, Species.BURMY, /* Species.WOOLOO, Species.PAWMI, Species.SMOLIV, */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.EEVEE, Species.CLEFFA, Species.IGGLYBUFF, Species.SWINUB, Species.WOOPER, Species.DRIFLOON, /* Species.DEDENNE, Species.STUFFUL, */ ],
[TrainerPoolTier.COMMON]: [ Species.CATERPIE, Species.PICHU, Species.SANDSHREW, Species.LEDYBA, Species.BUDEW, Species.BURMY, Species.WOOLOO, /* Species.PAWMI, Species.SMOLIV, */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.EEVEE, Species.CLEFFA, Species.IGGLYBUFF, Species.SWINUB, Species.WOOPER, Species.DRIFLOON, Species.DEDENNE, Species.STUFFUL ],
[TrainerPoolTier.RARE]: [ Species.RALTS, Species.RIOLU, Species.JOLTIK /* Species.TANDEMAUS, */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.DARUMAKA, /* Species.TINKATINK, */],
}),
[TrainerType.PSYCHIC]: new TrainerConfig(++t).setHasGenders().setMoneyMultiplier(1.4).setEncounterBgm(TrainerType.PSYCHIC)
.setPartyTemplates(trainerPartyTemplates.TWO_WEAK, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG, trainerPartyTemplates.TWO_WEAK_SAME_TWO_WEAK_SAME, trainerPartyTemplates.ONE_STRONGER)
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.ABRA, Species.DROWZEE, Species.RALTS, Species.SPOINK, Species.GOTHITA, Species.SOLOSIS, Species.BLIPBUG, Species.ESPURR, /* Species.HATTENA */ ],
[TrainerPoolTier.COMMON]: [ Species.ABRA, Species.DROWZEE, Species.RALTS, Species.SPOINK, Species.GOTHITA, Species.SOLOSIS, Species.BLIPBUG, Species.ESPURR, Species.HATENNA ],
[TrainerPoolTier.UNCOMMON]: [ Species.MIME_JR, Species.EXEGGCUTE, Species.MEDITITE, Species.NATU, Species.EXEGGCUTE, Species.WOOBAT, Species.INKAY, Species.ORANGURU ],
[TrainerPoolTier.RARE]: [ Species.ELGYEM, Species.SIGILYPH, Species.BALTOY, Species.GIRAFARIG, Species.MEOWSTIC ],
[TrainerPoolTier.SUPER_RARE]: [ Species.BELDUM, Species.ESPEON /* Species.WYRDEER, */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.BELDUM, Species.ESPEON, Species.WYRDEER ],
}),
[TrainerType.RANGER]: new TrainerConfig(++t).setMoneyMultiplier(1.4).setEncounterBgm(TrainerType.BACKPACKER).setHasGenders()
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.PICHU, Species.GROWLITHE, Species.PONYTA, Species.ZIGZAGOON, Species.SEEDOT, Species.BIDOOF, Species.RIOLU, Species.SEWADDLE, Species.SKIDDO, /* Species.SALANDIT */ /* Species.YAMPER */ ],
[TrainerPoolTier.UNCOMMON]: [ Species.AZURILL, Species.TAUROS, Species.MAREEP, Species.FARFETCHD, Species.TEDDIURSA, Species.SHROOMISH, Species.ELECTRIKE, Species.BUDEW, Species.BUIZEL, /* Species.MUDBRAY, */ /* Species.STUFFUL */ ],
[TrainerPoolTier.COMMON]: [ Species.PICHU, Species.GROWLITHE, Species.PONYTA, Species.ZIGZAGOON, Species.SEEDOT, Species.BIDOOF, Species.RIOLU, Species.SEWADDLE, Species.SKIDDO, Species.SALANDIT, Species.YAMPER ],
[TrainerPoolTier.UNCOMMON]: [ Species.AZURILL, Species.TAUROS, Species.MAREEP, Species.FARFETCHD, Species.TEDDIURSA, Species.SHROOMISH, Species.ELECTRIKE, Species.BUDEW, Species.BUIZEL, Species.MUDBRAY, Species.STUFFUL ],
[TrainerPoolTier.RARE]: [ Species.EEVEE, Species.SCYTHER, Species.KANGASKHAN, Species.RALTS, Species.MUNCHLAX, Species.ZORUA, /* Species.PALDEA_TAUROS */ /* Species.TINKATINK */ /* Species.CYCLIZAR */ /* Species.FLAMIGO */ ],
[TrainerPoolTier.SUPER_RARE]: [ Species.LARVESTA ],
}),
@@ -682,9 +684,9 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.MAGNEMITE, Species.GRIMER, Species.DROWZEE, Species.VOLTORB, Species.KOFFING ],
[TrainerPoolTier.UNCOMMON]: [ Species.BALTOY, Species.BRONZOR, Species.FERROSEED, Species.KLINK, Species.CHARJABUG, Species.BLIPBUG, Species.HELIOPTILE ],
[TrainerPoolTier.RARE ]: [ Species.ABRA, Species.DITTO, Species.PORYGON, Species.ELEKID, Species.SOLOSIS, /* Species.GALAR_WEEZING */ ],
[TrainerPoolTier.SUPER_RARE ]: [ Species.OMANYTE, Species.KABUTO, Species.AERODACTYL, Species.LILEEP, Species.ANORITH, Species.CRANIDOS, Species.SHIELDON, Species.TIRTOUGA, Species.ARCHEN, /* Species.ARCTOVISH, Species.ARCTOZOLT, Species.DRACOVISH, Species.DRACOZOLT */ ],
[TrainerPoolTier.ULTRA_RARE]: [ Species.ROTOM, /* Species.MELTAN */ ]
[TrainerPoolTier.RARE ]: [ Species.ABRA, Species.DITTO, Species.PORYGON, Species.ELEKID, Species.SOLOSIS, Species.GALAR_WEEZING ],
[TrainerPoolTier.SUPER_RARE ]: [ Species.OMANYTE, Species.KABUTO, Species.AERODACTYL, Species.LILEEP, Species.ANORITH, Species.CRANIDOS, Species.SHIELDON, Species.TIRTOUGA, Species.ARCHEN, Species.ARCTOVISH, Species.ARCTOZOLT, Species.DRACOVISH, Species.DRACOZOLT ],
[TrainerPoolTier.ULTRA_RARE]: [ Species.ROTOM, Species.MELTAN ]
}),
[TrainerType.SMASHER]: new TrainerConfig(++t).setMoneyMultiplier(1.2).setEncounterBgm(TrainerType.CYCLIST),
[TrainerType.SNOW_WORKER]: new TrainerConfig(++t).setName('Worker').setMoneyMultiplier(1.7).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ICE) || s.isOfType(Type.STEEL)),
@@ -719,7 +721,8 @@ export const trainerConfigs: TrainerConfigs = {
`I didn't think you'd beat me that bad…`,
`I hope we get to have a rematch some day.`
]),
[TrainerType.BROCK]: new TrainerConfig(++t).initForGymLeader(Species.GEODUDE, Type.ROCK),
[TrainerType.BROCK]: new TrainerConfig((t = TrainerType.BROCK)).initForGymLeader(Species.GEODUDE, Type.ROCK),
[TrainerType.MISTY]: new TrainerConfig(++t).initForGymLeader(Species.STARYU, Type.WATER),
[TrainerType.LT_SURGE]: new TrainerConfig(++t).initForGymLeader(Species.ELECTABUZZ, Type.ELECTRIC),
[TrainerType.ERIKA]: new TrainerConfig(++t).initForGymLeader(Species.TANGELA, Type.GRASS),
@@ -882,11 +885,13 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.BRYCEN]: new TrainerConfig(++t).initForGymLeader(Species.CRYOGONAL, Type.ICE),
[TrainerType.DRAYDEN]: new TrainerConfig(++t).initForGymLeader(Species.DRUDDIGON, Type.DRAGON),
[TrainerType.MARLON]: new TrainerConfig(++t).initForGymLeader(Species.WAILMER, Type.WATER),
[TrainerType.SHAUNTAL]: new TrainerConfig(++t).initForEliteFour(Species.LITWICK, Type.GHOST),
[TrainerType.SHAUNTAL]: new TrainerConfig((t = TrainerType.SHAUNTAL)).initForEliteFour(Species.LITWICK, Type.GHOST),
[TrainerType.MARSHAL]: new TrainerConfig(++t).initForEliteFour(Species.TIMBURR, Type.FIGHTING),
[TrainerType.GRIMSLEY]: new TrainerConfig(++t).initForEliteFour(Species.PAWNIARD, Type.DARK),
[TrainerType.CAITLIN]: new TrainerConfig(++t).initForEliteFour(Species.GOTHITA, Type.PSYCHIC),
[TrainerType.BLUE]: new TrainerConfig(++t).initForChampion(Species.GYARADOS),
[TrainerType.BLUE]: new TrainerConfig((t = TrainerType.BLUE)).initForChampion(Species.GYARADOS),
[TrainerType.RED]: new TrainerConfig(++t).initForChampion(Species.CHARIZARD),
[TrainerType.LANCE]: new TrainerConfig(++t).initForChampion(Species.DRAGONITE),
[TrainerType.STEVEN]: new TrainerConfig(++t).initForChampion(Species.BELDUM),
@@ -894,7 +899,8 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.CYNTHIA]: new TrainerConfig(++t).initForChampion(Species.GARCHOMP).setBattleBgm('battle_cynthia'),
[TrainerType.ALDER]: new TrainerConfig(++t).initForChampion(Species.VOLCARONA),
[TrainerType.IRIS]: new TrainerConfig(++t).initForChampion(Species.AXEW),
[TrainerType.RIVAL]: new TrainerConfig(++t).setStaticParty().setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL).setEncounterMessages([
[TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL)).setStaticParty().setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL).setEncounterMessages([
`There you are! I've been looking everywhere for you!\nDid you forget to say goodbye to your best friend?
$So you're finally pursuing your dream, huh?\nI knew you'd do it one day…
$Anyway, I'll forgive you for forgetting me, but on one condition. You have to battle me!
+3 -1
View File
@@ -1,6 +1,7 @@
import Phaser from 'phaser';
import BattleScene from './battle-scene';
import InvertPostFX from './pipelines/invert';
import { version } from '../package.json';
const config: Phaser.Types.Core.GameConfig = {
type: Phaser.WEBGL,
@@ -12,7 +13,8 @@ const config: Phaser.Types.Core.GameConfig = {
},
pixelArt: true,
pipeline: [ InvertPostFX ] as unknown as Phaser.Types.Core.PipelineConfig,
scene: [ BattleScene ]
scene: [ BattleScene ],
version: version
};
const setPositionRelative = function (guideObject: any, x: number, y: number) {
+17 -1
View File
@@ -21,6 +21,7 @@ interface SystemSaveData {
dexData: DexData;
unlocks: Unlocks;
achvUnlocks: AchvUnlocks;
gameVersion: string;
timestamp: integer;
}
@@ -38,6 +39,7 @@ interface SessionSaveData {
waveIndex: integer;
battleType: BattleType;
trainer: TrainerData;
gameVersion: string;
timestamp: integer;
}
@@ -116,6 +118,7 @@ export class GameData {
dexData: this.dexData,
unlocks: this.unlocks,
achvUnlocks: this.achvUnlocks,
gameVersion: this.scene.game.config.gameVersion,
timestamp: new Date().getTime()
};
@@ -135,6 +138,12 @@ export class GameData {
console.debug(data);
/*const versions = [ this.scene.game.config.gameVersion, data.gameVersion || '0.0.0' ];
if (versions[0] !== versions[1]) {
const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v)));
}*/
this.trainerId = data.trainerId;
this.secretId = data.secretId;
@@ -201,6 +210,7 @@ export class GameData {
waveIndex: scene.currentBattle.waveIndex,
battleType: scene.currentBattle.battleType,
trainer: scene.currentBattle.battleType == BattleType.TRAINER ? new TrainerData(scene.currentBattle.trainer) : null,
gameVersion: scene.game.config.gameVersion,
timestamp: new Date().getTime()
} as SessionSaveData;
@@ -222,6 +232,12 @@ export class GameData {
try {
const sessionData = JSON.parse(atob(localStorage.getItem('sessionData')), (k: string, v: any) => {
/*const versions = [ scene.game.config.gameVersion, sessionData.gameVersion || '0.0.0' ];
if (versions[0] !== versions[1]) {
const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v)));
}*/
if (k === 'party' || k === 'enemyParty' || k === 'enemyField') {
const ret: PokemonData[] = [];
for (let pd of v)
@@ -248,7 +264,7 @@ export class GameData {
console.debug(sessionData);
scene.seed = sessionData.seed || this.scene.game.config.seed[0];
scene.seed = sessionData.seed || scene.game.config.seed[0];
scene.resetSeed();
scene.gameMode = sessionData.gameMode || GameMode.CLASSIC;
+3 -1
View File
@@ -12,7 +12,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
constructor(scene: BattleScene, trainerType: TrainerType, female?: boolean, partyTemplateIndex?: integer) {
super(scene, -72, 80);
this.config = trainerConfigs[trainerType];
this.config = trainerConfigs.hasOwnProperty(trainerType)
? trainerConfigs[trainerType]
: trainerConfigs[TrainerType.ACE_TRAINER];
this.female = female;
this.partyTemplateIndex = Math.min(partyTemplateIndex !== undefined ? partyTemplateIndex : Phaser.Math.RND.weightedPick(this.config.partyTemplates.map((_, i) => i)),
this.config.partyTemplates.length - 1);
+4 -3
View File
@@ -22,7 +22,7 @@ export interface Starter {
pokerus: boolean;
}
const gens = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII' ];
const gens = [ 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII' ];
const ivChartSize = 24;
const ivChartStatCoordMultipliers = [ [ 0, 1 ], [ 0.825, 0.5 ], [ 0.825, -0.5 ], [ 0, -1 ], [ -0.825, -0.5 ], [ -0.825, 0.5 ] ];
const defaultIvChartData = new Array(12).fill(null).map(() => 0);
@@ -135,8 +135,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonAbilityText.setOrigin(0, 0);
this.starterSelectContainer.add(this.pokemonAbilityText);
this.genOptionsText = addTextObject(this.scene, 115, 6, '', TextStyle.WINDOW);
this.genOptionsText.setLineSpacing(16);
this.genOptionsText = addTextObject(this.scene, 124, 7, '', TextStyle.WINDOW, { fontSize: 72, lineSpacing: 39, align: 'center' });
this.genOptionsText.setShadowOffset(4.5, 4.5);
this.genOptionsText.setOrigin(0.5, 0);
this.starterSelectContainer.add(this.genOptionsText);
this.updateGenOptions();
+2 -1
View File
@@ -67,7 +67,8 @@ export function addTextObject(scene: Phaser.Scene, x: number, y: number, content
const ret = scene.add.text(x, y, content, styleOptions);
ret.setScale(0.1666666667);
ret.setShadow(shadowSize, shadowSize, shadowColor);
ret.setLineSpacing(5);
if (!styleOptions.lineSpacing)
ret.setLineSpacing(5);
return ret;
}