mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-27 01:39:34 +02:00
Uploading changes to test
I'm lazy and am not going to copy the files into my offline version even though using the installer is slower
This commit is contained in:
parent
3468fb233a
commit
fce810fa73
@ -61,6 +61,89 @@ export function getNatureName(nature: Nature, includeStatEffects: boolean = fals
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getNatureIncrease(nature: Nature): string {
|
||||||
|
switch (nature) {
|
||||||
|
case Nature.LONELY:
|
||||||
|
case Nature.BRAVE:
|
||||||
|
case Nature.ADAMANT:
|
||||||
|
case Nature.NAUGHTY:
|
||||||
|
return "atk";
|
||||||
|
case Nature.BOLD:
|
||||||
|
case Nature.RELAXED:
|
||||||
|
case Nature.IMPISH:
|
||||||
|
case Nature.LAX:
|
||||||
|
return "def";
|
||||||
|
case Nature.MODEST:
|
||||||
|
case Nature.MILD:
|
||||||
|
case Nature.QUIET:
|
||||||
|
case Nature.RASH:
|
||||||
|
return "spatk";
|
||||||
|
case Nature.CALM:
|
||||||
|
case Nature.GENTLE:
|
||||||
|
case Nature.SASSY:
|
||||||
|
case Nature.CAREFUL:
|
||||||
|
return "spdef";
|
||||||
|
case Nature.TIMID:
|
||||||
|
case Nature.HASTY:
|
||||||
|
case Nature.JOLLY:
|
||||||
|
case Nature.NAIVE:
|
||||||
|
return "speed"
|
||||||
|
case Nature.HARDY:
|
||||||
|
//return "atk"
|
||||||
|
case Nature.DOCILE:
|
||||||
|
//return "def"
|
||||||
|
case Nature.SERIOUS:
|
||||||
|
//return "spatk"
|
||||||
|
case Nature.BASHFUL:
|
||||||
|
//return "spdef"
|
||||||
|
case Nature.QUIRKY:
|
||||||
|
//return "speed"
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function getNatureDecrease(nature: Nature): string {
|
||||||
|
switch (nature) {
|
||||||
|
case Nature.BOLD:
|
||||||
|
case Nature.TIMID:
|
||||||
|
case Nature.MODEST:
|
||||||
|
case Nature.CALM:
|
||||||
|
return "atk";
|
||||||
|
case Nature.LONELY:
|
||||||
|
case Nature.HASTY:
|
||||||
|
case Nature.MILD:
|
||||||
|
case Nature.GENTLE:
|
||||||
|
return "def"
|
||||||
|
case Nature.ADAMANT:
|
||||||
|
case Nature.IMPISH:
|
||||||
|
case Nature.JOLLY:
|
||||||
|
case Nature.CAREFUL:
|
||||||
|
return "spatk"
|
||||||
|
case Nature.NAUGHTY:
|
||||||
|
case Nature.LAX:
|
||||||
|
case Nature.NAIVE:
|
||||||
|
case Nature.RASH:
|
||||||
|
return "spdef"
|
||||||
|
case Nature.BRAVE:
|
||||||
|
case Nature.RELAXED:
|
||||||
|
case Nature.QUIET:
|
||||||
|
case Nature.SASSY:
|
||||||
|
return "speed"
|
||||||
|
case Nature.HARDY:
|
||||||
|
//return "atk"
|
||||||
|
case Nature.DOCILE:
|
||||||
|
//return "def"
|
||||||
|
case Nature.SERIOUS:
|
||||||
|
//return "spatk"
|
||||||
|
case Nature.BASHFUL:
|
||||||
|
//return "spdef"
|
||||||
|
case Nature.QUIRKY:
|
||||||
|
//return "speed"
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function getNatureStatMultiplier(nature: Nature, stat: Stat): number {
|
export function getNatureStatMultiplier(nature: Nature, stat: Stat): number {
|
||||||
switch (stat) {
|
switch (stat) {
|
||||||
case Stat.ATK:
|
case Stat.ATK:
|
||||||
|
@ -2,7 +2,7 @@ import i18next from "i18next";
|
|||||||
import * as Utils from "./utils";
|
import * as Utils from "./utils";
|
||||||
import Pokemon from "./field/pokemon";
|
import Pokemon from "./field/pokemon";
|
||||||
import { PlayerPokemon, EnemyPokemon } from "./field/pokemon";
|
import { PlayerPokemon, EnemyPokemon } from "./field/pokemon";
|
||||||
import { Nature, getNatureName } from "./data/nature";
|
import { Nature, getNatureDecrease, getNatureIncrease, getNatureName } from "./data/nature";
|
||||||
import BattleScene from "./battle-scene";
|
import BattleScene from "./battle-scene";
|
||||||
import { OptionSelectItem } from "./ui/abstact-option-select-ui-handler";
|
import { OptionSelectItem } from "./ui/abstact-option-select-ui-handler";
|
||||||
import { TrainerType } from "#enums/trainer-type";
|
import { TrainerType } from "#enums/trainer-type";
|
||||||
@ -26,7 +26,10 @@ export var logKeys: string[] = [
|
|||||||
"d", // Debug
|
"d", // Debug
|
||||||
];
|
];
|
||||||
|
|
||||||
export const DRPD_Version = "0.1.3"
|
export const DRPD_Version = "1.0.0"
|
||||||
|
export const acceptedVersions = [
|
||||||
|
"1.0.0"
|
||||||
|
]
|
||||||
export interface DRPD {
|
export interface DRPD {
|
||||||
version: string,
|
version: string,
|
||||||
title?: string,
|
title?: string,
|
||||||
@ -42,7 +45,7 @@ export interface Wave {
|
|||||||
type: string,
|
type: string,
|
||||||
double: boolean,
|
double: boolean,
|
||||||
actions: string[],
|
actions: string[],
|
||||||
shop: boolean | string,
|
shop: string,
|
||||||
biome: string,
|
biome: string,
|
||||||
trainer?: TrainerData,
|
trainer?: TrainerData,
|
||||||
pokemon?: PokeData[]
|
pokemon?: PokeData[]
|
||||||
@ -53,7 +56,7 @@ export interface PokeData {
|
|||||||
ability: string,
|
ability: string,
|
||||||
isHiddenAbility: boolean,
|
isHiddenAbility: boolean,
|
||||||
passiveAbility: string,
|
passiveAbility: string,
|
||||||
nature: string,
|
nature: NatureData,
|
||||||
gender: string,
|
gender: string,
|
||||||
rarity: string,
|
rarity: string,
|
||||||
captured: boolean,
|
captured: boolean,
|
||||||
@ -62,6 +65,11 @@ export interface PokeData {
|
|||||||
ivs: IVData,
|
ivs: IVData,
|
||||||
source?: Pokemon
|
source?: Pokemon
|
||||||
}
|
}
|
||||||
|
export interface NatureData {
|
||||||
|
name: string,
|
||||||
|
increased: string,
|
||||||
|
decreased: string
|
||||||
|
}
|
||||||
export interface IVData {
|
export interface IVData {
|
||||||
hp: integer,
|
hp: integer,
|
||||||
atk: integer,
|
atk: integer,
|
||||||
@ -92,6 +100,25 @@ export function newDocument(name: string = "Untitled Run " + (new Date().getUTCM
|
|||||||
filename: (new Date().getUTCMonth() + 1 < 10 ? "0" : "") + (new Date().getUTCMonth() + 1) + "-" + (new Date().getUTCDate() < 10 ? "0" : "") + new Date().getUTCDate() + "-" + new Date().getUTCFullYear() + "_untitled"
|
filename: (new Date().getUTCMonth() + 1 < 10 ? "0" : "") + (new Date().getUTCMonth() + 1) + "-" + (new Date().getUTCDate() < 10 ? "0" : "") + new Date().getUTCDate() + "-" + new Date().getUTCFullYear() + "_untitled"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export function importDocument(drpd: string): DRPD {
|
||||||
|
return JSON.parse(drpd) as DRPD;
|
||||||
|
}
|
||||||
|
export function importPokemon(pokemon: any): PokeData {
|
||||||
|
return {
|
||||||
|
id: pokemon.id,
|
||||||
|
name: pokemon.name,
|
||||||
|
ability: pokemon.ability,
|
||||||
|
isHiddenAbility: pokemon.isHiddenAbility,
|
||||||
|
passiveAbility: pokemon.passiveAbility,
|
||||||
|
nature: importNature(pokemon.nature),
|
||||||
|
gender: pokemon.gender,
|
||||||
|
rarity: pokemon.rarity,
|
||||||
|
captured: pokemon.captured,
|
||||||
|
level: pokemon.level,
|
||||||
|
items: pokemon.items.map(itm => importItem(itm)),
|
||||||
|
ivs: importIVs(pokemon.ivs)
|
||||||
|
}
|
||||||
|
}
|
||||||
export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeData {
|
export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeData {
|
||||||
return {
|
return {
|
||||||
id: pokemon.species.speciesId,
|
id: pokemon.species.speciesId,
|
||||||
@ -99,7 +126,7 @@ export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeD
|
|||||||
ability: pokemon.getAbility().name,
|
ability: pokemon.getAbility().name,
|
||||||
isHiddenAbility: pokemon.hasAbility(pokemon.species.abilityHidden),
|
isHiddenAbility: pokemon.hasAbility(pokemon.species.abilityHidden),
|
||||||
passiveAbility: pokemon.getPassiveAbility().name,
|
passiveAbility: pokemon.getPassiveAbility().name,
|
||||||
nature: getNatureName(pokemon.nature),
|
nature: exportNature(pokemon.nature),
|
||||||
gender: pokemon.gender == 0 ? "Male" : (pokemon.gender == 1 ? "Female" : "Genderless"),
|
gender: pokemon.gender == 0 ? "Male" : (pokemon.gender == 1 ? "Female" : "Genderless"),
|
||||||
rarity: encounterRarity,
|
rarity: encounterRarity,
|
||||||
captured: false,
|
captured: false,
|
||||||
@ -108,6 +135,27 @@ export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeD
|
|||||||
ivs: exportIVs(pokemon.ivs)
|
ivs: exportIVs(pokemon.ivs)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export function importNature(nature: any): NatureData {
|
||||||
|
return {
|
||||||
|
name: nature.name,
|
||||||
|
increased: nature.increased,
|
||||||
|
decreased: nature.decreased
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function exportNature(nature: Nature): NatureData {
|
||||||
|
return {
|
||||||
|
name: getNatureName(nature),
|
||||||
|
increased: getNatureIncrease(nature),
|
||||||
|
decreased: getNatureDecrease(nature),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export function importItem(item: any): ItemData {
|
||||||
|
return {
|
||||||
|
id: item.id,
|
||||||
|
name: item.name,
|
||||||
|
quantity: item.quantity
|
||||||
|
}
|
||||||
|
}
|
||||||
export function exportItem(item: PokemonHeldItemModifier): ItemData {
|
export function exportItem(item: PokemonHeldItemModifier): ItemData {
|
||||||
return {
|
return {
|
||||||
id: item.type.id,
|
id: item.type.id,
|
||||||
@ -115,6 +163,16 @@ export function exportItem(item: PokemonHeldItemModifier): ItemData {
|
|||||||
quantity: item.getStackCount()
|
quantity: item.getStackCount()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
export function importIVs(ivs: any): IVData {
|
||||||
|
return {
|
||||||
|
hp: ivs[0],
|
||||||
|
atk: ivs[1],
|
||||||
|
def: ivs[2],
|
||||||
|
spatk: ivs[3],
|
||||||
|
spdef: ivs[4],
|
||||||
|
speed: ivs[5]
|
||||||
|
}
|
||||||
|
}
|
||||||
export function exportIVs(ivs: integer[]): IVData {
|
export function exportIVs(ivs: integer[]): IVData {
|
||||||
return {
|
return {
|
||||||
hp: ivs[0],
|
hp: ivs[0],
|
||||||
|
@ -342,6 +342,7 @@ export class TitlePhase extends Phase {
|
|||||||
|
|
||||||
start(): void {
|
start(): void {
|
||||||
super.start();
|
super.start();
|
||||||
|
console.log(LoggerTools.importDocument(JSON.stringify(LoggerTools.newDocument())))
|
||||||
|
|
||||||
this.scene.ui.clearText();
|
this.scene.ui.clearText();
|
||||||
this.scene.ui.fadeIn(250);
|
this.scene.ui.fadeIn(250);
|
||||||
|
Loading…
Reference in New Issue
Block a user