Add endless mode
Add endless mode; prevent stat booster items from being transferred or stolen
This commit is contained in:
1 parent
ac9814e665
commit
9faa489f19
16 files changed
+241
-112
No files matched your search
@@ -10,6 +10,7 @@ import PersistentModifierData from "./modifier-data";
|
||||
import { PokemonHeldItemModifier } from "../modifier/modifier";
|
||||
import ArenaData from "./arena-data";
|
||||
import { Unlockables } from "./unlockables";
|
||||
import { GameMode } from "../game-mode";
|
||||
|
||||
interface SystemSaveData {
|
||||
trainerId: integer;
|
||||
@@ -20,6 +21,7 @@ interface SystemSaveData {
|
||||
}
|
||||
|
||||
interface SessionSaveData {
|
||||
gameMode: GameMode;
|
||||
party: PokemonData[];
|
||||
enemyField: PokemonData[];
|
||||
modifiers: PersistentModifierData[];
|
||||
@@ -75,6 +77,7 @@ export class GameData {
|
||||
this.trainerId = Utils.randInt(65536);
|
||||
this.secretId = Utils.randInt(65536);
|
||||
this.unlocks = {
|
||||
[Unlockables.ENDLESS_MODE]: false,
|
||||
[Unlockables.MINI_BLACK_HOLE]: false
|
||||
};
|
||||
this.initDexData();
|
||||
@@ -125,6 +128,7 @@ export class GameData {
|
||||
|
||||
saveSession(scene: BattleScene): boolean {
|
||||
const sessionData = {
|
||||
gameMode: scene.gameMode,
|
||||
party: scene.getParty().map(p => new PokemonData(p)),
|
||||
enemyField: scene.getEnemyField().map(p => new PokemonData(p)),
|
||||
modifiers: scene.findModifiers(() => true).map(m => new PersistentModifierData(m, true)),
|
||||
@@ -176,6 +180,8 @@ export class GameData {
|
||||
|
||||
console.debug(sessionData);
|
||||
|
||||
scene.gameMode = sessionData.gameMode || GameMode.CLASSIC;
|
||||
|
||||
const loadPokemonAssets: Promise<void>[] = [];
|
||||
|
||||
const party = scene.getParty();
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
export enum Unlockables {
|
||||
ENDLESS_MODE,
|
||||
MINI_BLACK_HOLE
|
||||
}
|
||||
|
||||
export function getUnlockableName(unlockable: Unlockables) {
|
||||
switch (unlockable) {
|
||||
case Unlockables.ENDLESS_MODE:
|
||||
return 'Endless Mode';
|
||||
case Unlockables.MINI_BLACK_HOLE:
|
||||
return 'MINI BLACK HOLE';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user