Update final boss fight and restructure some files
This commit is contained in:
1 parent
25972b68ea
commit
052564f902
52 files changed
+2018
-1669
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { Arena } from "../arena";
|
||||
import { ArenaTag } from "../data/arena-tag";
|
||||
import { Biome } from "../data/biome";
|
||||
import { Biome } from "../data/enums/biome";
|
||||
import { Weather } from "../data/weather";
|
||||
|
||||
export default class ArenaData {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { SelectModifierPhase } from "../battle-phases";
|
||||
import BattleScene, { Button } from "../battle-scene";
|
||||
import { ModifierTier, ModifierType, ModifierTypeOption, PokemonBaseStatBoosterModifierType, PokemonHpRestoreModifierType, PokemonReviveModifierType } from "../modifier/modifier-type";
|
||||
import { ModifierType, ModifierTypeOption, PokemonBaseStatBoosterModifierType, PokemonHpRestoreModifierType, PokemonReviveModifierType } from "../modifier/modifier-type";
|
||||
import Pokemon, { AiType, EnemyPokemon, PlayerPokemon, PokemonMove } from "../pokemon";
|
||||
import { Species } from "../data/species";
|
||||
import { Species } from "../data/enums/species";
|
||||
import BattleMessageUiHandler from "../ui/battle-message-ui-handler";
|
||||
import CommandUiHandler from "../ui/command-ui-handler";
|
||||
import FightUiHandler from "../ui/fight-ui-handler";
|
||||
@@ -11,6 +11,7 @@ import ModifierSelectUiHandler from "../ui/modifier-select-ui-handler";
|
||||
import PartyUiHandler, { PartyUiMode } from "../ui/party-ui-handler";
|
||||
import ConfirmUiHandler from "../ui/confirm-ui-handler";
|
||||
import { Mode } from "../ui/ui";
|
||||
import { ModifierTier } from "../modifier/modifier-tier";
|
||||
|
||||
export function initAutoPlay() {
|
||||
const thisArg = this as BattleScene;
|
||||
|
||||
@@ -2,7 +2,7 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene";
|
||||
import Pokemon, { EnemyPokemon, PlayerPokemon } from "../pokemon";
|
||||
import { pokemonPrevolutions } from "../data/pokemon-evolutions";
|
||||
import PokemonSpecies, { allSpecies, getPokemonSpecies, speciesStarters } from "../data/pokemon-species";
|
||||
import { Species } from "../data/species";
|
||||
import { Species } from "../data/enums/species";
|
||||
import * as Utils from "../utils";
|
||||
import PokemonData from "./pokemon-data";
|
||||
import PersistentModifierData from "./modifier-data";
|
||||
@@ -11,7 +11,7 @@ import { Unlockables } from "./unlockables";
|
||||
import { GameMode } from "../game-mode";
|
||||
import { BattleType } from "../battle";
|
||||
import TrainerData from "./trainer-data";
|
||||
import { trainerConfigs } from "../data/trainer-type";
|
||||
import { trainerConfigs } from "../data/trainer-config";
|
||||
import { Setting, setSetting, settingDefaults } from "./settings";
|
||||
import { achvs } from "./achv";
|
||||
import EggData from "./egg-data";
|
||||
|
||||
+22
-14
@@ -1,11 +1,11 @@
|
||||
import { BattleType } from "../battle";
|
||||
import BattleScene from "../battle-scene";
|
||||
import { Biome } from "../data/biome";
|
||||
import { Biome } from "../data/enums/biome";
|
||||
import { Gender } from "../data/gender";
|
||||
import { Nature } from "../data/nature";
|
||||
import { PokeballType } from "../data/pokeball";
|
||||
import { getPokemonSpecies } from "../data/pokemon-species";
|
||||
import { Species } from "../data/species";
|
||||
import { Species } from "../data/enums/species";
|
||||
import { Status } from "../data/status-effect";
|
||||
import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove, PokemonSummonData } from "../pokemon";
|
||||
|
||||
@@ -43,7 +43,7 @@ export default class PokemonData {
|
||||
|
||||
public summonData: PokemonSummonData;
|
||||
|
||||
constructor(source: Pokemon | any) {
|
||||
constructor(source: Pokemon | any, forHistory: boolean = false) {
|
||||
const sourcePokemon = source instanceof Pokemon ? source as Pokemon : null;
|
||||
this.id = source.id;
|
||||
this.player = sourcePokemon ? sourcePokemon.isPlayer() : source.player;
|
||||
@@ -54,16 +54,19 @@ export default class PokemonData {
|
||||
this.pokeball = source.pokeball;
|
||||
this.level = source.level;
|
||||
this.exp = source.exp;
|
||||
this.levelExp = source.levelExp;
|
||||
if (!forHistory)
|
||||
this.levelExp = source.levelExp;
|
||||
this.gender = source.gender;
|
||||
this.hp = source.hp;
|
||||
if (!forHistory)
|
||||
this.hp = source.hp;
|
||||
this.stats = source.stats;
|
||||
this.ivs = source.ivs;
|
||||
this.nature = source.nature !== undefined ? source.nature : 0 as Nature;
|
||||
this.friendship = source.friendship !== undefined ? source.friendship : getPokemonSpecies(this.species).baseFriendship;
|
||||
this.metLevel = source.metLevel || 5;
|
||||
this.metBiome = source.metBiome !== undefined ? source.metBiome : -1;
|
||||
this.pauseEvolutions = !!source.pauseEvolutions;
|
||||
if (!forHistory)
|
||||
this.pauseEvolutions = !!source.pauseEvolutions;
|
||||
this.pokerus = !!source.pokerus;
|
||||
|
||||
this.fusionSpecies = sourcePokemon ? sourcePokemon.fusionSpecies?.speciesId : source.fusionSpecies;
|
||||
@@ -72,21 +75,26 @@ export default class PokemonData {
|
||||
this.fusionShiny = source.fusionShiny;
|
||||
this.fusionGender = source.fusionGender;
|
||||
|
||||
this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss);
|
||||
if (!forHistory)
|
||||
this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss);
|
||||
|
||||
if (sourcePokemon) {
|
||||
this.moveset = sourcePokemon.moveset;
|
||||
this.status = sourcePokemon.status;
|
||||
if (this.player)
|
||||
this.summonData = sourcePokemon.summonData;
|
||||
if (!forHistory) {
|
||||
this.status = sourcePokemon.status;
|
||||
if (this.player)
|
||||
this.summonData = sourcePokemon.summonData;
|
||||
}
|
||||
} else {
|
||||
this.moveset = source.moveset.map((m: any) => new PokemonMove(m.moveId, m.ppUsed, m.ppUp));
|
||||
this.status = source.status
|
||||
? new Status(source.status.effect, source.status.turnCount, source.status.cureTurn)
|
||||
: undefined;
|
||||
if (!forHistory) {
|
||||
this.status = source.status
|
||||
? new Status(source.status.effect, source.status.turnCount, source.status.cureTurn)
|
||||
: undefined;
|
||||
}
|
||||
|
||||
this.summonData = new PokemonSummonData();
|
||||
if (source.summonData) {
|
||||
if (!forHistory && source.summonData) {
|
||||
this.summonData.battleStats = source.summonData.battleStats;
|
||||
this.summonData.moveQueue = source.summonData.moveQueue;
|
||||
this.summonData.tags = []; // TODO
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { GameMode } from "../game-mode";
|
||||
import PokemonData from "./pokemon-data";
|
||||
import PersistentModifierData from "./modifier-data";
|
||||
|
||||
export enum SessionHistoryResult {
|
||||
ACTIVE,
|
||||
WIN,
|
||||
LOSS
|
||||
}
|
||||
|
||||
export interface SessionHistory {
|
||||
seed: string;
|
||||
playTime: integer;
|
||||
result: SessionHistoryResult,
|
||||
gameMode: GameMode;
|
||||
party: PokemonData[];
|
||||
modifiers: PersistentModifierData[];
|
||||
money: integer;
|
||||
waveIndex: integer;
|
||||
gameVersion: string;
|
||||
timestamp: integer;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import BattleScene from "../battle-scene";
|
||||
import { TrainerType } from "../data/trainer-type";
|
||||
import { TrainerType } from "../data/enums/trainer-type";
|
||||
import Trainer from "../trainer";
|
||||
|
||||
export default class TrainerData {
|
||||
|
||||
+27
-24
@@ -1,6 +1,6 @@
|
||||
import BattleScene from "../battle-scene";
|
||||
import { TrainerType, trainerConfigs } from "../data/trainer-type";
|
||||
import { ModifierTier } from "../modifier/modifier-type";
|
||||
import { TrainerType } from "../data/enums/trainer-type";
|
||||
import { ModifierTier } from "../modifier/modifier-tier";
|
||||
import { Achv, achvs } from "./achv";
|
||||
|
||||
export enum VoucherType {
|
||||
@@ -86,30 +86,33 @@ const voucherAchvs: Achv[] = [ achvs.CLASSIC_VICTORY ];
|
||||
|
||||
{
|
||||
(function() {
|
||||
for (let achv of voucherAchvs) {
|
||||
const voucherType = achv.score >= 150
|
||||
? VoucherType.GOLDEN
|
||||
: achv.score >= 100
|
||||
? VoucherType.PREMIUM
|
||||
: achv.score >= 75
|
||||
? VoucherType.PLUS
|
||||
: VoucherType.REGULAR;
|
||||
vouchers[achv.id] = new Voucher(voucherType, achv.description);
|
||||
}
|
||||
import('../data/trainer-config').then(tc => {
|
||||
for (let achv of voucherAchvs) {
|
||||
const voucherType = achv.score >= 150
|
||||
? VoucherType.GOLDEN
|
||||
: achv.score >= 100
|
||||
? VoucherType.PREMIUM
|
||||
: achv.score >= 75
|
||||
? VoucherType.PLUS
|
||||
: VoucherType.REGULAR;
|
||||
vouchers[achv.id] = new Voucher(voucherType, achv.description);
|
||||
}
|
||||
|
||||
const bossTrainerTypes = Object.keys(trainerConfigs)
|
||||
.filter(tt => trainerConfigs[tt].isBoss && trainerConfigs[tt].getDerivedType() !== TrainerType.RIVAL);
|
||||
const trainerConfigs = tc.trainerConfigs;
|
||||
const bossTrainerTypes = Object.keys(trainerConfigs)
|
||||
.filter(tt => trainerConfigs[tt].isBoss && trainerConfigs[tt].getDerivedType() !== TrainerType.RIVAL);
|
||||
|
||||
for (let trainerType of bossTrainerTypes) {
|
||||
const voucherType = trainerConfigs[trainerType].moneyMultiplier < 10
|
||||
? VoucherType.PLUS
|
||||
: VoucherType.PREMIUM;
|
||||
const key = TrainerType[trainerType];
|
||||
vouchers[key] = new Voucher(voucherType, `Defeat ${trainerConfigs[trainerType].name}`);
|
||||
}
|
||||
for (let trainerType of bossTrainerTypes) {
|
||||
const voucherType = trainerConfigs[trainerType].moneyMultiplier < 10
|
||||
? VoucherType.PLUS
|
||||
: VoucherType.PREMIUM;
|
||||
const key = TrainerType[trainerType];
|
||||
vouchers[key] = new Voucher(voucherType, `Defeat ${trainerConfigs[trainerType].name}`);
|
||||
}
|
||||
|
||||
const voucherKeys = Object.keys(vouchers);
|
||||
for (let k of voucherKeys)
|
||||
vouchers[k].id = k;
|
||||
const voucherKeys = Object.keys(vouchers);
|
||||
for (let k of voucherKeys)
|
||||
vouchers[k].id = k;
|
||||
});
|
||||
})();
|
||||
}
|
||||
Reference in new issue
Block a user