diff --git a/README.md b/README.md index db902e01bed..796a0bb69fd 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,11 @@ This program is for Windows - it does not have installers for Mac or Linux right (You can still do run validation without this mod, of course) ## Feature progress -- [ ] Logs all the steps you take while playing +- [x] Logs all the steps you take while playing - [x] Logs the wild Pokémon you encounter and their stats - [x] Logs the category of trainers you encounter - [x] In-Game GUI to export logs -- [ ] Show damage values for attacks (present, but incomplete) +- [x] Show damage values for attacks (present, but incomplete) - [x] Show catch rates - [x] Show attributes of wild Pokémon (max IVs, nature, abilities) diff --git a/public/images/events/september-update-pt_BR.png b/public/images/events/september-update-pt-BR.png similarity index 100% rename from public/images/events/september-update-pt_BR.png rename to public/images/events/september-update-pt-BR.png diff --git a/public/images/events/september-update-zh_CN.png b/public/images/events/september-update-zh-CN.png similarity index 100% rename from public/images/events/september-update-zh_CN.png rename to public/images/events/september-update-zh-CN.png diff --git a/src/data/biomes.ts b/src/data/biomes.ts index 721231f9cb0..0e37cc94ff5 100644 --- a/src/data/biomes.ts +++ b/src/data/biomes.ts @@ -1,6 +1,6 @@ import { Type } from "./type"; import * as Utils from "../utils"; -import {pokemonEvolutions, SpeciesFormEvolution} from "./pokemon-evolutions"; +import { pokemonEvolutions, SpeciesFormEvolution } from "./pokemon-evolutions"; import i18next from "i18next"; import { Biome } from "#enums/biome"; import { Species } from "#enums/species"; @@ -46,7 +46,7 @@ export const biomeLinks: BiomeLinks = { [Biome.SEABED]: [ Biome.CAVE, [ Biome.VOLCANO, 3 ] ], [Biome.MOUNTAIN]: [ Biome.VOLCANO, [ Biome.WASTELAND, 2 ], [ Biome.SPACE, 3 ] ], [Biome.BADLANDS]: [ Biome.DESERT, Biome.MOUNTAIN ], - [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE [ Biome.LABORATORY, 2 ] ], + [Biome.CAVE]: [ Biome.BADLANDS, Biome.LAKE, [ Biome.LABORATORY, 2 ] ], [Biome.DESERT]: [ Biome.RUINS, [ Biome.CONSTRUCTION_SITE, 2 ] ], [Biome.ICE_CAVE]: Biome.SNOWY_FOREST, [Biome.MEADOW]: [ Biome.PLAINS, Biome.FAIRY_CAVE ], diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index d40b1aeb143..21638f76955 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -945,7 +945,7 @@ export function initSpecies() { new PokemonSpecies(Species.METAPOD, 1, false, false, false, "Cocoon Pokémon", Type.BUG, null, 0.7, 9.9, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 50, 20, 55, 25, 25, 30, 120, 50, 72, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.BUTTERFREE, 1, false, false, false, "Butterfly Pokémon", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, GrowthRate.MEDIUM_FAST, 50, true, true, new PokemonForm("Normal", "", Type.BUG, Type.FLYING, 1.1, 32, Abilities.COMPOUND_EYES, Abilities.NONE, Abilities.TINTED_LENS, 395, 60, 45, 50, 90, 80, 70, 45, 50, 198, true, null, true), - new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.TINTED_LENS, Abilities.TINTED_LENS, Abilities.TINTED_LENS, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), + new PokemonForm("G-Max", SpeciesFormKey.GIGANTAMAX, Type.BUG, Type.FLYING, 17, 32, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, Abilities.COMPOUND_EYES, 495, 85, 35, 80, 120, 90, 85, 45, 50, 198, true), ), new PokemonSpecies(Species.WEEDLE, 1, false, false, false, "Hairy Bug Pokémon", Type.BUG, Type.POISON, 0.3, 3.2, Abilities.SHIELD_DUST, Abilities.NONE, Abilities.RUN_AWAY, 195, 40, 35, 30, 20, 20, 50, 255, 70, 39, GrowthRate.MEDIUM_FAST, 50, false), new PokemonSpecies(Species.KAKUNA, 1, false, false, false, "Cocoon Pokémon", Type.BUG, Type.POISON, 0.6, 10, Abilities.SHED_SKIN, Abilities.NONE, Abilities.SHED_SKIN, 205, 45, 25, 50, 25, 25, 35, 120, 70, 72, GrowthRate.MEDIUM_FAST, 50, false), diff --git a/src/loading-scene.ts b/src/loading-scene.ts index a60d789dd17..74477adac4e 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -373,7 +373,7 @@ export class LoadingScene extends SceneBase { } else { this.loadAtlas("types", ""); } - const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"]; + const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"]; if (lang && availableLangs.includes(lang)) { this.loadImage("september-update-"+lang, "events"); } else { diff --git a/src/logger.ts b/src/logger.ts index 5c7e4d01559..db7532b394f 100644 --- a/src/logger.ts +++ b/src/logger.ts @@ -55,7 +55,7 @@ SECTIONS /** The number of enemy actions to log. */ export const EnemyEventLogCount = 3 /** The current DRPD version. */ -export const DRPD_Version = "1.1.0a" +export const DRPD_Version = "1.1.0b" /** (Unused / reference only) All the log versions that this mod can keep updated. * @see updateLog */ @@ -64,6 +64,7 @@ export const acceptedVersions = [ "1.0.0a", "1.1.0", "1.1.0a", + "1.1.0b", ] // Value holders @@ -608,6 +609,18 @@ function updateLog(drpd: DRPD): DRPD { drpd.maxluck = 14 drpd.minSafeLuckFloor = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1] } // 1.1.0 → 1.1.0a + if (drpd.version == "1.1.0a") { + drpd.version = "1.1.0b" + for (var i = 0; i < drpd.waves.length; i++) { + if (drpd.waves[i] && drpd.waves[i].pokemon) { + for (var j = 0; j < drpd.waves[i].pokemon!.length; j++) { + drpd.waves[i].pokemon![j].iv_raw = drpd.waves[i].pokemon![j].ivs! + drpd.waves[i].pokemon![j].ivs = undefined + drpd.waves[i].pokemon![j].iv = formatIVs(drpd.waves[i].pokemon![j].ivs!) + } + } + } + } // 1.1.0a → 1.1.0b return drpd; } // #endregion @@ -1026,7 +1039,11 @@ export interface PokeData { /** The Pokémon's IVs. Influences its base stats. * @see IVData */ - ivs: IVData, + iv_raw: IVData, + /** The Pokémon's IVs, printed as ordered text. */ + iv: string[], + /** @deprecated */ + ivs?: IVData, /** The Pokémon that was used to generate this `PokeData`. Not exported. * @see Pokemon */ @@ -1051,7 +1068,8 @@ export function exportPokemon(pokemon: Pokemon, encounterRarity?: string): PokeD captured: false, level: pokemon.level, items: pokemon.getHeldItems().map((item, idx) => exportItem(item)), - ivs: exportIVs(pokemon.ivs) + iv_raw: exportIVs(pokemon.ivs), + iv: formatIVs(pokemon.ivs) } } /** @@ -1111,7 +1129,7 @@ function printPoke(inData: string, indent: string, pokemon: PokeData) { } } inData += ",\n" + indent + " \"ivs\": " - inData = printIV(inData, indent + " ", pokemon.ivs) + inData = printIV(inData, indent + " ", pokemon.iv_raw) //inData += ",\n" + indent + " \"rarity\": " + pokemon.rarity inData += "\n" + indent + "}" return inData; @@ -1228,6 +1246,16 @@ export function exportIVs(ivs: integer[]): IVData { speed: ivs[5] } } +export function formatIVs(ivs: integer[] | IVData): string[] { + return [ + `HP: ${Array.isArray(ivs) ? ivs[0] : ivs.hp}`, + `Attack: ${Array.isArray(ivs) ? ivs[1] : ivs.hp}`, + `Defense: ${Array.isArray(ivs) ? ivs[2] : ivs.hp}`, + `Sp. Atk: ${Array.isArray(ivs) ? ivs[3] : ivs.hp}`, + `Sp. Def: ${Array.isArray(ivs) ? ivs[4] : ivs.hp}`, + `Speed: ${Array.isArray(ivs) ? ivs[5] : ivs.hp}`, + ] +} /** * Prints a Pokemon's IV data as a string, for saving a DRPD to your device. * @param inData The data to add on to. diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index abdb2db232a..874bf6a8b46 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -33,7 +33,7 @@ const timedEvents: TimedEvent[] = [ xPosition: 19, yPosition: 115, scale: 0.30, - availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt_BR", "zh_CN"] + availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"] } ]; diff --git a/src/ui/fight-ui-handler.ts b/src/ui/fight-ui-handler.ts index ade59101ac8..6f2e9760893 100644 --- a/src/ui/fight-ui-handler.ts +++ b/src/ui/fight-ui-handler.ts @@ -8,17 +8,15 @@ import * as Utils from "../utils"; import Move, * as MoveData from "../data/move"; import i18next from "i18next"; import {Button} from "#enums/buttons"; -import Battle from "#app/battle.js"; import { Stat } from "#app/data/pokemon-stat.js"; -import { Abilities } from "#app/enums/abilities.js"; import { WeatherType } from "#app/data/weather.js"; import { Moves } from "#app/enums/moves.js"; -import { AddSecondStrikeAbAttr, AllyMoveCategoryPowerBoostAbAttr, AlwaysHitAbAttr, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreDefendAbAttrsNoApply, BattleStatMultiplierAbAttr, BlockCritAbAttr, BonusCritAbAttr, BypassBurnDamageReductionAbAttr, ConditionalCritAbAttr, DamageBoostAbAttr, FieldMoveTypePowerBoostAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentEvasionAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MoveTypeChangeAttr, MultCritAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, StabBoostAbAttr, TypeImmunityAbAttr, UserFieldMoveTypePowerBoostAbAttr, VariableMovePowerAbAttr, WonderSkinAbAttr } from "#app/data/ability.js"; +import { AddSecondStrikeAbAttr, AllyMoveCategoryPowerBoostAbAttr, AlwaysHitAbAttr, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreDefendAbAttrsNoApply, BattleStatMultiplierAbAttr, BlockCritAbAttr, BypassBurnDamageReductionAbAttr, ConditionalCritAbAttr, DamageBoostAbAttr, FieldMoveTypePowerBoostAbAttr, FieldPriorityMoveImmunityAbAttr, IgnoreOpponentEvasionAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, MultCritAbAttr, PreDefendFullHpEndureAbAttr, ReceivedMoveDamageMultiplierAbAttr, StabBoostAbAttr, TypeImmunityAbAttr, UserFieldMoveTypePowerBoostAbAttr, VariableMovePowerAbAttr, WonderSkinAbAttr } from "#app/data/ability.js"; import { ArenaTagType } from "#app/enums/arena-tag-type.js"; import { ArenaTagSide, WeakenMoveScreenTag, WeakenMoveTypeTag } from "#app/data/arena-tag.js"; -import { BattlerTagLapseType, HelpingHandTag, SemiInvulnerableTag, TypeBoostTag } from "#app/data/battler-tags.js"; +import { HelpingHandTag, SemiInvulnerableTag, TypeBoostTag } from "#app/data/battler-tags.js"; import { TerrainType } from "#app/data/terrain.js"; -import { AttackTypeBoosterModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, EnemyEndureChanceModifier, PokemonMoveAccuracyBoosterModifier, PokemonMultiHitModifier, TempBattleStatBoosterModifier } from "#app/modifier/modifier.js"; +import { AttackTypeBoosterModifier, EnemyDamageBoosterModifier, EnemyDamageReducerModifier, PokemonMoveAccuracyBoosterModifier, PokemonMultiHitModifier, TempBattleStatBoosterModifier } from "#app/modifier/modifier.js"; import { BattlerTagType } from "#app/enums/battler-tag-type.js"; import { TempBattleStat } from "#app/data/temp-battle-stat.js"; import { StatusEffect } from "#app/data/status-effect.js"; @@ -185,12 +183,11 @@ export default class FightUiHandler extends UiHandler { const typeChangeMovePowerMultiplier = new Utils.NumberHolder(1); MoveData.applyMoveAttrs(MoveData.VariableMoveTypeAttr, user, target, move); - applyPreAttackAbAttrs(MoveTypeChangeAttr, user, target, move, true, typeChangeMovePowerMultiplier); const types = target.getTypes(true, true); const cancelled = new Utils.BooleanHolder(false); const typeless = move.hasAttr(MoveData.TypelessAttr); - const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveData.MoveCategory.STATUS || move.getAttrs(MoveData.StatusMoveTypeImmunityAttr).find(attr => types.includes(attr.immuneType))) + const typeMultiplier = new Utils.NumberHolder(!typeless && (moveCategory !== MoveData.MoveCategory.STATUS) ? target.getAttackTypeEffectiveness(move.type, user, false, false) : 1); MoveData.applyMoveAttrs(MoveData.VariableMoveTypeMultiplierAttr, user, target, move, typeMultiplier); diff --git a/src/ui/menu-ui-handler.ts b/src/ui/menu-ui-handler.ts index aaf6d0a08fb..ed50f9b665a 100644 --- a/src/ui/menu-ui-handler.ts +++ b/src/ui/menu-ui-handler.ts @@ -551,6 +551,7 @@ export default class MenuUiHandler extends MessageUiHandler { break; case MenuOptions.LINKS: ui.setOverlayMode(Mode.MENU_OPTION_SELECT, this.legalLinksConfig); + break; case MenuOptions.RUN_HISTORY: ui.setOverlayMode(Mode.RUN_HISTORY); success = true;