diff --git a/asm/macros/frscrcmd.inc b/asm/macros/frscrcmd.inc index 40ff373d30..0dca7b9f50 100644 --- a/asm/macros/frscrcmd.inc +++ b/asm/macros/frscrcmd.inc @@ -352,14 +352,14 @@ .short \unused .endm - .macro FrontierScrCmd_3D destVar, value - .short FRSCRCMD_3D + .macro SetSystemVar destVar, value + .short FRSCRCMD_SETSYSTEMVAR .short \destVar .short \value .endm - .macro FrontierScrCmd_3E srcVar, destVar - .short FRSCRCMD_3E + .macro GetSystemVar srcVar, destVar + .short FRSCRCMD_GETSYSTEMVAR .short \srcVar .short \destVar .endm @@ -758,12 +758,12 @@ .short \arg1 .endm - .macro FrontierScrCmd_8B arg0, arg1, arg2, arg3 - .short FRSCRCMD_8B - .short \arg0 - .short \arg1 - .short \arg2 - .short \arg3 + .macro InitBattleHall resumingFromSave, challengeType, partySlot1, partySlot2 + .short FRSCRCMD_INITBATTLEHALL + .short \resumingFromSave + .short \challengeType + .short \partySlot1 + .short \partySlot2 .endm .macro FrontierScrCmd_8C arg0 @@ -771,8 +771,8 @@ .short \arg0 .endm - .macro FrontierScrCmd_8D - .short FRSCRCMD_8D + .macro FreeBattleHall + .short FRSCRCMD_FREEBATTLEHALL .endm .macro OpenBattleHallApp diff --git a/asm/macros/scrcmd.inc b/asm/macros/scrcmd.inc index 7a5e7ec146..3f399f473b 100644 --- a/asm/macros/scrcmd.inc +++ b/asm/macros/scrcmd.inc @@ -26,7 +26,6 @@ #include "generated/sdat.h" #include "generated/signpost_commands.h" #include "generated/signpost_types.h" -#include "generated/string_padding_mode.h" #include "generated/time_of_day.h" #include "generated/trainer_score_events.h" #include "generated/trainers.h" @@ -55,9 +54,11 @@ #include "constants/savedata/vars_flags.h" #include "constants/scrcmd.h" #include "constants/sound_volume.h" +#include "constants/string.h" #include "constants/tv_broadcast.h" #include "constants/union_room_message_types.h" #include "constants/villa_visitors.h" +#include "constants/vs_seeker.h" #include "data/scripts/scrcmd.h" #include "macros/movement.inc" @@ -1245,9 +1246,9 @@ .short SCRCMD_0C4 .endm - .macro ScrCmd_0C5 arg0 - .short SCRCMD_0C5 - .short \arg0 + .macro PlayHMCutIn slot + .short SCRCMD_PLAYHMCUTIN + .short \slot .endm .macro ChangeIntoContestAttire @@ -2673,26 +2674,26 @@ .short SCRCMD_UNUSED_1CE .endm - .macro Strength mode, checkDestVarID=0 - .short SCRCMD_STRENGTH - .byte \mode - .if \mode == 2 + .macro DoStrengthFunc func, checkDestVarID=0 + .short SCRCMD_DOSTRENGTHFUNC + .byte \func + .if \func == FIELD_MOVE_FUNC_CHECK_ACTIVE .short \checkDestVarID .endif .endm - .macro Flash mode, checkDestVarID=0 - .short SCRCMD_FLASH - .byte \mode - .if \mode == 2 + .macro DoFlashFunc func, checkDestVarID=0 + .short SCRCMD_DOFLASHFUNC + .byte \func + .if \func == FIELD_MOVE_FUNC_CHECK_ACTIVE .short \checkDestVarID .endif .endm - .macro Defog mode, checkDestVarID=0 - .short SCRCMD_DEFOG - .byte \mode - .if \mode == 2 + .macro DoDefogFunc func, checkDestVarID=0 + .short SCRCMD_DODEFOGFUNC + .byte \func + .if \func == FIELD_MOVE_FUNC_CHECK_ACTIVE .short \checkDestVarID .endif .endm @@ -2984,13 +2985,13 @@ StartEndSafariGame SAFARI_GAME_INACTIVE .endm - .macro ScrCmd_203 arg0, arg1, arg2, arg3, arg4 - .short SCRCMD_203 - .short \arg0 - .short \arg1 - .short \arg2 - .short \arg3 - .short \arg4 + .macro WarpToColosseum mapID, warpID, x, z, dir + .short SCRCMD_WARPTOCOLOSSEUM + .short \mapID + .short \warpID + .short \x + .short \z + .short \dir .endm .macro ScrCmd_204 @@ -3020,9 +3021,9 @@ .short SCRCMD_REMOVEPOKEMONPREVIEW .endm - .macro ScrCmd_20A arg0 - .short SCRCMD_20A - .short \arg0 + .macro StartVsSeeker destVar + .short SCRCMD_STARTVSSEEKER + .short \destVar .endm .macro SetMoveCodeForFacingDirection @@ -3351,9 +3352,9 @@ .short \destVar .endm - .macro ScrCmd_239 arg0 - .short SCRCMD_239 - .short \arg0 + .macro OpenBattleRegulationMenu destVar + .short SCRCMD_OPENBATTLEREGULATIONMENU + .short \destVar .endm .macro GetPartyMonFootprintType hasPrintVar, printTypeVar, partySlot @@ -3816,10 +3817,10 @@ .short \arg1 .endm - .macro ScrCmd_27D arg0, arg1 - .short SCRCMD_27D - .short \arg0 - .short \arg1 + .macro TryBufferAndUnlockRandomToughWord destVar, index + .short SCRCMD_TRYBUFFERANDUNLOCKRANDOMTOUGHWORD + .short \destVar + .short \index .endm /* Returns TRUE in destVarID if the player has bought at least 5 items at the Veilstone Department Store */ @@ -3828,9 +3829,9 @@ .short \destVarID .endm - .macro ScrCmd_27F arg0 - .short SCRCMD_27F - .short \arg0 + .macro CheckAllToughWordsUnlocked destVar + .short SCRCMD_CHECKALLTOUGHWORDSUNLOCKED + .short \destVar .endm .macro BufferVarPaddingDigits templateArg, varID, paddingMode, maxDigits @@ -4004,10 +4005,10 @@ .short \entryIndex .endm - .macro ScrCmd_29E arg0, arg1 - .short SCRCMD_29E - .short \arg0 - .short \arg1 + .macro StartDestroyObstacleAnimation obstacle, destVar + .short SCRCMD_STARTDESTROYOBSTACLEANIMATION + .short \obstacle + .short \destVar .endm .macro ScrCmd_29F arg0 @@ -4034,14 +4035,14 @@ .short \item .endm - .macro ScrCmd_2A3 arg0 - .short SCRCMD_2A3 - .short \arg0 + .macro CheckHasWiFiListValidLogin destVar + .short SCRCMD_CHECKHASWIFILISTVALIDLOGIN + .short \destVar .endm - .macro ScrCmd_2A4 arg0 - .short SCRCMD_2A4 - .short \arg0 + .macro GetWiFListValidFriendsCount destVar + .short SCRCMD_GETWIFLISTVALIDFRIENDSCOUNT + .short \destVar .endm .macro OpenPartyMenuForTrade @@ -4743,9 +4744,9 @@ .short \species .endm - .macro ScrCmd_31D arg0 - .short SCRCMD_31D - .short \arg0 + .macro TryRevertPartyPokemonForms destVar + .short SCRCMD_TRYREVERTPARTYPOKEMONFORMS + .short \destVar .endm .macro TryRevertPokemonForm partySlot, destVar @@ -4771,9 +4772,9 @@ .short SCRCMD_FINISHDISTORTIONWORLDGIRATINASHADOWEVENT .endm - .macro ScrCmd_323 arg0 - .short SCRCMD_323 - .short \arg0 + .macro CheckNoWiFiPlazaCooldown destVar + .short SCRCMD_CHECKNOWIFIPLAZACOOLDOWN + .short \destVar .endm .macro GetBattleHallRecordKeeperStats curStreakIdx, passedMilestoneIdx, nextMilestoneIdx, earnedBPIdx, nextMilestone, response diff --git a/docs/3d_rendering.md b/docs/3d_rendering.md index cfc588e684..480f9fcca0 100644 --- a/docs/3d_rendering.md +++ b/docs/3d_rendering.md @@ -74,7 +74,7 @@ This is all that needs to be done in terms of setup, now the model is ready to d ### Drawing the Model Before drawing there's a few things that should be configured on the object, one of them being the position of the model obviously. For simplicity's sake I will just set the models position to the player's position. ```c -const VecFx32 *pos = PlayerAvatar_PosVector(fieldSystem->playerAvatar); +const VecFx32 *pos = PlayerAvatar_GetPos(fieldSystem->playerAvatar); Easy3DObject_SetPosition(&giratinaObj, pos->x, pos->y, pos->z); // Make sure the model actually gets rendered diff --git a/docs/datafiles/ingame_trades.md b/docs/datafiles/ingame_trades.md new file mode 100644 index 0000000000..48115af940 --- /dev/null +++ b/docs/datafiles/ingame_trades.md @@ -0,0 +1,63 @@ +# In-Game Trade Data File Format + +This document describes the file format for in-game trade data consumed by the +`npctradeproc` build tool. Each NPC trade in the ROM is represented by a JSON +file `res/npc_trades/.json`, which contains metadata for the in-game trade +event and the received Pokémon. The fields from each of these files are mapped +onto the `NPCTradeMon` struct from `include/overlay006/npc_trade.h`. + +## Schema + +| Field | Type | Description | +| -------------------- | ------------------------- | --------------------------------------------------------------- | +| `name` | `string` | The Pokémon's nickname after the trade. | +| `otName` | `string` | The Original Trainer's name (max 7 characters). | +| `species` | `enum Species` | The species of the Pokémon being offered. | +| `hpIV` | `u8` (0–31) | HP Individual Value (stored in 5 bits). | +| `atkIV` | `u8` (0–31) | Attack Individual Value (stored in 5 bits). | +| `defIV` | `u8` (0–31) | Defense Individual Value (stored in 5 bits). | +| `speedIV` | `u8` (0–31) | Speed Individual Value (stored in 5 bits). | +| `spAtkIV` | `u8` (0–31) | Special Attack Individual Value (stored in 5 bits). | +| `spDefIV` | `u8` (0–31) | Special Defense Individual Value (stored in 5 bits). | +| `unused1` | `u32` | Unused field. Present in the retail ROM. | +| `otID` | `u32` | The Original Trainer's ID number. | +| `cool` | `u32` | Cool contest condition value. | +| `beauty` | `u32` | Beauty contest condition value. | +| `cute` | `u32` | Cute contest condition value. | +| `smart` | `u32` | Smart contest condition value. | +| `tough` | `u32` | Tough contest condition value. | +| `personality` | `u32` | Personality value, which determines gender, ability, and nature.| +| `heldItem` | `enum Item` | The item held by the Pokémon. | +| `otGender` | `enum Gender` | The gender of the Original Trainer. | +| `unused2` | `u32` | Unused field. Present in the retail ROM. | +| `language` | `enum Language` | The language of the Original Trainer. | +| `requestedSpecies` | `enum Species` | The species required in exchange for the trade. | + +## Example + +```json +{ + "name": "Kazza", + "otName": "Hilary", + "species": "SPECIES_ABRA", + "hpIV": 15, + "atkIV": 15, + "defIV": 15, + "speedIV": 20, + "spAtkIV": 25, + "spDefIV": 25, + "unused1": 28, + "otID": 25643, + "cool": 0, + "beauty": 0, + "cute": 0, + "smart": 0, + "tough": 0, + "personality": 142, + "heldItem": "ITEM_ORAN_BERRY", + "otGender": "GENDER_FEMALE", + "unused2": 0, + "language": "LANGUAGE_ENGLISH", + "requestedSpecies": "SPECIES_MACHOP" +} +``` diff --git a/docs/datafiles/items.md b/docs/datafiles/items.md new file mode 100644 index 0000000000..1c853ed0c6 --- /dev/null +++ b/docs/datafiles/items.md @@ -0,0 +1,166 @@ +# Item Data File Format + +This document describes the file format for item data consumed by the `itemproc` +build tool. Each item in the ROM is represented by a JSON file +`res/items/data/.json`. Fields from each of these files are mapped onto +the `ItemData` struct from `include/item.h` and the `BerryData` struct from +`include/berry_data.h`. + +Bogus items in the retail ROM—those with the `ITEM_UNUSED_` prefix—do not have +corresponding JSON files. They are assigned placeholder text in the output, but +they do not produce a data entry. + +## Schema + +| Field | Type | Description | +| -------------------- | ------------------------------ | ---------------------------------------------------------------------------------------------- | +| `name` | `string` | The item's display name (singular). | +| `plural` | `string` | The item's display name (plural). | +| `article` | `string` | Indefinite article (e.g. "a", "an") for in-game text. | +| `description` | `string[]` | The item's description, as an array of lines. | +| `icon` | `object` | References to the item's icon graphics. See below. | +| `gbaID` | `string` | The corresponding Gen-III item identifier, or `GBA_ITEM_NONE` for Gen-IV items. | +| `price` | `u16` | Base price in Pokédollars paid when purchasing from a shop. `0` means the item cannot be sold. | +| `effectParam` | `u8` | Generic parameter; semantics vary by item type (e.g., heal amount). | +| `holdEffect` | `enum ItemHoldEffect` | Effect when held by a Pokémon. | +| `pluckEffect` | `define PLUCK_EFFECT` | Effect when consumed by Bug Bite / Pluck. | +| `flingEffect` | `define FLING_EFFECT` | Effect when used with Fling. | +| `flingPower` | `u8` | Base power of Fling when this item is flung. | +| `naturalGiftPower` | `u8` | Base power of Natural Gift when this item is held. 0 if not a berry. | +| `naturalGiftType` | `enum PokemonType` or `null` | Type of Natural Gift when this item is held. `null` if not a berry. | +| `preventToss` | `bool` | If `true`, then the item cannot be tossed or sold. | +| `canRegister` | `bool` | If `true`, then the item can be registered to the `Y` button. | +| `fieldPocket` | `define POCKET` | The Bag pocket the item belongs to (Items, Medicine, etc.). | +| `battlePocket` | `define BATTLE_POCKET_MASK` | The battle pocket mask for use during battle. | +| `fieldUseFunc` | `define ITEM_USE_FUNC` | The field-use function invoked from the overworld. | +| `battleUseFunc` | `u8` | The battle-use function invoked from the battle menu. | +| `itemUseParams` | `object` or `null` | Detailed usage parameters. See below. | +| `teachesMove` | `enum Move` | The move taught by this TM or HM (only for TMs/HMs). | +| `berryData` | `object` | Berry growth and flavor data (only for berries). See below. | + +### The `icon` Object + +| Field | Type | Description | +| --------- | -------- | ---------------------------------------------------- | +| `sprite` | `string` | Name of the NCGR sprite resource for the item icon. | +| `palette` | `string` | Name of the NCLR palette resource for the item icon. | + +These fields map to the in-game files produced from the inputs in +`res/items/icons`. + +### The `itemUseParams` Object + +This object defines the parameters for items that act on a Pokémon in the party +or in battle. All fields are optional and default to `0` or `false`. + +| Field | Type | Description | +| ------------------- | ------- | ---------------------------------------------------------------- | +| `healSleep` | `bool` | Cures sleep. | +| `healPoison` | `bool` | Cures poison. | +| `healBurn` | `bool` | Cures burn. | +| `healFreeze` | `bool` | Cures freeze. | +| `healParalysis` | `bool` | Cures paralysis. | +| `healConfusion` | `bool` | Cures confusion. | +| `healAttract` | `bool` | Cures infatuation. | +| `guardSpec` | `bool` | Temporarily protects from stat reduction. | +| `revive` | `bool` | Revives a fainted Pokémon. | +| `reviveAll` | `bool` | Revives all fainted Pokémon. | +| `levelUp` | `bool` | Increases the Pokémon's level by one. | +| `ppUp` | `bool` | Increases a move's PP. | +| `ppMax` | `bool` | Maximizes a move's PP. | +| `restorePPAllMoves` | `bool` | Restores PP to all moves. | +| `atkStages` | `u8` | Attack stage change (0–4). | +| `defStages` | `u8` | Defense stage change (0–4). | +| `spatkStages` | `u8` | Special Attack stage change (0–4). | +| `spdefStages` | `u8` | Special Defense stage change (0–4). | +| `speedStages` | `u8` | Speed stage change (0–4). | +| `accStages` | `u8` | Accuracy stage change (0–4). | +| `critStages` | `u8` | Critical-hit ratio stage change (0–2). | +| `hpRestored` | `s8` | HP restored. Use `-1` for 100%, `-2` for 50%, or `-3` for 25%. | +| `ppRestored` | `s8` | PP restored. Use `-1` for 100%. | +| `hpEVs` | `s8` | HP EVs gained. | +| `atkEVs` | `s8` | Attack EVs gained. | +| `defEVs` | `s8` | Defense EVs gained. | +| `speedEVs` | `s8` | Speed EVs gained. | +| `spatkEVs` | `s8` | Special Attack EVs gained. | +| `spdefEVs` | `s8` | Special Defense EVs gained. | +| `friendshipLow` | `s8` | Friendship change when friendship < 100. | +| `friendshipMed` | `s8` | Friendship change when 100 ≤ friendship < 200. | +| `friendshipHigh` | `s8` | Friendship change when friendship ≥ 200. | + +When `fieldUseFunc` is set to `ITEM_USE_FUNC_BERRY`, `ITEM_USE_FUNC_EVO_STONE`, +`ITEM_USE_FUNC_HEALING`, or any other use function that acts on a party Pokémon, +this object is optional but will be used if present. + +### The `berryData` Object + +| Field | Type | Description | +| ------------------- | ---------------------- | ------------------------------------------------------ | +| `size` | `u16` | Size of the berry in millimeters. | +| `firmness` | `define FIRMNESS` | Firmness category (Very Soft through Super Hard). | +| `baseYield` | `u8` | Base yield per plant. | +| `stageDuration` | `u8` | Number of stages to grow. | +| `moistureDrainRate` | `u8` | How quickly moisture drains. | +| `spiciness` | `u8` | Spicy flavor value. | +| `dryness` | `u8` | Dry flavor value. | +| `sweetness` | `u8` | Sweet flavor value. | +| `bitterness` | `u8` | Bitter flavor value. | +| `sourness` | `u8` | Sour flavor value. | +| `smoothness` | `u8` | Smoothness for Poffin cooking. | + +This field is only recognized when `fieldUseFunc` is `ITEM_USE_FUNC_BERRY`. + +## Outputs + +The tool produces the following outputs: + +| Output | Description | +| ------------------------------- | -------------------------------------------------------------------- | +| `pl_item_data.narc` | `ItemData` entries for every item, packed by index ID. | +| `item_id_map.h` | Maps item IDs to data index, icon resource, palette, and Gen-III ID. | +| `item_tm_move_map.h` | Maps TM indices to the move they teach. | +| `item_berry_list.h` | Lists all berry items by their berry index. | +| `item_mail_list.h` | Lists all mail items by their mail type index. | +| `item_names.json` | Text bank for singular item names. | +| `item_names_plural.json` | Text bank for plural item names. | +| `item_names_with_articles.json` | Text bank for item names with their indefinite article. | +| `item_descriptions.json` | Text bank for item descriptions. | +| `hidden_item_scripts.h` | Generated header mapping hidden item script IDs to script entries. | +| `nuts_data.narc` | `BerryData` entries for each in-game berry. | + +## Example + +```json +{ + "name": "Potion", + "plural": "Potions", + "article": "a", + "description": [ + "A spray-type medicine for wounds.\n", + "It restores the HP of one Pokémon by\n", + "just 20 points." + ], + "icon": { + "sprite": "potion_NCGR", + "palette": "potion_NCLR" + }, + "gbaID": "GBA_ITEM_POTION", + "price": 300, + "effectParam": 20, + "holdEffect": "HOLD_EFFECT_NONE", + "pluckEffect": "PLUCK_EFFECT_NONE", + "flingEffect": "FLING_EFFECT_NONE", + "flingPower": 30, + "naturalGiftPower": 0, + "naturalGiftType": null, + "preventToss": false, + "canRegister": false, + "fieldPocket": "POCKET_MEDICINE", + "battlePocket": "BATTLE_POCKET_MASK_RECOVER_HP", + "fieldUseFunc": "ITEM_USE_FUNC_HEALING", + "battleUseFunc": 2, + "itemUseParams": { + "hpRestored": 20 + } +} +``` diff --git a/docs/datafiles/pokemon.md b/docs/datafiles/pokemon.md new file mode 100644 index 0000000000..d81a941276 --- /dev/null +++ b/docs/datafiles/pokemon.md @@ -0,0 +1,361 @@ +# Pokémon Data File Format + +This document describes the file format for Pokémon species data consumed by the +`speciesproc` build tool. Each species in the ROM is represented by a directory +`res/pokemon/` which must contain the following files: + +| File | Purpose | +| ------------------ | -------------------------------------------------------------- | +| `data.json` | Internal metadata (stats, types, learnsets, evolutions, etc.) | +| `sprite_data.json` | Sprite offset, shadow, and animation data (National Dex only) | + +Some alternate forms have their own input data due to differing base stats, +types, or abilities. In the retail ROM, this includes forms for: + +1. Deoxys +2. Wormadam +3. Shaymin +4. Giratina +5. Rotom + +Each such form has a corresponding subdirectory under their species parent, e.g. +`giratina/forms/origin`. These forms have a similar `data.json` file, but they +do not have a `sprite_data.json` file. + +## `data.json` — Internal Metadata + +The JSON fields from this file map onto the `SpeciesData`, `SpeciesEvolution`, +`SpeciesLearnset`, and `SpeciesPalPark` structs from +`include/struct_defs/species.h`. + +### Schema + +| Field | Type | Description | +| ------------------- | -------------------- | ----------------------------------------------------------------------------------------------- | +| `base_stats` | `object` | Base stat values (HP, Attack, Defense, Speed, Sp. Atk, Sp. Def). | +| `types` | `enum PokemonType[]` | The species' primary and secondary types (2 elements). | +| `catch_rate` | `u8` | Catch rate (0–255). | +| `base_exp_reward` | `u8` | Base experience yield on defeat. | +| `ev_yields` | `object` | EV yield values (2-bit each) for each stat. | +| `held_items.common` | `enum Item` | The common wild held item (20%). | +| `held_items.rare` | `enum Item` | The rare wild held item (5%). | +| `gender_ratio` | `enum GenderRatio` | Gender ratio of the species. | +| `hatch_cycles` | `u8` | Number of hatch cycles (255 x cycle length). | +| `base_friendship` | `u8` | Base friendship level. | +| `exp_rate` | `enum ExpRate` | Level-up experience curve. | +| `egg_groups` | `enum EggGroup[]` | Egg groups for breeding (2 elements). | +| `abilities` | `enum Ability[]` | Slot 1 and slot 2 abilities (2 elements). | +| `safari_flee_rate` | `u8` | Safari Zone flee rate. | +| `body_color` | `enum PokemonColor` | Pokédex body color. | +| `flip_sprite` | `bool` | Whether the in-battle sprite should be flipped horizontally in menus (like the summary screen). | +| `icon_palette` | `u8` or `array` | Icon palette index; array of `[form_name, index]` tuples for species with per-form palettes. | +| `learnset` | `object` | Learnset data (level-up, TM/HM, tutor, egg moves). See below. | +| `evolutions` | `array` | Evolution methods and targets. | +| `offspring` | `enum Species` | The species produced when breeding (usually self). | +| `footprint` | `object` | Footprint data for the Pokédex. | +| `pokedex_data` | `object` | Pokédex entry text, height, weight, body shape, and sprite scales/positions. | +| `catching_show` | `object` | Pal Park encounter data. | + +#### The `learnset` Object + +| Field | Type | Description | +| ---------- | ------------- | ------------------------------------------------------------------------- | +| `by_level` | `array` | Level-up learnset: array of `[level, move]` tuples. | +| `by_tm` | `string[]` | TM/HM compatibility: array of TM or HM markers (e.g. `"TM01"`, `"HM04"`). | +| `by_tutor` | `enum Move[]` | Moves teachable by move tutors. | +| `egg_moves`| `enum Move[]` | Moves available as egg moves (optional). | + +If a move listed in the `by_tutor` array is not teachable by any move tutor in +the game, then a warning will be emitted, and that move will be skipped. + +No validation is performed against `egg_moves` due to the potential cost of +analyzing every other member of each egg group. + +#### The `evolutions` Array + +Each element is a tuple describing one evolution path: + +| Index | Type | Description | +| ----- | ---------------------- | ---------------------------------------------------------------------- | +| 0 | `enum EvolutionMethod` | The evolution method (level, trade, item, etc.) | +| 1 | varies | The parameter for the method (level, item, move, species, or nothing). | +| 2 | `enum Species` | The target species to evolve into. | + +The parameter type depends on the method: + +- For `EVO_LEVEL`, `EVO_LEVEL_ATK_GT_DEF`, etc., it is the level at which the + evolution should trigger. +- For `EVO_USE_ITEM`, `EVO_TRADE_WITH_HELD_ITEM`, etc., it is the `enum Item` + required to be held or used to trigger the evolution. +- For `EVO_LEVEL_KNOW_MOVE`, it is an `enum Move` which must be known for the + next level-up to trigger the evolution. +- For `EVO_LEVEL_SPECIES_IN_PARTY`, it is an `enum Species` which must be + present in the party for the next level-up to trigger the evolution. +- For `EVO_NONE`, `EVO_LEVEL_HAPPINESS`, `EVO_TRADE`, there is no listed + parameter, and the evolution only has two elements: `[method, species]`. + +#### The `footprint` Object + +| Field | Type | Description | +| ------ | ----------------------- | --------------------------------------------------- | +| `has` | `bool` | Whether the species has a footprint in the Pokédex. | +| `size` | `enum FootprintSize` | The relative size of the footprint. | +| `type` | `define FOOTPRINT_TYPE` | The footprint type (e.g. Cute, Scary, etc.). | + +#### The `pokedex_data` Object + +Height and weight may be specified in either metric or imperial units, but not +both. + +| Field | Type | Description | +| ------------------ | ----------------------- | -------------------------------------------------------- | +| `height_meters` | `float` | Height in meters (alternative to `height_inches`). | +| `height_inches` | `u32` | Height in inches (alternative to `height_meters`). | +| `weight_kilograms` | `float` | Weight in kilograms (alternative to `weight_pounds`). | +| `weight_pounds` | `float` | Weight in pounds (alternative to `weight_kilograms`). | +| `body_shape` | `enum PokemonBodyShape` | Pokédex body shape category. | +| `trainer_scale_f` | `u16` | Trainer back-sprite scale (female). | +| `pokemon_scale_f` | `u16` | Pokémon front-sprite scale (female). | +| `trainer_scale_m` | `u16` | Trainer back-sprite scale (male). | +| `pokemon_scale_m` | `u16` | Pokémon front-sprite scale (male). | +| `trainer_pos_f` | `u16` | Trainer back-sprite Y-position offset (female). | +| `pokemon_pos_f` | `u16` | Pokémon front-sprite Y-position offset (female). | +| `trainer_pos_m` | `u16` | Trainer back-sprite Y-position offset (male). | +| `pokemon_pos_m` | `u16` | Pokémon front-sprite Y-position offset (male). | +| `origin_forme` | `object` | Alternate-forme Pokédex data (Giratina only). See below. | +| `en`, `fr`, `etc.` | `object` | Localized Pokédex data. See below. | + +The `origin_forme` sub-object uses the same schema as the top-level +`pokedex_data` (height, weight, body shape, scales, and positions) and is only +present for Giratina to support its Origin Forme. + +Each language sub-object has the following fields: + +| Field | Type | Description | +| ------------ | ---------- | --------------------------------------------- | +| `name` | `string` | The species name in that language. | +| `category` | `string` | The species category (e.g. "Lizard Pokémon"). | +| `entry_text` | `string[]` | The Pokédex entry text, as an array of lines. | + +#### The `catching_show` Object + +| Field | Type | Description | +| --------------------- | ----------------------- | ---------------------------------------- | +| `pal_park_land_area` | `enum PalParkLandArea` | Pal Park land area assignment. | +| `pal_park_water_area` | `enum PalParkWaterArea` | Pal Park water area assignment. | +| `catching_points` | `u8` | Catching show points awarded. | +| `rarity` | `u8` | Rarity score for the catching show. | +| `unused` | `u16` | Unused field. Present in the retail ROM. | + +## `sprite_data.json` — Sprite Offsets and Animation Data + +This file is only processed for species present in the National Pokédex (that +is, those with an ID less than `SPECIES_EGG`) and defines the battle sprite +layout and some animation parameters. + +| Field | Type | Description | +| -------- | -------- | ---------------------------------------------- | +| `front` | `object` | Front-face sprite animation and Y-offset data. | +| `back` | `object` | Back-face sprite animation and Y-offset data. | +| `shadow` | `object` | Shadow sprite position and size. | + +### The `front` and `back` Objects + +| Field | Type | Description | +| --------------- | ---------- | -------------------------------------------------------- | +| `y_offset` | `object` | Per-gender Y-offsets for the sprite (`male` / `female`). | +| `addl_y_offset` | `s8` | Additional Y-offset (front only). | +| `animation` | `u8` | Pre-programmed animation sequence ID. | +| `cry_delay` | `u8` | Frames to wait before playing the cry. | +| `start_delay` | `u8` | Frames to wait before starting the animation. | +| `frames` | `object[]` | Array of animation frame definitions (up to 10 frames). | + +#### The `frame` Objects + +| Field | Type | Description | +| -------------- | ---- | ------------------------------------- | +| `sprite_frame` | `s8` | Sprite frame index (`-1` = no frame). | +| `frame_delay` | `u8` | Duration of this frame in ticks. | +| `x_shift` | `s8` | Horizontal shift for this frame. | +| `y_shift` | `s8` | Vertical shift for this frame. | + +### The `shadow` Object + +| Field | Type | Description | +| ---------- | ----------------- | --------------------------------------- | +| `x_offset` | `s8` | Horizontal offset of the shadow sprite. | +| `size` | `enum ShadowSize` | Size category of the shadow sprite. | + +### Outputs + +The tool produces the following outputs: + +| Output | Description | +| ---------------------------------------- | ----------------------------------------------------------------- | +| `pl_personal.narc` | `SpeciesData` entries for every species and alternate form. | +| `evo.narc` | `SpeciesEvolution` entries. | +| `wotbl.narc` | Level-up learnset entries for every species. | +| `height.narc` | Per-gender sprite Y-offsets (4 files per National Dex species). | +| `pl_poke_data.narc` | `SpeciesSpriteData` for all National Dex species. | +| `ppark.narc` | `SpeciesPalPark` data for all National Dex species. | +| `pms.narc` | Offspring species map (breeding species resolution). | +| `zukan_data(_gira).narc` | Data for the sorted Pokédex indices (by height, by weight, etc.). | +| `tutorable_moves.h` | Move tutor definitions and costs. | +| `species_learnsets_by_tutor.h` | Bitmask of tutorable moves per species. | +| `species_egg_moves.h` | Egg move lists per species. | +| `species_footprint_sizes.h` | Footprint size per species. | +| `species_footprint_types.h` | Footprint type per species. | +| `species_icon_palettes.h` | Icon palette index per species. | +| `species_name.json` | Text bank for species names. | +| `species_name_with_articles.json` | Text bank for species names with indefinite articles. | +| `species_pokedex_entry_*.json` | Text banks for Pokédex entries in 6 languages. | +| `species_name_with_natdex_number_*.json` | Text banks for species names with National Dex numbers. | +| `species_category*.json` | Text banks for species categories. | +| `species_weight*.json` | Text banks for Pokédex weight display. | +| `species_height*.json` | Text banks for Pokédex height display. | + +### Example + +```json +{ + "base_stats": { + "hp": 39, + "attack": 52, + "defense": 43, + "speed": 65, + "special_attack": 60, + "special_defense": 50 + }, + "types": [ "TYPE_FIRE", "TYPE_FIRE" ], + "catch_rate": 45, + "base_exp_reward": 65, + "ev_yields": { + "hp": 0, + "attack": 0, + "defense": 0, + "speed": 1, + "special_attack": 0, + "special_defense": 0 + }, + "held_items": { + "common": "ITEM_NONE", + "rare": "ITEM_NONE" + }, + "gender_ratio": "GENDER_RATIO_FEMALE_12_5", + "hatch_cycles": 20, + "base_friendship": 70, + "exp_rate": "EXP_RATE_MEDIUM_SLOW", + "egg_groups": [ "EGG_GROUP_MONSTER", "EGG_GROUP_DRAGON" ], + "abilities": [ "ABILITY_BLAZE", "ABILITY_NONE" ], + "safari_flee_rate": 0, + "body_color": "MON_COLOR_RED", + "flip_sprite": false, + "icon_palette": 0, + "learnset": { + "by_level": [ + [ 1, "MOVE_SCRATCH" ], + [ 1, "MOVE_GROWL" ], + [ 7, "MOVE_EMBER" ], + [ 10, "MOVE_SMOKE_SCREEN" ], + [ 16, "MOVE_DRAGON_RAGE" ] + ], + "by_tm": [ + "TM01", "TM02", "TM06", "TM10", + "HM01", "HM04", "HM06" + ], + "by_tutor": [ + "MOVE_MUD_SLAP", + "MOVE_FIRE_PUNCH", + "MOVE_SNORE" + ], + "egg_moves": [ + "MOVE_BELLY_DRUM", + "MOVE_OUTRAGE", + "MOVE_DRAGON_DANCE" + ] + }, + "evolutions": [ + [ "EVO_LEVEL", 16, "SPECIES_CHARMELEON" ] + ], + "offspring": "SPECIES_CHARMANDER", + "footprint": { + "has": true, + "size": "FOOTPRINT_MEDIUM", + "type": "FOOTPRINT_TYPE_CUTE" + }, + "pokedex_data": { + "height_inches": 24, + "weight_pounds": 18.7, + "body_shape": "SHAPE_BIPEDAL_TAILED", + "trainer_scale_f": 272, + "pokemon_scale_f": 384, + "trainer_scale_m": 256, + "pokemon_scale_m": 384, + "trainer_pos_f": 8, + "pokemon_pos_f": 23, + "trainer_pos_m": 9, + "pokemon_pos_m": 23, + "en": { + "name": "CHARMANDER", + "category": "Lizard Pokémon", + "entry_text": [ + "The fire on the tip of its tail is a\n", + "measure of its life. If healthy,\n", + "its tail burns intensely." + ] + }, + "fr": { + "name": "SALAMECHE", + "category": "Pokémon Lézard", + "entry_text": [ + "La flamme de sa queue symbolise sa\n", + "vitalité. Elle est intense quand il\n", + "est en bonne santé." + ] + }, + "de": { + "name": "GLUMANDA", + "category": "Echse", + "entry_text": [ + "Lodert die Flamme auf seiner\n", + "Schweifspitze hell, ist GLUMANDA\n", + "gesund." + ] + }, + "it": { + "name": "CHARMANDER", + "category": "Pokémon Lucertola", + "entry_text": [ + "La fiamma sulla punta della coda\n", + "indica la sua vitalità. Se sta bene,\n", + "la fiamma è più ardente." + ] + }, + "es": { + "name": "CHARMANDER", + "category": "Pokémon Lagartija", + "entry_text": [ + "La llama de la punta de su cola\n", + "indica su salud. Si CHARMANDER\n", + "está sano, arderá con más fuerza." + ] + }, + "jp": { + "name": "ヒトカゲ", + "category": "とかげポケモン", + "entry_text": [ + "ヒトカゲの しっぽの ほのおは\n", + "いのちの ともしび。げんきな ときは\n", + "ほのおも ちからづよく もえあがる。" + ] + } + }, + "catching_show": { + "pal_park_land_area": "PAL_PARK_AREA_LAND_SOUTH_WEST", + "pal_park_water_area": "PAL_PARK_AREA_WATER_NONE", + "catching_points": 50, + "rarity": 30, + "unused": 514 + } +} +``` diff --git a/docs/datafiles/trainers.md b/docs/datafiles/trainers.md new file mode 100644 index 0000000000..2957d9212a --- /dev/null +++ b/docs/datafiles/trainers.md @@ -0,0 +1,231 @@ +# Trainer Data File Format + +This document describes the file format for trainer data consumed by the +`trainerproc` build tool. Each trainer in the ROM is represented by a JSON file +`res/trainers/data/.json`, which contains metadata for the trainer and +their party. The fields from each of these files are mapped onto the structs +defined in `include/struct_defs/trainer_data.h`. + +## Top-Level Schema + +| Field | Type | Description | +| --------------- | ----------------------------- | ---------------------------------------------------------------- | +| `name` | `string` | The trainer's display name. | +| `class` | `enum TrainerClass` | The trainer class, e.g. Youngster, Ace Trainer, Gym Leader. | +| `items` | `enum Item[]` | Items usable by the trainer in battle (up to 4). May be empty. | +| `ai_flags` | `enum AIFlag[]` | AI behavior flags for battle scripts. May be empty. | +| `double_battle` | `bool` | Whether this is a double battle. | +| `party` | `object[]` | The trainer's party of Pokémon. See below for the member schema. | +| `messages` | `object[]` | Dialogue messages. See the Messages section below. | + +## Party Member Schema + +Each element of the `party` array represents a Pokémon owned by the trainer. + +| Field | Type | Description | +| ------------ | ----------------------- | ----------------------------------------------------------------- | +| `species` | `enum Species` | The species of the Pokémon. | +| `form` | `u8` | Form index, packed into the high bits of the species field. | +| `level` | `u16` | The level of the Pokémon. | +| `item` | `enum Item` or `null` | The held item, or `null` for none. | +| `moves` | `enum Move[]` or `null` | Known moves (up to 4), or `null` for default level-up moves. | +| `iv_scale` | `u16` | IV scaling factor (0–255). | +| `ball_seal` | `u16` | Ball seal / capsule decoration index. | + +The presence of the `item` and `moves` fields determines the exact structure of +the output data, which affects the trainer's party in-game. If any Pokémon in +the party specifies that it can have a held item or a custom move-set, then all +other Pokémon in the party must *also* specify as much. + +To illustrate, this party is valid: + +```json +{ + "party": [ + { + "species": "SPECIES_STARLY", + "form": 0, + "level": 7, + "item": null, + "moves": [ + "MOVE_QUICK_ATTACK", + "MOVE_GROWL" + ], + "iv_scale": 30, + "ball_seal": 0 + }, + { + "species": "SPECIES_CHIMCHAR", + "form": 0, + "level": 9, + "item": null, + "moves": [ + "MOVE_SCRATCH", + "MOVE_LEER" + ], + "iv_scale": 30, + "ball_seal": 0 + } + ] +} +``` + +However, this party is *not* valid, as Chimchar specifies that it has data for +its held-item, while Starly does not: + +```json +{ + "party": [ + { + "species": "SPECIES_STARLY", + "form": 0, + "level": 7, + "item": null, + "moves": [ + "MOVE_QUICK_ATTACK", + "MOVE_GROWL" + ], + "iv_scale": 30, + "ball_seal": 0 + }, + { + "species": "SPECIES_CHIMCHAR", + "form": 0, + "level": 9, + "item": "ITEM_ORAN_BERRY", + "moves": [ + "MOVE_SCRATCH", + "MOVE_LEER" + ], + "iv_scale": 30, + "ball_seal": 0 + } + ], +} +``` + +Similarly, this party would also be invalid, as Starly declares that it should +derive its move-set from the moves that it learns by level-up, while Chimchar +declares that it has a custom move-set: + +```json +{ + "party": [ + { + "species": "SPECIES_STARLY", + "form": 0, + "level": 7, + "item": null, + "moves": null, + "iv_scale": 30, + "ball_seal": 0 + }, + { + "species": "SPECIES_CHIMCHAR", + "form": 0, + "level": 9, + "item": null, + "moves": [ + "MOVE_SCRATCH", + "MOVE_LEER" + ], + "iv_scale": 30, + "ball_seal": 0 + } + ], +} +``` + +## Messages + +The `messages` array defines dialogue that the trainer may speak at various +points during a battle. Each entry has a `type` field drawn from +`enum TrainerMessageType` (e.g. `TRMSG_PRE_BATTLE`, `TRMSG_DEFEAT`, +`TRMSG_POST_BATTLE`, `TRMSG_REMATCH`) and an `en_US` field containing the +message text. As with the text-files stored in `res/text`, the content may be +a single string or an array of strings as a convenience for multi-line messages. +Entries with the `garbage` key in place of `en_US` represent padding present in +the retail ROM. + +## Outputs + +The tool produces the following outputs: + +| Output | Description | +| --------------------------- | -------------------------------------------------------------- | +| `trdata.narc` | `TrainerHeader` entries for every trainer, packed by index ID. | +| `trpoke.narc` | Party data for every trainer, packed by index ID. | +| `trainer_scripts.h` | Generated header mapping trainer IDs to `ScriptEntry` macros. | +| `npc_trainer_names.json` | Text bank for trainer display names. | +| `npc_trainer_messages.json` | Text bank for in-battle trainer dialogue. | +| `trtbl.narc` | Message lookup table mapping `(trainerID, messageType)` pairs. | +| `trtblofs.narc` | Offset table into `trtbl.narc` for each trainer index. | + +## Example + +```json +{ + "name": "Catherine", + "class": "TRAINER_CLASS_ACE_TRAINER_FEMALE", + "items": [], + "ai_flags": [ + "AI_FLAG_BASIC", + "AI_FLAG_EVAL_ATTACK", + "AI_FLAG_EXPERT" + ], + "double_battle": false, + "party": [ + { + "species": "SPECIES_HAUNTER", + "form": 0, + "level": 23, + "item": null, + "moves": [ + "MOVE_NIGHT_SHADE", + "MOVE_CONFUSE_RAY", + "MOVE_SUCKER_PUNCH", + "MOVE_CURSE" + ], + "iv_scale": 60, + "ball_seal": 0 + }, + { + "species": "SPECIES_MISDREAVUS", + "form": 0, + "level": 24, + "item": null, + "moves": [ + "MOVE_PSYBEAM", + "MOVE_PAIN_SPLIT", + "MOVE_CONFUSE_RAY", + "MOVE_SPITE" + ], + "iv_scale": 60, + "ball_seal": 0 + } + ], + "messages": [ + { + "type": "TRMSG_PRE_BATTLE", + "en_US": [ + "What does it feel like, taking one step\n", + "after another into darkness?\r" + ] + }, + { + "type": "TRMSG_DEFEAT", + "en_US": [ + "You’re the kind of person who can keep\n", + "going forward even into the unknown.\n" + ] + }, + { + "type": "TRMSG_POST_BATTLE", + "en_US": [ + "I think, sometimes, one has to make\n", + "mistakes to learn what is right.\n" + ] + } + ] +} +``` diff --git a/docs/index.md b/docs/index.md index ee19a82350..a325c44905 100644 --- a/docs/index.md +++ b/docs/index.md @@ -15,6 +15,10 @@ For more detailed information about the project as a whole, please refer to its ## Working with Files for Various Data Types - [Overview of the Processing Tools](datafiles/overview.md) +- [Pokémon Species](datafiles/pokemon.md) +- [In-Game Trainers](datafiles/trainers.md) +- [In-Game Trades](datafiles/trainers.md) +- [Items](datafiles/items.md) - [Moves](datafiles/moves.md) ## Subsystems diff --git a/generated/map_headers.txt b/generated/map_headers.txt index 9abcbe2f9f..b389d7a440 100644 --- a/generated/map_headers.txt +++ b/generated/map_headers.txt @@ -3,7 +3,7 @@ MAP_HEADER_NOTHING MAP_HEADER_UNDERGROUND MAP_HEADER_JUBILIFE_CITY MAP_HEADER_JUBILIFE_CITY_MART -MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_1 +MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_1 MAP_HEADER_JUBILIFE_CITY_POKECENTER_1F MAP_HEADER_JUBILIFE_CITY_POKECENTER_2F MAP_HEADER_POKETCH_CO_1F @@ -21,7 +21,7 @@ MAP_HEADER_JUBILIFE_CITY_SOUTH_HOUSE_1F MAP_HEADER_JUBILIFE_CITY_SOUTH_HOUSE_2F MAP_HEADER_JUBILIFE_CITY_SOUTH_HOUSE_3F MAP_HEADER_JUBILIFE_CITY_SOUTH_HOUSE_4F -MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_2 +MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_2 MAP_HEADER_JUBILIFE_CITY_CONDOMINIUMS_1F MAP_HEADER_JUBILIFE_CITY_CONDOMINIUMS_2F MAP_HEADER_JUBILIFE_CITY_CONDOMINIUMS_3F @@ -29,8 +29,8 @@ MAP_HEADER_JUBILIFE_CITY_CONDOMINIUMS_4F MAP_HEADER_GLOBAL_TERMINAL_1F MAP_HEADER_TRAINERS_SCHOOL MAP_HEADER_JUBILIFE_CITY_SOUTHWEST_HOUSE_1F -MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_3 -MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_4 +MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_3 +MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_4 MAP_HEADER_CANALAVE_CITY MAP_HEADER_CANALAVE_CITY_MART MAP_HEADER_CANALAVE_CITY_GYM @@ -83,7 +83,7 @@ MAP_HEADER_ETERNA_CITY_HERB_SHOP MAP_HEADER_ETERNA_CITY_SOUTH_HOUSE MAP_HEADER_ETERNA_CITY_EAST_HOUSE MAP_HEADER_ETERNA_CITY_UNDERGROUND_MAN_HOUSE -MAP_HEADER_ETERNA_CITY_UNKNOWN_HOUSE +MAP_HEADER_UNUSED_ETERNA_CITY_HOUSE MAP_HEADER_HEARTHOME_CITY MAP_HEADER_HEARTHOME_CITY_MART MAP_HEADER_HEARTHOME_CITY_GYM_ENTRANCE_ROOM @@ -159,8 +159,8 @@ MAP_HEADER_SUNYSHORE_MARKET MAP_HEADER_SUNYSHORE_CITY_NORTHEAST_HOUSE MAP_HEADER_SUNYSHORE_CITY_WEST_HOUSE MAP_HEADER_SUNYSHORE_CITY_NORTHWEST_HOUSE -MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_1 -MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_2 +MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_1 +MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_2 MAP_HEADER_SUNYSHORE_CITY_EAST_HOUSE MAP_HEADER_VISTA_LIGHTHOUSE MAP_HEADER_SNOWPOINT_CITY @@ -194,7 +194,7 @@ MAP_HEADER_UNUSED_BATTLE_PARK_GATE_TO_FIGHT_AREA MAP_HEADER_ROUTE_225_GATE_TO_FIGHT_AREA MAP_HEADER_FIGHT_AREA_MIDDLE_HOUSE MAP_HEADER_FIGHT_AREA_SOUTH_HOUSE -MAP_HEADER_FIGHT_AREA_UNKNOWN_HOUSE +MAP_HEADER_UNUSED_FIGHT_AREA_HOUSE MAP_HEADER_UNKNOWN_197 MAP_HEADER_OREBURGH_MINE_B1F MAP_HEADER_OREBURGH_MINE_B2F @@ -333,7 +333,7 @@ MAP_HEADER_BATTLE_TOWER_MULTI_BATTLE_ROOM MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_2P MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_4P MAP_HEADER_VERITY_LAKEFRONT -MAP_HEADER_VERITY_LAKEFRONT_UNKNOWN_HOUSE +MAP_HEADER_UNUSED_VERITY_LAKEFRONT_HOUSE MAP_HEADER_VALOR_LAKEFRONT MAP_HEADER_RESTAURANT MAP_HEADER_GRAND_LAKE_VALOR_LAKEFRONT_EAST_HOUSE diff --git a/generated/meson.build b/generated/meson.build index e079da84c5..e7d04ecdaa 100644 --- a/generated/meson.build +++ b/generated/meson.build @@ -102,7 +102,6 @@ metang_generators = { 'species': { 'type': 'enum', 'tag': 'Species' }, 'species_data_params': { 'type': 'enum', 'tag': 'SpeciesDataParam' }, 'sphere_types': { 'type': 'enum', 'tag': 'SphereType' }, - 'string_padding_mode': { 'type': 'enum', 'tag': 'PaddingMode' }, 'text_banks': { 'type': 'enum', 'tag': 'TextBank' }, 'time_of_day': { 'type': 'enum', 'tag': 'TimeOfDay' }, 'town_map_description_flag_types': { 'type': 'enum', 'tag': 'TownMapDescriptionFlagType' }, diff --git a/generated/movement_types.txt b/generated/movement_types.txt index 80a560281c..dc1ce9ad9a 100644 --- a/generated/movement_types.txt +++ b/generated/movement_types.txt @@ -1,5 +1,5 @@ MOVEMENT_TYPE_NONE -MOVEMENT_TYPE_DUMMY +MOVEMENT_TYPE_PLAYER MOVEMENT_TYPE_LOOK_AROUND MOVEMENT_TYPE_WANDER_AROUND MOVEMENT_TYPE_WANDER_NORTH_AND_SOUTH diff --git a/generated/string_padding_mode.txt b/generated/string_padding_mode.txt deleted file mode 100644 index 3d255e7811..0000000000 --- a/generated/string_padding_mode.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Control codes for how to pad numeric strings. -PADDING_MODE_NONE # Do not pad the string. Effectively left-justification. -PADDING_MODE_SPACES # Right-justify the string, padding with spaces. -PADDING_MODE_ZEROES # Right-justify the string, padding with zeroes. \ No newline at end of file diff --git a/generated/text_banks.txt b/generated/text_banks.txt index 9019ff860a..37ab5f9374 100644 --- a/generated/text_banks.txt +++ b/generated/text_banks.txt @@ -23,7 +23,7 @@ TEXT_BANK_FRONTIER_TRAINER_NAMES TEXT_BANK_UNK_0022 TEXT_BANK_JUBILIFE_CITY TEXT_BANK_JUBILIFE_CITY_MART -TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_1 +TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_1 TEXT_BANK_JUBILIFE_CITY_POKECENTER_1F TEXT_BANK_POKETCH_CO_1F TEXT_BANK_POKETCH_CO_2F @@ -39,7 +39,7 @@ TEXT_BANK_JUBILIFE_TV_ELEVATOR TEXT_BANK_JUBILIFE_CITY_SOUTH_HOUSE_1F TEXT_BANK_JUBILIFE_CITY_SOUTH_HOUSE_2F TEXT_BANK_JUBILIFE_CITY_SOUTH_HOUSE_3F -TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_2 +TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_2 TEXT_BANK_JUBILIFE_CITY_CONDOMINIUMS_1F TEXT_BANK_JUBILIFE_CITY_CONDOMINIUMS_2F TEXT_BANK_JUBILIFE_CITY_CONDOMINIUMS_3F @@ -50,8 +50,8 @@ TEXT_BANK_GLOBAL_TERMINAL_3F TEXT_BANK_TRAINERS_SCHOOL TEXT_BANK_JUBILIFE_CITY_SOUTHWEST_HOUSE_1F TEXT_BANK_JUBILIFE_CITY_SOUTHWEST_HOUSE_2F -TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_3 -TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_4 +TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_3 +TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_4 TEXT_BANK_CANALAVE_CITY TEXT_BANK_CANALAVE_CITY_MART TEXT_BANK_CANALAVE_CITY_GYM @@ -169,8 +169,8 @@ TEXT_BANK_SUNYSHORE_MARKET TEXT_BANK_SUNYSHORE_CITY_NORTHEAST_HOUSE TEXT_BANK_SUNYSHORE_CITY_WEST_HOUSE TEXT_BANK_SUNYSHORE_CITY_NORTHWEST_HOUSE -TEXT_BANK_SUNYSHORE_CITY_UNKNOWN_HOUSE_1 -TEXT_BANK_SUNYSHORE_CITY_UNKNOWN_HOUSE_2 +TEXT_BANK_UNUSED_SUNYSHORE_CITY_HOUSE_1 +TEXT_BANK_UNUSED_SUNYSHORE_CITY_HOUSE_2 TEXT_BANK_SUNYSHORE_CITY_EAST_HOUSE TEXT_BANK_VISTA_LIGHTHOUSE TEXT_BANK_SUNYSHORE_CITY_EAST_HOUSE_UNUSED @@ -219,7 +219,7 @@ TEXT_BANK_CONTEST_COMMON TEXT_BANK_CONTEST_RESULTS TEXT_BANK_STATUS_CONDITION_NAMES TEXT_BANK_OPTIONS_MENU -TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS +TEXT_BANK_POKEMON_CENTER_2F_COMMON TEXT_BANK_OREBURGH_MINE_B1F TEXT_BANK_OREBURGH_MINE_B2F TEXT_BANK_VALLEY_WINDWORKS_OUTSIDE @@ -398,7 +398,7 @@ TEXT_BANK_BAG_POCKET_NAMES_WITH_ICONS TEXT_BANK_BERRY_TREES TEXT_BANK_BERRY_TAGS TEXT_BANK_VERITY_LAKEFRONT -TEXT_BANK_VERITY_LAKEFRONT_UNKNOWN_HOUSE +TEXT_BANK_UNUSED_VERITY_LAKEFRONT_HOUSE TEXT_BANK_VALOR_LAKEFRONT TEXT_BANK_RESTAURANT TEXT_BANK_GRAND_LAKE_VALOR_LAKEFRONT_EAST_HOUSE @@ -428,7 +428,7 @@ TEXT_BANK_DUMMY_0426 TEXT_BANK_GENERIC_NAMES TEXT_BANK_UNK_0428 TEXT_BANK_FOLLOWER_PARTNERS -TEXT_BANK_POKEMON_CENTER_B1F_ATTENDANTS +TEXT_BANK_POKEMON_CENTER_B1F_COMMON TEXT_BANK_RECORD_CHATOT_CRY TEXT_BANK_POFFIN_COMMON TEXT_BANK_LOCATION_NAMES @@ -437,18 +437,18 @@ TEXT_BANK_SPECIAL_MET_LOCATION_NAMES TEXT_BANK_EASY_CHAT_GROUPS TEXT_BANK_EASY_CHAT TEXT_BANK_UNK_0438 -TEXT_BANK_UNK_0439 -TEXT_BANK_UNK_0440 -TEXT_BANK_UNK_0441 -TEXT_BANK_UNK_0442 -TEXT_BANK_UNK_0443 -TEXT_BANK_UNK_0444 -TEXT_BANK_UNK_0445 -TEXT_BANK_UNK_0446 -TEXT_BANK_UNK_0447 -TEXT_BANK_UNK_0448 -TEXT_BANK_UNK_0449 -TEXT_BANK_UNK_0450 +TEXT_BANK_TRAINER_WORDS +TEXT_BANK_PEOPLE_WORDS +TEXT_BANK_GREETINGS +TEXT_BANK_LIFESTYLE_WORDS +TEXT_BANK_FEELINGS +TEXT_BANK_TOUGH_WORDS +TEXT_BANK_UNION_WORDS +TEXT_BANK_LOSS_SENTENCES +TEXT_BANK_GENERAL_SENTENCES +TEXT_BANK_PRE_BATTLE_SENTENCES +TEXT_BANK_UNION_ROOM_SENTENCES +TEXT_BANK_WIN_SENTENCES TEXT_BANK_UNK_0451 TEXT_BANK_UNK_0452 TEXT_BANK_PARTY_MENU diff --git a/generated/vars_flags.txt b/generated/vars_flags.txt index ed7df632fc..3895251ec7 100644 --- a/generated/vars_flags.txt +++ b/generated/vars_flags.txt @@ -112,7 +112,7 @@ FLAG_UNK_0x006E FLAG_UNK_0x006F FLAG_CHOSE_UNION_ROOM_APPEARANCE FLAG_UNK_0x0071 -FLAG_UNK_0x0072 +FLAG_TALKED_TO_SCRATCH_OFF_CARDS_ATTENDANT FLAG_DUMMY_0x0073 FLAG_OBTAINED_GARDENIA_TM86 FLAG_OBTAINED_ROARK_TM76 @@ -506,7 +506,7 @@ FLAG_HIDE_ROUTE_205_SOUTH_LITTLE_GIRL FLAG_HIDE_VALLEY_WINDWORKS_BUILDING_LITTLE_GIRL FLAG_HIDE_VALLEY_WINDWORKS_OUTSIDE_LOOKER FLAG_HIDE_PASTORIA_CITY_CRASHER_WAKE -FLAG_UNK_0x01FC +FLAG_HIDE_ETERNA_FOREST_GARDENIA FLAG_HIDE_ETERNA_CITY_GALACTIC_GRUNTS FLAG_HIDE_ETERNA_CITY_POKECENTER_1F_BUNEARY FLAG_HIDE_TEAM_GALACTIC_ETERNA_BUILDING_4F_HOSTAGES @@ -4192,7 +4192,7 @@ VAR_ROAMING_MESPRIT_STATE VAR_RESORT_VILLA_VISITOR_MESSAGE_NUM VAR_DISTORTION_WORLD_CYRUS_APPEARANCE VAR_WIFI_PLAZA_RETURN_WARP_ID -VAR_UNK_0x405D +VAR_WIFI_PLAZA_ATTENDANT_ID VAR_ROAMING_MOLTRES_STATE VAR_ROAMING_ZAPDOS_STATE VAR_ROAMING_ARTICUNO_STATE @@ -4227,7 +4227,7 @@ VAR_PASTORIA_STATE VAR_VEILSTONE_WAREHOUSE_GUARDS_FIGHTABLE VAR_SUNYSHORE_STATE VAR_SNOWPOINT_CITY_STATE -VAR_UNK_0x4080 +VAR_ENTERED_WIFI_PLAZA VAR_FIGHT_AREA_STATE VAR_UNK_0x4082 VAR_UNK_0x4083 @@ -4311,8 +4311,8 @@ VAR_HAS_SEEN_UNDERGROUND_ROARK_INTRO VAR_HAS_ENTERED_HEARTHOME_GYM_BEFORE VAR_UNK_0x40D2 VAR_LAKE_ACUITY_STATE -VAR_UNK_0x40D4 -VAR_UNK_0x40D5 +VAR_VISITED_POKEMON_CENTER_B1F +VAR_COMMUNICATION_LOAD_ACTION VAR_GALACTIC_HQ_4F_STATE VAR_PASTORIA_CITY_OBSERVATORY_GATE_1F_STATE VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION diff --git a/include/applications/easy_chat/defs.h b/include/applications/easy_chat/defs.h index 32decc7996..f3151b0880 100644 --- a/include/applications/easy_chat/defs.h +++ b/include/applications/easy_chat/defs.h @@ -1,8 +1,6 @@ #ifndef POKEPLATINUM_EASY_CHAT_DEFS_H #define POKEPLATINUM_EASY_CHAT_DEFS_H -#define WORD_NONE 0xFFFF - enum EasyChatType { EASY_CHAT_TYPE_ONE_WORD = 0, EASY_CHAT_TYPE_TWO_WORDS, diff --git a/include/applications/easy_chat/main.h b/include/applications/easy_chat/main.h index 201b62ec8a..86288f1884 100644 --- a/include/applications/easy_chat/main.h +++ b/include/applications/easy_chat/main.h @@ -1,12 +1,11 @@ #ifndef POKEPLATINUM_APPLICATIONS_EASY_CHAT_MAIN_H #define POKEPLATINUM_APPLICATIONS_EASY_CHAT_MAIN_H -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" #include "applications/easy_chat/struct_ov20_021D2128_decl.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "overlay_manager.h" #include "string_gf.h" #include "touch_screen_actions.h" @@ -40,7 +39,7 @@ typedef struct { typedef struct EasyChatApp { EasyChatArgs *args; u32 type; - Sentence sentence; + EasyChatSentence sentence; u16 words[MAX_EASY_CHAT_WORDS]; UnkStruct_ov20_021D2128 *unk_14; UnkStruct_020998EC *unk_18; diff --git a/include/applications/mail.h b/include/applications/mail.h index 1b60e64974..67a7208290 100644 --- a/include/applications/mail.h +++ b/include/applications/mail.h @@ -1,8 +1,7 @@ #ifndef POKEPLATINUM_APPLICATIONS_MAIL_H #define POKEPLATINUM_APPLICATIONS_MAIL_H -#include "struct_defs/sentence.h" - +#include "easy_chat_sentence.h" #include "game_options.h" #include "mail.h" #include "pokemon.h" @@ -37,7 +36,7 @@ typedef struct MailViewerAppArgs { u8 mailType; String *trainerName; MailIconData iconData[MAIL_MAX_ICONS]; - Sentence sentences[MAIL_MAX_SENTENCES]; + EasyChatSentence sentences[MAIL_MAX_SENTENCES]; } MailViewerAppArgs; MailAppArgs *MailAppArgs_New_Write(SaveData *saveData, enum MailContext context, u8 partySlot, u8 mailType, enum HeapID heapID); diff --git a/include/battle_hall_save.h b/include/battle_hall_save.h new file mode 100644 index 0000000000..32be1d59c2 --- /dev/null +++ b/include/battle_hall_save.h @@ -0,0 +1,42 @@ +#ifndef POKEPLATINUM_BATTLE_HALL_SAVE_H +#define POKEPLATINUM_BATTLE_HALL_SAVE_H + +#include "savedata.h" + +#define HALL_SAVE_CHALLENGE_TYPE 0 +#define HALL_SAVE_UNK_1 1 +#define HALL_SAVE_TRAINER_IDS 2 +#define HALL_SAVE_PARTY_SLOTS 3 +#define HALL_SAVE_UNK_4 4 +#define HALL_SAVE_STREAK_FLAGS 5 + +typedef struct BattleHallSave { + u8 challengeType : 3; + u8 didSave : 1; + u8 unk_00_4 : 4; + u8 unk_01; + u8 partySlots[2]; + u16 trainerIDs[20]; + u16 unk_2C[20]; +} BattleHallSave; + +typedef struct BattleHallStreakFlags { + u8 streakActiveFlags; + u8 unused[3]; +} BattleHallStreakFlags; + +void BattleHallSave_Init(BattleHallSave *challenge); +BattleHallSave *BattleHallSave_Get(SaveData *saveData); +BOOL BattleHallSave_HasSaved(BattleHallSave *save); +void BattleHallSave_RecordSave(BattleHallSave *save, BOOL didSave); +void BattleHallSave_SetMember(BattleHallSave *save, u8 field, u8 index, u8 unused, void *value); +u32 BattleHallSave_GetMember(BattleHallSave *save, u8 field, u8 index, u8 unused, void *unused2); +u8 BattleHall_GetRankOfType(u8 idx, u8 *typeRanks); +void BattleHall_SetRankOfType(u8 pokemonType, u8 *typeRanks, u8 value); +void BattleHall_ResetRankOfAllTypes(u8 *typeRanks); +void BattleHallStreakFlags_Init(BattleHallStreakFlags *flags); +BattleHallStreakFlags *BattleHallStreakFlags_Get(SaveData *saveData); +void BattleHallStreakFlags_SetFlag(BattleHallStreakFlags *flags, u8 field, u8 challengeType, u8 unused, u8 *value); +u32 BattleHallStreakFlags_GetFlag(BattleHallStreakFlags *flags, u8 field, u8 challengeType, u8 unused, void *unused2); + +#endif // POKEPLATINUM_BATTLE_HALL_SAVE_H diff --git a/include/battle_regulation.h b/include/battle_regulation.h index 6b505a94f9..648356ae9d 100644 --- a/include/battle_regulation.h +++ b/include/battle_regulation.h @@ -13,8 +13,8 @@ typedef struct BattleRegulation { u8 maxLevel; s8 heightRestriction; s8 weightRestriction; - u8 speciesRestriction : 1; - u8 itemRestriction : 1; + u8 evolutionRestriction : 1; + u8 specialSpeciesRestriction : 1; u8 speciesUniqueness : 1; u8 itemUniqueness : 1; u8 moveRestrictions : 1; @@ -28,14 +28,14 @@ enum BattleRegulationRule { BATTLE_REGULATION_RULE_TEAM_SIZE = 1, BATTLE_REGULATION_RULE_MAX_LEVEL, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL, - BATTLE_REGULATION_RULE_SPECIES_RESTRICT, + BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT, BATTLE_REGULATION_RULE_HEIGHT_RESTRICT, BATTLE_REGULATION_RULE_HEIGHT_TYPE, BATTLE_REGULATION_RULE_WEIGHT_RESTRICT, BATTLE_REGULATION_RULE_WEIGHT_TYPE, BATTLE_REGULATION_RULE_ITEM_UNIQUE, BATTLE_REGULATION_RULE_SPECIES_UNIQUE, - BATTLE_REGULATION_RULE_ITEM_RESTRICT, + BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT, BATTLE_REGULATION_RULE_MOVE_RESTRICTIONS, }; diff --git a/include/battle_regulation_validation.h b/include/battle_regulation_validation.h index d5664a06a2..ede659dd91 100644 --- a/include/battle_regulation_validation.h +++ b/include/battle_regulation_validation.h @@ -6,17 +6,17 @@ #include "pokedex_heightweight.h" #include "pokemon.h" -enum BattleRegulationValidationError { - BATTLE_REGULATION_VALIDATION_SUCCESS = 0, - BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED = 1, - BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES = 2, - BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS = 3, - BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE = 4, - BATTLE_REGULATION_VALIDATION_ERROR_INVALID_POKEMON = 5, +enum BattleRegulationValidationResult { + BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS = 0, + BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED, + BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES, + BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS, + BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE, + BATTLE_REGULATION_VALIDATION_RESULT_INVALID_POKEMON, }; BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemon *mon, const HeightWeightData *heightWeightData); -enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots); -enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData); +enum BattleRegulationValidationResult BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots); +enum BattleRegulationValidationResult BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData); #endif // POKEPLATINUM_BATTLE_REGULATION_VALIDATION_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 9e5f13f18a..f762fb4360 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -36,16 +36,17 @@ #define BATTLE_TYPE_CATCH_TUTORIAL (1 << 10) #define BATTLE_TYPE_DEBUG (1 << 31) +#define BATTLE_TYPE_TRAINER_SINGLES (BATTLE_TYPE_SINGLES | BATTLE_TYPE_TRAINER) #define BATTLE_TYPE_TRAINER_DOUBLES (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_TRAINER) #define BATTLE_TYPE_LINK_DOUBLES (BATTLE_TYPE_LINK | BATTLE_TYPE_TRAINER_DOUBLES) +#define BATTLE_TYPE_FRONTIER_SINGLES (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_SINGLES) #define BATTLE_TYPE_FRONTIER_DOUBLES (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_DOUBLES) +#define BATTLE_TYPE_FRONTIER_LINK (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) #define BATTLE_TYPE_TAG_DOUBLES (BATTLE_TYPE_TAG | BATTLE_TYPE_TRAINER_DOUBLES) -#define BATTLE_TYPE_NO_ITEMS (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) #define BATTLE_TYPE_AI_PARTNER (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_2vs2 | BATTLE_TYPE_AI) #define BATTLE_TYPE_TRAINER_WITH_AI_PARTNER (BATTLE_TYPE_TRAINER | BATTLE_TYPE_AI_PARTNER) #define BATTLE_TYPE_FRONTIER_WITH_AI_PARTNER (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_WITH_AI_PARTNER) #define BATTLE_TYPE_SPECIAL_WILD (BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER | BATTLE_TYPE_PAL_PARK | BATTLE_TYPE_CATCH_TUTORIAL) -#define BATTLE_TYPE_NO_OBEDIENCE_CHECK (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) #define BATTLE_TYPE_FORCED_SET_MODE (BATTLE_TYPE_DOUBLES | BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) #define BATTLE_TYPE_NO_AI_ITEMS (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_SAFARI | BATTLE_TYPE_AI | BATTLE_TYPE_PAL_PARK) #define BATTLE_TYPE_NO_MOVES (BATTLE_TYPE_SAFARI | BATTLE_TYPE_PAL_PARK) @@ -53,8 +54,6 @@ #define BATTLE_TYPE_NO_ABILITIES (BATTLE_TYPE_SAFARI | BATTLE_TYPE_PAL_PARK) #define BATTLE_TYPE_2vs2_TAG (BATTLE_TYPE_2vs2 | BATTLE_TYPE_TAG) #define BATTLE_TYPE_ALWAYS_CATCH (BATTLE_TYPE_PAL_PARK | BATTLE_TYPE_CATCH_TUTORIAL) -#define BATTLE_TYPE_RESTORE_ITEMS_AFTER (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) -#define BATTLE_TYPE_NO_TRAINER_MESSAGES (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER) #define MAX_LINK_BATTLERS 4 #define MAX_BATTLERS 4 diff --git a/include/constants/battle_frontier.h b/include/constants/battle_frontier.h index 68aae2fb81..09826f2e10 100644 --- a/include/constants/battle_frontier.h +++ b/include/constants/battle_frontier.h @@ -12,6 +12,8 @@ #define FRONTIER_RECORDS_APP_HALL 5 #define FRONTIER_RECORDS_APP_ARCADE 6 +#define BATTLES_PER_ROUND_HALL 10 + #define BATTLES_PER_ROUND_ARCADE 7 #define ARCADE_PARTY_SIZE_SOLO 3 diff --git a/include/constants/battle_frontier_stats.h b/include/constants/battle_frontier_stats.h index 97bdf667c1..2cba72ccf3 100644 --- a/include/constants/battle_frontier_stats.h +++ b/include/constants/battle_frontier_stats.h @@ -36,42 +36,42 @@ enum BattleFrontierStatsIndex { STAT_FACTORY_LATEST_STREAK_OPEN_MULTI, STAT_FACTORY_RECORD_TRADE_COUNT_OPEN_MULTI, STAT_FACTORY_LATEST_TRADE_COUNT_OPEN_MULTI, - STAT_HALL_UNK_34, + STAT_HALL_CURRENT_STREAK_SINGLE, STAT_HALL_LATEST_STREAK_SINGLE, STAT_HALL_LATEST_SPECIES_SINGLE, - STAT_HALL_UNK_37, - STAT_HALL_UNK_38, - STAT_HALL_UNK_39, - STAT_HALL_UNK_40, - STAT_HALL_UNK_41, - STAT_HALL_UNK_42, - STAT_HALL_UNK_43, - STAT_HALL_UNK_44, - STAT_HALL_UNK_45, - STAT_HALL_UNK_46, + STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_SINGLE, + STAT_HALL_CURRENT_RANKS_FLYING_POISON_SINGLE, + STAT_HALL_CURRENT_RANKS_GROUND_ROCK_SINGLE, + STAT_HALL_CURRENT_RANKS_BUG_GHOST_SINGLE, + STAT_HALL_CURRENT_RANKS_STEEL_MYSTERY_SINGLE, + STAT_HALL_CURRENT_RANKS_FIRE_WATER_SINGLE, + STAT_HALL_CURRENT_RANKS_GRASS_ELECTRIC_SINGLE, + STAT_HALL_CURRENT_RANKS_PSYCHIC_ICE_SINGLE, + STAT_HALL_CURRENT_RANKS_DRAGON_DARK_SINGLE, + STAT_HALL_CURRENT_STREAK_DOUBLE, STAT_HALL_LATEST_STREAK_DOUBLE, STAT_HALL_LATEST_SPECIES_DOUBLE, - STAT_HALL_UNK_49, - STAT_HALL_UNK_50, - STAT_HALL_UNK_51, - STAT_HALL_UNK_52, - STAT_HALL_UNK_53, - STAT_HALL_UNK_54, - STAT_HALL_UNK_55, - STAT_HALL_UNK_56, - STAT_HALL_UNK_57, - STAT_HALL_UNK_58, + STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_DOUBLE, + STAT_HALL_CURRENT_RANKS_FLYING_POISON_DOUBLE, + STAT_HALL_CURRENT_RANKS_GROUND_ROCK_DOUBLE, + STAT_HALL_CURRENT_RANKS_BUG_GHOST_DOUBLE, + STAT_HALL_CURRENT_RANKS_STEEL_MYSTERY_DOUBLE, + STAT_HALL_CURRENT_RANKS_FIRE_WATER_DOUBLE, + STAT_HALL_CURRENT_RANKS_GRASS_ELECTRIC_DOUBLE, + STAT_HALL_CURRENT_RANKS_PSYCHIC_ICE_DOUBLE, + STAT_HALL_CURRENT_RANKS_DRAGON_DARK_DOUBLE, + STAT_HALL_CURRENT_STREAK_MULTI, STAT_HALL_LATEST_STREAK_MULTI, STAT_HALL_LATEST_SPECIES_MULTI, - STAT_HALL_UNK_61, - STAT_HALL_UNK_62, - STAT_HALL_UNK_63, - STAT_HALL_UNK_64, - STAT_HALL_UNK_65, - STAT_HALL_UNK_66, - STAT_HALL_UNK_67, - STAT_HALL_UNK_68, - STAT_HALL_UNK_69, + STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_MULTI, + STAT_HALL_CURRENT_RANKS_FLYING_POISON_MULTI, + STAT_HALL_CURRENT_RANKS_GROUND_ROCK_MULTI, + STAT_HALL_CURRENT_RANKS_BUG_GHOST_MULTI, + STAT_HALL_CURRENT_RANKS_STEEL_MYSTERY_MULTI, + STAT_HALL_CURRENT_RANKS_FIRE_WATER_MULTI, + STAT_HALL_CURRENT_RANKS_GRASS_ELECTRIC_MULTI, + STAT_HALL_CURRENT_RANKS_PSYCHIC_ICE_MULTI, + STAT_HALL_CURRENT_RANKS_DRAGON_DARK_MULTI, STAT_CASTLE_RECORD_STREAK_SINGLE, STAT_CASTLE_LATEST_STREAK_SINGLE, STAT_CASTLE_LATEST_CP_SINGLE, @@ -132,18 +132,18 @@ enum BattleFrontierStatsIndex { STAT_FACTORY_LATEST_STREAK_OPEN_MULTI_WFC, STAT_FACTORY_RECORD_TRADE_COUNT_OPEN_MULTI_WFC, STAT_FACTORY_LATEST_TRADE_COUNT_OPEN_MULTI_WFC, - STAT_HALL_UNK_122, + STAT_HALL_CURRENT_STREAK_MULTI_WFC, STAT_HALL_LATEST_STREAK_MULTI_WFC, STAT_HALL_LATEST_SPECIES_MULTI_WFC, - STAT_HALL_UNK_125, - STAT_HALL_UNK_126, - STAT_HALL_UNK_127, - STAT_HALL_UNK_128, - STAT_HALL_UNK_129, - STAT_HALL_UNK_130, - STAT_HALL_UNK_131, - STAT_HALL_UNK_132, - STAT_HALL_UNK_133, + STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_FLYING_POISON_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_GROUND_ROCK_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_BUG_GHOST_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_STEEL_MYSTERY_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_FIRE_WATER_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_GRASS_ELECTRIC_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_PSYCHIC_ICE_MULTI_WFC, + STAT_HALL_CURRENT_RANKS_DRAGON_DARK_MULTI_WFC, STAT_CASTLE_RECORD_STREAK_MULTI_WFC, STAT_CASTLE_LATEST_STREAK_MULTI_WFC, STAT_CASTLE_LATEST_CP_MULTI_WFC, diff --git a/include/constants/battle_hall_functions.h b/include/constants/battle_hall_functions.h index 0157f76bda..b800e5a525 100644 --- a/include/constants/battle_hall_functions.h +++ b/include/constants/battle_hall_functions.h @@ -12,7 +12,7 @@ enum BattleHallFunction { BH_FUNC_RESET_SYSTEM, BH_FUNC_UNK_8, BH_FUNC_UNK_9, - BH_FUNC_UNK_10, + BH_FUNC_QUICKSAVE, BH_FUNC_UNK_11, BH_FUNC_UNK_12, BH_FUNC_UNK_13, @@ -29,7 +29,7 @@ enum BattleHallFunction { BH_FUNC_UNK_24, BH_FUNC_UNK_25, BH_FUNC_UNK_26, - BH_FUNC_UPDATE_HELD_ITEMS, + BH_FUNC_RESTORE_HELD_ITEMS, BH_FUNC_UNK_28, BH_FUNC_UNK_29, BH_FUNC_IS_MULTIPLAYER_CHALLENGE, diff --git a/include/constants/field/field_effect_renderer.h b/include/constants/field/field_effect_renderer.h index 996c71eeb6..16f63378d3 100644 --- a/include/constants/field/field_effect_renderer.h +++ b/include/constants/field/field_effect_renderer.h @@ -33,7 +33,7 @@ enum FieldEffectRendererType { FIELD_EFFECT_RENDERER_BERRY_PATCH_EFFECT_COUNTER, FIELD_EFFECT_RENDERER_1D, FIELD_EFFECT_RENDERER_1E, - FIELD_EFFECT_RENDERER_1F, + FIELD_EFFECT_RENDERER_VEILSTONE_GYM_OBJECTS, FIELD_EFFECT_RENDERER_20, FIELD_EFFECT_RENDERER_DISTORTION_WORLD_SURF_MOUNT, FIELD_EFFECT_RENDERER_COUNT, diff --git a/include/constants/field/map_tile_behaviors.h b/include/constants/field/map_tile_behaviors.h index c26e4c3da1..1b40ea5b21 100644 --- a/include/constants/field/map_tile_behaviors.h +++ b/include/constants/field/map_tile_behaviors.h @@ -97,7 +97,7 @@ enum TileBehavior { TILE_BEHAVIOR_PASTORIA_GYM_H_GROUND, TILE_BEHAVIOR_PASTORIA_GYM_M_GROUND, TILE_BEHAVIOR_PASTORIA_GYM_L_GROUND, - TILE_BEHAVIOR_PASTORIA_GYM_WATER, + TILE_BEHAVIOR_DYNAMIC_HEIGHT_COLLISION, TILE_BEHAVIOR_JUMP_NORTH_TWICE, TILE_BEHAVIOR_JUMP_SOUTH_TWICE, TILE_BEHAVIOR_JUMP_WEST_TWICE, diff --git a/include/constants/player_avatar.h b/include/constants/player_avatar.h index def3ae2c57..7a0b54c944 100644 --- a/include/constants/player_avatar.h +++ b/include/constants/player_avatar.h @@ -4,9 +4,27 @@ #include "generated/player_transitions.h"; // Player State -#define PLAYER_STATE_WALKING 0 -#define PLAYER_STATE_CYCLING 1 -#define PLAYER_STATE_SURFING 2 +enum PlayerAvatarState { + PLAYER_AVATAR_WALKING = 0, + PLAYER_AVATAR_CYCLING, + PLAYER_AVATAR_SURFING, + + PLAYER_AVATAR_USE_FIELD_MOVE = 16, + PLAYER_AVATAR_SPRAYDUCK, + PLAYER_AVATAR_CONTEST, + PLAYER_AVATAR_FISHING, + PLAYER_AVATAR_POKETCH, + PLAYER_AVATAR_SAVE, + PLAYER_AVATAR_HEAL, + PLAYER_AVATAR_VS_SEEKER, + PLAYER_AVATAR_DISTORTION_WORLD, + PLAYER_AVATAR_DISTORTION_WORLD_SURF, + PLAYER_AVATAR_26, + PLAYER_AVATAR_27, + PLAYER_AVATAR_HEARTHOME_GYM, + PLAYER_AVATAR_29, + PLAYER_AVATAR_30, +}; #define PLAYER_EVENT_NONE 0 #define PLAYER_EVENT_USED_STRENGTH (1 << 0) @@ -36,4 +54,14 @@ enum AvatarDistortionState { AVATAR_DISTORTION_STATE_MAX, }; +enum PlayerMovementActionSpeed { + PLAYER_ACTION_SPEED_NONE, + PLAYER_ACTION_SPEED_NOT_MOVING, + PLAYER_ACTION_SPEED_SLOWER, + PLAYER_ACTION_SPEED_SLOW, + PLAYER_ACTION_SPEED_NORMAL, + PLAYER_ACTION_SPEED_FAST, + PLAYER_ACTION_SPEED_FASTER +}; + #endif // POKEPLATINUM_CONSTANTS_PLAYER_AVATAR_H diff --git a/include/constants/savedata/save_table.h b/include/constants/savedata/save_table.h index 4e69784616..a763e9bc87 100644 --- a/include/constants/savedata/save_table.h +++ b/include/constants/savedata/save_table.h @@ -43,7 +43,7 @@ enum SaveTableEntryID { SAVE_TABLE_ENTRY_MYSTERY_GIFT, SAVE_TABLE_ENTRY_PAL_PARK_TRANSFER, SAVE_TABLE_ENTRY_LINK_CONTEST_RECORDS, - SAVE_TABLE_ENTRY_SENTENCE, + SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS, SAVE_TABLE_ENTRY_EMAIL, SAVE_TABLE_ENTRY_WIFI_QUESTIONS, SAVE_TABLE_ENTRY_PC_BOXES, diff --git a/include/constants/scrcmd.h b/include/constants/scrcmd.h index ce42331aa2..ab2c5cf8e9 100644 --- a/include/constants/scrcmd.h +++ b/include/constants/scrcmd.h @@ -25,4 +25,8 @@ #define SAFARI_GAME_ACTIVE 0 #define SAFARI_GAME_INACTIVE 1 +#define FIELD_MOVE_FUNC_CLEAR_ACTIVE 0 +#define FIELD_MOVE_FUNC_SET_ACTIVE 1 +#define FIELD_MOVE_FUNC_CHECK_ACTIVE 2 + #endif // POKEPLATINUM_CONSTANTS_SCRCMD_H diff --git a/include/constants/string.h b/include/constants/string.h index e098cbd353..289492f8f9 100644 --- a/include/constants/string.h +++ b/include/constants/string.h @@ -8,4 +8,11 @@ #define UNION_GROUP_NAME_LEN 7 #define BOX_NAME_LEN 8 +// Control codes for how to pad numeric strings. +enum PaddingMode { + PADDING_MODE_NONE = 0, // Do not pad the string. Effectively left-justification. + PADDING_MODE_SPACES, // Right-justify the string, padding with spaces. + PADDING_MODE_ZEROES, // Right-justify the string, padding with zeroes. +}; + #endif diff --git a/include/constants/tv_broadcast.h b/include/constants/tv_broadcast.h index f04c944734..7826081b71 100644 --- a/include/constants/tv_broadcast.h +++ b/include/constants/tv_broadcast.h @@ -36,13 +36,18 @@ #define TV_PROGRAM_TYPE_VARIETY_HOUR_NUM_SEGMENTS 8 // Interview Segments +#define TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_01 1 #define TV_PROGRAM_SEGMENT_BATTLE_TOWER_CORNER 2 +#define TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_03 3 #define TV_PROGRAM_SEGMENT_YOUR_POKEMON_CORNER 4 +#define TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_05 5 #define TV_PROGRAM_SEGMENT_THE_POKETCH_WATCH 6 #define TV_PROGRAM_SEGMENT_CONTEST_HALL 7 +#define TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_08 8 #define TV_PROGRAM_SEGMENT_RIGHT_ON_PHOTO_CORNER 9 #define TV_PROGRAM_SEGMENT_STREET_CORNER_PERSONALITY_CHECKUP 10 #define TV_PROGRAM_SEGMENT_THREE_CHEERS_FOR_POFFIN_CORNER 11 +#define TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_12 12 #define TV_PROGRAM_SEGMENT_AMITY_SQUARE_WATCH 13 #define TV_PROGRAM_SEGMENT_BATTLE_FRONTIER_FRONTLINE_NEWS_SINGLE 14 #define TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_1 15 diff --git a/include/constants/vs_seeker.h b/include/constants/vs_seeker.h new file mode 100644 index 0000000000..42b63cb80f --- /dev/null +++ b/include/constants/vs_seeker.h @@ -0,0 +1,9 @@ +#ifndef POKEPLATIUM_CONSTANTS_VS_SEEKER_H +#define POKEPLATIUM_CONSTANTS_VS_SEEKER_H + +#define VS_SEEKER_USE_RESULT_OK 0 +#define VS_SEEKER_USE_RESULT_NO_BATTERY 1 +#define VS_SEEKER_USE_RESULT_NO_TRAINERS 2 +#define VS_SEEKER_USE_RESULT_NO_TRAINERS_PICKED 3 // No trainers were picked for a rematch (e.g. all the random chances failed) + +#endif // POKEPLATIUM_CONSTANTS_VS_SEEKER_H diff --git a/include/data/map_headers.h b/include/data/map_headers.h index 29961937bb..742073849f 100644 --- a/include/data/map_headers.h +++ b/include/data/map_headers.h @@ -141,17 +141,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_1] = { + [MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_1] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_123, - .scriptsArchiveID = scripts_jubilife_city_unknown_house_1, - .initScriptsArchiveID = scripts_init_jubilife_city_unknown_house_1, - .msgArchiveID = TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_1, + .scriptsArchiveID = scripts_unused_jubilife_city_house_1, + .initScriptsArchiveID = scripts_init_unused_jubilife_city_house_1, + .msgArchiveID = TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_1, .dayMusicID = SEQ_GYM, .nightMusicID = SEQ_GYM, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_jubilife_city_unknown_house_1, + .eventsArchiveID = events_unused_jubilife_city_house_1, .mapLabelTextID = LocationNames_Text_JubilifeCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -537,17 +537,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_2] = { + [MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_2] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_125, - .scriptsArchiveID = scripts_jubilife_city_unknown_house_2, - .initScriptsArchiveID = scripts_init_jubilife_city_unknown_house_2, - .msgArchiveID = TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_2, + .scriptsArchiveID = scripts_unused_jubilife_city_house_2, + .initScriptsArchiveID = scripts_init_unused_jubilife_city_house_2, + .msgArchiveID = TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_2, .dayMusicID = SEQ_DUMMY, .nightMusicID = SEQ_DUMMY, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_jubilife_city_unknown_house_2, + .eventsArchiveID = events_unused_jubilife_city_house_2, .mapLabelTextID = LocationNames_Text_JubilifeCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -713,17 +713,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_3] = { + [MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_3] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_125, - .scriptsArchiveID = scripts_jubilife_city_unknown_house_3, - .initScriptsArchiveID = scripts_init_jubilife_city_unknown_house_3, - .msgArchiveID = TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_3, + .scriptsArchiveID = scripts_unused_jubilife_city_house_3, + .initScriptsArchiveID = scripts_init_unused_jubilife_city_house_3, + .msgArchiveID = TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_3, .dayMusicID = SEQ_DUMMY, .nightMusicID = SEQ_DUMMY, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_jubilife_city_unknown_house_3, + .eventsArchiveID = events_unused_jubilife_city_house_3, .mapLabelTextID = LocationNames_Text_JubilifeCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -735,17 +735,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_4] = { + [MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_4] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_125, - .scriptsArchiveID = scripts_jubilife_city_unknown_house_4, - .initScriptsArchiveID = scripts_init_jubilife_city_unknown_house_4, - .msgArchiveID = TEXT_BANK_JUBILIFE_CITY_UNKNOWN_HOUSE_4, + .scriptsArchiveID = scripts_unused_jubilife_city_house_4, + .initScriptsArchiveID = scripts_init_unused_jubilife_city_house_4, + .msgArchiveID = TEXT_BANK_UNUSED_JUBILIFE_CITY_HOUSE_4, .dayMusicID = SEQ_DUMMY, .nightMusicID = SEQ_DUMMY, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_jubilife_city_unknown_house_4, + .eventsArchiveID = events_unused_jubilife_city_house_4, .mapLabelTextID = LocationNames_Text_JubilifeCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -1901,7 +1901,7 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_ETERNA_CITY_UNKNOWN_HOUSE] = { + [MAP_HEADER_UNUSED_ETERNA_CITY_HOUSE] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_123, @@ -1911,7 +1911,7 @@ static const MapHeader sMapHeaders[] = { .dayMusicID = SEQ_DUMMY, .nightMusicID = SEQ_DUMMY, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_eterna_city_unknown_house, + .eventsArchiveID = events_unused_eterna_city_house, .mapLabelTextID = LocationNames_Text_EternaCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -3573,17 +3573,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_1] = { + [MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_1] = { .areaDataArchiveID = area_data_020, .unk_01 = 0xF, .mapMatrixID = map_matrix_243, - .scriptsArchiveID = scripts_sunyshore_city_unknown_house_1, - .initScriptsArchiveID = scripts_init_sunyshore_city_unknown_house_1, - .msgArchiveID = TEXT_BANK_SUNYSHORE_CITY_UNKNOWN_HOUSE_1, + .scriptsArchiveID = scripts_unused_sunyshore_city_house_1, + .initScriptsArchiveID = scripts_init_unused_sunyshore_city_house_1, + .msgArchiveID = TEXT_BANK_UNUSED_SUNYSHORE_CITY_HOUSE_1, .dayMusicID = SEQ_CITY08_D, .nightMusicID = SEQ_CITY08_N, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_sunyshore_city_unknown_house_1, + .eventsArchiveID = events_unused_sunyshore_city_house_1, .mapLabelTextID = LocationNames_Text_SunyshoreCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -3595,17 +3595,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_2] = { + [MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_2] = { .areaDataArchiveID = area_data_020, .unk_01 = 0xF, .mapMatrixID = map_matrix_243, - .scriptsArchiveID = scripts_sunyshore_city_unknown_house_2, - .initScriptsArchiveID = scripts_init_sunyshore_city_unknown_house_2, - .msgArchiveID = TEXT_BANK_SUNYSHORE_CITY_UNKNOWN_HOUSE_2, + .scriptsArchiveID = scripts_unused_sunyshore_city_house_2, + .initScriptsArchiveID = scripts_init_unused_sunyshore_city_house_2, + .msgArchiveID = TEXT_BANK_UNUSED_SUNYSHORE_CITY_HOUSE_2, .dayMusicID = SEQ_CITY08_D, .nightMusicID = SEQ_CITY08_N, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_sunyshore_city_unknown_house_2, + .eventsArchiveID = events_unused_sunyshore_city_house_2, .mapLabelTextID = LocationNames_Text_SunyshoreCity, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, @@ -4343,7 +4343,7 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = FALSE, }, - [MAP_HEADER_FIGHT_AREA_UNKNOWN_HOUSE] = { + [MAP_HEADER_UNUSED_FIGHT_AREA_HOUSE] = { .areaDataArchiveID = area_data_020, .unk_01 = 0xF, .mapMatrixID = map_matrix_123, @@ -7401,17 +7401,17 @@ static const MapHeader sMapHeaders[] = { .isEscapeRopeAllowed = FALSE, .isFlyAllowed = TRUE, }, - [MAP_HEADER_VERITY_LAKEFRONT_UNKNOWN_HOUSE] = { + [MAP_HEADER_UNUSED_VERITY_LAKEFRONT_HOUSE] = { .areaDataArchiveID = area_data_020, .unk_01 = 0x14, .mapMatrixID = map_matrix_123, - .scriptsArchiveID = scripts_verity_lakefront_unknown_house, - .initScriptsArchiveID = scripts_init_verity_lakefront_unknown_house, - .msgArchiveID = TEXT_BANK_VERITY_LAKEFRONT_UNKNOWN_HOUSE, + .scriptsArchiveID = scripts_unused_verity_lakefront_house, + .initScriptsArchiveID = scripts_init_unused_verity_lakefront_house, + .msgArchiveID = TEXT_BANK_UNUSED_VERITY_LAKEFRONT_HOUSE, .dayMusicID = SEQ_ROAD_A_D, .nightMusicID = SEQ_ROAD_A_N, .wildEncountersArchiveID = ENCOUNTERS_NONE, - .eventsArchiveID = events_verity_lakefront_unknown_house, + .eventsArchiveID = events_unused_verity_lakefront_house, .mapLabelTextID = LocationNames_Text_VerityLakefront, .mapLabelWindowID = MAP_LABEL_WINDOW_WATER, .weather = OVERWORLD_WEATHER_CLEAR, diff --git a/include/data/scripts/frscrcmd.h b/include/data/scripts/frscrcmd.h index abbb64b470..2308e6bf57 100644 --- a/include/data/scripts/frscrcmd.h +++ b/include/data/scripts/frscrcmd.h @@ -66,8 +66,8 @@ ScriptCommand(FRSCRCMD_HEALPARTY, FrontierScrCmd_HealPart ScriptCommand(FRSCRCMD_WAITABPRESS, FrontierScrCmd_WaitABPress) ScriptCommand(FRSCRCMD_WAITABPRESSTIME, FrontierScrCmd_WaitABPressTime) ScriptCommand(FRSCRCMD_DUMMY3C, FrontierScrCmd_Dummy3C) -ScriptCommand(FRSCRCMD_3D, FrontierScrCmd_3D) -ScriptCommand(FRSCRCMD_3E, FrontierScrCmd_3E) +ScriptCommand(FRSCRCMD_SETSYSTEMVAR, FrontierScrCmd_SetSystemVar) +ScriptCommand(FRSCRCMD_GETSYSTEMVAR, FrontierScrCmd_GetSystemVar) ScriptCommand(FRSCRCMD_3F, FrontierScrCmd_3F) ScriptCommand(FRSCRCMD_GETPLAYEROBJEVENTGFX, FrontierScrCmd_GetPlayerObjEventGfx) ScriptCommand(FRSCRCMD_INITPARTICLESYSTEM, FrontierScrCmd_InitParticleSystem) @@ -144,9 +144,9 @@ ScriptCommand(FRSCRCMD_BATTLETOWER_STARTBATTLE, FrontierScrCmd_BattleTo ScriptCommand(FRSCRCMD_BATTLETOWER_CHECKWONBATTLE, FrontierScrCmd_BattleTower_CheckWonBattle) ScriptCommand(FRSCRCMD_89, FrontierScrCmd_89) ScriptCommand(FRSCRCMD_8A, FrontierScrCmd_8A) -ScriptCommand(FRSCRCMD_8B, FrontierScrCmd_8B) +ScriptCommand(FRSCRCMD_INITBATTLEHALL, FrontierScrCmd_InitBattleHall) ScriptCommand(FRSCRCMD_8C, FrontierScrCmd_8C) -ScriptCommand(FRSCRCMD_8D, FrontierScrCmd_8D) +ScriptCommand(FRSCRCMD_FREEBATTLEHALL, FrontierScrCmd_FreeBattleHall) ScriptCommand(FRSCRCMD_OPENBATTLEHALLAPP, FrontierScrCmd_OpenBattleHallApp) ScriptCommand(FRSCRCMD_BATTLEHALL_CLEANUPBATTLE, FrontierScrCmd_BattleHall_CleanupBattle) ScriptCommand(FRSCRCMD_BATTLEHALL_STARTBATTLE, FrontierScrCmd_BattleHall_StartBattle) diff --git a/include/data/scripts/scrcmd.h b/include/data/scripts/scrcmd.h index edbd78ab25..ff7254d6c6 100644 --- a/include/data/scripts/scrcmd.h +++ b/include/data/scripts/scrcmd.h @@ -202,7 +202,7 @@ ScriptCommand(SCRCMD_USEWATERFALL, ScrCm ScriptCommand(SCRCMD_USEFLY, ScrCmd_UseFly) ScriptCommand(SCRCMD_0C3, ScrCmd_0C3) ScriptCommand(SCRCMD_0C4, ScrCmd_0C4) -ScriptCommand(SCRCMD_0C5, ScrCmd_0C5) +ScriptCommand(SCRCMD_PLAYHMCUTIN, ScrCmd_PlayHMCutIn) ScriptCommand(SCRCMD_CHANGEINTOCONTESTATTIRE, ScrCmd_ChangeIntoContestAttire) ScriptCommand(SCRCMD_CHECKPLAYERONBIKE, ScrCmd_CheckPlayerOnBike) ScriptCommand(SCRCMD_SETPLAYERBIKE, ScrCmd_SetPlayerBike) @@ -468,9 +468,9 @@ ScriptCommand(SCRCMD_BUFFERPARTYMOVENAME, ScrCm ScriptCommand(SCRCMD_GIVEJOURNAL, ScrCmd_GiveJournal) ScriptCommand(SCRCMD_CREATEJOURNALEVENT, ScrCmd_CreateJournalEvent) ScriptCommand(SCRCMD_UNUSED_1CE, ScrCmd_Unused_1CE) -ScriptCommand(SCRCMD_STRENGTH, ScrCmd_Strength) -ScriptCommand(SCRCMD_FLASH, ScrCmd_Flash) -ScriptCommand(SCRCMD_DEFOG, ScrCmd_Defog) +ScriptCommand(SCRCMD_DOSTRENGTHFUNC, ScrCmd_DoStrengthFunc) +ScriptCommand(SCRCMD_DOFLASHFUNC, ScrCmd_DoFlashFunc) +ScriptCommand(SCRCMD_DODEFOGFUNC, ScrCmd_DoDefogFunc) ScriptCommand(SCRCMD_ADDACCESSORY, ScrCmd_AddAccessory) ScriptCommand(SCRCMD_CANFITACCESSORY, ScrCmd_CanFitAccessory) ScriptCommand(SCRCMD_UNUSED_1D4, ScrCmd_Unused_1D4) @@ -520,14 +520,14 @@ ScriptCommand(SCRCMD_MESSAGESEENBANLISTSPECIES, ScrCm ScriptCommand(SCRCMD_GETPREVIOUSMAPID, ScrCmd_GetPreviousMapID) ScriptCommand(SCRCMD_GETCURRENTMAPID, ScrCmd_GetCurrentMapID) ScriptCommand(SCRCMD_STARTENDSAFARIGAME, ScrCmd_StartEndSafariGame) -ScriptCommand(SCRCMD_203, ScrCmd_203) +ScriptCommand(SCRCMD_WARPTOCOLOSSEUM, ScrCmd_WarpToColosseum) ScriptCommand(SCRCMD_204, ScrCmd_204) ScriptCommand(SCRCMD_205, ScrCmd_205) ScriptCommand(SCRCMD_STARTGREATMARSHLOOKOUT, ScrCmd_StartGreatMarshLookout) ScriptCommand(SCRCMD_GETCURNETID, ScrCmd_GetCurNetID) ScriptCommand(SCRCMD_DRAWPOKEMONPREVIEW, ScrCmd_DrawPokemonPreview) ScriptCommand(SCRCMD_REMOVEPOKEMONPREVIEW, ScrCmd_RemovePokemonPreview) -ScriptCommand(SCRCMD_20A, ScrCmd_20A) +ScriptCommand(SCRCMD_STARTVSSEEKER, ScrCmd_StartVsSeeker) ScriptCommand(SCRCMD_SETMOVECODEFORFACINGDIRECTION, ScrCmd_SetMoveCodeForFacingDirection) ScriptCommand(SCRCMD_MESSAGEFROMTRAINERTYPE, ScrCmd_MessageFromTrainerType) ScriptCommand(SCRCMD_20D, ScrCmd_20D) @@ -574,7 +574,7 @@ ScriptCommand(SCRCMD_CALLTVBROADCAST, ScrCm ScriptCommand(SCRCMD_SAVETVSEGMENTHIDDENITEM, ScrCmd_SaveTVSegmentHiddenItem) ScriptCommand(SCRCMD_CALLTVINTERVIEW, ScrCmd_CallTVInterview) ScriptCommand(SCRCMD_CHECKTVINTERVIEWELIGIBLE, ScrCmd_CheckTVInterviewEligible) -ScriptCommand(SCRCMD_239, ScrCmd_239) +ScriptCommand(SCRCMD_OPENBATTLEREGULATIONMENU, ScrCmd_OpenBattleRegulationMenu) ScriptCommand(SCRCMD_GETPARTYMONFOOTPRINTTYPE, ScrCmd_GetPartyMonFootprintType) ScriptCommand(SCRCMD_PLAYPOKECENTERHEALINGANIMATION, ScrCmd_PlayPokecenterHealingAnimation) ScriptCommand(SCRCMD_PLAYELEVATORANIMATION, ScrCmd_PlayElevatorAnimation) @@ -642,9 +642,9 @@ ScriptCommand(SCRCMD_REMOVEACCESSORY, ScrCm ScriptCommand(SCRCMD_USEVISTALIGHTHOUSEBINOCULARS, ScrCmd_UseVistaLighthouseBinoculars) ScriptCommand(SCRCMD_INITDAILYRANDOMLEVEL, ScrCmd_InitDailyRandomLevel) ScriptCommand(SCRCMD_27C, ScrCmd_27C) -ScriptCommand(SCRCMD_27D, ScrCmd_27D) +ScriptCommand(SCRCMD_TRYBUFFERANDUNLOCKRANDOMTOUGHWORD, ScrCmd_TryBufferAndUnlockRandomToughWord) ScriptCommand(SCRCMD_CHECKISDEPARTMENTSTOREREGULAR, ScrCmd_CheckIsDepartmentStoreRegular) -ScriptCommand(SCRCMD_27F, ScrCmd_27F) +ScriptCommand(SCRCMD_CHECKALLTOUGHWORDSUNLOCKED, ScrCmd_CheckAllToughWordsUnlocked) ScriptCommand(SCRCMD_BUFFERVARPADDINGDIGITS, ScrCmd_BufferVarPaddingDigits) ScriptCommand(SCRCMD_GETPARTYMONCONTESTSTAT, ScrCmd_GetPartyMonContestStat) ScriptCommand(SCRCMD_CHECKISTODAYPLAYERBIRTHDAY, ScrCmd_CheckIsTodayPlayerBirthday) @@ -675,13 +675,13 @@ ScriptCommand(SCRCMD_CHECKBATTLEPOINTS, ScrCm ScriptCommand(SCRCMD_GetExchangeServiceCornerItemAndCost, ScrCmd_GetExchangeServiceCornerItemAndCost) ScriptCommand(SCRCMD_CALCULATETRAINERINFOAPPEARANCE, ScrCmd_CalculateTrainerInfoAppearance) ScriptCommand(SCRCMD_ADDMENUENTRY, ScrCmd_AddMenuEntry) -ScriptCommand(SCRCMD_29E, ScrCmd_29E) +ScriptCommand(SCRCMD_STARTDESTROYOBSTACLEANIMATION, ScrCmd_StartDestroyObstacleAnimation) ScriptCommand(SCRCMD_29F, ScrCmd_29F) ScriptCommand(SCRCMD_STARTTAGBATTLE, ScrCmd_StartTagBattle) ScriptCommand(SCRCMD_UNUSED_2A1, ScrCmd_Unused_2A1) ScriptCommand(SCRCMD_TRYSETUNUSEDCOLLECTEDORBFLAG, ScrCmd_TrySetUnusedCollectedOrbFlag) -ScriptCommand(SCRCMD_2A3, ScrCmd_2A3) -ScriptCommand(SCRCMD_2A4, ScrCmd_2A4) +ScriptCommand(SCRCMD_CHECKHASWIFILISTVALIDLOGIN, ScrCmd_CheckHasWiFiListValidLogin) +ScriptCommand(SCRCMD_GETWIFLISTVALIDFRIENDSCOUNT, ScrCmd_GetWiFListValidFriendsCount) ScriptCommand(SCRCMD_OPENPARTYMENUFORTRADE, ScrCmd_OpenPartyMenuForTrade) ScriptCommand(SCRCMD_GETGAMECORNERPRIZEDATA, ScrCmd_GetGameCornerPrizeData) ScriptCommand(SCRCMD_CHECKITEMISPLATE, ScrCmd_CheckItemIsPlate) @@ -802,13 +802,13 @@ ScriptCommand(SCRCMD_STARTGIRATINAORIGINBATTLE, ScrCm ScriptCommand(SCRCMD_SETSPECIESSEEN, ScrCmd_SetSpeciesSeen) ScriptCommand(SCRCMD_GETCURRENTSAFARIGAMECAUGHTNUM, ScrCmd_GetCurrentSafariGameCaughtNum) ScriptCommand(SCRCMD_FINDPARTYSLOTWITHFATEFULENCOUNTERSPECIES, ScrCmd_FindPartySlotWithFatefulEncounterSpecies) -ScriptCommand(SCRCMD_31D, ScrCmd_31D) +ScriptCommand(SCRCMD_TRYREVERTPARTYPOKEMONFORMS, ScrCmd_TryRevertPartyPokemonForms) ScriptCommand(SCRCMD_TRYREVERTPOKEMONFORM, ScrCmd_TryRevertPokemonForm) ScriptCommand(SCRCMD_RESETDISTORTIONWORLDPERSISTEDCAMERAANGLES, ScrCmd_ResetDistortionWorldPersistedCameraAngles) ScriptCommand(SCRCMD_DODWWARP, ScrCmd_DoDWWarp) ScriptCommand(SCRCMD_STARTDISTORTIONWORLDGIRATINASHADOWEVENT, ScrCmd_StartDistortionWorldGiratinaShadowEvent) ScriptCommand(SCRCMD_FINISHDISTORTIONWORLDGIRATINASHADOWEVENT, ScrCmd_FinishDistortionWorldGiratinaShadowEvent) -ScriptCommand(SCRCMD_323, ScrCmd_323) +ScriptCommand(SCRCMD_CHECKNOWIFIPLAZACOOLDOWN, ScrCmd_CheckNoWiFiPlazaCooldown) ScriptCommand(SCRCMD_GETBATTLEHALLRECORDKEEPERSTATS, ScrCmd_GetBattleHallRecordKeeperStats) ScriptCommand(SCRCMD_GETNUMSPECIESWITHBATTLEHALLRECORDS, ScrCmd_GetNumSpeciesWithBattleHallRecords) ScriptCommand(SCRCMD_GETBATTLEHALLTOTALSINGLESRECORD, ScrCmd_GetBattleHallTotalSinglesRecord) diff --git a/include/easy_chat_args.h b/include/easy_chat_args.h index 913cb0af7d..4dfed818dc 100644 --- a/include/easy_chat_args.h +++ b/include/easy_chat_args.h @@ -1,11 +1,10 @@ #ifndef POKEPLATINUM_EASY_CHAT_ARGS_H #define POKEPLATINUM_EASY_CHAT_ARGS_H -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "pokedex.h" #include "savedata.h" @@ -18,8 +17,8 @@ typedef struct EasyChatArgs { u8 unk_05; int frame; const Pokedex *pokedex; - const UnkStruct_02014EC4 *unk_10; - Sentence sentence; + const UnlockedEasyChatWords *unlockedWords; + EasyChatSentence sentence; u16 words[MAX_EASY_CHAT_WORDS]; u8 padding[4]; } EasyChatArgs; @@ -28,23 +27,23 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 param1, SaveData *saveData, enum He void EasyChatArgs_Free(EasyChatArgs *args); void EasyChatArgs_SetOneWord(EasyChatArgs *args, u16 word); void EasyChatArgs_SetTwoWords(EasyChatArgs *args, u16 word1, u16 word2); -void EasyChatArgs_SetSentence(EasyChatArgs *args, const Sentence *sentence); +void EasyChatArgs_SetSentence(EasyChatArgs *args, const EasyChatSentence *sentence); void EasyChatArgs_FlagAsUnmodified(EasyChatArgs *args); void sub_02097520(EasyChatArgs *args); BOOL EasyChatArgs_IsUnmodified(const EasyChatArgs *args); BOOL EasyChatArgs_WasUpdated(const EasyChatArgs *args); u16 EasyChatArgs_GetOneWord(const EasyChatArgs *args); void EasyChatArgs_CopyTwoWordsTo(const EasyChatArgs *args, u16 *dest); -void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, Sentence *dest); +void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, EasyChatSentence *dest); u32 EasyChatArgs_GetType(const EasyChatArgs *args); u32 EasyChatArgs_GetInstructionBankEntry(const EasyChatArgs *args); int EasyChatArgs_GetFrame(const EasyChatArgs *args); const Pokedex *EasyChatArgs_GetPokedex(const EasyChatArgs *args); -const UnkStruct_02014EC4 *sub_02097560(const EasyChatArgs *args); +const UnlockedEasyChatWords *EasyChatArgs_GetUnlockedWords(const EasyChatArgs *args); BOOL EasyChatArgs_IsGameCompleted(const EasyChatArgs *args); BOOL sub_02097568(const EasyChatArgs *args); -void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence *outSentence); -BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sentence *sentence); -void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *param1, const Sentence *param2); +void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, EasyChatSentence *outSentence); +BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence); +void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *param1, const EasyChatSentence *param2); #endif // POKEPLATINUM_EASY_CHAT_ARGS_H diff --git a/include/easy_chat_sentence.h b/include/easy_chat_sentence.h new file mode 100644 index 0000000000..679e896635 --- /dev/null +++ b/include/easy_chat_sentence.h @@ -0,0 +1,46 @@ +#ifndef POKEPLATINUM_EASY_CHAT_SENTENCE_H +#define POKEPLATINUM_EASY_CHAT_SENTENCE_H + +#include "constants/heap.h" + +#include "string_gf.h" + +#define MAX_EASY_CHAT_SENTENCE_WORD_SLOTS 2 + +#define FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1 3 + +typedef struct EasyChatSentence { + u16 type; + u16 id; + u16 words[MAX_EASY_CHAT_SENTENCE_WORD_SLOTS]; +} EasyChatSentence; + +enum EasyChatSentenceType { + EASY_CHAT_SENTENCE_TYPE_NONE = 0xFFFF, + EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE = 0, + EASY_CHAT_SENTENCE_TYPE_WIN, + EASY_CHAT_SENTENCE_TYPE_LOSS, + EASY_CHAT_SENTENCE_TYPE_GENERAL, + EASY_CHAT_SENTENCE_TYPE_UNION_ROOM, + EASY_CHAT_SENTENCE_TYPE_COUNT, +}; + +void EasyChatSentence_Init(EasyChatSentence *sentence); +void EasyChatSentence_InitWithType(EasyChatSentence *sentence, u32 type); +void EasyChatSentence_InitWithEnteredUnionRoom(EasyChatSentence *sentence); +void EasyChatSentence_SetDefaultFrontierFields(EasyChatSentence *sentence, int type); +String *EasyChatSentence_ToString(const EasyChatSentence *sentence, enum HeapID heapID); +String *EasyChatSentence_GetTemplateString(const EasyChatSentence *sentence, enum HeapID heapID); +BOOL EasyChatSentence_IsValid(const EasyChatSentence *sentence); +BOOL EasyChatSentence_IsComplete(const EasyChatSentence *sentence); +u16 EasyChatSentence_GetWord(const EasyChatSentence *sentence, int slot); +u32 EasyChatSentence_GetType(const EasyChatSentence *sentence); +u32 EasyChatSentence_GetID(const EasyChatSentence *sentence); +BOOL EasyChatSentence_Compare(const EasyChatSentence *sentence1, const EasyChatSentence *sentence2); +void EasyChatSentence_Copy(EasyChatSentence *dest, const EasyChatSentence *src); +u32 EasyChatSentence_GetBankEntryCountForType(u32 type); +void EasyChatSentence_SetTypeAndID(EasyChatSentence *sentence, u32 type, u32 id); +void EasyChatSentence_SetWord(EasyChatSentence *sentence, u32 index, u16 word); +void EasyChatSentence_ClearUnusedWords(EasyChatSentence *sentence); + +#endif // POKEPLATINUM_EASY_CHAT_SENTENCE_H diff --git a/include/easy_chat_words.h b/include/easy_chat_words.h new file mode 100644 index 0000000000..ba40f641c5 --- /dev/null +++ b/include/easy_chat_words.h @@ -0,0 +1,61 @@ +#ifndef POKEPLATINUM_EASY_CHAT_WORDS_H +#define POKEPLATINUM_EASY_CHAT_WORDS_H + +#include "message.h" +#include "savedata.h" +#include "string_gf.h" + +#define WORD_NONE 0xFFFF + +enum EasyChatWordTextBank { + EASY_CHAT_WORD_TEXT_BANK_SPECIES_NAME = 0, + EASY_CHAT_WORD_TEXT_BANK_MOVE_NAMES_UPPERCASE, + EASY_CHAT_WORD_TEXT_BANK_POKEMON_TYPE_NAMES, + EASY_CHAT_WORD_TEXT_BANK_ABILITY_NAMES_UPPERCASE, + EASY_CHAT_WORD_TEXT_BANK_TRAINER_WORDS, + EASY_CHAT_WORD_TEXT_BANK_PEOPLE_WORDS, + EASY_CHAT_WORD_TEXT_BANK_GREETINGS, + EASY_CHAT_WORD_TEXT_BANK_LIFESTYLE_WORDS, + EASY_CHAT_WORD_TEXT_BANK_FEELINGS, + EASY_CHAT_WORD_TEXT_BANK_TOUGH_WORDS, + EASY_CHAT_WORD_TEXT_BANK_UNION_WORDS, + EASY_CHAT_WORD_TEXT_BANK_COUNT, +}; + +typedef struct UnlockedEasyChatWords { + u32 unlockedGreetingBits; + u32 unlockedToughWordBits; +} UnlockedEasyChatWords; + +typedef struct EasyChatWordLoader { + enum HeapID heapID; + MessageLoader *loaders[EASY_CHAT_WORD_TEXT_BANK_COUNT]; +} EasyChatWordLoader; + +typedef struct UnkStruct_02014FB0 { + u32 unk_00; + u32 *unk_04; +} UnkStruct_02014FB0; + +EasyChatWordLoader *EasyChatWordLoader_New(enum HeapID heapID); +void EasyChatWordLoader_Free(EasyChatWordLoader *wordLoader); +void EasyChatWordLoader_GetString(EasyChatWordLoader *wordLoader, u16 word, String *out); +void EasyChatWord_ToString(u16 word, String *out); +u16 EasyChatWord_FromBankAndEntry(u32 bankID, u32 bankEntry); +BOOL EasyChatWord_GetLoaderIndexAndEntry(u16 word, u32 *outLoaderIndex, u32 *outBankEntry); +u32 UnlockedEasyChatWords_SaveSize(void); +void UnlockedEasyChatWords_Init(UnlockedEasyChatWords *unlockedWords); +UnlockedEasyChatWords *SaveData_GetUnlockedEasyChatWords(SaveData *saveData); +BOOL EasyChatWords_IsToughWordUnlocked(const UnlockedEasyChatWords *unlockedWords, u32 bankEntry); +u32 EasyChatWords_TryUnlockRandomToughWord(UnlockedEasyChatWords *unlockedWords); +BOOL EasyChatWords_AreAllToughWordsUnlocked(UnlockedEasyChatWords *unlockedWords); +u16 EasyChatWords_GetToughWordFromBankEntry(u32 bankEntry); +BOOL EasyChatWords_IsGreetingUnlocked(const UnlockedEasyChatWords *unlockedWords, int bankEntry); +void EasyChatWords_UnlockGreeting(UnlockedEasyChatWords *unlockedWords, int bankEntry); +UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID); +void sub_02014FF0(UnkStruct_02014FB0 *param0); +u32 sub_02015004(const UnkStruct_02014FB0 *param0); +u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1); +s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1); + +#endif // POKEPLATINUM_EASY_CHAT_WORDS_H diff --git a/include/mail.h b/include/mail.h index 52e86f0062..bdeed9954e 100644 --- a/include/mail.h +++ b/include/mail.h @@ -3,9 +3,8 @@ #include "constants/string.h" -#include "struct_defs/sentence.h" - #include "charcode.h" +#include "easy_chat_sentence.h" #include "savedata.h" #define MAIL_TYPE_NONE 0xFFFF @@ -47,7 +46,7 @@ typedef struct Mail { charcode_t trainerName[TRAINER_NAME_LEN + 1]; MailIconData iconData[MAIL_MAX_ICONS]; u16 platExclusiveFormIcons; - Sentence sentences[MAIL_MAX_SENTENCES]; + EasyChatSentence sentences[MAIL_MAX_SENTENCES]; } Mail; typedef struct Mailbox { @@ -68,8 +67,8 @@ u8 Mail_GetLanguage(const Mail *mail); u8 Mail_GetGameVersion(const Mail *mail); u16 Mail_GetIconData(const Mail *mail, u8 index, enum MailIconDataType type, u16 platExclusiveFormIcons); u16 Mail_GetPlatExclusiveFormIcons(const Mail *mail); -Sentence *Mail_GetSentence(Mail *mail, u8 index); -void Mail_SetSentence(Mail *mail, Sentence *sentence, u8 index); +EasyChatSentence *Mail_GetSentence(Mail *mail, u8 index); +void Mail_SetSentence(Mail *mail, EasyChatSentence *sentence, u8 index); Mailbox *SaveData_GetMailbox(SaveData *saveData); int Mailbox_SaveSize(void); void Mailbox_Init(Mailbox *mailbox); diff --git a/include/map_tile_behavior.h b/include/map_tile_behavior.h index c37124ae74..3b4ff0320c 100644 --- a/include/map_tile_behavior.h +++ b/include/map_tile_behavior.h @@ -29,7 +29,7 @@ BOOL TileBehavior_IsTownMap(u8 behavior); BOOL TileBehavior_IsPastoriaGymHighGround(u8 behavior); BOOL TileBehavior_IsPastoriaGymMiddleGround(u8 behavior); BOOL TileBehavior_IsPastoriaGymLowGround(u8 behavior); -BOOL TileBehavior_IsPastoriaGymWater(u8 behavior); +BOOL TileBehavior_HasDynamicHeightCollision(u8 behavior); BOOL TileBehavior_IsEscalatorFlipFace(u8 behavior); BOOL TileBehavior_IsEscalator(u8 behavior); BOOL TileBehavior_IsWarpStairsEast(u8 behavior); diff --git a/include/overlay005/ov5_021F428C.h b/include/overlay005/ov5_021F428C.h deleted file mode 100644 index c0c7dced16..0000000000 --- a/include/overlay005/ov5_021F428C.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef POKEPLATINUM_OV5_021F428C_H -#define POKEPLATINUM_OV5_021F428C_H - -#include "field/field_system_decl.h" -#include "overlay005/field_effect_manager.h" - -#include "overworld_anim_manager.h" - -void *ov5_021F428C(FieldEffectManager *param0); -void ov5_021F42A8(void *param0); -void ov5_021F42D8(FieldEffectManager *param0, int param1, int param2); -OverworldAnimManager *ov5_021F4474(FieldSystem *fieldSystem, int param1, int param2, fx32 param3); -void ov5_021F44A4(OverworldAnimManager *param0); -BOOL ov5_021F453C(OverworldAnimManager *param0); -OverworldAnimManager *ov5_021F4668(FieldSystem *fieldSystem, int param1, int param2, fx32 param3); -void ov5_021F4698(OverworldAnimManager *param0, int param1, BOOL param2); -void ov5_021F4714(OverworldAnimManager *param0, fx32 param1); -BOOL ov5_021F4720(OverworldAnimManager *param0); - -#endif // POKEPLATINUM_OV5_021F428C_H diff --git a/include/overlay005/ov5_021F6454.h b/include/overlay005/ov5_021F6454.h index 59d67c9341..95a4b1bbaf 100644 --- a/include/overlay005/ov5_021F6454.h +++ b/include/overlay005/ov5_021F6454.h @@ -5,7 +5,7 @@ BOOL ScrCmd_ShowBattleHallRecordMonSelectionMenu(ScriptContext *ctx); BOOL ScrCmd_JudgeStats(ScriptContext *ctx); -BOOL ScrCmd_31D(ScriptContext *param0); +BOOL ScrCmd_TryRevertPartyPokemonForms(ScriptContext *ctx); BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0); BOOL ScrCmd_2F1(ScriptContext *param0); BOOL ScrCmd_GetPartyRotomCountAndFirst(ScriptContext *ctx); diff --git a/include/overlay005/veilstone_gym_object_renderer.h b/include/overlay005/veilstone_gym_object_renderer.h new file mode 100644 index 0000000000..1d08e8e6a4 --- /dev/null +++ b/include/overlay005/veilstone_gym_object_renderer.h @@ -0,0 +1,22 @@ +#ifndef POKEPLATINUM_VEILSTONE_GYM_OBJECT_RENDERER_H +#define POKEPLATINUM_VEILSTONE_GYM_OBJECT_RENDERER_H + +#include "field/field_system_decl.h" +#include "overlay005/field_effect_manager.h" + +#include "overworld_anim_manager.h" + +void *VeilstoneGymObjectRenderer_New(FieldEffectManager *fieldEffMan); +void VeilstoneGymObjectRenderer_Free(void *context); +void VeilstoneGymObjectRenderer_InitContext(FieldEffectManager *fieldEffMan, int numTireStacks, int numPunchingBags); + +OverworldAnimManager *VeilstoneGymObjectRenderer_InitTireStackRenderer(FieldSystem *fieldSystem, int x, int z, fx32 yOffset); +void VeilstoneGymObjectRenderer_PlayToppleTireStackAnim(OverworldAnimManager *animManager); +BOOL VeilstoneGymObjectRenderer_IsTireStackAnimationFinished(OverworldAnimManager *animManager); + +OverworldAnimManager *VeilstoneGymObjectRenderer_InitPunchingBagRenderer(FieldSystem *fieldSystem, int x, int z, fx32 yOffset); +void VeilstoneGymObjectRenderer_StartPunchingBagAnimation(OverworldAnimManager *animManager, int animId, BOOL isMoving); +void VeilstoneGymObjectRenderer_UpdateBagFrameDelta(OverworldAnimManager *animManager, fx32 frameDelta); +BOOL VeilstoneGymObjectRenderer_IsPunchingBagAnimFinished(OverworldAnimManager *animManager); + +#endif // POKEPLATINUM_VEILSTONE_GYM_OBJECT_RENDERER_H diff --git a/include/overlay007/battle_regulation_menu.h b/include/overlay007/battle_regulation_menu.h new file mode 100644 index 0000000000..e6ab978935 --- /dev/null +++ b/include/overlay007/battle_regulation_menu.h @@ -0,0 +1,8 @@ +#ifndef POKEPLATINUM_BATTLE_REGULATION_MENU_H +#define POKEPLATINUM_BATTLE_REGULATION_MENU_H + +#include "field_task.h" + +void OpenBattleRegulationMenu(FieldTask *task, u16 *result); + +#endif // POKEPLATINUM_BATTLE_REGULATION_MENU_H diff --git a/include/overlay007/ov7_0224B4E8.h b/include/overlay007/ov7_0224B4E8.h deleted file mode 100644 index 843e1fad09..0000000000 --- a/include/overlay007/ov7_0224B4E8.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef POKEPLATINUM_OV7_0224B4E8_H -#define POKEPLATINUM_OV7_0224B4E8_H - -#include "field_task.h" - -void ov7_0224BE7C(FieldTask *param0, u16 *param1); - -#endif // POKEPLATINUM_OV7_0224B4E8_H diff --git a/include/overlay008/ov8_02249960.h b/include/overlay008/gym_features.h similarity index 93% rename from include/overlay008/ov8_02249960.h rename to include/overlay008/gym_features.h index 551ce588f4..acd5a97fec 100644 --- a/include/overlay008/ov8_02249960.h +++ b/include/overlay008/gym_features.h @@ -1,5 +1,5 @@ -#ifndef POKEPLATINUM_OV8_02249960_H -#define POKEPLATINUM_OV8_02249960_H +#ifndef POKEPLATINUM_GYM_FEATURES_H +#define POKEPLATINUM_GYM_FEATURES_H #include "struct_decls/map_object.h" @@ -39,6 +39,10 @@ typedef struct EternaGymClockPersistedFeature { u32 state; } EternaGymClockPersistedFeature; +typedef struct VeilstoneGymPersistedFeature { + int initialized; +} VeilstoneGymPersistedFeature; + typedef struct PastoriaGymPersistedFeature { u8 pressedButton; } PastoriaGymPersistedFeature; @@ -63,31 +67,36 @@ typedef struct SunyshoreGymPersistedFeatures { int roomID; } SunyshoreGymPersistedFeatures; -void PastoriaGym_PressButton(FieldSystem *fieldSystem); -BOOL PastoriaGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); -void PastoriaGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); -void HearthomeGym_MoveLift(FieldSystem *fieldSystem); -void CanalaveGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); -BOOL CanalaveGym_CheckIfPlayerOnPlatform(FieldSystem *fieldSystem); -void CanalaveGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); -BOOL CanalaveGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); -void SunyshoreGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); -void SunyshoreGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); -BOOL SunyshoreGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); -void SunyshoreGym_PressButton(FieldSystem *fieldSystem, const u8 buttonType); void EternaGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); void EternaGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); BOOL EternaGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *outIsColliding); BOOL EternaGym_AdvanceClockState(FieldSystem *fieldSystem, Window *window, MessageLoader *msgLoader, String *msgBuf); BOOL EternaGym_IsHourHandJumpTile(FieldSystem *fieldSystem, int tileX, int tileZ, int direction); + void VeilstoneGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); void VeilstoneGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); BOOL VeilstoneGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); -BOOL ov8_0224BF4C(FieldSystem *fieldSystem); +BOOL VeilstoneGym_HitPunchingBag(FieldSystem *fieldSystem); + +void PastoriaGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); +BOOL PastoriaGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); +void PastoriaGym_PressButton(FieldSystem *fieldSystem); + void HearthomeGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); void HearthomeGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); +void HearthomeGym_MoveLift(FieldSystem *fieldSystem); BOOL HearthomeGym_CheckIfPlayerSeesTrainer(FieldSystem *fieldSystem); BOOL HearthomeGym_SetTrainerPostBattleMovement(FieldSystem *fieldSystem, MapObject *trainerObj); BOOL HearthomeGym_CheckIfEnteredIncorrectDoor(FieldSystem *fieldSystem, int playerX, int playerZ, int *transitionDir); -#endif // POKEPLATINUM_OV8_02249960_H +void CanalaveGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); +void CanalaveGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); +BOOL CanalaveGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); +BOOL CanalaveGym_CheckIfPlayerOnPlatform(FieldSystem *fieldSystem); + +void SunyshoreGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem); +void SunyshoreGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem); +BOOL SunyshoreGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const int tileX, const int tileZ, const fx32 height, BOOL *isColliding); +void SunyshoreGym_PressButton(FieldSystem *fieldSystem, const u8 buttonType); + +#endif // POKEPLATINUM_GYM_FEATURES_H diff --git a/include/overlay009/ov9_02249960.h b/include/overlay009/ov9_02249960.h index 12228ea3f8..88247bf108 100644 --- a/include/overlay009/ov9_02249960.h +++ b/include/overlay009/ov9_02249960.h @@ -89,9 +89,9 @@ int DistWorld_GetMapObjectRotatorAnimFrame(FieldSystem *fieldSystem, MapObject * void DistWorld_BindMapObjectRotator(FieldSystem *fieldSystem, Billboard *billboard, int initialAngle); void DistWorld_UnbindMapObjectRotator(FieldSystem *fieldSystem, const Billboard *billboard); BOOL DistWorld_HandlePlayerMoved(FieldSystem *fieldSystem, enum FaceDirection playerDir); -BOOL ov9_0224A67C(FieldSystem *fieldSystem, int param1); -BOOL ov9_0224A71C(FieldSystem *fieldSystem); -BOOL ov9_0224A800(FieldSystem *fieldSystem, int param1); +BOOL DistWorld_HandlePlayerMovementEnd(FieldSystem *fieldSystem, enum FaceDirection playerDir); +BOOL DistWorld_HandlePlayerPositionChanged(FieldSystem *fieldSystem); +BOOL DistWorld_CheckMapTransition(FieldSystem *fieldSystem, enum FaceDirection transitionDir); void DistWorld_RenderInactiveFloor(FieldSystem *fieldSystem); void DistWorld_TickInactiveFloor(FieldSystem *fieldSystem); void DistWorld_StartGiratinaShadowEvent(FieldSystem *fieldSystem, u16 eventIndex); @@ -103,13 +103,13 @@ BOOL DistWorld_IsBoulderAtFallLocation(const MapObject *boulderMapObj); DistWorldFallingBoulder *DistWorldFallingBoulder_New(FieldSystem *fieldSystem, FieldTask *boulderFieldTask, MapObject *boulderMapObj); BOOL DistWorldFallingBoulder_Tick(DistWorldFallingBoulder *boulder); void DistWorld_ApplyGiratinaSpritePalette(FieldSystem *fieldSystem); -BOOL ov9_02250F74(FieldSystem *fieldSystem); +BOOL DistWorld_ArePersistedFeaturesInit(FieldSystem *fieldSystem); BOOL DistWorld_CheckCollisionOnCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ); BOOL DistWorld_IsValidTileOnCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ); -BOOL ov9_02250FD8(FieldSystem *fieldSystem, int param1, int param2, int param3); -void ov9_02251000(FieldSystem *fieldSystem, int param1, int param2, int param3); +BOOL DistWorld_AreCoordsValidOnCurrentFloatingPlatformKind(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ); +void DistWorld_FindAndPrepareNewCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ); BOOL DistWorld_GetTileBehaviorOnCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ, u32 *tileBehavior); void DistWorld_LoadFloorOffsets(int mapHeaderID, int *offsetTileX, int *offsetAltitude, int *offsetTileZ); -BOOL ov9_022511A0(FieldSystem *fieldSystem, int param1, int param2, int param3); +BOOL DistWorld_IsBlockedByCynthia(FieldSystem *fieldSystem, int tileX, int tileZ, int tileY); #endif // POKEPLATINUM_OV9_02249960_H diff --git a/include/overlay061/struct_ov61_0222AE80.h b/include/overlay061/struct_ov61_0222AE80.h index c572dfb813..4227fcf55b 100644 --- a/include/overlay061/struct_ov61_0222AE80.h +++ b/include/overlay061/struct_ov61_0222AE80.h @@ -1,17 +1,17 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222AE80_H #define POKEPLATINUM_STRUCT_OV61_0222AE80_H -#include "struct_defs/sentence.h" - #include "overlay061/struct_ov61_0222AE80_sub1.h" #include "overlay061/struct_ov61_0222AE80_sub2.h" #include "overlay062/struct_ov62_02239DA4_sub1.h" +#include "easy_chat_sentence.h" + typedef struct { u32 integrity; UnkStruct_ov61_0222AE80_sub1 unk_04; u32 unk_24; - Sentence title; + EasyChatSentence title; UnkStruct_ov61_0222AE80_sub2 unk_30[10]; u8 unk_58; u8 language; diff --git a/include/overlay061/struct_ov61_0222AFC0.h b/include/overlay061/struct_ov61_0222AFC0.h index 44b1922dff..42d4d82ca8 100644 --- a/include/overlay061/struct_ov61_0222AFC0.h +++ b/include/overlay061/struct_ov61_0222AFC0.h @@ -1,10 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222AFC0_H #define POKEPLATINUM_STRUCT_OV61_0222AFC0_H -#include "struct_defs/sentence.h" - #include "overlay062/struct_ov62_02239DA4_sub1.h" +#include "easy_chat_sentence.h" + typedef struct { u16 unk_00[8]; u32 unk_10; @@ -21,7 +21,7 @@ typedef struct { u8 unk_1E; u8 unk_1F; union { - Sentence unk_20_val1; + EasyChatSentence unk_20_val1; u16 unk_20_val2[40]; }; u8 unk_70[12]; diff --git a/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h b/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h index 29688407e9..d549ff25e9 100644 --- a/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h +++ b/include/overlay061/struct_ov61_0222BED8_sub2_sub1_sub1.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H #define POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct { u8 unk_00; @@ -12,8 +12,8 @@ typedef struct { u32 unk_0C; u32 unk_10; u16 unk_14[8]; - Sentence unk_24; - Sentence unk_2C; + EasyChatSentence unk_24; + EasyChatSentence unk_2C; } UnkStruct_ov61_0222BED8_sub2_sub1_sub1; #endif // POKEPLATINUM_STRUCT_OV61_0222BED8_SUB2_SUB1_SUB1_H diff --git a/include/overlay104/frontier_data_transfer.h b/include/overlay104/frontier_data_transfer.h index c0c70cb439..3ea4d1a1f7 100644 --- a/include/overlay104/frontier_data_transfer.h +++ b/include/overlay104/frontier_data_transfer.h @@ -10,9 +10,9 @@ typedef struct FrontierTrainerDataDTO { u16 trainerType; u16 unk_06; u16 trainerName[TRAINER_NAME_LEN + 1]; - u16 unk_18[4]; - u16 unk_20[4]; - u16 unk_28[4]; + u16 introMsg[4]; + u16 winMsg[4]; + u16 loseMsg[4]; } FrontierTrainerDataDTO; typedef struct FrontierPokemonDataDTO { diff --git a/include/overlay104/frscrcmd_battle_hall.h b/include/overlay104/frscrcmd_battle_hall.h index 787ad9d67d..38f59e330b 100644 --- a/include/overlay104/frscrcmd_battle_hall.h +++ b/include/overlay104/frscrcmd_battle_hall.h @@ -3,14 +3,14 @@ #include "overlay104/defs.h" -BOOL FrontierScrCmd_8B(FrontierScriptContext *param0); +BOOL FrontierScrCmd_InitBattleHall(FrontierScriptContext *ctx); BOOL FrontierScrCmd_8C(FrontierScriptContext *param0); -BOOL FrontierScrCmd_8D(FrontierScriptContext *param0); +BOOL FrontierScrCmd_FreeBattleHall(FrontierScriptContext *ctx); BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx); BOOL FrontierScrCmd_BattleHall_CleanupBattle(FrontierScriptContext *ctx); BOOL FrontierScrCmd_BattleHall_StartBattle(FrontierScriptContext *ctx); BOOL FrontierScrCmd_CallBattleHallFunction(FrontierScriptContext *ctx); -BOOL FrontierScrCmd_BattleHall_CheckWonBattle(FrontierScriptContext *param0); +BOOL FrontierScrCmd_BattleHall_CheckWonBattle(FrontierScriptContext *ctx); BOOL FrontierScrCmd_93(FrontierScriptContext *param0); BOOL FrontierScrCmd_94(FrontierScriptContext *param0); BOOL FrontierScrCmd_95(FrontierScriptContext *param0); diff --git a/include/overlay104/ov104_0222DCE0.h b/include/overlay104/ov104_0222DCE0.h index 5a75531cde..74021352da 100644 --- a/include/overlay104/ov104_0222DCE0.h +++ b/include/overlay104/ov104_0222DCE0.h @@ -16,11 +16,11 @@ #include "string_template.h" #include "trainer_info.h" -BattleFrontierTrainerData *BattleTower_GetTrainerDataFromTrainerIDAndNarcID(u16 battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID); +BattleFrontierTrainerData *BattleFrontier_GetTrainerDataFromTrainerIDAndNarcID(u16 battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID); void BattleTower_GetMonDataFromSetIDAndNarcID(BattleFrontierPokemonData *monData, int setID, enum NarcID narcID); -BattleFrontierTrainerData *BattleTower_GetTrainerData(FrontierTrainerDataDTO *trDataDTO, int battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID); +BattleFrontierTrainerData *BattleFrontier_GetTrainerData(FrontierTrainerDataDTO *trDataDTO, int battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID); u32 ov104_0222DD6C(FrontierPokemonDataDTO *param0, u16 param1, u32 param2, u32 param3, u8 param4, u8 param5, BOOL param6, int param7, enum NarcID narcID); -void ov104_0222DF40(const FrontierPokemonDataDTO *param0, Pokemon *param1, u8 param2); +void FrontierPokemonDataDTO_InitPokemon(const FrontierPokemonDataDTO *pokemonDTO, Pokemon *mon, u8 param2); u16 BattleTower_GetObjectIDFromTrainerClass(u8 trainerClass); void ov104_0222E134(SaveData *saveData, Pokemon *param1); void ov104_0222E1C0(SaveData *saveData, Party *party, Pokemon *param2); @@ -28,7 +28,7 @@ void BattleCastle_UpdateMonSpriteAnimID(Sprite *sprite, u8 animID); void BattleCastle_UpdateMonSpritePosition(Sprite *sprite, s16 x, s16 y, u8 isSelected); u8 BattleCastle_GetPokeIconAnimID(u16 hp, u16 maxHp); void ov104_0222E278(FrontierDataDTO *param0, u16 param1, enum HeapID heapID, int param3); -void ov104_0222E284(FieldBattleDTO *param0, FrontierTrainerDataDTO *param1, int param2, int battlerId, enum HeapID heapID); +void FieldBattleDTO_InitFrontierTrainer(FieldBattleDTO *battleDTO, FrontierTrainerDataDTO *trDataDTO, int unused, int battlerId, enum HeapID heapID); u32 ov104_0222E2F0(FrontierPokemonDataDTO *param0, u16 param1, int param2, u8 param3, u32 param4, int param5, int param6); void ov104_0222E330(FrontierPokemonDataDTO *param0, u16 param1[], u8 param2[], u32 param3[], u32 param4[], int param5, int param6, int param7); u8 ov104_0222E3A8(u16 param0); @@ -36,6 +36,6 @@ BOOL ov104_0222E3E4(BattleFrontierTrainerData *param0, const u16 param1[], const void ov104_0222E4BC(u8 param0, u16 param1, u16 param2, u16 *param3, FrontierPokemonDataDTO *param4, u8 *param5, u32 *param6, u8 param7); void BattleFrontier_SetPartnerInStrTemplate(StringTemplate *template, u32 idx); enum ObjectEventGfx BattleFrontier_GetPlayerObjEventGfx(const TrainerInfo *param0); -void ov104_0222E630(SaveData *saveData); +void BattleFrontier_FlagGeonetLinkInfo(SaveData *saveData); #endif // POKEPLATINUM_OV104_0222DCE0_H diff --git a/include/overlay104/ov104_02234DB4.h b/include/overlay104/ov104_02234DB4.h index c96ef580ae..6f7388fbce 100644 --- a/include/overlay104/ov104_02234DB4.h +++ b/include/overlay104/ov104_02234DB4.h @@ -5,12 +5,12 @@ #include "savedata.h" -BattleHall *ov104_02234DB4(SaveData *saveData, u16 param1, u8 param2, u8 param3, u8 param4); +BattleHall *BattleHall_Init(SaveData *saveData, u16 resumingFromSave, u8 challengeType, u8 partySlot1, u8 partySlot2); void ov104_022350B0(BattleHall *param0, u16 param1); -void ov104_02235190(BattleHall *param0); +void BattleHall_Free(BattleHall *battleHall); void BattleHall_GetTypeSelectionAppResult(BattleHall *battleHall, void *args); void BattleHall_UpdateWinRecordForCurrentMon(BattleHall *battleHall, u16 *updated); -void ov104_0223526C(BattleHall *param0, u8 param1); +void BattleHall_Save(BattleHall *battleHall, u8 saveType); u16 ov104_022354B0(BattleHall *param0); u16 ov104_022354BC(BattleHall *param0); u16 ov104_022354C0(BattleHall *param0, u8 param1); diff --git a/include/overlay104/ov104_0223A0C4.h b/include/overlay104/ov104_0223A0C4.h index 7430e59600..922bf8906a 100644 --- a/include/overlay104/ov104_0223A0C4.h +++ b/include/overlay104/ov104_0223A0C4.h @@ -11,8 +11,8 @@ #include "savedata.h" BOOL BattleTower_CreateTrainerParty(BattleTower *battleTower, FrontierDataDTO *opponentDataDTO, u16 battleTowerTrainerID, int partySize, u16 *species, u16 *items, UnkStruct_0204B404 *param6, enum HeapID heapID); -void ov104_0223A30C(SaveData *saveData, FrontierDataDTO *param1, const u8 param2); -FieldBattleDTO *ov104_0223A580(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1); +void BattleTower_CreateWiFiTrainerParty(SaveData *saveData, FrontierDataDTO *dto, const u8 opponentID); +FieldBattleDTO *FieldBattleDTO_NewBattleTower(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1); void ov104_0223A734(BattleTower *battleTower, u16 param1); u16 ov104_0223A750(BattleTower *battleTower, const u16 *param1); int BattleTower_GetTrainerMessagesBankID(u8 challengeMode); diff --git a/include/overlay104/ov104_0223A7F4.h b/include/overlay104/ov104_0223A7F4.h index 4d76571072..5822c5d275 100644 --- a/include/overlay104/ov104_0223A7F4.h +++ b/include/overlay104/ov104_0223A7F4.h @@ -11,15 +11,15 @@ void ov104_0223A860(u8 param0, int param1, u16 param2[], u8 param3); const UnkStruct_ov104_0224028C *ov104_0223A8A8(int param0, int param1); BOOL ov104_0223A918(const u16 param0[], const u16 param1[], int param2, int param3, u16 param4[], int param5, const UnkStruct_ov104_0224028C *param6, u16 param7, u8 param8[]); -u8 BattleFactory_GetPartySize(u8 param0); -u8 ov104_0223AA74(u8 param0, BOOL param1); +u8 BattleFactory_GetPlayerPartySize(u8 challengeType); +u8 BattleFactory_GetOpponentPartySize(u8 challengeType, BOOL param1); void ov104_0223AAA0(u16 param0, u8 param1, u16 *param2, FrontierPokemonDataDTO *param3, u8 *param4, u32 *param5, u16 param6, u16 *param7, u16 *param8); void ov104_0223AB0C(u8 param0, u16 param1, u8 param2, FrontierPokemonDataDTO *param3, u16 *param4, FrontierPokemonDataDTO *param5, u8 *param6, u32 *param7, int param8); -FieldBattleDTO *ov104_0223ABA0(BattleFactory *param0, UnkStruct_ov104_02230BE4 *param1); -u8 ov104_0223ADA0(BattleFactory *param0); -void ov104_0223ADB0(BattleFactory *param0); -void ov104_0223AE30(BattleFactory *param0); +FieldBattleDTO *FieldBattleDTO_NewBattleFactory(BattleFactory *battleFactory, UnkStruct_ov104_02230BE4 *param1); +u8 BattleFactory_GetPokemonLevel(BattleFactory *battleFactory); +void ov104_0223ADB0(BattleFactory *battleFactory); +void ov104_0223AE30(BattleFactory *battleFactory); BOOL BattleFactory_IsMultiplayerChallenge(u8 challengeType); -u16 ov104_0223AF34(BattleFactory *param0); +u16 ov104_0223AF34(BattleFactory *battleFactory); #endif // POKEPLATINUM_OV104_0223A7F4_H diff --git a/include/overlay104/ov104_0223AF58.h b/include/overlay104/ov104_0223AF58.h index 22c0f274e9..a014be0efe 100644 --- a/include/overlay104/ov104_0223AF58.h +++ b/include/overlay104/ov104_0223AF58.h @@ -11,13 +11,13 @@ void ov104_0223AF58(u8 param0, u8 param1, u8 param2, u8 param3, u16 param4[]); void ov104_0223AFB4(u8 param0, u8 param1, int param2, u8 param3, u8 param4, u16 param5[]); void ov104_0223B0C8(u8 param0, u8 param1, u8 param2, u8 param3, u16 param4, u16 param5[], u8 param6); -FieldBattleDTO *ov104_0223B250(BattleHall *param0, UnkStruct_ov104_02230BE4 *param1); -u8 BattleHall_GetPartySize(u8 param0); -u8 ov104_0223B50C(u8 param0); +FieldBattleDTO *FieldBattleDTO_NewBattleHall(BattleHall *battleHall, UnkStruct_ov104_02230BE4 *param1); +u8 BattleHall_GetPlayerPartySize(u8 challengeType); +u8 BattleHall_GetOpponentPartySize(u8 challengeType); u8 BattleHall_CursorPosToType(u8 cursorPos); BOOL BattleHall_IsMultiPlayerChallenge(u8 challengeType); -u8 ov104_0223B5C0(BattleHall *param0); -u16 BattleHall_GetHighestLevelInParty(BattleHall *param0); -fx32 BattleHall_GetLevelSquareRoot(u32 param0); +u8 ov104_0223B5C0(BattleHall *battleHall); +u16 BattleHall_GetHighestLevelInParty(BattleHall *battleHall); +fx32 BattleHall_GetLevelSquareRoot(u32 level); #endif // POKEPLATINUM_OV104_0223AF58_H diff --git a/include/overlay104/ov104_0223B6F4.h b/include/overlay104/ov104_0223B6F4.h index 6786122a4b..d96c8fe142 100644 --- a/include/overlay104/ov104_0223B6F4.h +++ b/include/overlay104/ov104_0223B6F4.h @@ -12,17 +12,17 @@ #include "pokemon.h" void ov104_0223B760(u8 param0, int param1, u16 param2[], u8 param3); -u8 BattleCastle_GetPartySize(u8 challengeType, BOOL includePartnersMons); -u8 ov104_0223B7DC(u8 param0, BOOL param1); -FieldBattleDTO *ov104_0223B810(BattleCastle *param0, UnkStruct_ov104_02230BE4 *param1); -u8 ov104_0223BA10(BattleCastle *param0); +u8 BattleCastle_GetPlayerPartySize(u8 challengeType, BOOL includePartnersMons); +u8 BattleCastle_GetOpponentPartySize(u8 challengeType, BOOL param1); +FieldBattleDTO *FieldBattleDTO_NewBattleCastle(BattleCastle *battleCastle, UnkStruct_ov104_02230BE4 *param1); +u8 BattleCastle_GetOpponentLevel(BattleCastle *battleCastle); BOOL BattleCastle_IsMultiPlayerChallenge(u8 challengeType); void ov104_0223BA24(Party *param0); -void ov104_0223BA7C(BattleCastle *param0, Pokemon *param1); -void ov104_0223BAA0(BattleCastle *param0, Party *param1, Pokemon *param2); -void ov104_0223BAB8(BattleCastle *param0); -u16 ov104_0223BB60(BattleCastle *param0); -void ov104_0223BB84(BgConfig *param0, BattleCastle *param1, u32 param2); +void ov104_0223BA7C(BattleCastle *battleCastle, Pokemon *param1); +void ov104_0223BAA0(BattleCastle *battleCastle, Party *param1, Pokemon *param2); +void ov104_0223BAB8(BattleCastle *battleCastle); +u16 ov104_0223BB60(BattleCastle *battleCastle); +void ov104_0223BB84(BgConfig *param0, BattleCastle *battleCastle, u32 param2); u16 ov104_0223BC24(u16 param0); void ov104_0223BC2C(BattleFrontier *frontier, u8 challengeType, int castlePoints); diff --git a/include/overlay104/ov104_0223BCBC.h b/include/overlay104/ov104_0223BCBC.h index bcde614fc5..ab1a7b5786 100644 --- a/include/overlay104/ov104_0223BCBC.h +++ b/include/overlay104/ov104_0223BCBC.h @@ -9,16 +9,16 @@ #include "pokemon.h" void ov104_0223BD28(u8 param0, int param1, u16 param2[], u8 param3); -u8 BattleArcade_GetPartySize(u8 challengeType, BOOL includePartnerMons); +u8 BattleArcade_GetPlayerPartySize(u8 challengeType, BOOL includePartnerMons); u8 BattleArcade_GetOpponentPartySize(u8 challengeType, BOOL includeBothOpponents); -FieldBattleDTO *ov104_0223BDD8(BattleArcade *param0, UnkStruct_ov104_02230BE4 *param1); -u8 ov104_0223BFFC(BattleArcade *param0); +FieldBattleDTO *FieldBattleDTO_NewBattleArcade(BattleArcade *battleArcade, UnkStruct_ov104_02230BE4 *param1); +u8 BattleArcade_GetPokemonLevel(BattleArcade *battleArcade); BOOL BattleArcade_IsMultiPlayerChallenge(u8 challengeType); -void ov104_0223C010(BattleArcade *param0, Pokemon *param1); -void ov104_0223C034(BattleArcade *param0, Party *param1, Pokemon *param2); -void ov104_0223C04C(BattleArcade *param0); -u16 ov104_0223C0BC(BattleArcade *param0, u8 param1); -u16 ov104_0223C124(BattleArcade *param0); +void ov104_0223C010(BattleArcade *battleArcade, Pokemon *param1); +void ov104_0223C034(BattleArcade *battleArcade, Party *param1, Pokemon *param2); +void ov104_0223C04C(BattleArcade *battleArcade); +u16 ov104_0223C0BC(BattleArcade *battleArcade, u8 param1); +u16 ov104_0223C124(BattleArcade *battleArcade); u8 BattleArcade_GetCategoryFromEffect(u8 effect); #endif // POKEPLATINUM_OV104_0223BCBC_H diff --git a/include/overlay104/struct_battle_arcade.h b/include/overlay104/struct_battle_arcade.h index 45432323bf..3d186677e7 100644 --- a/include/overlay104/struct_battle_arcade.h +++ b/include/overlay104/struct_battle_arcade.h @@ -5,6 +5,7 @@ #include "overlay104/frontier_data_transfer.h" +#include "field_battle_data_transfer.h" #include "party.h" #include "savedata.h" #include "sprite.h" @@ -13,12 +14,12 @@ typedef struct BattleArcade { int unk_00; SaveData *saveData; UnkStruct_020304A0 *unk_08; - void *dto; + FieldBattleDTO *dto; u8 challengeType; u8 unk_11; u8 unk_12; u8 activeEffect; - int unk_14; + int weather; u16 currentStreak; u16 unk_1A; u8 unk_1C; @@ -35,9 +36,9 @@ typedef struct BattleArcade { ManagedSprite *unk_40[4]; ManagedSprite *unk_50[4]; ManagedSprite *unk_60[4]; - Party *unk_70; - Party *unk_74; - u16 unk_78[14]; + Party *playersParty; + Party *opponentsParty; + u16 trainerIDs[14]; u32 monHP[4]; u32 monAtk[4]; u32 monDef[4]; diff --git a/include/overlay104/struct_battle_castle.h b/include/overlay104/struct_battle_castle.h index 6988b0e863..86ce4d4580 100644 --- a/include/overlay104/struct_battle_castle.h +++ b/include/overlay104/struct_battle_castle.h @@ -5,6 +5,7 @@ #include "overlay104/frontier_data_transfer.h" +#include "field_battle_data_transfer.h" #include "party.h" #include "savedata.h" @@ -12,7 +13,7 @@ typedef struct BattleCastle { int unk_00; SaveData *saveData; UnkStruct_020302DC *unk_08; - void *unk_0C; + FieldBattleDTO *dto; u8 challengeType; u8 unk_11; u8 unk_12; @@ -25,9 +26,9 @@ typedef struct BattleCastle { u16 unk_22; u8 unk_24[3]; u8 unk_27; - Party *unk_28; - Party *unk_2C; - u16 unk_30[14]; + Party *playersParty; + Party *opponentsParty; + u16 trainerIDs[14]; FrontierDataDTO unk_4C[2]; u16 unk_26C[4]; u8 unk_274[4]; diff --git a/include/overlay104/struct_battle_factory.h b/include/overlay104/struct_battle_factory.h index 16427e82dc..0ccf4aeb7f 100644 --- a/include/overlay104/struct_battle_factory.h +++ b/include/overlay104/struct_battle_factory.h @@ -5,6 +5,7 @@ #include "overlay104/frontier_data_transfer.h" +#include "field_battle_data_transfer.h" #include "party.h" #include "savedata.h" #include "sys_task_manager.h" @@ -22,7 +23,7 @@ typedef struct BattleFactory { u16 unk_0E; u32 unk_10; int wonBattle; - u16 unk_18[14]; + u16 trainerIDs[14]; FrontierDataDTO unk_34[2]; u16 unk_254[6]; u8 unk_260[6]; @@ -34,13 +35,13 @@ typedef struct BattleFactory { u32 unk_3E0[4]; FrontierPokemonDataDTO unk_3F0[4]; u16 unk_4D0; - Party *unk_4D4; - Party *unk_4D8; + Party *playersParty; + Party *opponentsParty; u16 unk_4DC[6]; u16 unk_4E8[6]; UnkStruct_0202FF58 *unk_4F4; SaveData *saveData; - void *unk_4FC; + FieldBattleDTO *dto; SysTask *unk_500; u16 unk_504[60]; u8 unk_57C; diff --git a/include/overlay104/struct_battle_hall.h b/include/overlay104/struct_battle_hall.h index 4de63947eb..d36f86310c 100644 --- a/include/overlay104/struct_battle_hall.h +++ b/include/overlay104/struct_battle_hall.h @@ -1,47 +1,49 @@ #ifndef POKEPLATINUM_STRUCT_BATTLE_HALL_H #define POKEPLATINUM_STRUCT_BATTLE_HALL_H -#include "struct_decls/struct_02030114_decl.h" +#include "constants/battle_frontier.h" + +#include "struct_defs/pokemon.h" #include "overlay104/frontier_data_transfer.h" +#include "battle_hall_save.h" #include "field_battle_data_transfer.h" #include "party.h" -#include "pokemon.h" #include "savedata.h" typedef struct BattleHall { - int unk_00; + int unused; u8 challengeType; u8 unk_05; - u8 unk_06; + u8 streakActive; u8 unk_07; u16 currentStreak; - u16 unk_0A; + u16 currentRound; fx32 playerLevelSqrt; u32 unk_10; int wonBattle; - u16 unk_18[20]; + u16 trainerIDs[BATTLES_PER_ROUND_HALL * 2]; FrontierDataDTO unk_40[2]; - u8 unk_260[2]; - Party *unk_264; + u8 partySlots[2]; + Party *party; u16 unk_268[20]; FrontierPokemonDataDTO unk_290[20]; u16 unk_6F0; u16 selectedTypeIdx2; u8 selectedType; u8 selectedTypeIdx; - UnkStruct_02030114 *unk_6F8; + BattleHallSave *hallSave; SaveData *saveData; - FieldBattleDTO *unk_700; - u8 unk_704[4][9]; - u16 unk_728[2]; + FieldBattleDTO *dto; + u8 typeRanks[4][9]; + u16 heldItems[2]; u16 unk_72C[44]; u8 unk_784[512]; u8 unk_984[2][512]; u16 unk_D84[2]; u8 unk_D88; - Pokemon *unk_D8C; + Pokemon *partnersMon; u8 unk_D90; u32 unk_D94; } BattleHall; diff --git a/include/overlay104/struct_ov104_02230BE4.h b/include/overlay104/struct_ov104_02230BE4.h index d09e26276c..383ecc3472 100644 --- a/include/overlay104/struct_ov104_02230BE4.h +++ b/include/overlay104/struct_ov104_02230BE4.h @@ -16,8 +16,8 @@ typedef struct { BagCursor *bagCursor; int unk_14; int unk_18; - int unk_1C; - u8 *unk_20; + int mapHeaderID; + u8 *subscreenCursorOn; u8 sceneID; FieldSystem *fieldSystem; } UnkStruct_ov104_02230BE4; diff --git a/include/player_avatar.h b/include/player_avatar.h index ed0ff08d81..9816a4b388 100644 --- a/include/player_avatar.h +++ b/include/player_avatar.h @@ -14,37 +14,31 @@ #include "location.h" #include "overworld_anim_manager.h" -enum PlayerAvatarForm { - PLAYER_AVATAR_WALKING = 0, - PLAYER_AVATAR_BIKING, - PLAYER_AVATAR_SURFING, -}; - -enum PlayerAvatarFlagUnk00 { - UNK_00_0 = (1 << 0), - UNK_00_1 = (1 << 1), - UNK_00_2 = (1 << 2), - UNK_00_ON_CYCLING_ROAD = (1 << 3), - UNK_00_ESCAPED_FROM_DEEP_MUD = (1 << 4), - UNK_00_5 = (1 << 5), - UNK_00_6 = (1 << 6), - UNK_00_7 = (1 << 7), - UNK_00_8 = (1 << 8), - UNK_00_9 = (1 << 9), - UNK_00_10 = (1 << 10), - UNK_00_11 = (1 << 11), - UNK_00_12 = (1 << 12) +enum PlayerAvatarMovementFlag { + AVATAR_MOVE_FORCED = (1 << 0), + AVATAR_MOVE_IGNORE_TILE_BEHAVIOR = (1 << 1), + AVATAR_MOVE_BIKE_BRAKE = (1 << 2), + AVATAR_MOVE_ON_CYCLING_ROAD = (1 << 3), + AVATAR_MOVE_ESCAPED_FROM_DEEP_MUD = (1 << 4), + AVATAR_MOVE_MOVE_THROUGH_MUD = (1 << 5), + AVATAR_MOVE_STEP = (1 << 6), + AVATAR_MOVE_FORCED_RETAIN_SPEED = (1 << 7), + AVATAR_MOVE_DISTORTION_ACTIVE = (1 << 8), + AVATAR_MOVE_DISTORTION_FLOOR = (1 << 9), + AVATAR_MOVE_DISTORTION_WEST_WALL = (1 << 10), + AVATAR_MOVE_DISTORTION_EAST_WALL = (1 << 11), + AVATAR_MOVE_DISTORTION_CEILING = (1 << 12) }; typedef struct PlayerAvatar { - u32 unk_00; - u32 unk_04; - u32 unk_08; - int unk_0C; + u32 movementFlag; + u32 requestStateFlag; + u32 movementAction; + int movementActionSpeed; u32 unk_10; - int unk_14; - int unk_18; - int unk_1C; + int moveState; + int playerMoveState; + int playerAvatarState; int gender; int speed; enum FaceDirection faceLeftOrRight; @@ -55,38 +49,37 @@ typedef struct PlayerAvatar { const PlayerData *playerConst; } PlayerAvatar; -PlayerAvatar *PlayerAvatar_Init(const MapObjectManager *param0, int param1, int param2, int param3, int param4, int param5, int param6, PlayerData *param7); -PlayerAvatar *sub_0205E820(const MapObjectManager *param0, PlayerData *param1, int gender); -void PlayerAvatar_InitDraw(PlayerAvatar *playerAvatar, int dynamicMapFeaturesID); -void Player_Delete(PlayerAvatar *playerAvatar); -void Player_DeleteAll(PlayerAvatar *playerAvatar); -MapObject *sub_0205EA24(const MapObjectManager *param0); -int PlayerAvatar_GetDir(PlayerAvatar *const playerAvatar); -void Player_SetDir(PlayerAvatar *playerAvatar, int param1); -int PlayerAvatar_GetMoveDir(PlayerAvatar *const playerAvatar); +PlayerAvatar *PlayerAvatar_New(const MapObjectManager *param0, int param1, int param2, int param3, int param4, int param5, int param6, PlayerData *param7); +PlayerAvatar *PlayerAvatar_NewLoad(const MapObjectManager *param0, PlayerData *param1, int gender); +void PlayerAvatar_InitMapFeatures(PlayerAvatar *playerAvatar, int dynamicMapFeaturesID); +void PlayerAvatar_Free(PlayerAvatar *playerAvatar); +void PlayerAvatar_Delete(PlayerAvatar *playerAvatar); +MapObject *MapObjectMan_GetPlayerMapObject(const MapObjectManager *param0); +int PlayerAvatar_GetFacingDir(PlayerAvatar *const playerAvatar); +void PlayerAvatar_TryFace(PlayerAvatar *playerAvatar, int param1); +int PlayerAvatar_GetMovingDir(PlayerAvatar *const playerAvatar); int PlayerAvatar_GetDistortionDir(PlayerAvatar *const playerAvatar); -int Player_GetXPos(PlayerAvatar *const playerAvatar); -int Player_GetZPos(PlayerAvatar *const playerAvatar); +int PlayerAvatar_GetXPos(PlayerAvatar *const playerAvatar); +int PlayerAvatar_GetZPos(PlayerAvatar *const playerAvatar); int PlayerAvatar_XPosPrev(PlayerAvatar *const playerAvatar); int PlayerAvatar_ZPosPrev(PlayerAvatar *const playerAvatar); -void PlayerAvatar_PosVectorOut(PlayerAvatar *const playerAvatar, VecFx32 *param1); -const VecFx32 *PlayerAvatar_PosVector(PlayerAvatar *const playerAvatar); -void sub_0205EB08(PlayerAvatar *playerAvatar, int param1); -int PlayerAvatar_MoveState(const PlayerAvatar *playerAvatar); -void sub_0205EB10(PlayerAvatar *playerAvatar, int param1); -int Player_MoveState(const PlayerAvatar *playerAvatar); +void PlayerAvatar_GetPosPtr(PlayerAvatar *const playerAvatar, VecFx32 *param1); +const VecFx32 *PlayerAvatar_GetPos(PlayerAvatar *const playerAvatar); +void PlayerAvatar_SetMoveState(PlayerAvatar *playerAvatar, int param1); +int PlayerAvatar_GetPlayerMoveState(const PlayerAvatar *playerAvatar); +void PlayerAvatar_SetPlayerMoveState(PlayerAvatar *playerAvatar, int param1); void PlayerAvatar_SetVisible(PlayerAvatar *playerAvatar, BOOL visible); void PlayerAvatar_SetMapObject(PlayerAvatar *playerAvatar, MapObject *param1); -MapObject *Player_MapObject(PlayerAvatar *playerAvatar); -const MapObject *PlayerAvatar_ConstMapObject(const PlayerAvatar *playerAvatar); +MapObject *PlayerAvatar_GetMapObject(PlayerAvatar *playerAvatar); +const MapObject *PlayerAvatar_GetConstMapObject(const PlayerAvatar *playerAvatar); void PlayerAvatar_SetPlayerState(PlayerAvatar *playerAvatar, int param1); int PlayerAvatar_GetPlayerState(PlayerAvatar *playerAvatar); void PlayerAvatar_TurnOnRequestStateBit(PlayerAvatar *playerAvatar, u32 param1); void PlayerAvatar_SetRequestStateFlag(PlayerAvatar *playerAvatar, u32 param1); -u32 PlayerAvatar_RequestStateFlag(PlayerAvatar *playerAvatar); +u32 PlayerAvatar_GetRequestStateFlag(PlayerAvatar *playerAvatar); void PlayerAvatar_SetGender(PlayerAvatar *playerAvatar, int param1); -int PlayerAvatar_Gender(PlayerAvatar *playerAvatar); -int PlayerAvatar_Speed(PlayerAvatar *playerAvatar); +int PlayerAvatar_GetGender(PlayerAvatar *playerAvatar); +int PlayerAvatar_GetSpeed(PlayerAvatar *playerAvatar); void PlayerAvatar_SetSpeed(PlayerAvatar *playerAvatar, int param1); void PlayerAvatar_ClearSpeed(PlayerAvatar *playerAvatar); int PlayerAvatar_AddMoveSpeed(PlayerAvatar *playerAvatar, int param1, int param2); @@ -98,43 +91,43 @@ void PlayerAvatar_SetFaceDirection(PlayerAvatar *playerAvatar, enum FaceDirectio void PlayerAvatar_SetSurfMountAnimManager(PlayerAvatar *playerAvatar, OverworldAnimManager *surfMountAnimMan); OverworldAnimManager *PlayerAvatar_GetSurfMountAnimManager(PlayerAvatar *playerAvatar); PlayerData *PlayerAvatar_PlayerData(PlayerAvatar *playerAvatar); -void sub_0205EC10(PlayerAvatar *playerAvatar, u32 param1); -u32 sub_0205EC14(PlayerAvatar *playerAvatar); -void sub_0205EC18(PlayerAvatar *playerAvatar, int param1); -int sub_0205EC1C(PlayerAvatar *playerAvatar); -void sub_0205EC20(PlayerAvatar *playerAvatar, u32 param1, int param2); +void PlayerAvatar_SetMovementAction(PlayerAvatar *playerAvatar, u32 param1); +u32 PlayerAvatar_GetMovementAction(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetMovementActionSpeed(PlayerAvatar *playerAvatar, int param1); +int PlayerAvatar_GetMovementActionSpeed(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetMovementActionAndSpeed(PlayerAvatar *playerAvatar, u32 param1, int param2); void PlayerData_Init(PlayerData *param0); int PlayerData_HasRunningShoes(PlayerData *param0); void PlayerData_SetRunningShoes(PlayerData *param0, int param1); -int PlayerData_CyclingGear(PlayerData *param0); +int PlayerData_GetCyclingGear(PlayerData *param0); void PlayerData_SetCyclingGear(PlayerData *param0, int param1); void PlayerAvatar_SetCyclingGear(PlayerAvatar *playerAvatar, int param1); -int PlayerAvatar_CyclingGear(PlayerAvatar *playerAvatar); -void sub_0205ECB8(PlayerAvatar *playerAvatar, const VecFx32 *param1, int param2); -void sub_0205ECE0(PlayerAvatar *playerAvatar, int x, int z, int dir); +int PlayerAvatar_GetCyclingGear(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetPosDirFromVec(PlayerAvatar *playerAvatar, const VecFx32 *param1, int param2); +void PlayerAvatar_SetPosDirFromCoords(PlayerAvatar *playerAvatar, int x, int z, int dir); void Player_SetYPos(PlayerAvatar *playerAvatar, fx32 y); void PlayerAvatar_SetHeightCalculationEnabled(PlayerAvatar *playerAvatar, BOOL heightCalculationEnabled); void PlayerAvatar_SetHeightCalculationEnabledAndUpdate(PlayerAvatar *playerAvatar, BOOL heightCalculationEnabled); -int Player_MoveStateFromGender(int param0, int param1); +int Player_GetSpriteFromStateAndGender(int param0, int param1); u32 Player_ConvertStateToTransition(int param0); PlayerAvatar *FieldSystem_GetPlayerAvatar(FieldSystem *fieldSystem); -void sub_0205EF40(PlayerAvatar *playerAvatar, int param1); -BOOL sub_0205EF58(PlayerAvatar *playerAvatar); -void sub_0205EF6C(PlayerAvatar *playerAvatar, int param1); -BOOL sub_0205EF84(PlayerAvatar *playerAvatar); -void sub_0205EF98(PlayerAvatar *playerAvatar, int param1); -BOOL sub_0205EFB0(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetForceMovement(PlayerAvatar *playerAvatar, int param1); +BOOL PlayerAvatar_CheckForcedMovement(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetIgnoreTileBehavior(PlayerAvatar *playerAvatar, int param1); +BOOL PlayerAvatar_CheckIgnoreTileBehavior(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetBikeBrake(PlayerAvatar *playerAvatar, int param1); +BOOL PlayerAvatar_CheckBikeBrake(PlayerAvatar *playerAvatar); void PlayerAvatar_SetOnCyclingRoad(PlayerAvatar *playerAvatar, BOOL flag); BOOL PlayerAvatar_IsOnCyclingRoad(PlayerAvatar *playerAvatar); void PlayerAvatar_SetEscapedFromDeepMud(PlayerAvatar *playerAvatar, BOOL flag); BOOL PlayerAvatar_CheckEscapedFromDeepMud(PlayerAvatar *playerAvatar); -void sub_0205F01C(PlayerAvatar *playerAvatar, BOOL param1); -BOOL sub_0205F034(PlayerAvatar *playerAvatar); -void sub_0205F048(PlayerAvatar *playerAvatar); -void sub_0205F054(PlayerAvatar *playerAvatar); -BOOL sub_0205F060(PlayerAvatar *playerAvatar); -void sub_0205F074(PlayerAvatar *playerAvatar, BOOL param1); -int sub_0205F08C(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetMoveThroughMudFlag(PlayerAvatar *playerAvatar, BOOL param1); +BOOL PlayerAvatar_CheckMoveThroughMudFlag(PlayerAvatar *playerAvatar); +void PlayerAvatar_StartStep(PlayerAvatar *playerAvatar); +void PlayerAvatar_EndStep(PlayerAvatar *playerAvatar); +BOOL PlayerAvatar_CheckStep(PlayerAvatar *playerAvatar); +void PlayerAvatar_SetForceMovementRetainSpeed(PlayerAvatar *playerAvatar, BOOL param1); +int PlayerAvatar_CheckForcedMovementRetainSpeed(PlayerAvatar *playerAvatar); void PlayerAvatar_SetDistortionState(PlayerAvatar *playerAvatar, enum AvatarDistortionState state); enum AvatarDistortionState PlayerAvatar_MapDistortionState(PlayerAvatar *const playerAvatar); BOOL PlayerAvatar_DistortionGravityChanged(PlayerAvatar *const playerAvatar); diff --git a/include/unk_0202F180.h b/include/save_catchrecords.h similarity index 100% rename from include/unk_0202F180.h rename to include/save_catchrecords.h diff --git a/include/savedata_misc.h b/include/savedata_misc.h index 6ac280c551..6fa2beb431 100644 --- a/include/savedata_misc.h +++ b/include/savedata_misc.h @@ -4,9 +4,8 @@ #include "constants/savedata/save_table.h" #include "constants/string.h" -#include "struct_defs/sentence.h" - #include "berry_patches.h" +#include "easy_chat_sentence.h" #include "persisted_map_features.h" #include "savedata.h" #include "string_gf.h" @@ -30,7 +29,7 @@ typedef struct MiscSaveBlock { u8 vsRecorderColor : 4; u8 padding : 3; u32 unused; - Sentence introMsg; + EasyChatSentence introMsg; ExtraSaveKey extraKey; } MiscSaveBlock; @@ -48,8 +47,8 @@ void MiscSaveBlock_SetInitFlag(MiscSaveBlock *miscSave); u32 MiscSaveBlock_InitFlag(const MiscSaveBlock *miscSave); void MiscSaveBlock_SetFavoriteMon(MiscSaveBlock *miscSave, int species, int form, int isEgg); void MiscSaveBlock_GetFavoriteMon(const MiscSaveBlock *miscSave, int *species, int *form, int *isEgg); -void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, Sentence *message); -void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const Sentence *message); +void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, EasyChatSentence *message); +void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const EasyChatSentence *message); void MiscSaveBlock_VsRecorderColor(const MiscSaveBlock *miscSave, u8 *color); void MiscSaveBlock_SetVsRecorderColor(MiscSaveBlock *miscSave, u8 color); void MiscSaveBlock_ExtraSaveKey(const MiscSaveBlock *miscSave, int saveTableID, u32 *currKey, u32 *oldKey, u8 *keyFlag); diff --git a/include/scrcmd_system_flags.h b/include/scrcmd_system_flags.h index 53d828e186..c75727f3e8 100644 --- a/include/scrcmd_system_flags.h +++ b/include/scrcmd_system_flags.h @@ -20,8 +20,8 @@ BOOL ScrCmd_SetStepFlag(ScriptContext *ctx); BOOL ScrCmd_ClearStepFlag(ScriptContext *ctx); BOOL ScrCmd_CheckGameCompleted(ScriptContext *ctx); BOOL ScrCmd_SetGameCompleted(ScriptContext *ctx); -BOOL ScrCmd_Strength(ScriptContext *ctx); -BOOL ScrCmd_Flash(ScriptContext *ctx); -BOOL ScrCmd_Defog(ScriptContext *ctx); +BOOL ScrCmd_DoStrengthFunc(ScriptContext *ctx); +BOOL ScrCmd_DoFlashFunc(ScriptContext *ctx); +BOOL ScrCmd_DoDefogFunc(ScriptContext *ctx); #endif // POKEPLATINUM_SCRCMD_SYSTEM_FLAGS_H diff --git a/include/script_manager.h b/include/script_manager.h index 74731ecb6c..ed58845bbd 100644 --- a/include/script_manager.h +++ b/include/script_manager.h @@ -98,9 +98,9 @@ enum ScriptContextType { #define SCRIPT_ID_OFFSET_RECORD_CHATOT_CRY 8900 #define SCRIPT_ID_OFFSET_VS_SEEKER 8950 #define SCRIPT_ID_OFFSET_POKE_RADAR 8970 -#define SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_ATTENDANTS 9000 +#define SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_COMMON 9000 #define SCRIPT_ID_OFFSET_COMMUNICATION_CLUB 9100 -#define SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_ATTENDANTS 9200 +#define SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_COMMON 9200 #define SCRIPT_ID_OFFSET_GROUP_CONNECTION 9300 #define SCRIPT_ID_OFFSET_POFFIN_COMMON 9400 #define SCRIPT_ID_OFFSET_DAY_CARE_COMMON 9500 diff --git a/include/string_gf.h b/include/string_gf.h index a520ef13a9..dfb35d5435 100644 --- a/include/string_gf.h +++ b/include/string_gf.h @@ -1,6 +1,8 @@ #ifndef POKEPLATINUM_STRING_H #define POKEPLATINUM_STRING_H +#include "constants/string.h" + #include "charcode.h" /** @@ -24,8 +26,6 @@ typedef struct String { charcode_t data[1]; } String; -#include "generated/string_padding_mode.h" - /** * Control codes for which charset to use when formatting a string. */ diff --git a/include/string_template.h b/include/string_template.h index 3d99c88a42..28de837c5e 100644 --- a/include/string_template.h +++ b/include/string_template.h @@ -86,7 +86,7 @@ void StringTemplate_SetGymName(StringTemplate *template, u32 idx, u32 gym); void StringTemplate_SetTimeOfDay(StringTemplate *template, u32 idx, u32 timeOfDay); void StringTemplate_SetCountryName(StringTemplate *template, u32 idx, u32 country); void StringTemplate_SetCityName(StringTemplate *template, u32 idx, u32 country, u32 city); -void StringTemplate_SetCustomMessageWord(StringTemplate *template, u32 idx, u16 customMessageWord); +void StringTemplate_SetEasyChatWord(StringTemplate *template, u32 idx, u16 word); void StringTemplate_SetBallSealName(StringTemplate *template, u32 idx, u32 ballSeal); void StringTemplate_SetBallSealNamePlural(StringTemplate *template, u32 idx, u32 ballSeal); void StringTemplate_SetMetLocationName(StringTemplate *template, u32 idx, u32 location); diff --git a/include/struct_decls/struct_02014D38_decl.h b/include/struct_decls/struct_02014D38_decl.h deleted file mode 100644 index 3721f9fabc..0000000000 --- a/include/struct_decls/struct_02014D38_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014D38_DECL_H -#define POKEPLATINUM_STRUCT_02014D38_DECL_H - -typedef struct UnkStruct_02014D38_t UnkStruct_02014D38; - -#endif // POKEPLATINUM_STRUCT_02014D38_DECL_H diff --git a/include/struct_decls/struct_02014EC4_decl.h b/include/struct_decls/struct_02014EC4_decl.h deleted file mode 100644 index 8bacfd20c9..0000000000 --- a/include/struct_decls/struct_02014EC4_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014EC4_DECL_H -#define POKEPLATINUM_STRUCT_02014EC4_DECL_H - -typedef struct UnkStruct_02014EC4_t UnkStruct_02014EC4; - -#endif // POKEPLATINUM_STRUCT_02014EC4_DECL_H diff --git a/include/struct_decls/struct_02014FB0_decl.h b/include/struct_decls/struct_02014FB0_decl.h deleted file mode 100644 index 6d7af0793f..0000000000 --- a/include/struct_decls/struct_02014FB0_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02014FB0_DECL_H -#define POKEPLATINUM_STRUCT_02014FB0_DECL_H - -typedef struct UnkStruct_02014FB0_t UnkStruct_02014FB0; - -#endif // POKEPLATINUM_STRUCT_02014FB0_DECL_H diff --git a/include/struct_decls/struct_02030114_decl.h b/include/struct_decls/struct_02030114_decl.h deleted file mode 100644 index 450c93b4c8..0000000000 --- a/include/struct_decls/struct_02030114_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02030114_DECL_H -#define POKEPLATINUM_STRUCT_02030114_DECL_H - -typedef struct UnkStruct_02030114_t UnkStruct_02030114; - -#endif // POKEPLATINUM_STRUCT_02030114_DECL_H diff --git a/include/struct_decls/struct_0203026C_decl.h b/include/struct_decls/struct_0203026C_decl.h deleted file mode 100644 index 69591a63f4..0000000000 --- a/include/struct_decls/struct_0203026C_decl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_0203026C_DECL_H -#define POKEPLATINUM_STRUCT_0203026C_DECL_H - -typedef struct UnkStruct_0203026C_t UnkStruct_0203026C; - -#endif // POKEPLATINUM_STRUCT_0203026C_DECL_H diff --git a/include/struct_defs/battle_frontier.h b/include/struct_defs/battle_frontier.h index cfabafda63..a42d4c62ef 100644 --- a/include/struct_defs/battle_frontier.h +++ b/include/struct_defs/battle_frontier.h @@ -9,13 +9,12 @@ #include "struct_defs/struct_0202D764.h" #include "struct_defs/struct_0202FF58.h" #include "struct_defs/struct_020300F4.h" -#include "struct_defs/struct_02030114.h" -#include "struct_defs/struct_0203026C.h" #include "struct_defs/struct_020302DC.h" #include "struct_defs/struct_0203041C.h" #include "struct_defs/struct_020304A0.h" #include "struct_defs/struct_020305B8.h" +#include "battle_hall_save.h" #include "wifi_list.h" typedef struct BattleFrontierStats { @@ -28,7 +27,7 @@ typedef struct BattleFrontier { union { UnkStruct_0202D060 unk_8E0_val1; UnkStruct_0202FF58 unk_8E0_val2; - UnkStruct_02030114 unk_8E0_val3; + BattleHallSave hallSave; UnkStruct_020302DC unk_8E0_val4; UnkStruct_020304A0 unk_8E0_val5; }; @@ -41,8 +40,8 @@ typedef struct BattleFrontier { UnkStruct_020300F4 unk_00; } unk_1614; struct { - UnkStruct_0203026C unk_00; - } unk_1618; + BattleHallStreakFlags streakFlags; + } hall; struct { UnkStruct_0203041C unk_00; } unk_161C; diff --git a/include/struct_defs/battle_tower.h b/include/struct_defs/battle_tower.h index edcbbd1133..0e9d776196 100644 --- a/include/struct_defs/battle_tower.h +++ b/include/struct_defs/battle_tower.h @@ -9,6 +9,7 @@ #include "overlay104/frontier_data_transfer.h" +#include "field_battle_data_transfer.h" #include "location.h" typedef struct BattleTower { @@ -48,7 +49,7 @@ typedef struct BattleTower { u16 unk_83E[35]; u16 unk_884[35]; int wonBattle; - void *unk_8D0; + FieldBattleDTO *dto; u8 unk_8D4; u8 unk_8D5; u8 unk_8D6; diff --git a/include/struct_defs/dress_up_photo.h b/include/struct_defs/dress_up_photo.h index 685ea25004..5723636d57 100644 --- a/include/struct_defs/dress_up_photo.h +++ b/include/struct_defs/dress_up_photo.h @@ -3,7 +3,8 @@ #include "struct_defs/photo_accessory.h" #include "struct_defs/photo_pokemon.h" -#include "struct_defs/sentence.h" + +#include "easy_chat_sentence.h" #define PHOTO_ACCESSORY_COUNT 10 @@ -11,7 +12,7 @@ typedef struct DressUpPhoto { u32 integrity; PhotoPokemon photoMon; u32 unk_3C; - Sentence title; + EasyChatSentence title; PhotoAccessory accessories[PHOTO_ACCESSORY_COUNT]; u8 unk_70; u8 language; diff --git a/include/struct_defs/player_data.h b/include/struct_defs/player_data.h index 9fc981d493..a13d1eec72 100644 --- a/include/struct_defs/player_data.h +++ b/include/struct_defs/player_data.h @@ -4,7 +4,7 @@ typedef struct PlayerData { u16 cyclingGear; u16 runningShoes; - u32 form; + u32 playerState; } PlayerData; #endif // POKEPLATINUM_STRUCT_DEF_PLAYER_DATA_H diff --git a/include/struct_defs/sentence.h b/include/struct_defs/sentence.h deleted file mode 100644 index 2d4e3e12e9..0000000000 --- a/include/struct_defs/sentence.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_SENTENCE_H -#define POKEPLATINUM_STRUCT_SENTENCE_H - -typedef struct Sentence { - u16 type; - u16 id; - u16 words[2]; -} Sentence; - -#endif // POKEPLATINUM_STRUCT_SENTENCE_H diff --git a/include/struct_defs/struct_0202D080.h b/include/struct_defs/struct_0202D080.h index b435541d12..8999bedb2b 100644 --- a/include/struct_defs/struct_0202D080.h +++ b/include/struct_defs/struct_0202D080.h @@ -1,10 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_0202D080_H #define POKEPLATINUM_STRUCT_0202D080_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct UnkStruct_0202D080_t { - Sentence unk_00[4]; + EasyChatSentence unk_00[4]; } UnkStruct_0202D080; #endif // POKEPLATINUM_STRUCT_0202D080_H diff --git a/include/struct_defs/struct_0202D63C.h b/include/struct_defs/struct_0202D63C.h index 7cc5fe93c6..467aef82f1 100644 --- a/include/struct_defs/struct_0202D63C.h +++ b/include/struct_defs/struct_0202D63C.h @@ -1,11 +1,13 @@ #ifndef POKEPLATINUM_STRUCT_0202D63C_H #define POKEPLATINUM_STRUCT_0202D63C_H +#include "constants/string.h" + #include "overlay104/frontier_data_transfer.h" typedef struct UnkStruct_0202D63C_t { - FrontierPokemonDataDTO unk_00[3]; - u16 unk_A8[8]; + FrontierPokemonDataDTO monDataDTO[3]; + u16 trainerName[TRAINER_NAME_LEN + 1]; u8 unk_B8; u8 unk_B9; u8 unk_BA; @@ -20,10 +22,10 @@ typedef struct UnkStruct_0202D63C_t { }; u8 unk_C8_val2; }; - u8 unk_C9; - u16 unk_CA[4]; - u16 unk_D2[4]; - u16 unk_DA[4]; + u8 trainerType; + u16 introMsg[4]; + u16 winMsg[4]; + u16 loseMsg[4]; u16 unk_E2; } UnkStruct_0202D63C; diff --git a/include/struct_defs/struct_02030114.h b/include/struct_defs/struct_02030114.h deleted file mode 100644 index 58726fb911..0000000000 --- a/include/struct_defs/struct_02030114.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02030114_H -#define POKEPLATINUM_STRUCT_02030114_H - -typedef struct UnkStruct_02030114_t { - u8 unk_00_0 : 3; - u8 unk_00_3 : 1; - u8 unk_00_4 : 4; - u8 unk_01; - u8 unk_02[2]; - u16 unk_04[20]; - u16 unk_2C[20]; -} UnkStruct_02030114; - -#endif // POKEPLATINUM_STRUCT_02030114_H diff --git a/include/struct_defs/struct_0203026C.h b/include/struct_defs/struct_0203026C.h deleted file mode 100644 index f78127f7d4..0000000000 --- a/include/struct_defs/struct_0203026C.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_0203026C_H -#define POKEPLATINUM_STRUCT_0203026C_H - -typedef struct UnkStruct_0203026C_t { - u8 unk_00; - u8 unk_01; - u16 unk_02; -} UnkStruct_0203026C; - -#endif // POKEPLATINUM_STRUCT_0203026C_H diff --git a/include/struct_defs/struct_02030A80.h b/include/struct_defs/struct_02030A80.h index 351a7e6032..1ed63a4aca 100644 --- a/include/struct_defs/struct_02030A80.h +++ b/include/struct_defs/struct_02030A80.h @@ -1,9 +1,10 @@ #ifndef POKEPLATINUM_STRUCT_02030A80_H #define POKEPLATINUM_STRUCT_02030A80_H -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202F298_sub1.h" +#include "easy_chat_sentence.h" + typedef struct UnkStruct_02030A80_t { u16 unk_00[8]; u32 id; @@ -20,7 +21,7 @@ typedef struct UnkStruct_02030A80_t { u8 unk_1E; u8 unk_1F; union { - Sentence unk_20_val1; + EasyChatSentence unk_20_val1; u16 unk_20_val2[40]; }; u8 unk_70[12]; diff --git a/include/struct_defs/struct_0203330C.h b/include/struct_defs/struct_0203330C.h index 3e0f5b18c6..d5cb4dfd12 100644 --- a/include/struct_defs/struct_0203330C.h +++ b/include/struct_defs/struct_0203330C.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_0203330C_H #define POKEPLATINUM_STRUCT_0203330C_H -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" typedef struct { u32 unk_00; @@ -9,7 +9,7 @@ typedef struct { u8 unk_05; u8 unk_06; u8 unk_07; - Sentence unk_08; + EasyChatSentence unk_08; u8 unk_10[32]; u8 unk_30[32]; u32 padding_50; diff --git a/include/struct_defs/struct_0205C924.h b/include/struct_defs/struct_0205C924.h index d5d5a56fad..3b9fbcab78 100644 --- a/include/struct_defs/struct_0205C924.h +++ b/include/struct_defs/struct_0205C924.h @@ -1,8 +1,7 @@ #ifndef POKEPLATINUM_STRUCT_0205C924_H #define POKEPLATINUM_STRUCT_0205C924_H -#include "struct_defs/sentence.h" - +#include "easy_chat_sentence.h" #include "string_gf.h" typedef struct { @@ -11,7 +10,7 @@ typedef struct { String *unk_08; u32 unk_0C; int unk_10; - Sentence unk_14; + EasyChatSentence unk_14; } UnkStruct_0205C924; #endif // POKEPLATINUM_STRUCT_0205C924_H diff --git a/include/struct_defs/struct_02071BF8.h b/include/struct_defs/struct_02071BF8.h deleted file mode 100644 index 9497e3fbd6..0000000000 --- a/include/struct_defs/struct_02071BF8.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef POKEPLATINUM_STRUCT_02071BF8_H -#define POKEPLATINUM_STRUCT_02071BF8_H - -typedef struct { - int unk_00; -} UnkStruct_02071BF8; - -#endif // POKEPLATINUM_STRUCT_02071BF8_H diff --git a/include/struct_defs/trainer.h b/include/struct_defs/trainer.h index e4de20d13a..e6b5793b60 100644 --- a/include/struct_defs/trainer.h +++ b/include/struct_defs/trainer.h @@ -3,17 +3,16 @@ #include "constants/string.h" -#include "struct_defs/sentence.h" #include "struct_defs/trainer_data.h" #include "charcode.h" +#include "easy_chat_sentence.h" typedef struct Trainer { TrainerHeader header; - charcode_t name[TRAINER_NAME_LEN + 1]; - Sentence winMsg; - Sentence loseMsg; + EasyChatSentence winMsg; + EasyChatSentence loseMsg; } Trainer; #endif // POKEPLATINUM_STRUCT_TRAINER_H diff --git a/include/unk_02014A84.h b/include/unk_02014A84.h deleted file mode 100644 index 4b3c1dd4c5..0000000000 --- a/include/unk_02014A84.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02014A84_H -#define POKEPLATINUM_UNK_02014A84_H - -#include "constants/heap.h" - -#include "struct_defs/sentence.h" - -#include "string_gf.h" - -void Sentence_Init(Sentence *sentence); -void Sentence_InitWithType(Sentence *sentence, u32 type); -void sub_02014AB4(Sentence *sentence); -void sub_02014AC4(Sentence *sentence, int param1); -String *Sentence_AsString(const Sentence *sentence, enum HeapID heapID); -String *Sentence_GetTemplateString(const Sentence *sentence, u32 param1); -BOOL Sentence_IsValid(const Sentence *sentence); -BOOL Sentence_IsComplete(const Sentence *sentence); -u16 Sentence_GetWord(const Sentence *sentence, int slot); -u32 Sentence_GetType(const Sentence *sentence); -u32 Sentence_GetID(const Sentence *sentence); -BOOL sub_02014C88(const Sentence *param0, const Sentence *param1); -void Sentence_Copy(Sentence *dest, const Sentence *src); -u32 sub_02014CD4(u32 param0); -void sub_02014CE0(Sentence *sentence, u32 param1, u32 param2); -void Sentence_SetWord(Sentence *sentence, u32 index, u16 word); -void Sentence_ClearUnusedWords(Sentence *sentence); - -#endif // POKEPLATINUM_UNK_02014A84_H diff --git a/include/unk_02014D38.h b/include/unk_02014D38.h deleted file mode 100644 index df8924c10d..0000000000 --- a/include/unk_02014D38.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02014D38_H -#define POKEPLATINUM_UNK_02014D38_H - -#include "struct_decls/struct_02014D38_decl.h" -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_decls/struct_02014FB0_decl.h" - -#include "savedata.h" -#include "string_gf.h" - -UnkStruct_02014D38 *sub_02014D38(enum HeapID heapID); -void sub_02014D70(UnkStruct_02014D38 *param0); -void sub_02014D90(UnkStruct_02014D38 *param0, u16 param1, String *param2); -void sub_02014DB8(u16 param0, String *param1); -u16 sub_02014DFC(u32 param0, u32 param1); -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2); -u32 Sentence_SaveSize(void); -void SentenceSaveData_Init(void *param0); -UnkStruct_02014EC4 *sub_02014EC4(SaveData *saveData); -BOOL sub_02014ED8(const UnkStruct_02014EC4 *param0, u32 param1); -u32 sub_02014EE4(UnkStruct_02014EC4 *param0); -BOOL sub_02014F48(UnkStruct_02014EC4 *param0); -u16 sub_02014F64(u32 param0); -BOOL sub_02014F8C(const UnkStruct_02014EC4 *param0, int param1); -void sub_02014F98(UnkStruct_02014EC4 *param0, int param1); -UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID); -void sub_02014FF0(UnkStruct_02014FB0 *param0); -u32 sub_02015004(const UnkStruct_02014FB0 *param0); -u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1); -s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1); - -#endif // POKEPLATINUM_UNK_02014D38_H diff --git a/include/unk_0202D05C.h b/include/unk_0202D05C.h index 138a5a70f0..e447100737 100644 --- a/include/unk_0202D05C.h +++ b/include/unk_0202D05C.h @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202D080_decl.h" #include "struct_decls/struct_0202D750_decl.h" #include "struct_decls/struct_0202D764_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202D314.h" #include "struct_defs/struct_02049A68.h" @@ -16,6 +15,7 @@ #include "overlay096/struct_ov96_0223B450_sub2.h" #include "overlay104/frontier_data_transfer.h" +#include "easy_chat_sentence.h" #include "savedata.h" #define BATTLE_POINTS_FUNC_NONE 0 @@ -46,8 +46,8 @@ u16 sub_0202D3FC(UnkStruct_0202D750 *param0, u16 param1, u16 param2); BOOL sub_0202D414(UnkStruct_0202D750 *param0, u16 param1, int param2); void sub_0202D470(UnkStruct_0202D750 *param0, u32 param1); u32 sub_0202D474(UnkStruct_0202D750 *param0); -void sub_0202D478(SaveData *saveData, int param1, Sentence *param2); -Sentence *sub_0202D498(SaveData *saveData, int param1); +void sub_0202D478(SaveData *saveData, int param1, EasyChatSentence *param2); +EasyChatSentence *sub_0202D498(SaveData *saveData, int param1); void sub_0202D4B0(UnkStruct_0202D764 *param0, u8 param1, u8 param2, RTCDate *param3); void sub_0202D514(UnkStruct_0202D764 *param0); BOOL sub_0202D558(UnkStruct_0202D764 *param0, u8 param1, u8 param2, RTCDate *param3); diff --git a/include/unk_02030108.h b/include/unk_02030108.h deleted file mode 100644 index 467d69bcc2..0000000000 --- a/include/unk_02030108.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef POKEPLATINUM_UNK_02030108_H -#define POKEPLATINUM_UNK_02030108_H - -#include "struct_decls/struct_02030114_decl.h" -#include "struct_decls/struct_0203026C_decl.h" - -#include "savedata.h" - -void sub_02030108(UnkStruct_02030114 *param0); -UnkStruct_02030114 *sub_02030114(SaveData *saveData); -BOOL sub_02030124(UnkStruct_02030114 *param0); -void sub_0203012C(UnkStruct_02030114 *param0, BOOL param1); -void sub_02030140(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, const void *param4); -u32 sub_02030198(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, void *param4); -u8 BattleHall_GetRankOfType(u8 idx, u8 *typeRanks); -void sub_02030204(u8 param0, u8 *param1, u8 param2); -void sub_02030244(u8 *param0); -void sub_02030260(UnkStruct_0203026C *param0); -UnkStruct_0203026C *sub_0203026C(SaveData *saveData); -void sub_02030280(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, const void *param4); -u32 sub_020302B4(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, void *param4); - -#endif // POKEPLATINUM_UNK_02030108_H diff --git a/include/unk_02030A80.h b/include/unk_02030A80.h index 7c5fb5adbf..f66261b4be 100644 --- a/include/unk_02030A80.h +++ b/include/unk_02030A80.h @@ -2,8 +2,8 @@ #define POKEPLATINUM_UNK_02030A80_H #include "struct_decls/struct_02030A80_decl.h" -#include "struct_defs/sentence.h" +#include "easy_chat_sentence.h" #include "savedata.h" #include "string_gf.h" @@ -17,7 +17,7 @@ int sub_02030BCC(const UnkStruct_02030A80 *param0); int sub_02030BEC(const UnkStruct_02030A80 *param0); int sub_02030BFC(const UnkStruct_02030A80 *param0); int sub_02030C08(const UnkStruct_02030A80 *param0); -String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum HeapID heapID); +String *sub_02030C28(const UnkStruct_02030A80 *param0, EasyChatSentence *param1, enum HeapID heapID); int sub_02030CCC(const UnkStruct_02030A80 *param0); int sub_02030CDC(const UnkStruct_02030A80 *param0); diff --git a/include/unk_02033200.h b/include/unk_02033200.h index dcf97e5a89..76ae21d4ac 100644 --- a/include/unk_02033200.h +++ b/include/unk_02033200.h @@ -3,9 +3,9 @@ #include -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" +#include "easy_chat_sentence.h" #include "trainer_info.h" void CommServerClient_Init(TrainerInfo *param0, BOOL param1); @@ -46,7 +46,7 @@ TrainerInfo *sub_02033FB0(int param0); void sub_02033FDC(u8 *param0, int param1); BOOL sub_0203406C(void); void sub_0203408C(void); -void sub_020340A8(Sentence *param0); +void sub_020340A8(EasyChatSentence *param0); void sub_020340C4(void *param0); void *sub_020340E8(void); void sub_020340FC(void); diff --git a/include/unk_0204FA34.h b/include/unk_0204FA34.h index 67fbae29ca..afe30da700 100644 --- a/include/unk_0204FA34.h +++ b/include/unk_0204FA34.h @@ -1,7 +1,7 @@ #ifndef POKEPLATINUM_UNK_0204FA34_H #define POKEPLATINUM_UNK_0204FA34_H -#include "struct_decls/struct_0203026C_decl.h" +#include "struct_defs/battle_frontier.h" #include "savedata.h" @@ -15,6 +15,6 @@ typedef struct BattleHallSameSpeciesCheck { } BattleHallSameSpeciesCheck; void CommCmd_BattleHallSelectedSpeciesMsg(int netID, int unused, void *data, void *context); -void sub_0204FA50(SaveData *saveData, UnkStruct_0203026C *param1, u8 param2); +void sub_0204FA50(SaveData *saveData, BattleHallStreakFlags *param1, u8 param2); #endif // POKEPLATINUM_UNK_0204FA34_H diff --git a/include/unk_0205B33C.h b/include/unk_0205B33C.h index e4d3835b36..48259930fa 100644 --- a/include/unk_0205B33C.h +++ b/include/unk_0205B33C.h @@ -3,12 +3,12 @@ #include -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "field/field_system_decl.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "string_template.h" #include "sys_task_manager.h" #include "trainer_info.h" @@ -42,10 +42,10 @@ int UnionRoom_GetMessage(UnkStruct_0205B43C *param0, int param1, int msgType, St u8 UnionRoom_GetCommInfoGameCode(void); void sub_0205BEA8(int param0); int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTemplate); -void sub_0205C010(UnkStruct_0205B43C *param0, Sentence *param1); -Sentence *sub_0205C028(UnkStruct_0205B43C *param0); -void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnkStruct_02014EC4 *param4); -void sub_0205C12C(Sentence *param0); +void sub_0205C010(UnkStruct_0205B43C *param0, EasyChatSentence *param1); +EasyChatSentence *sub_0205C028(UnkStruct_0205B43C *param0); +void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnlockedEasyChatWords *unlockedWords); +void sub_0205C12C(EasyChatSentence *param0); void sub_0205C154(UnkStruct_0205B43C *param0); void *UnionRoom_GetTrainerCase(UnkStruct_0205B43C *param0); void sub_0205C1F0(UnkStruct_0205B43C *param0); diff --git a/include/unk_0205DFC4.h b/include/unk_0205DFC4.h index 988c1555da..7d9581af91 100644 --- a/include/unk_0205DFC4.h +++ b/include/unk_0205DFC4.h @@ -20,9 +20,9 @@ enum BattleFrontierStatsIndex BattleFrontierStats_GetFactoryLatestStreakIdx(u8 i enum BattleFrontierStatsIndex BattleFrontierStats_GetFactoryRecordStreakIdx(u8 isOpenLevel, u8 challengeType); enum BattleFrontierStatsIndex BattleFrontierStats_GetFactoryLatestTradeCountIndex(u8 isOpenLevel, u8 challengeType); enum BattleFrontierStatsIndex BattleFrontierStats_GetFactoryRecordTradeCountIndex(u8 isOpenLevel, u8 challengeType); -enum BattleFrontierStatsIndex sub_0205E4E0(u8 param0, u8 param1); +enum BattleFrontierStatsIndex BattleFrontierStats_GetHallCurrentTypeRanksIndex(u8 challengeType, u8 pokemonType); enum BattleFrontierStatsIndex BattleFrontierStats_GetHallLatestStreakIndex(u8 challengeType); -enum BattleFrontierStatsIndex sub_0205E534(u8 param0); +enum BattleFrontierStatsIndex BattleFrontierStats_GetHallCurrentStreakIndex(u8 challengeType); enum BattleFrontierStatsIndex BattleFrontierStats_GetHallLatestSpeciesIndex(u8 challengeType); enum BattleFrontierStatsIndex BattleFrontierStats_GetHallRecordStreakIndex(u8 challengeType); enum BattleFrontierStatsIndex BattleFrontierStats_GetCastleRankIndex(u8 challengeType, u8 rankType); diff --git a/include/wifi_list.h b/include/wifi_list.h index 18a8b1f16a..ef12c8dad3 100644 --- a/include/wifi_list.h +++ b/include/wifi_list.h @@ -20,8 +20,8 @@ u16 *sub_0202AEF0(WiFiList *wiFiList, int param1); void sub_0202AF0C(WiFiList *wiFiList, int param1, String *param2); u16 *sub_0202AF34(WiFiList *wiFiList, int param1); void sub_0202AF50(WiFiList *wiFiList, int param1, String *param2); -BOOL sub_0202AF78(WiFiList *wiFiList, int param1); -int sub_0202AF94(WiFiList *wiFiList); +BOOL WiFiList_IsValidFriendData(WiFiList *wiFiList, int param1); +int WiFiList_GetValidFriendsCount(WiFiList *wiFiList); int sub_0202AFB4(WiFiList *wiFiList); void sub_0202AFD4(WiFiList *wiFiList, int param1); void sub_0202B0F8(WiFiList *wiFiList); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index a3a083f128..15f101aabb 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -56,8 +56,8 @@ Static main Object main.nef.p/src_screen_scroll_manager.c.o Object main.nef.p/src_particle_system.c.o Object main.nef.p/src_colored_arrow.c.o - Object main.nef.p/src_unk_02014A84.c.o - Object main.nef.p/src_unk_02014D38.c.o + Object main.nef.p/src_easy_chat_sentence.c.o + Object main.nef.p/src_easy_chat_words.c.o Object main.nef.p/src_software_sprite.c.o Object main.nef.p/src_unk_0201567C.c.o Object main.nef.p/src_poffin_types.c.o @@ -140,10 +140,10 @@ Static main Object main.nef.p/src_rankings.c.o Object main.nef.p/src_pal_park_transfers.c.o Object main.nef.p/src_link_contest_records.c.o - Object main.nef.p/src_unk_0202F180.c.o + Object main.nef.p/src_save_catchrecords.c.o Object main.nef.p/src_unk_0202F1D4.c.o Object main.nef.p/src_unk_0202FF4C.c.o - Object main.nef.p/src_unk_02030108.c.o + Object main.nef.p/src_battle_hall_save.c.o Object main.nef.p/src_unk_020302D0.c.o Object main.nef.p/src_unk_02030494.c.o Object main.nef.p/src_battle_frontier_stats.c.o @@ -536,7 +536,7 @@ Overlay overlay5 Object main.nef.p/src_overlay005_ov5_021F3D00.c.o Object main.nef.p/src_overlay005_ov5_021F3E74.c.o Object main.nef.p/src_overlay005_ov5_021F4018.c.o - Object main.nef.p/src_overlay005_ov5_021F428C.c.o + Object main.nef.p/src_overlay005_veilstone_gym_object_renderer.c.o Object main.nef.p/src_overlay005_ov5_021F47B0.c.o Object main.nef.p/src_overlay005_ov5_021F4DAC.c.o Object main.nef.p/src_overlay005_ov5_021F4E08.c.o @@ -596,15 +596,15 @@ Overlay overlay7 { After overlay6 Object main.nef.p/src_overlay007_communication_club.c.o - Object main.nef.p/src_overlay007_ov7_0224B4E8.c.o + Object main.nef.p/src_overlay007_battle_regulation_menu.c.o Object main.nef.p/src_overlay007_accessory_shop.c.o Object main.nef.p/src_overlay007_shop_menu.c.o } -Overlay overlay8 +Overlay gym_features { After overlay6 - Object main.nef.p/src_overlay008_ov8_02249960.c.o + Object main.nef.p/src_overlay008_gym_features.c.o } Overlay overlay9 diff --git a/platinum.us/sbins_shared.sha1 b/platinum.us/sbins_shared.sha1 index 8baf5b9d87..40cee50cf4 100644 --- a/platinum.us/sbins_shared.sha1 +++ b/platinum.us/sbins_shared.sha1 @@ -7,7 +7,7 @@ de8a847bff8c343d69b853a215e6ee775ef2ef96 *dummy4.sbin 0456f78ac3e294722f669c793fc9727b23b66fba *overlay5.sbin 6e5ed74d5bdb94d2ce78d8990c364b4766eab772 *overlay6.sbin fef29cf33d4dfd1f068a7b67798e7b5950fce749 *overlay7.sbin -9d381061f1a7c6cccb731871aa8e7013848709cd *overlay8.sbin +9d381061f1a7c6cccb731871aa8e7013848709cd *gym_features.sbin ba1a20a286990d2d318af29cd6e8dad389d45504 *overlay9.sbin 05ab4e12c01211ce4305bde303e06ce11dda78af *overlay10.sbin a6dc7a7e32c14081b5db5a0a5e1e5120bebe52a9 *overlay11.sbin diff --git a/res/field/events/events_eterna_forest.json b/res/field/events/events_eterna_forest.json index 3d107cfe00..01d82b2990 100644 --- a/res/field/events/events_eterna_forest.json +++ b/res/field/events/events_eterna_forest.json @@ -391,7 +391,7 @@ "graphics_id": "OBJ_EVENT_GFX_GARDENIA", "movement_type": "MOVEMENT_TYPE_LOOK_NORTH", "trainer_type": "TRAINER_TYPE_NONE", - "hidden_flag": "FLAG_UNK_0x01FC", + "hidden_flag": "FLAG_HIDE_ETERNA_FOREST_GARDENIA", "script": 7, "initial_dir": 0, "data": [], diff --git a/res/field/events/events_jubilife_city.json b/res/field/events/events_jubilife_city.json index 7b37902bcd..8bff281f4d 100644 --- a/res/field/events/events_jubilife_city.json +++ b/res/field/events/events_jubilife_city.json @@ -584,13 +584,13 @@ { "x": 129, "z": 736, - "dest_header_id": "MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_3", + "dest_header_id": "MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_3", "dest_warp_id": 0 }, { "x": 128, "z": 736, - "dest_header_id": "MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_4", + "dest_header_id": "MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_4", "dest_warp_id": 0 }, { diff --git a/res/field/events/events_sunyshore_city.json b/res/field/events/events_sunyshore_city.json index eac0207179..2b6bc0788c 100644 --- a/res/field/events/events_sunyshore_city.json +++ b/res/field/events/events_sunyshore_city.json @@ -382,13 +382,13 @@ { "x": 832, "z": 751, - "dest_header_id": "MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_1", + "dest_header_id": "MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_1", "dest_warp_id": 0 }, { "x": 832, "z": 750, - "dest_header_id": "MAP_HEADER_SUNYSHORE_CITY_UNKNOWN_HOUSE_2", + "dest_header_id": "MAP_HEADER_UNUSED_SUNYSHORE_CITY_HOUSE_2", "dest_warp_id": 0 }, { diff --git a/res/field/events/events_eterna_city_unknown_house.json b/res/field/events/events_unused_eterna_city_house.json similarity index 100% rename from res/field/events/events_eterna_city_unknown_house.json rename to res/field/events/events_unused_eterna_city_house.json diff --git a/res/field/events/events_jubilife_city_unknown_house_1.json b/res/field/events/events_unused_jubilife_city_house_1.json similarity index 100% rename from res/field/events/events_jubilife_city_unknown_house_1.json rename to res/field/events/events_unused_jubilife_city_house_1.json diff --git a/res/field/events/events_jubilife_city_unknown_house_2.json b/res/field/events/events_unused_jubilife_city_house_2.json similarity index 100% rename from res/field/events/events_jubilife_city_unknown_house_2.json rename to res/field/events/events_unused_jubilife_city_house_2.json diff --git a/res/field/events/events_jubilife_city_unknown_house_3.json b/res/field/events/events_unused_jubilife_city_house_3.json similarity index 100% rename from res/field/events/events_jubilife_city_unknown_house_3.json rename to res/field/events/events_unused_jubilife_city_house_3.json diff --git a/res/field/events/events_jubilife_city_unknown_house_4.json b/res/field/events/events_unused_jubilife_city_house_4.json similarity index 100% rename from res/field/events/events_jubilife_city_unknown_house_4.json rename to res/field/events/events_unused_jubilife_city_house_4.json diff --git a/res/field/events/events_sunyshore_city_unknown_house_1.json b/res/field/events/events_unused_sunyshore_city_house_1.json similarity index 100% rename from res/field/events/events_sunyshore_city_unknown_house_1.json rename to res/field/events/events_unused_sunyshore_city_house_1.json diff --git a/res/field/events/events_sunyshore_city_unknown_house_2.json b/res/field/events/events_unused_sunyshore_city_house_2.json similarity index 100% rename from res/field/events/events_sunyshore_city_unknown_house_2.json rename to res/field/events/events_unused_sunyshore_city_house_2.json diff --git a/res/field/events/events_verity_lakefront_unknown_house.json b/res/field/events/events_unused_verity_lakefront_house.json similarity index 100% rename from res/field/events/events_verity_lakefront_unknown_house.json rename to res/field/events/events_unused_verity_lakefront_house.json diff --git a/res/field/events/meson.build b/res/field/events/meson.build index d69d41f046..bdb9f1fedd 100644 --- a/res/field/events/meson.build +++ b/res/field/events/meson.build @@ -10,7 +10,7 @@ events_files = files( 'events_underground.json', 'events_jubilife_city.json', 'events_jubilife_city_mart.json', - 'events_jubilife_city_unknown_house_1.json', + 'events_unused_jubilife_city_house_1.json', 'events_jubilife_city_pokecenter_1f.json', 'events_jubilife_city_pokecenter_2f.json', 'events_poketch_co_1f.json', @@ -28,7 +28,7 @@ events_files = files( 'events_jubilife_city_south_house_2f.json', 'events_jubilife_city_south_house_3f.json', 'events_jubilife_city_south_house_4f.json', - 'events_jubilife_city_unknown_house_2.json', + 'events_unused_jubilife_city_house_2.json', 'events_jubilife_city_condominiums_1f.json', 'events_jubilife_city_condominiums_2f.json', 'events_jubilife_city_condominiums_3f.json', @@ -36,8 +36,8 @@ events_files = files( 'events_global_terminal_1f.json', 'events_trainers_school.json', 'events_jubilife_city_southwest_house_1f.json', - 'events_jubilife_city_unknown_house_3.json', - 'events_jubilife_city_unknown_house_4.json', + 'events_unused_jubilife_city_house_3.json', + 'events_unused_jubilife_city_house_4.json', 'events_canalave_city.json', 'events_canalave_city_mart.json', 'events_canalave_city_gym.json', @@ -90,7 +90,7 @@ events_files = files( 'events_eterna_city_south_house.json', 'events_eterna_city_east_house.json', 'events_eterna_city_underground_man_house.json', - 'events_eterna_city_unknown_house.json', + 'events_unused_eterna_city_house.json', 'events_hearthome_city.json', 'events_hearthome_city_mart.json', 'events_hearthome_city_gym_entrance_room.json', @@ -166,8 +166,8 @@ events_files = files( 'events_sunyshore_city_northeast_house.json', 'events_sunyshore_city_west_house.json', 'events_sunyshore_city_northwest_house.json', - 'events_sunyshore_city_unknown_house_1.json', - 'events_sunyshore_city_unknown_house_2.json', + 'events_unused_sunyshore_city_house_1.json', + 'events_unused_sunyshore_city_house_2.json', 'events_sunyshore_city_east_house.json', 'events_vista_lighthouse.json', 'events_snowpoint_city.json', @@ -327,7 +327,7 @@ events_files = files( 'events_communication_club_colosseum_2p.json', 'events_communication_club_colosseum_4p.json', 'events_verity_lakefront.json', - 'events_verity_lakefront_unknown_house.json', + 'events_unused_verity_lakefront_house.json', 'events_valor_lakefront.json', 'events_restaurant.json', 'events_grand_lake_valor_lakefront_east_house.json', diff --git a/res/field/events/zone_event.order b/res/field/events/zone_event.order index 28fa7ea1f2..5b68881422 100644 --- a/res/field/events/zone_event.order +++ b/res/field/events/zone_event.order @@ -2,7 +2,7 @@ events_empty events_underground events_jubilife_city events_jubilife_city_mart -events_jubilife_city_unknown_house_1 +events_unused_jubilife_city_house_1 events_jubilife_city_pokecenter_1f events_jubilife_city_pokecenter_2f events_poketch_co_1f @@ -20,7 +20,7 @@ events_jubilife_city_south_house_1f events_jubilife_city_south_house_2f events_jubilife_city_south_house_3f events_jubilife_city_south_house_4f -events_jubilife_city_unknown_house_2 +events_unused_jubilife_city_house_2 events_jubilife_city_condominiums_1f events_jubilife_city_condominiums_2f events_jubilife_city_condominiums_3f @@ -28,8 +28,8 @@ events_jubilife_city_condominiums_4f events_global_terminal_1f events_trainers_school events_jubilife_city_southwest_house_1f -events_jubilife_city_unknown_house_3 -events_jubilife_city_unknown_house_4 +events_unused_jubilife_city_house_3 +events_unused_jubilife_city_house_4 events_canalave_city events_canalave_city_mart events_canalave_city_gym @@ -82,7 +82,7 @@ events_eterna_city_herb_shop events_eterna_city_south_house events_eterna_city_east_house events_eterna_city_underground_man_house -events_eterna_city_unknown_house +events_unused_eterna_city_house events_hearthome_city events_hearthome_city_mart events_hearthome_city_gym_entrance_room @@ -158,8 +158,8 @@ events_sunyshore_market events_sunyshore_city_northeast_house events_sunyshore_city_west_house events_sunyshore_city_northwest_house -events_sunyshore_city_unknown_house_1 -events_sunyshore_city_unknown_house_2 +events_unused_sunyshore_city_house_1 +events_unused_sunyshore_city_house_2 events_sunyshore_city_east_house events_vista_lighthouse events_snowpoint_city @@ -319,7 +319,7 @@ events_battle_tower_multi_battle_room events_communication_club_colosseum_2p events_communication_club_colosseum_4p events_verity_lakefront -events_verity_lakefront_unknown_house +events_unused_verity_lakefront_house events_valor_lakefront events_restaurant events_grand_lake_valor_lakefront_east_house diff --git a/res/field/frontier_scripts/frontier_scripts_battle_arcade.s b/res/field/frontier_scripts/frontier_scripts_battle_arcade.s index b3603fd3eb..3296472a4d 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_arcade.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_arcade.s @@ -884,11 +884,11 @@ _065C: EndMovement _0662: - FrontierScrCmd_3E VAR_BATTLE_ARCADE_CHALLENGE_TYPE, VAR_0x8001 - FrontierScrCmd_3E VAR_MAP_LOCAL_3, VAR_0x8003 - FrontierScrCmd_3E VAR_MAP_LOCAL_2, VAR_0x8004 - FrontierScrCmd_3E VAR_MAP_LOCAL_5, VAR_0x8005 - FrontierScrCmd_3E VAR_MAP_LOCAL_6, VAR_0x8006 + GetSystemVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, VAR_0x8001 + GetSystemVar VAR_MAP_LOCAL_3, VAR_0x8003 + GetSystemVar VAR_MAP_LOCAL_2, VAR_0x8004 + GetSystemVar VAR_MAP_LOCAL_5, VAR_0x8005 + GetSystemVar VAR_MAP_LOCAL_6, VAR_0x8006 InitNewBattleRecording FrontierScrCmd_B8 VAR_0x8003, VAR_0x8001, VAR_0x8004, VAR_0x8005, VAR_0x8006, VAR_0x8008 GetPlayerObjEventGfx VAR_0x8007 @@ -2694,7 +2694,7 @@ _278C: _279A: CallBattleArcadeFunction BA_FUNC_UNK_22, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 1 Message BattleArcadeScene_Text_BPEarned BufferPlayerName 0 CallBattleArcadeFunction BA_FUNC_UNK_45, 0, 0, VAR_0x8008 @@ -2986,7 +2986,7 @@ _2C5A: End _2C78: - FrontierScrCmd_3D VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 2 + SetSystemVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 2 CallBattleArcadeFunction BA_FUNC_UNK_10, 0, 0, VAR_0x8008 FreeBattleRecording FrontierScrCmd_BA @@ -3033,7 +3033,7 @@ _2D19: _2D31: CallBattleArcadeFunction BA_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 3 GoTo _2E0A End @@ -3071,7 +3071,7 @@ _2DB5: _2DBD: CallBattleArcadeFunction BA_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 3 GoTo _2DD4 End @@ -3291,7 +3291,7 @@ _3198: _31DE: Call _32A0 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_ARCADE_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_ARCADE_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 0, _320A Message BattleArcadeScene_Text_BeatDahlia CloseMessage @@ -3299,13 +3299,13 @@ _31DE: End _320A: - FrontierScrCmd_3D VAR_BATTLE_ARCADE_PRINT_STATE, 1 + SetSystemVar VAR_BATTLE_ARCADE_PRINT_STATE, 1 Return _3212: Call _32A0 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_ARCADE_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_ARCADE_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 2, _323E Message BattleArcadeScene_Text_BeatDahliaGold CloseMessage @@ -3313,7 +3313,7 @@ _3212: End _323E: - FrontierScrCmd_3D VAR_BATTLE_ARCADE_PRINT_STATE, 3 + SetSystemVar VAR_BATTLE_ARCADE_PRINT_STATE, 3 Return _3246: diff --git a/res/field/frontier_scripts/frontier_scripts_battle_castle.s b/res/field/frontier_scripts/frontier_scripts_battle_castle.s index f50de3aa29..6c432b144a 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_castle.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_castle.s @@ -566,11 +566,11 @@ _03BC: EndMovement _03C2: - FrontierScrCmd_3E VAR_BATTLE_CASTLE_CHALLENGE_TYPE, VAR_0x8001 - FrontierScrCmd_3E VAR_MAP_LOCAL_3, VAR_0x8003 - FrontierScrCmd_3E VAR_MAP_LOCAL_2, VAR_0x8004 - FrontierScrCmd_3E VAR_MAP_LOCAL_5, VAR_0x8005 - FrontierScrCmd_3E VAR_MAP_LOCAL_6, VAR_0x8006 + GetSystemVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, VAR_0x8001 + GetSystemVar VAR_MAP_LOCAL_3, VAR_0x8003 + GetSystemVar VAR_MAP_LOCAL_2, VAR_0x8004 + GetSystemVar VAR_MAP_LOCAL_5, VAR_0x8005 + GetSystemVar VAR_MAP_LOCAL_6, VAR_0x8006 GetPlayerObjEventGfx VAR_0x8007 SetVar FR_VAR_0x800E, 0 GoToIfEq VAR_0x8001, FRONTIER_CHALLENGE_MULTI, _041E @@ -1425,7 +1425,7 @@ _12C5: _12D3: CallBattleCastleFunction BC_FUNC_UNK_22, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 1 BufferPlayerName 0 Message BattleCastleScene_Text_BPEarned BufferPlayerName 0 @@ -1691,7 +1691,7 @@ _1720: End _173E: - FrontierScrCmd_3D VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 2 + SetSystemVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 2 CallBattleCastleFunction BC_FUNC_UNK_10, 0, 0, VAR_0x8008 FreeBattleRecording FrontierScrCmd_99 @@ -1738,7 +1738,7 @@ _17D9: _17F1: CallBattleCastleFunction BC_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 3 GoTo _18E4 End @@ -1779,7 +1779,7 @@ _1893: _189B: CallBattleCastleFunction BC_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 3 GoTo _18B0 End @@ -1928,7 +1928,7 @@ _1ADC: _1AF8: Call _1B75 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_CASTLE_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_CASTLE_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 0, _1B27 BufferPlayerName 0 Message BattleCastleScene_Text_BeatDarach @@ -1937,13 +1937,13 @@ _1AF8: End _1B27: - FrontierScrCmd_3D VAR_BATTLE_CASTLE_PRINT_STATE, 1 + SetSystemVar VAR_BATTLE_CASTLE_PRINT_STATE, 1 Return _1B2F: Call _1B75 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_CASTLE_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_CASTLE_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 2, _1B5B Message BattleCastleScene_Text_BeatDarachGold CloseMessage @@ -1951,7 +1951,7 @@ _1B2F: End _1B5B: - FrontierScrCmd_3D VAR_BATTLE_CASTLE_PRINT_STATE, 3 + SetSystemVar VAR_BATTLE_CASTLE_PRINT_STATE, 3 Return _1B63: diff --git a/res/field/frontier_scripts/frontier_scripts_battle_factory.s b/res/field/frontier_scripts/frontier_scripts_battle_factory.s index 19768dc955..c1f0df3000 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_factory.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_factory.s @@ -427,9 +427,9 @@ _02A8: EndMovement _02D6: - FrontierScrCmd_3E VAR_BATTLE_FACTORY_CHALLENGE_TYPE, VAR_0x8001 - FrontierScrCmd_3E VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, VAR_0x8002 - FrontierScrCmd_3E VAR_MAP_LOCAL_3, VAR_0x8003 + GetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, VAR_0x8001 + GetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, VAR_0x8002 + GetSystemVar VAR_MAP_LOCAL_3, VAR_0x8003 GetPlayerObjEventGfx VAR_0x8007 GoToIfEq VAR_0x8001, FRONTIER_CHALLENGE_MULTI, _0320 GoToIfEq VAR_0x8001, FRONTIER_CHALLENGE_MULTI_WFC, _0320 @@ -923,7 +923,7 @@ _0BCB: _0BD9: CallBattleFactoryFunction BF_FUNC_UNK_22, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 1 Message BattleFactoryScene_Text_BPEarned BufferPlayerName 0 CallBattleFactoryFunction BF_FUNC_UNK_35, 0, 0, VAR_0x8008 @@ -1230,7 +1230,7 @@ _10B7: SetVar VAR_0x8003, 1 MessageInstant BattleFactoryScene_Text_Saving ShowSavingIcon - FrontierScrCmd_3E VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, VAR_0x8008 + GetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, VAR_0x8008 GoToIfEq VAR_0x8008, 0, _10DE GoTo _10F7 End @@ -1275,7 +1275,7 @@ _113E: End _115C: - FrontierScrCmd_3D VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 2 + SetSystemVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 2 CallBattleFactoryFunction BF_FUNC_UNK_10, 0, 0, VAR_0x8008 Call _137B CloseMessage @@ -1323,7 +1323,7 @@ _11FE: _1216: CallBattleFactoryFunction BF_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 3 GoTo _12F3 End @@ -1360,7 +1360,7 @@ _12A2: _12AA: CallBattleFactoryFunction BF_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 3 GoTo _12BF End @@ -1544,7 +1544,7 @@ _154A: _15AA: Call _1612 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_FACTORY_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_FACTORY_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 0, _15D6 Message BattleFactoryScene_Text_BeatThorton CloseMessage @@ -1552,13 +1552,13 @@ _15AA: End _15D6: - FrontierScrCmd_3D VAR_BATTLE_FACTORY_PRINT_STATE, 1 + SetSystemVar VAR_BATTLE_FACTORY_PRINT_STATE, 1 Return _15DE: Call _1612 BufferNumber 0, VAR_0x8008 - FrontierScrCmd_3E VAR_BATTLE_FACTORY_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_FACTORY_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 2, _160A Message BattleFactoryScene_Text_BeatThortonGold CloseMessage @@ -1566,7 +1566,7 @@ _15DE: End _160A: - FrontierScrCmd_3D VAR_BATTLE_FACTORY_PRINT_STATE, 3 + SetSystemVar VAR_BATTLE_FACTORY_PRINT_STATE, 3 Return _1612: diff --git a/res/field/frontier_scripts/frontier_scripts_battle_hall.s b/res/field/frontier_scripts/frontier_scripts_battle_hall.s index 2118521ed6..61069b5557 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_hall.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_hall.s @@ -464,14 +464,14 @@ _0320: EndMovement _0326: - FrontierScrCmd_3E VAR_BATTLE_HALL_CHALLENGE_TYPE, VAR_0x8001 - FrontierScrCmd_3E VAR_MAP_LOCAL_3, VAR_0x8003 - FrontierScrCmd_3E VAR_MAP_LOCAL_2, VAR_0x8002 - FrontierScrCmd_3E VAR_MAP_LOCAL_5, VAR_0x8000 + GetSystemVar VAR_BATTLE_HALL_CHALLENGE_TYPE, VAR_0x8001 + GetSystemVar VAR_MAP_LOCAL_3, VAR_0x8003 + GetSystemVar VAR_MAP_LOCAL_2, VAR_0x8002 + GetSystemVar VAR_MAP_LOCAL_5, VAR_0x8000 GetPlayerObjEventGfx VAR_0x800A SetVar FR_VAR_0x800E, 0 InitNewBattleRecording - FrontierScrCmd_8B VAR_0x8003, VAR_0x8001, VAR_0x8002, VAR_0x8000 + InitBattleHall VAR_0x8003, VAR_0x8001, VAR_0x8002, VAR_0x8000 CallBattleHallFunction BH_FUNC_IS_MULTIPLAYER_CHALLENGE, 0, 0, VAR_0x8008 GoToIfEq VAR_0x8008, 1, _0382 SetVar FR_VAR_0x800F, 231 @@ -787,7 +787,7 @@ _08F1: _0907: BattleHall_StartBattle BattleHall_CleanupBattle - CallBattleHallFunction BH_FUNC_UPDATE_HELD_ITEMS, 0, 0, VAR_0x8008 + CallBattleHallFunction BH_FUNC_RESTORE_HELD_ITEMS, 0, 0, VAR_0x8008 CallBattleHallFunction BH_FUNC_TOGGLE_ENGINE_LAYER, 0, 0, VAR_0x8008 FadeScreenIn BattleHall_CheckWonBattle VAR_0x8008 @@ -880,7 +880,7 @@ _0AC8: _0AD6: CallBattleHallFunction BH_FUNC_UNK_22, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 1 CallBattleHallFunction BH_FUNC_UNK_15, 0, 0, VAR_0x8008 BufferSpeciesName 0, VAR_0x8008 Message BattleHallScene_Text_BPEarned @@ -1123,11 +1123,11 @@ _0E7B: End _0E99: - FrontierScrCmd_3D VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 2 - CallBattleHallFunction BH_FUNC_UNK_10, 0, 0, VAR_0x8008 + SetSystemVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 2 + CallBattleHallFunction BH_FUNC_QUICKSAVE, 0, 0, VAR_0x8008 Call _1087 FreeBattleRecording - FrontierScrCmd_8D + FreeBattleHall FadeScreenOut CloseMessage CallBattleHallFunction BH_FUNC_RESET_SYSTEM, 0, 0, VAR_0x8008 @@ -1167,7 +1167,7 @@ _0F30: _0F40: CallBattleHallFunction BH_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 3 GoTo _100D End @@ -1202,7 +1202,7 @@ _0FC0: _0FC8: CallBattleHallFunction BH_FUNC_UNK_21, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 3 GoTo _0FDD End @@ -1235,7 +1235,7 @@ _101D: CallBattleHallFunction BH_FUNC_GET_CHALLENGE_TYPE, 0, 0, VAR_0x8008 GoToIfEq VAR_0x8008, 3, _107B FreeBattleRecording - FrontierScrCmd_8D + FreeBattleHall FrontierScrCmd_02 _106B: @@ -1250,7 +1250,7 @@ _1071: _107B: FreeBattleRecording - FrontierScrCmd_8D + FreeBattleHall FrontierScrCmd_04 14, 1 End @@ -1414,7 +1414,7 @@ _1333: Call _1173 WaitForParticleSystemEmitters FreeParticleSystem 0 - FrontierScrCmd_3E VAR_BATTLE_HALL_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_HALL_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 0, _1373 Message BattleHallScene_Text_BeatArgenta CloseMessage @@ -1422,7 +1422,7 @@ _1333: End _1373: - FrontierScrCmd_3D VAR_BATTLE_HALL_PRINT_STATE, 1 + SetSystemVar VAR_BATTLE_HALL_PRINT_STATE, 1 Return _137B: @@ -1432,7 +1432,7 @@ _137B: Call _1173 WaitForParticleSystemEmitters FreeParticleSystem 0 - FrontierScrCmd_3E VAR_BATTLE_HALL_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_HALL_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 2, _13BB Message BattleHallScene_Text_BeatArgentaGold CloseMessage @@ -1440,7 +1440,7 @@ _137B: End _13BB: - FrontierScrCmd_3D VAR_BATTLE_HALL_PRINT_STATE, 3 + SetSystemVar VAR_BATTLE_HALL_PRINT_STATE, 3 Return _13C3: diff --git a/res/field/frontier_scripts/frontier_scripts_battle_tower_battle_room.s b/res/field/frontier_scripts/frontier_scripts_battle_tower_battle_room.s index 99368dab5a..68425f19cc 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_tower_battle_room.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_tower_battle_room.s @@ -130,7 +130,7 @@ _00D4: _00E2: InitNewBattleRecording - FrontierScrCmd_3E VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 + GetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 Call _0176 Call _018F CallBattleTowerFunction BT_FUNC_GET_CHALLENGE_MODE, 0, VAR_0x8008 @@ -174,8 +174,8 @@ _019E: Return _01A0: - FrontierScrCmd_3D VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 - FrontierScrCmd_3E VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 + SetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 + GetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 CallBattleTowerFunction BT_FUNC_CHECK_IS_NULL, 0, VAR_0x8008 GoToIfEq VAR_0x8008, 1, _03EF Call _03CF @@ -292,8 +292,8 @@ _0382: Return _0394: - FrontierScrCmd_3D VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 - FrontierScrCmd_3E VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 + SetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 + GetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 SetVar VAR_0x8003, 1 CallBattleTowerFunction BT_FUNC_CHECK_IS_NULL, 0, VAR_0x8008 GoToIfEq VAR_0x8008, 1, _03EF @@ -316,7 +316,7 @@ _03DB: _03EF: FreeBattleRecording WaitTime 30, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 CallBattleTowerFunction BT_FUNC_GET_CHALLENGE_MODE, 0, VAR_0x8008 SetVar FR_VAR_0x8010, VAR_0x8008 GoToIfEq FR_VAR_0x8010, BATTLE_TOWER_MODE_WIFI, _043F @@ -335,8 +335,8 @@ _043F: FrontierScrCmd_02 _0459: - FrontierScrCmd_3D VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 0 - FrontierScrCmd_3E VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 + SetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 0 + GetSystemVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, VAR_0x8001 Call _046D End @@ -484,7 +484,7 @@ _06B3: End _06D3: - FrontierScrCmd_3D VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 2 + SetSystemVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 2 CallBattleTowerFunction BT_FUNC_UNK_39, 0, VAR_0x8008 FreeTowerStruct Message BattleTowerBattleRoom_Text_Saving @@ -579,7 +579,7 @@ _086E: GoToIfEq VAR_0x800C, 0, _020F CallBattleTowerFunction BT_FUNC_UNK_36, 0, VAR_0x8008 GoToIfEq VAR_0x8008, 48, _08FD - FrontierScrCmd_3E VAR_BATTLE_TOWER_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 0, _08D9 Message BattleTowerBattleRoom_Text_BeatPalmer CallBattleTowerFunction BT_FUNC_SET_BEAT_PALMER, 1, VAR_0x8008 @@ -587,7 +587,7 @@ _086E: End _08D9: - FrontierScrCmd_3D VAR_BATTLE_TOWER_PRINT_STATE, 1 + SetSystemVar VAR_BATTLE_TOWER_PRINT_STATE, 1 Return _08E1: @@ -602,7 +602,7 @@ _08F1: End _08FD: - FrontierScrCmd_3E VAR_BATTLE_TOWER_PRINT_STATE, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_PRINT_STATE, VAR_0x8008 CallIfEq VAR_0x8008, 2, _0924 Message BattleTowerBattleRoom_Text_BeatPalmerGold CallBattleTowerFunction BT_FUNC_SET_BEAT_PALMER, 2, VAR_0x8008 @@ -610,7 +610,7 @@ _08FD: End _0924: - FrontierScrCmd_3D VAR_BATTLE_TOWER_PRINT_STATE, 3 + SetSystemVar VAR_BATTLE_TOWER_PRINT_STATE, 3 Return _092C: diff --git a/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor.s b/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor.s index e9b4f2126a..73d192a4f5 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor.s @@ -132,7 +132,7 @@ _010C: FrontierScrCmd_2A _0028 FrontierScrCmd_2C _002C FadeScreenIn - FrontierScrCmd_3E VAR_BATTLE_TOWER_CORRIDOR_LOAD_ACTION, VAR_0x8001 + GetSystemVar VAR_BATTLE_TOWER_CORRIDOR_LOAD_ACTION, VAR_0x8001 GoToIfEq VAR_0x8001, 1, _0161 End diff --git a/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor_multi.s b/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor_multi.s index eac2b4eb52..4cd0f170f3 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor_multi.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_tower_corridor_multi.s @@ -188,7 +188,7 @@ _0138: EndMovement _0142: - FrontierScrCmd_3E VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, VAR_0x8001 + GetSystemVar VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, VAR_0x8001 Call _0278 Call _0344 SetVar FR_VAR_0x800F, 232 diff --git a/res/field/frontier_scripts/frontier_scripts_battle_tower_multi_battle_room.s b/res/field/frontier_scripts/frontier_scripts_battle_tower_multi_battle_room.s index b603ee738e..4115b1661b 100644 --- a/res/field/frontier_scripts/frontier_scripts_battle_tower_multi_battle_room.s +++ b/res/field/frontier_scripts/frontier_scripts_battle_tower_multi_battle_room.s @@ -250,13 +250,13 @@ _01CE: _01F8: FadeScreenIn - FrontierScrCmd_3E VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 GoToIfEq VAR_0x8008, 1, _0226 GoToIfEq VAR_0x8008, 2, _04FB End _0226: - FrontierScrCmd_3D VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 Call _025C CallBattleTowerFunction BT_FUNC_GET_CHALLENGE_MODE, 0, VAR_0x8008 GoToIfEq VAR_0x8008, BATTLE_TOWER_MODE_LINK_MULTI, _0270 @@ -347,7 +347,7 @@ _03DD: GoToIfEq VAR_0x8008, BATTLE_TOWER_MODE_LINK_MULTI, _0437 GoToIfEq VAR_0x8008, BATTLE_TOWER_MODE_6, _0443 WaitTime 30, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 FadeScreenOut FrontierScrCmd_25 0 FrontierScrCmd_25 1 @@ -365,7 +365,7 @@ _0437: _0443: WaitTime 30, VAR_0x8008 - FrontierScrCmd_3D VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 1 ClearReceivedTempDataAllPlayers SyncConnectedPlayers 6 CallIfEq VAR_0x8004, 100, _04D1 @@ -411,7 +411,7 @@ _04F7: Return _04FB: - FrontierScrCmd_3D VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 + SetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 SetVar VAR_0x8006, 1 Call _025C Call _051B @@ -535,7 +535,7 @@ _06E7: End _0707: - FrontierScrCmd_3D VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 2 + SetSystemVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 2 CallBattleTowerFunction BT_FUNC_UNK_39, 0, VAR_0x8008 FreeTowerStruct Message BattleTowerMultiBattleRoom_Text_ThanksForParticipating @@ -813,7 +813,7 @@ _0B91: End _0BCF: - FrontierScrCmd_3E VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 GoToIfEq VAR_0x8008, 0, _0C01 GoToIfEq VAR_0x8000, 1, _0C03 CallBattleTowerFunction BT_FUNC_GET_PARTNER_PARAM, BT_PARAM_PLAYER_GRAPHICS_ID, VAR_0x8009 @@ -829,13 +829,13 @@ _0C03: Return _0C15: - FrontierScrCmd_3E VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 CallIfNe VAR_0x8008, 0, _0C4B GoTo _0C30 End _0C30: - FrontierScrCmd_3E VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 + GetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, VAR_0x8008 GoToIfEq VAR_0x8008, 3, _0C4D GoTo _0C55 End diff --git a/res/field/frontier_scripts/frontier_scripts_unknown_10.s b/res/field/frontier_scripts/frontier_scripts_unknown_10.s index 689a0dbfc9..f92fb45f24 100644 --- a/res/field/frontier_scripts/frontier_scripts_unknown_10.s +++ b/res/field/frontier_scripts/frontier_scripts_unknown_10.s @@ -86,13 +86,13 @@ _010E: FrontierScrCmd_B2 7, 1, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 1 - FrontierScrCmd_3D VAR_MAP_LOCAL_3, 0 + SetSystemVar VAR_MAP_LOCAL_3, 0 GoTo _0254 End _012F: - FrontierScrCmd_3D VAR_BATTLE_FACTORY_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC - FrontierScrCmd_3D VAR_MAP_LOCAL_3, 0 + SetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC + SetSystemVar VAR_MAP_LOCAL_3, 0 GoTo _0143 End @@ -113,7 +113,7 @@ _0188: FrontierScrCmd_B2 7, 2, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 2 - FrontierScrCmd_3D VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 + SetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 GoTo _0254 End @@ -121,7 +121,7 @@ _01A9: FrontierScrCmd_B2 7, 3, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 3 - FrontierScrCmd_3D VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 1 + SetSystemVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 1 GoTo _0254 End @@ -129,8 +129,8 @@ _01CA: FrontierScrCmd_B2 7, 4, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 4 - FrontierScrCmd_3D VAR_BATTLE_CASTLE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC - FrontierScrCmd_3D VAR_MAP_LOCAL_3, 0 + SetSystemVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC + SetSystemVar VAR_MAP_LOCAL_3, 0 GoTo _0254 End @@ -138,8 +138,8 @@ _01F1: FrontierScrCmd_B2 7, 5, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 5 - FrontierScrCmd_3D VAR_BATTLE_HALL_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC - FrontierScrCmd_3D VAR_MAP_LOCAL_3, 0 + SetSystemVar VAR_BATTLE_HALL_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC + SetSystemVar VAR_MAP_LOCAL_3, 0 GoTo _0254 End @@ -147,8 +147,8 @@ _0218: FrontierScrCmd_B2 7, 6, 0, VAR_0x8008 SetVar VAR_0x8004, 0 SetVar VAR_0x8009, 6 - FrontierScrCmd_3D VAR_BATTLE_ARCADE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC - FrontierScrCmd_3D VAR_MAP_LOCAL_3, 0 + SetSystemVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_MULTI_WFC + SetSystemVar VAR_MAP_LOCAL_3, 0 GoTo _0254 End @@ -223,8 +223,8 @@ _037E: FrontierScrCmd_AF VAR_0x8009, 1, VAR_0x8008 GoToIfEq VAR_0x8008, 2, _0366 FrontierScrCmd_B0 VAR_0x8002, VAR_0x8005 - FrontierScrCmd_3D VAR_MAP_LOCAL_2, VAR_0x8002 - FrontierScrCmd_3D VAR_MAP_LOCAL_5, VAR_0x8005 + SetSystemVar VAR_MAP_LOCAL_2, VAR_0x8002 + SetSystemVar VAR_MAP_LOCAL_5, VAR_0x8005 FadeScreenIn GoTo _03C1 End @@ -414,7 +414,7 @@ _0758: _0766: FrontierScrCmd_B2 12, 0, 0, VAR_0x8008 - FrontierScrCmd_3D VAR_WIFI_FRONTIER_CLEARED, VAR_0x8008 + SetSystemVar VAR_WIFI_FRONTIER_CLEARED, VAR_0x8008 ClearReceivedTempDataAllPlayers SyncConnectedPlayers 175 ClearReceivedTempDataAllPlayers @@ -458,7 +458,7 @@ _0838: _0842: FrontierScrCmd_B3 - FrontierScrCmd_3D VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 1 + SetSystemVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 1 Call _08D3 GoTo _0858 End diff --git a/res/field/scripts/meson.build b/res/field/scripts/meson.build index 0c068a308b..ce53160340 100644 --- a/res/field/scripts/meson.build +++ b/res/field/scripts/meson.build @@ -37,7 +37,7 @@ scr_seq_files = files( 'scripts_bg_events.s', 'scripts_jubilife_city.s', 'scripts_jubilife_city_mart.s', - 'scripts_jubilife_city_unknown_house_1.s', + 'scripts_unused_jubilife_city_house_1.s', 'scripts_jubilife_city_pokecenter_1f.s', 'scripts_jubilife_city_pokecenter_2f.s', 'scripts_jubilife_city_pokecenter_b1f.s', @@ -56,7 +56,7 @@ scr_seq_files = files( 'scripts_jubilife_city_south_house_2f.s', 'scripts_jubilife_city_south_house_3f.s', 'scripts_unk_0022.s', - 'scripts_jubilife_city_unknown_house_2.s', + 'scripts_unused_jubilife_city_house_2.s', 'scripts_jubilife_city_condominiums_1f.s', 'scripts_jubilife_city_condominiums_2f.s', 'scripts_jubilife_city_condominiums_3f.s', @@ -67,8 +67,8 @@ scr_seq_files = files( 'scripts_trainers_school.s', 'scripts_jubilife_city_southwest_house_1f.s', 'scripts_jubilife_city_southwest_house_2f.s', - 'scripts_jubilife_city_unknown_house_3.s', - 'scripts_jubilife_city_unknown_house_4.s', + 'scripts_unused_jubilife_city_house_3.s', + 'scripts_unused_jubilife_city_house_4.s', 'scripts_canalave_city.s', 'scripts_canalave_city_mart.s', 'scripts_canalave_city_gym.s', @@ -201,8 +201,8 @@ scr_seq_files = files( 'scripts_sunyshore_city_northeast_house.s', 'scripts_sunyshore_city_west_house.s', 'scripts_sunyshore_city_northwest_house.s', - 'scripts_sunyshore_city_unknown_house_1.s', - 'scripts_sunyshore_city_unknown_house_2.s', + 'scripts_unused_sunyshore_city_house_1.s', + 'scripts_unused_sunyshore_city_house_2.s', 'scripts_sunyshore_city_east_house.s', 'scripts_vista_lighthouse.s', 'scripts_vista_lighthouse_elevator.s', @@ -246,7 +246,7 @@ scr_seq_files = files( 'scripts_unk_0210.s', 'scripts_common.s', 'scripts_contests.s', - 'scripts_pokemon_center_2f_attendants.s', + 'scripts_pokemon_center_2f_common.s', 'scripts_oreburgh_mine_b1f.s', 'scripts_oreburgh_mine_b2f.s', 'scripts_valley_windworks_outside.s', @@ -448,7 +448,7 @@ scr_seq_files = files( 'scripts_init_new_game.s', 'scripts_berry_tree_interaction.s', 'scripts_verity_lakefront.s', - 'scripts_verity_lakefront_unknown_house.s', + 'scripts_unused_verity_lakefront_house.s', 'scripts_valor_lakefront.s', 'scripts_restaurant.s', 'scripts_grand_lake_valor_lakefront_east_house.s', @@ -456,7 +456,7 @@ scr_seq_files = files( 'scripts_acuity_lakefront.s', 'scripts_unk_0421.s', 'scripts_follower_partners.s', - 'scripts_pokemon_center_b1f_attendants.s', + 'scripts_pokemon_center_b1f_common.s', 'scripts_record_chatot_cry.s', 'scripts_poke_radar.s', 'scripts_poffin_common.s', @@ -537,7 +537,7 @@ scr_seq_files = files( 'scripts_day_care_common.s', 'scripts_init_jubilife_city.s', 'scripts_init_jubilife_city_mart.s', - 'scripts_init_jubilife_city_unknown_house_1.s', + 'scripts_init_unused_jubilife_city_house_1.s', 'scripts_init_jubilife_city_pokecenter_1f.s', 'scripts_init_jubilife_city_pokecenter_2f.s', 'scripts_init_jubilife_city_pokecenter_b1f.s', @@ -556,7 +556,7 @@ scr_seq_files = files( 'scripts_init_jubilife_city_south_house_2f.s', 'scripts_init_jubilife_city_south_house_3f.s', 'scripts_init_unk_0522.s', - 'scripts_init_jubilife_city_unknown_house_2.s', + 'scripts_init_unused_jubilife_city_house_2.s', 'scripts_init_jubilife_city_condominiums_1f.s', 'scripts_init_jubilife_city_condominiums_2f.s', 'scripts_init_jubilife_city_condominiums_3f.s', @@ -567,8 +567,8 @@ scr_seq_files = files( 'scripts_init_trainers_school.s', 'scripts_init_jubilife_city_southwest_house_1f.s', 'scripts_init_jubilife_city_southwest_house_2f.s', - 'scripts_init_jubilife_city_unknown_house_3.s', - 'scripts_init_jubilife_city_unknown_house_4.s', + 'scripts_init_unused_jubilife_city_house_3.s', + 'scripts_init_unused_jubilife_city_house_4.s', 'scripts_init_canalave_city.s', 'scripts_init_canalave_city_mart.s', 'scripts_init_canalave_city_gym.s', @@ -701,8 +701,8 @@ scr_seq_files = files( 'scripts_init_sunyshore_city_northeast_house.s', 'scripts_init_sunyshore_city_west_house.s', 'scripts_init_sunyshore_city_northwest_house.s', - 'scripts_init_sunyshore_city_unknown_house_1.s', - 'scripts_init_sunyshore_city_unknown_house_2.s', + 'scripts_init_unused_sunyshore_city_house_1.s', + 'scripts_init_unused_sunyshore_city_house_2.s', 'scripts_init_sunyshore_city_east_house.s', 'scripts_init_vista_lighthouse.s', 'scripts_init_vista_lighthouse_elevator.s', @@ -935,7 +935,7 @@ scr_seq_files = files( 'scripts_init_wifi_plaza_entrance.s', 'scripts_init_unk_0900.s', 'scripts_init_verity_lakefront.s', - 'scripts_init_verity_lakefront_unknown_house.s', + 'scripts_init_unused_verity_lakefront_house.s', 'scripts_init_valor_lakefront.s', 'scripts_init_restaurant.s', 'scripts_init_grand_lake_valor_lakefront_east_house.s', diff --git a/res/field/scripts/scripts.order b/res/field/scripts/scripts.order index 3c8dd1005f..a9be0e6491 100644 --- a/res/field/scripts/scripts.order +++ b/res/field/scripts/scripts.order @@ -2,7 +2,7 @@ scripts_communication_club scripts_bg_events scripts_jubilife_city scripts_jubilife_city_mart -scripts_jubilife_city_unknown_house_1 +scripts_unused_jubilife_city_house_1 scripts_jubilife_city_pokecenter_1f scripts_jubilife_city_pokecenter_2f scripts_jubilife_city_pokecenter_b1f @@ -21,7 +21,7 @@ scripts_jubilife_city_south_house_1f scripts_jubilife_city_south_house_2f scripts_jubilife_city_south_house_3f scripts_unk_0022 -scripts_jubilife_city_unknown_house_2 +scripts_unused_jubilife_city_house_2 scripts_jubilife_city_condominiums_1f scripts_jubilife_city_condominiums_2f scripts_jubilife_city_condominiums_3f @@ -32,8 +32,8 @@ scripts_global_terminal_3f scripts_trainers_school scripts_jubilife_city_southwest_house_1f scripts_jubilife_city_southwest_house_2f -scripts_jubilife_city_unknown_house_3 -scripts_jubilife_city_unknown_house_4 +scripts_unused_jubilife_city_house_3 +scripts_unused_jubilife_city_house_4 scripts_canalave_city scripts_canalave_city_mart scripts_canalave_city_gym @@ -166,8 +166,8 @@ scripts_sunyshore_market scripts_sunyshore_city_northeast_house scripts_sunyshore_city_west_house scripts_sunyshore_city_northwest_house -scripts_sunyshore_city_unknown_house_1 -scripts_sunyshore_city_unknown_house_2 +scripts_unused_sunyshore_city_house_1 +scripts_unused_sunyshore_city_house_2 scripts_sunyshore_city_east_house scripts_vista_lighthouse scripts_vista_lighthouse_elevator @@ -211,7 +211,7 @@ scripts_fight_area_south_house scripts_unk_0210 scripts_common scripts_contests -scripts_pokemon_center_2f_attendants +scripts_pokemon_center_2f_common scripts_oreburgh_mine_b1f scripts_oreburgh_mine_b2f scripts_valley_windworks_outside @@ -413,7 +413,7 @@ scripts_pokedex_ratings scripts_init_new_game scripts_berry_tree_interaction scripts_verity_lakefront -scripts_verity_lakefront_unknown_house +scripts_unused_verity_lakefront_house scripts_valor_lakefront scripts_restaurant scripts_grand_lake_valor_lakefront_east_house @@ -421,7 +421,7 @@ scripts_grand_lake_valor_lakefront_west_house scripts_acuity_lakefront scripts_unk_0421 scripts_follower_partners -scripts_pokemon_center_b1f_attendants +scripts_pokemon_center_b1f_common scripts_record_chatot_cry scripts_poke_radar scripts_poffin_common @@ -502,7 +502,7 @@ scripts_battle_frontier_records scripts_day_care_common scripts_init_jubilife_city scripts_init_jubilife_city_mart -scripts_init_jubilife_city_unknown_house_1 +scripts_init_unused_jubilife_city_house_1 scripts_init_jubilife_city_pokecenter_1f scripts_init_jubilife_city_pokecenter_2f scripts_init_jubilife_city_pokecenter_b1f @@ -521,7 +521,7 @@ scripts_init_jubilife_city_south_house_1f scripts_init_jubilife_city_south_house_2f scripts_init_jubilife_city_south_house_3f scripts_init_unk_0522 -scripts_init_jubilife_city_unknown_house_2 +scripts_init_unused_jubilife_city_house_2 scripts_init_jubilife_city_condominiums_1f scripts_init_jubilife_city_condominiums_2f scripts_init_jubilife_city_condominiums_3f @@ -532,8 +532,8 @@ scripts_init_global_terminal_3f scripts_init_trainers_school scripts_init_jubilife_city_southwest_house_1f scripts_init_jubilife_city_southwest_house_2f -scripts_init_jubilife_city_unknown_house_3 -scripts_init_jubilife_city_unknown_house_4 +scripts_init_unused_jubilife_city_house_3 +scripts_init_unused_jubilife_city_house_4 scripts_init_canalave_city scripts_init_canalave_city_mart scripts_init_canalave_city_gym @@ -666,8 +666,8 @@ scripts_init_sunyshore_market scripts_init_sunyshore_city_northeast_house scripts_init_sunyshore_city_west_house scripts_init_sunyshore_city_northwest_house -scripts_init_sunyshore_city_unknown_house_1 -scripts_init_sunyshore_city_unknown_house_2 +scripts_init_unused_sunyshore_city_house_1 +scripts_init_unused_sunyshore_city_house_2 scripts_init_sunyshore_city_east_house scripts_init_vista_lighthouse scripts_init_vista_lighthouse_elevator @@ -900,7 +900,7 @@ scripts_init_unk_0898 scripts_init_wifi_plaza_entrance scripts_init_unk_0900 scripts_init_verity_lakefront -scripts_init_verity_lakefront_unknown_house +scripts_init_unused_verity_lakefront_house scripts_init_valor_lakefront scripts_init_restaurant scripts_init_grand_lake_valor_lakefront_east_house diff --git a/res/field/scripts/scripts_acuity_lakefront.s b/res/field/scripts/scripts_acuity_lakefront.s index fc8f4a1190..5ac7b5b931 100644 --- a/res/field/scripts/scripts_acuity_lakefront.s +++ b/res/field/scripts/scripts_acuity_lakefront.s @@ -6,7 +6,7 @@ ScriptEntry AcuityLakefront_OnTransition ScriptEntry AcuityLakefront_OnLoad ScriptEntry AcuityLakefront_ArrowSignpostLakeAcuity - ScriptEntry AcuityLakefront_TriggerRival + ScriptEntry AcuityLakefront_CoordEvent_Rival ScriptEntryEnd AcuityLakefront_OnLoad: @@ -40,7 +40,7 @@ AcuityLakefront_ArrowSignpostLakeAcuity: ShowArrowSign AcuityLakefront_Text_SignLakeAcuityAhead End -AcuityLakefront_TriggerRival: +AcuityLakefront_CoordEvent_Rival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 AddFreeCamera VAR_0x8004, VAR_0x8005 diff --git a/res/field/scripts/scripts_amity_square.s b/res/field/scripts/scripts_amity_square.s index 2c3c0737d0..472665d54f 100644 --- a/res/field/scripts/scripts_amity_square.s +++ b/res/field/scripts/scripts_amity_square.s @@ -12,10 +12,10 @@ ScriptEntry AmitySquare_OnTransition - ScriptEntry AmitySquare_Trigger_WestGate - ScriptEntry AmitySquare_Trigger_ExitAmitySquare - ScriptEntry AmitySquare_Trigger_EastGate - ScriptEntry AmitySquare_Trigger_ExitAmitySquare + ScriptEntry AmitySquare_CoordEvent_WestGate + ScriptEntry AmitySquare_CoordEvent_ExitAmitySquare + ScriptEntry AmitySquare_CoordEvent_EastGate + ScriptEntry AmitySquare_CoordEvent_ExitAmitySquare ScriptEntry AmitySquare_FollowerMon ScriptEntry AmitySquare_WestReceptionist ScriptEntry AmitySquare_EastReceptionist @@ -55,7 +55,7 @@ ScriptEntry AmitySquare_Warp25 ScriptEntry AmitySquare_Warp26 ScriptEntry AmitySquare_Warp27 - ScriptEntry AmitySquare_UnusedEntry45 + ScriptEntry AmitySquare_Dummy45 ScriptEntryEnd AmitySquare_OnTransition: @@ -85,7 +85,7 @@ AmitySquare_SetGiftManPosition3: SetObjectEventPos LOCALID_GIFT_MAN, 48, 41 End -AmitySquare_Trigger_WestGate: +AmitySquare_CoordEvent_WestGate: LockAll SetVar VAR_0x8001, 1 ApplyMovement LOCALID_PLAYER, AmitySquare_Movement_PlayerWalkOnSpotWest @@ -93,7 +93,7 @@ AmitySquare_Trigger_WestGate: GoTo AmitySquare_CheckHasNationalDex End -AmitySquare_Trigger_EastGate: +AmitySquare_CoordEvent_EastGate: LockAll SetVar VAR_0x8001, 2 ApplyMovement LOCALID_PLAYER, AmitySquare_Movement_PlayerWalkOnSpotEast @@ -230,7 +230,7 @@ AmitySquare_Unused: ReleaseAll End -AmitySquare_Trigger_ExitAmitySquare: +AmitySquare_CoordEvent_ExitAmitySquare: LockAll FadeScreenOut WaitFadeScreen @@ -240,10 +240,10 @@ AmitySquare_Trigger_ExitAmitySquare: AmitySquare_RemoveFollower: RemoveObject LOCALID_FOLLOWER_MON - GoTo AmitySquare_Trigger_ExitAmitySquare_End + GoTo AmitySquare_CoordEvent_ExitAmitySquare_End End -AmitySquare_Trigger_ExitAmitySquare_End: +AmitySquare_CoordEvent_ExitAmitySquare_End: FadeScreenIn WaitFadeScreen SetVar VAR_FOLLOWER_MON_ACTIVE, FALSE @@ -274,7 +274,7 @@ AmitySquare_Movement_WalkNorth: WalkNormalNorth EndMovement -AmitySquare_UnusedMovement: +AmitySquare_Movement_Unused: WalkFastestSouth 2 FaceWest EndMovement @@ -1325,7 +1325,7 @@ AmitySquare_SetPositionsWarp27: SetPosition LOCALID_FOLLOWER_MON, 33, 5, 7, DIR_SOUTH Return -AmitySquare_UnusedEntry45: +AmitySquare_Dummy45: LockAll SetVar VAR_AMITY_SQUARE_STATE, 0 ReleaseAll diff --git a/res/field/scripts/scripts_battle_arcade.s b/res/field/scripts/scripts_battle_arcade.s index d7a90d450a..a658d8a4d6 100644 --- a/res/field/scripts/scripts_battle_arcade.s +++ b/res/field/scripts/scripts_battle_arcade.s @@ -5,10 +5,10 @@ ScriptEntry BattleArcade_SingleAttendant - ScriptEntry BattleArcade_OnFrameResumeChallenge - ScriptEntry BattleArcade_OnFrameDidntSaveBeforeQuit - ScriptEntry BattleArcade_OnFrameChallengeEndedCompletedRound - ScriptEntry BattleArcade_OnFrameChallengeEnded + ScriptEntry BattleArcade_OnFrame_ResumeChallenge + ScriptEntry BattleArcade_OnFrame_DidntSaveBeforeQuit + ScriptEntry BattleArcade_OnFrame_ChallengeEndedCompletedRound + ScriptEntry BattleArcade_OnFrame_ChallengeEnded ScriptEntry BattleArcade_MultiAttendant ScriptEntry BattleArcade_Worker ScriptEntry BattleArcade_ParasolLady @@ -444,7 +444,7 @@ BattleArcade_ExplainMultiChallenge: Message BattleArcade_Text_ExplainMultiChallenge Return -BattleArcade_OnFrameResumeChallenge: +BattleArcade_OnFrame_ResumeChallenge: RecordHeapMemory SetVar VAR_MAP_LOCAL_3, 1 SetVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 0 @@ -462,13 +462,13 @@ BattleArcade_SaveGame: WaitSE SEQ_SE_DP_SAVE Return -BattleArcade_OnFrameDidntSaveBeforeQuit: +BattleArcade_OnFrame_DidntSaveBeforeQuit: Message BattleArcade_Text_DidntSaveBeforeQuit ScrCmd_2DC VAR_BATTLE_ARCADE_CHALLENGE_TYPE GoTo BattleArcade_EndChallenge End -BattleArcade_OnFrameChallengeEndedCompletedRound: +BattleArcade_OnFrame_ChallengeEndedCompletedRound: CallIfEq VAR_BATTLE_ARCADE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_SINGLE, BattleArcade_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_ARCADE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_DOUBLE, BattleArcade_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_ARCADE_PRINT_STATE, 1, BattleArcade_EarnedSilverPrint @@ -499,17 +499,17 @@ BattleArcade_EarnedGoldPrint: Common_CheckAllFrontierGoldPrintsObtained Return -BattleArcade_OnFrameChallengeEnded: +BattleArcade_OnFrame_ChallengeEnded: GoTo BattleArcade_EndChallenge End -BattleArcade_UnusedMovement: +BattleArcade_Movement_Unused: WalkNormalNorth 2 Delay8 WalkNormalNorth EndMovement -BattleArcade_UnusedMovement2: +BattleArcade_Movement_Unused2: WalkNormalNorth 2 Delay8 WalkNormalNorth diff --git a/res/field/scripts/scripts_battle_castle.s b/res/field/scripts/scripts_battle_castle.s index ad53a1cbeb..931611e235 100644 --- a/res/field/scripts/scripts_battle_castle.s +++ b/res/field/scripts/scripts_battle_castle.s @@ -5,10 +5,10 @@ ScriptEntry BattleCastle_SingleAttendant - ScriptEntry BattleCastle_OnFrameResumeChallenge - ScriptEntry BattleCastle_OnFrameDidntSaveBeforeQuit - ScriptEntry BattleCastle_OnFrameChallengeEndedCompletedRound - ScriptEntry BattleCastle_OnFrameChallengeEnded + ScriptEntry BattleCastle_OnFrame_ResumeChallenge + ScriptEntry BattleCastle_OnFrame_DidntSaveBeforeQuit + ScriptEntry BattleCastle_OnFrame_ChallengeEndedCompletedRound + ScriptEntry BattleCastle_OnFrame_ChallengeEnded ScriptEntry BattleCastle_MultiAttendant ScriptEntry BattleCastle_Artist ScriptEntry BattleCastle_Socialite @@ -439,7 +439,7 @@ BattleCastle_ExplainMultiChallenge: Message BattleCastle_Text_ExplainMultiChallenge Return -BattleCastle_OnFrameResumeChallenge: +BattleCastle_OnFrame_ResumeChallenge: RecordHeapMemory SetVar VAR_MAP_LOCAL_3, 1 SetVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 0 @@ -457,13 +457,13 @@ BattleCastle_SaveGame: WaitSE SEQ_SE_DP_SAVE Return -BattleCastle_OnFrameDidntSaveBeforeQuit: +BattleCastle_OnFrame_DidntSaveBeforeQuit: Message BattleCastle_Text_DidntSaveBeforeQuit ScrCmd_2D5 VAR_BATTLE_CASTLE_CHALLENGE_TYPE GoTo BattleCastle_EndChallenge End -BattleCastle_OnFrameChallengeEndedCompletedRound: +BattleCastle_OnFrame_ChallengeEndedCompletedRound: CallIfEq VAR_BATTLE_CASTLE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_SINGLE, BattleCastle_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_CASTLE_CHALLENGE_TYPE, FRONTIER_CHALLENGE_DOUBLE, BattleCastle_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_CASTLE_PRINT_STATE, 1, BattleCastle_EarnedSilverPrint @@ -494,17 +494,17 @@ BattleCastle_EarnedGoldPrint: Common_CheckAllFrontierGoldPrintsObtained Return -BattleCastle_OnFrameChallengeEnded: +BattleCastle_OnFrame_ChallengeEnded: GoTo BattleCastle_EndChallenge End -BattleCastle_UnusedMovement: +BattleCastle_Movement_Unused: WalkNormalNorth 2 Delay8 WalkNormalNorth EndMovement -BattleCastle_UnusedMovement2: +BattleCastle_Movement_Unused2: WalkNormalNorth 2 Delay8 WalkNormalNorth diff --git a/res/field/scripts/scripts_battle_factory.s b/res/field/scripts/scripts_battle_factory.s index 1d337a49e0..0f37c703ad 100644 --- a/res/field/scripts/scripts_battle_factory.s +++ b/res/field/scripts/scripts_battle_factory.s @@ -5,10 +5,10 @@ ScriptEntry BattleFactory_SingleAttendant - ScriptEntry BattleFactory_OnFrameResumeChallenge - ScriptEntry BattleFactory_OnFrameDidntSaveBeforeQuit - ScriptEntry BattleFactory_OnFrameChallengeEndedCompletedRound - ScriptEntry BattleFactory_OnFrameChallengeEnded + ScriptEntry BattleFactory_OnFrame_ResumeChallenge + ScriptEntry BattleFactory_OnFrame_DidntSaveBeforeQuit + ScriptEntry BattleFactory_OnFrame_ChallengeEndedCompletedRound + ScriptEntry BattleFactory_OnFrame_ChallengeEnded ScriptEntry BattleFactory_MultiAttendant ScriptEntry BattleFactory_PokemonBreederF ScriptEntry BattleFactory_Sailor @@ -396,7 +396,7 @@ BattleFactory_ExplainMultiChallenge: Message BattleFactory_Text_ExplainMultiChallenge Return -BattleFactory_OnFrameResumeChallenge: +BattleFactory_OnFrame_ResumeChallenge: RecordHeapMemory SetVar VAR_MAP_LOCAL_3, 1 SetVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 0 @@ -414,13 +414,13 @@ BattleFactory_SaveGame: WaitSE SEQ_SE_DP_SAVE Return -BattleFactory_OnFrameDidntSaveBeforeQuit: +BattleFactory_OnFrame_DidntSaveBeforeQuit: Message BattleFactory_Text_DidntSaveBeforeQuit ScrCmd_2C5 VAR_BATTLE_FACTORY_CHALLENGE_TYPE, VAR_BATTLE_FACTORY_CHALLENGE_LEVEL GoTo BattleFactory_EndChallenge End -BattleFactory_OnFrameChallengeEndedCompletedRound: +BattleFactory_OnFrame_ChallengeEndedCompletedRound: CallIfEq VAR_BATTLE_FACTORY_CHALLENGE_TYPE, FRONTIER_CHALLENGE_SINGLE, BattleFactory_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_FACTORY_CHALLENGE_TYPE, FRONTIER_CHALLENGE_DOUBLE, BattleFactory_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_FACTORY_PRINT_STATE, 1, BattleFactory_EarnedSilverPrint @@ -451,18 +451,18 @@ BattleFactory_EarnedGoldPrint: Common_CheckAllFrontierGoldPrintsObtained Return -BattleFactory_OnFrameChallengeEnded: +BattleFactory_OnFrame_ChallengeEnded: GoTo BattleFactory_EndChallenge End .balign 4, 0 -BattleFactory_UnusedMovement: +BattleFactory_Movement_Unused: WalkNormalNorth 2 Delay8 WalkNormalNorth EndMovement -BattleFactory_UnusedMovement2: +BattleFactory_Movement_Unused2: WalkNormalNorth 2 Delay8 WalkNormalNorth diff --git a/res/field/scripts/scripts_battle_frontier.s b/res/field/scripts/scripts_battle_frontier.s index b652972f25..2d4e6fd484 100644 --- a/res/field/scripts/scripts_battle_frontier.s +++ b/res/field/scripts/scripts_battle_frontier.s @@ -3,7 +3,7 @@ #include "res/field/events/events_battle_frontier.h" - ScriptEntry BattleFrontier_Unused1 + ScriptEntry BattleFrontier_Dummy1 ScriptEntry BattleFrontier_NinjaBoy ScriptEntry BattleFrontier_BlackBelt ScriptEntry BattleFrontier_Idol @@ -26,20 +26,20 @@ ScriptEntry BattleFrontier_Fisherman ScriptEntry BattleFrontier_TuberM ScriptEntry BattleFrontier_AttendantSouthwest - ScriptEntry BattleFrontier_Unused24 + ScriptEntry BattleFrontier_ScratchOffCards_Unused ScriptEntry BattleFrontier_AttendantSoutheast - ScriptEntry BattleFrontier_SignBattleTower - ScriptEntry BattleFrontier_SignBattleHall - ScriptEntry BattleFrontier_SignBattleCastle - ScriptEntry BattleFrontier_SignBattleArcade - ScriptEntry BattleFrontier_SignBattleFactory + ScriptEntry BattleFrontier_TrainerTipsSignpostBattleTower + ScriptEntry BattleFrontier_TrainerTipsSignpostBattleHall + ScriptEntry BattleFrontier_TrainerTipsSignpostBattleCastle + ScriptEntry BattleFrontier_TrainerTipsSignpostBattleArcade + ScriptEntry BattleFrontier_TrainerTipsSignpostBattleFactory ScriptEntry BattleFrontier_StatueWest ScriptEntry BattleFrontier_StatueEast ScriptEntry BattleFrontier_ScaleModel - ScriptEntry BattleFrontier_TriggerEnterBattleHall - ScriptEntry BattleFrontier_TriggerEnterBattleCastle - ScriptEntry BattleFrontier_TriggerEnterBattleArcade - ScriptEntry BattleFrontier_TriggerEnterBattleFactory + ScriptEntry BattleFrontier_CoordEvent_EnterBattleHall + ScriptEntry BattleFrontier_CoordEvent_EnterBattleCastle + ScriptEntry BattleFrontier_CoordEvent_EnterBattleArcade + ScriptEntry BattleFrontier_CoordEvent_EnterBattleFactory ScriptEntry BattleFrontier_OnTransition ScriptEntryEnd @@ -152,7 +152,7 @@ BattleFrontier_AttendantSouthwest: ReleaseAll End -BattleFrontier_Unused24: +BattleFrontier_ScratchOffCards_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer @@ -175,23 +175,23 @@ BattleFrontier_AttendantSoutheast: ReleaseAll End -BattleFrontier_SignBattleTower: +BattleFrontier_TrainerTipsSignpostBattleTower: ShowLandmarkSign BattleFrontier_Text_SignBattleTower End -BattleFrontier_SignBattleHall: +BattleFrontier_TrainerTipsSignpostBattleHall: ShowLandmarkSign BattleFrontier_Text_SignBattleHall End -BattleFrontier_SignBattleCastle: +BattleFrontier_TrainerTipsSignpostBattleCastle: ShowLandmarkSign BattleFrontier_Text_SignBattleCastle End -BattleFrontier_SignBattleArcade: +BattleFrontier_TrainerTipsSignpostBattleArcade: ShowLandmarkSign BattleFrontier_Text_SignBattleArcade End -BattleFrontier_SignBattleFactory: +BattleFrontier_TrainerTipsSignpostBattleFactory: ShowLandmarkSign BattleFrontier_Text_SignBattleFactory End @@ -207,7 +207,7 @@ BattleFrontier_ScaleModel: EventMessage BattleFrontier_Text_ScaleModelBattleFrontier End -BattleFrontier_TriggerEnterBattleHall: +BattleFrontier_CoordEvent_EnterBattleHall: LockAll ApplyMovement LOCALID_PLAYER, BattleFrontier_Movement_PlayerEnterBattleHall WaitMovement @@ -224,7 +224,7 @@ BattleFrontier_Movement_PlayerEnterBattleHall: WalkFastWest 5 EndMovement -BattleFrontier_TriggerEnterBattleCastle: +BattleFrontier_CoordEvent_EnterBattleCastle: LockAll ApplyMovement LOCALID_PLAYER, BattleFrontier_Movement_PlayerEnterBattleCastle WaitMovement @@ -241,7 +241,7 @@ BattleFrontier_Movement_PlayerEnterBattleCastle: WalkFastWest 6 EndMovement -BattleFrontier_TriggerEnterBattleArcade: +BattleFrontier_CoordEvent_EnterBattleArcade: LockAll ApplyMovement LOCALID_PLAYER, BattleFrontier_Movement_PlayerEnterBattleArcade WaitMovement @@ -258,7 +258,7 @@ BattleFrontier_Movement_PlayerEnterBattleArcade: WalkFastEast 5 EndMovement -BattleFrontier_TriggerEnterBattleFactory: +BattleFrontier_CoordEvent_EnterBattleFactory: LockAll ApplyMovement LOCALID_PLAYER, BattleFrontier_Movement_PlayerEnterBattleFactory WaitMovement @@ -275,7 +275,7 @@ BattleFrontier_Movement_PlayerEnterBattleFactory: WalkFastEast 6 EndMovement -BattleFrontier_Unused1: +BattleFrontier_Dummy1: End .balign 4, 0 diff --git a/res/field/scripts/scripts_battle_frontier_gate_to_fight_area.s b/res/field/scripts/scripts_battle_frontier_gate_to_fight_area.s index badf6e6c26..af4512b8e7 100644 --- a/res/field/scripts/scripts_battle_frontier_gate_to_fight_area.s +++ b/res/field/scripts/scripts_battle_frontier_gate_to_fight_area.s @@ -3,7 +3,7 @@ #include "res/field/events/events_battle_frontier_gate_to_fight_area.h" - ScriptEntry BattleFrontierGateToFightArea_OnFrameFirstEntry + ScriptEntry BattleFrontierGateToFightArea_OnFrame_FirstEntry ScriptEntry BattleFrontierGateToFightArea_AttendantGeneral ScriptEntry BattleFrontierGateToFightArea_AttendantBattleTower ScriptEntry BattleFrontierGateToFightArea_AttendantBattleFactory @@ -21,7 +21,7 @@ BattleFrontierGateToFightArea_OnTransition: SetFlag FLAG_FIRST_ARRIVAL_BATTLE_PARK End -BattleFrontierGateToFightArea_OnFrameFirstEntry: +BattleFrontierGateToFightArea_OnFrame_FirstEntry: LockAll SetVar VAR_BATTLE_FRONTIER_GATE_TO_FIGHT_AREA_STATE, 1 SetFlag FLAG_HIDE_JUBILIFE_TV_3F_GLOBAL_RANKING_ROOM_WORKER diff --git a/res/field/scripts/scripts_battle_frontier_records.s b/res/field/scripts/scripts_battle_frontier_records.s index 3a18ded0cf..43029371cf 100644 --- a/res/field/scripts/scripts_battle_frontier_records.s +++ b/res/field/scripts/scripts_battle_frontier_records.s @@ -77,41 +77,41 @@ FrontierRecords_BattleHallMenus: GoToIfEq VAR_0x8008, 3, FrontierRecords_CloseAndExit GoToIfEq VAR_0x8008, MENU_CANCEL, FrontierRecords_CloseAndExit ScrCmd_2CC 1, VAR_0x8001, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _0174 + GoToIfEq VAR_RESULT, 0, FrontierRecords_WhichPokemon ScrCmd_2CC 2, VAR_0x8001, VAR_RESULT BufferSpeciesNameFromVar 0, VAR_RESULT, 0, 0 Message BattleFrontierRecords_Text_OnChallengeNow - GoTo _017F + GoTo FrontierRecords_InitVarsSelectStartingLetters End -_0174: +FrontierRecords_WhichPokemon: Message BattleFrontierRecords_Text_WhichPokemon - GoTo _017F + GoTo FrontierRecords_InitVarsSelectStartingLetters End -_017F: +FrontierRecords_InitVarsSelectStartingLetters: SetVar VAR_0x8002, 0 SetVar VAR_0x8004, 0 SetVar VAR_0x8005, 0 - GoTo _0199 + GoTo FrontierRecords_SelectStartingLetters End -_0199: - Call FrontierRecords_SelectStartingLetters +FrontierRecords_SelectStartingLetters: + Call FrontierRecords_InitMenuStartingLetters GoToIfEq VAR_0x8002, 9, FrontierRecords_BattleHallMenus GoToIfEq VAR_0x8002, MENU_CANCEL, FrontierRecords_BattleHallMenus SetVar VAR_0x8003, 0 SetVar VAR_0x8006, 0 SetVar VAR_0x8007, 0 - GoTo _01D3 + GoTo FrontierRecords_SelectPokemonWithStartingLetter End -_01D3: +FrontierRecords_SelectPokemonWithStartingLetter: ShowBattleHallRecordMonSelectionMenu VAR_0x8001, VAR_0x8002, VAR_0x8003, VAR_0x8006, VAR_0x8007 - GoToIfEq VAR_0x8003, MENU_CANCEL, _0199 + GoToIfEq VAR_0x8003, MENU_CANCEL, FrontierRecords_SelectStartingLetters Call FrontierRecords_OpenRecordDisplay Message BattleFrontierRecords_Text_WhichPokemon - GoTo _01D3 + GoTo FrontierRecords_SelectPokemonWithStartingLetter End FrontierRecords_BattleCastle: @@ -162,7 +162,7 @@ FrontierRecords_SelectChallengeType: ShowMenu Return -FrontierRecords_SelectStartingLetters: +FrontierRecords_InitMenuStartingLetters: InitLocalTextListMenu 25, 1, 0, VAR_0x8002 AddListMenuEntry BattleFrontierRecords_Text_ABC, 0 AddListMenuEntry BattleFrontierRecords_Text_DEF, 1 diff --git a/res/field/scripts/scripts_battle_hall.s b/res/field/scripts/scripts_battle_hall.s index 362e4debb3..f51fbe86bf 100644 --- a/res/field/scripts/scripts_battle_hall.s +++ b/res/field/scripts/scripts_battle_hall.s @@ -6,10 +6,10 @@ ScriptEntry BattleHall_SingleAttendant - ScriptEntry BattleHall_OnFrameResumeChallenge - ScriptEntry BattleHall_OnFrameDidntSaveBeforeQuit - ScriptEntry BattleHall_OnFrameChallengeEndedCompletedRound - ScriptEntry BattleHall_OnFrameChallengeEnded + ScriptEntry BattleHall_OnFrame_ResumeChallenge + ScriptEntry BattleHall_OnFrame_DidntSaveBeforeQuit + ScriptEntry BattleHall_OnFrame_ChallengeEndedCompletedRound + ScriptEntry BattleHall_OnFrame_ChallengeEnded ScriptEntry BattleHall_MultiAttendant ScriptEntry BattleHall_Hiker ScriptEntry BattleHall_SnowpointNPC @@ -567,7 +567,7 @@ BattleHall_ExplainMultiChallenge: Message BattleHall_Text_ExplainMultiChallenge Return -BattleHall_OnFrameResumeChallenge: +BattleHall_OnFrame_ResumeChallenge: RecordHeapMemory SetVar VAR_MAP_LOCAL_3, 1 SetVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 0 @@ -585,13 +585,13 @@ BattleHall_SaveGame: WaitSE SEQ_SE_DP_SAVE Return -BattleHall_OnFrameDidntSaveBeforeQuit: +BattleHall_OnFrame_DidntSaveBeforeQuit: Message BattleHall_Text_DidntSaveBeforeQuit ScrCmd_2D1 VAR_BATTLE_HALL_CHALLENGE_TYPE GoTo BattleHall_EndChallenge End -BattleHall_OnFrameChallengeEndedCompletedRound: +BattleHall_OnFrame_ChallengeEndedCompletedRound: CallIfEq VAR_BATTLE_HALL_CHALLENGE_TYPE, FRONTIER_CHALLENGE_SINGLE, BattleHall_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_HALL_CHALLENGE_TYPE, FRONTIER_CHALLENGE_DOUBLE, BattleHall_IncrementTrainerScoreRoundCompleted CallIfEq VAR_BATTLE_HALL_PRINT_STATE, 1, BattleHall_EarnedSilverPrint @@ -622,17 +622,17 @@ BattleHall_EarnedGoldPrint: Common_CheckAllFrontierGoldPrintsObtained Return -BattleHall_OnFrameChallengeEnded: +BattleHall_OnFrame_ChallengeEnded: GoTo BattleHall_EndChallenge End -BattleHall_UnusedMovement: +BattleHall_Movement_Unused: WalkNormalNorth 2 Delay8 WalkNormalNorth EndMovement -BattleHall_UnusedMovement2: +BattleHall_Movement_Unused2: WalkNormalNorth 2 Delay8 WalkNormalNorth diff --git a/res/field/scripts/scripts_battle_tower.s b/res/field/scripts/scripts_battle_tower.s index d294563e16..1dbc205c6b 100644 --- a/res/field/scripts/scripts_battle_tower.s +++ b/res/field/scripts/scripts_battle_tower.s @@ -8,14 +8,14 @@ ScriptEntry BattleTower_SingleAttendant ScriptEntry BattleTower_MultiAttendant ScriptEntry BattleTower_WiFiAttendant - ScriptEntry BattleTower_OnFrameChallengeEnded - ScriptEntry BattleTower_OnFrameResumeChallenge - ScriptEntry BattleTower_OnFrameDidntSaveBeforeQuit + ScriptEntry BattleTower_OnFrame_ChallengeEnded + ScriptEntry BattleTower_OnFrame_ResumeChallenge + ScriptEntry BattleTower_OnFrame_DidntSaveBeforeQuit ScriptEntry BattleTower_Teala - ScriptEntry BattleTower_OnFrameQuitBattleSalon - ScriptEntry BattleTower_Unused9 - ScriptEntry BattleTower_Unused10 - ScriptEntry BattleTower_Unused11 + ScriptEntry BattleTower_OnFrame_QuitBattleSalon + ScriptEntry BattleTower_Dummy9 + ScriptEntry BattleTower_ResultsMachine0_Unused + ScriptEntry BattleTower_ResultsMachine1_Unused ScriptEntry BattleTower_MachineWiFiResults ScriptEntry BattleTower_MachineWiFiLeaders ScriptEntry BattleTower_ParasolLady @@ -301,11 +301,11 @@ BattleTower_SelectPokemon: WaitFadeScreen Return -BattleTower_OnFrameResumeChallenge: +BattleTower_OnFrame_ResumeChallenge: LockAll SetVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 0 CallBattleTowerFunction BT_FUNC_UNK_04, 0, VAR_RESULT - GoToIfEq VAR_RESULT, 0, BattleTower_OnFrameDidntSaveBeforeQuit + GoToIfEq VAR_RESULT, 0, BattleTower_OnFrame_DidntSaveBeforeQuit Message BattleTower_Text_SaveBeforeEntering InitBattleTower 1, 0xFFFF CallBattleTowerFunction BT_FUNC_GET_CHALLENGE_MODE, 0, VAR_RESULT @@ -337,7 +337,7 @@ BattleTower_SetVarsResumeMultiChallenge: SetVar VAR_BATTLE_TOWER_BATTLE_SALON_STATE, 0 Return -BattleTower_OnFrameDidntSaveBeforeQuit: +BattleTower_OnFrame_DidntSaveBeforeQuit: LockAll Message BattleTower_Text_DidntSaveBeforeQuit CallBattleTowerFunction BT_FUNC_UNK_14, 0, VAR_RESULT @@ -418,7 +418,7 @@ BattleTower_GoToWarpToElevator: GoTo BattleTower_WarpToElevator End -BattleTower_OnFrameQuitBattleSalon: +BattleTower_OnFrame_QuitBattleSalon: LockAll Call BattleTower_ResetVarsClearCommunication CallBattleTowerFunction BT_FUNC_CHECK_IS_NULL, 0, VAR_RESULT @@ -873,7 +873,7 @@ _0EA2: GoTo _0E58 End -BattleTower_OnFrameChallengeEnded: +BattleTower_OnFrame_ChallengeEnded: LockAll FadeScreenIn WaitFadeScreen @@ -1117,7 +1117,7 @@ BattleTower_Movement_PlayerFaceEast: FaceEast EndMovement -BattleTower_Unused10: +BattleTower_ResultsMachine0_Unused: PlaySE SEQ_SE_CONFIRM LockAll SetVar VAR_0x8000, 0 @@ -1125,7 +1125,7 @@ BattleTower_Unused10: Call BattleTower_ResultsMachine End -BattleTower_Unused11: +BattleTower_ResultsMachine1_Unused: PlaySE SEQ_SE_CONFIRM LockAll SetVar VAR_0x8000, 0 @@ -1196,7 +1196,7 @@ BattleTower_SchoolKidM1: NPCMessage BattleTower_Text_ManyToughTrainers End -BattleTower_Unused9: +BattleTower_Dummy9: End BattleTower_Pikachu2: diff --git a/res/field/scripts/scripts_battle_tower_battle_room.s b/res/field/scripts/scripts_battle_tower_battle_room.s index 2ea84e8dfc..57773f9d87 100644 --- a/res/field/scripts/scripts_battle_tower_battle_room.s +++ b/res/field/scripts/scripts_battle_tower_battle_room.s @@ -6,9 +6,9 @@ ScriptEntry BattleTowerBattleRoom_OnTransition - ScriptEntry BattleTowerBattleRoom_OnFrameStartChallenge - ScriptEntry BattleTowerBattleRoom_OnFrameResumeChallenge - ScriptEntry BattleTowerBattleRoom_Unused4 + ScriptEntry BattleTowerBattleRoom_OnFrame_StartChallenge + ScriptEntry BattleTowerBattleRoom_OnFrame_ResumeChallenge + ScriptEntry BattleTowerBattleRoom_OpponentEnterAndBattle_Unused ScriptEntry BattleTowerBattleRoom_OnResume ScriptEntryEnd @@ -29,7 +29,7 @@ BattleTowerBattleRoom_SetPlayerPositionForBattle: SetPosition LOCALID_BT_PLAYER, 5, 0, 6, DIR_EAST End -BattleTowerBattleRoom_Unused4: +BattleTowerBattleRoom_OpponentEnterAndBattle_Unused: SetVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 0 PlaySE SEQ_SE_CONFIRM LockAll @@ -69,7 +69,7 @@ BattleTowerBattleRoom_WarpToLobbbyWiFiAttendant: ReleaseAll End -BattleTowerBattleRoom_OnFrameStartChallenge: +BattleTowerBattleRoom_OnFrame_StartChallenge: LockAll SetVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 CallBattleTowerFunction BT_FUNC_CHECK_IS_NULL, 0, VAR_RESULT @@ -78,7 +78,7 @@ BattleTowerBattleRoom_OnFrameStartChallenge: GoTo BattleTowerBattleRoom_Opponent End -BattleTowerBattleRoom_OnFrameResumeChallenge: +BattleTowerBattleRoom_OnFrame_ResumeChallenge: LockAll SetVar VAR_BATTLE_TOWER_BATTLE_ROOM_LOAD_ACTION, 3 CallBattleTowerFunction BT_FUNC_CHECK_IS_NULL, 0, VAR_RESULT @@ -300,7 +300,7 @@ BattleTowerBattleRoom_PalmerEnter: WaitMovement Return -BattleTowerBattleRoom_UnusedMovement: +BattleTowerBattleRoom_Movement_Unused: Delay4 FaceWest WalkNormalWest 5 diff --git a/res/field/scripts/scripts_battle_tower_battle_salon.s b/res/field/scripts/scripts_battle_tower_battle_salon.s index cf03a4d1f8..a5c3040f3c 100644 --- a/res/field/scripts/scripts_battle_tower_battle_salon.s +++ b/res/field/scripts/scripts_battle_tower_battle_salon.s @@ -12,8 +12,8 @@ ScriptEntry BattleTowerBattleSalon_Buck ScriptEntry BattleTowerBattleSalon_OnTransition ScriptEntry BattleTowerBattleSalon_OnResume - ScriptEntry BattleTowerBattleSalon_OnFrameEnterBattleSalon - ScriptEntry BattleTowerBattleSalon_OnFrameEnterBattleRoom + ScriptEntry BattleTowerBattleSalon_OnFrame_EnterBattleSalon + ScriptEntry BattleTowerBattleSalon_OnFrame_EnterBattleRoom ScriptEntryEnd BattleTowerBattleSalon_OnTransition: @@ -92,7 +92,7 @@ BattleTowerBattleSalon_SetAttendantPositionAtDoor: SetPosition LOCALID_TEALA, 8, 0, 3, DIR_SOUTH End -BattleTowerBattleSalon_OnFrameEnterBattleSalon: +BattleTowerBattleSalon_OnFrame_EnterBattleSalon: LockAll SetVar VAR_BATTLE_TOWER_BATTLE_SALON_STATE, 0 Call BattleTowerBattleSalon_EnterBattleSalon @@ -126,7 +126,7 @@ BattleTowerBattleSalon_Quit: WaitFadeScreen End -BattleTowerBattleSalon_OnFrameEnterBattleRoom: +BattleTowerBattleSalon_OnFrame_EnterBattleRoom: LockAll SetVar VAR_BATTLE_TOWER_BATTLE_SALON_STATE, 0 Message BattleTowerBattleSalon_Text_ShowYouToMultiBattleRoom diff --git a/res/field/scripts/scripts_battle_tower_corridor.s b/res/field/scripts/scripts_battle_tower_corridor.s index b63d879283..ddf60127eb 100644 --- a/res/field/scripts/scripts_battle_tower_corridor.s +++ b/res/field/scripts/scripts_battle_tower_corridor.s @@ -5,7 +5,7 @@ ScriptEntry BattleTowerCorridorMulti_OnTransition ScriptEntry BattleTowerCorridorMulti_OnResume - ScriptEntry BattleTowerCorridorMulti_OnFrameEnterBattleRoom + ScriptEntry BattleTowerCorridorMulti_OnFrame_EnterBattleRoom ScriptEntryEnd BattleTowerCorridorMulti_OnTransition: @@ -19,7 +19,7 @@ BattleTowerCorridorMulti_HidePlayer: HideObject LOCALID_PLAYER Return -BattleTowerCorridorMulti_OnFrameEnterBattleRoom: +BattleTowerCorridorMulti_OnFrame_EnterBattleRoom: LockAll Call BattleTowerCorridorMulti_EnterCorridor GetRandom VAR_RESULT, 4 diff --git a/res/field/scripts/scripts_battle_tower_corridor_multi.s b/res/field/scripts/scripts_battle_tower_corridor_multi.s index d2117a3259..61371630a4 100644 --- a/res/field/scripts/scripts_battle_tower_corridor_multi.s +++ b/res/field/scripts/scripts_battle_tower_corridor_multi.s @@ -5,7 +5,7 @@ ScriptEntry BattleTowerCorridorMulti_OnTransition ScriptEntry BattleTowerCorridorMulti_OnResume - ScriptEntry BattleTowerCorridorMulti_OnFrameEnterBattleRoom + ScriptEntry BattleTowerCorridorMulti_OnFrame_EnterBattleRoom ScriptEntryEnd BattleTowerCorridorMulti_OnTransition: @@ -37,7 +37,7 @@ BattleTowerCorridorMulti_HidePlayerMoveCamera: MoveCamera 8, 0, 0 Return -BattleTowerCorridorMulti_OnFrameEnterBattleRoom: +BattleTowerCorridorMulti_OnFrame_EnterBattleRoom: LockAll Call BattleTowerCorridorMulti_EnterCorridor Call BattleTowerCorridorMulti_WalkToBattleRoom diff --git a/res/field/scripts/scripts_battle_tower_elevator.s b/res/field/scripts/scripts_battle_tower_elevator.s index 3ed76e00b6..304164f3fe 100644 --- a/res/field/scripts/scripts_battle_tower_elevator.s +++ b/res/field/scripts/scripts_battle_tower_elevator.s @@ -4,9 +4,9 @@ ScriptEntry BattleTowerElevator_OnTransition - ScriptEntry BattleTowerElevator_OnFrameEnterBattleRoom - ScriptEntry BattleTowerElevator_OnFrameEnterMultiBattleRoom - ScriptEntry BattleTowerElevator_OnFrameEnterBattleSalon + ScriptEntry BattleTowerElevator_OnFrame_EnterBattleRoom + ScriptEntry BattleTowerElevator_OnFrame_EnterMultiBattleRoom + ScriptEntry BattleTowerElevator_OnFrame_EnterBattleSalon ScriptEntryEnd BattleTowerElevator_OnTransition: @@ -74,21 +74,21 @@ BattleTowerElevator_ElevatorAnimation: Call BattleTowerElevator_Exit Return -BattleTowerElevator_OnFrameEnterBattleRoom: +BattleTowerElevator_OnFrame_EnterBattleRoom: LockAll SetVar VAR_MAP_LOCAL_0, ELEVATOR_DIR_UP Call BattleTowerElevator_ElevatorAnimation GoTo BattleTowerElevator_BattleRoomCheckWiFi End -BattleTowerElevator_OnFrameEnterMultiBattleRoom: +BattleTowerElevator_OnFrame_EnterMultiBattleRoom: LockAll SetVar VAR_MAP_LOCAL_0, ELEVATOR_DIR_UP Call BattleTowerElevator_ElevatorAnimation GoTo BattleTowerElevator_MultiBattleRoom End -BattleTowerElevator_OnFrameEnterBattleSalon: +BattleTowerElevator_OnFrame_EnterBattleSalon: LockAll SetVar VAR_MAP_LOCAL_0, ELEVATOR_DIR_DOWN Call BattleTowerElevator_ElevatorAnimation @@ -106,7 +106,7 @@ BattleTowerElevator_Exit: WaitMovement Return -BattleTowerElevator_UnusedMovement: +BattleTowerElevator_Movement_Unused: WalkNormalNorth 2 FaceEast WalkNormalEast diff --git a/res/field/scripts/scripts_battle_tower_multi_battle_room.s b/res/field/scripts/scripts_battle_tower_multi_battle_room.s index 254fadc091..35bf32d106 100644 --- a/res/field/scripts/scripts_battle_tower_multi_battle_room.s +++ b/res/field/scripts/scripts_battle_tower_multi_battle_room.s @@ -7,8 +7,8 @@ ScriptEntry BattleTowerMultiBattleRoom_OnTransition ScriptEntry BattleTowerMultiBattleRoom_OnResume - ScriptEntry BattleTowerMultiBattleRoom_OnFrameEnter - ScriptEntry BattleTowerMultiBattleRoom_OnFrameContinueMultiChallenge + ScriptEntry BattleTowerMultiBattleRoom_OnFrame_Enter + ScriptEntry BattleTowerMultiBattleRoom_OnFrame_ContinueMultiChallenge ScriptEntryEnd BattleTowerMultiBattleRoom_OnTransition: @@ -84,7 +84,7 @@ BattleTowerMultiBattleRoom_EndCommunicationWarpToLobby: ReleaseAll End -BattleTowerMultiBattleRoom_OnFrameEnter: +BattleTowerMultiBattleRoom_OnFrame_Enter: LockAll SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 Call BattleTowerMultiBattleRoom_PlayersEnter @@ -93,7 +93,7 @@ BattleTowerMultiBattleRoom_OnFrameEnter: GoTo BattleTowerMultiBattleRoom_DoMultiBattle End -BattleTowerMultiBattleRoom_OnFrameContinueMultiChallenge: +BattleTowerMultiBattleRoom_OnFrame_ContinueMultiChallenge: LockAll SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 3 Call BattleTowerMultiBattleRoom_PlayersEnter diff --git a/res/field/scripts/scripts_battleground.s b/res/field/scripts/scripts_battleground.s index 71f42af065..c431aceabd 100644 --- a/res/field/scripts/scripts_battleground.s +++ b/res/field/scripts/scripts_battleground.s @@ -10,7 +10,7 @@ ScriptEntry Battleground_ExpertM ScriptEntry Battleground_Buck - ScriptEntry Battleground_OnFrameWelcome + ScriptEntry Battleground_OnFrame_Welcome ScriptEntry Battleground_OnTransition ScriptEntry Battleground_Trainer1 ScriptEntry Battleground_Trainer2 @@ -187,7 +187,7 @@ Battleground_Movement_BuckLeaveZ9: WalkNormalSouth 2 EndMovement -Battleground_OnFrameWelcome: +Battleground_OnFrame_Welcome: LockAll SetVar VAR_BATTLEGROUND_STATE, 1 ApplyMovement LOCALID_EXPERT_M, Battleground_Movement_ExpertFExclamationMark diff --git a/res/field/scripts/scripts_berry_tree_interaction.s b/res/field/scripts/scripts_berry_tree_interaction.s index a6388b8d5a..758b363760 100644 --- a/res/field/scripts/scripts_berry_tree_interaction.s +++ b/res/field/scripts/scripts_berry_tree_interaction.s @@ -4,13 +4,13 @@ #include "generated/berry_growth_stages.h" - ScriptEntry BerryTreeMainScript - ScriptEntry BerryTree_PlantBerryScript - ScriptEntry BerryTree_WaterBerryScript - ScriptEntry BerryTree_ApplyMulchScript + ScriptEntry BerryTree_Main + ScriptEntry BerryTree_PlantBerry + ScriptEntry BerryTree_UseSprayduck + ScriptEntry BerryTree_UseMulch ScriptEntryEnd -BerryTreeMainScript: +BerryTree_Main: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer @@ -51,7 +51,7 @@ BerryTree_SproutedState: BerryTree_SproutedStateNoWater: BufferBerryName 0, VAR_0x8000 - Message BerryTrees_Text_BerryPlantHasSproutedAfterHarvest + Message BerryTrees_Text_PlantHasSproutedAfterHarvest WaitButton GoTo BerryTree_CloseAndEnd @@ -64,7 +64,7 @@ BerryTree_GrowingState: BerryTree_GrowingStateNoWater: BufferBerryName 0, VAR_0x8000 - Message BerryTrees_Text_BerryPlantIsGrowingBiggerAfterHarvest + Message BerryTrees_Text_PlantIsGrowingAfterHarvest WaitButton GoTo BerryTree_CloseAndEnd @@ -77,7 +77,7 @@ BerryTree_BloomingState: BerryTree_BloomingStateNoWater: BufferBerryName 0, VAR_0x8000 - Message BerryTrees_Text_BerryPlantIsInBloomAfterHarvest + Message BerryTrees_Text_PlantIsInBloomAfterHarvest WaitButton GoTo BerryTree_CloseAndEnd @@ -124,12 +124,12 @@ BerryTree_FruitState: BufferNumber 1, VAR_0x8001 GoToIfGt VAR_0x8001, 1, BerryTree_ShowMultipleBerriesMessage BufferItemNameWithArticle 0, VAR_0x8000 - Message BerryTrees_Text_ThereIsBerryWantToPickIt + Message BerryTrees_Text_WantToPickBerry GoTo BerryTree_ShowHarvestMenu BerryTree_ShowMultipleBerriesMessage: BufferItemNamePlural 0, VAR_0x8000 - Message BerryTrees_Text_ThereAreBerriesWantToPickThem + Message BerryTrees_Text_WantToPickBerries BerryTree_ShowHarvestMenu: ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_NO, BerryTree_HandleHarvestDeclined @@ -157,7 +157,7 @@ BerryTree_ShowMultipleBerriesStoredMessage: BerryTree_ShowBerriesStoredMessage: GetItemPocket VAR_0x8000, VAR_RESULT BufferPocketName 3, VAR_RESULT - Message BerryTrees_Text_PlayerPutAwayBerriesInBagPocket + Message BerryTrees_Text_PlayerPutBerriesInPocket WaitButton GoTo BerryTree_CloseAndEnd @@ -169,7 +169,7 @@ BerryTree_CheckBagSpace: BerryTree_ShowMultipleBerriesBagFullMessage: BufferItemNamePlural 0, VAR_0x8000 BerryTree_ShowBagFullMessage: - Message BerryTrees_Text_BagIsFullBerriesCouldntBeTaken + Message BerryTrees_Text_BagIsFull WaitButton GoTo BerryTree_CloseAndEnd @@ -182,12 +182,12 @@ BerryTree_ShowLeftBerryMessage: BufferPlayerName 0 GoToIfGt VAR_0x8001, 1, BerryTree_ShowLeftBerriesMessage BufferItemName 1, VAR_0x8000 - Message BerryTrees_Text_PlayerLeftBerryWhereItWas + Message BerryTrees_Text_PlayerLeftBerry GoTo BerryTree_EndLeftBerryMessage BerryTree_ShowLeftBerriesMessage: BufferItemNamePlural 1, VAR_0x8000 - Message BerryTrees_Text_PlayerLeftBerriesWhereTheyWere + Message BerryTrees_Text_PlayerLeftBerries BerryTree_EndLeftBerryMessage: WaitButton GoTo BerryTree_CloseAndEnd @@ -261,7 +261,7 @@ BerryTree_ApplyMulch: BerryTree_ShowMulchAppliedMessage: BufferItemName 0, VAR_0x8005 - Message BerryTrees_Text_MulchWasScatteredOnSoilAfterHarvest + Message BerryTrees_Text_MulchWasScatteredAfterHarvest WaitButton GoTo BerryTree_CloseAndEnd @@ -280,7 +280,7 @@ BerryTree_OpenBerryMenu: GetSelectedItem VAR_RESULT GoToIfEq VAR_RESULT, 0, BerryTree_ReleaseAndEnd BufferItemName 0, VAR_RESULT - Message BerryTrees_Text_BerryWasPlantedInSoftSoil + Message BerryTrees_Text_BerryWasPlantedInSoil WaitButton RemoveItem VAR_RESULT, 1, VAR_0x8004 PlantBerry VAR_RESULT @@ -300,16 +300,16 @@ BerryTree_ShowEmptySoilMessage: BerryTree_ShowMulchExistsMessage: GetBerryMulchType VAR_RESULT BufferItemName 0, VAR_RESULT - Message BerryTrees_Text_MulchHasBeenLaidDownAfterHarvest + Message BerryTrees_Text_MulchLaidDownAfterHarvest WaitButton GoTo BerryTree_CloseAndEnd -BerryTree_PlantBerryScript: +BerryTree_PlantBerry: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer BufferItemName 0, VAR_0x8000 - Message BerryTrees_Text_BerryWasPlantedInSoftSoil + Message BerryTrees_Text_BerryWasPlantedInSoil WaitButton CloseMessage RemoveItem VAR_0x8000, 1, VAR_0x8004 @@ -317,7 +317,7 @@ BerryTree_PlantBerryScript: ReleaseAll End -BerryTree_WaterBerryScript: +BerryTree_UseSprayduck: LockAll SetBerryWateringState BERRY_WATERING_START Message BerryTrees_Text_ThereAllHappy @@ -327,7 +327,7 @@ BerryTree_WaterBerryScript: ReleaseAll End -BerryTree_ApplyMulchScript: +BerryTree_UseMulch: LockAll SetVar VAR_RESULT, VAR_0x8000 SetVar VAR_0x8005, VAR_0x8000 diff --git a/res/field/scripts/scripts_canalave_city.s b/res/field/scripts/scripts_canalave_city.s index 7fe906e3f3..df72941a0a 100644 --- a/res/field/scripts/scripts_canalave_city.s +++ b/res/field/scripts/scripts_canalave_city.s @@ -6,10 +6,10 @@ ScriptEntry CanalaveCity_OnTransition - ScriptEntry CanalaveCity_TriggerRival + ScriptEntry CanalaveCity_CoordEvent_Rival ScriptEntry CanalaveCity_RivalBridge - ScriptEntry CanalaveCity_OnFrameRivalOutsideGym - ScriptEntry CanalaveCity_OnFrameAfterExplosion + ScriptEntry CanalaveCity_OnFrame_RivalOutsideGym + ScriptEntry CanalaveCity_OnFrame_AfterExplosion ScriptEntry CanalaveCity_ProfRowan ScriptEntry CanalaveCity_Counterpart ScriptEntry CanalaveCity_Collector @@ -18,16 +18,16 @@ ScriptEntry CanalaveCity_Lass ScriptEntry CanalaveCity_Psyduck ScriptEntry CanalaveCity_OldMan - ScriptEntry CanalaveCity_MapSign - ScriptEntry CanalaveCity_GymSign - ScriptEntry CanalaveCity_SignCanalaveLibrary - ScriptEntry CanalaveCity_SignSailorEldritchsHouse - ScriptEntry CanalaveCity_SignCanalaveDock - ScriptEntry CanalaveCity_SignHarborInn + ScriptEntry CanalaveCity_MapSignpost + ScriptEntry CanalaveCity_GymSignpost + ScriptEntry CanalaveCity_SignboardCanalaveLibrary + ScriptEntry CanalaveCity_SignboardSailorEldritchsHouse + ScriptEntry CanalaveCity_SignboardCanalaveDock + ScriptEntry CanalaveCity_SignboardHarborInn ScriptEntry CanalaveCity_SailorEldritch ScriptEntry CanalaveCity_Door ScriptEntry CanalaveCity_AskGoingToFullmoonIsland - ScriptEntry CanalaveCity_OnFrameAfterDarkrai + ScriptEntry CanalaveCity_OnFrame_AfterDarkrai ScriptEntry CanalaveCity_OnLoad ScriptEntry CanalaveCity_RivalLibrary ScriptEntryEnd @@ -115,7 +115,7 @@ CanalaveCity_SetHarborInnDoorClosed: SetWarpEventPos 5, 59, 712 Return -CanalaveCity_TriggerRival: +CanalaveCity_CoordEvent_Rival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 723, CanalaveCity_SetRivalBridgePositionZ707 @@ -216,7 +216,7 @@ CanalaveCity_RivalBridge: NPCMessage CanalaveCity_Text_TrainAtIronIsland End -CanalaveCity_OnFrameRivalOutsideGym: +CanalaveCity_OnFrame_RivalOutsideGym: LockAll BufferRivalName 0 BufferPlayerName 1 @@ -244,7 +244,7 @@ CanalaveCity_Movement_PlayerWatchRivalWalkToLibrary: WalkOnSpotNormalWest EndMovement -CanalaveCity_OnFrameAfterExplosion: +CanalaveCity_OnFrame_AfterExplosion: LockAll ApplyMovement LOCALID_PROF_ROWAN, CanalaveCity_Movement_ProfRowanWalkOnSpotSouth WaitMovement @@ -457,33 +457,33 @@ CanalaveCity_WhatCouldExplode: Message CanalaveCity_Text_WhatCouldExplode GoTo CanalaveCity_NPCEnd -CanalaveCity_MapSign: +CanalaveCity_MapSignpost: ShowMapSign CanalaveCity_Text_MapSign End -CanalaveCity_GymSign: +CanalaveCity_GymSignpost: ShowScrollingSign CanalaveCity_Text_SignPokemonGym End -CanalaveCity_SignCanalaveLibrary: +CanalaveCity_SignboardCanalaveLibrary: ShowLandmarkSign CanalaveCity_Text_SignCanalaveLibrary End -CanalaveCity_SignSailorEldritchsHouse: +CanalaveCity_SignboardSailorEldritchsHouse: ShowLandmarkSign CanalaveCity_Text_SignSailorEldritchsHouse End -CanalaveCity_SignCanalaveDock: +CanalaveCity_SignboardCanalaveDock: ShowLandmarkSign CanalaveCity_Text_SignCanalaveDock End -CanalaveCity_SignHarborInn: +CanalaveCity_SignboardHarborInn: Call CanalaveCity_CheckDoDarkraiEvent - GoToIfEq VAR_MAP_LOCAL_0, FALSE, CanalaveCity_SignHarborInnFaded + GoToIfEq VAR_MAP_LOCAL_0, FALSE, CanalaveCity_SignboardHarborInnFaded ShowScrollingSign CanalaveCity_Text_SignHarborInn End -CanalaveCity_SignHarborInnFaded: +CanalaveCity_SignboardHarborInnFaded: ShowScrollingSign CanalaveCity_Text_SignHarborInnFaded End @@ -647,7 +647,7 @@ CanalaveCity_TakeLunarWingToSon: ReleaseAll End -CanalaveCity_OnFrameAfterDarkrai: +CanalaveCity_OnFrame_AfterDarkrai: LockAll ApplyMovement LOCALID_SAILOR_ELDRITCH, CanalaveCity_Movement_SailorEldritchNoticeWalkToPlayer WaitMovement diff --git a/res/field/scripts/scripts_canalave_city_gym.s b/res/field/scripts/scripts_canalave_city_gym.s index cb05b2a1c4..aa7de9440b 100644 --- a/res/field/scripts/scripts_canalave_city_gym.s +++ b/res/field/scripts/scripts_canalave_city_gym.s @@ -17,7 +17,7 @@ CanalaveGym_Byron: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_MINE, CanalaveGym_ByronAfterBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 35, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_CANALAVE_CITY_GYM, 0, 0, 0 Message CanalaveGym_Text_ByronIntro CloseMessage StartTrainerBattle TRAINER_LEADER_BYRON @@ -37,7 +37,7 @@ CanalaveGym_Byron: SetTrainerFlag TRAINER_ACE_TRAINER_BREANNA SetTrainerFlag TRAINER_BLACK_BELT_RICKY SetTrainerFlag TRAINER_WORKER_GERARDO - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 35, TRAINER_LEADER_BYRON, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_CANALAVE_CITY_GYM, TRAINER_LEADER_BYRON, 0, 0 ClearFlag FLAG_HIDE_CANALAVE_CITY_RIVAL_BRIDGE ClearFlag FLAG_HIDE_CANALAVE_CITY_RIVAL_LIBRARY ClearFlag FLAG_HIDE_CANALAVE_LIBRARY_RIVAL diff --git a/res/field/scripts/scripts_canalave_city_harbor_inn.s b/res/field/scripts/scripts_canalave_city_harbor_inn.s index 07dc42965a..7baa62400d 100644 --- a/res/field/scripts/scripts_canalave_city_harbor_inn.s +++ b/res/field/scripts/scripts_canalave_city_harbor_inn.s @@ -4,8 +4,8 @@ #include "res/field/events/events_canalave_city_harbor_inn.h" ScriptEntry CanalaveCityHarborInn_OnTransition - ScriptEntry CanalaveCityHarborInn_OnFrameSleep - ScriptEntry CanalaveCityHarborInn_OnFrameAwaken + ScriptEntry CanalaveCityHarborInn_OnFrame_Sleep + ScriptEntry CanalaveCityHarborInn_OnFrame_Awaken ScriptEntryEnd CanalaveCityHarborInn_OnTransition: @@ -45,7 +45,7 @@ CanalaveCityWestHouse_TryStartDarkraiEvent: CanalaveCityHarborInn_OnTransitionEnd: End -CanalaveCityHarborInn_OnFrameSleep: +CanalaveCityHarborInn_OnFrame_Sleep: LockAll WaitTime 30, VAR_RESULT Message CanalaveCityHarborInn_Text_ReservationForYou @@ -96,7 +96,7 @@ CanalaveCityHarborInn_Movement_GymGuideWalkToBed: WalkOnSpotNormalEast EndMovement -CanalaveCityHarborInn_OnFrameAwaken: +CanalaveCityHarborInn_OnFrame_Awaken: LockAll Call CanalaveCityHarborInn_ResetOrFinishDarkraiEvent ScrCmd_2B5 MAP_HEADER_CANALAVE_CITY, 58, 714 diff --git a/res/field/scripts/scripts_canalave_city_pokecenter_2f.s b/res/field/scripts/scripts_canalave_city_pokecenter_2f.s index bc512f0386..86fef17d0b 100644 --- a/res/field/scripts/scripts_canalave_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_canalave_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry CanalaveCityPokecenter2F_UnusedEntry1 + ScriptEntry CanalaveCityPokecenter2F_Dummy1 ScriptEntryEnd -CanalaveCityPokecenter2F_UnusedEntry1: +CanalaveCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_canalave_city_pokecenter_b1f.s b/res/field/scripts/scripts_canalave_city_pokecenter_b1f.s index 4b2d757aa1..051df2e1e2 100644 --- a/res/field/scripts/scripts_canalave_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_canalave_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry CanalaveCityPokecenterB1F_UnusedEntry1 + ScriptEntry CanalaveCityPokecenterB1F_Dummy1 ScriptEntryEnd -CanalaveCityPokecenterB1F_UnusedEntry1: +CanalaveCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_canalave_city_west_house.s b/res/field/scripts/scripts_canalave_city_west_house.s index eec91bc300..b15ff002d0 100644 --- a/res/field/scripts/scripts_canalave_city_west_house.s +++ b/res/field/scripts/scripts_canalave_city_west_house.s @@ -1,7 +1,7 @@ #include "macros/scrcmd.inc" - ScriptEntry CanalaveCityWestHouse_Unused + ScriptEntry CanalaveCityWestHouse_Dummy1 ScriptEntry CanalaveCityWestHouse_OnTransition ScriptEntryEnd @@ -15,7 +15,7 @@ CanalaveCityWestHouse_HideReporter: SetFlag FLAG_HIDE_CANALAVE_CITY_WEST_HOUSE_REPORTER End -CanalaveCityWestHouse_Unused: +CanalaveCityWestHouse_Dummy1: End .balign 4, 0 diff --git a/res/field/scripts/scripts_canalave_library_2f.s b/res/field/scripts/scripts_canalave_library_2f.s index 95bb8db828..d6b64c9e7c 100644 --- a/res/field/scripts/scripts_canalave_library_2f.s +++ b/res/field/scripts/scripts_canalave_library_2f.s @@ -6,9 +6,9 @@ ScriptEntry CanalaveLibrary2F_SchoolKidM ScriptEntry CanalaveLibrary2F_Bookshelves ScriptEntry CanalaveLibrary2F_Shelves - ScriptEntry CanalaveLibrary2F_Sign + ScriptEntry CanalaveLibrary2F_BgSign ScriptEntry CanalaveLibrary2F_OnTransition - ScriptEntry CanalaveLibrary2F_OnFrameHiker + ScriptEntry CanalaveLibrary2F_OnFrame_Hiker ScriptEntryEnd CanalaveLibrary2F_OnTransition: @@ -62,11 +62,11 @@ CanalaveLibrary2F_Shelves: EventMessage CanalaveLibrary2F_Text_ShelvesLinedWithBooks End -CanalaveLibrary2F_Sign: +CanalaveLibrary2F_BgSign: EventMessage CanalaveLibrary2F_Text_RefrainFromBringingFood End -CanalaveLibrary2F_OnFrameHiker: +CanalaveLibrary2F_OnFrame_Hiker: LockAll ApplyMovement LOCALID_HIKER, CanalaveLibrary2F_Movement_HikerNoticeWalkToPlayer WaitMovement diff --git a/res/field/scripts/scripts_canalave_library_3f.s b/res/field/scripts/scripts_canalave_library_3f.s index 711a9ccb26..3cc67aca07 100644 --- a/res/field/scripts/scripts_canalave_library_3f.s +++ b/res/field/scripts/scripts_canalave_library_3f.s @@ -5,7 +5,7 @@ ScriptEntry CanalaveLibrary3F_OnTransition - ScriptEntry CanalaveLibrary3F_OnFrameExplosion + ScriptEntry CanalaveLibrary3F_OnFrame_Explosion ScriptEntry CanalaveLibrary3F_ScientistF ScriptEntry CanalaveLibrary3F_Youngster ScriptEntry CanalaveLibrary3F_SinnohMyth @@ -15,7 +15,7 @@ ScriptEntry CanalaveLibrary3F_TheOriginalStory ScriptEntry CanalaveLibrary3F_HorrificMyth ScriptEntry CanalaveLibrary3F_SinnohFolkStories - ScriptEntry CanalaveLibrary3F_Sign + ScriptEntry CanalaveLibrary3F_BgSign ScriptEntryEnd CanalaveLibrary3F_OnTransition: @@ -32,7 +32,7 @@ CanalaveLibrary3F_SetCounterpartGraphicsLucas: SetVar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_PLAYER_M End -CanalaveLibrary3F_OnFrameExplosion: +CanalaveLibrary3F_OnFrame_Explosion: LockAll BufferRivalName 0 BufferPlayerName 1 @@ -572,7 +572,7 @@ CanalaveLibrary3F_PutSinnohFolkStoriesBack: ReleaseAll End -CanalaveLibrary3F_Sign: +CanalaveLibrary3F_BgSign: EventMessage CanalaveLibrary3F_Text_ManyMythsAndLegends End diff --git a/res/field/scripts/scripts_celestic_town.s b/res/field/scripts/scripts_celestic_town.s index 8d6cf57c06..aa1b673bdd 100644 --- a/res/field/scripts/scripts_celestic_town.s +++ b/res/field/scripts/scripts_celestic_town.s @@ -5,14 +5,14 @@ ScriptEntry CelesticTown_OnTransition ScriptEntry CelesticTown_Elder - ScriptEntry CelesticTown_TriggerElder + ScriptEntry CelesticTown_CoordEvent_Elder ScriptEntry CelesticTown_GruntM - ScriptEntry CelesticTown_OnFrameCynthia + ScriptEntry CelesticTown_OnFrame_Cynthia ScriptEntry CelesticTown_Cynthia ScriptEntry CelesticTown_ExpertM ScriptEntry CelesticTown_AceTrainerF ScriptEntry CelesticTown_NinjaBoy - ScriptEntry CelesticTown_MapSign + ScriptEntry CelesticTown_MapSignpost ScriptEntry CelesticTown_EtchingDialga ScriptEntry CelesticTown_EtchingPalkia ScriptEntryEnd @@ -169,17 +169,17 @@ CelesticTown_Movement_PlayerWatchElderEnterNorth: WalkOnSpotNormalEast EndMovement -CelesticTown_UnusedMovement: +CelesticTown_Movement_Unused: Delay8 8 WalkOnSpotNormalSouth EndMovement -CelesticTown_UnusedMovement2: +CelesticTown_Movement_Unused2: Delay8 9 WalkOnSpotNormalSouth EndMovement -CelesticTown_TriggerElder: +CelesticTown_CoordEvent_Elder: LockAll ApplyMovement LOCALID_PLAYER, CelesticTown_Movement_PlayerFaceWest ApplyMovement LOCALID_ELDER, CelesticTown_Movement_ElderWalkOnSpotEast @@ -221,7 +221,7 @@ CelesticTown_ExamineRuins: ReleaseAll End -CelesticTown_OnFrameCynthia: +CelesticTown_OnFrame_Cynthia: LockAll ApplyMovement LOCALID_PLAYER, CelesticTown_Movement_PlayerWalkOnSpotEast ApplyMovement LOCALID_CYNTHIA, CelesticTown_Movement_CynthiaNoticePlayer @@ -279,7 +279,7 @@ CelesticTown_NinjaBoy: NPCMessage CelesticTown_Text_APokemonCreatedSinnoh End -CelesticTown_MapSign: +CelesticTown_MapSignpost: ShowMapSign CelesticTown_Text_MapSign End diff --git a/res/field/scripts/scripts_celestic_town_cave.s b/res/field/scripts/scripts_celestic_town_cave.s index 559d1090c9..9366a9a707 100644 --- a/res/field/scripts/scripts_celestic_town_cave.s +++ b/res/field/scripts/scripts_celestic_town_cave.s @@ -171,7 +171,7 @@ CelesticTownCave_PlayerElderFaceEachOtherX9South: Return CelesticTownCave_Unused: - ApplyMovement LOCALID_PLAYER, CelesticTownCave_UnusedMovement + ApplyMovement LOCALID_PLAYER, CelesticTownCave_Movement_Unused ApplyMovement LOCALID_ELDER, CelesticTownCave_Movement_ElderWalkOnSpotWest WaitMovement Return @@ -190,7 +190,7 @@ CelesticTownCave_PlayerElderFaceEachOtherX10South: Return CelesticTownCave_Unused2: - ApplyMovement LOCALID_PLAYER, CelesticTownCave_UnusedMovement2 + ApplyMovement LOCALID_PLAYER, CelesticTownCave_Movement_Unused2 ApplyMovement LOCALID_ELDER, CelesticTownCave_Movement_ElderWalkOnSpotWest WaitMovement Return @@ -303,7 +303,7 @@ CelesticTownCave_Movement_PlayerWalkNorthOnSpotEast: WalkOnSpotNormalEast EndMovement -CelesticTownCave_UnusedMovement: +CelesticTownCave_Movement_Unused: WalkNormalNorth 2 WalkOnSpotNormalEast EndMovement @@ -319,7 +319,7 @@ CelesticTownCave_Movement_PlayerWalkNorthOnSpotWest: WalkOnSpotNormalWest EndMovement -CelesticTownCave_UnusedMovement2: +CelesticTownCave_Movement_Unused2: WalkNormalNorth 2 WalkOnSpotNormalWest EndMovement diff --git a/res/field/scripts/scripts_celestic_town_northwest_house.s b/res/field/scripts/scripts_celestic_town_northwest_house.s index 5c1a414397..5e354ec6b8 100644 --- a/res/field/scripts/scripts_celestic_town_northwest_house.s +++ b/res/field/scripts/scripts_celestic_town_northwest_house.s @@ -2,13 +2,13 @@ #include "res/text/bank/celestic_town_northwest_house.h" - ScriptEntry CelesticTownNorthwestHouse_Unused + ScriptEntry CelesticTownNorthwestHouse_Vendor_Unused ScriptEntry CelesticTownNorthwestHouse_ExpertF ScriptEntry CelesticTownNorthwestHouse_ExpertM ScriptEntry CelesticTownNorthwestHouse_GymGuide ScriptEntryEnd -CelesticTownNorthwestHouse_Unused: +CelesticTownNorthwestHouse_Vendor_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer diff --git a/res/field/scripts/scripts_celestic_town_pokecenter_2f.s b/res/field/scripts/scripts_celestic_town_pokecenter_2f.s index 3eb89f0232..0e45937e43 100644 --- a/res/field/scripts/scripts_celestic_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_celestic_town_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry CelesticCityPokecenter2F_UnusedEntry1 + ScriptEntry CelesticCityPokecenter2F_Dummy1 ScriptEntryEnd -CelesticCityPokecenter2F_UnusedEntry1: +CelesticCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_celestic_town_pokecenter_b1f.s b/res/field/scripts/scripts_celestic_town_pokecenter_b1f.s index 6692cec471..2c227514f4 100644 --- a/res/field/scripts/scripts_celestic_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_celestic_town_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry CelesticCityPokecenterB1F_UnusedEntry1 + ScriptEntry CelesticCityPokecenterB1F_Dummy1 ScriptEntryEnd -CelesticCityPokecenterB1F_UnusedEntry1: +CelesticCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_common.s b/res/field/scripts/scripts_common.s index c91111846d..7dfa63d533 100644 --- a/res/field/scripts/scripts_common.s +++ b/res/field/scripts/scripts_common.s @@ -33,11 +33,11 @@ ScriptEntry CommonScript_2004 @ 0x7D4 ScriptEntry CommonScript_SaveAndStoreResult @ 0x7D5 ScriptEntry CommonScript_SaveGame @ 0x7D6 - ScriptEntry CommonScript_EmptyScript2007 @ 0x7D7 + ScriptEntry CommonScript_Dummy2007 @ 0x7D7 ScriptEntry CommonScript_HoneyTree @ 0x7D8 ScriptEntry CommonScript_ObtainPoketchApp @ 0x7D9 - ScriptEntry CommonScript_EmptyScript2010 @ 0x7DA - ScriptEntry CommonScript_EmptyScript2011 @ 0x7DB + ScriptEntry CommonScript_Dummy2010 @ 0x7DA + ScriptEntry CommonScript_Dummy2011 @ 0x7DB ScriptEntry CommonScript_SendToUndergroundPC @ 0x7DC ScriptEntry CommonScript_ObtainUndergroundTrap @ 0x7DD ScriptEntry CommonScript_ObtainUndergroundSphere @ 0x7DE @@ -48,9 +48,9 @@ ScriptEntry CommonScript_VendorGreetingGeneric @ 0x7E3 ScriptEntry CommonScript_PlayerHouseBlackOutRecover @ 0x7E4 ScriptEntry CommonScript_PokecenterBlackOutRecover @ 0x7E5 - ScriptEntry CommonScript_EmptyScript2022 @ 0x7E6 + ScriptEntry CommonScript_Dummy2022 @ 0x7E6 ScriptEntry CommonScript_2023 @ 0x7E7 - ScriptEntry CommonScript_EmptyScript2024 @ 0x7E8 + ScriptEntry CommonScript_Dummy2024 @ 0x7E8 ScriptEntry CommonScript_Geonet @ 0x7E9 ScriptEntry CommonScript_2026 @ 0x7EA ScriptEntry CommonScript_Vent @ 0x7EB @@ -63,7 +63,7 @@ ScriptEntry CommonScript_ImpossibleToSave @ 0x7F2 ScriptEntry CommonScript_BlockPokecenterBasement @ 0x7F3 ScriptEntry CommonScript_ObtainContestBackdropWaitForConfirm @ 0x7F4 - ScriptEntry CommonScript_EmptyScript2037 @ 0x7F5 + ScriptEntry CommonScript_Dummy2037 @ 0x7F5 ScriptEntry CommonScript_PlateObtainedEngraving @ 0x7F6 ScriptEntry CommonScript_TryUseAzureFlute @ 0x7F7 ScriptEntry CommonScript_SetCounterpartBGM @ 0x7F8 @@ -86,10 +86,10 @@ ScriptEntry CommonScript_GriseousOrbCouldNotBeRemoved @ 0x809 ScriptEntryEnd -CommonScript_EmptyScript2010: +CommonScript_Dummy2010: End -CommonScript_EmptyScript2007: +CommonScript_Dummy2007: End CommonScript_PokecenterNurse: @@ -193,7 +193,7 @@ CommonScript_NurseIdentifiedPokerus: WaitMovement SetPlayerState PLAYER_TRANSITION_WALKING ChangePlayerState - Message CommonStrings_Text_PokecenterYourPokemonMayBeInfected + Message CommonStrings_Text_PokecenterPokemonMayBeInfected WaitButton CloseMessage ReleaseAll @@ -682,7 +682,7 @@ CommonScript_ObtainedPoketchAlarmClock: Message CommonStrings_Text_ObtainedPoketchAlarmClock Return -CommonScript_EmptyScript2011: +CommonScript_Dummy2011: End CommonScript_SendToUndergroundPC: @@ -736,14 +736,14 @@ CommonScript_InternalObtainUndergroundSphere: CommonScript_ObtainAccessoryWaitForConfirm: Call CommonScript_InternalObtainAccessory - Message CommonStrings_Text_PutAwayItemInTheFashionCaseNoLineFeed + Message CommonStrings_Text_PutItemInFashionCase WaitButton ReturnCommonScript End CommonScript_ObtainAccessory: Call CommonScript_InternalObtainAccessory - Message CommonStrings_Text_PutAwayItemInTheFashionCase + Message CommonStrings_Text_PutItemInFashionCase_ArrowPrompt ReturnCommonScript End @@ -759,14 +759,14 @@ CommonScript_InternalObtainAccessory: CommonScript_ObtainContestBackdropWaitForConfirm: Call CommonScript_InternalObtainContestBackdrop - Message CommonStrings_Text_PutAwayItemInTheFashionCaseNoLineFeed + Message CommonStrings_Text_PutItemInFashionCase WaitButton ReturnCommonScript End CommonScript_ObtainContestBackdrop: Call CommonScript_InternalObtainContestBackdrop - Message CommonStrings_Text_PutAwayItemInTheFashionCase + Message CommonStrings_Text_PutItemInFashionCase_ArrowPrompt ReturnCommonScript End @@ -791,7 +791,7 @@ CommonScript_InternalAddItemQuantityNoLineFeed: GetItemPocket VAR_0x8004, VAR_RESULT CallIfEq VAR_RESULT, POCKET_KEY_ITEMS, CommonScript_ObtainedKeyItem CallIfNe VAR_RESULT, POCKET_KEY_ITEMS, CommonScript_PrepareMessageObtainedItem - Message CommonStrings_Text_PutItemInThePocketNoLineFeed + Message CommonStrings_Text_PutItemInPocket WaitButton Return @@ -806,7 +806,7 @@ CommonScript_InternalAddItemQuantity: GetItemPocket VAR_0x8004, VAR_RESULT CallIfEq VAR_RESULT, POCKET_KEY_ITEMS, CommonScript_ObtainedKeyItem CallIfNe VAR_RESULT, POCKET_KEY_ITEMS, CommonScript_PrepareMessageObtainedItem - Message CommonStrings_Text_PutItemInThePocket + Message CommonStrings_Text_PutItemInPocket_ArrowPrompt Return CommonScript_ObtainedKeyItem: @@ -1148,7 +1148,7 @@ CommonScript_PCFadeOut: UnloadAnimation ANIMATION_TAG_PC Return -CommonScript_EmptyScript2022: +CommonScript_Dummy2022: End CommonScript_2023: @@ -1204,7 +1204,7 @@ CommonScript_PokecenterBlackOutRecover: ChangePlayerState ApplyMovement LOCALID_PLAYER, CommonScript_Movement_PlayerGivePokemon WaitMovement - Message CommonStrings_Text_PokecenterFirstLetsRestoreYourPokemon + Message CommonStrings_Text_PokecenterFirstRestorePokemon Call CommonScript_GetNurseID Call CommonScript_NurseHealPokemon GoToIfBadgeAcquired BADGE_ID_COAL, CommonScript_PokecenterBlackOutRecoverHasCoalBadge @@ -1344,11 +1344,11 @@ CommonScript_Movement_NurseTurnToMachine: FaceWest EndMovement -CommonScript_UnusedMovement: +CommonScript_Movement_Unused: FaceNorth EndMovement -CommonScript_UnusedMovement2: +CommonScript_Movement_Unused2: FaceEast EndMovement @@ -1357,7 +1357,7 @@ CommonScript_Movement_NurseTurnToPlayer: FaceSouth EndMovement -CommonScript_EmptyScript2024: +CommonScript_Dummy2024: End CommonScript_Geonet: @@ -1515,7 +1515,7 @@ CommonScript_Engraving8PlatesObtained: Message CommonStrings_Text_Engraving8PlatesObtained Return -CommonScript_EmptyScript2037: +CommonScript_Dummy2037: End CommonScript_TryUseAzureFlute: diff --git a/res/field/scripts/scripts_contest_hall_lobby.s b/res/field/scripts/scripts_contest_hall_lobby.s index d8ceb1a2f3..36596524ae 100644 --- a/res/field/scripts/scripts_contest_hall_lobby.s +++ b/res/field/scripts/scripts_contest_hall_lobby.s @@ -3,7 +3,7 @@ #include "res/field/events/events_contest_hall_lobby.h" - ScriptEntry ContestHallLobby_OnFrameFirstEntry + ScriptEntry ContestHallLobby_OnFrame_FirstEntry ScriptEntry ContestHallLobby_Frame0 ScriptEntry ContestHallLobby_Frame1 ScriptEntry ContestHallLobby_Frame2 @@ -16,7 +16,7 @@ ScriptEntry ContestHallLobby_Fantina ScriptEntryEnd -ContestHallLobby_OnFrameFirstEntry: +ContestHallLobby_OnFrame_FirstEntry: LockAll ApplyMovement LOCALID_KEIRA, ContestHallLobby_Movement_KeiraNoticePlayer WaitMovement @@ -33,12 +33,12 @@ ContestHallLobby_OnFrameFirstEntry: WaitMovement Message ContestHallLobby_Text_WaitJohannaIsYourMom BufferPlayerName 0 - Message ContestHallLobby_Text_IveNeverSpokenToPlayerAboutContests - Message ContestHallLobby_Text_INeedToThankYouForEarlier + Message ContestHallLobby_Text_NeverSpokenAboutContests + Message ContestHallLobby_Text_ThankYouForEarlier SetVar VAR_0x8004, ACCESSORY_GLITTER_POWDER SetVar VAR_0x8005, 1 Common_GiveAccessory - Message ContestHallLobby_Text_PutThatAccessoryOnYourPokemon + Message ContestHallLobby_Text_PutAccessoryOnPokemon ApplyMovement LOCALID_KEIRA, ContestHallLobby_Movement_KeiraFaceMom ApplyMovement LOCALID_MOM, ContestHallLobby_Movement_MomFaceKeira WaitMovement @@ -53,7 +53,7 @@ ContestHallLobby_OnFrameFirstEntry: ApplyMovement LOCALID_PLAYER, ContestHallLobby_Movement_PlayerFaceMom WaitMovement BufferPlayerName 0 - Message ContestHallLobby_Text_WereYouSurprisedToSeeMe + Message ContestHallLobby_Text_WereYouSurprised CloseMessage PlayFanfare SEQ_FANFA4 GetPlayerGender VAR_RESULT @@ -127,7 +127,7 @@ ContestHallLobby_Movement_MomFaceKeira: WalkOnSpotNormalEast EndMovement -ContestHallLobby_UnusedMovement: +ContestHallLobby_Movement_Unused: WalkOnSpotNormalEast EndMovement @@ -136,15 +136,15 @@ ContestHallLobby_Movement_MomFacePlayer: WalkOnSpotNormalSouth EndMovement -ContestHallLobby_UnusedMovement2: +ContestHallLobby_Movement_Unused2: WalkNormalWest 8 EndMovement -ContestHallLobby_UnusedMovement3: +ContestHallLobby_Movement_Unused3: WalkNormalNorth 6 EndMovement -ContestHallLobby_UnusedMovement4: +ContestHallLobby_Movement_Unused4: WalkNormalEast 8 EndMovement @@ -257,11 +257,11 @@ ContestHallLobby_AceTrainerF: End ContestHallLobby_Clown: - NPCMessage ContestHallLobby_Text_AContestHasVisualDanceAndActingParts + NPCMessage ContestHallLobby_Text_ContestHasParts End ContestHallLobby_SchoolKidF: - NPCMessage ContestHallLobby_Text_TheyPutUpPhotosOfTheWinners + NPCMessage ContestHallLobby_Text_PhotosOfWinners End ContestHallLobby_RichBoy: @@ -270,8 +270,8 @@ ContestHallLobby_RichBoy: FacePlayer GoToIfUnset FLAG_TALKED_TO_CONTEST_HALL_LOBBY_RICH_BOY, ContestHallLobby_RichBoyFirstInteraction GoToIfUnset FLAG_RECEIVED_CONTEST_HALL_LOBBY_MILD_POFFIN, ContestHallLobby_HasNotReceivedPoffinYet -ContestHallLobby_ItTakesPracticeToWinContests: - Message ContestHallLobby_Text_ItTakesPracticeToWinContests +ContestHallLobby_TakesPracticeToWin: + Message ContestHallLobby_Text_TakesPracticeToWin WaitButton CloseMessage ReleaseAll @@ -279,7 +279,7 @@ ContestHallLobby_ItTakesPracticeToWinContests: ContestHallLobby_HasNotReceivedPoffinYet: CheckItem ITEM_POFFIN_CASE, 1, VAR_RESULT - GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_ItTakesPracticeToWinContests + GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_TakesPracticeToWin Message ContestHallLobby_Text_YupYouHaveAPoffinCase CheckHasEmptyPoffinCaseSlot VAR_RESULT GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_PoffinCaseIsFull @@ -304,7 +304,7 @@ ContestHallLobby_RichBoyFirstInteraction: GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_IDontSeeAPoffinCase Message ContestHallLobby_Text_YupYouHaveAPoffinCase CheckHasEmptyPoffinCaseSlot VAR_RESULT - GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_IllGiveItToYouAnotherTime + GoToIfEq VAR_RESULT, FALSE, ContestHallLobby_IllGiveItAnotherTime Call ContestHallLobby_GiveMildPoffin SetFlag FLAG_RECEIVED_CONTEST_HALL_LOBBY_MILD_POFFIN Message ContestHallLobby_Text_FeedThatPoffinToAPokemon @@ -313,8 +313,8 @@ ContestHallLobby_RichBoyFirstInteraction: ReleaseAll End -ContestHallLobby_IllGiveItToYouAnotherTime: - Message ContestHallLobby_Text_IllGiveItToYouAnotherTime +ContestHallLobby_IllGiveItAnotherTime: + Message ContestHallLobby_Text_IllGiveItAnotherTime CloseMessage Call ContestHallLobby_RichBoyWalkAwayFromCounter ReleaseAll @@ -333,7 +333,7 @@ ContestHallLobby_GiveMildPoffin: BufferPlayerName 0 Message ContestHallLobby_Text_PlayerReceivedAMildPoffin WaitFanfare - Message ContestHallLobby_Text_TheMildPoffinWasPutAway + Message ContestHallLobby_Text_MildPoffinWasPutAway Return ContestHallLobby_RichBoyWalkAwayFromCounter: diff --git a/res/field/scripts/scripts_contest_hall_stage_no_contest.s b/res/field/scripts/scripts_contest_hall_stage_no_contest.s index 66134d7d60..bbaa3640af 100644 --- a/res/field/scripts/scripts_contest_hall_stage_no_contest.s +++ b/res/field/scripts/scripts_contest_hall_stage_no_contest.s @@ -9,19 +9,19 @@ ScriptEntryEnd ContestHallStageNoContest_Hiker: - NPCMessage ContestHallStageNoContest_Text_ForTheVisualJudgingDressUpYourPokemon + NPCMessage ContestHallStageNoContest_Text_DressUpYourPokemon End ContestHallStageNoContest_Idol: - NPCMessage ContestHallStageNoContest_Text_ForTheDanceCompetitionMimicTheLeadDancer + NPCMessage ContestHallStageNoContest_Text_MimicTheLeadDancer End ContestHallStageNoContest_Beauty: - NPCMessage ContestHallStageNoContest_Text_ForThePerformancePokemonNeedTheRightMoves + NPCMessage ContestHallStageNoContest_Text_PokemonNeedTheRightMoves End ContestHallStageNoContest_BlackBelt: - NPCMessage ContestHallStageNoContest_Text_AtTheCoolContestPullOffACoolMove + NPCMessage ContestHallStageNoContest_Text_PullOffACoolMove End .balign 4, 0 diff --git a/res/field/scripts/scripts_contest_hall_stage_ongoing_contest.s b/res/field/scripts/scripts_contest_hall_stage_ongoing_contest.s index ace6677912..516a15d113 100644 --- a/res/field/scripts/scripts_contest_hall_stage_ongoing_contest.s +++ b/res/field/scripts/scripts_contest_hall_stage_ongoing_contest.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry ContestHallStageOngoingContest_UnusedEntry1 + ScriptEntry ContestHallStageOngoingContest_Dummy1 ScriptEntryEnd -ContestHallStageOngoingContest_UnusedEntry1: +ContestHallStageOngoingContest_Dummy1: End diff --git a/res/field/scripts/scripts_contests.s b/res/field/scripts/scripts_contests.s index 57575130e4..e89c2cb711 100644 --- a/res/field/scripts/scripts_contests.s +++ b/res/field/scripts/scripts_contests.s @@ -13,11 +13,11 @@ ScriptEntry Contests_LobbyOnFrameExitContestHall @ 0x2648 - ScriptEntry Contests_EmptyScript9801 @ 0x2649 + ScriptEntry Contests_Dummy9801 @ 0x2649 ScriptEntry Contests_OngoingContestOnTransition @ 0x264A ScriptEntry Contests_LobbyOnTransition @ 0x264B ScriptEntry Contests_OngoingContestOnResume @ 0x264C - ScriptEntry Contests_UnusedEntry9805 @ 0x264D + ScriptEntry Contests_Dummy9805 @ 0x264D ScriptEntry Contests_ReceptionistOfficialContest @ 0x264E ScriptEntry Contests_ReceptionistLinkContest @ 0x264F ScriptEntry Contests_ReceptionistPracticeContest @ 0x2650 @@ -32,7 +32,7 @@ Contests_LobbyOnFrameExitContestHall: SetVar VAR_RESULT, 7 Call Contests_ExitContestHall ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 ReleaseAll End @@ -121,7 +121,7 @@ Contests_Movement_PlayerWalkToOfficialReceptionist: WalkOnSpotFastNorth EndMovement -Contests_EmptyScript9801: +Contests_Dummy9801: End Contests_OngoingContestOnTransition: @@ -171,7 +171,7 @@ Contests_HidePlayer: HideObject LOCALID_PLAYER Return -Contests_UnusedEntry9805: +Contests_Dummy9805: NPCMessage ContestCommon_Text_Dummy0 End @@ -221,7 +221,7 @@ Contests_ContestMenu: Contests_ContestMenuExit: EndCommunication - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE Message ContestCommon_Text_LookForwardToParticipation WaitButton @@ -588,7 +588,7 @@ Contests_OfficialContestDoor: Contests_LinkContestDoor: SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 5 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 5 LoadDoorAnimation 0, 0, 7, 5, ANIMATION_TAG_DOOR_1 Call Contests_DoorOpenAnimation WaitMovement @@ -816,7 +816,7 @@ Contests_EndContest: SetVar VAR_RESULT, 7 Call Contests_ExitContestHall ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 GoTo Contests_End Contests_OfficialContestReturnToReceptionist: @@ -948,7 +948,7 @@ Contests_Movement_PlayerWalkToPracticeContestDoor: WalkNormalNorth 3 EndMovement -Contests_UnusedMovement: +Contests_Movement_Unused: Delay4 FaceEast Delay4 diff --git a/res/field/scripts/scripts_cycle_shop.s b/res/field/scripts/scripts_cycle_shop.s index dd2d02a31d..61a5b16b42 100644 --- a/res/field/scripts/scripts_cycle_shop.s +++ b/res/field/scripts/scripts_cycle_shop.s @@ -13,19 +13,19 @@ CycleShop_PokefanM: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_RECEIVED_BICYCLE, CycleShop_ThisIsTheLatestModelSoIllReadTheOperatingManualToYou - Message CycleShop_Text_ThanksForRescuingMeThisIsSomethingToShowMyThanks + GoToIfSet FLAG_RECEIVED_BICYCLE, CycleShop_IllReadOperatingManual + Message CycleShop_Text_ThanksForRescuingMe SetVar VAR_0x8004, ITEM_BICYCLE SetVar VAR_0x8005, 1 Common_GiveItemQuantity SetFlag FLAG_RECEIVED_BICYCLE SetVar VAR_ETERNA_CITY_BLOCK_EXITS_STATE, 1 SetBlackOutWarpId 9 - GoTo CycleShop_ThisIsTheLatestModelSoIllReadTheOperatingManualToYou + GoTo CycleShop_IllReadOperatingManual End -CycleShop_ThisIsTheLatestModelSoIllReadTheOperatingManualToYou: - Message CycleShop_Text_ThisIsTheLatestModelSoIllReadTheOperatingManualToYou +CycleShop_IllReadOperatingManual: + Message CycleShop_Text_IllReadOperatingManual WaitButton CloseMessage ReleaseAll @@ -39,26 +39,26 @@ CycleShop_Youngster: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, CycleShop_WhatWasTeamGalacticTryingToDoWithOtherPeoplesPokemon - Message CycleShop_Text_TheManagersGoneOffToTheTeamGalacticBuildingAndHasntReturned + GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, CycleShop_WhatWasTeamGalacticTrying + Message CycleShop_Text_ManagersGoneOff WaitButton CloseMessage ReleaseAll End -CycleShop_WhatWasTeamGalacticTryingToDoWithOtherPeoplesPokemon: - Message CycleShop_Text_WhatWasTeamGalacticTryingToDoWithOtherPeoplesPokemon +CycleShop_WhatWasTeamGalacticTrying: + Message CycleShop_Text_WhatWasTeamGalacticTrying WaitButton CloseMessage ReleaseAll End CycleShop_Manual: - EventMessage CycleShop_Text_ThereIsAManualOnTheLatestModelBicycle + EventMessage CycleShop_Text_ManualOnLatestBicycle End CycleShop_Catalog: - EventMessage CycleShop_Text_TheresACatalogFromTheHoennRegionOnItsPopularBikes + EventMessage CycleShop_Text_CatalogFromHoenn End .balign 4, 0 diff --git a/res/field/scripts/scripts_distortion_world_1f.s b/res/field/scripts/scripts_distortion_world_1f.s index 6bc0e9dc09..5fd6f2f58e 100644 --- a/res/field/scripts/scripts_distortion_world_1f.s +++ b/res/field/scripts/scripts_distortion_world_1f.s @@ -6,8 +6,8 @@ ScriptEntry DistortionWorld1F_OnTransition ScriptEntry DistortionWorld1F_Portal - ScriptEntry DistortionWorld1F_OnFrameFirstEntry - ScriptEntry DistortionWorld1F_TriggerCynthiaElevator + ScriptEntry DistortionWorld1F_OnFrame_FirstEntry + ScriptEntry DistortionWorld1F_CoordEvent_CynthiaElevator ScriptEntry DistortionWorld1F_CynthiaElevator ScriptEntryEnd @@ -38,7 +38,7 @@ DistortionWorld1F_ReturnToSpearPillar: WaitFadeScreen End -DistortionWorld1F_OnFrameFirstEntry: +DistortionWorld1F_OnFrame_FirstEntry: LockAll ApplyMovement LOCALID_PLAYER, DistortionWorld1F_Movement_PlayerWalkWest WaitMovement @@ -81,7 +81,7 @@ DistortionWorld1F_OnFrameFirstEntry: ReleaseAll End -DistortionWorld1F_TriggerCynthiaElevator: +DistortionWorld1F_CoordEvent_CynthiaElevator: LockAll Message DistortionWorld1F_Text_SlabMovesIfYouStep WaitABPadPress diff --git a/res/field/scripts/scripts_distortion_world_b1f.s b/res/field/scripts/scripts_distortion_world_b1f.s index c1f59bc16d..2264fa88fe 100644 --- a/res/field/scripts/scripts_distortion_world_b1f.s +++ b/res/field/scripts/scripts_distortion_world_b1f.s @@ -6,15 +6,15 @@ #define LOCALID_MESPRIT 129 ScriptEntry DistortionWorldB1F_OnTransition - ScriptEntry DistortionWorldB1F_OnFrameFirstEntry - ScriptEntry DistortionWorldB1F_TriggerMesprit + ScriptEntry DistortionWorldB1F_OnFrame_FirstEntry + ScriptEntry DistortionWorldB1F_CoordEvent_Mesprit ScriptEntryEnd DistortionWorldB1F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB1F_OnFrameFirstEntry: +DistortionWorldB1F_OnFrame_FirstEntry: LockAll ApplyMovement LOCALID_PLAYER, DistortionWorldB1F_Movement_PlayerWalkOnSpotNorth ApplyMovement LOCALID_CYNTHIA, DistortionWorldB1F_Movement_CynthiaWalkOnSpotSouth @@ -29,7 +29,7 @@ DistortionWorldB1F_OnFrameFirstEntry: ReleaseAll End -DistortionWorldB1F_TriggerMesprit: +DistortionWorldB1F_CoordEvent_Mesprit: LockAll PlayCry SPECIES_MESPRIT Message DistortionWorldB1F_Text_MespritCry diff --git a/res/field/scripts/scripts_distortion_world_b2f.s b/res/field/scripts/scripts_distortion_world_b2f.s index a824c70c9c..0896f0e5b6 100644 --- a/res/field/scripts/scripts_distortion_world_b2f.s +++ b/res/field/scripts/scripts_distortion_world_b2f.s @@ -5,7 +5,7 @@ #define LOCALID_CYNTHIA 128 ScriptEntry DistortionWorldB2F_OnTransition - ScriptEntry DistortionWorldB2F_OnFrameFirstEntry + ScriptEntry DistortionWorldB2F_OnFrame_FirstEntry ScriptEntry DistortionWorldB2F_Cynthia ScriptEntryEnd @@ -13,7 +13,7 @@ DistortionWorldB2F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB2F_OnFrameFirstEntry: +DistortionWorldB2F_OnFrame_FirstEntry: PlaySE SEQ_SE_CONFIRM LockAll GoToIfEq VAR_DISTORTION_WORLD_PROGRESS, 5, DistortionWorldB2F_Cynthia diff --git a/res/field/scripts/scripts_distortion_world_b3f.s b/res/field/scripts/scripts_distortion_world_b3f.s index 9ef21f8f05..70690deb5b 100644 --- a/res/field/scripts/scripts_distortion_world_b3f.s +++ b/res/field/scripts/scripts_distortion_world_b3f.s @@ -5,14 +5,14 @@ #define LOCALID_CYRUS 128 ScriptEntry DistortionWorldB3F_OnTransition - ScriptEntry DistortionWorldB3F_TriggerCyrus + ScriptEntry DistortionWorldB3F_CoordEvent_Cyrus ScriptEntryEnd DistortionWorldB3F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB3F_TriggerCyrus: +DistortionWorldB3F_CoordEvent_Cyrus: LockAll AddDistortionWorldMapObject LOCALID_CYRUS ApplyMovement LOCALID_CYRUS, DistortionWorldB3F_Movement_CyrusEnter diff --git a/res/field/scripts/scripts_distortion_world_b4f.s b/res/field/scripts/scripts_distortion_world_b4f.s index 55716e698f..5192b633f5 100644 --- a/res/field/scripts/scripts_distortion_world_b4f.s +++ b/res/field/scripts/scripts_distortion_world_b4f.s @@ -2,12 +2,12 @@ ScriptEntry DistortionWorldB4F_OnTransition - ScriptEntry DistortionWorldB4F_UnusedEntry2 + ScriptEntry DistortionWorldB4F_Dummy2 ScriptEntryEnd DistortionWorldB4F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB4F_UnusedEntry2: +DistortionWorldB4F_Dummy2: End diff --git a/res/field/scripts/scripts_distortion_world_b5f.s b/res/field/scripts/scripts_distortion_world_b5f.s index 23bfd6441b..2cef88917a 100644 --- a/res/field/scripts/scripts_distortion_world_b5f.s +++ b/res/field/scripts/scripts_distortion_world_b5f.s @@ -2,12 +2,12 @@ ScriptEntry DistortionWorldB5F_OnTransition - ScriptEntry DistortionWorldB5F_UnusedEntry2 + ScriptEntry DistortionWorldB5F_Dummy2 ScriptEntryEnd DistortionWorldB5F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB5F_UnusedEntry2: +DistortionWorldB5F_Dummy2: End diff --git a/res/field/scripts/scripts_distortion_world_b6f.s b/res/field/scripts/scripts_distortion_world_b6f.s index 0a8149d6dc..dbddcd0c0f 100644 --- a/res/field/scripts/scripts_distortion_world_b6f.s +++ b/res/field/scripts/scripts_distortion_world_b6f.s @@ -11,9 +11,9 @@ ScriptEntry DistortionWorldB6F_Cynthia ScriptEntry DistortionWorldB6F_CynthiaPuzzleFinished ScriptEntry DistortionWorldB6F_WereGettingClose - ScriptEntry DistortionWorldB6F_TriggerMespritBoulderInPit - ScriptEntry DistortionWorldB6F_TriggerUxieBoulderInPit - ScriptEntry DistortionWorldB6F_TriggerAzelfBoulderInPit + ScriptEntry DistortionWorldB6F_CoordEvent_MespritBoulderInPit + ScriptEntry DistortionWorldB6F_CoordEvent_UxieBoulderInPit + ScriptEntry DistortionWorldB6F_CoordEvent_AzelfBoulderInPit ScriptEntry DistortionWorldB6F_BoulderPit ScriptEntryEnd @@ -46,7 +46,7 @@ DistortionWorldB6F_WereGettingClose: NPCMessage DistortionWorldB6F_Text_WereGettingClose End -DistortionWorldB6F_TriggerMespritBoulderInPit: +DistortionWorldB6F_CoordEvent_MespritBoulderInPit: LockAll PlayCry SPECIES_MESPRIT Message DistortionWorldB6F_Text_MespritCry @@ -58,7 +58,7 @@ DistortionWorldB6F_TriggerMespritBoulderInPit: ReleaseAll End -DistortionWorldB6F_TriggerUxieBoulderInPit: +DistortionWorldB6F_CoordEvent_UxieBoulderInPit: LockAll PlayCry SPECIES_UXIE Message DistortionWorldB6F_Text_UxieCry @@ -70,7 +70,7 @@ DistortionWorldB6F_TriggerUxieBoulderInPit: ReleaseAll End -DistortionWorldB6F_TriggerAzelfBoulderInPit: +DistortionWorldB6F_CoordEvent_AzelfBoulderInPit: LockAll PlayCry SPECIES_AZELF Message DistortionWorldB6F_Text_AzelfCry diff --git a/res/field/scripts/scripts_distortion_world_b7f.s b/res/field/scripts/scripts_distortion_world_b7f.s index 56cea5e0d9..803eefc3af 100644 --- a/res/field/scripts/scripts_distortion_world_b7f.s +++ b/res/field/scripts/scripts_distortion_world_b7f.s @@ -6,9 +6,9 @@ #define LOCALID_CYRUS 129 ScriptEntry DistortionWorldB7F_OnTransition - ScriptEntry DistortionWorldB7F_TriggerWarpToGiratinaRoom - ScriptEntry DistortionWorldB7F_OnFrameFirstEntry - ScriptEntry DistortionWorldB7F_TriggerCynthiaCyrus + ScriptEntry DistortionWorldB7F_CoordEvent_WarpToGiratinaRoom + ScriptEntry DistortionWorldB7F_OnFrame_FirstEntry + ScriptEntry DistortionWorldB7F_CoordEvent_CynthiaCyrus ScriptEntry DistortionWorldB7F_Cyrus ScriptEntry DistortionWorldB7F_Cynthia ScriptEntryEnd @@ -17,7 +17,7 @@ DistortionWorldB7F_OnTransition: InitPersistedMapFeaturesForDistortionWorld End -DistortionWorldB7F_TriggerWarpToGiratinaRoom: +DistortionWorldB7F_CoordEvent_WarpToGiratinaRoom: FadeScreenOut WaitFadeScreen Warp MAP_HEADER_DISTORTION_WORLD_GIRATINA_ROOM, 0, 15, 25, DIR_NORTH @@ -25,7 +25,7 @@ DistortionWorldB7F_TriggerWarpToGiratinaRoom: WaitFadeScreen End -DistortionWorldB7F_OnFrameFirstEntry: +DistortionWorldB7F_OnFrame_FirstEntry: LockAll ApplyMovement LOCALID_CYNTHIA, DistortionWorldB7F_Movement_CynthiaWalkOnSpotNorth ApplyMovement LOCALID_PLAYER, DistortionWorldB7F_Movement_PlayerWalkOnSpotNorth @@ -37,7 +37,7 @@ DistortionWorldB7F_OnFrameFirstEntry: SetVar VAR_DISTORTION_WORLD_PROGRESS, 8 End -DistortionWorldB7F_TriggerCynthiaCyrus: +DistortionWorldB7F_CoordEvent_CynthiaCyrus: LockAll Message DistortionWorldB7F_Text_YouWereAlreadyHere CloseMessage diff --git a/res/field/scripts/scripts_distortion_world_giratina_room.s b/res/field/scripts/scripts_distortion_world_giratina_room.s index 21334c127f..8ab789de88 100644 --- a/res/field/scripts/scripts_distortion_world_giratina_room.s +++ b/res/field/scripts/scripts_distortion_world_giratina_room.s @@ -10,11 +10,11 @@ ScriptEntry DistortionWorldGiratinaRoom_OnTransition ScriptEntry DistortionWorldGiratinaRoom_OnLoad ScriptEntry DistortionWorldGiratinaRoom_Portal - ScriptEntry DistortionWorldGiratinaRoom_TriggerWarpToB7F + ScriptEntry DistortionWorldGiratinaRoom_CoordEvent_WarpToB7F ScriptEntry DistortionWorldGiratinaRoom_Giratina ScriptEntry DistortionWorldGiratinaRoom_Cynthia - ScriptEntry DistortionWorldGiratinaRoom_TriggerFirstShadow - ScriptEntry DistortionWorldGiratinaRoom_TriggerGiratinaArrival + ScriptEntry DistortionWorldGiratinaRoom_CoordEvent_FirstShadow + ScriptEntry DistortionWorldGiratinaRoom_CoordEvent_GiratinaArrival ScriptEntryEnd DistortionWorldGiratinaRoom_OnTransition: @@ -55,7 +55,7 @@ DistortionWorldGiratinaRoom_GoToSendoffSpring: WaitFadeScreen End -DistortionWorldGiratinaRoom_TriggerWarpToB7F: +DistortionWorldGiratinaRoom_CoordEvent_WarpToB7F: FadeScreenOut WaitFadeScreen Warp MAP_HEADER_DISTORTION_WORLD_B7F, 0, 89, 57, DIR_SOUTH @@ -148,7 +148,7 @@ DistortionWorldGiratinaRoom_Cynthia: NPCMessage DistortionWorldGiratinaRoom_Text_LetsGoBackHome End -DistortionWorldGiratinaRoom_TriggerFirstShadow: +DistortionWorldGiratinaRoom_CoordEvent_FirstShadow: LockAll PlayCry SPECIES_GIRATINA Message DistortionWorldGiratinaRoom_Text_GiratinaCryGiygogagogwoh @@ -158,7 +158,7 @@ DistortionWorldGiratinaRoom_TriggerFirstShadow: ReleaseAll End -DistortionWorldGiratinaRoom_TriggerGiratinaArrival: +DistortionWorldGiratinaRoom_CoordEvent_GiratinaArrival: LockAll BufferPlayerName 0 Message DistortionWorldGiratinaRoom_Text_GiratinaIsEyeingPlayer diff --git a/res/field/scripts/scripts_empty.s b/res/field/scripts/scripts_empty.s index 752d9f40e6..50421d2bb5 100644 --- a/res/field/scripts/scripts_empty.s +++ b/res/field/scripts/scripts_empty.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry Empty_UnusedEntry1 + ScriptEntry Empty_Dummy1 ScriptEntryEnd -Empty_UnusedEntry1: +Empty_Dummy1: End diff --git a/res/field/scripts/scripts_eterna_city.s b/res/field/scripts/scripts_eterna_city.s index d7fcefb5cb..4ea4170c70 100644 --- a/res/field/scripts/scripts_eterna_city.s +++ b/res/field/scripts/scripts_eterna_city.s @@ -4,33 +4,33 @@ #include "res/field/events/events_eterna_city.h" - ScriptEntry EternaCity_TriggerCynthiaGiveCut + ScriptEntry EternaCity_CoordEvent_CynthiaGiveCut ScriptEntry EternaCity_GruntM1 ScriptEntry EternaCity_GruntM2 ScriptEntry EternaCity_GruntM3 ScriptEntry EternaCity_PokemonBreederM ScriptEntry EternaCity_PokemonBreederF1 - ScriptEntry EternaCity_Unused7 + ScriptEntry EternaCity_RatherFetching_Unused ScriptEntry EternaCity_BugCatcher1 ScriptEntry EternaCity_AceTrainerF ScriptEntry EternaCity_ExpertM ScriptEntry EternaCity_NinjaBoy - ScriptEntry EternaCity_MapSign + ScriptEntry EternaCity_MapSignpost ScriptEntry EternaCity_GymSignpost - ScriptEntry EternaCity_LandmarkSignRadRickshawsCycleShop - ScriptEntry EternaCity_LandmarkSignTeamGalacticEternaBuilding - ScriptEntry EternaCity_LandmarkSignUndergroundMansHouse - ScriptEntry EternaCity_LandmarkSignEternaCondominiums + ScriptEntry EternaCity_SignboardRadRickshawsCycleShop + ScriptEntry EternaCity_SignboardTeamGalacticEternaBuilding + ScriptEntry EternaCity_SignboardUndergroundMansHouse + ScriptEntry EternaCity_SignboardEternaCondominiums ScriptEntry EternaCity_Statue ScriptEntry EternaCity_PokemonBreederF2 - ScriptEntry EternaCity_TriggerBlockExitSouth + ScriptEntry EternaCity_CoordEvent_BlockExitSouth ScriptEntry EternaCity_OnTransition ScriptEntry EternaCity_BugCatcher2 - ScriptEntry EternaCity_TriggerBlockExitWest + ScriptEntry EternaCity_CoordEvent_BlockExitWest ScriptEntry EternaCity_Gardenia - ScriptEntry EternaCity_TriggerRival - ScriptEntry EternaCity_TriggerCynthiaTryGiveEgg - ScriptEntry EternaCity_TriggerCynthiaBlockBikeShop + ScriptEntry EternaCity_CoordEvent_Rival + ScriptEntry EternaCity_CoordEvent_CynthiaTryGiveEgg + ScriptEntry EternaCity_CoordEvent_CynthiaBlockBikeShop ScriptEntry EternaCity_Cynthia ScriptEntryEnd @@ -54,26 +54,26 @@ EternaCity_SetCynthiaPositionForGiveEgg: Return EternaCity_PokemonBreederM: - NPCMessage EternaCity_Text_IfYoureVisitingEternaYouNeedToGetYourselfABicycle + NPCMessage EternaCity_Text_GetYourselfABicycle End -EternaCity_Unused7: - NPCMessage EternaCity_Text_OhYourPokemonAreRatherFetching +EternaCity_RatherFetching_Unused: + NPCMessage EternaCity_Text_PokemonAreRatherFetching End EternaCity_PokemonBreederF1: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, EternaCity_WithTeamGalacticGoneWhatsGoingToHappenToTheirBuilding - Message EternaCity_Text_SinceThatTeamGalacticBuildingWentUp + GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, EternaCity_WhatWillHappenToGalacticBuilding + Message EternaCity_Text_AtmosphereHasGottenCreepy WaitButton CloseMessage ReleaseAll End -EternaCity_WithTeamGalacticGoneWhatsGoingToHappenToTheirBuilding: - Message EternaCity_Text_WithTeamGalacticGoneWhatsGoingToHappenToTheirBuilding +EternaCity_WhatWillHappenToGalacticBuilding: + Message EternaCity_Text_WhatWillHappenToGalacticBuilding WaitButton CloseMessage ReleaseAll @@ -83,45 +83,45 @@ EternaCity_BugCatcher1: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, EternaCity_DoYouUseYourBikesKickstand - Message EternaCity_Text_MyFriendSaidTeamGalacticTookHisFavoritePokemonAway + GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, EternaCity_DoYouUseKickstand + Message EternaCity_Text_GalacticTookFavoritePokemon WaitButton CloseMessage ReleaseAll End -EternaCity_DoYouUseYourBikesKickstand: - Message EternaCity_Text_DoYouUseYourBikesKickstand +EternaCity_DoYouUseKickstand: + Message EternaCity_Text_DoYouUseKickstand WaitButton CloseMessage ReleaseAll End -EternaCity_MapSign: +EternaCity_MapSignpost: ShowMapSign EternaCity_Text_EternaCityHistoryLiving End EternaCity_GymSignpost: - ShowScrollingSign EternaCity_Text_EternaCityPokemonGymLeaderGardeniaMasterOfVividPlantPokemon + ShowScrollingSign EternaCity_Text_SignPokemonGym End -EternaCity_LandmarkSignRadRickshawsCycleShop: - ShowLandmarkSign EternaCity_Text_RadRickshawsCycleShopGetOnAndRide +EternaCity_SignboardRadRickshawsCycleShop: + ShowLandmarkSign EternaCity_Text_SignRadRickshawsCycleShop End -EternaCity_LandmarkSignTeamGalacticEternaBuilding: - ShowLandmarkSign EternaCity_Text_TeamGalacticEternaBuildingWeWantYourPokemon +EternaCity_SignboardTeamGalacticEternaBuilding: + ShowLandmarkSign EternaCity_Text_SignTeamGalacticEternaBuilding End -EternaCity_LandmarkSignUndergroundMansHouse: - ShowLandmarkSign EternaCity_Text_UndergroundMansHouseGoinDownForAdventure +EternaCity_SignboardUndergroundMansHouse: + ShowLandmarkSign EternaCity_Text_SignUndergroundMansHouse End -EternaCity_LandmarkSignEternaCondominiums: - ShowLandmarkSign EternaCity_Text_EternaCondominiumsNameRatingServicesAvailable +EternaCity_SignboardEternaCondominiums: + ShowLandmarkSign EternaCity_Text_SignEternaCondominiums End -EternaCity_TriggerCynthiaGiveCut: +EternaCity_CoordEvent_CynthiaGiveCut: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 522, EternaCity_SetCynthiaPositionForGiveCutZ522 @@ -173,15 +173,15 @@ EternaCity_CynthiaGiveCut: CallIfEq VAR_0x8005, 522, EternaCity_EnterCynthiaForGiveCutZ522 CallIfNe VAR_0x8005, 522, EternaCity_EnterCynthiaForGiveCutNotZ522 BufferPlayerName 0 - Message EternaCity_Text_OhThatDeviceYouHaveItIsAPokedex + Message EternaCity_Text_OhYouHaveAPokedex CloseMessage CallIfEq VAR_0x8005, 522, EternaCity_CynthiaWalkOnSpotEastNorth CallIfNe VAR_0x8005, 522, EternaCity_CynthiaWalkOnSpotEastWest - Message EternaCity_Text_TryUsingThisItShouldBeHelpful + Message EternaCity_Text_TryUsingThis SetVar VAR_0x8004, ITEM_HM01 SetVar VAR_0x8005, 1 Common_GiveItemQuantity - Message EternaCity_Text_RememberTheHiddenMoveCutCanBeUsedInTheField + Message EternaCity_Text_CutCanBeUsedInField CloseMessage GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 522, EternaCity_CynthiaLeaveAfterCutZ522 @@ -359,11 +359,11 @@ EternaCity_Movement_PlayerWatchCynthiaLeaveAfterCutNotZ522: EndMovement EternaCity_GruntM1: - NPCMessage EternaCity_Text_HeyYouThereKidStayAwayFromThatPokemonStatue + NPCMessage EternaCity_Text_StayAwayFromStatue End EternaCity_GruntM2: - NPCMessage EternaCity_Text_HeyYouYeahYouTrainer + NPCMessage EternaCity_Text_IllLetYouKeepPokemon End EternaCity_GruntM3: @@ -375,11 +375,11 @@ EternaCity_AceTrainerF: End EternaCity_ExpertM: - NPCMessage EternaCity_Text_EternaCitysNotAnythingLikeItWasBefore + NPCMessage EternaCity_Text_EternaCitysNotLikeBefore End EternaCity_NinjaBoy: - NPCMessage EternaCity_Text_TheySayThisIsAnAwesomePokemonThatPeopleSawLongAgo + NPCMessage EternaCity_Text_AwesomePokemonFromLongAgo End EternaCity_Statue: @@ -387,15 +387,15 @@ EternaCity_Statue: End EternaCity_PokemonBreederF2: - GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, EternaCity_GoingUndergroundWithTheExplorerKitIsABlastIsntIt - NPCMessage EternaCity_Text_OhDontTellMeYouDontHaveAnExplorerKit2 + GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, EternaCity_GoingUndergroundIsABlast + NPCMessage EternaCity_Text_YouDontHaveExplorerKit End -EternaCity_GoingUndergroundWithTheExplorerKitIsABlastIsntIt: - NPCMessage EternaCity_Text_GoingUndergroundWithTheExplorerKitIsABlastIsntIt +EternaCity_GoingUndergroundIsABlast: + NPCMessage EternaCity_Text_GoingUndergroundIsABlast End -EternaCity_TriggerBlockExitSouth: +EternaCity_CoordEvent_BlockExitSouth: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 CallIfEq VAR_0x8004, 303, EternaCity_PokemonBreederFBlockExitSouthX303 @@ -405,7 +405,7 @@ EternaCity_TriggerBlockExitSouth: CallIfEq VAR_0x8004, 307, EternaCity_PokemonBreederFBlockExitSouthX307 ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerWalkOnSpotWestToFacePokemonBreederF WaitMovement - Message EternaCity_Text_OhDontTellMeYouDontHaveAnExplorerKit + Message EternaCity_Text_YouDontHaveExplorerKit_ArrowPrompt CloseMessage CallIfEq VAR_0x8004, 303, EternaCity_PokemonBreederFMoveBackX303 CallIfEq VAR_0x8004, 304, EternaCity_PokemonBreederFMoveBackX304 @@ -504,7 +504,7 @@ EternaCity_Movement_PokemonBreederFBlockExitSouthX307: WalkNormalEast 4 EndMovement -EternaCity_UnusedMovement: +EternaCity_Movement_Unused: WalkOnSpotFastEast EndMovement @@ -546,9 +546,9 @@ EternaCity_BugCatcher2: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfUnset FLAG_RECEIVED_BICYCLE, EternaCity_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt - GoToIfGe VAR_ROUTE_207_COUNTERPART_TRIGGER_STATE, 1, EternaCity_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt - Message EternaCity_Text_OhWowYouGotABicycle2 + GoToIfUnset FLAG_RECEIVED_BICYCLE, EternaCity_FeelsGreatRidingABike + GoToIfGe VAR_ROUTE_207_COUNTERPART_TRIGGER_STATE, 1, EternaCity_FeelsGreatRidingABike + Message EternaCity_Text_YouGotABicycle WaitButton CloseMessage ApplyMovement LOCALID_BUG_CATCHER_2, EternaCity_Movement_BugCatcher2FaceSouth @@ -556,8 +556,8 @@ EternaCity_BugCatcher2: ReleaseAll End -EternaCity_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt: - Message EternaCity_Text_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt +EternaCity_FeelsGreatRidingABike: + Message EternaCity_Text_FeelsGreatRidingABike WaitButton CloseMessage ApplyMovement LOCALID_BUG_CATCHER_2, EternaCity_Movement_BugCatcher2FaceSouth @@ -565,7 +565,7 @@ EternaCity_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt: ReleaseAll End -EternaCity_TriggerBlockExitWest: +EternaCity_CoordEvent_BlockExitWest: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 CallIfEq VAR_0x8005, 532, EternaCity_BugCatcher2BlockExitWestZ532 @@ -573,7 +573,7 @@ EternaCity_TriggerBlockExitWest: CallIfEq VAR_0x8005, 534, EternaCity_BugCatcher2BlockExitWestZ534 ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerFaceNorth WaitMovement - Message EternaCity_Text_OhWowYouGotABicycle + Message EternaCity_Text_YouGotABicycle_ArrowPrompt CloseMessage CallIfEq VAR_0x8005, 532, EternaCity_PushBackPlayerZ532 CallIfEq VAR_0x8005, 533, EternaCity_PushBackPlayerZ533 @@ -676,7 +676,7 @@ EternaCity_Gardenia: LockAll FacePlayer BufferRivalName 0 - Message EternaCity_Text_HiImGardeniaImThisTownsGymLeader + Message EternaCity_Text_ImThisTownsGymLeader CloseMessage ApplyMovement LOCALID_GARDENIA, EternaCity_Movement_GardeniaWalkOnSpotNorth WaitMovement @@ -702,7 +702,7 @@ EternaCity_Movement_GardeniaEnterGym: WalkNormalNorth EndMovement -EternaCity_TriggerRival: +EternaCity_CoordEvent_Rival: LockAll ScrCmd_32D ScrCmd_331 @@ -720,31 +720,31 @@ EternaCity_RivalRunIntoPlayerZ523: ApplyMovement LOCALID_RIVAL, EternaCity_Movement_RivalRunIntoPlayerZ523 ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerGetPushedByRivalZ523 WaitMovement - GoTo EternaCity_YouCameToSeeThePokemonStatueRight + GoTo EternaCity_YouCameToSeeStatue End EternaCity_RivalRunIntoPlayerZ524: ApplyMovement LOCALID_RIVAL, EternaCity_Movement_RivalRunIntoPlayerZ524 ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerGetPushedByRivalZ524 WaitMovement - GoTo EternaCity_YouCameToSeeThePokemonStatueRight + GoTo EternaCity_YouCameToSeeStatue End EternaCity_RivalRunIntoPlayerZ525: ApplyMovement LOCALID_RIVAL, EternaCity_Movement_RivalRunIntoPlayerZ525 ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerGetPushedByRivalZ525 WaitMovement - GoTo EternaCity_YouCameToSeeThePokemonStatueRight + GoTo EternaCity_YouCameToSeeStatue End -EternaCity_YouCameToSeeThePokemonStatueRight: +EternaCity_YouCameToSeeStatue: PlaySE SEQ_SE_DP_WALL_HIT2 Message EternaCity_Text_BigThud CloseMessage Common_SetRivalBGM BufferRivalName 0 BufferPlayerName 1 - Message EternaCity_Text_YouCameToSeeThePokemonStatueRight + Message EternaCity_Text_YouCameToSeeStatue CloseMessage GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 523, EternaCity_WalkToStatueZ523 @@ -792,7 +792,7 @@ EternaCity_Cyrus: AddFreeCamera 323, 524 ApplyFreeCameraMovement EternaCity_Movement_CameraPanEast WaitMovement - Message EternaCity_Text_SoThisIsEternasPokemonStatue + Message EternaCity_Text_SoThisIsEternasStatue CloseMessage WaitTime 15, VAR_RESULT ApplyMovement LOCALID_CYRUS, EternaCity_Movement_CyrusWalkToPlayer @@ -811,7 +811,7 @@ EternaCity_Cyrus: ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerFaceRival WaitMovement BufferRivalName 0 - Message EternaCity_Text_GoCheckOutThePokemonStatueSeeYouAround + Message EternaCity_Text_GoCheckOutStatueSeeYou CloseMessage ApplyMovement LOCALID_RIVAL, EternaCity_Movement_RivalLeave ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerWatchRivalLeave @@ -1008,7 +1008,7 @@ EternaCity_Movement_CyrusLeave: WalkNormalWest 14 EndMovement -EternaCity_TriggerCynthiaTryGiveEgg: +EternaCity_CoordEvent_CynthiaTryGiveEgg: LockAll SetObjectEventDir LOCALID_CYNTHIA, DIR_EAST SetObjectEventMovementType LOCALID_CYNTHIA, MOVEMENT_TYPE_LOOK_EAST @@ -1068,7 +1068,7 @@ EternaCity_CynthiaTryGiveEgg: WaitMovement ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerWalkOnSpotWestToFaceCynthia WaitMovement - Message EternaCity_Text_IWantedYouToHaveThisPokemonEggWillYouAcceptIt + Message EternaCity_Text_WillYouAcceptEgg ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_NO, EternaCity_RefusedEgg GetPartyCount VAR_RESULT @@ -1083,20 +1083,20 @@ EternaCity_CynthiaTryGiveEgg: EternaCity_GiveTogepiEgg: PlayFanfare SEQ_FANFA4 WaitFanfare - Message EternaCity_Text_ThatsWonderfulThePokemonInsideTheEggIsHappyToo - Message EternaCity_Text_KeepThatEggWithYouInYourPartyOfPokemon + Message EternaCity_Text_ThatsWonderful + Message EternaCity_Text_KeepEggInYourParty CloseMessage GiveEgg SPECIES_TOGEPI, SPECIAL_METLOC_NAME_CYNTHIA SetVar VAR_ETERNA_CITY_STATE, 5 Return EternaCity_PartyIsFull: - Call EternaCity_OhYouDontHaveRoomForThisEgg + Call EternaCity_NoRoomForEgg GoTo EternaCity_CynthiaTryGiveEggEnd End EternaCity_RefusedEgg: - Call EternaCity_OhYouDontNeedToFeelObligated + Call EternaCity_DontFeelObligated GoTo EternaCity_CynthiaTryGiveEggEnd End @@ -1133,7 +1133,7 @@ EternaCity_Cynthia: End EternaCity_CynthiaTryAgainGiveEgg: - Message EternaCity_Text_WillYouAcceptThisPokemonEgg + Message EternaCity_Text_WillYouAcceptThisEgg ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_NO, EternaCity_RefusedEggAgain GetPartyCount VAR_RESULT @@ -1179,12 +1179,12 @@ EternaCity_RemoveCynthia: End EternaCity_PartyIsFullAgain: - Call EternaCity_OhYouDontHaveRoomForThisEgg + Call EternaCity_NoRoomForEgg GoTo EternaCity_CynthiaTryAgainGiveEggEnd End EternaCity_RefusedEggAgain: - Call EternaCity_OhYouDontNeedToFeelObligated + Call EternaCity_DontFeelObligated GoTo EternaCity_CynthiaTryAgainGiveEggEnd End @@ -1192,21 +1192,21 @@ EternaCity_CynthiaTryAgainGiveEggEnd: ReleaseAll End -EternaCity_OhYouDontHaveRoomForThisEgg: +EternaCity_NoRoomForEgg: SetVar VAR_ETERNA_CITY_STATE, 4 - Message EternaCity_Text_OhYouDontHaveRoomForThisEgg + Message EternaCity_Text_NoRoomForEgg WaitButton CloseMessage Return -EternaCity_OhYouDontNeedToFeelObligated: - Message EternaCity_Text_OhYouDontNeedToFeelObligated +EternaCity_DontFeelObligated: + Message EternaCity_Text_DontFeelObligated WaitButton CloseMessage SetVar VAR_ETERNA_CITY_STATE, 4 Return -EternaCity_TriggerCynthiaBlockBikeShop: +EternaCity_CoordEvent_CynthiaBlockBikeShop: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 540, EternaCity_CynthiaWalkOnSpotEastZ540 @@ -1220,41 +1220,41 @@ EternaCity_TriggerCynthiaBlockBikeShop: EternaCity_CynthiaWalkOnSpotEastZ540: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End EternaCity_CynthiaWalkOnSpotEastZ541: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End EternaCity_CynthiaWalkOnSpotEastZ542: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End EternaCity_CynthiaWalkOnSpotEastZ543: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End EternaCity_CynthiaWalkOnSpotEastZ544: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End EternaCity_CynthiaWalkOnSpotEastZ545: ApplyMovement LOCALID_CYNTHIA, EternaCity_Movement_CynthiaWalkOnSpotEast WaitMovement - GoTo EternaCity_DontLeaveWithoutThisPokemonEgg + GoTo EternaCity_DontLeaveWithoutEgg End -EternaCity_DontLeaveWithoutThisPokemonEgg: - Message EternaCity_Text_DontLeaveWithoutThisPokemonEgg +EternaCity_DontLeaveWithoutEgg: + Message EternaCity_Text_DontLeaveWithoutEgg CloseMessage ApplyMovement LOCALID_PLAYER, EternaCity_Movement_PlayerWalkNormalWest WaitMovement diff --git a/res/field/scripts/scripts_eterna_city_condominiums_1f.s b/res/field/scripts/scripts_eterna_city_condominiums_1f.s index 1df6f84f77..e809e7b6cd 100644 --- a/res/field/scripts/scripts_eterna_city_condominiums_1f.s +++ b/res/field/scripts/scripts_eterna_city_condominiums_1f.s @@ -12,14 +12,14 @@ EternaCityCondominiums1F_ExpertM: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - Message EternaCityCondominiums1F_Text_WantMeToRateTheNicknamesOfYourPokemon + Message EternaCityCondominiums1F_Text_WantMeToRateNicknames ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_YES, EternaCityCondominiums1F_TryGiveNickname - GoTo EternaCityCondominiums1F_ISeePleaseComeVisitAgain + GoTo EternaCityCondominiums1F_PleaseComeVisitAgain End EternaCityCondominiums1F_TryGiveNickname: - Message EternaCityCondominiums1F_Text_WhichPokemonsNicknameShouldICritique + Message EternaCityCondominiums1F_Text_CritiqueWhichNickname WaitABPress CloseMessage FadeScreenOut @@ -29,28 +29,28 @@ EternaCityCondominiums1F_TryGiveNickname: ReturnToField FadeScreenIn WaitFadeScreen - GoToIfEq VAR_RESULT, 0xFF, EternaCityCondominiums1F_ISeePleaseComeVisitAgain + GoToIfEq VAR_RESULT, 0xFF, EternaCityCondominiums1F_PleaseComeVisitAgain SetVar VAR_0x8005, VAR_RESULT GetPartyMonSpecies VAR_0x8005, VAR_RESULT GoToIfEq VAR_RESULT, SPECIES_NONE, EternaCityCondominiums1F_SelectedEgg CheckIsPartyMonOutsider VAR_0x8005, VAR_RESULT GoToIfEq VAR_RESULT, TRUE, EternaCityCondominiums1F_SelectedOutsiderPokemon BufferPartyMonNickname 0, VAR_0x8005 - Message EternaCityCondominiums1F_Text_WouldYouLikeToGiveItAnEvenBetterName + Message EternaCityCondominiums1F_Text_GiveItABetterName ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_YES, EternaCityCondominiums1F_GiveNewNickname - GoTo EternaCityCondominiums1F_ISeePleaseComeVisitAgain + GoTo EternaCityCondominiums1F_PleaseComeVisitAgain End -EternaCityCondominiums1F_ISeePleaseComeVisitAgain: - Message EternaCityCondominiums1F_Text_ISeePleaseComeVisitAgain +EternaCityCondominiums1F_PleaseComeVisitAgain: + Message EternaCityCondominiums1F_Text_PleaseComeVisitAgain WaitButton CloseMessage ReleaseAll End EternaCityCondominiums1F_SelectedEgg: - Message EternaCityCondominiums1F_Text_AnEggCanGoByNoOtherName + Message EternaCityCondominiums1F_Text_CantNicknameEgg WaitButton CloseMessage ReleaseAll @@ -58,14 +58,14 @@ EternaCityCondominiums1F_SelectedEgg: EternaCityCondominiums1F_SelectedOutsiderPokemon: BufferPartyMonNickname 0, VAR_0x8005 - Message EternaCityCondominiums1F_Text_NicknameIsItThatIsATrulyImpeccableName + Message EternaCityCondominiums1F_Text_TrulyImpeccableName WaitButton CloseMessage ReleaseAll End EternaCityCondominiums1F_GiveNewNickname: - Message EternaCityCondominiums1F_Text_AhGoodThenWhatShallTheNewNicknameBe + Message EternaCityCondominiums1F_Text_WhatShallNewNicknameBe WaitABPress CloseMessage SetVar VAR_RESULT, 0 @@ -78,7 +78,7 @@ EternaCityCondominiums1F_GiveNewNickname: ScrCmd_2B8 VAR_0x8005 IncrementGameRecord RECORD_POKEMON_NICKNAMED BufferPartyMonNickname 0, VAR_0x8005 - Message EternaCityCondominiums1F_Text_ThisPokemonShallBeKnownAsNicknameItIsABetterNameThanBefore + Message EternaCityCondominiums1F_Text_BetterNameThanBefore WaitButton CloseMessage ReleaseAll @@ -86,7 +86,7 @@ EternaCityCondominiums1F_GiveNewNickname: EternaCityCondominiums1F_GaveSameNickname: BufferPartyMonNickname 0, VAR_0x8005 - Message EternaCityCondominiums1F_Text_ThisPokemonShallBeKnownAsNicknameItLooksNoDifferentFromBefore + Message EternaCityCondominiums1F_Text_NoDifferentFromBefore WaitButton CloseMessage ReleaseAll @@ -96,8 +96,8 @@ EternaCityCondominiums1F_NinjaBoy: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_TRADED_FOR_CHARAP_CHATOT, EternaCityCondominiums1F_DidThatChatotITradedYouTotallyLearnThatChatterMove - Message EternaCityCondominiums1F_Text_DoYouGotThatPokemonNamedBuizelWannTradeItForMyChatot + GoToIfSet FLAG_TRADED_FOR_CHARAP_CHATOT, EternaCityCondominiums1F_DidChatotLearnChatter + Message EternaCityCondominiums1F_Text_AskTradeBuizelForChatot ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_YES, EternaCityCondominiums1F_TryTrade GoTo EternaCityCondominiums1F_OhOKTotallyGotIt @@ -115,7 +115,7 @@ EternaCityCondominiums1F_TryTrade: SetVar VAR_0x8004, VAR_RESULT GetPartyMonSpecies VAR_0x8004, VAR_0x8005 GetNPCTradeRequestedSpecies VAR_RESULT - GoToIfNe VAR_0x8005, VAR_RESULT, EternaCityCondominiums1F_WhatITotallyWantIsABuizel + GoToIfNe VAR_0x8005, VAR_RESULT, EternaCityCondominiums1F_IWantBuizel StartNPCTrade VAR_0x8004 FinishNPCTrade SetFlag FLAG_TRADED_FOR_CHARAP_CHATOT @@ -125,9 +125,9 @@ EternaCityCondominiums1F_TryTrade: ReleaseAll End -EternaCityCondominiums1F_WhatITotallyWantIsABuizel: +EternaCityCondominiums1F_IWantBuizel: FinishNPCTrade - Message EternaCityCondominiums1F_Text_WhatITotallyWantIsABuizel + Message EternaCityCondominiums1F_Text_IWantBuizel WaitButton CloseMessage ReleaseAll @@ -140,8 +140,8 @@ EternaCityCondominiums1F_OhOKTotallyGotIt: ReleaseAll End -EternaCityCondominiums1F_DidThatChatotITradedYouTotallyLearnThatChatterMove: - Message EternaCityCondominiums1F_Text_DidThatChatotITradedYouTotallyLearnThatChatterMove +EternaCityCondominiums1F_DidChatotLearnChatter: + Message EternaCityCondominiums1F_Text_DidChatotLearnChatter WaitButton CloseMessage ReleaseAll @@ -152,19 +152,19 @@ EternaCityCondominiums1F_PokefanM: LockAll FacePlayer GetTimeOfDay VAR_RESULT - GoToIfEq VAR_RESULT, TIMEOFDAY_LATE_NIGHT, EternaCityCondominiums1F_ImBuildingSuperintendentMantain24HourWatchZZZ - GoTo EternaCityCondominiums1F_HiImTheBuildingSuperintented + GoToIfEq VAR_RESULT, TIMEOFDAY_LATE_NIGHT, EternaCityCondominiums1F_Mantain24HourWatchZzz + GoTo EternaCityCondominiums1F_ImBuildingSuperintented End -EternaCityCondominiums1F_HiImTheBuildingSuperintented: - Message EternaCityCondominiums1F_Text_HiImTheBuildingSuperintented +EternaCityCondominiums1F_ImBuildingSuperintented: + Message EternaCityCondominiums1F_Text_ImBuildingSuperintented WaitButton CloseMessage ReleaseAll End -EternaCityCondominiums1F_ImBuildingSuperintendentMantain24HourWatchZZZ: - Message EternaCityCondominiums1F_Text_ImBuildingSuperintendentMantain24HourWatchZZZ +EternaCityCondominiums1F_Mantain24HourWatchZzz: + Message EternaCityCondominiums1F_Text_Mantain24HourWatchZzz WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_eterna_city_condominiums_2f.s b/res/field/scripts/scripts_eterna_city_condominiums_2f.s index c3075c1e2d..bb7c0fb7b1 100644 --- a/res/field/scripts/scripts_eterna_city_condominiums_2f.s +++ b/res/field/scripts/scripts_eterna_city_condominiums_2f.s @@ -11,8 +11,8 @@ EternaCityCondominiums2F_ExpertF: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_RECEIVED_ETERNA_CITY_CONDOMINIUMS_2F_TM67, EternaCityCondominiums2F_FolksLikeMeHaveALongHistoryWeCanLookBackOn - Message EternaCityCondominiums2F_Text_IveHadThisTMRecycleForSuchALongTimeNow + GoToIfSet FLAG_RECEIVED_ETERNA_CITY_CONDOMINIUMS_2F_TM67, EternaCityCondominiums2F_LongHistory + Message EternaCityCondominiums2F_Text_HadTMLongTimeNow SetVar VAR_0x8004, ITEM_TM67 SetVar VAR_0x8005, 1 GoToIfCannotFitItem VAR_0x8004, VAR_0x8005, VAR_RESULT, EternaCityCondominiums2F_BagIsFull @@ -28,19 +28,19 @@ EternaCityCondominiums2F_BagIsFull: ReleaseAll End -EternaCityCondominiums2F_FolksLikeMeHaveALongHistoryWeCanLookBackOn: - Message EternaCityCondominiums2F_Text_FolksLikeMeHaveALongHistoryWeCanLookBackOn +EternaCityCondominiums2F_LongHistory: + Message EternaCityCondominiums2F_Text_LongHistory WaitButton CloseMessage ReleaseAll End EternaCityCondominiums2F_Twin: - NPCMessage EternaCityCondominiums2F_Text_GardeniaOurGymLeaderGoesOutToEternaForestEverySoOften + NPCMessage EternaCityCondominiums2F_Text_GardeniaGoesToEternaForest End EternaCityCondominiums2F_ExpertM: - NPCMessage EternaCityCondominiums2F_Text_TheMoveRecycleIsToBeUsedDuringBattle + NPCMessage EternaCityCondominiums2F_Text_RecycleUsedDuringBattle End .balign 4, 0 diff --git a/res/field/scripts/scripts_eterna_city_condominiums_3f.s b/res/field/scripts/scripts_eterna_city_condominiums_3f.s index d7e6d1e822..198bec73f6 100644 --- a/res/field/scripts/scripts_eterna_city_condominiums_3f.s +++ b/res/field/scripts/scripts_eterna_city_condominiums_3f.s @@ -9,7 +9,7 @@ ScriptEntryEnd EternaCityCondominiums3F_BugCatcher: - NPCMessage EternaCityCondominiums3F_Text_IGatheredUpALotOfBerriesSoImTradingThemInForAccessories + NPCMessage EternaCityCondominiums3F_Text_GatheredUpBerries End EternaCityCondominiums3F_PokefanM: @@ -17,11 +17,11 @@ EternaCityCondominiums3F_PokefanM: End EternaCityCondominiums3F_SchoolKidM: - NPCMessage EternaCityCondominiums3F_Text_HahahaIveGotYouNowImGonnaTakeYourFlag + NPCMessage EternaCityCondominiums3F_Text_ImGonnaTakeYourFlag End EternaCityCondominiums3F_NinjaBoy: - NPCMessage EternaCityCondominiums3F_Text_YouCantCatchMeISetSomeTraps + NPCMessage EternaCityCondominiums3F_Text_ISetSomeTraps End .balign 4, 0 diff --git a/res/field/scripts/scripts_eterna_city_east_house.s b/res/field/scripts/scripts_eterna_city_east_house.s index 27a42d0bd1..00eaa109aa 100644 --- a/res/field/scripts/scripts_eterna_city_east_house.s +++ b/res/field/scripts/scripts_eterna_city_east_house.s @@ -8,29 +8,29 @@ ScriptEntryEnd EternaCityEastHouse_ExpertM: - NPCMessage EternaCityEastHouse_Text_EternaCameToBeLongAgoInHonorOfAncientPokemon + NPCMessage EternaCityEastHouse_Text_EternaCameToBeLongAgo End EternaCityEastHouse_ExpertF: - NPCMessage EternaCityEastHouse_Text_HaveYouSeenThePokemonStatue + NPCMessage EternaCityEastHouse_Text_HaveYouSeenStatue End EternaCityEastHouse_PokemonBreederM: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - Message EternaCityEastHouse_Text_SomeoneRippedOffTheDescriptivePlateFromThePokemonStatueWantToKnowWhatItSaid + Message EternaCityEastHouse_Text_WantToKnowWhatPlateSaid ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, EternaCityEastHouse_WellIfYoureNotInterestedDontFeelObligatedOrAnything - Message EternaCityEastHouse_Text_TheFirstInscriptionWentLikeThisWantToHearAboutTheOtherInscription + GoToIfEq VAR_RESULT, MENU_NO, EternaCityEastHouse_DontFeelObligated + Message EternaCityEastHouse_Text_FirstInscriptionLikeThisHearOther ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, EternaCityEastHouse_WellIfYoureNotInterestedDontFeelObligatedOrAnything - Message EternaCityEastHouse_Text_TheSecondInscriptionWentSortOfLikeThis + GoToIfEq VAR_RESULT, MENU_NO, EternaCityEastHouse_DontFeelObligated + Message EternaCityEastHouse_Text_SecondInscriptionWentLikeThis GoTo EternaCityEastHouse_PokemonBreederMEnd End -EternaCityEastHouse_WellIfYoureNotInterestedDontFeelObligatedOrAnything: - Message EternaCityEastHouse_Text_WellIfYoureNotInterestedDontFeelObligatedOrAnything +EternaCityEastHouse_DontFeelObligated: + Message EternaCityEastHouse_Text_DontFeelObligated GoTo EternaCityEastHouse_PokemonBreederMEnd End diff --git a/res/field/scripts/scripts_eterna_city_gym.s b/res/field/scripts/scripts_eterna_city_gym.s index dfe34fbea4..53fe37b511 100644 --- a/res/field/scripts/scripts_eterna_city_gym.s +++ b/res/field/scripts/scripts_eterna_city_gym.s @@ -62,7 +62,7 @@ EternaGym_Gardenia: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_FOREST, EternaGym_Gardenia_AlreadyHaveForestbadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 67, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_ETERNA_CITY_GYM, 0, 0, 0 Message EternaGym_Text_GardeniaIntro CloseMessage StartTrainerBattle TRAINER_LEADER_GARDENIA @@ -79,8 +79,8 @@ EternaGym_Gardenia: SetTrainerFlag TRAINER_AROMA_LADY_ANGELA SetTrainerFlag TRAINER_LASS_CAROLINE SetTrainerFlag TRAINER_BEAUTY_LINDSAY - ClearFlag FLAG_UNK_0x01FC - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 67, TRAINER_LEADER_GARDENIA, 0, 0 + ClearFlag FLAG_HIDE_ETERNA_FOREST_GARDENIA + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_ETERNA_CITY_GYM, TRAINER_LEADER_GARDENIA, 0, 0 Message EternaGym_Text_GardeniaExplainForestBadge GoTo EternaGym_GardeniaGiveTM86 End diff --git a/res/field/scripts/scripts_eterna_city_herb_shop.s b/res/field/scripts/scripts_eterna_city_herb_shop.s index c336c826eb..ac2f738888 100644 --- a/res/field/scripts/scripts_eterna_city_herb_shop.s +++ b/res/field/scripts/scripts_eterna_city_herb_shop.s @@ -22,7 +22,7 @@ EternaCityHerbShop_ExpertF: End EternaCityHerbShop_ExpertM: - NPCMessage EternaCityHerbShop_Text_NonBitterWouldBeMedicalBreakthrough + NPCMessage EternaCityHerbShop_Text_InventNonBitterMedicine End .balign 4, 0 diff --git a/res/field/scripts/scripts_eterna_city_pokecenter_1f.s b/res/field/scripts/scripts_eterna_city_pokecenter_1f.s index 55f91e15ca..74cb598a05 100644 --- a/res/field/scripts/scripts_eterna_city_pokecenter_1f.s +++ b/res/field/scripts/scripts_eterna_city_pokecenter_1f.s @@ -15,7 +15,7 @@ EternaCityPokecenter1F_Nurse: End EternaCityPokecenter1F_BattleGirl: - NPCMessage EternaCityPokecenter1F_Text_WhenAPokemonFaintsItJustMeansItDoesntHaveThePowerToBattle + NPCMessage EternaCityPokecenter1F_Text_FaintMeansNoPowerToBattle End EternaCityPokecenter1F_SchoolKidM: @@ -23,7 +23,7 @@ EternaCityPokecenter1F_SchoolKidM: LockAll FacePlayer GoToIfSet FLAG_TEAM_GALACTIC_LEFT_ETERNA_BUILDING, EternaCityPokecenter1F_IGotMyPokemonBack - Message EternaCityPokecenter1F_Text_TeamGalacticTookMyPokemonAway + Message EternaCityPokecenter1F_Text_TeamGalacticTookMyPokemon WaitButton CloseMessage ReleaseAll @@ -44,20 +44,20 @@ EternaCityPokecenter1F_PokemonBreederF: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfEq VAR_MAP_LOCAL_2, 1, EternaCityPokecenter1F_IfYouSpendEnoughTimeWithThemAllPokemonWillOpenUpToYou + GoToIfEq VAR_MAP_LOCAL_2, 1, EternaCityPokecenter1F_PokemonWillOpenUp CheckPoketchAppRegistered POKETCH_APPID_FRIENDSHIPCHECKER, VAR_RESULT GoToIfEq VAR_RESULT, FALSE, EternaCityPokecenter1F_GivePoketchAppFriendshipChecker GetFirstNonEggInParty VAR_0x8000 BufferPartyMonSpecies 0, VAR_0x8000 - Message EternaCityPokecenter1F_Text_WhatKindsOfPokemonAreWithYouOhYourPokemon + Message EternaCityPokecenter1F_Text_OhYourPokemon GetPartyMonFriendship VAR_RESULT, VAR_0x8000 GoToIfGe VAR_RESULT, 120, EternaCityPokecenter1F_ItSeemsToLikeYou - GoToIfGe VAR_RESULT, 70, EternaCityPokecenter1F_ItsBecomingComfortableAroundYouIThink - GoTo EternaCityPokecenter1F_HmmItNeedsToGetUsedToYouMore + GoToIfGe VAR_RESULT, 70, EternaCityPokecenter1F_ItsBecomingComfortable + GoTo EternaCityPokecenter1F_NeedsToGetUsedToYou End EternaCityPokecenter1F_GivePoketchAppFriendshipChecker: - Message EternaCityPokecenter1F_Text_ThisPoketchAppWillShowHowCloseYourPokemonFeelToYou + Message EternaCityPokecenter1F_Text_ShowHowClosePokemonFeel SetVar VAR_MAP_LOCAL_2, 1 SetVar VAR_0x8004, POKETCH_APPID_FRIENDSHIPCHECKER Common_GivePoketchApp @@ -66,8 +66,8 @@ EternaCityPokecenter1F_GivePoketchAppFriendshipChecker: ReleaseAll End -EternaCityPokecenter1F_IfYouSpendEnoughTimeWithThemAllPokemonWillOpenUpToYou: - Message EternaCityPokecenter1F_Text_IfYouSpendEnoughTimeWithThemAllPokemonWillOpenUpToYou +EternaCityPokecenter1F_PokemonWillOpenUp: + Message EternaCityPokecenter1F_Text_PokemonWillOpenUp WaitButton CloseMessage ReleaseAll @@ -80,15 +80,15 @@ EternaCityPokecenter1F_ItSeemsToLikeYou: ReleaseAll End -EternaCityPokecenter1F_ItsBecomingComfortableAroundYouIThink: - Message EternaCityPokecenter1F_Text_ItsBecomingComfortableAroundYouIThink +EternaCityPokecenter1F_ItsBecomingComfortable: + Message EternaCityPokecenter1F_Text_ItsBecomingComfortable WaitButton CloseMessage ReleaseAll End -EternaCityPokecenter1F_HmmItNeedsToGetUsedToYouMore: - Message EternaCityPokecenter1F_Text_HmmItNeedsToGetUsedToYouMore +EternaCityPokecenter1F_NeedsToGetUsedToYou: + Message EternaCityPokecenter1F_Text_NeedsToGetUsedToYou WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_eterna_city_pokecenter_2f.s b/res/field/scripts/scripts_eterna_city_pokecenter_2f.s index 7d7b971b51..02d57d95f9 100644 --- a/res/field/scripts/scripts_eterna_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_eterna_city_pokecenter_2f.s @@ -6,7 +6,7 @@ ScriptEntryEnd EternaCityPokecenter2F_SchoolKidM: - NPCMessage EternaCityPokecenter2F_Text_MultiBattlesAreTheUltimateInPulsePoundingAction + NPCMessage EternaCityPokecenter2F_Text_MultiBattlesAreUltimateAction End .balign 4, 0 diff --git a/res/field/scripts/scripts_eterna_city_pokecenter_b1f.s b/res/field/scripts/scripts_eterna_city_pokecenter_b1f.s index 85ecc2da58..b601d3e9cb 100644 --- a/res/field/scripts/scripts_eterna_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_eterna_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry EternaCityPokecenterB1F_UnusedEntry1 + ScriptEntry EternaCityPokecenterB1F_Dummy1 ScriptEntryEnd -EternaCityPokecenterB1F_UnusedEntry1: +EternaCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_eterna_city_south_house.s b/res/field/scripts/scripts_eterna_city_south_house.s index 82600469f7..bf48979306 100644 --- a/res/field/scripts/scripts_eterna_city_south_house.s +++ b/res/field/scripts/scripts_eterna_city_south_house.s @@ -16,17 +16,17 @@ EternaCitySouthHouse_ProfOak: GoToIfSet FLAG_ACTIVATED_ROAMING_LEGENDARY_BIRDS, EternaCitySouthHouse_TryReactivateRoamingLegendaryBirds GoToIfSet FLAG_RECEIVED_ETERNA_CITY_SOUTH_HOUSE_UPGRADE, EternaCitySouthHouse_PokedexRatingsCheckOak BufferPlayerName 0 - Message EternaCitySouthHouse_Text_HowIsYourPokedexComingAlong + Message EternaCitySouthHouse_Text_HowIsYourPokedex CloseMessage ApplyMovement LOCALID_PROF_OAK, EternaCitySouthHouse_Movement_EmoteExclamationMark WaitMovement - Message EternaCitySouthHouse_Text_AnAcquaintanceFromKantoHasSentSomethingQuiteInteresting + Message EternaCitySouthHouse_Text_AcquaintanceSentSomething SetVar VAR_0x8004, ITEM_UPGRADE SetVar VAR_0x8005, 1 GoToIfCannotFitItem VAR_0x8004, VAR_0x8005, VAR_RESULT, EternaCitySouthHouse_BagIsFull Common_GiveItemQuantity SetFlag FLAG_RECEIVED_ETERNA_CITY_SOUTH_HOUSE_UPGRADE - Message EternaCitySouthHouse_Text_IUnderstandThereIsAPokemonThatEvolvesWhenItIsTradedWhileHoldingThatUpGrade + Message EternaCitySouthHouse_Text_PokemonThatEvolvesTradingWithUpgrade GoTo EternaCitySouthHouse_ActivateRoamingLegendaryBirds End @@ -45,7 +45,7 @@ EternaCitySouthHouse_ActivateRoamingLegendaryBirds: ActivateRoamingPokemon ROAMING_SLOT_ZAPDOS ActivateRoamingPokemon ROAMING_SLOT_ARTICUNO SetFlag FLAG_ACTIVATED_ROAMING_LEGENDARY_BIRDS - Message EternaCitySouthHouse_Text_IveHeardThatThereHaveBeenSightingsOfArticunoZapdosAndMoltres + Message EternaCitySouthHouse_Text_SightingsOfLegendaryBirds GoTo EternaCitySouthHouse_ProfOakEnd End @@ -53,7 +53,7 @@ EternaCitySouthHouse_TryReactivateRoamingLegendaryBirds: CallIfEq VAR_ROAMING_MOLTRES_STATE, ROAMER_STATE_RESET, EternaCitySouthHouse_ReactivateRoamingMoltres CallIfEq VAR_ROAMING_ZAPDOS_STATE, ROAMER_STATE_RESET, EternaCitySouthHouse_ReactivateRoamingZapdos CallIfEq VAR_ROAMING_ARTICUNO_STATE, ROAMER_STATE_RESET, EternaCitySouthHouse_ReactivateRoamingArticuno - Message EternaCitySouthHouse_Text_ArticunoZapdosAndMoltresAreExtremelyRareEvenInKanto + Message EternaCitySouthHouse_Text_LegendaryBirdsExtremelyRare GoTo EternaCitySouthHouse_ProfOakEnd End @@ -73,7 +73,7 @@ EternaCitySouthHouse_ReactivateRoamingArticuno: Return EternaCitySouthHouse_CaughtAllRoamingLegendaryBirds: - Message EternaCitySouthHouse_Text_YouveCaughtArticunoZapdosAndMoltresAllowMeToExamineYourPokedex + Message EternaCitySouthHouse_Text_YouveCaughtLegendaryBirds SetFlag FLAG_CAUGHT_ROAMING_LEGENDARY_BIRDS CallCommonScript 0x26E1 End diff --git a/res/field/scripts/scripts_eterna_city_underground_man_house.s b/res/field/scripts/scripts_eterna_city_underground_man_house.s index f00619c0f5..ef95dd575a 100644 --- a/res/field/scripts/scripts_eterna_city_underground_man_house.s +++ b/res/field/scripts/scripts_eterna_city_underground_man_house.s @@ -10,7 +10,7 @@ ScriptEntry EternaCityUndergroundManHouse_UndergroundMan ScriptEntry EternaCityUndergroundManHouse_Youngster ScriptEntry EternaCityUndergroundManHouse_ScientistM - ScriptEntry EternaCityUndergroundManHouse_Sign + ScriptEntry EternaCityUndergroundManHouse_BgSign ScriptEntry EternaCityUndergroundManHouse_PC ScriptEntry EternaCityUndergroundManHouse_BugCatcher ScriptEntryEnd @@ -19,44 +19,44 @@ EternaCityUndergroundManHouse_UndergroundMan: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfGe VAR_CURRENT_UNDERGROUND_MISSION, 9, EternaCityUndergroundManHouse_FromNowOnYouAreTheSpelunkingMaster + GoToIfGe VAR_CURRENT_UNDERGROUND_MISSION, 9, EternaCityUndergroundManHouse_YouAreSpelunkingMaster GoToIfSet FLAG_ACCEPTED_UNDERGROUND_MAN_AS_MENTOR, EternaCityUndergroundManHouse_GoToCurrentMission - GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, EternaCityUndergroundManHouse_LetMeMentorYouAsYouBecomeAFullFledgedSpelunker - Message EternaCityUndergroundManHouse_Text_YouCanCallMeTheUndergroundManIllMakeAGiftOfThisToYou + GoToIfSet FLAG_EXPLORER_KIT_RECEIVED, EternaCityUndergroundManHouse_LetMeMentorYou + Message EternaCityUndergroundManHouse_Text_CallMeUndergroundMan SetVar VAR_0x8004, ITEM_EXPLORER_KIT SetVar VAR_0x8005, 1 Common_GiveItemQuantity SetFlag FLAG_EXPLORER_KIT_RECEIVED ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_LetMeMentorYouIntoBecomingAFullFledgedSpelunker + Message EternaCityUndergroundManHouse_Text_MentorYouBecomingSpelunker ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, EternaCityUndergroundManHouse_ICantForceYouToAcceptMyProposalIfYoureNotInclined + GoToIfEq VAR_RESULT, MENU_NO, EternaCityUndergroundManHouse_CantForceAcceptProposal SetFlag FLAG_ACCEPTED_UNDERGROUND_MAN_AS_MENTOR GoTo EternaCityUndergroundManHouse_GoToCurrentMission -EternaCityUndergroundManHouse_LetMeMentorYouAsYouBecomeAFullFledgedSpelunker: - Message EternaCityUndergroundManHouse_Text_LetMeMentorYouAsYouBecomeAFullFledgedSpelunker +EternaCityUndergroundManHouse_LetMeMentorYou: + Message EternaCityUndergroundManHouse_Text_MentorYouBecomeSpelunker ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, EternaCityUndergroundManHouse_ICantForceYouToAcceptMyProposalIfYoureNotInclined + GoToIfEq VAR_RESULT, MENU_NO, EternaCityUndergroundManHouse_CantForceAcceptProposal SetFlag FLAG_ACCEPTED_UNDERGROUND_MAN_AS_MENTOR GoTo EternaCityUndergroundManHouse_GoToCurrentMission -EternaCityUndergroundManHouse_ICantForceYouToAcceptMyProposalIfYoureNotInclined: - Message EternaCityUndergroundManHouse_Text_ICantForceYouToAcceptMyProposalIfYoureNotInclined +EternaCityUndergroundManHouse_CantForceAcceptProposal: + Message EternaCityUndergroundManHouse_Text_CantForceAcceptProposal WaitButton CloseMessage ReleaseAll End -EternaCityUndergroundManHouse_SoMySpelunkerAreYouGoingUndergroundWithYourFriends: - Message EternaCityUndergroundManHouse_Text_SoMySpelunkerAreYouGoingUndergroundWithYourFriends +EternaCityUndergroundManHouse_AreYouGoingUnderground: + Message EternaCityUndergroundManHouse_Text_AreYouGoingUnderground WaitButton CloseMessage ReleaseAll End -EternaCityUndergroundManHouse_FromNowOnYouAreTheSpelunkingMaster: - Message EternaCityUndergroundManHouse_Text_FromNowOnYouAreTheSpelunkingMaster +EternaCityUndergroundManHouse_YouAreSpelunkingMaster: + Message EternaCityUndergroundManHouse_Text_YouAreSpelunkingMaster WaitButton CloseMessage ReleaseAll @@ -64,7 +64,7 @@ EternaCityUndergroundManHouse_FromNowOnYouAreTheSpelunkingMaster: EternaCityUndergroundManHouse_StartMissionGoUnderground: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_IWillTeachYouByAssigningMissionsFirstGoUnderground + Message EternaCityUndergroundManHouse_Text_FirstGoUnderground WaitButton CloseMessage ReleaseAll @@ -72,7 +72,7 @@ EternaCityUndergroundManHouse_StartMissionGoUnderground: EternaCityUndergroundManHouse_StartMissionDigUpTreasureOrSpheres: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_ForMyNextTestIWantYouToDigUpSomeTreasureOrSpheresForMe + Message EternaCityUndergroundManHouse_Text_DigUpTreasureOrSpheres WaitButton CloseMessage ReleaseAll @@ -80,7 +80,7 @@ EternaCityUndergroundManHouse_StartMissionDigUpTreasureOrSpheres: EternaCityUndergroundManHouse_StartMissionBurySpheres: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_IWantYouToGoBuryTheseStrangeSpheresInTheUnderground + Message EternaCityUndergroundManHouse_Text_BuryTheseSpheres WaitButton CloseMessage ReleaseAll @@ -88,7 +88,7 @@ EternaCityUndergroundManHouse_StartMissionBurySpheres: EternaCityUndergroundManHouse_StartMissionMakeASecretBase: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_YourNextAssignmentIsGoMakeYourOwnSecretBase + Message EternaCityUndergroundManHouse_Text_GoMakeSecretBase WaitButton CloseMessage ReleaseAll @@ -96,7 +96,7 @@ EternaCityUndergroundManHouse_StartMissionMakeASecretBase: EternaCityUndergroundManHouse_StartMissionDecorateASecretBase: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_ForMyFinalTestIWantYouToDecorateYourSecretBase + Message EternaCityUndergroundManHouse_Text_DecorateSecretBase WaitButton CloseMessage ReleaseAll @@ -104,52 +104,52 @@ EternaCityUndergroundManHouse_StartMissionDecorateASecretBase: EternaCityUndergroundManHouse_StartMissionStealAFlag: SetFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_IfYouInsistThereIsOneMoreThingIShouldTellYou + Message EternaCityUndergroundManHouse_Text_OneMoreThing CloseMessage Call EternaCityUndergroundManHouse_UndergroundManWalkAround - Message EternaCityUndergroundManHouse_Text_StealYourFriendsFlagIfYouCanDoThatIWillPermitYouToMoveBoulders + Message EternaCityUndergroundManHouse_Text_StealYourFriendsFlag WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionGoUnderground: - Message EternaCityUndergroundManHouse_Text_ToGetDownToTheUndergroundTunnelsYouNeedOnlyToUseYourExplorerKit + Message EternaCityUndergroundManHouse_Text_UseExplorerKit WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionDigUpTreasureOrSpheres: - Message EternaCityUndergroundManHouse_Text_YouveNotLocatedAnyTreasureOrSpheresYet + Message EternaCityUndergroundManHouse_Text_CheckRadarYellowSpots WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionBurySpheres: - Message EternaCityUndergroundManHouse_Text_YouveNotBuriedTheSpheresYet + Message EternaCityUndergroundManHouse_Text_GoBuryThoseSpheres WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionMakeASecretBase: - Message EternaCityUndergroundManHouse_Text_HmYouDontKnowHowToUseTheDiggerDrill + Message EternaCityUndergroundManHouse_Text_ExplainDiggerDrill WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionDecorateYourSecretBase: - Message EternaCityUndergroundManHouse_Text_AhHaveIFinallyManagedToStumpYou + Message EternaCityUndergroundManHouse_Text_FinallyStumpedYou WaitButton CloseMessage ReleaseAll End EternaCityUndergroundManHouse_DidNotYetCompleteMissionStealAFlag: - Message EternaCityUndergroundManHouse_Text_IfYouManageToStealAFlagYouBeSureToComeShowMe + Message EternaCityUndergroundManHouse_Text_IfYouStealFlagShowMe WaitButton CloseMessage ReleaseAll @@ -165,14 +165,14 @@ EternaCityUndergroundManHouse_GoToCurrentMission: GoToIfEq VAR_CURRENT_UNDERGROUND_MISSION, 6, EternaCityUndergroundManHouse_MissionStealThreeFlags GoToIfEq VAR_CURRENT_UNDERGROUND_MISSION, 7, EternaCityUndergroundManHouse_MissionStealTenFlags GoToIfEq VAR_CURRENT_UNDERGROUND_MISSION, 8, EternaCityUndergroundManHouse_MissionStealFiftyFlags - GoTo EternaCityUndergroundManHouse_FromNowOnYouAreTheSpelunkingMaster + GoTo EternaCityUndergroundManHouse_YouAreSpelunkingMaster EternaCityUndergroundManHouse_MissionGoUnderground: GoToIfUnset FLAG_HAS_ACTIVE_UNDERGROUND_MISSION, EternaCityUndergroundManHouse_StartMissionGoUnderground GoToIfUnset FLAG_ENTERED_UNDERGROUND, EternaCityUndergroundManHouse_DidNotYetCompleteMissionGoUnderground SetVar VAR_CURRENT_UNDERGROUND_MISSION, 1 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_ISeeThatYouveGoneDownToTheUndergroundTunnelsTakeTheseAsRewards + Message EternaCityUndergroundManHouse_Text_YouveGoneDownToUnderground SetVar VAR_0x8004, TRAP_MOVE_UP SetVar VAR_0x8005, 1 Common_ObtainUndergroundTrap @@ -193,7 +193,7 @@ EternaCityUndergroundManHouse_MissionDigUpTreasureOrSpheres: GoToIfUnset FLAG_DIGGING_FOR_FOSSILS, EternaCityUndergroundManHouse_DidNotYetCompleteMissionDigUpTreasureOrSpheres SetVar VAR_CURRENT_UNDERGROUND_MISSION, 2 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_YouDugUpWhatIWasLookingForTakeTheseAsYourReward + Message EternaCityUndergroundManHouse_Text_YouDugUpWhatIWasLookingFor SetVar VAR_0x8004, SPHERE_PRISM SetVar VAR_0x8005, 1 Common_ObtainUndergroundSphere @@ -203,7 +203,7 @@ EternaCityUndergroundManHouse_MissionDigUpTreasureOrSpheres: SetVar VAR_0x8004, SPHERE_BLUE SetVar VAR_0x8005, 1 Common_ObtainUndergroundSphere - Message EternaCityUndergroundManHouse_Text_DigInTheWallsOfTheUndergroundTunnelsToUnearthHiddenStuff + Message EternaCityUndergroundManHouse_Text_DigInWalls WaitButton CloseMessage ReleaseAll @@ -214,11 +214,11 @@ EternaCityUndergroundManHouse_MissionBurySpheres: GoToIfUnset FLAG_SPHERE_ACQUIRED, EternaCityUndergroundManHouse_DidNotYetCompleteMissionBurySpheres SetVar VAR_CURRENT_UNDERGROUND_MISSION, 3 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_YouveBuriedYourSpheresThisIsYourReward + Message EternaCityUndergroundManHouse_Text_YouveBuriedSpheres SetVar VAR_0x8004, TRAP_DIGGER_DRILL SetVar VAR_0x8005, 1 Common_ObtainUndergroundTrap - Message EternaCityUndergroundManHouse_Text_YouMayHaveSeenThemAlreadyButTheseAreSphereCollectors + Message EternaCityUndergroundManHouse_Text_TheseAreSphereCollectors WaitButton CloseMessage ReleaseAll @@ -229,7 +229,7 @@ EternaCityUndergroundManHouse_MissionMakeASecretBase: GoToIfUnset FLAG_CREATED_SECRET_BASE, EternaCityUndergroundManHouse_DidNotYetCompleteMissionMakeASecretBase SetVar VAR_CURRENT_UNDERGROUND_MISSION, 4 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION - Message EternaCityUndergroundManHouse_Text_AhYouveMadeYourSecretBaseTakeTheseAsYourReward + Message EternaCityUndergroundManHouse_Text_YouveMadeSecretBase SetVar VAR_0x8004, UG_GOOD_PLAIN_TABLE SetVar VAR_0x8005, 1 Common_SendToUndergroundPCWithLinefeed @@ -242,7 +242,7 @@ EternaCityUndergroundManHouse_MissionMakeASecretBase: SetVar VAR_0x8004, UG_GOOD_BUNEARY_DOLL SetVar VAR_0x8005, 1 Common_SendToUndergroundPCWithLinefeed - Message EternaCityUndergroundManHouse_Text_IncidentallyADiggerDrillCanBeUsedOnlyOnce + Message EternaCityUndergroundManHouse_Text_DiggerDrillUsedOnlyOnce WaitButton CloseMessage ReleaseAll @@ -254,9 +254,9 @@ EternaCityUndergroundManHouse_MissionDecorateYourSecretBase: SetVar VAR_CURRENT_UNDERGROUND_MISSION, 5 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION ClearFlag FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD - Message EternaCityUndergroundManHouse_Text_AhYouveEvenManagedToDecorateYourSecretBaseThisIsYourReward + Message EternaCityUndergroundManHouse_Text_YouveDecoratedSecretBase Call EternaCityUndergroundManHouse_SendStarterDollToUndergroundPC - Message EternaCityUndergroundManHouse_Text_ThereAreWaysOfCollectingMoreDecorationGoods + Message EternaCityUndergroundManHouse_Text_WaysOfCollectingMoreGoods WaitButton CloseMessage ReleaseAll @@ -290,7 +290,7 @@ EternaCityUndergroundManHouse_MissionStealAFlag: GoToIfUnset FLAG_HAS_ACTIVE_UNDERGROUND_MISSION, EternaCityUndergroundManHouse_StartMissionStealAFlag GoToIfUnset FLAG_DELIVERED_STOLEN_FLAG, EternaCityUndergroundManHouse_DidNotYetCompleteMissionStealAFlag CallIfSet FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_HmThisBelongsToYou - CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_YouveCapturedAFlagThisIsYourReward + CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_CapturedAFlagReward SetVar VAR_0x8004, UG_GOOD_PRETTY_GEM SetVar VAR_0x8005, 1 CheckHasRoomForGoodsInPC VAR_0x8004, VAR_0x8005, VAR_RESULT @@ -299,21 +299,21 @@ EternaCityUndergroundManHouse_MissionStealAFlag: SetVar VAR_CURRENT_UNDERGROUND_MISSION, 6 ClearFlag FLAG_HAS_ACTIVE_UNDERGROUND_MISSION ClearFlag FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD - Message EternaCityUndergroundManHouse_Text_ThereReallyIsNothingElseThatICanTeachYou + Message EternaCityUndergroundManHouse_Text_NothingElseICanTeachYou WaitButton CloseMessage ReleaseAll End -EternaCityUndergroundManHouse_YouveCapturedAFlagThisIsYourReward: - Message EternaCityUndergroundManHouse_Text_YouveCapturedAFlagThisIsYourReward +EternaCityUndergroundManHouse_CapturedAFlagReward: + Message EternaCityUndergroundManHouse_Text_CapturedAFlagReward Return EternaCityUndergroundManHouse_MissionStealThreeFlags: GetCapturedFlagCount VAR_RESULT - GoToIfLt VAR_RESULT, 3, EternaCityUndergroundManHouse_SoMySpelunkerAreYouGoingUndergroundWithYourFriends + GoToIfLt VAR_RESULT, 3, EternaCityUndergroundManHouse_AreYouGoingUnderground CallIfSet FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_HmThisBelongsToYou - CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_AhYouveCapturedThreeFlagsTakeThisAsYourReward + CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_CapturedThreeFlagsReward SetVar VAR_0x8004, UG_GOOD_SHINY_GEM SetVar VAR_0x8005, 1 CheckHasRoomForGoodsInPC VAR_0x8004, VAR_0x8005, VAR_RESULT @@ -325,15 +325,15 @@ EternaCityUndergroundManHouse_MissionStealThreeFlags: ReleaseAll End -EternaCityUndergroundManHouse_AhYouveCapturedThreeFlagsTakeThisAsYourReward: - Message EternaCityUndergroundManHouse_Text_AhYouveCapturedThreeFlagsTakeThisAsYourReward +EternaCityUndergroundManHouse_CapturedThreeFlagsReward: + Message EternaCityUndergroundManHouse_Text_CapturedThreeFlagsReward Return EternaCityUndergroundManHouse_MissionStealTenFlags: GetCapturedFlagCount VAR_RESULT - GoToIfLt VAR_RESULT, 10, EternaCityUndergroundManHouse_SoMySpelunkerAreYouGoingUndergroundWithYourFriends + GoToIfLt VAR_RESULT, 10, EternaCityUndergroundManHouse_AreYouGoingUnderground CallIfSet FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_HmThisBelongsToYou - CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_AhYouveCapturedTenFlagsTakeThisAsYourReward + CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_CapturedTenFlagsReward SetVar VAR_0x8004, UG_GOOD_MYSTIC_GEM SetVar VAR_0x8005, 1 CheckHasRoomForGoodsInPC VAR_0x8004, VAR_0x8005, VAR_RESULT @@ -345,15 +345,15 @@ EternaCityUndergroundManHouse_MissionStealTenFlags: ReleaseAll End -EternaCityUndergroundManHouse_AhYouveCapturedTenFlagsTakeThisAsYourReward: - Message EternaCityUndergroundManHouse_Text_AhYouveCapturedTenFlagsTakeThisAsYourReward +EternaCityUndergroundManHouse_CapturedTenFlagsReward: + Message EternaCityUndergroundManHouse_Text_CapturedTenFlagsReward Return EternaCityUndergroundManHouse_MissionStealFiftyFlags: GetCapturedFlagCount VAR_RESULT - GoToIfLt VAR_RESULT, 50, EternaCityUndergroundManHouse_SoMySpelunkerAreYouGoingUndergroundWithYourFriends + GoToIfLt VAR_RESULT, 50, EternaCityUndergroundManHouse_AreYouGoingUnderground CallIfSet FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_HmThisBelongsToYou - CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_MyGoodnessYouveCapturedFiftyFlagsTakeThisAsYourReward + CallIfUnset FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD, EternaCityUndergroundManHouse_CapturedFiftyFlagsReward SetVar VAR_0x8004, UG_GOOD_GLITTER_GEM SetVar VAR_0x8005, 1 CheckHasRoomForGoodsInPC VAR_0x8004, VAR_0x8005, VAR_RESULT @@ -365,13 +365,13 @@ EternaCityUndergroundManHouse_MissionStealFiftyFlags: ReleaseAll End -EternaCityUndergroundManHouse_MyGoodnessYouveCapturedFiftyFlagsTakeThisAsYourReward: - Message EternaCityUndergroundManHouse_Text_MyGoodnessYouveCapturedFiftyFlagsTakeThisAsYourReward +EternaCityUndergroundManHouse_CapturedFiftyFlagsReward: + Message EternaCityUndergroundManHouse_Text_CapturedFiftyFlagsReward Return EternaCityUndergroundManHouse_UndergroundPCIsFull: SetFlag FLAG_UNDERGROUND_MAN_COULDNT_GIVE_REWARD - Message EternaCityUndergroundManHouse_Text_OhYourUndergroundPCAppearsToBeFull + Message EternaCityUndergroundManHouse_Text_UndergroundPCAppearsFull WaitButton CloseMessage ReleaseAll @@ -441,14 +441,14 @@ EternaCityUndergroundManHouse_Movement_UndergroundManWalkAroundFaceSouth: EndMovement EternaCityUndergroundManHouse_Youngster: - NPCMessage EternaCityUndergroundManHouse_Text_TheUndergroundTunnelsGoEverywhere + NPCMessage EternaCityUndergroundManHouse_Text_TunnelsGoEverywhere End EternaCityUndergroundManHouse_ScientistM: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_TALKED_TO_UNDERGROUND_MAN_HOUSE_SCIENTIST_M, EternaCityUndergroundManHouse_OhYoudLikeMoreAdviceOnDiggingUpTreasureAndSpheres + GoToIfSet FLAG_TALKED_TO_UNDERGROUND_MAN_HOUSE_SCIENTIST_M, EternaCityUndergroundManHouse_YoudLikeMoreAdvice SetFlag FLAG_TALKED_TO_UNDERGROUND_MAN_HOUSE_SCIENTIST_M Message EternaCityUndergroundManHouse_Text_LetsDigUpSomeTreasure WaitButton @@ -456,26 +456,26 @@ EternaCityUndergroundManHouse_ScientistM: ReleaseAll End -EternaCityUndergroundManHouse_OhYoudLikeMoreAdviceOnDiggingUpTreasureAndSpheres: - Message EternaCityUndergroundManHouse_Text_OhYoudLikeMoreAdviceOnDiggingUpTreasureAndSpheres +EternaCityUndergroundManHouse_YoudLikeMoreAdvice: + Message EternaCityUndergroundManHouse_Text_YoudLikeMoreAdvice WaitButton CloseMessage ReleaseAll End -EternaCityUndergroundManHouse_Sign: - EventMessage EternaCityUndergroundManHouse_Text_NewAndOnSaleUndergroundRadar +EternaCityUndergroundManHouse_BgSign: + EventMessage EternaCityUndergroundManHouse_Text_OnSaleUndergroundRadar End EternaCityUndergroundManHouse_PC: PlaySE SEQ_SE_CONFIRM LockAll - Message EternaCityUndergroundManHouse_Text_ShortcutToTheUndergroundIsOnTheScreen + Message EternaCityUndergroundManHouse_Text_ShortcutToTheUnderground GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End EternaCityUndergroundManHouse_PCHeadingsMenu: - Message EternaCityUndergroundManHouse_Text_WhichHeadingWouldYouLikeToRead + Message EternaCityUndergroundManHouse_Text_ReadWhichHeading InitGlobalTextMenu 1, 1, 0, VAR_RESULT AddMenuEntryImm MenuEntries_Text_UndergroundManHousePCHeading_Flags, 0 AddMenuEntryImm MenuEntries_Text_UndergroundManHousePCHeading_Spheres, 1 @@ -494,27 +494,27 @@ EternaCityUndergroundManHouse_PCHeadingsMenu: End EternaCityUndergroundManHouse_PCHeadingFlags: - Message EternaCityUndergroundManHouse_Text_AFlagCanBeFoundInEverySecretBase + Message EternaCityUndergroundManHouse_Text_ExplainFlags GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End EternaCityUndergroundManHouse_PCHeadingSpheres: - Message EternaCityUndergroundManHouse_Text_InTheUndergroundTunnelsYouCanDigUpPrettyStonesThatAreCalledSpheres + Message EternaCityUndergroundManHouse_Text_ExplainSpheres GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End EternaCityUndergroundManHouse_PCHeadingTraps: - Message EternaCityUndergroundManHouse_Text_ThereAreTrapsThatCanBePutDownInTheUndergroundTunnels + Message EternaCityUndergroundManHouse_Text_ExplainTraps GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End EternaCityUndergroundManHouse_PCHeadingGoods: - Message EternaCityUndergroundManHouse_Text_GoodsAreFurnitureAndDecorativeItemsForSecretBases + Message EternaCityUndergroundManHouse_Text_ExplainGoods GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End EternaCityUndergroundManHouse_PCHeadingTreasures: - Message EternaCityUndergroundManHouse_Text_TreasuresAreRareItemsThatAppearWhileDiggingUnderground + Message EternaCityUndergroundManHouse_Text_ExplainTreasures GoTo EternaCityUndergroundManHouse_PCHeadingsMenu End @@ -524,7 +524,7 @@ EternaCityUndergroundManHouse_PCEnd: End EternaCityUndergroundManHouse_BugCatcher: - NPCMessage EternaCityUndergroundManHouse_Text_AllIEverUnearthAreArmorFossils + NPCMessage EternaCityUndergroundManHouse_Text_AllIUnearthAreArmorFossils End .balign 4, 0 diff --git a/res/field/scripts/scripts_eterna_forest.s b/res/field/scripts/scripts_eterna_forest.s index d639a2fdff..feb1bf4ba4 100644 --- a/res/field/scripts/scripts_eterna_forest.s +++ b/res/field/scripts/scripts_eterna_forest.s @@ -2,18 +2,18 @@ #include "res/text/bank/eterna_forest.h" #include "res/field/events/events_eterna_forest.h" - ScriptEntry EternaForest_TriggerStartFollowingCheryl - ScriptEntry EternaForest_TriggerPlayerLeaveCheryl - ScriptEntry EternaForest_TriggerCherylLeavePlayer - ScriptEntry EternaForest_Unused4 - ScriptEntry EternaForest_Unused5 + ScriptEntry EternaForest_CoordEvent_CherylStartFollowing + ScriptEntry EternaForest_CoordEvent_PlayerLeaveCheryl + ScriptEntry EternaForest_CoordEvent_CherylLeavePlayer + ScriptEntry EternaForest_Dummy4 + ScriptEntry EternaForest_Dummy5 ScriptEntry EternaForest_BugCatcher ScriptEntry EternaForest_Gardenia - ScriptEntry EternaForest_LandmarkSignEternaForest + ScriptEntry EternaForest_SignboardEternaForest ScriptEntry EternaForest_TrainerTipsSignpost ScriptEntry EternaForest_MossRock ScriptEntry EternaForest_OnTransition - ScriptEntry EternaForest_OnFrameCherylOldChateauCutscene + ScriptEntry EternaForest_OnFrame_CherylOldChateauCutscene ScriptEntryEnd EternaForest_OnTransition: @@ -24,7 +24,7 @@ EternaForest_ResetFollowerCherylState: SetVar VAR_ETERNA_FOREST_FOLLOWER_CHERYL_STATE, 0 End -EternaForest_TriggerStartFollowingCheryl: +EternaForest_CoordEvent_CherylStartFollowing: LockAll SetPlayerBike FALSE GetPlayerMapPos VAR_0x8004, VAR_0x8005 @@ -35,23 +35,23 @@ EternaForest_TriggerStartFollowingCheryl: EternaForest_CherylNoticeAndWalkToPlayerX28: ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylNoticeAndWalkToPlayerX28 WaitMovement - GoTo EternaForest_StartFollowingCheryl + GoTo EternaForest_CherylStartFollowing EternaForest_CherylNoticeAndWalkToPlayerX29: ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylNoticeAndWalkToPlayerX29 WaitMovement - GoTo EternaForest_StartFollowingCheryl + GoTo EternaForest_CherylStartFollowing -EternaForest_StartFollowingCheryl: - CallIfUnset FLAG_TALKED_TO_ETERNA_FOREST_CHERYL, EternaForest_PleaseMayIGoThroughWithYou - CallIfSet FLAG_TALKED_TO_ETERNA_FOREST_CHERYL, EternaForest_LetsGetThroughThisForestTogether +EternaForest_CherylStartFollowing: + CallIfUnset FLAG_TALKED_TO_ETERNA_FOREST_CHERYL, EternaForest_MayIGoWithYou + CallIfSet FLAG_TALKED_TO_ETERNA_FOREST_CHERYL, EternaForest_LetsGetThroughForestTogether BufferPlayerName 0 PlayFanfare SEQ_GONIN Message EternaForest_Text_PlayerDecidedToGoWithCheryl WaitFanfare SetFlag FLAG_TALKED_TO_ETERNA_FOREST_CHERYL SetVar VAR_ETERNA_FOREST_FOLLOWER_CHERYL_STATE, 1 - Message EternaForest_Text_IllKeepYourPokemonInPerfectHealth + Message EternaForest_Text_IllKeepPokemonHealthy WaitButton CloseMessage SetVar VAR_PARTNER_TRAINER_ID, TRAINER_CHERYL_ETERNA_FOREST @@ -61,14 +61,14 @@ EternaForest_StartFollowingCheryl: ReleaseAll End -EternaForest_PleaseMayIGoThroughWithYou: +EternaForest_MayIGoWithYou: BufferPlayerName 0 - Message EternaForest_Text_PleaseMayIGoThroughWithYou + Message EternaForest_Text_MayIGoWithYou Return -EternaForest_LetsGetThroughThisForestTogether: +EternaForest_LetsGetThroughForestTogether: BufferPlayerName 0 - Message EternaForest_Text_LetsGetThroughThisForestTogether + Message EternaForest_Text_LetsGetThroughForestTogether Return .balign 4, 0 @@ -85,7 +85,7 @@ EternaForest_Movement_CherylNoticeAndWalkToPlayerX29: WalkOnSpotNormalSouth EndMovement -EternaForest_TriggerPlayerLeaveCheryl: +EternaForest_CoordEvent_PlayerLeaveCheryl: LockAll ClearHasPartner SetMovementType LOCALID_CHERYL, MOVEMENT_TYPE_LOOK_SOUTH @@ -132,13 +132,13 @@ EternaForest_Movement_CherylWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -EternaForest_TriggerCherylLeavePlayer: +EternaForest_CoordEvent_CherylLeavePlayer: LockAll ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylExclamationMark ApplyMovement LOCALID_PLAYER, EternaForest_Movement_PlayerWalkOnSpotWest WaitMovement BufferPlayerName 0 - Message EternaForest_Text_OhTheresTheExitThankYouSoMuchPlayer + Message EternaForest_Text_ThankYouSoMuch SetVar VAR_0x8004, ITEM_SOOTHE_BELL SetVar VAR_0x8005, 1 GoToIfCannotFitItem VAR_0x8004, VAR_0x8005, VAR_RESULT, EternaForest_CherylWalkToExit @@ -146,7 +146,7 @@ EternaForest_TriggerCherylLeavePlayer: End EternaForest_GiveSootheBell: - Message EternaForest_Text_ThisIsMyTokenOfAppreciation + Message EternaForest_Text_TokenOfAppreciation Common_GiveItemQuantityNoLineFeed GoTo EternaForest_CherylWalkToExit End @@ -201,7 +201,7 @@ EternaForest_CherylWalkToExitX39: EternaForest_CherylLeave: ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylWalkOnSpotWest WaitMovement - Message EternaForest_Text_ImSureWellMeetAgainSomewhere + Message EternaForest_Text_ImSureWellMeetAgain CloseMessage ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylLeave WaitMovement @@ -321,33 +321,33 @@ EternaForest_Movement_PlayerWatchCherylWalkToExitX39: WalkOnSpotNormalEast EndMovement -EternaForest_Unused4: +EternaForest_Dummy4: LockAll BufferPlayerName 0 ReleaseAll End -EternaForest_Unused5: +EternaForest_Dummy5: LockAll BufferPlayerName 0 ReleaseAll End EternaForest_BugCatcher: - NPCMessage EternaForest_Text_ImSearchingForBugPokemonSoICanWinAtTheEternaGym + NPCMessage EternaForest_Text_ImSearchingForBugPokemon End EternaForest_Gardenia: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - Message EternaForest_Text_HiyaWereYouIngriguedByTheRumorsGoingAroundToo + Message EternaForest_Text_WereYouIngriguedByRumors CloseMessage ApplyMovement LOCALID_GARDENIA, EternaForest_Movement_GardeniaWalkOnSpotNorth WaitMovement - Message EternaForest_Text_YouKnowPeopleveBeenTalkingAboutTheGhostPokemonOfTheOldChateau + Message EternaForest_Text_GhostPokemonOfOldChateau FacePlayer - Message EternaForest_Text_IShouldCheckItOutMyselfButGoingInThereIs + Message EternaForest_Text_GoodLuckWithInvestigation CloseMessage GetPlayerDir VAR_RESULT GoToIfEq VAR_RESULT, DIR_NORTH, EternaForest_GardeniaLeaveNorth @@ -403,24 +403,24 @@ EternaForest_Movement_GardeniaLeaveNorth: WalkNormalEast 10 EndMovement -EternaForest_LandmarkSignEternaForest: - ShowLandmarkSign EternaForest_Text_TheEternaForestWhereTimeFlowsEternally +EternaForest_SignboardEternaForest: + ShowLandmarkSign EternaForest_Text_SignEternaForest End EternaForest_TrainerTipsSignpost: - ShowScrollingSign EternaForest_Text_TrainerTipsInForestsAndCavesThereAreManyItemsOnTheGround + ShowScrollingSign EternaForest_Text_TrainerTipsItemsOnGround End EternaForest_MossRock: - EventMessage EternaForest_Text_TheRockIsCoveredInMoss + EventMessage EternaForest_Text_RockIsCoveredInMoss End -EternaForest_OnFrameCherylOldChateauCutscene: +EternaForest_OnFrame_CherylOldChateauCutscene: LockAll SetVar VAR_ETERNA_FOREST_CHERYL_OLD_CHATEAU_CUTSCENE_STATE, 2 ApplyMovement LOCALID_CHERYL, EternaForest_Movement_CherylWalkOnSpotNorth WaitMovement - Message EternaForest_Text_ThereIsAnOldChateauAhead + Message EternaForest_Text_OldChateauAhead WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_eterna_forest_outside.s b/res/field/scripts/scripts_eterna_forest_outside.s index f1ed462af0..79c20a86d5 100644 --- a/res/field/scripts/scripts_eterna_forest_outside.s +++ b/res/field/scripts/scripts_eterna_forest_outside.s @@ -3,8 +3,8 @@ ScriptEntry EternaForestOutside_OnTransition - ScriptEntry EternaForestOutside_Unused2 - ScriptEntry EternaForestOutside_Unused3 + ScriptEntry EternaForestOutside_Dummy2 + ScriptEntry EternaForestOutside_Dummy3 ScriptEntry EternaForestOutside_PokemonBreederF ScriptEntryEnd @@ -16,10 +16,10 @@ EternaForestOutside_PokemonBreederF: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_OBTAINED_ETERNA_FOREST_OUTSIDE_ACCESSORY_BIG_TREE, EternaForestOutside_ICollectBerriesAndTradeThemForAccessoriesInFloaromaTown + GoToIfSet FLAG_OBTAINED_ETERNA_FOREST_OUTSIDE_ACCESSORY_BIG_TREE, EternaForestOutside_ITradeBerriesForAccessories SetVar VAR_0x8004, ACCESSORY_BIG_TREE BufferAccessoryName 0, VAR_0x8004 - Message EternaForestOutside_Text_OhAreYouCollectingAccessoriesIveGotSomethingForYou + Message EternaForestOutside_Text_AreYouCollectingAccessories SetVar VAR_0x8005, 1 Common_GiveAccessoryWaitForConfirm SetFlag FLAG_OBTAINED_ETERNA_FOREST_OUTSIDE_ACCESSORY_BIG_TREE @@ -27,17 +27,17 @@ EternaForestOutside_PokemonBreederF: ReleaseAll End -EternaForestOutside_ICollectBerriesAndTradeThemForAccessoriesInFloaromaTown: - Message EternaForestOutside_Text_ICollectBerriesAndTradeThemForAccessoriesInFloaromaTown +EternaForestOutside_ITradeBerriesForAccessories: + Message EternaForestOutside_Text_ITradeBerriesForAccessories WaitButton CloseMessage ReleaseAll End -EternaForestOutside_Unused2: +EternaForestOutside_Dummy2: ShowLandmarkSign EternaForestOutside_Text_Dummy2 End -EternaForestOutside_Unused3: +EternaForestOutside_Dummy3: ShowScrollingSign EternaForestOutside_Text_Dummy3 End diff --git a/res/field/scripts/scripts_field_moves.s b/res/field/scripts/scripts_field_moves.s index 0a577a3c06..4d65395885 100644 --- a/res/field/scripts/scripts_field_moves.s +++ b/res/field/scripts/scripts_field_moves.s @@ -9,7 +9,7 @@ ScriptEntry FieldMoves_Water ScriptEntry FieldMoves_Fog_Unused ScriptEntry FieldMoves_Waterfall - ScriptEntry FieldMoves_Dummy + ScriptEntry FieldMoves_Dummy8 ScriptEntry FieldMoves_UseCutFromMenu ScriptEntry FieldMoves_UseRockSmashFromMenu ScriptEntry FieldMoves_UseStrengthFromMenu @@ -25,41 +25,41 @@ FieldMoves_CutTree: LockAll FacePlayer FindPartySlotWithMove VAR_RESULT, MOVE_CUT - GoToIfEq VAR_RESULT, 6, _008E + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseCut CheckBadgeAcquired BADGE_ID_FOREST, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _008E + GoToIfEq VAR_RESULT, FALSE, FieldMoves_CantUseCut Message FieldMoves_Text_WouldYouLikeToUseCut ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _00AE + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseCutFromField CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_008E: +FieldMoves_CantUseCut: Message FieldMoves_Text_TreeLooksLikeCanBeCut GetCurrentMapID VAR_0x8004 - CallIfEq VAR_0x8004, 203, _014A + CallIfEq VAR_0x8004, MAP_HEADER_ETERNA_FOREST, FieldMoves_TryEnableCherylCutscene WaitButton CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_00AE: +FieldMoves_UseCutFromField: FindPartySlotWithMove VAR_RESULT, MOVE_CUT SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT Message FieldMoves_Text_PokemonUsedCut CloseMessage - ScrCmd_0C5 VAR_0x8004 - ScrCmd_29E 0, VAR_0x8005 + PlayHMCutIn VAR_0x8004 + StartDestroyObstacleAnimation 0, VAR_0x8005 WaitTime 7, VAR_RESULT RemoveObject VAR_LAST_TALKED GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_CUT, VAR_0x8004, 0, 0, 0 -_00E8: +FieldMoves_WaitForCutAnimFromField: WaitTime 1, VAR_RESULT - GoToIfEq VAR_0x8005, 0, _00E8 - GoTo _066D + GoToIfEq VAR_0x8005, 0, FieldMoves_WaitForCutAnimFromField + GoTo FieldMoves_End End FieldMoves_UseCutFromMenu: @@ -67,61 +67,61 @@ FieldMoves_UseCutFromMenu: BufferPartyMonNickname 0, VAR_0x8000 Message FieldMoves_Text_PokemonUsedCut CloseMessage - ScrCmd_0C5 VAR_0x8000 - ScrCmd_29E 0, VAR_0x8005 + PlayHMCutIn VAR_0x8000 + StartDestroyObstacleAnimation 0, VAR_0x8005 WaitTime 7, VAR_RESULT RemoveObject VAR_LAST_TALKED GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_CUT, VAR_0x8004, 0, 0, 0 -_0133: +FieldMoves_WaitForCutAnimFromMenu: WaitTime 1, VAR_RESULT - GoToIfEq VAR_0x8005, 0, _0133 + GoToIfEq VAR_0x8005, 0, FieldMoves_WaitForCutAnimFromMenu ReleaseAll End -_014A: - GoToIfNe VAR_ETERNA_FOREST_CHERYL_OLD_CHATEAU_CUTSCENE_STATE, 0, _0221 - GoToIfNe VAR_ETERNA_FOREST_FOLLOWER_CHERYL_STATE, 1, _0221 - Call _017F - GoToIfEq VAR_RESULT, 0, _0221 +FieldMoves_TryEnableCherylCutscene: + GoToIfNe VAR_ETERNA_FOREST_CHERYL_OLD_CHATEAU_CUTSCENE_STATE, 0, FieldMoves_DontEnableCherylCutscene + GoToIfNe VAR_ETERNA_FOREST_FOLLOWER_CHERYL_STATE, 1, FieldMoves_DontEnableCherylCutscene + Call FieldMoves_CheckPositionForCherylCutscene + GoToIfEq VAR_RESULT, FALSE, FieldMoves_DontEnableCherylCutscene SetVar VAR_ETERNA_FOREST_CHERYL_OLD_CHATEAU_CUTSCENE_STATE, 1 Return -_017F: - SetVar VAR_RESULT, 0 +FieldMoves_CheckPositionForCherylCutscene: + SetVar VAR_RESULT, FALSE GetPlayerMapPos VAR_0x8004, VAR_0x8005 - GoToIfEq VAR_0x8004, 73, _01CE - GoToIfEq VAR_0x8004, 74, _01DD - GoToIfEq VAR_0x8004, 75, _01EC - GoToIfEq VAR_0x8004, 76, _01FB - GoToIfEq VAR_0x8004, 77, _020A + GoToIfEq VAR_0x8004, 73, FieldMoves_CheckPositionX73 + GoToIfEq VAR_0x8004, 74, FieldMoves_CheckPositionX74 + GoToIfEq VAR_0x8004, 75, FieldMoves_CheckPositionX75 + GoToIfEq VAR_0x8004, 76, FieldMoves_CheckPositionX76 + GoToIfEq VAR_0x8004, 77, FieldMoves_CheckPositionX77 Return -_01CE: - GoToIfEq VAR_0x8005, 33, _0219 +FieldMoves_CheckPositionX73: + GoToIfEq VAR_0x8005, 33, FieldMoves_CorrectPositionForCherylCutscene Return -_01DD: - GoToIfEq VAR_0x8005, 34, _0219 +FieldMoves_CheckPositionX74: + GoToIfEq VAR_0x8005, 34, FieldMoves_CorrectPositionForCherylCutscene Return -_01EC: - GoToIfEq VAR_0x8005, 34, _0219 +FieldMoves_CheckPositionX75: + GoToIfEq VAR_0x8005, 34, FieldMoves_CorrectPositionForCherylCutscene Return -_01FB: - GoToIfEq VAR_0x8005, 33, _0219 +FieldMoves_CheckPositionX76: + GoToIfEq VAR_0x8005, 33, FieldMoves_CorrectPositionForCherylCutscene Return -_020A: - GoToIfEq VAR_0x8005, 34, _0219 +FieldMoves_CheckPositionX77: + GoToIfEq VAR_0x8005, 34, FieldMoves_CorrectPositionForCherylCutscene Return -_0219: - SetVar VAR_RESULT, 1 +FieldMoves_CorrectPositionForCherylCutscene: + SetVar VAR_RESULT, TRUE Return -_0221: +FieldMoves_DontEnableCherylCutscene: Return FieldMoves_Rock: @@ -130,37 +130,37 @@ FieldMoves_Rock: FacePlayer FindPartySlotWithMove VAR_RESULT, MOVE_ROCK_SMASH SetVar VAR_0x8004, VAR_RESULT - GoToIfEq VAR_RESULT, 6, _0275 + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseRockSmash CheckBadgeAcquired BADGE_ID_COAL, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _0275 + GoToIfEq VAR_RESULT, FALSE, FieldMoves_CantUseRockSmash Message FieldMoves_Text_WouldYouLikeToUseRockSmash ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0284 + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseRockSmashFromField CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_0275: +FieldMoves_CantUseRockSmash: Message FieldMoves_Text_PokemonMayBeAbleToSmashRock WaitButton CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_0284: +FieldMoves_UseRockSmashFromField: BufferPartyMonNickname 0, VAR_0x8004 Message FieldMoves_Text_PokemonUsedRockSmash CloseMessage - ScrCmd_0C5 VAR_0x8004 - ScrCmd_29E 1, VAR_0x8005 + PlayHMCutIn VAR_0x8004 + StartDestroyObstacleAnimation 1, VAR_0x8005 WaitTime 10, VAR_RESULT RemoveObject VAR_LAST_TALKED GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_ROCK_SMASH, VAR_0x8004, 0, 0, 0 -_02B2: +FieldMoves_WaitForRockSmashAnimFromField: WaitTime 1, VAR_RESULT - GoToIfEq VAR_0x8005, 0, _02B2 - GoTo _066D + GoToIfEq VAR_0x8005, 0, FieldMoves_WaitForRockSmashAnimFromField + GoTo FieldMoves_End End FieldMoves_UseRockSmashFromMenu: @@ -168,15 +168,15 @@ FieldMoves_UseRockSmashFromMenu: BufferPartyMonNickname 0, VAR_0x8000 Message FieldMoves_Text_PokemonUsedRockSmash CloseMessage - ScrCmd_0C5 VAR_0x8000 - ScrCmd_29E 1, VAR_0x8005 + PlayHMCutIn VAR_0x8000 + StartDestroyObstacleAnimation 1, VAR_0x8005 WaitTime 10, VAR_RESULT RemoveObject VAR_LAST_TALKED GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_ROCK_SMASH, VAR_0x8004, 0, 0, 0 -_02FD: +FieldMoves_WaitForRockSmashAnimFromMenu: WaitTime 1, VAR_RESULT - GoToIfEq VAR_0x8005, 0, _02FD + GoToIfEq VAR_0x8005, 0, FieldMoves_WaitForRockSmashAnimFromMenu ReleaseAll End @@ -184,96 +184,96 @@ FieldMoves_Boulder: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - Strength 2, VAR_RESULT - GoToIfEq VAR_RESULT, 1, _03BD + DoStrengthFunc FIELD_MOVE_FUNC_CHECK_ACTIVE, VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, FieldMoves_StrenghtAlreadyActive FindPartySlotWithMove VAR_RESULT, MOVE_STRENGTH - GoToIfEq VAR_RESULT, 6, _0372 + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseStrength CheckBadgeAcquired BADGE_ID_MINE, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _0372 + GoToIfEq VAR_RESULT, FALSE, FieldMoves_CantUseStrength Message FieldMoves_Text_WouldYouLikeToUseStrength ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0381 + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseStrengthFromField CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_0372: +FieldMoves_CantUseStrength: Message FieldMoves_Text_BoulderMayBeAbleToPush WaitButton CloseMessage - GoTo _066D + GoTo FieldMoves_End End -_0381: - Strength 1 +FieldMoves_UseStrengthFromField: + DoStrengthFunc FIELD_MOVE_FUNC_SET_ACTIVE FindPartySlotWithMove VAR_RESULT, MOVE_STRENGTH SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT Message FieldMoves_Text_PokemonUsedStrength - ScrCmd_0C5 VAR_0x8004 + PlayHMCutIn VAR_0x8004 CloseMessage Message FieldMoves_Text_PokemonStrengthMadePossibleToMove WaitButton CloseMessage GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_STRENGTH, VAR_0x8004, 0, 0, 0 - GoTo _066D + GoTo FieldMoves_End End -_03BD: +FieldMoves_StrenghtAlreadyActive: Message FieldMoves_Text_StrengthMadePossibleToMove WaitButton CloseMessage - GoTo _066D + GoTo FieldMoves_End End FieldMoves_UseStrengthFromMenu: LockAll - Strength 2, VAR_RESULT - GoToIfEq VAR_RESULT, 1, _03BD - Strength 1 + DoStrengthFunc FIELD_MOVE_FUNC_CHECK_ACTIVE, VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, FieldMoves_StrenghtAlreadyActive + DoStrengthFunc FIELD_MOVE_FUNC_SET_ACTIVE BufferPartyMonNickname 0, VAR_0x8000 Message FieldMoves_Text_PokemonUsedStrength CloseMessage - ScrCmd_0C5 VAR_0x8000 + PlayHMCutIn VAR_0x8000 Message FieldMoves_Text_PokemonStrengthMadePossibleToMove WaitButton CloseMessage GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_STRENGTH, VAR_0x8004, 0, 0, 0 - GoTo _0675 + GoTo FieldMoves_End3 FieldMoves_RockyWall: PlaySE SEQ_SE_CONFIRM LockAll FindPartySlotWithMove VAR_RESULT, MOVE_ROCK_CLIMB - GoToIfEq VAR_RESULT, 6, _0469 + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseRockClimb CheckBadgeAcquired BADGE_ID_ICICLE, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _0469 + GoToIfEq VAR_RESULT, FALSE, FieldMoves_CantUseRockClimb CheckHasPartner VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0478 + GoToIfEq VAR_RESULT, TRUE, FieldMoves_NoRockClimbingWithPartner Message FieldMoves_Text_WouldYouLikeToUseRockClimb ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0487 + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseRockClimbFromField CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_0469: +FieldMoves_CantUseRockClimb: Message FieldMoves_Text_RockyWallWillMoveScale WaitButton CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_0478: +FieldMoves_NoRockClimbingWithPartner: Message FieldMoves_Text_NoRockClimbingWithPartner WaitButton CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_0487: +FieldMoves_UseRockClimbFromField: FindPartySlotWithMove VAR_RESULT, MOVE_ROCK_CLIMB SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT @@ -282,7 +282,7 @@ _0487: UseRockClimb VAR_0x8004 GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_ROCK_CLIMB, VAR_0x8004, 0, 0, 0 - GoTo _0671 + GoTo FieldMoves_End2 End FieldMoves_UseRockClimbFromMenu: @@ -300,21 +300,21 @@ FieldMoves_Water: PlaySE SEQ_SE_CONFIRM LockAll CheckHasPartner VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0512 + GoToIfEq VAR_RESULT, TRUE, FieldMoves_CantUseSurf Message FieldMoves_Text_WouldYouLikeToUseSurf ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _051F + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseSurfFromField CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_0512: +FieldMoves_CantUseSurf: Message FieldMoves_Text_NoSurfingWithPartner WaitButton CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 -_051F: +FieldMoves_UseSurfFromField: FindPartySlotWithMove VAR_RESULT, MOVE_SURF SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT @@ -323,7 +323,7 @@ _051F: UseSurf VAR_0x8004 GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_SURF, VAR_0x8004, 0, 0, 0 - GoTo _0671 + GoTo FieldMoves_End2 End FieldMoves_UseSurfFromMenu: @@ -343,36 +343,36 @@ FieldMoves_Fog_Unused: PlaySE SEQ_SE_CONFIRM LockAll FindPartySlotWithMove VAR_RESULT, MOVE_DEFOG - GoToIfEq VAR_RESULT, 6, _05B4 + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseDefog_Unused Message FieldMoves_Text_WouldYouLikeToUseDefog_Unused ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _05C3 + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseDefogFromField_Unused CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_05B4: +FieldMoves_CantUseDefog_Unused: Message FieldMoves_Text_DeepFogDrapesArea_Unused WaitButton CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_05C3: +FieldMoves_UseDefogFromField_Unused: FindPartySlotWithMove VAR_RESULT, MOVE_DEFOG SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT Message FieldMoves_Text_PokemonUsedDefog CloseMessage - ScrCmd_0C5 VAR_0x8004 + PlayHMCutIn VAR_0x8004 GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_DEFOG, VAR_0x8004, 0, 0, 0 GetCurrentMapID VAR_0x8004 - CallIfEq VAR_0x8004, MAP_HEADER_ROUTE_209_LOST_TOWER_5F, _0606 - GoTo _0671 + CallIfEq VAR_0x8004, MAP_HEADER_ROUTE_209_LOST_TOWER_5F, FieldMoves_SetFlagUsedDefog_Unused + GoTo FieldMoves_End2 End -_0606: +FieldMoves_SetFlagUsedDefog_Unused: SetFlag FLAG_USED_DEFOG_IN_ROUTE_209_LOST_TOWER_5F Return @@ -381,36 +381,36 @@ FieldMoves_UseDefogFromMenu: BufferPartyMonNickname 0, VAR_0x8000 Message FieldMoves_Text_PokemonUsedDefog CloseMessage - ScrCmd_0C5 VAR_0x8000 - Defog 1 + PlayHMCutIn VAR_0x8000 + DoDefogFunc FIELD_MOVE_FUNC_SET_ACTIVE PlaySE SEQ_SE_DP_FBRADE ScrCmd_0C4 GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_DEFOG, VAR_0x8004, 0, 0, 0 GetCurrentMapID VAR_0x8004 - CallIfEq VAR_0x8004, 0x169, _0606 - GoTo _0675 + CallIfEq VAR_0x8004, MAP_HEADER_ROUTE_209_LOST_TOWER_5F, FieldMoves_SetFlagUsedDefog_Unused + GoTo FieldMoves_End3 FieldMoves_UseFlashFromMenu: LockAll BufferPartyMonNickname 0, VAR_0x8000 Message FieldMoves_Text_PokemonUsedFlash CloseMessage - ScrCmd_0C5 VAR_0x8000 - Flash 1 + PlayHMCutIn VAR_0x8000 + DoFlashFunc FIELD_MOVE_FUNC_SET_ACTIVE ScrCmd_0C3 WaitTime 42, VAR_RESULT - GoTo _0675 + GoTo FieldMoves_End3 -_066D: +FieldMoves_End: ReleaseAll End -_0671: +FieldMoves_End2: ReleaseAll End -_0675: +FieldMoves_End3: ReleaseAll End @@ -418,24 +418,24 @@ FieldMoves_Waterfall: PlaySE SEQ_SE_CONFIRM LockAll FindPartySlotWithMove VAR_RESULT, MOVE_WATERFALL - GoToIfEq VAR_RESULT, 6, _06C3 + GoToIfEq VAR_RESULT, MAX_PARTY_SIZE, FieldMoves_CantUseWaterfall CheckBadgeAcquired BADGE_ID_BEACON, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _06C3 + GoToIfEq VAR_RESULT, FALSE, FieldMoves_CantUseWaterfall Message FieldMoves_Text_WouldYouLikeToUseWaterfall ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _06D2 + GoToIfEq VAR_RESULT, MENU_YES, FieldMoves_UseWaterfallFromField CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_06C3: +FieldMoves_CantUseWaterfall: Message FieldMoves_Text_WallOfWater WaitButton CloseMessage - GoTo _0671 + GoTo FieldMoves_End2 End -_06D2: +FieldMoves_UseWaterfallFromField: FindPartySlotWithMove VAR_RESULT, MOVE_WATERFALL SetVar VAR_0x8004, VAR_RESULT BufferPartyMonNickname 0, VAR_RESULT @@ -444,7 +444,7 @@ _06D2: UseWaterfall VAR_0x8004 GetCurrentMapID VAR_0x8004 CreateJournalEvent LOCATION_EVENT_USED_WATERFALL, VAR_0x8004, 0, 0, 0 - GoTo _0671 + GoTo FieldMoves_End2 End FieldMoves_UseWaterfallFromMenu: @@ -460,7 +460,7 @@ FieldMoves_UseWaterfallFromMenu: ReleaseAll End -FieldMoves_Dummy: +FieldMoves_Dummy8: End .balign 4, 0 diff --git a/res/field/scripts/scripts_fight_area.s b/res/field/scripts/scripts_fight_area.s index e2cef4b5b4..8d74422940 100644 --- a/res/field/scripts/scripts_fight_area.s +++ b/res/field/scripts/scripts_fight_area.s @@ -3,7 +3,7 @@ #include "res/field/events/events_fight_area.h" - ScriptEntry FightArea_OnFrameRival + ScriptEntry FightArea_OnFrame_Rival ScriptEntry FightArea_AceTrainerM1 ScriptEntry FightArea_AceTrainerF1 ScriptEntry FightArea_PokemonBreederM @@ -11,7 +11,7 @@ ScriptEntry FightArea_BattleGirl1 ScriptEntry FightArea_Sailor1 ScriptEntry FightArea_Fisherman - ScriptEntry FightArea_MapSign + ScriptEntry FightArea_MapSignpost ScriptEntry FightArea_ArrowSignpostBattleFrontier ScriptEntry FightArea_ArrowSignpostRt225 ScriptEntry FightArea_Sailor2 @@ -58,7 +58,7 @@ FightArea_ActivateRivalFight_Unused: ClearFlag FLAG_HIDE_FIGHT_AREA_RIVAL End -FightArea_OnFrameRival: +FightArea_OnFrame_Rival: LockAll ScrCmd_32D ApplyMovement LOCALID_RIVAL, FightArea_Movement_RivalNoticePlayer @@ -219,7 +219,7 @@ FightArea_Movement_RivalNoticePlayer: EmoteExclamationMark EndMovement -FightArea_UnusedMovement: +FightArea_Movement_Unused: WalkNormalWest EndMovement @@ -251,7 +251,7 @@ FightArea_Movement_RivalGetPushedBack: UnlockDir EndMovement -FightArea_UnusedMovement2: +FightArea_Movement_Unused2: EmoteExclamationMark EndMovement @@ -331,7 +331,7 @@ FightArea_Movement_PlayerWatchRivalLeave: WalkOnSpotNormalSouth EndMovement -FightArea_UnusedMovement3: +FightArea_Movement_Unused3: Delay8 WalkOnSpotNormalNorth EndMovement @@ -383,11 +383,11 @@ FightArea_Movement_BuckLeave: WalkNormalSouth 8 EndMovement -FightArea_UnusedMovement4: +FightArea_Movement_Unused4: WalkOnSpotNormalWest EndMovement -FightArea_UnusedMovement5: +FightArea_Movement_Unused5: WalkNormalEast 10 EndMovement @@ -453,7 +453,7 @@ FightArea_AdviceForFishing: ReleaseAll End -FightArea_MapSign: +FightArea_MapSignpost: ShowMapSign FightArea_Text_MapSign End diff --git a/res/field/scripts/scripts_fight_area_mart.s b/res/field/scripts/scripts_fight_area_mart.s index fc8dd96ab3..0e8fad5892 100644 --- a/res/field/scripts/scripts_fight_area_mart.s +++ b/res/field/scripts/scripts_fight_area_mart.s @@ -3,7 +3,7 @@ ScriptEntry FightAreaMart_CommonVendor - ScriptEntry FightAreaMart_Unused + ScriptEntry FightAreaMart_Dummy2 ScriptEntry FightAreaMart_Socialite ScriptEntry FightAreaMart_Clown ScriptEntryEnd @@ -12,7 +12,7 @@ FightAreaMart_CommonVendor: PokeMartCommonWithGreeting End -FightAreaMart_Unused: +FightAreaMart_Dummy2: End FightAreaMart_Socialite: diff --git a/res/field/scripts/scripts_fight_area_pokecenter_2f.s b/res/field/scripts/scripts_fight_area_pokecenter_2f.s index 7d983fc45b..c50fbadd2b 100644 --- a/res/field/scripts/scripts_fight_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_fight_area_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry FightAreaPokecenter2F_UnusedEntry1 + ScriptEntry FightAreaPokecenter2F_Dummy1 ScriptEntryEnd -FightAreaPokecenter2F_UnusedEntry1: +FightAreaPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_fight_area_pokecenter_b1f.s b/res/field/scripts/scripts_fight_area_pokecenter_b1f.s index 8377dac78d..5da1c64d43 100644 --- a/res/field/scripts/scripts_fight_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_fight_area_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry FightAreaPokecenterB1F_UnusedEntry1 + ScriptEntry FightAreaPokecenterB1F_Dummy1 ScriptEntryEnd -FightAreaPokecenterB1F_UnusedEntry1: +FightAreaPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_floaroma_meadow.s b/res/field/scripts/scripts_floaroma_meadow.s index 2a0fa4fada..5a41a1bbd1 100644 --- a/res/field/scripts/scripts_floaroma_meadow.s +++ b/res/field/scripts/scripts_floaroma_meadow.s @@ -4,11 +4,11 @@ ScriptEntry FloaromaMeadow_OnTransition - ScriptEntry FloaromaMeadow_TriggerGrunts - ScriptEntry FloaromaMeadow_UnusedGrunt - ScriptEntry FloaromaMeadow_UnusedGrunt + ScriptEntry FloaromaMeadow_CoordEvent_Grunts + ScriptEntry FloaromaMeadow_Grunt_Unused + ScriptEntry FloaromaMeadow_Grunt_Unused ScriptEntry FloaromaMeadow_PokefanM - ScriptEntry FloaromaMeadow_UnusedArrowSign + ScriptEntry FloaromaMeadow_Dummy6 ScriptEntry FloaromaMeadow_ItemWorksKey ScriptEntryEnd @@ -16,7 +16,7 @@ FloaromaMeadow_OnTransition: SetFlag FLAG_FIRST_ARRIVAL_FLOAROMA_MEADOW End -FloaromaMeadow_TriggerGrunts: +FloaromaMeadow_CoordEvent_Grunts: LockAll Call FloaromaMeadow_GruntsNoticePlayer StartTrainerBattle TRAINER_GALACTIC_GRUNT_FLOAROMA_MEADOW_1 @@ -52,11 +52,11 @@ FloaromaMeadow_Movement_GruntWestWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -FloaromaMeadow_UnusedMovement: +FloaromaMeadow_Movement_Unused: WalkNormalNorth 9 EndMovement -FloaromaMeadow_UnusedMovement2: +FloaromaMeadow_Movement_Unused2: WalkNormalNorth 9 EndMovement @@ -151,7 +151,7 @@ FloaromaMeadow_Unused: ReleaseAll End -FloaromaMeadow_UnusedGrunt: +FloaromaMeadow_Grunt_Unused: End FloaromaMeadow_PokefanM: @@ -228,7 +228,7 @@ FloaromaMeadow_OopsyYouDontHaveEnoughMoney: ReleaseAll End -FloaromaMeadow_UnusedArrowSign: +FloaromaMeadow_Dummy6: ShowArrowSign FloaromaMeadow_Text_Dummy18 End diff --git a/res/field/scripts/scripts_floaroma_town.s b/res/field/scripts/scripts_floaroma_town.s index 64a7010560..d6314fd7a5 100644 --- a/res/field/scripts/scripts_floaroma_town.s +++ b/res/field/scripts/scripts_floaroma_town.s @@ -10,8 +10,8 @@ ScriptEntry FloaromaTown_LassEast ScriptEntry FloaromaTown_Camper ScriptEntry FloaromaTown_MapSignpost - ScriptEntry FloaromaTown_LandmarkSignFlowerShop - ScriptEntry FloaromaTown_LandmarkSignFloaromaMeadow + ScriptEntry FloaromaTown_SignboardFlowerShop + ScriptEntry FloaromaTown_SignboardFloaromaMeadow ScriptEntry FloaromaTown_Beauty ScriptEntryEnd @@ -90,11 +90,11 @@ FloaromaTown_MapSignpost: ShowMapSign FloaromaTown_Text_MapSign End -FloaromaTown_LandmarkSignFlowerShop: +FloaromaTown_SignboardFlowerShop: ShowLandmarkSign FloaromaTown_Text_PickAPeckOfColorsFlowerShopFreeBerriesAvailable End -FloaromaTown_LandmarkSignFloaromaMeadow: +FloaromaTown_SignboardFloaromaMeadow: ShowLandmarkSign FloaromaTown_Text_FloaromaMeadowAheadHoneyAvailable End diff --git a/res/field/scripts/scripts_floaroma_town_pokecenter_2f.s b/res/field/scripts/scripts_floaroma_town_pokecenter_2f.s index 89e99dc6c8..75c73b10f0 100644 --- a/res/field/scripts/scripts_floaroma_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_floaroma_town_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry FloaromaPokecenter2F_UnusedEntry1 + ScriptEntry FloaromaPokecenter2F_Dummy1 ScriptEntryEnd -FloaromaPokecenter2F_UnusedEntry1: +FloaromaPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_floaroma_town_pokecenter_b1f.s b/res/field/scripts/scripts_floaroma_town_pokecenter_b1f.s index 1da6aab381..d5379b1119 100644 --- a/res/field/scripts/scripts_floaroma_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_floaroma_town_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry FloaromaPokecenterB1F_UnusedEntry1 + ScriptEntry FloaromaPokecenterB1F_Dummy1 ScriptEntryEnd -FloaromaPokecenterB1F_UnusedEntry1: +FloaromaPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_follower_partners.s b/res/field/scripts/scripts_follower_partners.s index 6441433340..1363297e47 100644 --- a/res/field/scripts/scripts_follower_partners.s +++ b/res/field/scripts/scripts_follower_partners.s @@ -3,10 +3,10 @@ ScriptEntry FollowerPartners_Rival - ScriptEntry FollowerPartners_UnusedEntry9701 + ScriptEntry FollowerPartners_DummyFollower_Unused ScriptEntry FollowerPartners_Cheryl ScriptEntry FollowerPartners_Buck - ScriptEntry FollowerPartners_Mira + ScriptEntry FollowerPartners_Mira_Unused ScriptEntry FollowerPartners_Marley ScriptEntryEnd @@ -85,29 +85,29 @@ FollowerPartners_Rival_IncreaseTimesTalked: ReleaseAll End -FollowerPartners_UnusedEntry9701: +FollowerPartners_DummyFollower_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfGe VAR_FOLLOWER_UNUSED_TIMES_TALKED, 2, FollowerPartners_UnusedFollowerTalkedGe2Times - GoToIfEq VAR_FOLLOWER_UNUSED_TIMES_TALKED, 1, FollowerPartners_UnusedFollowerTalked1Time + GoToIfGe VAR_FOLLOWER_UNUSED_TIMES_TALKED, 2, FollowerPartners_DummyFollowerTalkedGe2Times_Unused + GoToIfEq VAR_FOLLOWER_UNUSED_TIMES_TALKED, 1, FollowerPartners_DummyFollowerTalked1Time_Unused BufferRivalName 0 - GoTo FollowerPartners_UnusedFollowerTalked0Times + GoTo FollowerPartners_DummyFollowerTalked0Times_Unused End -FollowerPartners_UnusedFollowerTalkedGe2Times: +FollowerPartners_DummyFollowerTalkedGe2Times_Unused: BufferRivalName 0 WaitButton CloseMessage ReleaseAll End -FollowerPartners_UnusedFollowerTalked1Time: +FollowerPartners_DummyFollowerTalked1Time_Unused: BufferRivalName 0 - GoTo FollowerPartners_UnusedFollowerTalked0Times + GoTo FollowerPartners_DummyFollowerTalked0Times_Unused End -FollowerPartners_UnusedFollowerTalked0Times: +FollowerPartners_DummyFollowerTalked0Times_Unused: WaitButton CloseMessage AddVar VAR_FOLLOWER_UNUSED_TIMES_TALKED, 1 @@ -181,23 +181,23 @@ FollowerPartners_Buck_IncreaseTimesTalked: ReleaseAll End -FollowerPartners_Mira: +FollowerPartners_Mira_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfGe VAR_FOLLOWER_MIRA_TIMES_TALKED, 2, FollowerPartners_Mira_IWillTryLikeYou - GoToIfEq VAR_FOLLOWER_MIRA_TIMES_TALKED, 1, FollowerPartners_Mira_EasyToGetConfused + GoToIfGe VAR_FOLLOWER_MIRA_TIMES_TALKED, 2, FollowerPartners_Mira_IWillTryLikeYou_Unused + GoToIfEq VAR_FOLLOWER_MIRA_TIMES_TALKED, 1, FollowerPartners_Mira_EasyToGetConfused_Unused BufferPlayerName 0 Message FollowerPartners_Text_Mira_ILikeHelpfulMoves - GoTo FollowerPartners_Mira_IncreaseTimesTalked + GoTo FollowerPartners_Mira_IncreaseTimesTalked_Unused End -FollowerPartners_Mira_EasyToGetConfused: +FollowerPartners_Mira_EasyToGetConfused_Unused: Message FollowerPartners_Text_Mira_EasyToGetConfused - GoTo FollowerPartners_Mira_IncreaseTimesTalked + GoTo FollowerPartners_Mira_IncreaseTimesTalked_Unused End -FollowerPartners_Mira_IWillTryLikeYou: +FollowerPartners_Mira_IWillTryLikeYou_Unused: BufferPlayerName 0 Message FollowerPartners_Text_Mira_IWillTryLikeYou WaitButton @@ -205,7 +205,7 @@ FollowerPartners_Mira_IWillTryLikeYou: ReleaseAll End -FollowerPartners_Mira_IncreaseTimesTalked: +FollowerPartners_Mira_IncreaseTimesTalked_Unused: AddVar VAR_FOLLOWER_MIRA_TIMES_TALKED, 1 WaitButton CloseMessage diff --git a/res/field/scripts/scripts_fuego_ironworks_outside.s b/res/field/scripts/scripts_fuego_ironworks_outside.s index 5f8d766222..debf6f8dfa 100644 --- a/res/field/scripts/scripts_fuego_ironworks_outside.s +++ b/res/field/scripts/scripts_fuego_ironworks_outside.s @@ -2,10 +2,10 @@ #include "res/text/bank/fuego_ironworks_outside.h" - ScriptEntry FuegoIronworksOutside_Sign + ScriptEntry FuegoIronworksOutside_Signboard ScriptEntryEnd -FuegoIronworksOutside_Sign: +FuegoIronworksOutside_Signboard: ShowLandmarkSign FuegoIronworksOutside_Text_SignFuegoIronworks End diff --git a/res/field/scripts/scripts_fullmoon_island_forest.s b/res/field/scripts/scripts_fullmoon_island_forest.s index 4a6afe0c47..93d79db8f1 100644 --- a/res/field/scripts/scripts_fullmoon_island_forest.s +++ b/res/field/scripts/scripts_fullmoon_island_forest.s @@ -3,11 +3,11 @@ #include "res/field/events/events_fullmoon_island_forest.h" - ScriptEntry FullmoonIslandForest_Unused + ScriptEntry FullmoonIslandForest_Dummy1 ScriptEntry FullmoonIslandForest_Cresselia ScriptEntryEnd -FullmoonIslandForest_Unused: +FullmoonIslandForest_Dummy1: End FullmoonIslandForest_Cresselia: diff --git a/res/field/scripts/scripts_galactic_hq_1f.s b/res/field/scripts/scripts_galactic_hq_1f.s index 95cec95731..1aa9fd4314 100644 --- a/res/field/scripts/scripts_galactic_hq_1f.s +++ b/res/field/scripts/scripts_galactic_hq_1f.s @@ -9,7 +9,7 @@ ScriptEntry GalacticHQ1F_GruntF2 ScriptEntry GalacticHQ1F_ScientistM1 ScriptEntry GalacticHQ1F_Door - ScriptEntry GalacticHQ1F_Sign + ScriptEntry GalacticHQ1F_BgSign ScriptEntry GalacticHQ1F_Saturn ScriptEntryEnd @@ -143,7 +143,7 @@ GalacticHQ1F_Movement_DoorEastMoveEast: WalkFastEast EndMovement -GalacticHQ1F_Sign: +GalacticHQ1F_BgSign: EventMessage GalacticHQ1F_Text_TeamGalacticCredo End diff --git a/res/field/scripts/scripts_galactic_hq_2f.s b/res/field/scripts/scripts_galactic_hq_2f.s index 6928989417..6737a568e9 100644 --- a/res/field/scripts/scripts_galactic_hq_2f.s +++ b/res/field/scripts/scripts_galactic_hq_2f.s @@ -3,9 +3,9 @@ ScriptEntry GalacticHQ2F_Bed - ScriptEntry GalacticHQ2F_SignNapRoom - ScriptEntry GalacticHQ2F_SignTVRoom - ScriptEntry GalacticHQ2F_SignCredo + ScriptEntry GalacticHQ2F_BgSignNapRoom + ScriptEntry GalacticHQ2F_BgSignTVRoom + ScriptEntry GalacticHQ2F_BgSignCredo ScriptEntry GalacticHQ2F_KitchenSink ScriptEntry GalacticHQ2F_Report ScriptEntry GalacticHQ2F_Refrigerator @@ -42,15 +42,15 @@ GalacticHQ2F_BedEnd: ReleaseAll End -GalacticHQ2F_SignNapRoom: +GalacticHQ2F_BgSignNapRoom: EventMessage GalacticHQ2F_Text_TeamGalacticNapRoom End -GalacticHQ2F_SignTVRoom: +GalacticHQ2F_BgSignTVRoom: EventMessage GalacticHQ2F_Text_TeamGalacticTVRoom End -GalacticHQ2F_SignCredo: +GalacticHQ2F_BgSignCredo: EventMessage GalacticHQ2F_Text_TeamGalacticCredo End diff --git a/res/field/scripts/scripts_galactic_hq_3f.s b/res/field/scripts/scripts_galactic_hq_3f.s index c0270164cd..9d33ad6eb4 100644 --- a/res/field/scripts/scripts_galactic_hq_3f.s +++ b/res/field/scripts/scripts_galactic_hq_3f.s @@ -5,7 +5,7 @@ ScriptEntry GalacticHQ3F_GruntM ScriptEntry GalacticHQ3F_Door - ScriptEntry GalacticHQ3F_Sign + ScriptEntry GalacticHQ3F_BgSign ScriptEntryEnd GalacticHQ3F_GruntM: @@ -62,7 +62,7 @@ GalacticHQ3F_Movement_DoorEastMoveEast: WalkFastEast EndMovement -GalacticHQ3F_Sign: +GalacticHQ3F_BgSign: EventMessage GalacticHQ3F_Text_TeamGalacticCredo End diff --git a/res/field/scripts/scripts_galactic_hq_4f.s b/res/field/scripts/scripts_galactic_hq_4f.s index e1e4ad85ec..824b3490e4 100644 --- a/res/field/scripts/scripts_galactic_hq_4f.s +++ b/res/field/scripts/scripts_galactic_hq_4f.s @@ -4,13 +4,13 @@ #include "res/field/events/events_galactic_hq_4f.h" - ScriptEntry GalacticHQ4F_TriggerCyrus + ScriptEntry GalacticHQ4F_CoordEvent_Cyrus ScriptEntry GalacticHQ4F_Door - ScriptEntry GalacticHQ4F_SignWarpPanels + ScriptEntry GalacticHQ4F_BgSignWarpPanels ScriptEntry GalacticHQ4F_Report ScriptEntryEnd -GalacticHQ4F_TriggerCyrus: +GalacticHQ4F_CoordEvent_Cyrus: LockAll ApplyMovement LOCALID_CYRUS, GalacticHQ4F_Movement_CyrusWalkOnSpotSouth WaitMovement @@ -151,7 +151,7 @@ GalacticHQ4F_Movement_DoorEastMoveEast: WalkFastEast EndMovement -GalacticHQ4F_SignWarpPanels: +GalacticHQ4F_BgSignWarpPanels: EventMessage GalacticHQ4F_Text_TeamGalacticWarpPanels End diff --git a/res/field/scripts/scripts_galactic_hq_control_room.s b/res/field/scripts/scripts_galactic_hq_control_room.s index 973de7b7db..c206db0627 100644 --- a/res/field/scripts/scripts_galactic_hq_control_room.s +++ b/res/field/scripts/scripts_galactic_hq_control_room.s @@ -9,14 +9,14 @@ ScriptEntry GalacticHQControlRoom_MachineUxie ScriptEntry GalacticHQControlRoom_MachineMesprit ScriptEntry GalacticHQControlRoom_MachineAzelf - ScriptEntry GalacticHQControlRoom_Unused7 - ScriptEntry GalacticHQControlRoom_Unused8 - ScriptEntry GalacticHQControlRoom_Unused9 + ScriptEntry GalacticHQControlRoom_Dummy7 + ScriptEntry GalacticHQControlRoom_Dummy8 + ScriptEntry GalacticHQControlRoom_Dummy9 ScriptEntry GalacticHQControlRoom_Button ScriptEntry GalacticHQControlRoom_Uxie ScriptEntry GalacticHQControlRoom_Mesprit ScriptEntry GalacticHQControlRoom_Azelf - ScriptEntry GalacticHQControlRoom_TriggerSaturn + ScriptEntry GalacticHQControlRoom_CoordEvent_Saturn ScriptEntry GalacticHQControlRoom_Charon ScriptEntryEnd @@ -161,13 +161,13 @@ GalacticHQControlRoom_AzelfWasSealedInside: ReleaseAll End -GalacticHQControlRoom_Unused7: +GalacticHQControlRoom_Dummy7: End -GalacticHQControlRoom_Unused8: +GalacticHQControlRoom_Dummy8: End -GalacticHQControlRoom_Unused9: +GalacticHQControlRoom_Dummy9: End GalacticHQControlRoom_Button: @@ -304,7 +304,7 @@ GalacticHQControlRoom_Movement_PlayerWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -GalacticHQControlRoom_TriggerSaturn: +GalacticHQControlRoom_CoordEvent_Saturn: LockAll ApplyMovement LOCALID_SATURN, GalacticHQControlRoom_Movement_SaturnWalkOnSpotSouth WaitMovement diff --git a/res/field/scripts/scripts_galactic_hq_hall.s b/res/field/scripts/scripts_galactic_hq_hall.s index 05aefb6687..02cb7e0a2f 100644 --- a/res/field/scripts/scripts_galactic_hq_hall.s +++ b/res/field/scripts/scripts_galactic_hq_hall.s @@ -3,10 +3,10 @@ #include "res/field/events/events_galactic_hq_hall.h" - ScriptEntry GalacticHQHall_TriggerSpeech + ScriptEntry GalacticHQHall_CoordEvent_Speech ScriptEntryEnd -GalacticHQHall_TriggerSpeech: +GalacticHQHall_CoordEvent_Speech: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 ApplyMovement LOCALID_LOOKER, GalacticHQHall_Movement_LookerNoticePlayer diff --git a/res/field/scripts/scripts_game_corner.s b/res/field/scripts/scripts_game_corner.s index 0875a243bd..53f7929f7d 100644 --- a/res/field/scripts/scripts_game_corner.s +++ b/res/field/scripts/scripts_game_corner.s @@ -25,7 +25,7 @@ ScriptEntry GameCorner_LadyPokeBalls ScriptEntry GameCorner_Guitarist ScriptEntry GameCorner_MaylenesDad - ScriptEntry GameCorner_SignBonusRounds + ScriptEntry GameCorner_BgSignBonusRounds ScriptEntry GameCorner_Looker ScriptEntryEnd @@ -312,13 +312,13 @@ GameCorner_MaylenesDad: NPCMessage GameCorner_Text_SighNothingGoingMyWayToday End -GameCorner_SignBonusRounds: - GoToIfGt VAR_CONSECUTIVE_BONUS_ROUND_WINS, 999, GameCorner_SignBonusRounds_GreaterThan999 +GameCorner_BgSignBonusRounds: + GoToIfGt VAR_CONSECUTIVE_BONUS_ROUND_WINS, 999, GameCorner_BgSignBonusRounds_GreaterThan999 BufferNumber 0, VAR_CONSECUTIVE_BONUS_ROUND_WINS EventMessage GameCorner_Text_ShootFor10 End -GameCorner_SignBonusRounds_GreaterThan999: +GameCorner_BgSignBonusRounds_GreaterThan999: BufferNumber 0, 999 EventMessage GameCorner_Text_ShootFor10 End diff --git a/res/field/scripts/scripts_global_terminal_1f.s b/res/field/scripts/scripts_global_terminal_1f.s index aaa3ecb080..8a2d043070 100644 --- a/res/field/scripts/scripts_global_terminal_1f.s +++ b/res/field/scripts/scripts_global_terminal_1f.s @@ -4,8 +4,8 @@ #include "constants/map_object.h" - ScriptEntry GlobalTerminal1F_Unused1 - ScriptEntry GlobalTerminal1F_Unused2 + ScriptEntry GlobalTerminal1F_Dummy1 + ScriptEntry GlobalTerminal1F_Dummy2 ScriptEntry GlobalTerminal1F_ReceptionistGTS ScriptEntry GlobalTerminal1F_Collector ScriptEntry GlobalTerminal1F_BugCatcher @@ -15,7 +15,7 @@ ScriptEntry GlobalTerminal1F_Beauty1 ScriptEntry GlobalTerminal1F_Picnicker ScriptEntry GlobalTerminal1F_Youngster - ScriptEntry GlobalTerminal1F_OnFrameExitGTSRoom + ScriptEntry GlobalTerminal1F_OnFrame_ExitGTSRoom ScriptEntry GlobalTerminal1F_OnResume ScriptEntry GlobalTerminal1F_BattleVideoRankingsMachine ScriptEntry GlobalTerminal1F_TrainerRankingsMachine @@ -24,18 +24,18 @@ ScriptEntry GlobalTerminal1F_PokemonBreederF ScriptEntry GlobalTerminal1F_PokemonBreederM ScriptEntry GlobalTerminal1F_Beauty2 - ScriptEntry GlobalTerminal1F_Sign + ScriptEntry GlobalTerminal1F_BgSign ScriptEntryEnd GlobalTerminal1F_OnResume: - CallIfEq VAR_UNK_0x40D5, 6, GlobalTerminal1F_HidePlayer + CallIfEq VAR_COMMUNICATION_LOAD_ACTION, 6, GlobalTerminal1F_HidePlayer End GlobalTerminal1F_HidePlayer: HideObject LOCALID_PLAYER Return -GlobalTerminal1F_OnFrameExitGTSRoom: +GlobalTerminal1F_OnFrame_ExitGTSRoom: LockAll Call GlobalTerminal1F_ExitGTSRoom ReleaseAll @@ -53,7 +53,7 @@ GlobalTerminal1F_ExitGTSRoom: ApplyMovement LOCALID_PLAYER, GlobalTerminal1F_Movement_PlayerWalkSouth WaitMovement Call GlobalTerminal1F_PlayDoorCloseAnimation - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 Return GlobalTerminal1F_PlayDoorOpenAnimation: @@ -72,7 +72,7 @@ GlobalTerminal1F_Movement_PlayerExitGTSRoom: WalkNormalSouth EndMovement -GlobalTerminal1F_UnusedMovement: +GlobalTerminal1F_Movement_Unused: WalkNormalSouth EndMovement @@ -81,10 +81,10 @@ GlobalTerminal1F_Movement_PlayerWalkSouth: WalkNormalSouth 2 EndMovement -GlobalTerminal1F_Unused1: +GlobalTerminal1F_Dummy1: End -GlobalTerminal1F_Unused2: +GlobalTerminal1F_Dummy2: End GlobalTerminal1F_ReceptionistGTS: @@ -163,7 +163,7 @@ GlobalTerminal1F_BeginTrade: SetVar VAR_RESULT, VAR_MAP_LOCAL_0 GoToIfEq VAR_RESULT, 0, GlobalTerminal1F_ReceptionistGTSEnd HealParty - SetVar VAR_UNK_0x40D5, 6 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 6 Message GlobalTerminal1F_Text_EnjoyVisitToGTS CloseMessage ApplyMovement LOCALID_PLAYER, GlobalTerminal1F_Movement_PlayerWalkToGate @@ -204,7 +204,7 @@ GlobalTerminal1F_ExitAndEnd: End GlobalTerminal1F_ReceptionistGTSEnd: - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 Message GlobalTerminal1F_Text_PleaseVisitAgain WaitButton CloseMessage @@ -257,7 +257,7 @@ GlobalTerminal1F_Movement_PlayerFaceSouth: EndMovement GlobalTerminal1F_HasBadEgg: - CallCommonScript 0x2338 @ CommonScript_HasBadEgg; outputs pl_msg_00000221_00127 + CallCommonScript 0x2338 @ PokemonCenter2FCommon_HasBadEggReturnCommon WaitButton CloseMessage ReleaseAll @@ -529,7 +529,7 @@ GlobalTerminal1F_CheckReceivedBackdrop: GlobalTerminal1F_DidntReceivAllBackdrops: Return -GlobalTerminal1F_Sign: +GlobalTerminal1F_BgSign: EventMessage GlobalTerminal1F_Text_PanelsLeadTo2F3F End diff --git a/res/field/scripts/scripts_global_terminal_2f.s b/res/field/scripts/scripts_global_terminal_2f.s index f3231597b9..e8f1c9431e 100644 --- a/res/field/scripts/scripts_global_terminal_2f.s +++ b/res/field/scripts/scripts_global_terminal_2f.s @@ -2,7 +2,7 @@ #include "res/text/bank/global_terminal_2f.h" - ScriptEntry GlobalTerminal2F_Unused1 + ScriptEntry GlobalTerminal2F_Dummy1 ScriptEntry GlobalTerminal2F_Artist ScriptEntry GlobalTerminal2F_Hiker ScriptEntry GlobalTerminal2F_BattleGirl @@ -12,8 +12,8 @@ ScriptEntry GlobalTerminal2F_Beauty ScriptEntry GlobalTerminal2F_Lass ScriptEntry GlobalTerminal2F_Twin - ScriptEntry GlobalTerminal2F_SignWarp1F - ScriptEntry GlobalTerminal2F_SignWarp3F + ScriptEntry GlobalTerminal2F_BgSignWarp1F + ScriptEntry GlobalTerminal2F_BgSignWarp3F ScriptEntry GlobalTerminal2F_BoxDataMachine ScriptEntry GlobalTerminal2F_DressUpDataMachine ScriptEntryEnd @@ -54,15 +54,15 @@ GlobalTerminal2F_Twin: NPCMessage GlobalTerminal2F_Text_ILikeSneakingGlances End -GlobalTerminal2F_SignWarp1F: +GlobalTerminal2F_BgSignWarp1F: EventMessage GlobalTerminal2F_Text_WarpsTo1F End -GlobalTerminal2F_SignWarp3F: +GlobalTerminal2F_BgSignWarp3F: EventMessage GlobalTerminal2F_Text_WarpsTo3F End -GlobalTerminal2F_Unused1: +GlobalTerminal2F_Dummy1: End GlobalTerminal2F_BoxDataMachine: diff --git a/res/field/scripts/scripts_global_terminal_3f.s b/res/field/scripts/scripts_global_terminal_3f.s index 7f4031cf66..33731dbdb2 100644 --- a/res/field/scripts/scripts_global_terminal_3f.s +++ b/res/field/scripts/scripts_global_terminal_3f.s @@ -2,7 +2,7 @@ #include "res/text/bank/global_terminal_3f.h" - ScriptEntry GlobalTerminal3F_Unused1 + ScriptEntry GlobalTerminal3F_Dummy1 ScriptEntry GlobalTerminal3F_Youngster ScriptEntry GlobalTerminal3F_SchoolKidF ScriptEntry GlobalTerminal3F_AceTrainerM @@ -12,8 +12,8 @@ ScriptEntry GlobalTerminal3F_Clown ScriptEntry GlobalTerminal3F_Guitarist ScriptEntry GlobalTerminal3F_Hiker - ScriptEntry GlobalTerminal3F_SignWarp1F - ScriptEntry GlobalTerminal3F_SignWarp2F + ScriptEntry GlobalTerminal3F_BgSignWarp1F + ScriptEntry GlobalTerminal3F_BgSignWarp2F ScriptEntry GlobalTerminal3F_BattleVideosMachine ScriptEntryEnd @@ -53,15 +53,15 @@ GlobalTerminal3F_Hiker: NPCMessage GlobalTerminal3F_Text_Hiker2FIsBrother End -GlobalTerminal3F_SignWarp1F: +GlobalTerminal3F_BgSignWarp1F: EventMessage GlobalTerminal3F_Text_WarpsTo1F End -GlobalTerminal3F_SignWarp2F: +GlobalTerminal3F_BgSignWarp2F: EventMessage GlobalTerminal3F_Text_WarpsTo2F End -GlobalTerminal3F_Unused1: +GlobalTerminal3F_Dummy1: End GlobalTerminal3F_BattleVideosMachine: diff --git a/res/field/scripts/scripts_great_marsh_1.s b/res/field/scripts/scripts_great_marsh_1.s index 43182d9148..3f810ad5dc 100644 --- a/res/field/scripts/scripts_great_marsh_1.s +++ b/res/field/scripts/scripts_great_marsh_1.s @@ -2,7 +2,7 @@ #include "res/text/bank/great_marsh_1.h" - ScriptEntry GreatMarsh1_SignArea1 + ScriptEntry GreatMarsh1_SignboardArea1 ScriptEntry GreatMarsh1_RuinManiac ScriptEntryEnd @@ -10,6 +10,6 @@ GreatMarsh1_RuinManiac: NPCMessage GreatMarsh1_Text_ThisIsHowYouWin End -GreatMarsh1_SignArea1: +GreatMarsh1_SignboardArea1: ShowLandmarkSign GreatMarsh1_Text_SignArea1 End diff --git a/res/field/scripts/scripts_great_marsh_2.s b/res/field/scripts/scripts_great_marsh_2.s index d6bd8711ea..40e8228b4d 100644 --- a/res/field/scripts/scripts_great_marsh_2.s +++ b/res/field/scripts/scripts_great_marsh_2.s @@ -3,13 +3,13 @@ ScriptEntry GreatMarsh2_ParasolLady - ScriptEntry GreatMarsh2_SignArea2 + ScriptEntry GreatMarsh2_SignboardArea2 ScriptEntryEnd GreatMarsh2_ParasolLady: NPCMessage GreatMarsh2_Text_PokemonDifferDayToDay End -GreatMarsh2_SignArea2: +GreatMarsh2_SignboardArea2: ShowLandmarkSign GreatMarsh2_Text_SignArea2 End diff --git a/res/field/scripts/scripts_great_marsh_3.s b/res/field/scripts/scripts_great_marsh_3.s index b11478afbe..69d3fb3ba6 100644 --- a/res/field/scripts/scripts_great_marsh_3.s +++ b/res/field/scripts/scripts_great_marsh_3.s @@ -3,13 +3,13 @@ ScriptEntry GreatMarsh3_Collector - ScriptEntry GreatMarsh3_SignArea3 + ScriptEntry GreatMarsh3_SignboardArea3 ScriptEntryEnd GreatMarsh3_Collector: NPCMessage GreatMarsh3_Text_WhatToDo End -GreatMarsh3_SignArea3: +GreatMarsh3_SignboardArea3: ShowLandmarkSign GreatMarsh3_Text_SignArea3 End diff --git a/res/field/scripts/scripts_great_marsh_4.s b/res/field/scripts/scripts_great_marsh_4.s index 0cbef2e5bb..148e4fb540 100644 --- a/res/field/scripts/scripts_great_marsh_4.s +++ b/res/field/scripts/scripts_great_marsh_4.s @@ -3,13 +3,13 @@ ScriptEntry GreatMarsh4_BugCatcher - ScriptEntry GreatMarsh4_SignArea4 + ScriptEntry GreatMarsh4_SignboardArea4 ScriptEntryEnd GreatMarsh4_BugCatcher: NPCMessage GreatMarsh4_Text_YouGetSuckedDown End -GreatMarsh4_SignArea4: +GreatMarsh4_SignboardArea4: ShowLandmarkSign GreatMarsh4_Text_SignArea4 End diff --git a/res/field/scripts/scripts_great_marsh_5.s b/res/field/scripts/scripts_great_marsh_5.s index 640477fbdc..1744cd9332 100644 --- a/res/field/scripts/scripts_great_marsh_5.s +++ b/res/field/scripts/scripts_great_marsh_5.s @@ -3,13 +3,13 @@ ScriptEntry GreatMarsh5_Youngster - ScriptEntry GreatMarsh5_SignArea5 + ScriptEntry GreatMarsh5_SignboardArea5 ScriptEntryEnd GreatMarsh5_Youngster: NPCMessage GreatMarsh5_Text_IRecommendQuickTrams End -GreatMarsh5_SignArea5: +GreatMarsh5_SignboardArea5: ShowLandmarkSign GreatMarsh5_Text_SignArea5 End diff --git a/res/field/scripts/scripts_great_marsh_6.s b/res/field/scripts/scripts_great_marsh_6.s index 9cccc27596..78e26667dc 100644 --- a/res/field/scripts/scripts_great_marsh_6.s +++ b/res/field/scripts/scripts_great_marsh_6.s @@ -3,7 +3,7 @@ ScriptEntry GreatMarsh6_AceTrainerM - ScriptEntry GreatMarsh6_SignArea6 + ScriptEntry GreatMarsh6_SignboardArea6 ScriptEntryEnd GreatMarsh6_AceTrainerM: @@ -62,6 +62,6 @@ GreatMarsh6_BagIsFull: ReleaseAll End -GreatMarsh6_SignArea6: +GreatMarsh6_SignboardArea6: ShowLandmarkSign GreatMarsh6_Text_Area6 End diff --git a/res/field/scripts/scripts_hall_of_origin.s b/res/field/scripts/scripts_hall_of_origin.s index 6fef7ccf06..d2a6b48c13 100644 --- a/res/field/scripts/scripts_hall_of_origin.s +++ b/res/field/scripts/scripts_hall_of_origin.s @@ -5,9 +5,9 @@ ScriptEntry HallOfOrigin_OnLoad - ScriptEntry HallOfOrigin_TriggerArceus + ScriptEntry HallOfOrigin_CoordEvent_Arceus ScriptEntry HallOfOrigin_OnTransition - ScriptEntry HallOfOrigin_TriggerArceus + ScriptEntry HallOfOrigin_CoordEvent_Arceus ScriptEntryEnd HallOfOrigin_OnTransition: @@ -31,7 +31,7 @@ HallOfOrigin_RemoveArceus: ClearFlag FLAG_MAP_LOCAL End -HallOfOrigin_TriggerArceus: +HallOfOrigin_CoordEvent_Arceus: LockAll SetVar VAR_HALL_OF_ORIGIN_STATE, 0 Call HallOfOrigin_PlayerNoticeArceus diff --git a/res/field/scripts/scripts_hearthome_city.s b/res/field/scripts/scripts_hearthome_city.s index 2237590f24..ed036ed514 100644 --- a/res/field/scripts/scripts_hearthome_city.s +++ b/res/field/scripts/scripts_hearthome_city.s @@ -24,16 +24,16 @@ ScriptEntry HearthomeCity_BabyInPram2 ScriptEntry HearthomeCity_BlackBelt1 ScriptEntry HearthomeCity_PokemonBreederF2 - ScriptEntry HearthomeCity_TriggerBunearyAndKeira + ScriptEntry HearthomeCity_CoordEvent_BunearyAndKeira ScriptEntry HearthomeCity_MapSignpost ScriptEntry HearthomeCity_GymSignpost - ScriptEntry HearthomeCity_SignPokemonContestHall - ScriptEntry HearthomeCity_SignPokemonFanClub + ScriptEntry HearthomeCity_SignboardPokemonContestHall + ScriptEntry HearthomeCity_SignboardPokemonFanClub ScriptEntry HearthomeCity_ArrowSignpostWest ScriptEntry HearthomeCity_ArrowSignpostEast - ScriptEntry HearthomeCity_SignAmitySquareWestGate - ScriptEntry HearthomeCity_SignAmitySquareEastGate - ScriptEntry HearthomeCity_SignPoffinHouse + ScriptEntry HearthomeCity_SignboardAmitySquareWestGate + ScriptEntry HearthomeCity_SignboardAmitySquareEastGate + ScriptEntry HearthomeCity_SignboardPoffinHouse ScriptEntry HearthomeCity_GymGuide ScriptEntry HearthomeCity_BlackBelt2 ScriptEntryEnd @@ -145,7 +145,7 @@ HearthomeCity_ThisIsTheContestHall: ReleaseAll End -HearthomeCity_UnusedMovement: +HearthomeCity_Movement_Unused: EmoteExclamationMark Delay16 EndMovement @@ -440,7 +440,7 @@ HearthomeCity_PokemonBreederF2: NPCMessage HearthomeCity_Text_IdLikeToLiveInHearthome End -HearthomeCity_TriggerBunearyAndKeira: +HearthomeCity_CoordEvent_BunearyAndKeira: LockAll ApplyMovement LOCALID_PLAYER, HearthomeCity_Movement_PlayerExclamationMark WaitMovement @@ -517,7 +517,7 @@ HearthomeCity_Movement_BunearyEnter: WalkFastWest 9 EndMovement -HearthomeCity_UnusedMovement2: +HearthomeCity_Movement_Unused2: WalkFastEast 8 EndMovement @@ -539,11 +539,11 @@ HearthomeCity_GymSignpost: ShowScrollingSign HearthomeCity_Text_SignHearthomeCityPokemonGym End -HearthomeCity_SignPokemonContestHall: +HearthomeCity_SignboardPokemonContestHall: ShowLandmarkSign HearthomeCity_Text_SignPokemonContestHall End -HearthomeCity_SignPokemonFanClub: +HearthomeCity_SignboardPokemonFanClub: ShowLandmarkSign HearthomeCity_Text_SignPokemonFanClub End @@ -555,15 +555,15 @@ HearthomeCity_ArrowSignpostEast: ShowArrowSign HearthomeCity_Text_SignRt209SolaceonTown End -HearthomeCity_SignAmitySquareWestGate: +HearthomeCity_SignboardAmitySquareWestGate: ShowLandmarkSign HearthomeCity_Text_SignAmitySquareWestGate End -HearthomeCity_SignAmitySquareEastGate: +HearthomeCity_SignboardAmitySquareEastGate: ShowLandmarkSign HearthomeCity_Text_SignAmitySquareEastGate End -HearthomeCity_SignPoffinHouse: +HearthomeCity_SignboardPoffinHouse: ShowLandmarkSign HearthomeCity_Text_SignThePoffinHouse End diff --git a/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_1.s b/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_1.s index d3c957ebb6..dee4e68723 100644 --- a/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_1.s +++ b/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_1.s @@ -3,20 +3,20 @@ ScriptEntry HearthomeCityDPGymElevatorRoom1_OnTransition - ScriptEntry HearthomeCityDPGymElevatorRoom1_TriggerMoveLift - ScriptEntry HearthomeCityDPGymElevatorRoom1_SignCorrect - ScriptEntry HearthomeCityDPGymElevatorRoom1_SignQuestion + ScriptEntry HearthomeCityDPGymElevatorRoom1_CoordEvent_MoveLift + ScriptEntry HearthomeCityDPGymElevatorRoom1_BgSignCorrect + ScriptEntry HearthomeCityDPGymElevatorRoom1_BgSignQuestion ScriptEntryEnd HearthomeCityDPGymElevatorRoom1_OnTransition: InitPersistedMapFeaturesForHearthomeGym End -HearthomeCityDPGymElevatorRoom1_TriggerMoveLift: +HearthomeCityDPGymElevatorRoom1_CoordEvent_MoveLift: MoveHearthomeGymDPLift End -HearthomeCityDPGymElevatorRoom1_SignCorrect: +HearthomeCityDPGymElevatorRoom1_BgSignCorrect: LockAll PlaySE SEQ_SE_DP_UG_020 Message HearthomeCityDPGymElevatorRoom1_Text_Correct @@ -25,7 +25,7 @@ HearthomeCityDPGymElevatorRoom1_SignCorrect: ReleaseAll End -HearthomeCityDPGymElevatorRoom1_SignQuestion: +HearthomeCityDPGymElevatorRoom1_BgSignQuestion: PlaySE SEQ_SE_CONFIRM LockAll Message HearthomeCityDPGymElevatorRoom1_Text_WhatIs3Times13 diff --git a/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_2.s b/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_2.s index 76f2321fc1..eef0e9c415 100644 --- a/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_2.s +++ b/res/field/scripts/scripts_hearthome_city_dp_gym_elevator_room_2.s @@ -3,20 +3,20 @@ ScriptEntry HearthomeCityDPGymElevatorRoom2_OnTransition - ScriptEntry HearthomeCityDPGymElevatorRoom2_TriggerMoveLift - ScriptEntry HearthomeCityDPGymElevatorRoom2_SignCorrect - ScriptEntry HearthomeCityDPGymElevatorRoom2_SignQuestion + ScriptEntry HearthomeCityDPGymElevatorRoom2_CoordEvent_MoveLift + ScriptEntry HearthomeCityDPGymElevatorRoom2_BgSignCorrect + ScriptEntry HearthomeCityDPGymElevatorRoom2_BgSignQuestion ScriptEntryEnd HearthomeCityDPGymElevatorRoom2_OnTransition: InitPersistedMapFeaturesForHearthomeGym End -HearthomeCityDPGymElevatorRoom2_TriggerMoveLift: +HearthomeCityDPGymElevatorRoom2_CoordEvent_MoveLift: MoveHearthomeGymDPLift End -HearthomeCityDPGymElevatorRoom2_SignCorrect: +HearthomeCityDPGymElevatorRoom2_BgSignCorrect: LockAll PlaySE SEQ_SE_DP_UG_020 Message HearthomeCityDPGymElevatorRoom2_Text_Correct @@ -25,7 +25,7 @@ HearthomeCityDPGymElevatorRoom2_SignCorrect: ReleaseAll End -HearthomeCityDPGymElevatorRoom2_SignQuestion: +HearthomeCityDPGymElevatorRoom2_BgSignQuestion: PlaySE SEQ_SE_CONFIRM LockAll Message HearthomeCityDPGymElevatorRoom2_Text_WhatsFirstRoomsAnswer diff --git a/res/field/scripts/scripts_hearthome_city_dp_gym_leader_room.s b/res/field/scripts/scripts_hearthome_city_dp_gym_leader_room.s index ac10eb082d..f053fbf90c 100644 --- a/res/field/scripts/scripts_hearthome_city_dp_gym_leader_room.s +++ b/res/field/scripts/scripts_hearthome_city_dp_gym_leader_room.s @@ -42,7 +42,7 @@ HearthomeCityDPGymLeaderRoom_FantinaSpinEast: HearthomeCityDPGymLeaderRoom_FantinaBattle: GoToIfBadgeAcquired BADGE_ID_RELIC, HearthomeCityDPGymLeaderRoom_FantinaPostBattle - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 100, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_HEARTHOME_CITY_DP_GYM_LEADER_ROOM, 0, 0, 0 Message HearthomeCityDPGymLeaderRoom_Text_Dummy0 CloseMessage StartTrainerBattle TRAINER_LEADER_FANTINA @@ -63,7 +63,7 @@ HearthomeCityDPGymLeaderRoom_FantinaBattle: SetTrainerFlag TRAINER_SCHOOL_KID_CHANCE SetTrainerFlag TRAINER_SCHOOL_KID_MACKENZIE SetTrainerFlag TRAINER_YOUNGSTER_DONNY - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 100, TRAINER_LEADER_FANTINA, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_HEARTHOME_CITY_DP_GYM_LEADER_ROOM, TRAINER_LEADER_FANTINA, 0, 0 SetVar VAR_HEARTHOME_STATE, 1 SetFlag FLAG_HIDE_HEARTHOME_ROUTE_209_ROADBLOCK ClearFlag FLAG_HIDE_HEARTHOME_ROUTE_209_GATE_RIVAL diff --git a/res/field/scripts/scripts_hearthome_city_gym_leader_room.s b/res/field/scripts/scripts_hearthome_city_gym_leader_room.s index 9dfe2fec51..efcbb7c2b7 100644 --- a/res/field/scripts/scripts_hearthome_city_gym_leader_room.s +++ b/res/field/scripts/scripts_hearthome_city_gym_leader_room.s @@ -55,7 +55,7 @@ HearthomeGym_FantinaPrepareSpinFaceWest: HearthomeGym_FantinaMain: GoToIfBadgeAcquired BADGE_ID_RELIC, HearthomeGym_FantinaAfterBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 91, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_HEARTHOME_CITY_GYM_LEADER_ROOM, 0, 0, 0 Message HearthomeGym_Text_FantinaIntro CloseMessage SetFlag FLAG_MAP_LOCAL @@ -78,7 +78,7 @@ HearthomeGym_FantinaMain: SetTrainerFlag TRAINER_SCHOOL_KID_CHANCE SetTrainerFlag TRAINER_SCHOOL_KID_MACKENZIE SetTrainerFlag TRAINER_YOUNGSTER_DONNY - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 91, TRAINER_LEADER_FANTINA, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_HEARTHOME_CITY_GYM_LEADER_ROOM, TRAINER_LEADER_FANTINA, 0, 0 SetVar VAR_HEARTHOME_STATE, 1 SetFlag FLAG_HIDE_HEARTHOME_ROUTE_209_ROADBLOCK ClearFlag FLAG_HIDE_HEARTHOME_ROUTE_209_GATE_RIVAL diff --git a/res/field/scripts/scripts_hearthome_city_northeast_house_1f.s b/res/field/scripts/scripts_hearthome_city_northeast_house_1f.s index dc6835a643..69169dc727 100644 --- a/res/field/scripts/scripts_hearthome_city_northeast_house_1f.s +++ b/res/field/scripts/scripts_hearthome_city_northeast_house_1f.s @@ -9,7 +9,7 @@ ScriptEntry HearthomeCityNortheastHouse1F_Twin ScriptEntry HearthomeCityNortheastHouse1F_SchoolKidM ScriptEntry HearthomeCityNortheastHouse1F_Lass - ScriptEntry HearthomeCityNortheastHouse1F_Unused + ScriptEntry HearthomeCityNortheastHouse1F_Dummy8 ScriptEntry HearthomeCityNortheastHouse1F_Pikachu ScriptEntryEnd @@ -41,7 +41,7 @@ HearthomeCityNortheastHouse1F_Lass: NPCMessage HearthomeCityNortheastHouse1F_Text_WowYoureAPokemonTrainer End -HearthomeCityNortheastHouse1F_Unused: +HearthomeCityNortheastHouse1F_Dummy8: NPCMessage HearthomeCityNortheastHouse1F_Text_Dummy7 End diff --git a/res/field/scripts/scripts_hearthome_city_pokecenter_2f.s b/res/field/scripts/scripts_hearthome_city_pokecenter_2f.s index c2799a8044..2622f70ac4 100644 --- a/res/field/scripts/scripts_hearthome_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_hearthome_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry HearthomeCityPokecenter2F_UnusedEntry1 + ScriptEntry HearthomeCityPokecenter2F_Dummy1 ScriptEntryEnd -HearthomeCityPokecenter2F_UnusedEntry1: +HearthomeCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_hearthome_city_pokecenter_b1f.s b/res/field/scripts/scripts_hearthome_city_pokecenter_b1f.s index 1a40bb03f3..92584a9043 100644 --- a/res/field/scripts/scripts_hearthome_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_hearthome_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry HearthomeCityPokecenterB1F_UnusedEntry1 + ScriptEntry HearthomeCityPokecenterB1F_Dummy1 ScriptEntryEnd -HearthomeCityPokecenterB1F_UnusedEntry1: +HearthomeCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s b/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s b/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_contest_hall_lobby.s b/res/field/scripts/scripts_init_contest_hall_lobby.s index e7318367dd..f718cb4d48 100644 --- a/res/field/scripts/scripts_init_contest_hall_lobby.s +++ b/res/field/scripts/scripts_init_contest_hall_lobby.s @@ -6,7 +6,7 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 5, 0x2648 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 5, 0x2648 InitScriptGoToIfEqual VAR_CONTEST_HALL_LOBBY_STATE, 0, 1 InitScriptFrameTableEnd diff --git a/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s b/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s b/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s b/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_global_terminal_1f.s b/res/field/scripts/scripts_init_global_terminal_1f.s index e6afd353dd..61cf638705 100644 --- a/res/field/scripts/scripts_init_global_terminal_1f.s +++ b/res/field/scripts/scripts_init_global_terminal_1f.s @@ -6,7 +6,7 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 6, 12 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 6, 12 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s b/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s b/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_new_game.s b/res/field/scripts/scripts_init_new_game.s index 83eb2935b4..8d47e4c9f5 100644 --- a/res/field/scripts/scripts_init_new_game.s +++ b/res/field/scripts/scripts_init_new_game.s @@ -27,7 +27,7 @@ InitNewGame: SetFlag FLAG_HIDE_SANDGEM_TOWN_LAB_PROF_OAK SetFlag FLAG_HIDE_VALLEY_WINDWORKS_BUILDING_LITTLE_GIRL SetFlag FLAG_HIDE_VALLEY_WINDWORKS_OUTSIDE_LOOKER - SetFlag FLAG_UNK_0x01FC + SetFlag FLAG_HIDE_ETERNA_FOREST_GARDENIA SetFlag FLAG_HIDE_CELESTIC_TOWN_CYNTHIA SetFlag FLAG_HIDE_CELESTIC_TOWN_CAVE_CYRUS SetFlag FLAG_HIDE_CELESTIC_TOWN_CAVE_ELDER diff --git a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s b/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s b/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s b/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s b/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s b/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_jubilife_city_unknown_house_1.s b/res/field/scripts/scripts_init_unused_jubilife_city_house_1.s similarity index 100% rename from res/field/scripts/scripts_init_jubilife_city_unknown_house_1.s rename to res/field/scripts/scripts_init_unused_jubilife_city_house_1.s diff --git a/res/field/scripts/scripts_init_jubilife_city_unknown_house_2.s b/res/field/scripts/scripts_init_unused_jubilife_city_house_2.s similarity index 100% rename from res/field/scripts/scripts_init_jubilife_city_unknown_house_2.s rename to res/field/scripts/scripts_init_unused_jubilife_city_house_2.s diff --git a/res/field/scripts/scripts_init_jubilife_city_unknown_house_3.s b/res/field/scripts/scripts_init_unused_jubilife_city_house_3.s similarity index 100% rename from res/field/scripts/scripts_init_jubilife_city_unknown_house_3.s rename to res/field/scripts/scripts_init_unused_jubilife_city_house_3.s diff --git a/res/field/scripts/scripts_init_jubilife_city_unknown_house_4.s b/res/field/scripts/scripts_init_unused_jubilife_city_house_4.s similarity index 100% rename from res/field/scripts/scripts_init_jubilife_city_unknown_house_4.s rename to res/field/scripts/scripts_init_unused_jubilife_city_house_4.s diff --git a/res/field/scripts/scripts_init_sunyshore_city_unknown_house_1.s b/res/field/scripts/scripts_init_unused_sunyshore_city_house_1.s similarity index 100% rename from res/field/scripts/scripts_init_sunyshore_city_unknown_house_1.s rename to res/field/scripts/scripts_init_unused_sunyshore_city_house_1.s diff --git a/res/field/scripts/scripts_init_sunyshore_city_unknown_house_2.s b/res/field/scripts/scripts_init_unused_sunyshore_city_house_2.s similarity index 100% rename from res/field/scripts/scripts_init_sunyshore_city_unknown_house_2.s rename to res/field/scripts/scripts_init_unused_sunyshore_city_house_2.s diff --git a/res/field/scripts/scripts_init_verity_lakefront_unknown_house.s b/res/field/scripts/scripts_init_unused_verity_lakefront_house.s similarity index 100% rename from res/field/scripts/scripts_init_verity_lakefront_unknown_house.s rename to res/field/scripts/scripts_init_unused_verity_lakefront_house.s diff --git a/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s b/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_iron_island_b1f_right_room.s b/res/field/scripts/scripts_iron_island_b1f_right_room.s index ad2a197d8b..f258f03e3b 100644 --- a/res/field/scripts/scripts_iron_island_b1f_right_room.s +++ b/res/field/scripts/scripts_iron_island_b1f_right_room.s @@ -2,14 +2,14 @@ ScriptEntry IronIslandB1FRightRoom_OnTransition - ScriptEntry IronIslandB1FRightRoom_TriggerPlatformLift + ScriptEntry IronIslandB1FRightRoom_CoordEvent_PlatformLift ScriptEntryEnd IronIslandB1FRightRoom_OnTransition: InitPersistedMapFeaturesForPlatformLift End -IronIslandB1FRightRoom_TriggerPlatformLift: +IronIslandB1FRightRoom_CoordEvent_PlatformLift: TriggerPlatformLift End diff --git a/res/field/scripts/scripts_iron_island_b2f_left_room.s b/res/field/scripts/scripts_iron_island_b2f_left_room.s index 685e200dcd..125a72735d 100644 --- a/res/field/scripts/scripts_iron_island_b2f_left_room.s +++ b/res/field/scripts/scripts_iron_island_b2f_left_room.s @@ -5,14 +5,14 @@ ScriptEntry IronIslandB2FLeftRoom_OnTransition - ScriptEntry IronIslandB2FLeftRoom_TriggerPlatformLift - ScriptEntry IronIslandB2FLeftRoom_TriggerStartFollowingRiley - ScriptEntry IronIslandB2FLeftRoom_TriggerPlayerLeaveRiley - ScriptEntry IronIslandB2FLeftRoom_Unused5 - ScriptEntry IronIslandB2FLeftRoom_Unused6 - ScriptEntry IronIslandB2FLeftRoom_Unused7 + ScriptEntry IronIslandB2FLeftRoom_CoordEvent_PlatformLift + ScriptEntry IronIslandB2FLeftRoom_CoordEvent_StartFollowingRiley + ScriptEntry IronIslandB2FLeftRoom_CoordEvent_PlayerLeaveRiley + ScriptEntry IronIslandB2FLeftRoom_Dummy5 + ScriptEntry IronIslandB2FLeftRoom_Dummy6 + ScriptEntry IronIslandB2FLeftRoom_Dummy7 ScriptEntry IronIslandB2FLeftRoom_Riley - ScriptEntry IronIslandB2FLeftRoom_TriggerGrunts + ScriptEntry IronIslandB2FLeftRoom_CoordEvent_Grunts ScriptEntryEnd IronIslandB2FLeftRoom_OnTransition: @@ -31,11 +31,11 @@ IronIslandB2FLeftRoom_SetRileyPositionAtExit: SetObjectEventDir LOCALID_RILEY, DIR_EAST End -IronIslandB2FLeftRoom_TriggerPlatformLift: +IronIslandB2FLeftRoom_CoordEvent_PlatformLift: TriggerPlatformLift End -IronIslandB2FLeftRoom_TriggerStartFollowingRiley: +IronIslandB2FLeftRoom_CoordEvent_StartFollowingRiley: LockAll SetPlayerBike FALSE GetPlayerMapPos VAR_0x8004, VAR_0x8005 @@ -77,7 +77,7 @@ IronIslandB2FLeftRoom_HiLetsTeamUp: Message IronIslandB2FLeftRoom_Text_HiLetsTeamUp Return -IronIslandB2FLeftRoom_TriggerPlayerLeaveRiley: +IronIslandB2FLeftRoom_CoordEvent_PlayerLeaveRiley: LockAll ApplyMovement LOCALID_PLAYER, IronIslandB2FLeftRoom_Movement_PlayerWalkOnSpotWest ApplyMovement LOCALID_RILEY, IronIslandB2FLeftRoom_Movement_RileyFaceEast @@ -143,10 +143,10 @@ IronIslandB2FLeftRoom_Movement_RileyWalkBackZ3: WalkNormalWest EndMovement -IronIslandB2FLeftRoom_Unused5: +IronIslandB2FLeftRoom_Dummy5: End -IronIslandB2FLeftRoom_TriggerGrunts: +IronIslandB2FLeftRoom_CoordEvent_Grunts: LockAll ClearHasPartner SetMovementType LOCALID_RILEY, MOVEMENT_TYPE_LOOK_WEST @@ -207,12 +207,12 @@ IronIslandB2FLeftRoom_PlayerRileyWalkToGruntsZ41: WaitMovement Return -IronIslandB2FLeftRoom_UnusedMovement6: +IronIslandB2FLeftRoom_Unused: ApplyMovement LOCALID_RILEY, IronIslandB2FLeftRoom_Movement_Unused6 WaitMovement Return -IronIslandB2FLeftRoom_UnusedMovement7: +IronIslandB2FLeftRoom_Unused2: ApplyMovement LOCALID_RILEY, IronIslandB2FLeftRoom_Movement_Unused7 WaitMovement Return @@ -381,10 +381,10 @@ IronIslandB2FLeftRoom_Movement_PlayerWalkToGruntMSouth: WalkNormalWest EndMovement -IronIslandB2FLeftRoom_Unused6: +IronIslandB2FLeftRoom_Dummy6: End -IronIslandB2FLeftRoom_Unused7: +IronIslandB2FLeftRoom_Dummy7: End IronIslandB2FLeftRoom_Riley: diff --git a/res/field/scripts/scripts_iron_island_b3f.s b/res/field/scripts/scripts_iron_island_b3f.s index 1ea2dd0cd7..28ab392382 100644 --- a/res/field/scripts/scripts_iron_island_b3f.s +++ b/res/field/scripts/scripts_iron_island_b3f.s @@ -2,8 +2,8 @@ ScriptEntry IronIslandB3F_OnTransition - ScriptEntry IronIslandB3F_TriggerPlatformLift - ScriptEntry IronIslandB3F_Unused + ScriptEntry IronIslandB3F_CoordEvent_PlatformLift + ScriptEntry IronIslandB3F_Dummy3 ScriptEntry IronIslandB3F_OnLoad ScriptEntryEnd @@ -29,7 +29,7 @@ IronIslandB3F_RemoveWarpIronRuinsWithoutRegisteel: SetWarpEventPos 2, 17, 1 End -IronIslandB3F_TriggerPlatformLift: +IronIslandB3F_CoordEvent_PlatformLift: TriggerPlatformLift End @@ -37,7 +37,7 @@ IronIslandB3F_ResetIronRuinsState: SetVar VAR_IRON_RUINS_STATE, 0 Return -IronIslandB3F_Unused: +IronIslandB3F_Dummy3: End .balign 4, 0 diff --git a/res/field/scripts/scripts_jubilife_city.s b/res/field/scripts/scripts_jubilife_city.s index b83a768669..2912a9eaa0 100644 --- a/res/field/scripts/scripts_jubilife_city.s +++ b/res/field/scripts/scripts_jubilife_city.s @@ -5,9 +5,9 @@ ScriptEntry JubilifeCity_OnTransition - ScriptEntry JubilifeCity_TriggerFirstArrival - ScriptEntry JubilifeCity_TriggerLookerBlockRoute203 - ScriptEntry JubilifeCity_TriggerTeamGalactic + ScriptEntry JubilifeCity_CoordEvent_FirstArrival + ScriptEntry JubilifeCity_CoordEvent_LookerBlockRoute203 + ScriptEntry JubilifeCity_CoordEvent_TeamGalactic ScriptEntry JubilifeCity_Looker ScriptEntry JubilifeCity_SchoolKidM1 ScriptEntry JubilifeCity_Twin @@ -20,18 +20,18 @@ ScriptEntry JubilifeCity_Clown1 ScriptEntry JubilifeCity_Clown2 ScriptEntry JubilifeCity_Clown3 - ScriptEntry JubilifeCity_TriggerPoketchCampaign + ScriptEntry JubilifeCity_CoordEvent_PoketchCampaign ScriptEntry JubilifeCity_PoketchCoPresident - ScriptEntry JubilifeCity_TriggerGTSGreeterBlockPlayer + ScriptEntry JubilifeCity_CoordEvent_GTSGreeterBlockPlayer ScriptEntry JubilifeCity_KidWithNDS1 ScriptEntry JubilifeCity_KidWithNDS2 - ScriptEntry JubilifeCity_MapSign - ScriptEntry JubilifeCity_LandmarkSignJubilifeCondominiums - ScriptEntry JubilifeCity_LandmarkSignPoketchCompany - ScriptEntry JubilifeCity_LandmarkSignTrainersSchool - ScriptEntry JubilifeCity_LandmarkSignJubilifeTV - ScriptEntry JubilifeCity_LandmarkSignGlobalTerminal - ScriptEntry JubilifeCity_TriggerLookerPalPad + ScriptEntry JubilifeCity_MapSignpost + ScriptEntry JubilifeCity_SignboardJubilifeCondominiums + ScriptEntry JubilifeCity_SignboardPoketchCompany + ScriptEntry JubilifeCity_SignboardTrainersSchool + ScriptEntry JubilifeCity_SignboardJubilifeTV + ScriptEntry JubilifeCity_SignboardGlobalTerminal + ScriptEntry JubilifeCity_CoordEvent_LookerPalPad ScriptEntryEnd JubilifeCity_OnTransition: @@ -62,7 +62,7 @@ JubilifeCity_SetCounterpartGraphicsLucas: SetVar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_PLAYER_M End -JubilifeCity_TriggerFirstArrival: +JubilifeCity_CoordEvent_FirstArrival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8004, 173, JubilifeCity_FirstArrivalX173 @@ -460,7 +460,7 @@ JubilifeCity_AceTrainerM3: NPCMessage JubilifeCity_Text_PastHereIsTheGlobalTerminal End -JubilifeCity_TriggerGTSGreeterBlockPlayer: +JubilifeCity_CoordEvent_GTSGreeterBlockPlayer: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 779, JubilifeCity_GTSGreeterBlockPlayerZ779 @@ -558,7 +558,7 @@ JubilifeCity_Movement_PlayerStepBackEast: WalkNormalEast EndMovement -JubilifeCity_TriggerLookerBlockRoute203: +JubilifeCity_CoordEvent_LookerBlockRoute203: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 757, JubilifeCity_LookerWalkToPlayerZ757 @@ -793,7 +793,7 @@ JubilifeCity_Movement_LookerFaceSouth: FaceSouth EndMovement -JubilifeCity_TriggerTeamGalactic: +JubilifeCity_CoordEvent_TeamGalactic: LockAll ApplyMovement LOCALID_GRUNT_M_2, JubilifeCity_Movement_GruntWalkOnSpotEast WaitMovement @@ -1068,14 +1068,14 @@ JubilifeCity_Movement_PlayerWatchCounterpartAndProfRowanLeave: WalkOnSpotNormalSouth EndMovement -JubilifeCity_UnusedMovement: +JubilifeCity_Movement_Unused: Delay8 WalkOnSpotNormalEast Delay8 WalkOnSpotNormalSouth EndMovement -JubilifeCity_UnusedMovement2: +JubilifeCity_Movement_Unused2: Delay8 WalkOnSpotNormalWest Delay8 @@ -1109,12 +1109,12 @@ JubilifeCity_Movement_CounterpartLeaveAfterGalacticBattle: WalkNormalSouth 9 EndMovement -JubilifeCity_UnusedMovement3: +JubilifeCity_Movement_Unused3: WalkNormalEast WalkNormalSouth 9 EndMovement -JubilifeCity_UnusedMovement4: +JubilifeCity_Movement_Unused4: WalkNormalWest WalkOnSpotNormalEast WalkNormalEast @@ -1167,11 +1167,11 @@ JubilifeCity_Movement_ProfRowanLeave: WalkNormalSouth 9 EndMovement -JubilifeCity_UnusedMovement5: +JubilifeCity_Movement_Unused5: WalkNormalSouth 9 EndMovement -JubilifeCity_UnusedMovement6: +JubilifeCity_Movement_Unused6: WalkOnSpotNormalWest WalkNormalWest WalkNormalSouth 9 @@ -1187,23 +1187,23 @@ JubilifeCity_Movement_ProfRowanWalkOnSpotWest2: WalkOnSpotNormalWest EndMovement -JubilifeCity_UnusedMovement7: +JubilifeCity_Movement_Unused7: WalkOnSpotNormalWest EndMovement -JubilifeCity_UnusedMovement8: +JubilifeCity_Movement_Unused8: WalkOnSpotNormalWest EndMovement -JubilifeCity_UnusedMovement9: +JubilifeCity_Movement_Unused9: WalkOnSpotNormalWest EndMovement -JubilifeCity_UnusedMovement10: +JubilifeCity_Movement_Unused10: WalkOnSpotNormalWest EndMovement -JubilifeCity_UnusedMovement11: +JubilifeCity_Movement_Unused11: WalkOnSpotNormalWest EndMovement @@ -1287,31 +1287,31 @@ JubilifeCity_SchoolKidM2: NPCMessage JubilifeCity_Text_AtMostYouCanHaveSixPokemonWithYou End -JubilifeCity_MapSign: +JubilifeCity_MapSignpost: ShowMapSign JubilifeCity_Text_MapSign End -JubilifeCity_LandmarkSignJubilifeCondominiums: +JubilifeCity_SignboardJubilifeCondominiums: ShowLandmarkSign JubilifeCity_Text_JubilifeCondominiumsTenantsWanted End -JubilifeCity_LandmarkSignPoketchCompany: +JubilifeCity_SignboardPoketchCompany: ShowLandmarkSign JubilifeCity_Text_ThePoketchCompanyPokemonWatchesForTheWorld End -JubilifeCity_LandmarkSignTrainersSchool: +JubilifeCity_SignboardTrainersSchool: ShowLandmarkSign JubilifeCity_Text_TrainersSchoolTheFirstStepForTrainers End -JubilifeCity_LandmarkSignJubilifeTV: +JubilifeCity_SignboardJubilifeTV: ShowLandmarkSign JubilifeCity_Text_JubilifeTVTheFunAndGamesTVStation End -JubilifeCity_LandmarkSignGlobalTerminal: +JubilifeCity_SignboardGlobalTerminal: ShowLandmarkSign JubilifeCity_Text_TheGlobalTerminalYourGatewayToTheWholeWorld End -JubilifeCity_TriggerPoketchCampaign: +JubilifeCity_CoordEvent_PoketchCampaign: LockAll ApplyMovement LOCALID_POKETCH_CO_PRESIDENT, JubilifeCity_Movement_PoketchCoPresidentNoticePlayer ApplyMovement LOCALID_PLAYER, JubilifeCity_Movement_PlayerFaceNorthPoketchCoPresident @@ -1627,7 +1627,7 @@ JubilifeCity_KidWithNDS2: NPCMessage JubilifeCity_TextIMadeMyPokemonHoldAnItemBeforeTradingIt End -JubilifeCity_TriggerLookerPalPad: +JubilifeCity_CoordEvent_LookerPalPad: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 SetObjectEventPos LOCALID_LOOKER, 179, VAR_0x8005 diff --git a/res/field/scripts/scripts_jubilife_city_pokecenter_2f.s b/res/field/scripts/scripts_jubilife_city_pokecenter_2f.s index 43f53ae5ce..351e2b538d 100644 --- a/res/field/scripts/scripts_jubilife_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_jubilife_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry JubilifeCityPokecenter2F_UnusedEntry1 + ScriptEntry JubilifeCityPokecenter2F_Dummy1 ScriptEntryEnd -JubilifeCityPokecenter2F_UnusedEntry1: +JubilifeCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_jubilife_city_pokecenter_b1f.s b/res/field/scripts/scripts_jubilife_city_pokecenter_b1f.s index b6e11d5ea2..81373383c9 100644 --- a/res/field/scripts/scripts_jubilife_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_jubilife_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry JubilifeCityPokecenterB1F_UnusedEntry1 + ScriptEntry JubilifeCityPokecenterB1F_Dummy1 ScriptEntryEnd -JubilifeCityPokecenterB1F_UnusedEntry1: +JubilifeCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_jubilife_city_unknown_house_1.s b/res/field/scripts/scripts_jubilife_city_unknown_house_1.s deleted file mode 100644 index 45c3869557..0000000000 --- a/res/field/scripts/scripts_jubilife_city_unknown_house_1.s +++ /dev/null @@ -1,12 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/jubilife_city_unknown_house_1.h" - - - ScriptEntry _0006 - ScriptEntryEnd - -_0006: - NPCMessage 0 - End - - .balign 4, 0 diff --git a/res/field/scripts/scripts_jubilife_city_unknown_house_2.s b/res/field/scripts/scripts_jubilife_city_unknown_house_2.s deleted file mode 100644 index 27a07f49f0..0000000000 --- a/res/field/scripts/scripts_jubilife_city_unknown_house_2.s +++ /dev/null @@ -1,12 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/jubilife_city_unknown_house_2.h" - - - ScriptEntry _0006 - ScriptEntryEnd - -_0006: - NPCMessage 0 - End - - .balign 4, 0 diff --git a/res/field/scripts/scripts_jubilife_city_unknown_house_3.s b/res/field/scripts/scripts_jubilife_city_unknown_house_3.s deleted file mode 100644 index 67dc52480d..0000000000 --- a/res/field/scripts/scripts_jubilife_city_unknown_house_3.s +++ /dev/null @@ -1,15 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/jubilife_city_unknown_house_3.h" - - - ScriptEntry _000A - ScriptEntry _001D - ScriptEntryEnd - -_000A: - NPCMessage 0 - End - -_001D: - NPCMessage 1 - End diff --git a/res/field/scripts/scripts_jubilife_city_unknown_house_4.s b/res/field/scripts/scripts_jubilife_city_unknown_house_4.s deleted file mode 100644 index a760672854..0000000000 --- a/res/field/scripts/scripts_jubilife_city_unknown_house_4.s +++ /dev/null @@ -1,12 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/jubilife_city_unknown_house_4.h" - - - ScriptEntry _0006 - ScriptEntryEnd - -_0006: - NPCMessage 0 - End - - .balign 4, 0 diff --git a/res/field/scripts/scripts_jubilife_tv_1f.s b/res/field/scripts/scripts_jubilife_tv_1f.s index 52f74f1a5c..0b7b9e2885 100644 --- a/res/field/scripts/scripts_jubilife_tv_1f.s +++ b/res/field/scripts/scripts_jubilife_tv_1f.s @@ -2,13 +2,13 @@ #include "res/text/bank/jubilife_tv_1f.h" - ScriptEntry JubilifeTV1F_Unused1 + ScriptEntry JubilifeTV1F_Dummy1 ScriptEntry JubilifeTV1F_GymGuide - ScriptEntry JubilifeTV1F_Unused2 + ScriptEntry JubilifeTV1F_Dummy3 ScriptEntry JubilifeTV1F_AceTrainerSnowF ScriptEntry JubilifeTV1F_Beauty ScriptEntry JubilifeTV1F_MiddleAgedMan - ScriptEntry JubilifeTV1F_Unused3 + ScriptEntry JubilifeTV1F_Dummy7 ScriptEntry JubilifeTV1F_OnTransition ScriptEntry JubilifeTV1F_AceTrainerM ScriptEntryEnd @@ -16,14 +16,14 @@ JubilifeTV1F_OnTransition: End -JubilifeTV1F_Unused1: +JubilifeTV1F_Dummy1: End JubilifeTV1F_GymGuide: NPCMessage JubilifeTV1F_Text_WhyDontYouTryDressingUpYourPokemonNow End -JubilifeTV1F_Unused2: +JubilifeTV1F_Dummy3: End JubilifeTV1F_AceTrainerSnowF: @@ -185,7 +185,7 @@ JubilifeTV1F_MiddleAgedMan: NPCMessage JubilifeTV1F_Text_ImGoingToGetCommercialsShownOnTV End -JubilifeTV1F_Unused3: +JubilifeTV1F_Dummy7: End JubilifeTV1F_AceTrainerM: diff --git a/res/field/scripts/scripts_lake_acuity.s b/res/field/scripts/scripts_lake_acuity.s index d50f47151b..bf64fc85a6 100644 --- a/res/field/scripts/scripts_lake_acuity.s +++ b/res/field/scripts/scripts_lake_acuity.s @@ -3,10 +3,10 @@ #include "res/field/events/events_lake_acuity.h" - ScriptEntry LakeAcuity_TriggerJupiterRival + ScriptEntry LakeAcuity_CoordEvent_JupiterRival ScriptEntryEnd -LakeAcuity_TriggerJupiterRival: +LakeAcuity_CoordEvent_JupiterRival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 AddFreeCamera VAR_0x8004, VAR_0x8005 diff --git a/res/field/scripts/scripts_lake_valor.s b/res/field/scripts/scripts_lake_valor.s index 657e5e26a3..89b1440d48 100644 --- a/res/field/scripts/scripts_lake_valor.s +++ b/res/field/scripts/scripts_lake_valor.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry LakeValor_UnusedEntry1 + ScriptEntry LakeValor_Dummy1 ScriptEntryEnd -LakeValor_UnusedEntry1: +LakeValor_Dummy1: End diff --git a/res/field/scripts/scripts_lake_verity.s b/res/field/scripts/scripts_lake_verity.s index 703b6fbd83..5e9cf2e7a5 100644 --- a/res/field/scripts/scripts_lake_verity.s +++ b/res/field/scripts/scripts_lake_verity.s @@ -7,7 +7,7 @@ ScriptEntry LakeVerity_OnLoad ScriptEntry LakeVerity_ProfRowan ScriptEntry LakeVerity_Counterpart - ScriptEntry LakeVerity_OnFrameProfRowanNoticePlayer + ScriptEntry LakeVerity_OnFrame_ProfRowanNoticePlayer ScriptEntry LakeVerity_Mars ScriptEntry LakeVerity_GruntM ScriptEntryEnd @@ -154,7 +154,7 @@ LakeVerity_Movement_RowanWalkOnSpotEast: WalkOnSpotNormalEast EndMovement -LakeVerity_OnFrameProfRowanNoticePlayer: +LakeVerity_OnFrame_ProfRowanNoticePlayer: LockAll ApplyMovement LOCALID_PROF_ROWAN, LakeVerity_Movement_RowanNoticePlayer WaitMovement @@ -236,11 +236,11 @@ LakeVerity_BlackOut: End .balign 4, 0 -LakeVerity_UnusedMovement: +LakeVerity_Movement_Unused: WalkOnSpotNormalNorth EndMovement -LakeVerity_UnusedMovement2: +LakeVerity_Movement_Unused2: WalkNormalNorth 3 EndMovement diff --git a/res/field/scripts/scripts_lake_verity_low_water.s b/res/field/scripts/scripts_lake_verity_low_water.s index 06be6aee7a..4ebf76eed2 100644 --- a/res/field/scripts/scripts_lake_verity_low_water.s +++ b/res/field/scripts/scripts_lake_verity_low_water.s @@ -5,11 +5,11 @@ ScriptEntry LakeVerityLowWater_OnTransition ScriptEntry LakeVerityLowWater_OnLoad - ScriptEntry LakeVerityLowWater_OnFrameCyrus + ScriptEntry LakeVerityLowWater_OnFrame_Cyrus ScriptEntry LakeVerityLowWater_ProfRowan ScriptEntry LakeVerityLowWater_Counterpart - ScriptEntry LakeVerityLowWater_UnusedEntry6 - ScriptEntry LakeVerityLowWater_UnusedEntry7 + ScriptEntry LakeVerityLowWater_Dummy6 + ScriptEntry LakeVerityLowWater_Dummy7 ScriptEntryEnd LakeVerityLowWater_OnTransition: @@ -38,7 +38,7 @@ LakeVerityLowWater_HideStarly: End End -LakeVerityLowWater_OnFrameCyrus: +LakeVerityLowWater_OnFrame_Cyrus: LockAll ClearHasPartner ApplyMovement LOCALID_RIVAL, LakeVerityLowWater_Movement_RivalEnter @@ -126,11 +126,11 @@ LakeVerityLowWater_Movement_PanBackToPlayer: WalkNormalSouth 9 EndMovement -LakeVerityLowWater_UnusedMovement: +LakeVerityLowWater_Movement_Unused: WalkOnSpotNormalEast EndMovement -LakeVerityLowWater_UnusedMovement2: +LakeVerityLowWater_Movement_Unused2: WalkOnSpotNormalSouth Delay8 2 WalkOnSpotNormalEast @@ -149,29 +149,29 @@ LakeVerityLowWater_Movement_CyrusLeave: SetInvisible EndMovement -LakeVerityLowWater_UnusedMovement3: +LakeVerityLowWater_Movement_Unused3: Delay8 WalkOnSpotNormalWest EndMovement -LakeVerityLowWater_UnusedMovement4: +LakeVerityLowWater_Movement_Unused4: WalkOnSpotNormalWest EndMovement -LakeVerityLowWater_UnusedMovement5: +LakeVerityLowWater_Movement_Unused5: WalkNormalSouth 4 WalkNormalWest 2 WalkNormalSouth 5 EndMovement -LakeVerityLowWater_UnusedMovement6: +LakeVerityLowWater_Movement_Unused6: WalkNormalWest WalkNormalSouth 5 WalkNormalWest WalkNormalSouth 3 EndMovement -LakeVerityLowWater_UnusedMovement7: +LakeVerityLowWater_Movement_Unused7: WalkNormalSouth WalkOnSpotNormalWest Delay4 @@ -183,19 +183,19 @@ LakeVerityLowWater_UnusedMovement7: Delay8 EndMovement -LakeVerityLowWater_UnusedMovement8: +LakeVerityLowWater_Movement_Unused8: WalkNormalSouth 3 SetInvisible EndMovement -LakeVerityLowWater_UnusedMovement9: +LakeVerityLowWater_Movement_Unused9: WalkNormalNorth 4 WalkNormalEast 2 WalkNormalNorth 4 WalkOnSpotNormalWest EndMovement -LakeVerityLowWater_UnusedMovement10: +LakeVerityLowWater_Movement_Unused10: WalkOnSpotNormalSouth Delay8 WalkOnSpotFastEast @@ -254,40 +254,40 @@ LakeVerityLowWater_Movement_RivalLeave: WalkFastSouth 2 EndMovement -LakeVerityLowWater_UnusedMovement11: +LakeVerityLowWater_Movement_Unused11: WalkOnSpotNormalEast EndMovement -LakeVerityLowWater_UnusedMovement12: +LakeVerityLowWater_Movement_Unused12: WalkOnSpotFastEast EndMovement -LakeVerityLowWater_UnusedMovement13: +LakeVerityLowWater_Movement_Unused13: WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement14: +LakeVerityLowWater_Movement_Unused14: Delay8 7 WalkNormalEast WalkOnSpotNormalWest EndMovement -LakeVerityLowWater_UnusedMovement15: +LakeVerityLowWater_Movement_Unused15: Delay4 WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement16: +LakeVerityLowWater_Movement_Unused16: WalkNormalWest WalkNormalSouth WalkOnSpotNormalWest EndMovement -LakeVerityLowWater_UnusedMovement17: +LakeVerityLowWater_Movement_Unused17: WalkOnSpotFastSouth EndMovement -LakeVerityLowWater_UnusedMovement18: +LakeVerityLowWater_Movement_Unused18: WalkNormalSouth WalkNormalWest WalkNormalSouth 3 @@ -329,11 +329,11 @@ LakeVerityLowWater_Movement_PlayerWatchRivalLeave: WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement19: +LakeVerityLowWater_Movement_Unused19: WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement20: +LakeVerityLowWater_Movement_Unused20: Delay8 5 WalkOnSpotNormalSouth Delay8 2 @@ -341,25 +341,25 @@ LakeVerityLowWater_UnusedMovement20: WalkOnSpotNormalNorth EndMovement -LakeVerityLowWater_UnusedMovement21: +LakeVerityLowWater_Movement_Unused21: WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement22: +LakeVerityLowWater_Movement_Unused22: Delay8 WalkOnSpotNormalSouth EndMovement -LakeVerityLowWater_UnusedMovement23: +LakeVerityLowWater_Movement_Unused23: Delay8 WalkOnSpotNormalEast EndMovement -LakeVerityLowWater_UnusedMovement24: +LakeVerityLowWater_Movement_Unused24: WalkOnSpotNormalNorth EndMovement -LakeVerityLowWater_UnusedMovement25: +LakeVerityLowWater_Movement_Unused25: Delay8 WalkOnSpotNormalSouth WalkNormalSouth 4 @@ -368,11 +368,11 @@ LakeVerityLowWater_UnusedMovement25: SetInvisible EndMovement -LakeVerityLowWater_UnusedMovement26: +LakeVerityLowWater_Movement_Unused26: WalkFastNorth 6 EndMovement -LakeVerityLowWater_UnusedMovement27: +LakeVerityLowWater_Movement_Unused27: WalkFastWest 7 EndMovement @@ -421,10 +421,10 @@ LakeVerityLowWater_CloseMessage: ReleaseAll End -LakeVerityLowWater_UnusedEntry6: +LakeVerityLowWater_Dummy6: End -LakeVerityLowWater_UnusedEntry7: +LakeVerityLowWater_Dummy7: End .balign 4, 0 diff --git a/res/field/scripts/scripts_mt_coronet_1f_north_room_2.s b/res/field/scripts/scripts_mt_coronet_1f_north_room_2.s index 328aae06ce..4def83f252 100644 --- a/res/field/scripts/scripts_mt_coronet_1f_north_room_2.s +++ b/res/field/scripts/scripts_mt_coronet_1f_north_room_2.s @@ -1,7 +1,7 @@ #include "macros/scrcmd.inc" - ScriptEntry MtCoronet1FNorthRoom2_Unused + ScriptEntry MtCoronet1FNorthRoom2_Dummy1 ScriptEntry MtCoronet1FNorthRoom2_OnTransition ScriptEntry MtCoronet1FNorthRoom2_OnLoad ScriptEntryEnd @@ -31,7 +31,7 @@ MtCoronet1FNorthRoom2_RemoveWarpIcebergRuinsWithoutRegice: SetWarpEventPos 2, 17, 16 End -MtCoronet1FNorthRoom2_Unused: +MtCoronet1FNorthRoom2_Dummy1: End .balign 4, 0 diff --git a/res/field/scripts/scripts_mt_coronet_1f_south.s b/res/field/scripts/scripts_mt_coronet_1f_south.s index 2314de542e..0a6456613e 100644 --- a/res/field/scripts/scripts_mt_coronet_1f_south.s +++ b/res/field/scripts/scripts_mt_coronet_1f_south.s @@ -3,10 +3,10 @@ #include "res/field/events/events_mt_coronet_1f_south.h" - ScriptEntry MtCoronet1FSouth_TriggerCyrus + ScriptEntry MtCoronet1FSouth_CoordEvent_Cyrus ScriptEntryEnd -MtCoronet1FSouth_TriggerCyrus: +MtCoronet1FSouth_CoordEvent_Cyrus: LockAll ApplyMovement LOCALID_PLAYER, MtCoronet1FSouth_Movement_PlayerWatchCyrusWalkToPlayer ApplyMovement LOCALID_CYRUS, MtCoronet1FSouth_Movement_CyrusWalkToPlayer diff --git a/res/field/scripts/scripts_mt_coronet_2f.s b/res/field/scripts/scripts_mt_coronet_2f.s index 6c21b5ff84..f80dc25b91 100644 --- a/res/field/scripts/scripts_mt_coronet_2f.s +++ b/res/field/scripts/scripts_mt_coronet_2f.s @@ -4,7 +4,7 @@ ScriptEntry MtCoronet2F_CavePainting - ScriptEntry MtCoronet2F_TriggerLooker + ScriptEntry MtCoronet2F_CoordEvent_Looker ScriptEntry MtCoronet2F_Looker ScriptEntry MtCoronet2F_CavePaintingShards ScriptEntryEnd @@ -17,7 +17,7 @@ MtCoronet2F_CavePaintingShards: NPCMessage MtCoronet2F_Text_ShardsAreAllThatRemainOfTheAncientCavePainting End -MtCoronet2F_TriggerLooker: +MtCoronet2F_CoordEvent_Looker: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 SetVar VAR_MT_CORONET_2F_STATE, 2 diff --git a/res/field/scripts/scripts_old_chateau_back_middle_east_room.s b/res/field/scripts/scripts_old_chateau_back_middle_east_room.s index b03fb93bbe..5d3e32eb15 100644 --- a/res/field/scripts/scripts_old_chateau_back_middle_east_room.s +++ b/res/field/scripts/scripts_old_chateau_back_middle_east_room.s @@ -3,7 +3,7 @@ ScriptEntry OldChateauBackMiddleEastRoom_OnTransition - ScriptEntry OldChateauBackMiddleEastRoom_OnFrameTwinLeave + ScriptEntry OldChateauBackMiddleEastRoom_OnFrame_TwinLeave ScriptEntryEnd OldChateauBackMiddleEastRoom_OnTransition: @@ -17,7 +17,7 @@ OldChateauBackMiddleEastRoom_ShowTwin: SetVar VAR_OLD_CHATEAU_BACK_MIDDLE_EAST_ROOM_TWIN_STATE, 1 End -OldChateauBackMiddleEastRoom_OnFrameTwinLeave: +OldChateauBackMiddleEastRoom_OnFrame_TwinLeave: LockAll ApplyMovement LOCALID_TWIN, OldChateauBackMiddleEastRoom_Movement_TwinLeave WaitMovement diff --git a/res/field/scripts/scripts_old_chateau_dining_area.s b/res/field/scripts/scripts_old_chateau_dining_area.s index 64c69c2e52..c0707c3a87 100644 --- a/res/field/scripts/scripts_old_chateau_dining_area.s +++ b/res/field/scripts/scripts_old_chateau_dining_area.s @@ -3,7 +3,7 @@ ScriptEntry OldChateauDiningArea_OnTransition - ScriptEntry OldChateauDiningArea_OnFrameOldManLeave + ScriptEntry OldChateauDiningArea_OnFrame_OldManLeave ScriptEntryEnd OldChateauDiningArea_OnTransition: @@ -17,7 +17,7 @@ OldChateauDiningArea_ShowOldMan: SetVar VAR_OLD_CHATEAU_DINING_AREA_OLD_MAN_STATE, 1 End -OldChateauDiningArea_OnFrameOldManLeave: +OldChateauDiningArea_OnFrame_OldManLeave: LockAll ApplyMovement LOCALID_PLAYER, OldChateauDiningArea_Movement_PlayerWatchOldManLeave ApplyMovement LOCALID_OLD_MAN, OldChateauDiningArea_Movement_OldManLeave diff --git a/res/field/scripts/scripts_oreburgh_city.s b/res/field/scripts/scripts_oreburgh_city.s index 89c5590e3c..ab5d45dd2d 100644 --- a/res/field/scripts/scripts_oreburgh_city.s +++ b/res/field/scripts/scripts_oreburgh_city.s @@ -4,8 +4,8 @@ ScriptEntry OreburghCity_Rival ScriptEntry OreburghCity_Youngster - ScriptEntry OreburghCity_TriggerYoungster - ScriptEntry OreburghCity_TriggerRival + ScriptEntry OreburghCity_CoordEvent_Youngster + ScriptEntry OreburghCity_CoordEvent_Rival ScriptEntry OreburghCity_Hiker ScriptEntry OreburghCity_Worker1 ScriptEntry OreburghCity_Worker2 @@ -16,10 +16,10 @@ ScriptEntry OreburghCity_Guitarist ScriptEntry OreburghCity_PokefanF ScriptEntry OreburghCity_Camper - ScriptEntry OreburghCity_MapSign + ScriptEntry OreburghCity_MapSignpost ScriptEntry OreburghCity_GymSignpost - ScriptEntry OreburghCity_ScrollingSignOreburghMiningMuseum - ScriptEntry OreburghCity_ScrollingSignOreburghMine + ScriptEntry OreburghCity_ScrollingSignpostOreburghMiningMuseum + ScriptEntry OreburghCity_ScrollingSignpostOreburghMine ScriptEntry OreburghCity_Machop1 ScriptEntry OreburghCity_BattleGirl2 ScriptEntry OreburghCity_Machop3 @@ -74,7 +74,7 @@ OreburghCity_TheGymLeadersWaitingForYou: ReleaseAll End -OreburghCity_TriggerRival: +OreburghCity_CoordEvent_Rival: LockAll ClearFlag FLAG_HIDE_OREBURGH_CITY_RIVAL SetObjectEventMovementType LOCALID_RIVAL, MOVEMENT_TYPE_LOOK_WEST @@ -304,7 +304,7 @@ OreburghCity_Worker4: NPCMessage OreburghCity_Text_ChopChopMachopChopChopAwayOnRocks End -OreburghCity_TriggerYoungster: +OreburghCity_CoordEvent_Youngster: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 748, OreburghCity_YoungsterWalkToPlayerZ748 @@ -516,7 +516,7 @@ OreburghCity_Camper: NPCMessage OreburghCity_Text_WhenIRunAroundWithMyRunningShoesOnImTheCenterOfAttention End -OreburghCity_MapSign: +OreburghCity_MapSignpost: ShowMapSign OreburghCity_Text_MapSign End @@ -524,11 +524,11 @@ OreburghCity_GymSignpost: ShowScrollingSign OreburghCity_Text_OreburgCityPokemonGymCallMeRoarkTheRock End -OreburghCity_ScrollingSignOreburghMiningMuseum: +OreburghCity_ScrollingSignpostOreburghMiningMuseum: ShowLandmarkSign OreburghCity_Text_OreburghMiningMuseumCoalMiningAndYou End -OreburghCity_ScrollingSignOreburghMine: +OreburghCity_ScrollingSignpostOreburghMine: ShowLandmarkSign OreburghCity_Text_OreburghMineBewareOfBusyPokemon End diff --git a/res/field/scripts/scripts_oreburgh_city_east_house_2f.s b/res/field/scripts/scripts_oreburgh_city_east_house_2f.s index d837586b56..20f06f2db6 100644 --- a/res/field/scripts/scripts_oreburgh_city_east_house_2f.s +++ b/res/field/scripts/scripts_oreburgh_city_east_house_2f.s @@ -4,7 +4,7 @@ ScriptEntry OreburghCityEastHouse2F_Gentleman ScriptEntry OreburghCityEastHouse2F_Youngster - ScriptEntry OreburghCityEastHouse2F_Unused + ScriptEntry OreburghCityEastHouse2F_Dummy3 ScriptEntry OreburghCityEastHouse2F_ScientistM ScriptEntryEnd @@ -39,7 +39,7 @@ OreburghCityEastHouse2F_BagIsFull: ReleaseAll End -OreburghCityEastHouse2F_Unused: +OreburghCityEastHouse2F_Dummy3: End OreburghCityEastHouse2F_ScientistM: diff --git a/res/field/scripts/scripts_oreburgh_city_gym.s b/res/field/scripts/scripts_oreburgh_city_gym.s index 79dc8a6aff..a2b89dab69 100644 --- a/res/field/scripts/scripts_oreburgh_city_gym.s +++ b/res/field/scripts/scripts_oreburgh_city_gym.s @@ -12,7 +12,7 @@ OreburghGym_Roark: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_COAL, OreburghGym_AlreadyHaveCoalBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 47, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_OREBURGH_CITY_GYM, 0, 0, 0 Message OreburghGym_Text_RoarkIntro CloseMessage StartTrainerBattle TRAINER_LEADER_ROARK @@ -33,7 +33,7 @@ OreburghGym_Roark: SetVar VAR_GTS_ACCESS_STATE, 1 SetVar VAR_JUBILIFE_LOOKER_PAL_PAD_STATE, 1 SetVar VAR_OREBURGH_STATE, 2 - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 47, TRAINER_LEADER_ROARK, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_OREBURGH_CITY_GYM, TRAINER_LEADER_ROARK, 0, 0 SetVar VAR_JUBILIFE_CITY_STATE, 3 ClearFlag FLAG_HIDE_JUBILIFE_CITY_COUNTERPART ClearFlag FLAG_HIDE_JUBILIFE_ROWAN diff --git a/res/field/scripts/scripts_oreburgh_city_pokecenter_2f.s b/res/field/scripts/scripts_oreburgh_city_pokecenter_2f.s index e2c40303e7..2936c2285d 100644 --- a/res/field/scripts/scripts_oreburgh_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_oreburgh_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry OreburghCityPokecenter2F_UnusedEntry1 + ScriptEntry OreburghCityPokecenter2F_Dummy1 ScriptEntryEnd -OreburghCityPokecenter2F_UnusedEntry1: +OreburghCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_oreburgh_gate_1f.s b/res/field/scripts/scripts_oreburgh_gate_1f.s index 18b7d7f871..65e88e9ae3 100644 --- a/res/field/scripts/scripts_oreburgh_gate_1f.s +++ b/res/field/scripts/scripts_oreburgh_gate_1f.s @@ -5,7 +5,7 @@ ScriptEntry OreburghGate1F_OnTransition ScriptEntry OreburghGate1F_Hiker - ScriptEntry OreburghGate1F_HikerTrigger + ScriptEntry OreburghGate1F_CoordEvent_Hiker ScriptEntryEnd OreburghGate1F_OnTransition: @@ -45,7 +45,7 @@ OreburghGate1F_SetFlagReceivedHM06: SetVar VAR_OREBURGH_GATE_1F_HIKER_STATE, 2 Return -OreburghGate1F_HikerTrigger: +OreburghGate1F_CoordEvent_Hiker: LockAll ApplyMovement LOCALID_HIKER, OreburghGate1F_Movement_HikerWalkToPlayer ApplyMovement LOCALID_PLAYER, OreburghGate1F_Movement_PlayerFaceHiker diff --git a/res/field/scripts/scripts_oreburgh_mine_b2f.s b/res/field/scripts/scripts_oreburgh_mine_b2f.s index 5d134e8c0c..3fc283b90e 100644 --- a/res/field/scripts/scripts_oreburgh_mine_b2f.s +++ b/res/field/scripts/scripts_oreburgh_mine_b2f.s @@ -17,7 +17,7 @@ OreburghMineB2F_Roark: GoTo OreburghMineB2F_RoarkTurnBackEast OreburghMineB2F_Unused: - ApplyMovement LOCALID_ROARK, OreburghMineB2F_UnusedMovement2 + ApplyMovement LOCALID_ROARK, OreburghMineB2F_Movement_Unused2 WaitMovement GoTo OreburghMineB2F_RoarkUseRockSmash @@ -29,7 +29,7 @@ OreburghMineB2F_RoarkTurnBackEast: OreburghMineB2F_RoarkUseRockSmash: Message OreburghMineB2F_Text_OKStandBackAndWatchThis CloseMessage - ScrCmd_29E 2, VAR_0x8005 + StartDestroyObstacleAnimation 2, VAR_0x8005 WaitTime 10, VAR_RESULT RemoveObject LOCALID_ROCK_SMASH_1 OreburghMineB2F_WaitRockSmash: @@ -41,8 +41,8 @@ OreburghMineB2F_WaitRockSmash: GoTo OreburghMineB2F_RoarkLeave OreburghMineB2F_Unused2: - ApplyMovement 0, OreburghMineB2F_UnusedMovement - ApplyMovement LOCALID_PLAYER, OreburghMineB2F_UnusedMovement3 + ApplyMovement 0, OreburghMineB2F_Movement_Unused + ApplyMovement LOCALID_PLAYER, OreburghMineB2F_Movement_Unused3 WaitMovement GoTo OreburghMineB2F_RemoveRoark @@ -59,7 +59,7 @@ OreburghMineB2F_RemoveRoark: End .balign 4, 0 -OreburghMineB2F_UnusedMovement: +OreburghMineB2F_Movement_Unused: WalkNormalNorth WalkNormalEast 10 EndMovement @@ -69,7 +69,7 @@ OreburghMineB2F_Movement_RoarkLeave: WalkNormalEast 10 EndMovement -OreburghMineB2F_UnusedMovement2: +OreburghMineB2F_Movement_Unused2: Delay8 2 WalkOnSpotNormalNorth Delay8 4 @@ -82,7 +82,7 @@ OreburghMineB2F_Movement_RoarkTurnBackEast: Delay8 4 EndMovement -OreburghMineB2F_UnusedMovement3: +OreburghMineB2F_Movement_Unused3: Delay8 WalkOnSpotNormalNorth Delay8 2 diff --git a/res/field/scripts/scripts_pal_park.s b/res/field/scripts/scripts_pal_park.s index eb5a0a921f..c2ab251b3e 100644 --- a/res/field/scripts/scripts_pal_park.s +++ b/res/field/scripts/scripts_pal_park.s @@ -4,10 +4,10 @@ ScriptEntry PalPark_OnTransition - ScriptEntry PalPark_OnFrameCountdown - ScriptEntry PalPark_Trigger_CaughtAllPokemon + ScriptEntry PalPark_OnFrame_Countdown + ScriptEntry PalPark_CoordEvent_CaughtAllPokemon ScriptEntry PalPark_RetireFromMenu - ScriptEntry PalPark_Trigger_RetireFromGate + ScriptEntry PalPark_CoordEvent_RetireFromGate ScriptEntry PalPark_Worker ScriptEntryEnd @@ -15,7 +15,7 @@ PalPark_OnTransition: SetFlag FLAG_FIRST_ARRIVAL_PAL_PARK End -PalPark_OnFrameCountdown: +PalPark_OnFrame_Countdown: PlaySE SEQ_SE_CONFIRM LockAll MessageInstant PalPark_Text_LetTheCountdownBegin @@ -48,7 +48,7 @@ PalPark_Unused: ReleaseAll End -PalPark_Trigger_CaughtAllPokemon: +PalPark_CoordEvent_CaughtAllPokemon: PlaySE SEQ_SE_CONFIRM LockAll PlaySE SEQ_SE_DP_PINPON @@ -79,7 +79,7 @@ PalPark_RetireFromMenu_WarpOut: Call PalPark_ClearFlagAndWarpOut End -PalPark_Trigger_RetireFromGate: +PalPark_CoordEvent_RetireFromGate: PlaySE SEQ_SE_CONFIRM LockAll Call PalPark_AskPlayerRetireFromCatchingShow diff --git a/res/field/scripts/scripts_pal_park_lobby.s b/res/field/scripts/scripts_pal_park_lobby.s index e3f65390a4..d626fc60ed 100644 --- a/res/field/scripts/scripts_pal_park_lobby.s +++ b/res/field/scripts/scripts_pal_park_lobby.s @@ -8,16 +8,16 @@ ScriptEntry PalParkLobby_OnTransition ScriptEntry PalParkLobby_Worker - ScriptEntry PalParkLobby_OnFrameTallyScore - ScriptEntry PalParkLobby_RecordUnused + ScriptEntry PalParkLobby_OnFrame_TallyScore + ScriptEntry PalParkLobby_Record_Unused ScriptEntry PalParkLobby_Daughter ScriptEntry PalParkLobby_Dad ScriptEntry PalParkLobby_ShowWatcherBoy ScriptEntry PalParkLobby_ComplaintsLady ScriptEntry PalParkLobby_RecordGuy - ScriptEntry PalParkLobby_OnFrameProfOak + ScriptEntry PalParkLobby_OnFrame_ProfOak ScriptEntry PalParkLobby_PoketchAppLady - ScriptEntry PalParkLobby_OnFrameExitPalPark + ScriptEntry PalParkLobby_OnFrame_ExitPalPark ScriptEntry PalParkLobby_GBASlotGiftLady ScriptEntryEnd @@ -201,7 +201,7 @@ PalParkLobby_Movement_PlayerEnterPalPark: SetInvisible EndMovement -PalParkLobby_OnFrameExitPalPark: +PalParkLobby_OnFrame_ExitPalPark: LockAll SetVar VAR_PAL_PARK_STATE, 0 ApplyMovement LOCALID_PLAYER, PalParkLobby_Movement_PlayerExitPalPark @@ -211,7 +211,7 @@ PalParkLobby_OnFrameExitPalPark: ReleaseAll End -PalParkLobby_OnFrameTallyScore: +PalParkLobby_OnFrame_TallyScore: LockAll SetVar VAR_PAL_PARK_STATE, 0 ApplyMovement LOCALID_PLAYER, PalParkLobby_Movement_PlayerWalkToWorker @@ -290,7 +290,7 @@ PalParkLobby_Movement_PlayerLeaveCounter: WalkNormalSouth 4 EndMovement -PalParkLobby_RecordUnused: +PalParkLobby_Record_Unused: NPCMessage PalParkLobby_Text_CurrentRecordHolder End @@ -342,7 +342,7 @@ PalParkLobby_RecordGuy: NPCMessage PalParkLobby_Text_CurrentRecordHolder End -PalParkLobby_OnFrameProfOak: +PalParkLobby_OnFrame_ProfOak: LockAll ClearFlag FLAG_ETERNA_CITY_SOUTH_HOUSE_HIDE_PROF_OAK SetVar VAR_CATCHING_SHOW_RECORD, 2000 diff --git a/res/field/scripts/scripts_pastoria_city.s b/res/field/scripts/scripts_pastoria_city.s index f556ecc116..aaaed90dfe 100644 --- a/res/field/scripts/scripts_pastoria_city.s +++ b/res/field/scripts/scripts_pastoria_city.s @@ -15,17 +15,17 @@ ScriptEntry PastoriaCity_ParasolLady ScriptEntry PastoriaCity_Collector2 ScriptEntry PastoriaCity_AceTrainerM2 - ScriptEntry PastoriaCity_MapSign - ScriptEntry PastoriaCity_GymSign - ScriptEntry PastoriaCity_SignGreatMarsh - ScriptEntry PastoriaCity_SignSafariGame + ScriptEntry PastoriaCity_MapSignpost + ScriptEntry PastoriaCity_GymSignpost + ScriptEntry PastoriaCity_SignboardGreatMarsh + ScriptEntry PastoriaCity_SignboardSafariGame ScriptEntry PastoriaCity_Rival - ScriptEntry PastoriaCity_TriggerRivalBattle - ScriptEntry PastoriaCity_OnFrameExitGym + ScriptEntry PastoriaCity_CoordEvent_RivalBattle + ScriptEntry PastoriaCity_OnFrame_ExitGym ScriptEntry PastoriaCity_CrasherWake - ScriptEntry PastoriaCity_TriggerBomb - ScriptEntry PastoriaCity_TriggerBlockGreatMarsh - ScriptEntry PastoriaCity_TriggerFaceBoard + ScriptEntry PastoriaCity_CoordEvent_Bomb + ScriptEntry PastoriaCity_CoordEvent_BlockGreatMarsh + ScriptEntry PastoriaCity_CoordEvent_FaceBoard ScriptEntryEnd PastoriaCity_OnTransition: @@ -190,7 +190,7 @@ PastoriaCity_RemoveGruntM: End .balign 4, 0 -PastoriaCity_UnusedMovement: +PastoriaCity_Movement_Unused: WalkOnSpotNormalWest EndMovement @@ -200,7 +200,7 @@ PastoriaCity_Movement_PlayerWatchGruntMLeaveWest: WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement2: +PastoriaCity_Movement_Unused2: WalkOnSpotNormalNorth WalkOnSpotNormalEast EndMovement @@ -215,54 +215,54 @@ PastoriaCity_Movement_PlayerWatchGruntMLeaveNorth: WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement3: +PastoriaCity_Movement_Unused3: WalkOnSpotNormalSouth WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement4: +PastoriaCity_Movement_Unused4: WalkOnSpotNormalSouth WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement5: +PastoriaCity_Movement_Unused5: WalkOnSpotNormalNorth WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement6: +PastoriaCity_Movement_Unused6: WalkOnSpotNormalSouth WalkOnSpotNormalEast EndMovement -PastoriaCity_UnusedMovement7: +PastoriaCity_Movement_Unused7: WalkFastEast 9 EndMovement -PastoriaCity_UnusedMovement8: +PastoriaCity_Movement_Unused8: WalkFastEast 7 EndMovement -PastoriaCity_UnusedMovement9: +PastoriaCity_Movement_Unused9: WalkFastSouth WalkFastEast 8 EndMovement -PastoriaCity_UnusedMovement10: +PastoriaCity_Movement_Unused10: WalkFastNorth WalkFastEast 8 EndMovement -PastoriaCity_UnusedMovement11: +PastoriaCity_Movement_Unused11: EmoteExclamationMark EndMovement -PastoriaCity_UnusedMovement12: +PastoriaCity_Movement_Unused12: WalkFastSouth WalkFastEast 10 EndMovement -PastoriaCity_UnusedMovement13: +PastoriaCity_Movement_Unused13: WalkFastEast 10 EndMovement @@ -279,43 +279,43 @@ PastoriaCity_Movement_GruntMLeaveNorthSouthEast: WalkOnSpotFastEast EndMovement -PastoriaCity_UnusedMovement14: +PastoriaCity_Movement_Unused14: WalkFastSouth WalkFastEast 2 WalkOnSpotFastEast EndMovement -PastoriaCity_UnusedMovement15: +PastoriaCity_Movement_Unused15: WalkFastSouth WalkFastEast 4 WalkOnSpotFastEast EndMovement -PastoriaCity_UnusedMovement16: +PastoriaCity_Movement_Unused16: WalkFastNorth WalkFastEast 3 WalkOnSpotFastEast EndMovement -PastoriaCity_UnusedMovement17: +PastoriaCity_Movement_Unused17: WalkFastSouth WalkFastEast 3 WalkOnSpotFastEast EndMovement -PastoriaCity_MapSign: +PastoriaCity_MapSignpost: ShowMapSign PastoriaCity_Text_MapSign End -PastoriaCity_GymSign: +PastoriaCity_GymSignpost: ShowScrollingSign PastoriaCity_Text_SignPokemonGym End -PastoriaCity_SignGreatMarsh: +PastoriaCity_SignboardGreatMarsh: ShowLandmarkSign PastoriaCity_Text_SignGreatMarsh End -PastoriaCity_SignSafariGame: +PastoriaCity_SignboardSafariGame: ShowLandmarkSign PastoriaCity_Text_SignSafariGame End @@ -368,7 +368,7 @@ PastoriaCity_Movement_RivalWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -PastoriaCity_TriggerRivalBattle: +PastoriaCity_CoordEvent_RivalBattle: LockAll ClearFlag FLAG_HIDE_PASTORIA_CITY_RIVAL SetObjectEventPos LOCALID_RIVAL, 595, 819 @@ -454,7 +454,7 @@ PastoriaCity_Movement_RivalLeaveAfterBattle: WalkFastNorth 9 EndMovement -PastoriaCity_OnFrameExitGym: +PastoriaCity_OnFrame_ExitGym: LockAll ClearFlag FLAG_HIDE_PASTORIA_CITY_RIVAL SetObjectEventPos LOCALID_RIVAL, 595, 819 @@ -616,7 +616,7 @@ PastoriaCity_Movement_PlayerWatchCrasherWakeLeave: WalkOnSpotNormalEast EndMovement -PastoriaCity_TriggerBomb: +PastoriaCity_CoordEvent_Bomb: LockAll Call PastoriaCity_Explosion ApplyMovement LOCALID_CRASHER_WAKE, PastoriaCity_Movement_CrasherWakeWatchGruntMExitGreatMarsh @@ -818,11 +818,11 @@ PastoriaCity_Movement_RivalWalkOnSpotNorth: WalkOnSpotFastNorth EndMovement -PastoriaCity_UnusedMovement18: +PastoriaCity_Movement_Unused18: WalkFastSouth 3 EndMovement -PastoriaCity_UnusedMovement19: +PastoriaCity_Movement_Unused19: WalkOnSpotFastNorth EndMovement @@ -876,7 +876,7 @@ PastoriaCity_Movement_CrasherWakeWalkOnSpotNorth: WalkOnSpotNormalNorth EndMovement -PastoriaCity_UnusedMovement20: +PastoriaCity_Movement_Unused20: WalkOnSpotNormalSouth EndMovement @@ -901,7 +901,7 @@ PastoriaCity_Movement_CrasherWakeEnterGreatMarsh: WalkNormalNorth 2 EndMovement -PastoriaCity_TriggerBlockGreatMarsh: +PastoriaCity_CoordEvent_BlockGreatMarsh: LockAll ApplyMovement LOCALID_PLAYER, PastoriaCity_Movement_PlayerWalkOnSpotEast ApplyMovement LOCALID_RIVAL, PastoriaCity_Movement_RivalWalkOnSpotWest @@ -938,7 +938,7 @@ PastoriaCity_Movement_RivalPushBackPlayer: WalkOnSpotNormalNorth EndMovement -PastoriaCity_TriggerFaceBoard: +PastoriaCity_CoordEvent_FaceBoard: LockAll GoToIfSet FLAG_BLOCK_PASTORIA_CITY_CROAGUNK_EVENT, PastoriaCity_FaceBoardEnd SetVar VAR_PASTORIA_CITY_TRY_CROAGUNK_SCENE_STATE, 1 diff --git a/res/field/scripts/scripts_pastoria_city_gym.s b/res/field/scripts/scripts_pastoria_city_gym.s index 1f16b708b8..ca29eeb85b 100644 --- a/res/field/scripts/scripts_pastoria_city_gym.s +++ b/res/field/scripts/scripts_pastoria_city_gym.s @@ -44,7 +44,7 @@ PastoriaGym_Wake: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_FEN, PastoriaGym_WakeAlreadyHaveFenBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 122, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_PASTORIA_CITY_GYM, 0, 0, 0 Message PastoriaGym_Text_WakeIntro CloseMessage StartTrainerBattle TRAINER_LEADER_WAKE @@ -66,7 +66,7 @@ PastoriaGym_Wake: SetVar VAR_PASTORIA_STATE, 3 SetFlag FLAG_HIDE_PASTORIA_CITY_GRUNT_M SetFlag FLAG_BLOCK_PASTORIA_CITY_CROAGUNK_EVENT - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 122, TRAINER_LEADER_WAKE, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_PASTORIA_CITY_GYM, TRAINER_LEADER_WAKE, 0, 0 Message PastoriaGym_Text_WakeExplainFenBadge GoTo PastoriaGym_WakeTryGiveTm55 End diff --git a/res/field/scripts/scripts_pastoria_city_observatory_gate_1f.s b/res/field/scripts/scripts_pastoria_city_observatory_gate_1f.s index f3bf8a21a6..a0096d805a 100644 --- a/res/field/scripts/scripts_pastoria_city_observatory_gate_1f.s +++ b/res/field/scripts/scripts_pastoria_city_observatory_gate_1f.s @@ -4,9 +4,9 @@ ScriptEntry PastoriaCityObservatoryGate1F_CashierM - ScriptEntry PastoriaCityObservatoryGate1F_TriggerTryStartSafariGame - ScriptEntry PastoriaCityObservatoryGate1F_OnFrameTryExitEarly - ScriptEntry PastoriaCityObservatoryGate1F_OnFrameGameEnded + ScriptEntry PastoriaCityObservatoryGate1F_CoordEvent_TryStartSafariGame + ScriptEntry PastoriaCityObservatoryGate1F_OnFrame_TryExitEarly + ScriptEntry PastoriaCityObservatoryGate1F_OnFrame_GameEnded ScriptEntry PastoriaCityObservatoryGate1F_CashierF ScriptEntry PastoriaCityObservatoryGate1F_Cowgirl ScriptEntry PastoriaCityObservatoryGate1F_OnTransition @@ -18,7 +18,7 @@ PastoriaCityObservatoryGate1F_OnTransition: PastoriaCityObservatoryGate1F_CashierM: End -PastoriaCityObservatoryGate1F_TriggerTryStartSafariGame: +PastoriaCityObservatoryGate1F_CoordEvent_TryStartSafariGame: LockAll ApplyMovement LOCALID_PLAYER, PastoriaCityObservatoryGate1F_Movement_PlayerWalkOnSpotWest WaitMovement @@ -137,7 +137,7 @@ PastoriaCityObservatoryGate1F_Movement_PlayerWalkSouth: WalkNormalSouth EndMovement -PastoriaCityObservatoryGate1F_OnFrameTryExitEarly: +PastoriaCityObservatoryGate1F_OnFrame_TryExitEarly: LockAll Message PastoriaCityObservatoryGate1F_Text_AskExitGreatMarsh ShowYesNoMenu VAR_RESULT @@ -196,7 +196,7 @@ PastoriaCityObservatoryGate1F_Movement_PlayerReturnToGreatMarsh: SetInvisible EndMovement -PastoriaCityObservatoryGate1F_OnFrameGameEnded: +PastoriaCityObservatoryGate1F_OnFrame_GameEnded: LockAll ApplyMovement LOCALID_PLAYER, PastoriaCityObservatoryGate1F_Movement_PlayerExitGreatMarsh WaitMovement @@ -256,12 +256,12 @@ PastoriaCityObservatoryGate1F_Movement_CowgirlWalkToPlayer: WalkOnSpotNormalNorth EndMovement -PastoriaCityObservatoryGate1F_UnusedMovement: +PastoriaCityObservatoryGate1F_Movement_Unused: WalkNormalWest WalkOnSpotNormalEast EndMovement -PastoriaCityObservatoryGate1F_UnusedMovement2: +PastoriaCityObservatoryGate1F_Movement_Unused2: WalkNormalEast WalkOnSpotNormalWest EndMovement diff --git a/res/field/scripts/scripts_pastoria_city_pokecenter_b1f.s b/res/field/scripts/scripts_pastoria_city_pokecenter_b1f.s index 358a033c1a..01a829b682 100644 --- a/res/field/scripts/scripts_pastoria_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_pastoria_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry PastoriaCityPokecenterB1F_UnusedEntry1 + ScriptEntry PastoriaCityPokecenterB1F_Dummy1 ScriptEntryEnd -PastoriaCityPokecenterB1F_UnusedEntry1: +PastoriaCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_poke_radar.s b/res/field/scripts/scripts_poke_radar.s index e4d5159032..66f7cb0f66 100644 --- a/res/field/scripts/scripts_poke_radar.s +++ b/res/field/scripts/scripts_poke_radar.s @@ -2,11 +2,11 @@ #include "res/text/bank/bag.h" - ScriptEntry _000A - ScriptEntry _001C + ScriptEntry PokeRadar_BatteryHasRunDry + ScriptEntry PokeRadar_GrassyPatchRemainedQUiet ScriptEntryEnd -_000A: +PokeRadar_BatteryHasRunDry: LockAll BufferNumber 0, VAR_0x8000 Message Bag_Text_BatteryHasRunDry @@ -15,7 +15,7 @@ _000A: ReleaseAll End -_001C: +PokeRadar_GrassyPatchRemainedQUiet: LockAll Message Bag_Text_GrassyPatchRemainedQuiet WaitButton diff --git a/res/field/scripts/scripts_pokemon_center_2f_attendants.s b/res/field/scripts/scripts_pokemon_center_2f_attendants.s deleted file mode 100644 index fd82645794..0000000000 --- a/res/field/scripts/scripts_pokemon_center_2f_attendants.s +++ /dev/null @@ -1,533 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/pokemon_center_2f_attendants.h" -#include "res/text/bank/menu_entries.h" -#include "constants/map_object.h" - - - ScriptEntry _0046 - ScriptEntry _0108 - ScriptEntry _051E - ScriptEntry _0544 - ScriptEntry _0694 - ScriptEntry _0696 - ScriptEntry _0698 - ScriptEntry _069A - ScriptEntry _069C - ScriptEntry _069E - ScriptEntry _06A0 - ScriptEntry _06B4 - ScriptEntry _005B - ScriptEntry _0075 - ScriptEntry _005B - ScriptEntry _005B - ScriptEntry CommonScript_HasBadEgg @ 0x2338 - ScriptEntryEnd - -_0046: - CallIfNe VAR_UNK_0x40D5, 0, _0055 - End - -_0055: - HideObject LOCALID_PLAYER - Return - -_005B: - SetVar VAR_MAP_LOCAL_0, 13 - SetVar VAR_MAP_LOCAL_1, 5 - SetVar VAR_MAP_LOCAL_2, 2 - GoTo _008F - End - -_0075: - SetVar VAR_MAP_LOCAL_0, 8 - SetVar VAR_MAP_LOCAL_1, 5 - SetVar VAR_MAP_LOCAL_2, 2 - GoTo _008F - End - -_008F: - LockAll - LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_2, ANIMATION_TAG_DOOR_1 - Call _050B - ShowObject LOCALID_PLAYER - ApplyMovement LOCALID_PLAYER, _00F0 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _00F8 - WaitMovement - LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0100 - WaitMovement - Call _0513 - ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 - ReleaseAll - End - - .balign 4, 0 -_00F0: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_00F8: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_0100: - WalkNormalSouth 2 - EndMovement - -_0108: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0755 - Message 0 - GoTo _012C - End - -_012C: - Message 1 - InitGlobalTextListMenu 1, 1, 1, VAR_RESULT - AddListMenuEntry MenuEntries_Text_BattlesForTwo, LIST_MENU_BUILDER_HEADER - AddListMenuEntry MenuEntries_Text_SingleBattle, 0 - AddListMenuEntry MenuEntries_Text_DoubleBattle, 1 - AddListMenuEntry MenuEntries_Text_MixBattle, 2 - AddListMenuEntry MenuEntries_Text_BattlesForFour, LIST_MENU_BUILDER_HEADER - AddListMenuEntry MenuEntries_Text_MultiBattle, 3 - AddListMenuEntry MenuEntries_Text_Info, 4 - AddListMenuEntry MenuEntries_Text_Exit2, 5 - ShowListMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _01DE - GoToIfEq VAR_0x8008, 1, _01F2 - GoToIfEq VAR_0x8008, 2, _021A - GoToIfEq VAR_0x8008, 3, _0242 - GoToIfEq VAR_0x8008, 4, _01C8 - GoTo _01D3 - End - -_01C8: - Message 2 - GoTo _012C - End - -_01D3: - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_01DE: - SetVar VAR_0x8004, 1 - GoTo _026A - -Unk213_Unused: - GoTo _0290 - End - -_01F2: - SetVar VAR_0x8004, 2 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 2, _020F - GoTo _026A - -_020F: - Message 6 - WaitButton - CloseMessage - ReleaseAll - End - -_021A: - SetVar VAR_0x8004, 3 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 3, _0237 - GoTo _0290 - -_0237: - Message 126 - WaitButton - CloseMessage - ReleaseAll - End - -_0242: - SetVar VAR_0x8004, 4 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 3, _025F - GoTo _0290 - -_025F: - Message 125 - WaitButton - CloseMessage - ReleaseAll - End - -_026A: - ScrCmd_239 VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0290 - GoToIfEq VAR_RESULT, 3, _0290 - GoTo _01D3 - End - -_0290: - SetVar VAR_0x8005, 0 - GoTo _02E4 - End - -Unk213_Unused2: - SetVar VAR_0x8005, 0 - GoTo _02E4 - End - -Unk213_Unused3: - SetVar VAR_0x8005, 1 - GoTo _02E4 - End - -Unk213_Unused4: - SetVar VAR_0x8005, 2 - GoTo _02E4 - End - -Unk213_Unused5: - SetVar VAR_0x8005, 3 - GoTo _02E4 - End - -Unk213_Unused6: - SetVar VAR_0x8005, 4 - GoTo _02E4 - End - -_02E4: - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _0305 - GoTo _01D3 - End - -_0305: - CallIfEq VAR_0x8004, 1, _037A - CallIfEq VAR_0x8004, 2, _037A - CallIfEq VAR_0x8004, 3, _037A - CallIfEq VAR_0x8004, 4, _037F - InitGlobalTextMenu 30, 1, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 13, 0 - AddMenuEntryImm 14, 1 - AddMenuEntryImm 5, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0384 - GoToIfEq VAR_0x8008, 1, _03F7 - GoTo _01D3 - End - -_037A: - Message 22 - Return - -_037F: - Message 43 - Return - -_0384: - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _0305 - CloseMessage - StartBattleClient VAR_0x8004, VAR_0x8005, 0, VAR_RESULT - GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, _03D3 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, _03DD - GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, _03EA - GoTo _046A - End - -_03D3: - EndCommunication - GoTo _0305 - End - -_03DD: - EndCommunication - Message 16 - WaitButton - CloseMessage - ReleaseAll - End - -_03EA: - EndCommunication - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_03F7: - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _0305 - CloseMessage - StartBattleServer VAR_0x8004, VAR_0x8005, 0, VAR_RESULT - GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, _0446 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, _0450 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, _045D - GoTo _046A - End - -_0446: - EndCommunication - GoTo _0305 - End - -_0450: - EndCommunication - Message 16 - WaitButton - CloseMessage - ReleaseAll - End - -_045D: - EndCommunication - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_046A: - SetVar VAR_UNK_0x40D5, 1 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - MessageNoSkip 52 - WaitABPressTime 45 - ScrCmd_135 96 - CloseMessage - LoadDoorAnimation 0, 0, 13, 5, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0524 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _0530 - WaitMovement - LoadDoorAnimation 0, 0, 13, 2, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0538 - WaitMovement - Call _0513 - GoToIfEq VAR_0x8004, 4, _04F3 - GetCurNetID VAR_RESULT - AddVar VAR_RESULT, 7 - ScrCmd_203 0x14C, 0, VAR_RESULT, 11, 0 - End - -_04F3: - GetCurNetID VAR_RESULT - AddVar VAR_RESULT, 6 - ScrCmd_203 0x14D, 0, VAR_RESULT, 11, 0 - End - -_050B: - PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - Return - -_0513: - PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - UnloadAnimation ANIMATION_TAG_DOOR_1 - Return - -_051E: - StartLinkBattle - FieldCommEnterBattleRoom - End - - .balign 4, 0 -_0524: - WalkNormalEast - WalkNormalNorth 2 - EndMovement - - .balign 4, 0 -_0530: - WalkNormalNorth - EndMovement - - .balign 4, 0 -_0538: - WalkNormalNorth - SetInvisible - EndMovement - -_0544: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0755 - GoTo _0565 - End - -_0565: - Message 57 - InitGlobalTextMenu 1, 1, 0, VAR_RESULT - AddMenuEntryImm 41, 0 - AddMenuEntryImm 42, 1 - AddMenuEntryImm 10, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _05CF - GoToIfEq VAR_0x8008, 1, _01D3 - GoToIfEq VAR_0x8008, 2, _05B3 - GoTo _01D3 - End - -_05B3: - Message 58 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _05CF - GoTo _01D3 - End - -_05CF: - SetVar VAR_0x8004, 9 - HealParty - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _01D3 - ScrCmd_31D VAR_RESULT - GoToIfEq VAR_RESULT, 0xFF, _068E - SetVar VAR_UNK_0x40D5, 2 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _062D - SetVar VAR_UNK_0x40D5, 0 - ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - GoTo _01D3 - -_062D: - SetVar VAR_UNK_0x40D5, 2 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - Message 63 - CloseMessage - LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0524 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _0530 - WaitMovement - LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0538 - WaitMovement - Call _0513 - ReleaseAll - ScrCmd_153 - End - -_068E: - Common_GriseousOrbCouldNotBeRemoved - End - -_0694: - End - -_0696: - End - -_0698: - End - -_069A: - End - -_069C: - End - -_069E: - End - -_06A0: - WaitForTransition - ScrCmd_0A3 - ReturnToField - FadeScreenIn - WaitFadeScreen - End - -_06B4: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - SetFlag FLAG_UNK_0x00AA - Message 102 - GoTo _06CB - End - -_06CB: - Message 103 - InitGlobalTextMenu 1, 1, 0, VAR_RESULT - AddMenuEntryImm 41, 0 - AddMenuEntryImm 42, 1 - AddMenuEntryImm 10, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0724 - GoToIfEq VAR_0x8008, 1, _074A - GoToIfEq VAR_0x8008, 2, _0719 - GoTo _074A - End - -_0719: - Message 105 - GoTo _06CB - End - -_0724: - CloseMessage - FadeScreenOut - WaitFadeScreen - StartSignatureApp - ReturnToField - FadeScreenIn - WaitFadeScreen - GoTo _074A - End - -_074A: - Message 104 - WaitButton - CloseMessage - ReleaseAll - End - -_0755: - Call _076D - WaitButton - CloseMessage - ReleaseAll - End - -CommonScript_HasBadEgg: - Call _076D - ReturnCommonScript - End - -_076D: - Message pl_msg_00000221_00127 - Return - - .balign 4, 0 diff --git a/res/field/scripts/scripts_pokemon_center_2f_common.s b/res/field/scripts/scripts_pokemon_center_2f_common.s new file mode 100644 index 0000000000..8fc247e404 --- /dev/null +++ b/res/field/scripts/scripts_pokemon_center_2f_common.s @@ -0,0 +1,533 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/pokemon_center_2f_common.h" +#include "res/text/bank/menu_entries.h" +#include "constants/map_object.h" + + + ScriptEntry PokemonCenter2FCommon_OnResume + ScriptEntry PokemonCenter2FCommon_AttendantColosseum + ScriptEntry _051E + ScriptEntry PokemonCenter2FCommon_AttendantUnionRoom + ScriptEntry PokemonCenter2FCommon_Dummy9004 + ScriptEntry PokemonCenter2FCommon_Dummy9005 + ScriptEntry PokemonCenter2FCommon_Dummy9006 + ScriptEntry PokemonCenter2FCommon_Dummy9007 + ScriptEntry PokemonCenter2FCommon_Dummy9008 + ScriptEntry PokemonCenter2FCommon_Dummy9009 + ScriptEntry _06A0 + ScriptEntry PokemonCenter2FCommon_AttendantSignTrainerCard + ScriptEntry PokemonCenter2FCommon_OnFrame_ExitColosseum + ScriptEntry PokemonCenter2FCommon_OnFrame_ExitUnionRoom + ScriptEntry PokemonCenter2FCommon_OnFrame_ExitColosseum + ScriptEntry PokemonCenter2FCommon_OnFrame_ExitColosseum + ScriptEntry PokemonCenter2FCommon_HasBadEggReturnCommon @ 0x2338 + ScriptEntryEnd + +PokemonCenter2FCommon_OnResume: + CallIfNe VAR_COMMUNICATION_LOAD_ACTION, 0, PokemonCenter2FCommon_HidePlayer + End + +PokemonCenter2FCommon_HidePlayer: + HideObject LOCALID_PLAYER + Return + +PokemonCenter2FCommon_OnFrame_ExitColosseum: + SetVar VAR_MAP_LOCAL_0, 13 + SetVar VAR_MAP_LOCAL_1, 5 + SetVar VAR_MAP_LOCAL_2, 2 + GoTo PokemonCenter2FCommon_PlayerEnter + End + +PokemonCenter2FCommon_OnFrame_ExitUnionRoom: + SetVar VAR_MAP_LOCAL_0, 8 + SetVar VAR_MAP_LOCAL_1, 5 + SetVar VAR_MAP_LOCAL_2, 2 + GoTo PokemonCenter2FCommon_PlayerEnter + End + +PokemonCenter2FCommon_PlayerEnter: + LockAll + LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ShowObject LOCALID_PLAYER + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnter + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToGate + WaitMovement + LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 + ReleaseAll + End + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnter: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerWalkToGate: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerExitThroughGate: + WalkNormalSouth 2 + EndMovement + +PokemonCenter2FCommon_AttendantColosseum: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenter2FCommon_HasBadEggEnd + Message PokemonCenter2FCommon_Text_WelcomeToColosseum + GoTo PokemonCenter2FCommon_BattleModeMenu + End + +PokemonCenter2FCommon_BattleModeMenu: + Message PokemonCenter2FCommon_Text_WhichBattleMode + InitGlobalTextListMenu 1, 1, 1, VAR_RESULT + AddListMenuEntry MenuEntries_Text_BattlesForTwo, LIST_MENU_BUILDER_HEADER + AddListMenuEntry MenuEntries_Text_SingleBattle, 0 + AddListMenuEntry MenuEntries_Text_DoubleBattle, 1 + AddListMenuEntry MenuEntries_Text_MixBattle, 2 + AddListMenuEntry MenuEntries_Text_BattlesForFour, LIST_MENU_BUILDER_HEADER + AddListMenuEntry MenuEntries_Text_MultiBattle, 3 + AddListMenuEntry MenuEntries_Text_Info, 4 + AddListMenuEntry MenuEntries_Text_Exit2, 5 + ShowListMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_SingleBattle + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_DoubleBattle + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_MixBattle + GoToIfEq VAR_0x8008, 3, PokemonCenter2FCommon_MultiBattle + GoToIfEq VAR_0x8008, 4, PokemonCenter2FCommon_Info + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_Info: + Message PokemonCenter2FCommon_Text_BattleModesInfo + GoTo PokemonCenter2FCommon_BattleModeMenu + End + +PokemonCenter2FCommon_Exit: + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_SingleBattle: + SetVar VAR_0x8004, 1 + GoTo PokemonCenter2FCommon_SingleDoubleBattle + +PokemonCenter2FCommon_Unused: + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + End + +PokemonCenter2FCommon_DoubleBattle: + SetVar VAR_0x8004, 2 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 2, PokemonCenter2FCommon_NeedTwoPokemonDoubleBattle + GoTo PokemonCenter2FCommon_SingleDoubleBattle + +PokemonCenter2FCommon_NeedTwoPokemonDoubleBattle: + Message PokemonCenter2FCommon_Text_NeedTwoPokemonDoubleBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_MixBattle: + SetVar VAR_0x8004, 3 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 3, PokemonCenter2FCommon_NeedThreePokemonMixBattle + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + +PokemonCenter2FCommon_NeedThreePokemonMixBattle: + Message PokemonCenter2FCommon_Text_NeedThreePokemonMixBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_MultiBattle: + SetVar VAR_0x8004, 4 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 3, PokemonCenter2FCommon_NeedThreePokemonMultiBattle + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + +PokemonCenter2FCommon_NeedThreePokemonMultiBattle: + Message PokemonCenter2FCommon_Text_NeedThreePokemonMultiBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_SingleDoubleBattle: + OpenBattleRegulationMenu VAR_RESULT + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_SelectedValidBattleMode + GoToIfEq VAR_RESULT, 3, PokemonCenter2FCommon_SelectedValidBattleMode + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_SelectedValidBattleMode: + SetVar VAR_0x8005, 0 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused2: + SetVar VAR_0x8005, 0 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused3: + SetVar VAR_0x8005, 1 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused4: + SetVar VAR_0x8005, 2 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused5: + SetVar VAR_0x8005, 3 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused6: + SetVar VAR_0x8005, 4 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_HealPartySaveBeforeBattle: + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_DecideLeader + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_DecideLeader: + CallIfEq VAR_0x8004, 1, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 2, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 3, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 4, PokemonCenter2FCommon_DecideWhichOfFourBecomesLeader + InitGlobalTextMenu 30, 1, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_JoinGroup, 0 + AddMenuEntryImm MenuEntries_Text_BecomeLeader, 1 + AddMenuEntryImm MenuEntries_Text_Exit, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_JoinGroup + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_BecomeLeader + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader: + Message PokemonCenter2FCommon_Text_DecideWhichOfTwoBecomesLeader + Return + +PokemonCenter2FCommon_DecideWhichOfFourBecomesLeader: + Message PokemonCenter2FCommon_Text_DecideWhichOfFourBecomesLeader + Return + +PokemonCenter2FCommon_JoinGroup: + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_DecideLeader + CloseMessage + StartBattleClient VAR_0x8004, VAR_0x8005, 0, VAR_RESULT + GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, PokemonCenter2FCommon_JoinGroupCancel + GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, PokemonCenter2FCommon_JoinGroupError + GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, PokemonCenter2FCommon_JoinGroupRet4 + GoTo PokemonCenter2FCommon_EnterColosseum + End + +PokemonCenter2FCommon_JoinGroupCancel: + EndCommunication + GoTo PokemonCenter2FCommon_DecideLeader + End + +PokemonCenter2FCommon_JoinGroupError: + EndCommunication + Message PokemonCenter2FCommon_Text_RepeatProcessFromBeginning + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_JoinGroupRet4: + EndCommunication + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_BecomeLeader: + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_DecideLeader + CloseMessage + StartBattleServer VAR_0x8004, VAR_0x8005, 0, VAR_RESULT + GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, PokemonCenter2FCommon_BecomeLeaderCancel + GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, PokemonCenter2FCommon_BecomeLeaderError + GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, PokemonCenter2FCommon_BecomeLeaderRet4 + GoTo PokemonCenter2FCommon_EnterColosseum + End + +PokemonCenter2FCommon_BecomeLeaderCancel: + EndCommunication + GoTo PokemonCenter2FCommon_DecideLeader + End + +PokemonCenter2FCommon_BecomeLeaderError: + EndCommunication + Message PokemonCenter2FCommon_Text_RepeatProcessFromBeginning + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_BecomeLeaderRet4: + EndCommunication + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_EnterColosseum: + SetVar VAR_COMMUNICATION_LOAD_ACTION, 1 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + MessageNoSkip PokemonCenter2FCommon_Text_MembersGatheredEnterRoom + WaitABPressTime 45 + ScrCmd_135 96 + CloseMessage + LoadDoorAnimation 0, 0, 13, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 13, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterDoor + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + GoToIfEq VAR_0x8004, 4, PokemonCenter2FCommon_WarpColosseum4P + GetCurNetID VAR_RESULT + AddVar VAR_RESULT, 7 + WarpToColosseum MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_2P, 0, VAR_RESULT, 11, 0 + End + +PokemonCenter2FCommon_WarpColosseum4P: + GetCurNetID VAR_RESULT + AddVar VAR_RESULT, 6 + WarpToColosseum MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_4P, 0, VAR_RESULT, 11, 0 + End + +PokemonCenter2FCommon_DoorOpenAnimation: + PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenter2FCommon_DoorCloseAnimation: + PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + UnloadAnimation ANIMATION_TAG_DOOR_1 + Return + +_051E: + StartLinkBattle + FieldCommEnterBattleRoom + End + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnterThroughGate: + WalkNormalEast + WalkNormalNorth 2 + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerWalkToDoor: + WalkNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnterDoor: + WalkNormalNorth + SetInvisible + EndMovement + +PokemonCenter2FCommon_AttendantUnionRoom: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenter2FCommon_HasBadEggEnd + GoTo PokemonCenter2FCommon_UnionRoomMenu + End + +PokemonCenter2FCommon_UnionRoomMenu: + Message PokemonCenter2FCommon_Text_WelcomeEnterUnionRoom + InitGlobalTextMenu 1, 1, 0, VAR_RESULT + AddMenuEntryImm MenuEntries_Text_Yes, 0 + AddMenuEntryImm MenuEntries_Text_No, 1 + AddMenuEntryImm MenuEntries_Text_Info, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_TryEnterUnionRoom + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_Exit + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_UnionRoomInfo + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_UnionRoomInfo: + Message PokemonCenter2FCommon_Text_UnionRoomInfo + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenter2FCommon_TryEnterUnionRoom + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_TryEnterUnionRoom: + SetVar VAR_0x8004, 9 + HealParty + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_Exit + TryRevertPartyPokemonForms VAR_RESULT + GoToIfEq VAR_RESULT, 0xFF, PokemonCenter2FCommon_GriseousOrbCouldNotBeRemoved + SetVar VAR_COMMUNICATION_LOAD_ACTION, 2 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_EnterUnionRoom + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 + ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + GoTo PokemonCenter2FCommon_Exit + +PokemonCenter2FCommon_EnterUnionRoom: + SetVar VAR_COMMUNICATION_LOAD_ACTION, 2 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + Message PokemonCenter2FCommon_Text_EnjoyUnionRoom + CloseMessage + LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterDoor + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ReleaseAll + ScrCmd_153 + End + +PokemonCenter2FCommon_GriseousOrbCouldNotBeRemoved: + Common_GriseousOrbCouldNotBeRemoved + End + +PokemonCenter2FCommon_Dummy9004: + End + +PokemonCenter2FCommon_Dummy9005: + End + +PokemonCenter2FCommon_Dummy9006: + End + +PokemonCenter2FCommon_Dummy9007: + End + +PokemonCenter2FCommon_Dummy9008: + End + +PokemonCenter2FCommon_Dummy9009: + End + +_06A0: + WaitForTransition + ScrCmd_0A3 + ReturnToField + FadeScreenIn + WaitFadeScreen + End + +PokemonCenter2FCommon_AttendantSignTrainerCard: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + SetFlag FLAG_UNK_0x00AA + Message PokemonCenter2FCommon_Text_YouMaySignTrainerCard + GoTo PokemonCenter2FCommon_SignTrainerCardMenu + End + +PokemonCenter2FCommon_SignTrainerCardMenu: + Message PokemonCenter2FCommon_Text_WouldYouSignTrainerCard + InitGlobalTextMenu 1, 1, 0, VAR_RESULT + AddMenuEntryImm MenuEntries_Text_Yes, 0 + AddMenuEntryImm MenuEntries_Text_No, 1 + AddMenuEntryImm MenuEntries_Text_Info, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_SignTrainerCard + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_SignTrainerCardEnd + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_SignTrainerCardInfo + GoTo PokemonCenter2FCommon_SignTrainerCardEnd + End + +PokemonCenter2FCommon_SignTrainerCardInfo: + Message PokemonCenter2FCommon_Text_SignTrainerCardInfo + GoTo PokemonCenter2FCommon_SignTrainerCardMenu + End + +PokemonCenter2FCommon_SignTrainerCard: + CloseMessage + FadeScreenOut + WaitFadeScreen + StartSignatureApp + ReturnToField + FadeScreenIn + WaitFadeScreen + GoTo PokemonCenter2FCommon_SignTrainerCardEnd + End + +PokemonCenter2FCommon_SignTrainerCardEnd: + Message PokemonCenter2FCommon_Text_PleaseVisitAgain2 + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_HasBadEggEnd: + Call PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_HasBadEggReturnCommon: + Call PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken + ReturnCommonScript + End + +PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken: + Message PokemonCenter2FCommon_Text_AtLeastOnePokemonCantBeTaken + Return + + .balign 4, 0 diff --git a/res/field/scripts/scripts_pokemon_center_b1f_attendants.s b/res/field/scripts/scripts_pokemon_center_b1f_attendants.s deleted file mode 100644 index 03655b769f..0000000000 --- a/res/field/scripts/scripts_pokemon_center_b1f_attendants.s +++ /dev/null @@ -1,458 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/pokemon_center_b1f_attendants.h" - - - ScriptEntry _001A - ScriptEntry _00F4 - ScriptEntry _01A3 - ScriptEntry _043C - ScriptEntry _048E - ScriptEntry _0650 - ScriptEntryEnd - -_001A: - LockAll - Message 0 - CloseMessage - ApplyMovement LOCALID_PLAYER, _00D8 - WaitMovement - Message 1 - SetVar VAR_0x8004, ITEM_PAL_PAD - SetVar VAR_0x8005, 1 - Common_GiveItemQuantity - GoTo _0046 - End - -_0046: - Message 2 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 153, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0086 - GoToIfEq VAR_0x8008, 1, _00C6 - GoTo _00C6 - End - -_0086: - Message 3 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 155, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0086 - GoToIfEq VAR_0x8008, 1, _00C6 - GoTo _00C6 - End - -_00C6: - SetVar VAR_UNK_0x40D4, 1 - Message 4 - WaitButton - CloseMessage - ReleaseAll - End - - .balign 4, 0 -_00D8: - WalkOnSpotNormalNorth - Delay8 2 - WalkNormalNorth 4 - WalkNormalWest - FaceNorth - Delay8 2 - EndMovement - -_00F4: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - Message 5 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0123 - GoTo _0118 - End - -_0118: - Message 4 - WaitButton - CloseMessage - ReleaseAll - End - -_0123: - Message 6 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 153, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0163 - GoToIfEq VAR_0x8008, 1, _0118 - GoTo _0118 - End - -_0163: - Message 3 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 155, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0163 - GoToIfEq VAR_0x8008, 1, _0118 - GoTo _0118 - End - -_01A3: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0430 - GoTo _01C4 - End - -_01C4: - Message 7 - InitLocalTextMenu 31, 11, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 14, 0 - AddMenuEntryImm 15, 1 - AddMenuEntryImm 16, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0213 - GoToIfEq VAR_0x8008, 1, _0208 - GoTo _026C - End - -_0208: - Message 13 - GoTo _01C4 - End - -_0213: - ScrCmd_2A4 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _022C - GoTo _0277 - End - -_022C: - ScrCmd_2A3 VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0261 - GoTo _0245 - End - -_0245: - Message 11 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0277 - GoTo _026C - End - -_0261: - Message 12 - WaitButton - CloseMessage - ReleaseAll - End - -_026C: - Message 8 - WaitButton - CloseMessage - ReleaseAll - End - -_0277: - ScrCmd_31D VAR_RESULT - GoToIfEq VAR_RESULT, 0xFF, _02A9 - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _02AF - GoTo _026C - End - -_02A9: - Common_GriseousOrbCouldNotBeRemoved - End - -_02AF: - Message 10 - CloseMessage - GetPlayerMapPos VAR_0x8004, VAR_0x8005 - ApplyMovement LOCALID_PLAYER, _03B8 - WaitMovement - GoTo _02CC - End - -_02CC: - LoadDoorAnimation 0, 0, 9, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03C4 - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03CC - WaitMovement - LoadDoorAnimation 0, 0, 9, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03D4 - WaitMovement - Call _0328 - GoTo _0333 - End - -_0320: - PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - Return - -_0328: - PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - UnloadAnimation ANIMATION_TAG_DOOR_1 - Return - -_0333: - FadeScreenOut - WaitFadeScreen - WaitForTransition - ScrCmd_2A4 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _035A - ScrCmd_0A3 - GoTo _035C - -_035A: - ScrCmd_0A3 -_035C: - ReturnToField - FadeScreenIn - WaitFadeScreen - LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - End - - .balign 4, 0 -_03B8: - WalkNormalEast - WalkOnSpotNormalNorth - EndMovement - - .balign 4, 0 -_03C4: - WalkNormalNorth 2 - EndMovement - - .balign 4, 0 -_03CC: - WalkNormalNorth - EndMovement - - .balign 4, 0 -_03D4: - WalkNormalNorth - SetInvisible - EndMovement - - .balign 4, 0 -_03E0: - WalkNormalNorth 2 - SetInvisible - EndMovement - - .balign 4, 0 -_03EC: - FaceSouth - SetVisible - WalkNormalSouth - EndMovement - - .balign 4, 0 -_03FC: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_0404: - WalkNormalSouth 2 - EndMovement - - .balign 4, 0 -_040C: - WalkOnSpotNormalEast - EndMovement - - .balign 4, 0 -_0414: - WalkNormalNorth - WalkNormalEast - WalkOnSpotNormalNorth - EndMovement - - .balign 4, 0 -_0424: - WalkNormalNorth - SetInvisible - EndMovement - -_0430: - CallCommonScript 0x2338 - WaitButton - CloseMessage - ReleaseAll - End - -_043C: - Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE - SetVar VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, 0 - SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 0 - SetVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 - SetVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_HALL_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 0 - Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE - End - -_048E: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - ScrCmd_323 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _04BC - GetCurrentMapID VAR_WIFI_PLAZA_RETURN_WARP_ID - SetVar VAR_UNK_0x405D, VAR_LAST_TALKED - Message 17 - GoTo _04C7 - End - -_04BC: - Message 25 - GoTo _0513 - End - -_04C7: - InitLocalTextMenu 31, 11, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 22, 0 - AddMenuEntryImm 23, 1 - AddMenuEntryImm 24, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0526 - GoToIfEq VAR_0x8008, 1, _051B - GoTo _0508 - End - -_0508: - Message 20 - GoTo _0513 - End - -_0513: - WaitButton - CloseMessage - ReleaseAll - End - -_051B: - Message 21 - GoTo _04C7 - End - -_0526: - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 0, _0508 - Message 19 - CloseMessage - ApplyMovement LOCALID_PLAYER, _03B8 - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement VAR_LAST_TALKED, _040C - ApplyMovement LOCALID_PLAYER, _03C4 - WaitMovement - Call _0328 - ApplyMovement VAR_LAST_TALKED, _0414 - WaitMovement - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03E0 - ApplyMovement VAR_LAST_TALKED, _0424 - WaitMovement - Call _0328 - SetVar VAR_MAP_LOCAL_3, 0 - FadeScreenOut - WaitFadeScreen - Warp MAP_HEADER_WIFI_PLAZA_ENTRANCE, 0, 20, 11, DIR_NORTH - FadeScreenIn - WaitFadeScreen - End - -Unk423_Unused: - FadeScreenOut - WaitFadeScreen - WaitForTransition - ScrCmd_0B3 VAR_RESULT - SetVar VAR_0x8004, VAR_RESULT - ScrCmd_2F7 VAR_0x8004 - ReturnToField - FadeScreenIn - WaitFadeScreen - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - ReleaseAll - End - -_0650: - LockAll - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - SetVar VAR_UNK_0x4080, 0 - ReleaseAll - End diff --git a/res/field/scripts/scripts_pokemon_center_b1f_common.s b/res/field/scripts/scripts_pokemon_center_b1f_common.s new file mode 100644 index 0000000000..d303c2fdae --- /dev/null +++ b/res/field/scripts/scripts_pokemon_center_b1f_common.s @@ -0,0 +1,459 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/pokemon_center_b1f_common.h" +#include "res/text/bank/menu_entries.h" + + + ScriptEntry PokemonCenterB1FCommon_OnFrame_ReceivePalPad + ScriptEntry PokemonCenterB1FCommon_AttendantInfo + ScriptEntry PokemonCenterB1FCommon_AttendantWiFiClub + ScriptEntry PokemonCenterB1FCommon_OnLoad + ScriptEntry PokemonCenterB1FCommon_AttendantWifiPlaza + ScriptEntry PokemonCenterB1FCommon_OnFrame_ExitWiFiClub + ScriptEntryEnd + +PokemonCenterB1FCommon_OnFrame_ReceivePalPad: + LockAll + Message PokemonCenterB1FCommon_Text_HelloRightThisWay + CloseMessage + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkToAttendantEast + WaitMovement + Message PokemonCenterB1FCommon_Text_GuideToWiFiClub + SetVar VAR_0x8004, ITEM_PAL_PAD + SetVar VAR_0x8005, 1 + Common_GiveItemQuantity + GoTo PokemonCenterB1FCommon_ExplainPalPad + End + +PokemonCenterB1FCommon_ExplainPalPad: + Message PokemonCenterB1FCommon_Text_ExplainPalPad + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_RegisterAFriend, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_ReceivePalPadEnd + GoTo PokemonCenterB1FCommon_ReceivePalPadEnd + End + +PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend: + Message PokemonCenterB1FCommon_Text_ExplainRegisterAFriend + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_TellMeAgain, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_ReceivePalPadEnd + GoTo PokemonCenterB1FCommon_ReceivePalPadEnd + End + +PokemonCenterB1FCommon_ReceivePalPadEnd: + SetVar VAR_VISITED_POKEMON_CENTER_B1F, 1 + Message PokemonCenterB1FCommon_Text_EnjoyNintendoWFC + WaitButton + CloseMessage + ReleaseAll + End + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkToAttendantEast: + WalkOnSpotNormalNorth + Delay8 2 + WalkNormalNorth 4 + WalkNormalWest + FaceNorth + Delay8 2 + EndMovement + +PokemonCenterB1FCommon_AttendantInfo: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + Message PokemonCenterB1FCommon_Text_MayIHelpWithAnything + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenterB1FCommon_ExplainWiFiClub + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_EnjoyNintendoWFC: + Message PokemonCenterB1FCommon_Text_EnjoyNintendoWFC + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_ExplainWiFiClub: + Message PokemonCenterB1FCommon_Text_ExplainWiFiClub + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_RegisterAFriend, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_EnjoyNintendoWFC + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_ExplainRegisterAFriend: + Message PokemonCenterB1FCommon_Text_ExplainRegisterAFriend + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_TellMeAgain, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_EnjoyNintendoWFC + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_AttendantWiFiClub: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenterB1FCommon_HasBadEgg + GoTo PokemonCenterB1FCommon_WiFiClubMenu + End + +PokemonCenterB1FCommon_WiFiClubMenu: + Message PokemonCenterB1FCommon_Text_WiFiClubUseNintendoWFC + InitLocalTextMenu 31, 11, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm PokemonCenterB1FCommon_Text_GoToWiFiClub, 0 + AddMenuEntryImm PokemonCenterB1FCommon_Text_InfoWiFiClub, 1 + AddMenuEntryImm PokemonCenterB1FCommon_Text_ExitWiFiClub, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_CheckFriendsToEnterWiFiClub + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_WiFiClubInfo + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_WiFiClubInfo: + Message PokemonCenterB1FCommon_Text_WiFiClubInfo + GoTo PokemonCenterB1FCommon_WiFiClubMenu + End + +PokemonCenterB1FCommon_CheckFriendsToEnterWiFiClub: + GetWiFListValidFriendsCount VAR_RESULT + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_NoFriendsCheckValidLogin + GoTo PokemonCenterB1FCommon_TryEnterWiFiClub + End + +PokemonCenterB1FCommon_NoFriendsCheckValidLogin: + CheckHasWiFiListValidLogin VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenterB1FCommon_NoRegisteredFriends + GoTo PokemonCenterB1FCommon_NoFriendsAskGetAFriendCode + End + +PokemonCenterB1FCommon_NoFriendsAskGetAFriendCode: + Message PokemonCenterB1FCommon_Text_NoFriendsGetAFriendCode + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenterB1FCommon_TryEnterWiFiClub + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_NoRegisteredFriends: + Message PokemonCenterB1FCommon_Text_NoRegisteredFriends + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_PleaseComeAgain: + Message PokemonCenterB1FCommon_Text_PleaseComeAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_TryEnterWiFiClub: + TryRevertPartyPokemonForms VAR_RESULT + GoToIfEq VAR_RESULT, 0xFF, PokemonCenterB1FCommon_GriseousOrbCouldNotBeRemoved + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenterB1FCommon_EnterWiFiClub + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_GriseousOrbCouldNotBeRemoved: + Common_GriseousOrbCouldNotBeRemoved + End + +PokemonCenterB1FCommon_EnterWiFiClub: + Message PokemonCenterB1FCommon_Text_RightThisWay + CloseMessage + GetPlayerMapPos VAR_0x8004, VAR_0x8005 + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate + WaitMovement + GoTo PokemonCenterB1FCommon_PlayerEnterWiFiClub + End + +PokemonCenterB1FCommon_PlayerEnterWiFiClub: + LoadDoorAnimation 0, 0, 9, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 9, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + GoTo PokemonCenterB1FCommon_DoWiFiClub + End + +PokemonCenterB1FCommon_DoorOpenAnimation: + PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenterB1FCommon_DoorCloseAnimation: + PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + UnloadAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenterB1FCommon_DoWiFiClub: + FadeScreenOut + WaitFadeScreen + WaitForTransition + GetWiFListValidFriendsCount VAR_RESULT + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_DoWiFiClubNoFriends + ScrCmd_0A3 + GoTo PokemonCenterB1FCommon_ReturnToPokemonCenter + +PokemonCenterB1FCommon_DoWiFiClubNoFriends: + ScrCmd_0A3 +PokemonCenterB1FCommon_ReturnToPokemonCenter: + ReturnToField + FadeScreenIn + WaitFadeScreen + LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + End + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate: + WalkNormalEast + WalkOnSpotNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate: + WalkNormalNorth 2 + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkToDoor: + WalkNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterWiFiClub: + WalkNormalNorth + SetInvisible + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterWiFiPlaza: + WalkNormalNorth 2 + SetInvisible + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub: + FaceSouth + SetVisible + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerExitThroughGate: + WalkNormalSouth 2 + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantWalkOnSpotEast: + WalkOnSpotNormalEast + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantWalkToDoor: + WalkNormalNorth + WalkNormalEast + WalkOnSpotNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantEnterWiFiPlaza: + WalkNormalNorth + SetInvisible + EndMovement + +PokemonCenterB1FCommon_HasBadEgg: + CallCommonScript 0x2338 + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_OnLoad: + Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE + SetVar VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, 0 + SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 0 + SetVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 + SetVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_HALL_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 0 + Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE + End + +PokemonCenterB1FCommon_AttendantWifiPlaza: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckNoWiFiPlazaCooldown VAR_RESULT + GoToIfEq VAR_RESULT, FALSE, PokemonCenterB1FCommon_PleaseComeBackLater + GetCurrentMapID VAR_WIFI_PLAZA_RETURN_WARP_ID + SetVar VAR_WIFI_PLAZA_ATTENDANT_ID, VAR_LAST_TALKED + Message PokemonCenterB1FCommon_Text_WiFiPlazaUseNintendoWFC + GoTo PokemonCenterB1FCommon_WiFiPlazaMenu + End + +PokemonCenterB1FCommon_PleaseComeBackLater: + Message PokemonCenterB1FCommon_Text_PleaseComeBackLater + GoTo PokemonCenterB1FCommon_AttendantWiFiPlazaEnd + End + +PokemonCenterB1FCommon_WiFiPlazaMenu: + InitLocalTextMenu 31, 11, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm PokemonCenterB1FCommon_Text_GoToWiFiPlaza, 0 + AddMenuEntryImm PokemonCenterB1FCommon_Text_InfoWiFiPlaza, 1 + AddMenuEntryImm PokemonCenterB1FCommon_Text_ExitWiFiPlaza, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_GoToWiFiPlaza + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_WiFiPlazaInfo + GoTo PokemonCenterB1FCommon_WiFiPlazaExit + End + +PokemonCenterB1FCommon_WiFiPlazaExit: + Message PokemonCenterB1FCommon_Text_LookForwardToNextVisit + GoTo PokemonCenterB1FCommon_AttendantWiFiPlazaEnd + End + +PokemonCenterB1FCommon_AttendantWiFiPlazaEnd: + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_WiFiPlazaInfo: + Message PokemonCenterB1FCommon_Text_WiFiPlazaInfo + GoTo PokemonCenterB1FCommon_WiFiPlazaMenu + End + +PokemonCenterB1FCommon_GoToWiFiPlaza: + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_WiFiPlazaExit + Message PokemonCenterB1FCommon_Text_PleaseEnterThisWay + CloseMessage + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantWalkOnSpotEast + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterWiFiPlaza + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantEnterWiFiPlaza + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + SetVar VAR_MAP_LOCAL_3, 0 + FadeScreenOut + WaitFadeScreen + Warp MAP_HEADER_WIFI_PLAZA_ENTRANCE, 0, 20, 11, DIR_NORTH + FadeScreenIn + WaitFadeScreen + End + +PokemonCenterB1FCommon_Unused: + FadeScreenOut + WaitFadeScreen + WaitForTransition + ScrCmd_0B3 VAR_RESULT + SetVar VAR_0x8004, VAR_RESULT + ScrCmd_2F7 VAR_0x8004 + ReturnToField + FadeScreenIn + WaitFadeScreen + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ReleaseAll + End + +PokemonCenterB1FCommon_OnFrame_ExitWiFiClub: + LockAll + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + SetVar VAR_ENTERED_WIFI_PLAZA, 0 + ReleaseAll + End diff --git a/res/field/scripts/scripts_pokemon_day_care.s b/res/field/scripts/scripts_pokemon_day_care.s index 34a1b0bf7b..5f0170d9a3 100644 --- a/res/field/scripts/scripts_pokemon_day_care.s +++ b/res/field/scripts/scripts_pokemon_day_care.s @@ -4,7 +4,7 @@ ScriptEntry PokemonDayCare_OnTransition ScriptEntry PokemonDayCare_GymGuide - ScriptEntry PokemonDayCare_Sign + ScriptEntry PokemonDayCare_BgSign ScriptEntryEnd PokemonDayCare_OnTransition: @@ -36,7 +36,7 @@ PokemonDayCare_CheckOnDayCarePokemon: ReleaseAll End -PokemonDayCare_Sign: +PokemonDayCare_BgSign: EventMessage PokemonDayCare_Text_PokemonGrowsWithYou End diff --git a/res/field/scripts/scripts_pokemon_league.s b/res/field/scripts/scripts_pokemon_league.s index 1168b5dabf..0852e93be9 100644 --- a/res/field/scripts/scripts_pokemon_league.s +++ b/res/field/scripts/scripts_pokemon_league.s @@ -2,12 +2,12 @@ #include "res/text/bank/pokemon_league.h" - ScriptEntry PokemonLeague_ArrowSignPokemonleague + ScriptEntry PokemonLeague_ArrowSignpostPokemonleague ScriptEntry PokemonLeague_SignboardVictoryRoad ScriptEntry PokemonLeague_Statue ScriptEntryEnd -PokemonLeague_ArrowSignPokemonleague: +PokemonLeague_ArrowSignpostPokemonleague: ShowArrowSign PokemonLeague_Text_PokemonLeagueAhead End diff --git a/res/field/scripts/scripts_pokemon_league_elevator_to_aaron_room.s b/res/field/scripts/scripts_pokemon_league_elevator_to_aaron_room.s index 8a7b6bf85f..ca6ac8777b 100644 --- a/res/field/scripts/scripts_pokemon_league_elevator_to_aaron_room.s +++ b/res/field/scripts/scripts_pokemon_league_elevator_to_aaron_room.s @@ -3,7 +3,7 @@ ScriptEntry PokemonLeagueElevatorToAaronRoom_OnTransition ScriptEntry PokemonLeagueElevatorToAaronRoom_DisablePlatformLift - ScriptEntry PokemonLeagueElevatorToAaronRoom_TriggerPlatformLift + ScriptEntry PokemonLeagueElevatorToAaronRoom_CoordEvent_PlatformLift ScriptEntryEnd PokemonLeagueElevatorToAaronRoom_OnTransition: @@ -17,7 +17,7 @@ PokemonLeagueElevatorToAaronRoom_DisablePlatformLift: SetVar VAR_MAP_LOCAL_0, 1 End -PokemonLeagueElevatorToAaronRoom_TriggerPlatformLift: +PokemonLeagueElevatorToAaronRoom_CoordEvent_PlatformLift: TriggerPlatformLift SetVar VAR_MAP_LOCAL_0, 1 End diff --git a/res/field/scripts/scripts_pokemon_league_elevator_to_bertha_room.s b/res/field/scripts/scripts_pokemon_league_elevator_to_bertha_room.s index d84b7d06c4..baaeb3b80f 100644 --- a/res/field/scripts/scripts_pokemon_league_elevator_to_bertha_room.s +++ b/res/field/scripts/scripts_pokemon_league_elevator_to_bertha_room.s @@ -3,7 +3,7 @@ ScriptEntry PokemonLeagueElevatorToBerthaRoom_OnTransition ScriptEntry PokemonLeagueElevatorToBerthaRoom_DisablePlatformLift - ScriptEntry PokemonLeagueElevatorToBerthaRoom_TriggerPlatformLift + ScriptEntry PokemonLeagueElevatorToBerthaRoom_CoordEvent_PlatformLift ScriptEntryEnd PokemonLeagueElevatorToBerthaRoom_OnTransition: @@ -17,7 +17,7 @@ PokemonLeagueElevatorToBerthaRoom_DisablePlatformLift: SetVar VAR_MAP_LOCAL_0, 1 End -PokemonLeagueElevatorToBerthaRoom_TriggerPlatformLift: +PokemonLeagueElevatorToBerthaRoom_CoordEvent_PlatformLift: TriggerPlatformLift SetVar VAR_MAP_LOCAL_0, 1 End diff --git a/res/field/scripts/scripts_pokemon_league_elevator_to_champion_room.s b/res/field/scripts/scripts_pokemon_league_elevator_to_champion_room.s index db99549886..9c64bf411b 100644 --- a/res/field/scripts/scripts_pokemon_league_elevator_to_champion_room.s +++ b/res/field/scripts/scripts_pokemon_league_elevator_to_champion_room.s @@ -3,7 +3,7 @@ ScriptEntry PokemonLeagueElevatorToChampionRoom_OnTransition ScriptEntry PokemonLeagueElevatorToChampionRoom_DisablePlatformLift - ScriptEntry PokemonLeagueElevatorToChampionRoom_TriggerPlatformLift + ScriptEntry PokemonLeagueElevatorToChampionRoom_CoordEvent_PlatformLift ScriptEntryEnd PokemonLeagueElevatorToChampionRoom_OnTransition: @@ -17,7 +17,7 @@ PokemonLeagueElevatorToChampionRoom_DisablePlatformLift: SetVar VAR_MAP_LOCAL_0, 1 End -PokemonLeagueElevatorToChampionRoom_TriggerPlatformLift: +PokemonLeagueElevatorToChampionRoom_CoordEvent_PlatformLift: TriggerPlatformLift SetVar VAR_MAP_LOCAL_0, 1 End diff --git a/res/field/scripts/scripts_pokemon_league_elevator_to_flint_room.s b/res/field/scripts/scripts_pokemon_league_elevator_to_flint_room.s index 6e707249a0..4782967b91 100644 --- a/res/field/scripts/scripts_pokemon_league_elevator_to_flint_room.s +++ b/res/field/scripts/scripts_pokemon_league_elevator_to_flint_room.s @@ -3,7 +3,7 @@ ScriptEntry PokemonLeagueElevatorToFlintRoom_OnTransition ScriptEntry PokemonLeagueElevatorToFlintRoom_DisablePlatformLift - ScriptEntry PokemonLeagueElevatorToFlintRoom_TriggerPlatformLift + ScriptEntry PokemonLeagueElevatorToFlintRoom_CoordEvent_PlatformLift ScriptEntryEnd PokemonLeagueElevatorToFlintRoom_OnTransition: @@ -17,7 +17,7 @@ PokemonLeagueElevatorToFlintRoom_DisablePlatformLift: SetVar VAR_MAP_LOCAL_0, 1 End -PokemonLeagueElevatorToFlintRoom_TriggerPlatformLift: +PokemonLeagueElevatorToFlintRoom_CoordEvent_PlatformLift: TriggerPlatformLift SetVar VAR_MAP_LOCAL_0, 1 End diff --git a/res/field/scripts/scripts_pokemon_league_elevator_to_lucian_room.s b/res/field/scripts/scripts_pokemon_league_elevator_to_lucian_room.s index 44fa008fd9..31c2533d3a 100644 --- a/res/field/scripts/scripts_pokemon_league_elevator_to_lucian_room.s +++ b/res/field/scripts/scripts_pokemon_league_elevator_to_lucian_room.s @@ -3,7 +3,7 @@ ScriptEntry PokemonLeagueElevatorToLucianRoom_OnTransition ScriptEntry PokemonLeagueElevatorToLucianRoom_DisablePlatformLift - ScriptEntry PokemonLeagueElevatorToLucianRoom_TriggerPlatformLift + ScriptEntry PokemonLeagueElevatorToLucianRoom_CoordEvent_PlatformLift ScriptEntryEnd PokemonLeagueElevatorToLucianRoom_OnTransition: @@ -17,7 +17,7 @@ PokemonLeagueElevatorToLucianRoom_DisablePlatformLift: SetVar VAR_MAP_LOCAL_0, 1 End -PokemonLeagueElevatorToLucianRoom_TriggerPlatformLift: +PokemonLeagueElevatorToLucianRoom_CoordEvent_PlatformLift: TriggerPlatformLift SetVar VAR_MAP_LOCAL_0, 1 End diff --git a/res/field/scripts/scripts_pokemon_league_hallway_to_hall_of_fame.s b/res/field/scripts/scripts_pokemon_league_hallway_to_hall_of_fame.s index 9ee5de55a1..a19cd79b5d 100644 --- a/res/field/scripts/scripts_pokemon_league_hallway_to_hall_of_fame.s +++ b/res/field/scripts/scripts_pokemon_league_hallway_to_hall_of_fame.s @@ -123,7 +123,7 @@ PokemonLeagueHallwayToHallOfFame_Movement_PlayerFaceCynthia: WalkOnSpotNormalEast EndMovement -PokemonLeagueElevatorToHallOfFame_UnusedMovement: +PokemonLeagueElevatorToHallOfFame_Movement_Unused: WalkOnSpotNormalEast EndMovement diff --git a/res/field/scripts/scripts_pokemon_league_north_pokecenter_1f.s b/res/field/scripts/scripts_pokemon_league_north_pokecenter_1f.s index 791ac64dc5..454409d7c2 100644 --- a/res/field/scripts/scripts_pokemon_league_north_pokecenter_1f.s +++ b/res/field/scripts/scripts_pokemon_league_north_pokecenter_1f.s @@ -6,7 +6,7 @@ ScriptEntry PokemonLeagueNorthPokecenter1F_DoorGuard ScriptEntry PokemonLeagueNorthPokecenter1F_VendorCommon ScriptEntry PokemonLeagueNorthPokecenter1F_VendorSpecial - ScriptEntry PokemonLeagueNorthPokecenter1F_RivalTrigger + ScriptEntry PokemonLeagueNorthPokecenter1F_CoordEvent_Rival ScriptEntry PokemonLeagueNorthPokecenter1F_OnTransition ScriptEntry PokemonLeagueNorthPokecenter1F_AceTrainerF ScriptEntry PokemonLeagueNorthPokecenter1F_Guitarist @@ -105,7 +105,7 @@ PokemonLeagueNorthPokecenter1F_VendorSpecial: PokeMartSpecialtiesWithGreeting MART_SPECIALTIES_ID_POKEMON_LEAGUE End -PokemonLeagueNorthPokecenter1F_RivalTrigger: +PokemonLeagueNorthPokecenter1F_CoordEvent_Rival: LockAll ClearFlag FLAG_HIDE_POKEMON_LEAGUE_NORTH_POKECENTER_1F_RIVAL AddObject LOCALID_LEAGUE_NORTH_RIVAL diff --git a/res/field/scripts/scripts_pokemon_league_north_pokecenter_2f.s b/res/field/scripts/scripts_pokemon_league_north_pokecenter_2f.s index 6c7bb5fa47..f8240c2bc9 100644 --- a/res/field/scripts/scripts_pokemon_league_north_pokecenter_2f.s +++ b/res/field/scripts/scripts_pokemon_league_north_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry PokemonLeagueNorthPokecenter2F_UnusedEntry1 + ScriptEntry PokemonLeagueNorthPokecenter2F_Dummy1 ScriptEntryEnd -PokemonLeagueNorthPokecenter2F_UnusedEntry1: +PokemonLeagueNorthPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_pokemon_league_north_pokecenter_b1f.s b/res/field/scripts/scripts_pokemon_league_north_pokecenter_b1f.s index 972a9d7e6a..21379a509e 100644 --- a/res/field/scripts/scripts_pokemon_league_north_pokecenter_b1f.s +++ b/res/field/scripts/scripts_pokemon_league_north_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry PokemonLeagueNorthPokecenterB1F_UnusedEntry1 + ScriptEntry PokemonLeagueNorthPokecenterB1F_Dummy1 ScriptEntryEnd -PokemonLeagueNorthPokecenterB1F_UnusedEntry1: +PokemonLeagueNorthPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_pokemon_league_south_pokecenter_1f.s b/res/field/scripts/scripts_pokemon_league_south_pokecenter_1f.s index 4244688767..f239a71f60 100644 --- a/res/field/scripts/scripts_pokemon_league_south_pokecenter_1f.s +++ b/res/field/scripts/scripts_pokemon_league_south_pokecenter_1f.s @@ -4,8 +4,8 @@ ScriptEntry PokemonLeagueSouthPokecenter1F_Nurse - ScriptEntry PokemonLeagueSouthPokecenter1F_UnusedVendor2 - ScriptEntry PokemonLeagueSouthPokecenter1F_UnusedVendor3 + ScriptEntry PokemonLeagueSouthPokecenter1F_VendorCommon_Unused + ScriptEntry PokemonLeagueSouthPokecenter1F_VendorSpecial_Unused ScriptEntry PokemonLeagueSouthPokecenter1F_OnTransition ScriptEntry PokemonLeagueSouthPokecenter1F_Pokefan ScriptEntry PokemonLeagueSouthPokecenter1F_AceTrainer @@ -19,11 +19,11 @@ PokemonLeagueSouthPokecenter1F_Nurse: Common_CallPokecenterNurse LOCALID_LEAGUE_SOUTH_NURSE End -PokemonLeagueSouthPokecenter1F_UnusedVendor2: +PokemonLeagueSouthPokecenter1F_VendorCommon_Unused: PokeMartCommonWithGreeting End -PokemonLeagueSouthPokecenter1F_UnusedVendor3: +PokemonLeagueSouthPokecenter1F_VendorSpecial_Unused: PokeMartSpecialtiesWithGreeting MART_SPECIALTIES_ID_POKEMON_LEAGUE End diff --git a/res/field/scripts/scripts_pokemon_league_south_pokecenter_2f.s b/res/field/scripts/scripts_pokemon_league_south_pokecenter_2f.s index 5de9e7a9c7..e3f106a5ca 100644 --- a/res/field/scripts/scripts_pokemon_league_south_pokecenter_2f.s +++ b/res/field/scripts/scripts_pokemon_league_south_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry PokemonLeagueSouthPokecenter2F_UnusedEntry1 + ScriptEntry PokemonLeagueSouthPokecenter2F_Dummy1 ScriptEntryEnd -PokemonLeagueSouthPokecenter2F_UnusedEntry1: +PokemonLeagueSouthPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_pokemon_league_south_pokecenter_b1f.s b/res/field/scripts/scripts_pokemon_league_south_pokecenter_b1f.s index 9f6a4f95d4..406d95372c 100644 --- a/res/field/scripts/scripts_pokemon_league_south_pokecenter_b1f.s +++ b/res/field/scripts/scripts_pokemon_league_south_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry PokemonLeagueSouthPokecenterB1F_UnusedEntry1 + ScriptEntry PokemonLeagueSouthPokecenterB1F_Dummy1 ScriptEntryEnd -PokemonLeagueSouthPokecenterB1F_UnusedEntry1: +PokemonLeagueSouthPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_pokemon_mansion.s b/res/field/scripts/scripts_pokemon_mansion.s index 4478b88c00..4712976b7b 100644 --- a/res/field/scripts/scripts_pokemon_mansion.s +++ b/res/field/scripts/scripts_pokemon_mansion.s @@ -344,7 +344,7 @@ PokemonMansion_Movement_MaidTrophyGardenFaceSouth: FaceSouth EndMovement -PokemonMansion_UnusedMovement: +PokemonMansion_Movement_Unused: FaceEast EndMovement diff --git a/res/field/scripts/scripts_pokemon_mansion_office.s b/res/field/scripts/scripts_pokemon_mansion_office.s index e8dc052d8c..330f326ede 100644 --- a/res/field/scripts/scripts_pokemon_mansion_office.s +++ b/res/field/scripts/scripts_pokemon_mansion_office.s @@ -7,7 +7,7 @@ ScriptEntry PokemonMansionOffice_MrBacklot ScriptEntry PokemonMansionOffice_OldMan ScriptEntry PokemonMansionOffice_Policeman - ScriptEntry PokemonMansionOffice_TriggerBlockStatue + ScriptEntry PokemonMansionOffice_CoordEvent_BlockStatue ScriptEntry PokemonMansionOffice_Statue ScriptEntry PokemonMansionOffice_Book ScriptEntryEnd @@ -267,7 +267,7 @@ PokemonMansionOffice_Movement_PolicemanFaceWest: FaceWest EndMovement -PokemonMansionOffice_TriggerBlockStatue: +PokemonMansionOffice_CoordEvent_BlockStatue: LockAll ApplyMovement LOCALID_POLICEMAN, PokemonMansionOffice_Movement_PolicemanFaceWest WaitMovement diff --git a/res/field/scripts/scripts_resort_area.s b/res/field/scripts/scripts_resort_area.s index 5408af5b7c..1d0022b355 100644 --- a/res/field/scripts/scripts_resort_area.s +++ b/res/field/scripts/scripts_resort_area.s @@ -7,17 +7,17 @@ ScriptEntry ResortArea_Beauty2 ScriptEntry ResortArea_AceTrainerF ScriptEntry ResortArea_BlackBelt - ScriptEntry ResortArea_MapSign - ScriptEntry ResortArea_SignRibbonSyndicate + ScriptEntry ResortArea_MapSignpost + ScriptEntry ResortArea_SignboardRibbonSyndicate ScriptEntry ResortArea_SwimmerM - ScriptEntry ResortArea_TriggerSchoolKidM + ScriptEntry ResortArea_CoordEvent_SchoolKidM ScriptEntry ResortArea_ProfRowan ScriptEntry ResortArea_Roark ScriptEntry ResortArea_Gardenia ScriptEntry ResortArea_Maylene ScriptEntry ResortArea_Byron ScriptEntry ResortArea_OnTransition - ScriptEntry ResortArea_SignVilla + ScriptEntry ResortArea_SignboardVilla ScriptEntryEnd ResortArea_OnTransition: @@ -90,11 +90,11 @@ ResortArea_BlackBelt: NPCMessage ResortArea_Text_DigUpCoolStuff End -ResortArea_MapSign: +ResortArea_MapSignpost: ShowMapSign ResortArea_Text_MapSign End -ResortArea_SignRibbonSyndicate: +ResortArea_SignboardRibbonSyndicate: ShowLandmarkSign ResortArea_Text_SignRibbonSyndicate End @@ -102,7 +102,7 @@ ResortArea_SwimmerM: NPCMessage ResortArea_Text_SomethingLurks End -ResortArea_TriggerSchoolKidM: +ResortArea_CoordEvent_SchoolKidM: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 CallIfEq VAR_0x8005, 472, ResortArea_SchoolKidMWalkToPlayerZ472 @@ -409,7 +409,7 @@ ResortArea_ByronDeclinedVisit: GoTo ResortArea_VillaVisitorEnd End -ResortArea_SignVilla: +ResortArea_SignboardVilla: ShowLandmarkSign ResortArea_Text_SignVilla End diff --git a/res/field/scripts/scripts_resort_area_pokecenter_2f.s b/res/field/scripts/scripts_resort_area_pokecenter_2f.s index 6144484b92..6317140e4e 100644 --- a/res/field/scripts/scripts_resort_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_resort_area_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry ResortAreaPokecenter2F_UnusedEntry1 + ScriptEntry ResortAreaPokecenter2F_Dummy1 ScriptEntryEnd -ResortAreaPokecenter2F_UnusedEntry1: +ResortAreaPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_resort_area_pokecenter_b1f.s b/res/field/scripts/scripts_resort_area_pokecenter_b1f.s index 78d86d7dc1..827a00eda5 100644 --- a/res/field/scripts/scripts_resort_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_resort_area_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry ResortAreaPokecenterB1F_UnusedEntry1 + ScriptEntry ResortAreaPokecenterB1F_Dummy1 ScriptEntryEnd -ResortAreaPokecenterB1F_UnusedEntry1: +ResortAreaPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_resort_area_ribbon_syndicate_1f.s b/res/field/scripts/scripts_resort_area_ribbon_syndicate_1f.s index 0cd9006d17..14241c88d3 100644 --- a/res/field/scripts/scripts_resort_area_ribbon_syndicate_1f.s +++ b/res/field/scripts/scripts_resort_area_ribbon_syndicate_1f.s @@ -10,7 +10,7 @@ ScriptEntry ResortAreaRibbonSyndicate1F_Lady ScriptEntry ResortAreaRibbonSyndicate1F_Skitty ScriptEntry ResortAreaRibbonSyndicate1F_Psyduck - ScriptEntry ResortAreaRibbonSyndicate1F_OnFrameCheckEntry + ScriptEntry ResortAreaRibbonSyndicate1F_OnFrame_CheckEntry ScriptEntry ResortAreaRibbonSyndicate1F_OnTransition ScriptEntryEnd @@ -23,7 +23,7 @@ ResortAreaRibbonSyndicate1F_SetBeautyPositionAwayFromDoor: SetObjectEventDir LOCALID_BEAUTY, DIR_SOUTH End -ResortAreaRibbonSyndicate1F_OnFrameCheckEntry: +ResortAreaRibbonSyndicate1F_OnFrame_CheckEntry: LockAll WaitTime 20, VAR_RESULT CountPartyRibbons VAR_0x8004 diff --git a/res/field/scripts/scripts_restaurant.s b/res/field/scripts/scripts_restaurant.s index c9032c4811..9f7438e145 100644 --- a/res/field/scripts/scripts_restaurant.s +++ b/res/field/scripts/scripts_restaurant.s @@ -5,7 +5,7 @@ ScriptEntry Restaurant_Waiter ScriptEntry Restaurant_OnTransition - ScriptEntry Restaurant_OnFrameClosed + ScriptEntry Restaurant_OnFrame_Closed ScriptEntry Restaurant_ArtistIsmael ScriptEntry Restaurant_BeautyHarley ScriptEntry Restaurant_RichBoyRoman @@ -164,7 +164,7 @@ Restaurant_InitTrainersEmilioKaylee: Restaurant_InitTrainersReturn: Return -Restaurant_OnFrameClosed: +Restaurant_OnFrame_Closed: LockAll ApplyMovement LOCALID_PLAYER, Restaurant_Movement_FaceEast WaitMovement diff --git a/res/field/scripts/scripts_rotoms_room.s b/res/field/scripts/scripts_rotoms_room.s index 9167017be9..a11964c227 100644 --- a/res/field/scripts/scripts_rotoms_room.s +++ b/res/field/scripts/scripts_rotoms_room.s @@ -19,7 +19,7 @@ ScriptEntry RotomsRoom_OnResume ScriptEntry RotomsRoom_ApplianceSpot ScriptEntry RotomsRoom_OldNotebook - ScriptEntry RotomsRoom_OnFrameProfRowan + ScriptEntry RotomsRoom_OnFrame_ProfRowan ScriptEntryEnd RotomsRoom_OnResume: @@ -517,7 +517,7 @@ RotomsRoom_SetStateEnterProfRowan: GoTo RotomsRoom_WarpInPlace End -RotomsRoom_OnFrameProfRowan: +RotomsRoom_OnFrame_ProfRowan: LockAll ClearFlag FLAG_HIDE_ROTOMS_ROOM_PROF_ROWAN PlaySE SEQ_SE_DP_KAIDAN2 diff --git a/res/field/scripts/scripts_route_201.s b/res/field/scripts/scripts_route_201.s index 0ecc8213fc..6bc12a905d 100644 --- a/res/field/scripts/scripts_route_201.s +++ b/res/field/scripts/scripts_route_201.s @@ -3,9 +3,9 @@ #include "res/field/events/events_route_201.h" ScriptEntry Route201_OnTransition - ScriptEntry Route201_TriggerChooseStarterScene - ScriptEntry Route201_TriggerFollowingRivalStopPlayerSouth - ScriptEntry Route201_TriggerPickAPokemon + ScriptEntry Route201_CoordEvent_ChooseStarterScene + ScriptEntry Route201_CoordEvent_FollowingRivalStopPlayerSouth + ScriptEntry Route201_CoordEvent_PickAPokemon ScriptEntry _0B24 ScriptEntry Route201_ArrowSignpostTwinleafTown ScriptEntry Route201_ArrowSignpostSandgemTown @@ -15,9 +15,9 @@ ScriptEntry Route201_SchoolKidM ScriptEntry Route201_Lass ScriptEntry Route201_Briefcase - ScriptEntry Route201_TriggerFollowingRivalStopPlayerEast + ScriptEntry Route201_CoordEvent_FollowingRivalStopPlayerEast ScriptEntry Route201_ProfRowan - ScriptEntry Route201_TriggerLetsCatchThatLegendaryPokemon + ScriptEntry Route201_CoordEvent_LetsCatchThatLegendaryPokemon ScriptEntryEnd Route201_OnTransition: @@ -34,7 +34,7 @@ Route201_SetCounterpartGraphicsLucas: SetVar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_PLAYER_M End -Route201_TriggerChooseStarterScene: +Route201_CoordEvent_ChooseStarterScene: LockAll ApplyMovement LOCALID_RIVAL, Route201_Movement_RivalNoticePlayer WaitMovement @@ -490,7 +490,7 @@ Route201_Movement_RivalWalkToPlayer: WalkOnSpotNormalSouth EndMovement -Route201_UnusedMovement: +Route201_Movement_Unused: WalkNormalEast EndMovement @@ -565,7 +565,7 @@ Route201_Movement_RivalMoveAwayForProfRowan: WalkOnSpotNormalEast EndMovement -Route201_UnusedMovement2: +Route201_Movement_Unused2: Delay8 WalkOnSpotFastEast EndMovement @@ -731,7 +731,7 @@ Route201_Movement_CounterpartLeave: WalkNormalEast 9 EndMovement -Route201_TriggerFollowingRivalStopPlayerEast: +Route201_CoordEvent_FollowingRivalStopPlayerEast: LockAll GetPlayerDir VAR_RESULT GoToIfEq VAR_RESULT, DIR_EAST, Route201_RivalStopPlayerFacingEast @@ -822,7 +822,7 @@ Route201_Movement_PlayerTurnToRivalSouth: WalkOnSpotFastSouth EndMovement -Route201_TriggerFollowingRivalStopPlayerSouth: +Route201_CoordEvent_FollowingRivalStopPlayerSouth: LockAll ApplyMovement LOCALID_PLAYER, Route201_Movement_PlayerTurnToRivalNorth ApplyMovement LOCALID_RIVAL, Route201_Movement_RivalFacePlayerSouth @@ -869,7 +869,7 @@ Route201_Movement_PlayerTurnToRivalNorth: WalkOnSpotFastNorth EndMovement -Route201_TriggerPickAPokemon: +Route201_CoordEvent_PickAPokemon: LockAll ApplyMovement LOCALID_RIVAL, Route201_Movement_RivalWalkOnSpotNormalSouth WaitMovement @@ -912,23 +912,23 @@ Route201_Movement_PlayerWalkBackNorthToBriefcase: WalkNormalNorth EndMovement -Route201_UnusedMovement3: +Route201_Movement_Unused3: WalkNormalNorth EndMovement -Route201_UnusedMovement4: +Route201_Movement_Unused4: WalkNormalNorth EndMovement -Route201_UnusedMovement5: +Route201_Movement_Unused5: WalkNormalWest EndMovement -Route201_UnusedMovement6: +Route201_Movement_Unused6: WalkNormalWest EndMovement -Route201_UnusedMovement7: +Route201_Movement_Unused7: WalkNormalWest EndMovement @@ -1086,7 +1086,7 @@ _0D80: WalkOnSpotNormalWest EndMovement -Route201_UnusedMovement8: +Route201_Movement_Unused8: WalkOnSpotNormalWest EndMovement @@ -1190,7 +1190,7 @@ Route201_ProfRowan: NPCMessage Route201_Text_RowanGoOnChooseAPokemon End -Route201_TriggerLetsCatchThatLegendaryPokemon: +Route201_CoordEvent_LetsCatchThatLegendaryPokemon: LockAll ApplyMovement LOCALID_RIVAL, Route201_Movement_RivalNoticePlayer WaitMovement diff --git a/res/field/scripts/scripts_route_202.s b/res/field/scripts/scripts_route_202.s index adef34997d..50809ba888 100644 --- a/res/field/scripts/scripts_route_202.s +++ b/res/field/scripts/scripts_route_202.s @@ -8,7 +8,7 @@ ScriptEntry Route202_ArrowSignpostSandgemTown ScriptEntry Route202_ArrowSignpostJubilifeCity ScriptEntry Route202_TrainerTipsSignpost - ScriptEntry Route202_TriggerCatchingTutorial + ScriptEntry Route202_CoordEvent_CatchingTutorial ScriptEntry Route202_Counterpart ScriptEntryEnd @@ -49,7 +49,7 @@ Route202_TrainerTipsSignpost: ShowScrollingSign Route202_Text_TrainerTipsPokemonInvolvedInBattleEarnExpPoints End -Route202_TriggerCatchingTutorial: +Route202_CoordEvent_CatchingTutorial: LockAll ApplyMovement LOCALID_COUNTERPART, Route202_Movement_CounterpartNoticePlayer ApplyMovement LOCALID_PLAYER, Route202_Movement_PlayerDelay @@ -370,7 +370,7 @@ Route202_Counterpart: CloseMessage PlayMusic SEQ_POKERADAR AddCameraOverrideObject 189, 818 - ApplyFreeCameraMovement _06F8 + ApplyFreeCameraMovement Route202_Movement_CameraMoveEast WaitMovement RemoveCameraOverrideObject ApplyMovement LOCALID_COUNTERPART, Route202_Movement_CounterpartFaceGrassPatchEast @@ -497,7 +497,7 @@ Route202_Movement_CounterpartWalkOnSpotNorthToFacePlayer: WalkOnSpotNormalNorth EndMovement -Route202_UnusedMovement: +Route202_Movement_Unused: WalkOnSpotNormalEast EndMovement @@ -506,12 +506,12 @@ Route202_Movement_CounterpartWalkOnSpotWestToFacePlayer: WalkOnSpotNormalWest EndMovement -Route202_UnusedMovement2: +Route202_Movement_Unused2: Delay8 WalkOnSpotNormalWest EndMovement -Route202_UnusedMovement3: +Route202_Movement_Unused3: Delay8 WalkOnSpotNormalSouth EndMovement @@ -536,11 +536,11 @@ Route202_Movement_PlayerWalkOnSpotWestToFaceCounterpart: WalkOnSpotNormalWest EndMovement -Route202_UnusedMovement4: +Route202_Movement_Unused4: WalkOnSpotNormalEast EndMovement .balign 4, 0 -_06F8: +Route202_Movement_CameraMoveEast: WalkNormalEast EndMovement diff --git a/res/field/scripts/scripts_route_203.s b/res/field/scripts/scripts_route_203.s index bc9a46c587..92445bea59 100644 --- a/res/field/scripts/scripts_route_203.s +++ b/res/field/scripts/scripts_route_203.s @@ -8,7 +8,7 @@ ScriptEntry Route203_ArrowSignpostOreburghCity ScriptEntry Route203_TrainerTipsSignpostEast ScriptEntry Route203_TrainerTipsSignpostWest - ScriptEntry Route203_RivalTrigger + ScriptEntry Route203_CoordEvent_Rival ScriptEntryEnd Route203_Lass: @@ -31,7 +31,7 @@ Route203_TrainerTipsSignpostWest: ShowScrollingSign Route203_Text_TrainerTipsPokemonMovesUseEnergyCalledPowerPoints End -Route203_RivalTrigger: +Route203_CoordEvent_Rival: LockAll ApplyMovement LOCALID_RIVAL, Route203_Movement_RivalNoticePlayer WaitMovement diff --git a/res/field/scripts/scripts_route_204_south.s b/res/field/scripts/scripts_route_204_south.s index 87ca2a0b17..c5c769e65f 100644 --- a/res/field/scripts/scripts_route_204_south.s +++ b/res/field/scripts/scripts_route_204_south.s @@ -4,7 +4,7 @@ ScriptEntry Route204South_Youngster ScriptEntry Route204South_ArrowSignpostJubilifeCity - ScriptEntry Route204South_LandmarkSignRavagedPath + ScriptEntry Route204South_SignboardRavagedPath ScriptEntryEnd Route204South_Youngster: @@ -15,7 +15,7 @@ Route204South_ArrowSignpostJubilifeCity: ShowArrowSign Route204South_Text_Rt204JubilifeCity End -Route204South_LandmarkSignRavagedPath: +Route204South_SignboardRavagedPath: ShowLandmarkSign Route204South_Text_RavagedPath End diff --git a/res/field/scripts/scripts_route_205_south.s b/res/field/scripts/scripts_route_205_south.s index 4c071f7608..382150ab68 100644 --- a/res/field/scripts/scripts_route_205_south.s +++ b/res/field/scripts/scripts_route_205_south.s @@ -8,8 +8,8 @@ ScriptEntry Route205South_Youngster ScriptEntry Route205South_Grunts ScriptEntry Route205South_LittleGirl - ScriptEntry Route205South_TriggerLittleGirl - ScriptEntry Route205South_TriggerGrunts + ScriptEntry Route205South_CoordEvent_LittleGirl + ScriptEntry Route205South_CoordEvent_Grunts ScriptEntry Route205South_ArrowSignpostFloaromaTown ScriptEntry Route205South_ArrowSignpostEternaForest ScriptEntry Route205South_TrainerTipsSignpost @@ -45,7 +45,7 @@ Route205South_Movement_GruntMEastWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -Route205South_TriggerGrunts: +Route205South_CoordEvent_Grunts: LockAll ApplyMovement LOCALID_GRUNT_M_WEST, Route205South_Movement_GruntMWestWalkOnSpotEast WaitMovement @@ -131,7 +131,7 @@ Route205South_HideFloaromaTownGrunts: SetVar VAR_VALLEY_WINDWORKS_STATE, 1 Return -Route205South_TriggerLittleGirl: +Route205South_CoordEvent_LittleGirl: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 659, Route205South_LittleGirlNoticePlayerZ659 diff --git a/res/field/scripts/scripts_route_206_cycling_road_north_gate.s b/res/field/scripts/scripts_route_206_cycling_road_north_gate.s index ab689942d6..704ae35645 100644 --- a/res/field/scripts/scripts_route_206_cycling_road_north_gate.s +++ b/res/field/scripts/scripts_route_206_cycling_road_north_gate.s @@ -5,19 +5,19 @@ ScriptEntry Route206CyclingRoadNorthGate_OnTransition ScriptEntry Route206CyclingRoadNorthGate_CashierM - ScriptEntry Route206CyclingRoadNorthGate_TriggerOnlyBicycles - ScriptEntry Route206CyclingRoadNorthGate_TriggerClearFlagForceBikingInGate + ScriptEntry Route206CyclingRoadNorthGate_CoordEvent_OnlyBicycles + ScriptEntry Route206CyclingRoadNorthGate_CoordEvent_ClearFlagForceBikingInGate ScriptEntry Route206CyclingRoadNorthGate_ScientistM - ScriptEntry Route206CyclingRoadNorthGate_OnFrame + ScriptEntry Route206CyclingRoadNorthGate_OnFrame_TryForceBiking ScriptEntryEnd -Route206CyclingRoadNorthGate_OnFrame: +Route206CyclingRoadNorthGate_OnFrame_TryForceBiking: GetPlayerMapPos VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_5 - CallIfGe VAR_MAP_LOCAL_5, 12, Route206CyclingRoadNorthGate_OnFrameForceBikingInGate + CallIfGe VAR_MAP_LOCAL_5, 12, Route206CyclingRoadNorthGate_ForceBikingInGateOnFrame SetVar VAR_MAP_LOCAL_3, 1 End -Route206CyclingRoadNorthGate_OnFrameForceBikingInGate: +Route206CyclingRoadNorthGate_ForceBikingInGateOnFrame: SetFlag FLAG_FORCE_BIKING_IN_GATE Return @@ -33,10 +33,10 @@ Route206CyclingRoadNorthGate_CashierM: NPCMessage Route206CyclingRoadNorthGate_Text_LearnHowToShiftGearsAndYoullBeAbleToRideAnywhere End -Route206CyclingRoadNorthGate_TriggerOnlyBicycles: +Route206CyclingRoadNorthGate_CoordEvent_OnlyBicycles: LockAll CheckPlayerOnBike VAR_RESULT - GoToIfEq VAR_RESULT, TRUE, Route206CyclingRoadNorthGate_TriggerForceBikingInGate + GoToIfEq VAR_RESULT, TRUE, Route206CyclingRoadNorthGate_ForceBikingInGateCoordEvent ApplyMovement LOCALID_CASHIER_M_WEST, Route206CyclingRoadNorthGate_Movement_CashierMExclamationMark WaitMovement Message Route206CyclingRoadNorthGate_Text_CyclingRoadIsOnlyForBicycles @@ -46,7 +46,7 @@ Route206CyclingRoadNorthGate_TriggerOnlyBicycles: ReleaseAll End -Route206CyclingRoadNorthGate_TriggerForceBikingInGate: +Route206CyclingRoadNorthGate_ForceBikingInGateCoordEvent: SetFlag FLAG_FORCE_BIKING_IN_GATE SetVar VAR_MAP_LOCAL_2, 1 ReleaseAll @@ -62,7 +62,7 @@ Route206CyclingRoadNorthGate_Movement_PlayerWalkNorth: WalkNormalNorth EndMovement -Route206CyclingRoadNorthGate_TriggerClearFlagForceBikingInGate: +Route206CyclingRoadNorthGate_CoordEvent_ClearFlagForceBikingInGate: LockAll ClearFlag FLAG_FORCE_BIKING_IN_GATE SetVar VAR_MAP_LOCAL_2, 0 diff --git a/res/field/scripts/scripts_route_206_cycling_road_south_gate.s b/res/field/scripts/scripts_route_206_cycling_road_south_gate.s index 8afec1a2b6..1682f21b28 100644 --- a/res/field/scripts/scripts_route_206_cycling_road_south_gate.s +++ b/res/field/scripts/scripts_route_206_cycling_road_south_gate.s @@ -5,22 +5,22 @@ ScriptEntry Route206CyclingRoadSouthGate_OnTransition ScriptEntry Route206CyclingRoadSouthGate_CashierM - ScriptEntry Route206CyclingRoadSouthGate_TriggerOnlyCyclists - ScriptEntry Route206CyclingRoadSouthGate_TriggerClearFlagForceBikingInGate + ScriptEntry Route206CyclingRoadSouthGate_CoordEvent_OnlyCyclists + ScriptEntry Route206CyclingRoadSouthGate_CoordEvent_ClearFlagForceBikingInGate ScriptEntry Route206CyclingRoadSouthGate_BattleGirl - ScriptEntry Route206CyclingRoadSouthGate_OnFrame + ScriptEntry Route206CyclingRoadSouthGate_OnFrame_TryForceBiking ScriptEntryEnd Route206CyclingRoadSouthGate_OnTransition: End -Route206CyclingRoadSouthGate_OnFrame: +Route206CyclingRoadSouthGate_OnFrame_TryForceBiking: GetPlayerMapPos VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_5 - CallIfLe VAR_MAP_LOCAL_5, 3, Route206CyclingRoadSouthGate_OnFrameForceBikingInGate + CallIfLe VAR_MAP_LOCAL_5, 3, Route206CyclingRoadSouthGate_ForceBikingInGateOnFrame SetVar VAR_MAP_LOCAL_3, 1 End -Route206CyclingRoadSouthGate_OnFrameForceBikingInGate: +Route206CyclingRoadSouthGate_ForceBikingInGateOnFrame: SetFlag FLAG_FORCE_BIKING_IN_GATE Return @@ -28,10 +28,10 @@ Route206CyclingRoadSouthGate_CashierM: NPCMessage Route206CyclingRoadSouthGate_Text_LearnHowToShiftGearsAndYoullBeAbleToRideAnywhere End -Route206CyclingRoadSouthGate_TriggerOnlyCyclists: +Route206CyclingRoadSouthGate_CoordEvent_OnlyCyclists: LockAll CheckPlayerOnBike VAR_RESULT - GoToIfEq VAR_RESULT, TRUE, Route206CyclingRoadSouthGate_TriggerForceBikingInGate + GoToIfEq VAR_RESULT, TRUE, Route206CyclingRoadSouthGate_ForceBikingInGateCoordEvent ApplyMovement LOCALID_CASHIER_M_WEST, Route206CyclingRoadSouthGate_Movement_CashierMExclamationMark WaitMovement Message Route206CyclingRoadSouthGate_Text_CyclingRoadIsOpenOnlyToCyclists @@ -41,7 +41,7 @@ Route206CyclingRoadSouthGate_TriggerOnlyCyclists: ReleaseAll End -Route206CyclingRoadSouthGate_TriggerForceBikingInGate: +Route206CyclingRoadSouthGate_ForceBikingInGateCoordEvent: SetFlag FLAG_FORCE_BIKING_IN_GATE SetVar VAR_MAP_LOCAL_2, 1 ReleaseAll @@ -57,7 +57,7 @@ Route206CyclingRoadSouthGate_Movement_PlayerWalkSouth: WalkNormalSouth EndMovement -Route206CyclingRoadSouthGate_TriggerClearFlagForceBikingInGate: +Route206CyclingRoadSouthGate_CoordEvent_ClearFlagForceBikingInGate: LockAll ClearFlag FLAG_FORCE_BIKING_IN_GATE SetVar VAR_MAP_LOCAL_2, 0 diff --git a/res/field/scripts/scripts_route_207.s b/res/field/scripts/scripts_route_207.s index 77629d5327..b8ad10f505 100644 --- a/res/field/scripts/scripts_route_207.s +++ b/res/field/scripts/scripts_route_207.s @@ -5,12 +5,12 @@ ScriptEntry Route207_OnTransition - ScriptEntry Route207_TriggerCounterpart - ScriptEntry Route207_Unused + ScriptEntry Route207_CoordEvent_Counterpart + ScriptEntry Route207_Dummy3 ScriptEntry Route207_CyclistM ScriptEntry Route207_ArrowSignpostMtCoronet ScriptEntry Route207_ArrowSignpostOreburghCity - ScriptEntry Route207_TrainerTips + ScriptEntry Route207_TrainerTipsSignpost ScriptEntryEnd Route207_OnTransition: @@ -27,7 +27,7 @@ Route207_SetCounterpartGraphicsLucas: SetVar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_PLAYER_M End -Route207_TriggerCounterpart: +Route207_CoordEvent_Counterpart: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 SetObjectEventPos LOCALID_COUNTERPART, 331, VAR_0x8005 @@ -111,12 +111,12 @@ Route207_Movement_PlayerFaceCounterpart: WalkOnSpotNormalWest EndMovement -Route207_UnusedMovement: +Route207_Movement_Unused: Delay8 8 WalkOnSpotNormalWest EndMovement -Route207_UnusedMovement2: +Route207_Movement_Unused2: Delay8 1 WalkOnSpotNormalNorth EndMovement @@ -137,7 +137,7 @@ Route207_Movement_CounterpartLeave: WalkNormalWest 8 EndMovement -Route207_Unused: +Route207_Dummy3: NPCMessage Route207_Text_Dummy8 End @@ -167,7 +167,7 @@ Route207_ArrowSignpostOreburghCity: ShowArrowSign Route207_Text_Rt207OreburghCity End -Route207_TrainerTips: +Route207_TrainerTipsSignpost: ShowScrollingSign Route207_Text_TrainerTipsPokemonMayBecomeImmobilizedIfTheyAreAsleepOrParalyzed End diff --git a/res/field/scripts/scripts_route_208.s b/res/field/scripts/scripts_route_208.s index a6774eb2d3..ae90211277 100644 --- a/res/field/scripts/scripts_route_208.s +++ b/res/field/scripts/scripts_route_208.s @@ -4,9 +4,9 @@ ScriptEntry Route208_ArrowSignpostMtCoronet ScriptEntry Route208_ArrowSignpostHearthomeCity - ScriptEntry Route208_SignBerryMastersHouse + ScriptEntry Route208_SignboardBerryMastersHouse ScriptEntry Route208_BlackBelt - ScriptEntry Route208_TrainerTips + ScriptEntry Route208_TrainerTipsSignpost ScriptEntryEnd Route208_ArrowSignpostMtCoronet: @@ -17,11 +17,11 @@ Route208_ArrowSignpostHearthomeCity: ShowArrowSign Route208_Text_SignRt208HearthomeCity End -Route208_SignBerryMastersHouse: +Route208_SignboardBerryMastersHouse: ShowLandmarkSign Route208_Text_SignBerryMastersHouse End -Route208_TrainerTips: +Route208_TrainerTipsSignpost: ShowScrollingSign Route208_Text_TrainerTipsWatchBerrySoilColor End diff --git a/res/field/scripts/scripts_route_209.s b/res/field/scripts/scripts_route_209.s index 36b5e5cbd4..4329277372 100644 --- a/res/field/scripts/scripts_route_209.s +++ b/res/field/scripts/scripts_route_209.s @@ -10,7 +10,7 @@ ScriptEntry Route209_JoggerRichard ScriptEntry Route209_JoggerRaul ScriptEntry Route209_OnTransition - ScriptEntry Route209_TrainerTips + ScriptEntry Route209_TrainerTipsSignpost ScriptEntryEnd Route209_OnTransition: @@ -188,7 +188,7 @@ Route209_ArrowSignpostSolaceonTown: ShowArrowSign Route209_Text_Rt209SolaceonTown End -Route209_TrainerTips: +Route209_TrainerTipsSignpost: ShowScrollingSign Route209_Text_TrainerTipsRegisterKeyItems End diff --git a/res/field/scripts/scripts_route_209_gate_to_hearthome_city.s b/res/field/scripts/scripts_route_209_gate_to_hearthome_city.s index f6720a471d..7dc4974975 100644 --- a/res/field/scripts/scripts_route_209_gate_to_hearthome_city.s +++ b/res/field/scripts/scripts_route_209_gate_to_hearthome_city.s @@ -4,14 +4,14 @@ ScriptEntry Route209GateToHearthomeCity_BattleGirl - ScriptEntry Route209GateToHearthomeCity_TriggerRival + ScriptEntry Route209GateToHearthomeCity_CoordEvent_Rival ScriptEntryEnd Route209GateToHearthomeCity_BattleGirl: NPCMessage Route209GateToHearthomeCity_Text_TheresAWreckedStonePillar End -Route209GateToHearthomeCity_TriggerRival: +Route209GateToHearthomeCity_CoordEvent_Rival: LockAll ApplyMovement LOCALID_RIVAL, Route209GateToHearthomeCity_Movement_RivalNoticePlayer WaitMovement @@ -123,7 +123,7 @@ Route209GateToHearthomeCity_RivalLeaveZ9: Return .balign 4, 0 -Route209GateToHearthomeCity_UnusedMovement: +Route209GateToHearthomeCity_Movement_Unused: WalkFastWest 4 EmoteExclamationMark EndMovement diff --git a/res/field/scripts/scripts_route_210_north.s b/res/field/scripts/scripts_route_210_north.s index 8112542ada..7a32319131 100644 --- a/res/field/scripts/scripts_route_210_north.s +++ b/res/field/scripts/scripts_route_210_north.s @@ -3,19 +3,19 @@ ScriptEntry Route210North_BlackBelt - ScriptEntry Route210North_ArrowSignCelesticTown - ScriptEntry Route210North_SignGrandmaWilmasHouse + ScriptEntry Route210North_ArrowSignpostCelesticTown + ScriptEntry Route210North_SignboardGrandmaWilmasHouse ScriptEntryEnd Route210North_BlackBelt: NPCMessage Route210North_Text_HowDoesDefogWork End -Route210North_ArrowSignCelesticTown: +Route210North_ArrowSignpostCelesticTown: ShowArrowSign Route210North_Text_SignCelesticTown End -Route210North_SignGrandmaWilmasHouse: +Route210North_SignboardGrandmaWilmasHouse: ShowLandmarkSign Route210North_Text_SignGrandmaWilmasHouse End diff --git a/res/field/scripts/scripts_route_210_south.s b/res/field/scripts/scripts_route_210_south.s index 6c84c6f547..57fcfc807e 100644 --- a/res/field/scripts/scripts_route_210_south.s +++ b/res/field/scripts/scripts_route_210_south.s @@ -4,9 +4,9 @@ ScriptEntry Route210South_Psyduck - ScriptEntry Route210South_Unused + ScriptEntry Route210South_Dummy2 ScriptEntry Route210South_AceTrainerF - ScriptEntry Route210South_SignCafeCabin + ScriptEntry Route210South_SignboardCafeCabin ScriptEntry Route210South_ArrowSignpostSolaceonTown ScriptEntry Route210South_JoggerWyatt ScriptEntry Route210South_OnTransition @@ -202,21 +202,21 @@ Route210South_Movement_PlayerWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -Route210South_UnusedMovement: +Route210South_Movement_Unused: Delay8 WalkOnSpotNormalEast Delay8 WalkOnSpotNormalNorth EndMovement -Route210South_UnusedMovement2: +Route210South_Movement_Unused2: Delay8 WalkOnSpotNormalWest Delay8 WalkOnSpotNormalNorth EndMovement -Route210South_Unused: +Route210South_Dummy2: NPCMessage Route210South_Text_Dummy6 End @@ -246,7 +246,7 @@ Route210South_BagIsFull: ReleaseAll End -Route210South_SignCafeCabin: +Route210South_SignboardCafeCabin: ShowLandmarkSign Route210South_Text_SignCafeCabin End diff --git a/res/field/scripts/scripts_route_211_east.s b/res/field/scripts/scripts_route_211_east.s index d1d804eab1..780e8ffa01 100644 --- a/res/field/scripts/scripts_route_211_east.s +++ b/res/field/scripts/scripts_route_211_east.s @@ -3,9 +3,9 @@ ScriptEntry Route211East_AceTrainerM - ScriptEntry Route211East_ArrowSignMtCoronet - ScriptEntry Route211East_TrainerTips - ScriptEntry Route211East_ArrowSignCelesticTown + ScriptEntry Route211East_ArrowSignpostMtCoronet + ScriptEntry Route211East_TrainerTipsSignpost + ScriptEntry Route211East_ArrowSignpostCelesticTown ScriptEntryEnd Route211East_AceTrainerM: @@ -44,15 +44,15 @@ Route211East_Movement_ExclamationMark: EmoteExclamationMark EndMovement -Route211East_ArrowSignMtCoronet: +Route211East_ArrowSignpostMtCoronet: ShowArrowSign Route211East_Text_SignMtCoronet End -Route211East_TrainerTips: +Route211East_TrainerTipsSignpost: ShowScrollingSign Route211East_Text_TrainerTipsCheckSupply End -Route211East_ArrowSignCelesticTown: +Route211East_ArrowSignpostCelesticTown: ShowArrowSign Route211East_Text_SignCelesticTown End diff --git a/res/field/scripts/scripts_route_211_west.s b/res/field/scripts/scripts_route_211_west.s index f6ceaf16b0..4bddfb1dac 100644 --- a/res/field/scripts/scripts_route_211_west.s +++ b/res/field/scripts/scripts_route_211_west.s @@ -2,12 +2,12 @@ #include "res/text/bank/route_211_west.h" - ScriptEntry Route211West_Unused + ScriptEntry Route211West_Dummy1 ScriptEntry Route211West_ArrowSignpostMtCoronet ScriptEntry Route211West_ArrowSignpostEternaCity ScriptEntryEnd -Route211West_Unused: +Route211West_Dummy1: NPCMessage Route211West_Text_Dummy0 End diff --git a/res/field/scripts/scripts_route_212_north.s b/res/field/scripts/scripts_route_212_north.s index 1a95b65c61..92d580e2c0 100644 --- a/res/field/scripts/scripts_route_212_north.s +++ b/res/field/scripts/scripts_route_212_north.s @@ -4,8 +4,8 @@ ScriptEntry Route212North_Youngster ScriptEntry Route212North_ArrowSignpostHearthomeCity - ScriptEntry Route212North_SignPokemonMansion - ScriptEntry Route212North_TrainerTips + ScriptEntry Route212North_SignboardPokemonMansion + ScriptEntry Route212North_TrainerTipsSignpost ScriptEntry Route212North_Collector ScriptEntry Route212North_PolicemanBobby ScriptEntry Route212North_PolicemanAlex @@ -50,11 +50,11 @@ Route212North_ArrowSignpostHearthomeCity: ShowArrowSign Route212North_Text_SignHearthomeCity End -Route212North_SignPokemonMansion: +Route212North_SignboardPokemonMansion: ShowLandmarkSign Route212North_Text_SignPokemonMansion End -Route212North_TrainerTips: +Route212North_TrainerTipsSignpost: ShowScrollingSign Route212North_Text_TrainerTipsReorganizeItems End diff --git a/res/field/scripts/scripts_route_212_south.s b/res/field/scripts/scripts_route_212_south.s index c9cd3f91a0..25366865be 100644 --- a/res/field/scripts/scripts_route_212_south.s +++ b/res/field/scripts/scripts_route_212_south.s @@ -5,11 +5,11 @@ ScriptEntry Route212South_SchoolKidM ScriptEntry Route212South_Lady ScriptEntry Route212South_Collector - ScriptEntry Route212South_ArrowSignPastoriaCity - ScriptEntry Route212South_SignShardsWanted + ScriptEntry Route212South_ArrowSignpostPastoriaCity + ScriptEntry Route212South_SignboardShardsWanted ScriptEntry Route212South_PolicemanDanny ScriptEntry Route212South_OnTransition - ScriptEntry Route212South_TrainerTips + ScriptEntry Route212South_TrainerTipsSignpost ScriptEntryEnd Route212South_OnTransition: @@ -40,15 +40,15 @@ Route212South_Collector: NPCMessage Route212South_Text_HowAboutPokemonMansion End -Route212South_ArrowSignPastoriaCity: +Route212South_ArrowSignpostPastoriaCity: ShowArrowSign Route212South_Text_SignPastoriaCity End -Route212South_SignShardsWanted: +Route212South_SignboardShardsWanted: ShowLandmarkSign Route212South_Text_SignShardsWanted End -Route212South_TrainerTips: +Route212South_TrainerTipsSignpost: ShowScrollingSign Route212South_Text_TrainerTipsBog End diff --git a/res/field/scripts/scripts_route_213.s b/res/field/scripts/scripts_route_213.s index e40e2f825a..1f68da1cf0 100644 --- a/res/field/scripts/scripts_route_213.s +++ b/res/field/scripts/scripts_route_213.s @@ -8,9 +8,9 @@ ScriptEntry Route213_Fisherman ScriptEntry Route213_Beauty ScriptEntry Route213_Collector - ScriptEntry Route213_ArrowSignPastoriaCity - ScriptEntry Route213_SignHotelGrandLake - ScriptEntry Route213_SignDrFootstepsHouse + ScriptEntry Route213_ArrowSignpostPastoriaCity + ScriptEntry Route213_SignboardHotelGrandLake + ScriptEntry Route213_SignboardDrFootstepsHouse ScriptEntryEnd Route213_OnTransition: @@ -326,15 +326,15 @@ Route213_Fisherman: NPCMessage Route213_Text_TheresAFancyHotel End -Route213_ArrowSignPastoriaCity: +Route213_ArrowSignpostPastoriaCity: ShowArrowSign Route213_Text_SignRt213PastoriaCity End -Route213_SignHotelGrandLake: +Route213_SignboardHotelGrandLake: ShowLandmarkSign Route213_Text_SignHotelGrandLake End -Route213_SignDrFootstepsHouse: +Route213_SignboardDrFootstepsHouse: ShowLandmarkSign Route213_Text_SignDrFootstepsHouse End diff --git a/res/field/scripts/scripts_route_214.s b/res/field/scripts/scripts_route_214.s index 018445f478..b1051d665e 100644 --- a/res/field/scripts/scripts_route_214.s +++ b/res/field/scripts/scripts_route_214.s @@ -2,8 +2,8 @@ #include "res/text/bank/route_214.h" - ScriptEntry Route214_ArrowSignVeilstoneCity - ScriptEntry Route214_ArrowSignLakeValor + ScriptEntry Route214_ArrowSignpostVeilstoneCity + ScriptEntry Route214_ArrowSignpostLakeValor ScriptEntry Route214_OnTransition ScriptEntry Route214_OnLoad ScriptEntryEnd @@ -37,10 +37,10 @@ Route214_OnTransition: GoToIfLt VAR_MAP_LOCAL_0, 10, Route214_RemoveWarpsManiacCaveLongAndTunnel End -Route214_ArrowSignVeilstoneCity: +Route214_ArrowSignpostVeilstoneCity: ShowArrowSign Route214_Text_SignVeilstoneCity End -Route214_ArrowSignLakeValor: +Route214_ArrowSignpostLakeValor: ShowArrowSign Route214_Text_SignLakeValor End diff --git a/res/field/scripts/scripts_route_215.s b/res/field/scripts/scripts_route_215.s index 71e42835c0..84fd12bbdf 100644 --- a/res/field/scripts/scripts_route_215.s +++ b/res/field/scripts/scripts_route_215.s @@ -2,14 +2,14 @@ #include "res/text/bank/route_215.h" - ScriptEntry Route215_Unused + ScriptEntry Route215_Dummy1 ScriptEntry Route215_BlackBelt ScriptEntry Route215_ArrowSignpostWest ScriptEntry Route215_ArrowSignpostVeilstoneCity ScriptEntry Route215_JoggerScott ScriptEntry Route215_JoggerCraig ScriptEntry Route215_OnTransition - ScriptEntry Route215_TrainerTips + ScriptEntry Route215_TrainerTipsSignpost ScriptEntryEnd Route215_OnTransition: @@ -32,7 +32,7 @@ Route215_SetJoggersNoBattle: SetFlag FLAG_HIDE_ROUTE_215_JOGGER_CRAIG End -Route215_Unused: +Route215_Dummy1: NPCMessage Route215_Text_Dummy0 End @@ -70,7 +70,7 @@ Route215_ArrowSignpostVeilstoneCity: ShowArrowSign Route215_Text_SignRt215VeilstoneCity End -Route215_TrainerTips: +Route215_TrainerTipsSignpost: ShowScrollingSign Route215_Text_TrainerTipsPhysicalSpecial End diff --git a/res/field/scripts/scripts_route_216.s b/res/field/scripts/scripts_route_216.s index 2ea420c40b..d96df7f9d3 100644 --- a/res/field/scripts/scripts_route_216.s +++ b/res/field/scripts/scripts_route_216.s @@ -2,12 +2,12 @@ #include "res/text/bank/route_216.h" - ScriptEntry Route216_Unused + ScriptEntry Route216_CantRideBike_Unused ScriptEntry Route216_ArrowSignpostMtCoronet - ScriptEntry Route216_SignSnowboundLodge + ScriptEntry Route216_SignboardSnowboundLodge ScriptEntryEnd -Route216_Unused: +Route216_CantRideBike_Unused: NPCMessage Route216_Text_CantRideBikeOnSnow End @@ -15,7 +15,7 @@ Route216_ArrowSignpostMtCoronet: ShowArrowSign Route216_Text_SignRt216MtCoronet End -Route216_SignSnowboundLodge: +Route216_SignboardSnowboundLodge: ShowLandmarkSign Route216_Text_SignSnowboundLodge End diff --git a/res/field/scripts/scripts_route_217.s b/res/field/scripts/scripts_route_217.s index b67ce3bcfb..b7fb4d87b2 100644 --- a/res/field/scripts/scripts_route_217.s +++ b/res/field/scripts/scripts_route_217.s @@ -6,7 +6,7 @@ ScriptEntry Route217_IceRock ScriptEntry Route217_ArrowSignpostLakeAcuity ScriptEntry Route217_SnowpointNPCF - ScriptEntry Route217_TriggerMaylene + ScriptEntry Route217_CoordEvent_Maylene ScriptEntryEnd Route217_IceRock: @@ -21,7 +21,7 @@ Route217_SnowpointNPCF: NPCMessage Route217_Text_ImUsingDowsingMachine End -Route217_TriggerMaylene: +Route217_CoordEvent_Maylene: LockAll ClearFlag FLAG_HIDE_ROUTE_217_MAYLENE AddObject LOCALID_MAYLENE diff --git a/res/field/scripts/scripts_route_218_gate_to_canalave_city.s b/res/field/scripts/scripts_route_218_gate_to_canalave_city.s index 2be5ad1c3e..b40b57aa88 100644 --- a/res/field/scripts/scripts_route_218_gate_to_canalave_city.s +++ b/res/field/scripts/scripts_route_218_gate_to_canalave_city.s @@ -4,10 +4,10 @@ ScriptEntry Route218GateToCanalaveCity_Policeman - ScriptEntry Route218GateToCanalaveCity_TriggerScientistM + ScriptEntry Route218GateToCanalaveCity_CoordEvent_ScientistM ScriptEntryEnd -Route218GateToCanalaveCity_TriggerScientistM: +Route218GateToCanalaveCity_CoordEvent_ScientistM: LockAll Call Route218GateToCanalaveCity_ScientistMWalkToPlayer BufferPlayerName 0 diff --git a/res/field/scripts/scripts_route_219.s b/res/field/scripts/scripts_route_219.s index 62bb96227a..f71eb2cf84 100644 --- a/res/field/scripts/scripts_route_219.s +++ b/res/field/scripts/scripts_route_219.s @@ -2,10 +2,10 @@ #include "res/text/bank/route_219.h" - ScriptEntry Route219_ArrowSignSandgemBeach + ScriptEntry Route219_ArrowSignpostSandgemBeach ScriptEntryEnd -Route219_ArrowSignSandgemBeach: +Route219_ArrowSignpostSandgemBeach: ShowArrowSign Route219_Text_SignSandgemBeach End diff --git a/res/field/scripts/scripts_route_221.s b/res/field/scripts/scripts_route_221.s index 8709976f77..5f05c26c0a 100644 --- a/res/field/scripts/scripts_route_221.s +++ b/res/field/scripts/scripts_route_221.s @@ -4,7 +4,7 @@ ScriptEntry Route221_WorkerWest ScriptEntry Route221_WorkerEast - ScriptEntry Route221_SignPalPark + ScriptEntry Route221_SignboardPalPark ScriptEntry Route221_OnTransition ScriptEntryEnd @@ -24,7 +24,7 @@ Route221_WorkerEast: NPCMessage Route221_Text_GettingPalParkReady End -Route221_SignPalPark: +Route221_SignboardPalPark: ShowLandmarkSign Route221_Text_SignPalPark End diff --git a/res/field/scripts/scripts_route_221_house.s b/res/field/scripts/scripts_route_221_house.s index 5730654f51..ddfcd3511f 100644 --- a/res/field/scripts/scripts_route_221_house.s +++ b/res/field/scripts/scripts_route_221_house.s @@ -3,7 +3,7 @@ ScriptEntry Route221House_ExpertM - ScriptEntry Route221House_Sign + ScriptEntry Route221House_BgSign ScriptEntryEnd Route221House_ExpertM: @@ -91,7 +91,7 @@ Route221House_ComeAgainTomorrow: ReleaseAll End -Route221House_Sign: +Route221House_BgSign: EventMessage Route221House_Text_WinItemsFromMe End diff --git a/res/field/scripts/scripts_route_222.s b/res/field/scripts/scripts_route_222.s index da4fc02681..871f5f0734 100644 --- a/res/field/scripts/scripts_route_222.s +++ b/res/field/scripts/scripts_route_222.s @@ -6,8 +6,8 @@ ScriptEntry Route222_RichBoy ScriptEntry Route222_ArrowSignpostHotelGrandLake ScriptEntry Route222_ArrowSignpostSunyshoreCity - ScriptEntry Route222_SignPikachuFanClub - ScriptEntry Route222_SignPokemonSizeContest + ScriptEntry Route222_SignboardPikachuFanClub + ScriptEntry Route222_SignboardPokemonSizeContest ScriptEntry Route222_PolicemanThomas ScriptEntry Route222_OnTransition ScriptEntryEnd @@ -66,11 +66,11 @@ Route222_ArrowSignpostSunyshoreCity: ShowArrowSign Route222_Text_SignRt222SunyshoreCity End -Route222_SignPikachuFanClub: +Route222_SignboardPikachuFanClub: ShowLandmarkSign Route222_Text_SignPikachuFanClub End -Route222_SignPokemonSizeContest: +Route222_SignboardPokemonSizeContest: ShowLandmarkSign Route222_Text_SignPokemonSizeContest End diff --git a/res/field/scripts/scripts_route_222_west_house.s b/res/field/scripts/scripts_route_222_west_house.s index f2ec9e624f..a354fe725d 100644 --- a/res/field/scripts/scripts_route_222_west_house.s +++ b/res/field/scripts/scripts_route_222_west_house.s @@ -4,10 +4,10 @@ ScriptEntry Route222WestHouse_OnTransition ScriptEntry Route222WestHouse_Pikachu - ScriptEntry Route222WestHouse_Unused3 - ScriptEntry Route222WestHouse_Unused4 - ScriptEntry Route222WestHouse_Unused5 - ScriptEntry Route222WestHouse_Unused6 + ScriptEntry Route222WestHouse_Pikachu3_Unused + ScriptEntry Route222WestHouse_Pikachu4_Unused + ScriptEntry Route222WestHouse_Pikachu5_Unused + ScriptEntry Route222WestHouse_Pikachu6_Unused ScriptEntry Route222WestHouse_PokefanM ScriptEntryEnd @@ -19,19 +19,19 @@ Route222WestHouse_Pikachu: PokemonCryAndMessage SPECIES_PIKACHU, Route222WestHouse_Text_PikachuCryPikachuu End -Route222WestHouse_Unused3: +Route222WestHouse_Pikachu3_Unused: PokemonCryAndMessage SPECIES_PIKACHU, Route222WestHouse_Text_PikachuCryPikaah End -Route222WestHouse_Unused4: +Route222WestHouse_Pikachu4_Unused: PokemonCryAndMessage SPECIES_PIKACHU, Route222WestHouse_Text_PikachuCryPikaPika End -Route222WestHouse_Unused5: +Route222WestHouse_Pikachu5_Unused: PokemonCryAndMessage SPECIES_PIKACHU, Route222WestHouse_Text_PikachuCryPiPikachu End -Route222WestHouse_Unused6: +Route222WestHouse_Pikachu6_Unused: PokemonCryAndMessage SPECIES_PIKACHU, Route222WestHouse_Text_PikachuCryPiiKaahchu End diff --git a/res/field/scripts/scripts_route_224.s b/res/field/scripts/scripts_route_224.s index f45dfb2c88..da147d7374 100644 --- a/res/field/scripts/scripts_route_224.s +++ b/res/field/scripts/scripts_route_224.s @@ -9,7 +9,7 @@ ScriptEntry Route224_OnResume ScriptEntry Route224_Tablet ScriptEntry Route224_ProfOak - ScriptEntry Route224_TriggerMarley + ScriptEntry Route224_CoordEvent_Marley ScriptEntry Route224_Marley ScriptEntryEnd @@ -303,7 +303,7 @@ Route224_Movement_ProfOakLookAround: Delay16 EndMovement -Route224_UnusedMovement: +Route224_Movement_Unused: WalkOnSpotNormalSouth EndMovement @@ -324,7 +324,7 @@ Route224_Movement_ShayminLeave: WalkSlightlyFastNorth 12 EndMovement -Route224_TriggerMarley: +Route224_CoordEvent_Marley: LockAll ClearFlag FLAG_HIDE_ROUTE_224_MARLEY GetPlayerMapPos VAR_0x8004, VAR_0x8005 diff --git a/res/field/scripts/scripts_route_226_house.s b/res/field/scripts/scripts_route_226_house.s index c62e3acab5..b6ac8ef35e 100644 --- a/res/field/scripts/scripts_route_226_house.s +++ b/res/field/scripts/scripts_route_226_house.s @@ -5,7 +5,7 @@ ScriptEntry Route226House_OnTransition ScriptEntry Route226House_Meister - ScriptEntry Route226House_Sign + ScriptEntry Route226House_BgSign ScriptEntryEnd Route226House_OnTransition: @@ -77,6 +77,6 @@ Route226House_MakeFriendsAnywhere: ReleaseAll End -Route226House_Sign: +Route226House_BgSign: EventMessage Route226House_Text_VisitedOver150Countries End diff --git a/res/field/scripts/scripts_route_227.s b/res/field/scripts/scripts_route_227.s index fce530315b..571d452e08 100644 --- a/res/field/scripts/scripts_route_227.s +++ b/res/field/scripts/scripts_route_227.s @@ -3,13 +3,13 @@ #include "res/field/events/events_route_227.h" - ScriptEntry Route227_TriggerWakeRival + ScriptEntry Route227_CoordEvent_WakeRival ScriptEntry Route227_ArrowSignpostStarkMountain - ScriptEntry Route227_TriggerBuck + ScriptEntry Route227_CoordEvent_Buck ScriptEntry Route227_Buck ScriptEntryEnd -Route227_TriggerWakeRival: +Route227_CoordEvent_WakeRival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 CallIfEq VAR_0x8004, 739, Route227_PlayerWalkWestOnSpotNorth @@ -86,7 +86,7 @@ Route227_Movement_PlayerWatchRivalLeave: WalkOnSpotNormalSouth EndMovement -Route227_UnusedMovement: +Route227_Movement_Unused: WalkOnSpotNormalNorth EndMovement @@ -98,7 +98,7 @@ Route227_Movement_PlayerWalkWestWatchWakeLeave: WalkOnSpotNormalSouth EndMovement -Route227_UnusedMovement2: +Route227_Movement_Unused2: Delay8 WalkOnSpotNormalWest Delay4 @@ -131,7 +131,7 @@ Route227_Movement_RivalLeave: WalkFastSouth 9 EndMovement -Route227_UnusedMovement3: +Route227_Movement_Unused3: WalkFastSouth 9 EndMovement @@ -151,12 +151,12 @@ Route227_Movement_WakeWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -Route227_UnusedMovement4: +Route227_Movement_Unused4: Delay8 WalkOnSpotNormalEast EndMovement -Route227_UnusedMovement5: +Route227_Movement_Unused5: WalkOnSpotNormalSouth EndMovement @@ -166,7 +166,7 @@ Route227_Movement_WakeLeave: WalkNormalSouth 9 EndMovement -Route227_UnusedMovement6: +Route227_Movement_Unused6: WalkNormalSouth 9 EndMovement @@ -178,7 +178,7 @@ Route227_Buck: NPCMessage Route227_Text_YoureInCharge End -Route227_TriggerBuck: +Route227_CoordEvent_Buck: LockAll ApplyMovement LOCALID_BUCK, Route227_Movement_BuckNoticePlayer ApplyMovement LOCALID_PLAYER, Route227_Movement_PlayerFaceBuck @@ -216,7 +216,7 @@ Route227_Movement_PlayerFaceBuck: FaceNorth EndMovement -Route227_UnusedMovement7: +Route227_Movement_Unused7: Delay8 WalkOnSpotNormalEast EndMovement diff --git a/res/field/scripts/scripts_route_228_north_house.s b/res/field/scripts/scripts_route_228_north_house.s index 5de50e52f0..3ab8269f72 100644 --- a/res/field/scripts/scripts_route_228_north_house.s +++ b/res/field/scripts/scripts_route_228_north_house.s @@ -3,7 +3,7 @@ ScriptEntry Route228NorthHouse_ExpertM - ScriptEntry Route228NorthHouse_Sign + ScriptEntry Route228NorthHouse_BgSign ScriptEntryEnd Route228NorthHouse_ExpertM: @@ -162,7 +162,7 @@ Route228NorthHouse_AlreadyKnowsMove: ReleaseAll End -Route228NorthHouse_Sign: +Route228NorthHouse_BgSign: EventMessage Route228NorthHouse_Text_PokemonListedLearnUltimateMoves End diff --git a/res/field/scripts/scripts_sandgem_town.s b/res/field/scripts/scripts_sandgem_town.s index a559ab9692..fa212d1dcc 100644 --- a/res/field/scripts/scripts_sandgem_town.s +++ b/res/field/scripts/scripts_sandgem_town.s @@ -4,17 +4,17 @@ ScriptEntry SandgemTown_OnTransition - ScriptEntry SandgemTown_TriggerCounterpartLeadToLab - ScriptEntry SandgemTown_OnFrameExitLab + ScriptEntry SandgemTown_CoordEvent_CounterpartLeadToLab + ScriptEntry SandgemTown_OnFrame_ExitLab ScriptEntry SandgemTown_Youngster ScriptEntry SandgemTown_PokemonBreederM ScriptEntry SandgemTown_PokemonBreederF - ScriptEntry SandgemTown_Unused - ScriptEntry SandgemTown_MapSign - ScriptEntry SandgemTown_LandmarkSignPokemonResearchLab - ScriptEntry SandgemTown_LandmarkSignCounterpartMailbox - ScriptEntry SandgemTown_LandmarkSignPokeMart - ScriptEntry SandgemTown_LandmarkSignPokemonCenter + ScriptEntry SandgemTown_RowansComeBack_Unused + ScriptEntry SandgemTown_MapSignpost + ScriptEntry SandgemTown_SignboardPokemonResearchLab + ScriptEntry SandgemTown_SignboardCounterpartMailbox + ScriptEntry SandgemTown_SignboardPokeMart + ScriptEntry SandgemTown_SignboardPokemonCenter ScriptEntryEnd SandgemTown_OnTransition: @@ -38,7 +38,7 @@ SandgemTown_SetCounterpartGraphicsLucas: SetVar VAR_OBJ_GFX_ID_0, OBJ_EVENT_GFX_PLAYER_M End -SandgemTown_TriggerCounterpartLeadToLab: +SandgemTown_CoordEvent_CounterpartLeadToLab: LockAll ApplyMovement LOCALID_SANDGEM_COUNTERPART, SandgemTown_Movement_CounterpartNoticePlayer WaitMovement @@ -323,12 +323,12 @@ SandgemTown_Movement_PlayerFaceCounterpartZ843: FaceSouth EndMovement -SandgemTown_UnusedMovement: +SandgemTown_Movement_Unused: Delay8 3 WalkOnSpotNormalSouth EndMovement -SandgemTown_UnusedMovement2: +SandgemTown_Movement_Unused2: WalkNormalEast 4 WalkNormalNorth 2 EndMovement @@ -433,7 +433,7 @@ SandgemTown_Movement_RivalLeave: WalkFastEast 7 EndMovement -SandgemTown_OnFrameExitLab: +SandgemTown_OnFrame_ExitLab: LockAll LoadDoorAnimation 5, 26, 8, 10, ANIMATION_TAG_DOOR_1 PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 @@ -674,28 +674,28 @@ SandgemTown_PokemonBreederF: NPCMessage SandgemTown_Text_IdBetterSaveThis End -SandgemTown_Unused: +SandgemTown_RowansComeBack_Unused: NPCMessage SandgemTown_Text_ProfessorRowansComeBackToTown End -SandgemTown_MapSign: +SandgemTown_MapSignpost: ShowMapSign SandgemTown_Text_MapSign End -SandgemTown_LandmarkSignPokemonResearchLab: +SandgemTown_SignboardPokemonResearchLab: ShowLandmarkSign SandgemTown_Text_PokemonResearchLabSign End -SandgemTown_LandmarkSignCounterpartMailbox: +SandgemTown_SignboardCounterpartMailbox: BufferCounterpartName 0 ShowLandmarkSign SandgemTown_Text_CounterpartMailbox End -SandgemTown_LandmarkSignPokeMart: +SandgemTown_SignboardPokeMart: ShowLandmarkSign SandgemTown_Text_PokeMartSign End -SandgemTown_LandmarkSignPokemonCenter: +SandgemTown_SignboardPokemonCenter: ShowLandmarkSign SandgemTown_Text_PokemonCenterSign End diff --git a/res/field/scripts/scripts_sandgem_town_mart.s b/res/field/scripts/scripts_sandgem_town_mart.s index 11eb5eac5d..4a4e4d2340 100644 --- a/res/field/scripts/scripts_sandgem_town_mart.s +++ b/res/field/scripts/scripts_sandgem_town_mart.s @@ -3,7 +3,7 @@ ScriptEntry SandgemTownMart_CommonVendor - ScriptEntry SandgemTownMart_Dummy + ScriptEntry SandgemTownMart_Dummy2 ScriptEntry SandgemTownMart_Breeder ScriptEntry SandgemTownMart_SchoolBoy ScriptEntryEnd @@ -12,7 +12,7 @@ SandgemTownMart_CommonVendor: PokeMartCommonWithGreeting 0 End -SandgemTownMart_Dummy: +SandgemTownMart_Dummy2: End SandgemTownMart_Breeder: diff --git a/res/field/scripts/scripts_sandgem_town_pokecenter_b1f.s b/res/field/scripts/scripts_sandgem_town_pokecenter_b1f.s index 63310c9ba4..bb7ebba84e 100644 --- a/res/field/scripts/scripts_sandgem_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_sandgem_town_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SandgemTownPokecenterB1F_UnusedEntry1 + ScriptEntry SandgemTownPokecenterB1F_Dummy1 ScriptEntryEnd -SandgemTownPokecenterB1F_UnusedEntry1: +SandgemTownPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_sandgem_town_pokemon_research_lab.s b/res/field/scripts/scripts_sandgem_town_pokemon_research_lab.s index beb870b92b..0eba38a389 100644 --- a/res/field/scripts/scripts_sandgem_town_pokemon_research_lab.s +++ b/res/field/scripts/scripts_sandgem_town_pokemon_research_lab.s @@ -4,20 +4,20 @@ ScriptEntry SandgemTownLab_OnTransition - ScriptEntry SandgemTownLab_OnFrameGetPokedex + ScriptEntry SandgemTownLab_OnFrame_GetPokedex ScriptEntry SandgemTownLab_ProfRowan - ScriptEntry SandgemTownLab_UnusedEntry4 + ScriptEntry SandgemTownLab_Dummy4 ScriptEntry SandgemTownLab_ScientistM ScriptEntry SandgemTownLab_ScientistF - ScriptEntry SandgemTownLab_UnusedEntry7 + ScriptEntry SandgemTownLab_Dummy7 ScriptEntry SandgemTownLab_BookshelfAdventureRuleNo1 ScriptEntry SandgemTownLab_BookshelfAdventureRuleNo2 ScriptEntry SandgemTownLab_BookshelfBooks ScriptEntry SandgemTownLab_BookshelfReferenceMaterial ScriptEntry SandgemTownLab_PC - ScriptEntry SandgemTownLab_UnusedEntry13 + ScriptEntry SandgemTownLab_ResearchMaterials_Unused ScriptEntry SandgemTownLab_Refrigerator - ScriptEntry SandgemTownLab_OnFrameReturnedFromDistortionWorld + ScriptEntry SandgemTownLab_OnFrame_ReturnedFromDistortionWorld ScriptEntryEnd SandgemTownLab_OnTransition: @@ -76,7 +76,7 @@ SandgemTownLab_IfYouSeeCynthiaGiveHerMyBestRegards: ReleaseAll End -SandgemTownLab_OnFrameReturnedFromDistortionWorld: +SandgemTownLab_OnFrame_ReturnedFromDistortionWorld: LockAll CallIfEq VAR_EXITED_DISTORTION_WORLD_STATE, 2, SandgemTownLab_IncreaseExitedDistortionWorldState BufferPlayerName 1 @@ -123,10 +123,10 @@ SandgemTownLab_Movement_CounterpartTurnOnSpot: WalkOnSpotNormalSouth EndMovement -SandgemTownLab_UnusedEntry4: +SandgemTownLab_Dummy4: End -SandgemTownLab_OnFrameGetPokedex: +SandgemTownLab_OnFrame_GetPokedex: LockAll ApplyMovement LOCALID_COUNTERPART, SandgemTownLab_Movement_CounterpartWalkToProfRowan ApplyMovement LOCALID_PLAYER, SandgemTownLab_Movement_PlayerWalkToProfRowan @@ -314,7 +314,7 @@ SandgemTownLab_CounterpartLeave: End .balign 4, 0 -SandgemTownPokemonResearchLab_UnusedMovement: +SandgemTownPokemonResearchLab_Movement_Unused: WalkOnSpotNormalSouth EndMovement @@ -441,7 +441,7 @@ SandgemTownLab_HearingWhatWasHappeningGaveMeShivers: ReleaseAll End -SandgemTownLab_UnusedEntry7: +SandgemTownLab_Dummy7: End SandgemTownLab_BookshelfAdventureRuleNo1: @@ -465,7 +465,7 @@ SandgemTownLab_PC: EventMessage SandgemTownLab_Text_PlayerCheckedThePC End -SandgemTownLab_UnusedEntry13: +SandgemTownLab_ResearchMaterials_Unused: EventMessage SandgemTownLab_Text_ResearchMaterialsAreCarefullyTuckedAway End @@ -629,7 +629,7 @@ SandgemTownLab_Movement_ProfRowanTurnOnSpot: WalkOnSpotNormalSouth EndMovement -SandgemTownPokemonResearchLab_UnusedMovement2: +SandgemTownPokemonResearchLab_Movement_Unused2: WalkOnSpotNormalWest EndMovement diff --git a/res/field/scripts/scripts_scratch_off_cards.s b/res/field/scripts/scripts_scratch_off_cards.s index 820a7135f6..e591771863 100644 --- a/res/field/scripts/scripts_scratch_off_cards.s +++ b/res/field/scripts/scripts_scratch_off_cards.s @@ -2,51 +2,51 @@ #include "res/text/bank/scratch_off_cards.h" - ScriptEntry _0006 + ScriptEntry ScratchOffCards_BattleFrontierAttendant ScriptEntryEnd -_0006: +ScratchOffCards_BattleFrontierAttendant: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer ShowBattlePoints 21, 1 - GoToIfSet FLAG_UNK_0x0072, _0031 - SetFlag FLAG_UNK_0x0072 + GoToIfSet FLAG_TALKED_TO_SCRATCH_OFF_CARDS_ATTENDANT, ScratchOffCards_WouldYouLikeCards + SetFlag FLAG_TALKED_TO_SCRATCH_OFF_CARDS_ATTENDANT BufferNumber 0, 1 - Message 15 - GoTo _0041 + Message ScratchOffCards_Text_IntroduceScratchOffCards + GoTo ScratchOffCards_Menu End -_0031: +ScratchOffCards_WouldYouLikeCards: BufferNumber 0, 1 - Message 0 - GoTo _0041 + Message ScratchOffCards_Text_WouldYouLikeCards + GoTo ScratchOffCards_Menu End -_0041: - Message 1 +ScratchOffCards_Menu: + Message ScratchOffCards_Text_WillYouBuyCards InitLocalTextMenu 30, 11, 0, VAR_RESULT SetMenuXOriginToRight - AddMenuEntryImm 2, 0 - AddMenuEntryImm 3, 1 - AddMenuEntryImm 4, 2 + AddMenuEntryImm ScratchOffCards_Text_Scratch, 0 + AddMenuEntryImm ScratchOffCards_Text_Info, 1 + AddMenuEntryImm ScratchOffCards_Text_Cancel, 2 ShowMenu SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0085 - GoToIfEq VAR_0x8008, 1, _015D - GoTo _0152 + GoToIfEq VAR_0x8008, 0, ScratchOffCards_TryBuyCards + GoToIfEq VAR_0x8008, 1, ScratchOffCards_Info + GoTo ScratchOffCards_PleaseVisitAgain End -_0085: +ScratchOffCards_TryBuyCards: BufferNumber 2, 1 - Message 7 + Message ScratchOffCards_Text_XBPForThreeCards ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _0152 + GoToIfEq VAR_RESULT, MENU_NO, ScratchOffCards_PleaseVisitAgain CheckBattlePoints 1, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _0147 + GoToIfEq VAR_RESULT, 0, ScratchOffCards_NotEnoughBP RemoveBattlePoints 1 UpdateBPDisplay - Message 10 + Message ScratchOffCards_Text_SelectThreeCards FadeScreenOut WaitFadeScreen HideBattlePoints @@ -60,110 +60,110 @@ _0085: FadeScreenIn WaitFadeScreen SetVar VAR_0x8000, 0 - Call _017A - GoToIfEq VAR_0x8000, 0, _01AB + Call ScratchOffCards_GetNumCardsWon + GoToIfEq VAR_0x8000, 0, ScratchOffCards_NoCardsWon BufferNumber 0, VAR_0x8000 - Message 11 - CallIfNe VAR_MAP_LOCAL_1, 0, _01B6 - CallIfNe VAR_MAP_LOCAL_3, 0, _0200 - CallIfNe VAR_MAP_LOCAL_5, 0, _024A - Message 5 - GoTo _0172 + Message ScratchOffCards_Text_YouWonOnXCards + CallIfNe VAR_MAP_LOCAL_1, 0, ScratchOffCards_HandleCard0Prize + CallIfNe VAR_MAP_LOCAL_3, 0, ScratchOffCards_HandleCard1Prize + CallIfNe VAR_MAP_LOCAL_5, 0, ScratchOffCards_HandleCard2Prize + Message ScratchOffCards_Text_PleaseVisitAgain + GoTo ScratchOffCards_End End -_0147: - Message 14 - GoTo _0168 +ScratchOffCards_NotEnoughBP: + Message ScratchOffCards_Text_NotEnoughBP + GoTo ScratchOffCards_HideBattlePoints End -_0152: - Message 5 - GoTo _0168 +ScratchOffCards_PleaseVisitAgain: + Message ScratchOffCards_Text_PleaseVisitAgain + GoTo ScratchOffCards_HideBattlePoints End -_015D: - Message 6 - GoTo _0041 +ScratchOffCards_Info: + Message ScratchOffCards_Text_ScratchOffCardsInfo + GoTo ScratchOffCards_Menu End -_0168: +ScratchOffCards_HideBattlePoints: WaitButton CloseMessage HideBattlePoints ReleaseAll End -_0172: +ScratchOffCards_End: WaitButton CloseMessage ReleaseAll End -_017A: - CallIfNe VAR_MAP_LOCAL_1, 0, _01A3 - CallIfNe VAR_MAP_LOCAL_3, 0, _01A3 - CallIfNe VAR_MAP_LOCAL_5, 0, _01A3 +ScratchOffCards_GetNumCardsWon: + CallIfNe VAR_MAP_LOCAL_1, 0, ScratchOffCards_IncreaseVarCardsWon + CallIfNe VAR_MAP_LOCAL_3, 0, ScratchOffCards_IncreaseVarCardsWon + CallIfNe VAR_MAP_LOCAL_5, 0, ScratchOffCards_IncreaseVarCardsWon Return -_01A3: +ScratchOffCards_IncreaseVarCardsWon: AddVar VAR_0x8000, 1 Return -_01AB: - Message 5 - GoTo _0172 +ScratchOffCards_NoCardsWon: + Message ScratchOffCards_Text_PleaseVisitAgain + GoTo ScratchOffCards_End End -_01B6: - GoToIfGt VAR_MAP_LOCAL_1, 1, _01CE +ScratchOffCards_HandleCard0Prize: + GoToIfGt VAR_MAP_LOCAL_1, 1, ScratchOffCards_BufferCard0PrizePlural BufferItemName 0, VAR_MAP_LOCAL_0 - GoTo _01D3 + GoTo ScratchOffCards_TryGiveCard0Prize -_01CE: +ScratchOffCards_BufferCard0PrizePlural: BufferItemNamePlural 0, VAR_MAP_LOCAL_0 -_01D3: +ScratchOffCards_TryGiveCard0Prize: BufferNumber 1, VAR_MAP_LOCAL_1 - GoToIfCannotFitItem VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, VAR_RESULT, _0294 + GoToIfCannotFitItem VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, VAR_RESULT, ScratchOffCards_NoRoomForItem PlayFanfare SEQ_FANFA4 - Message 13 + Message ScratchOffCards_Text_ReceivedXItems AddItem VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, VAR_RESULT WaitFanfare Return -_0200: - GoToIfGt VAR_MAP_LOCAL_3, 1, _0218 +ScratchOffCards_HandleCard1Prize: + GoToIfGt VAR_MAP_LOCAL_3, 1, ScratchOffCards_BufferCard1PrizePlural BufferItemName 0, VAR_MAP_LOCAL_2 - GoTo _021D + GoTo ScratchOffCards_TryGiveCard1Prize -_0218: +ScratchOffCards_BufferCard1PrizePlural: BufferItemNamePlural 0, VAR_MAP_LOCAL_2 -_021D: +ScratchOffCards_TryGiveCard1Prize: BufferNumber 1, VAR_MAP_LOCAL_3 - GoToIfCannotFitItem VAR_MAP_LOCAL_2, VAR_MAP_LOCAL_3, VAR_RESULT, _0294 + GoToIfCannotFitItem VAR_MAP_LOCAL_2, VAR_MAP_LOCAL_3, VAR_RESULT, ScratchOffCards_NoRoomForItem PlayFanfare SEQ_FANFA4 - Message 13 + Message ScratchOffCards_Text_ReceivedXItems AddItem VAR_MAP_LOCAL_2, VAR_MAP_LOCAL_3, VAR_RESULT WaitFanfare Return -_024A: - GoToIfGt VAR_MAP_LOCAL_5, 1, _0262 +ScratchOffCards_HandleCard2Prize: + GoToIfGt VAR_MAP_LOCAL_5, 1, ScratchOffCards_BufferCard2PrizePlural BufferItemName 0, VAR_MAP_LOCAL_4 - GoTo _0267 + GoTo ScratchOffCards_TryGiveCard2Prize -_0262: +ScratchOffCards_BufferCard2PrizePlural: BufferItemNamePlural 0, VAR_MAP_LOCAL_4 -_0267: +ScratchOffCards_TryGiveCard2Prize: BufferNumber 1, VAR_MAP_LOCAL_5 - GoToIfCannotFitItem VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_5, VAR_RESULT, _0294 + GoToIfCannotFitItem VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_5, VAR_RESULT, ScratchOffCards_NoRoomForItem PlayFanfare SEQ_FANFA4 - Message 13 + Message ScratchOffCards_Text_ReceivedXItems AddItem VAR_MAP_LOCAL_4, VAR_MAP_LOCAL_5, VAR_RESULT WaitFanfare Return -_0294: - Message 12 +ScratchOffCards_NoRoomForItem: + Message ScratchOffCards_Text_NoRoomForItem Return .balign 4, 0 diff --git a/res/field/scripts/scripts_sendoff_spring.s b/res/field/scripts/scripts_sendoff_spring.s index 40d1553038..f20efa0d22 100644 --- a/res/field/scripts/scripts_sendoff_spring.s +++ b/res/field/scripts/scripts_sendoff_spring.s @@ -3,7 +3,7 @@ #include "res/field/events/events_sendoff_spring.h" - ScriptEntry SendoffSpring_OnFrameCynthia + ScriptEntry SendoffSpring_OnFrame_Cynthia ScriptEntry SendoffSpring_Cynthia ScriptEntry SendoffSpring_OnTransition ScriptEntryEnd @@ -16,7 +16,7 @@ SendoffSpring_ShowTurnbackCaveItem: ClearFlag FLAG_HIDE_TURNBACK_CAVE_GIRATINA_ROOM_ITEM Return -SendoffSpring_OnFrameCynthia: +SendoffSpring_OnFrame_Cynthia: LockAll SetPartyGiratinaForm GIRATINA_FORM_ALTERED ScrCmd_2B5 MAP_HEADER_UNKNOWN_266, 762, 714 diff --git a/res/field/scripts/scripts_snowpoint_city.s b/res/field/scripts/scripts_snowpoint_city.s index c9f7763081..01a4b26e33 100644 --- a/res/field/scripts/scripts_snowpoint_city.s +++ b/res/field/scripts/scripts_snowpoint_city.s @@ -5,15 +5,15 @@ ScriptEntry SnowpointCity_OnTransition ScriptEntry SnowpointCity_TempleGuard - ScriptEntry SnowpointCity_TriggerTempleGuard + ScriptEntry SnowpointCity_CoordEvent_TempleGuard ScriptEntry SnowpointCity_Candice ScriptEntry SnowpointCity_AceTrainerSnowF ScriptEntry SnowpointCity_SnowpointNPCF1 ScriptEntry SnowpointCity_SnowpointNPCF2 ScriptEntry SnowpointCity_SnowpointNPCM ScriptEntry SnowpointCity_Sailor - ScriptEntry SnowpointCity_MapSign - ScriptEntry SnowpointCity_GymSign + ScriptEntry SnowpointCity_MapSignpost + ScriptEntry SnowpointCity_GymSignpost ScriptEntry SnowpointCity_SailorSSSpiral ScriptEntryEnd @@ -25,7 +25,7 @@ SnowpointCity_HideCandice: SetFlag FLAG_HIDE_SNOWPOINT_CITY_CANDICE End -SnowpointCity_TriggerTempleGuard: +SnowpointCity_CoordEvent_TempleGuard: LockAll ApplyMovement LOCALID_TEMPLE_GUARD, SnowpointCity_Movement_TempleGuardWalkOnSpotWest WaitMovement @@ -168,11 +168,11 @@ SnowpointCity_Sailor: NPCMessage SnowpointCity_Text_NothingExceptionalHere End -SnowpointCity_MapSign: +SnowpointCity_MapSignpost: ShowMapSign SnowpointCity_Text_MapSign End -SnowpointCity_GymSign: +SnowpointCity_GymSignpost: ShowScrollingSign SnowpointCity_Text_SignPokemonGym End diff --git a/res/field/scripts/scripts_snowpoint_city_east_house.s b/res/field/scripts/scripts_snowpoint_city_east_house.s index bc66841e15..07b4ddcb88 100644 --- a/res/field/scripts/scripts_snowpoint_city_east_house.s +++ b/res/field/scripts/scripts_snowpoint_city_east_house.s @@ -12,12 +12,12 @@ SnowpointCityEastHouse_ExpertM: LockAll FacePlayer GoToIfSet FLAG_HEARD_DAILY_TRENDY_SAYING, SnowpointCityEastHouse_UseTrendySayings - ScrCmd_27F VAR_RESULT + CheckAllToughWordsUnlocked VAR_RESULT GoToIfEq VAR_RESULT, TRUE, SnowpointCityEastHouse_AreYouUsingTrendySayings Message SnowpointCityEastHouse_Text_HearTrendySaying ShowYesNoMenu VAR_RESULT GoToIfEq VAR_RESULT, MENU_NO, SnowpointCityEastHouse_ComeOnNow - ScrCmd_27D VAR_RESULT, 0 + TryBufferAndUnlockRandomToughWord VAR_RESULT, 0 GoToIfEq VAR_RESULT, -1, SnowpointCityEastHouse_AreYouUsingTrendySayings SetFlag FLAG_HEARD_DAILY_TRENDY_SAYING Message SnowpointCityEastHouse_Text_TrendyThingIsThis diff --git a/res/field/scripts/scripts_snowpoint_city_gym.s b/res/field/scripts/scripts_snowpoint_city_gym.s index d9fc8aa6d0..345b9e33b6 100644 --- a/res/field/scripts/scripts_snowpoint_city_gym.s +++ b/res/field/scripts/scripts_snowpoint_city_gym.s @@ -21,7 +21,7 @@ SnowpointGym_Candice: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_ICICLE, SnowpointGym_CandiceAfterBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 167, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_SNOWPOINT_CITY_GYM, 0, 0, 0 Message SnowpointGym_Text_CandiceIntro CloseMessage StartTrainerBattle TRAINER_LEADER_CANDICE @@ -40,7 +40,7 @@ SnowpointGym_Candice: SetTrainerFlag TRAINER_ACE_TRAINER_SAVANNAH SetTrainerFlag TRAINER_ACE_TRAINER_ALICIA SetTrainerFlag TRAINER_ACE_TRAINER_BRENNA - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 167, TRAINER_LEADER_CANDICE, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_SNOWPOINT_CITY_GYM, TRAINER_LEADER_CANDICE, 0, 0 SetFlag FLAG_HIDE_VEILSTONE_GALACTIC_GRUNTS Message SnowpointGym_Text_CandiceExplainIcicleBadge GoTo SnowpointGym_CandiceTryGiveTM72 diff --git a/res/field/scripts/scripts_snowpoint_city_pokecenter_2f.s b/res/field/scripts/scripts_snowpoint_city_pokecenter_2f.s index 3a8307f29b..aba5d3aa4b 100644 --- a/res/field/scripts/scripts_snowpoint_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_snowpoint_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SnowpointCityPokecenter2F_UnusedEntry1 + ScriptEntry SnowpointCityPokecenter2F_Dummy1 ScriptEntryEnd -SnowpointCityPokecenter2F_UnusedEntry1: +SnowpointCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_snowpoint_city_pokecenter_b1f.s b/res/field/scripts/scripts_snowpoint_city_pokecenter_b1f.s index e61424633d..1fd65cb4a8 100644 --- a/res/field/scripts/scripts_snowpoint_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_snowpoint_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SnowpointCityPokecenterB1F_UnusedEntry1 + ScriptEntry SnowpointCityPokecenterB1F_Dummy1 ScriptEntryEnd -SnowpointCityPokecenterB1F_UnusedEntry1: +SnowpointCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_solaceon_town.s b/res/field/scripts/scripts_solaceon_town.s index 3c464c4140..36b3c0b656 100644 --- a/res/field/scripts/scripts_solaceon_town.s +++ b/res/field/scripts/scripts_solaceon_town.s @@ -9,12 +9,12 @@ ScriptEntry SolaceonTown_Cowgirl2 ScriptEntry SolaceonTown_Rancher2 ScriptEntry SolaceonTown_RuinManiac - ScriptEntry SolaceonTown_MapSign - ScriptEntry SolaceonTown_SignPokemonDayCare - ScriptEntry SolaceonTown_SignPokemonNewsPress + ScriptEntry SolaceonTown_MapSignpost + ScriptEntry SolaceonTown_SignboardPokemonDayCare + ScriptEntry SolaceonTown_SignboardPokemonNewsPress ScriptEntry SolaceonTown_OnTransition ScriptEntry SolaceonTown_OnResume - ScriptEntry SolaceonTown_TriggerRival + ScriptEntry SolaceonTown_CoordEvent_Rival ScriptEntryEnd SolaceonTown_OnResume: @@ -93,19 +93,19 @@ SolaceonTown_EachPokemonHasItsOwnHistory: ReleaseAll End -SolaceonTown_MapSign: +SolaceonTown_MapSignpost: ShowMapSign SolaceonTown_Text_MapSign End -SolaceonTown_SignPokemonDayCare: +SolaceonTown_SignboardPokemonDayCare: ShowLandmarkSign SolaceonTown_Text_SignPokemonDayCare End -SolaceonTown_SignPokemonNewsPress: +SolaceonTown_SignboardPokemonNewsPress: ShowLandmarkSign SolaceonTown_Text_SignPokemonNewsPress End -SolaceonTown_TriggerRival: +SolaceonTown_CoordEvent_Rival: LockAll ApplyMovement LOCALID_PLAYER, SolaceonTown_Movement_PlayerNoticeRival WaitMovement diff --git a/res/field/scripts/scripts_solaceon_town_pokecenter_2f.s b/res/field/scripts/scripts_solaceon_town_pokecenter_2f.s index 41bcff2a27..247cc71f00 100644 --- a/res/field/scripts/scripts_solaceon_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_solaceon_town_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SolaceonTownPokecenter2F_UnusedEntry1 + ScriptEntry SolaceonTownPokecenter2F_Dummy1 ScriptEntryEnd -SolaceonTownPokecenter2F_UnusedEntry1: +SolaceonTownPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_solaceon_town_pokecenter_b1f.s b/res/field/scripts/scripts_solaceon_town_pokecenter_b1f.s index bcc0eb80ea..518ca2b2dd 100644 --- a/res/field/scripts/scripts_solaceon_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_solaceon_town_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SolaceonTownPokecenterB1F_UnusedEntry1 + ScriptEntry SolaceonTownPokecenterB1F_Dummy1 ScriptEntryEnd -SolaceonTownPokecenterB1F_UnusedEntry1: +SolaceonTownPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_spear_pillar.s b/res/field/scripts/scripts_spear_pillar.s index ed6105291f..8761010761 100644 --- a/res/field/scripts/scripts_spear_pillar.s +++ b/res/field/scripts/scripts_spear_pillar.s @@ -7,9 +7,9 @@ ScriptEntry SpearPillar_OnTransition ScriptEntry SpearPillar_OnLoad - ScriptEntry SpearPillar_TriggerGrunts + ScriptEntry SpearPillar_CoordEvent_Grunts ScriptEntry SpearPillar_Cyrus - ScriptEntry SpearPillar_TriggerMarsJupiter + ScriptEntry SpearPillar_CoordEvent_MarsJupiter ScriptEntry SpearPillar_Grunts ScriptEntry SpearPillar_Jupiter ScriptEntry SpearPillar_Mars @@ -78,7 +78,7 @@ SpearPillar_Unused: SpearPillar_Unused2: Return -SpearPillar_TriggerGrunts: +SpearPillar_CoordEvent_Grunts: LockAll ApplyMovement LOCALID_GRUNT_F, SpearPillar_Movement_GruntFWalkOnSpotEast ApplyMovement LOCALID_GRUNT_M, SpearPillar_Movement_GruntMWalkOnSpotWest @@ -159,7 +159,7 @@ SpearPillar_Mars: NPCMessage SpearPillar_Text_SurprisedYouMadeIt End -SpearPillar_TriggerMarsJupiter: +SpearPillar_CoordEvent_MarsJupiter: LockAll Call SpearPillar_MarsJupiterWalkToPlayer Message SpearPillar_Text_GoThroughMeFirst @@ -326,20 +326,20 @@ SpearPillar_PlayerRivalFaceEachOtherX32: Return SpearPillar_Unused3: - ApplyMovement LOCALID_JUPITER, SpearPillar_UnusedMovement - ApplyMovement LOCALID_MARS, SpearPillar_UnusedMovement2 + ApplyMovement LOCALID_JUPITER, SpearPillar_Movement_Unused + ApplyMovement LOCALID_MARS, SpearPillar_Movement_Unused2 WaitMovement Return .balign 4, 0 -SpearPillar_UnusedMovement: +SpearPillar_Movement_Unused: FaceEast LockDir WalkSlowWest UnlockDir EndMovement -SpearPillar_UnusedMovement2: +SpearPillar_Movement_Unused2: FaceWest LockDir WalkSlowEast diff --git a/res/field/scripts/scripts_spear_pillar_distorted.s b/res/field/scripts/scripts_spear_pillar_distorted.s index ddb22a6fae..bdf53d172c 100644 --- a/res/field/scripts/scripts_spear_pillar_distorted.s +++ b/res/field/scripts/scripts_spear_pillar_distorted.s @@ -3,7 +3,7 @@ #include "res/field/events/events_spear_pillar_distorted.h" - ScriptEntry SpearPillarDistorted_OnFrameAfterWarp + ScriptEntry SpearPillarDistorted_OnFrame_AfterWarp ScriptEntry SpearPillarDistorted_Cynthia ScriptEntry SpearPillarDistorted_Jupiter ScriptEntry SpearPillarDistorted_Mars @@ -13,7 +13,7 @@ ScriptEntry SpearPillarDistorted_RiftPalkia ScriptEntryEnd -SpearPillarDistorted_OnFrameAfterWarp: +SpearPillarDistorted_OnFrame_AfterWarp: LockAll ClearFlag FLAG_HIDE_SPEAR_PILLAR_DISTORTED_MESPRIT AddObject LOCALID_MESPRIT diff --git a/res/field/scripts/scripts_stark_mountain_outside.s b/res/field/scripts/scripts_stark_mountain_outside.s index 01152da7f5..b64b1da7c4 100644 --- a/res/field/scripts/scripts_stark_mountain_outside.s +++ b/res/field/scripts/scripts_stark_mountain_outside.s @@ -4,20 +4,20 @@ ScriptEntry StarkMountainOutside_OnTransition - ScriptEntry StarkMountainOutside_SignStarkMountain - ScriptEntry StarkMountainOutside_TriggerGrunts - ScriptEntry StarkMountainOutside_OnFrameLookerBuck + ScriptEntry StarkMountainOutside_SignboardStarkMountain + ScriptEntry StarkMountainOutside_CoordEvent_Grunts + ScriptEntry StarkMountainOutside_OnFrame_LookerBuck ScriptEntryEnd StarkMountainOutside_OnTransition: SetFlag FLAG_FIRST_ARRIVAL_STARK_MOUNTAIN_EXTERIOR End -StarkMountainOutside_SignStarkMountain: +StarkMountainOutside_SignboardStarkMountain: ShowLandmarkSign StarkMountainOutside_Text_SignStarkMountain End -StarkMountainOutside_TriggerGrunts: +StarkMountainOutside_CoordEvent_Grunts: LockAll ApplyMovement LOCALID_GRUNT_M_1, StarkMountainOutside_Movement_GruntM1Enter ApplyMovement LOCALID_GRUNT_M_2, StarkMountainOutside_Movement_GruntM2Enter @@ -58,7 +58,7 @@ StarkMountainOutside_Movement_GruntM1WalkToEntrance: WalkNormalNorth EndMovement -StarkMountainOutside_UnusedMovement: +StarkMountainOutside_Movement_Unused: WalkOnSpotNormalWest EndMovement @@ -101,7 +101,7 @@ StarkMountainOutside_Movement_GruntM2EnterStarkMountain: SetInvisible EndMovement -StarkMountainOutside_OnFrameLookerBuck: +StarkMountainOutside_OnFrame_LookerBuck: LockAll Message StarkMountainOutside_Text_InhaledVolcanicAsh CloseMessage diff --git a/res/field/scripts/scripts_stark_mountain_room_1.s b/res/field/scripts/scripts_stark_mountain_room_1.s index e14932c356..9fb66a579d 100644 --- a/res/field/scripts/scripts_stark_mountain_room_1.s +++ b/res/field/scripts/scripts_stark_mountain_room_1.s @@ -4,7 +4,7 @@ ScriptEntry StarkMountainOutside_OnTransition - ScriptEntry StarkMountainOutside_OnFrameTeamGalactic + ScriptEntry StarkMountainOutside_OnFrame_TeamGalactic ScriptEntryEnd StarkMountainOutside_OnTransition: @@ -12,7 +12,7 @@ StarkMountainOutside_OnTransition: SetFlag FLAG_HIDE_ROUTE_227_BUCK End -StarkMountainOutside_OnFrameTeamGalactic: +StarkMountainOutside_OnFrame_TeamGalactic: LockAll ApplyMovement LOCALID_MARS, StarkMountainRoom1_Movement_MarsWalkOnSpotSouth WaitMovement diff --git a/res/field/scripts/scripts_stark_mountain_room_2.s b/res/field/scripts/scripts_stark_mountain_room_2.s index 7fce59a387..a6ae4aa3ef 100644 --- a/res/field/scripts/scripts_stark_mountain_room_2.s +++ b/res/field/scripts/scripts_stark_mountain_room_2.s @@ -3,11 +3,11 @@ #include "res/field/events/events_stark_mountain_room_2.h" - ScriptEntry StarkMountainRoom2_TriggerBuckStartFollowing - ScriptEntry StarkMountainRoom2_TriggerPlayerLeaveBuck - ScriptEntry StarkMountainRoom2_TriggerBuckLeavePlayer - ScriptEntry StarkMountainRoom2_Unused4 - ScriptEntry StarkMountainRoom2_Unused5 + ScriptEntry StarkMountainRoom2_CoordEvent_BuckStartFollowing + ScriptEntry StarkMountainRoom2_CoordEvent_PlayerLeaveBuck + ScriptEntry StarkMountainRoom2_CoordEvent_BuckLeavePlayer + ScriptEntry StarkMountainRoom2_Dummy4 + ScriptEntry StarkMountainRoom2_Dummy5 ScriptEntry StarkMountainRoom2_OnTransition ScriptEntryEnd @@ -19,7 +19,7 @@ StarkMountainRoom2_ResetFollowerBuckState: SetVar VAR_STARK_MOUNTAIN_ROOM_2_FOLLOWER_BUCK_STATE, 0 End -StarkMountainRoom2_TriggerBuckStartFollowing: +StarkMountainRoom2_CoordEvent_BuckStartFollowing: LockAll SetPlayerBike FALSE CallIfUnset FLAG_TALKED_TO_STARK_MOUNTAIN_ROOM_2_BUCK, StarkMountainRoom2_BuckEnterStartFollowing @@ -71,7 +71,7 @@ StarkMountainRoom2_Movement_BuckEnter: WalkNormalNorth 8 EndMovement -StarkMountainRoom2_UnusedMovement: +StarkMountainRoom2_Movement_Unused: WalkNormalNorth EndMovement @@ -80,11 +80,11 @@ StarkMountainRoom2_Movement_PlayerWalkOnSpotSouth: WalkOnSpotNormalSouth EndMovement -StarkMountainRoom2_UnusedMovement2: +StarkMountainRoom2_Movement_Unused2: WalkNormalNorth EndMovement -StarkMountainRoom2_TriggerPlayerLeaveBuck: +StarkMountainRoom2_CoordEvent_PlayerLeaveBuck: LockAll ApplyMovement LOCALID_BUCK, StarkMountainRoom2_Movement_BuckWalkOnSpotSouth2 ApplyMovement LOCALID_PLAYER, StarkMountainRoom2_Movement_PlayerWalkOnSpotNorth @@ -119,7 +119,7 @@ StarkMountainRoom2_Movement_BuckWalkOnSpotSouth2: WalkOnSpotNormalSouth EndMovement -StarkMountainRoom2_TriggerBuckLeavePlayer: +StarkMountainRoom2_CoordEvent_BuckLeavePlayer: LockAll ClearHasPartner SetMovementType LOCALID_BUCK, MOVEMENT_TYPE_LOOK_SOUTH @@ -187,11 +187,11 @@ StarkMountainRoom2_Movement_BuckEnterRoom3: WalkNormalNorth EndMovement -StarkMountainRoom2_Unused4: +StarkMountainRoom2_Dummy4: NPCMessage StarkMountainRoom2_Text_Dummy6 End -StarkMountainRoom2_Unused5: +StarkMountainRoom2_Dummy5: NPCMessage StarkMountainRoom2_Text_Dummy7 End diff --git a/res/field/scripts/scripts_stark_mountain_room_3.s b/res/field/scripts/scripts_stark_mountain_room_3.s index 9f753316ce..7ed20a007c 100644 --- a/res/field/scripts/scripts_stark_mountain_room_3.s +++ b/res/field/scripts/scripts_stark_mountain_room_3.s @@ -5,9 +5,9 @@ ScriptEntry StarkMountainRoom3_OnTransition ScriptEntry StarkMountainRoom3_OnLoad - ScriptEntry StarkMountainRoom3_Unused + ScriptEntry StarkMountainRoom3_Buck_Unused ScriptEntry StarkMountainRoom3_Heatran - ScriptEntry StarkMountainRoom3_OnFrameCharon + ScriptEntry StarkMountainRoom3_OnFrame_Charon ScriptEntryEnd StarkMountainRoom3_OnTransition: @@ -45,7 +45,7 @@ StarkMountainRoom3_RemoveHeatran: ClearFlag FLAG_MAP_LOCAL End -StarkMountainRoom3_UnusedMovement: +StarkMountainRoom3_Movement_Unused: WalkNormalWest WalkOnSpotNormalEast WalkOnSpotNormalSouth @@ -56,16 +56,16 @@ StarkMountainRoom3_Movement_BuckWalkOnSpotNorth: WalkOnSpotNormalNorth EndMovement -StarkMountainRoom3_UnusedMovement2: +StarkMountainRoom3_Movement_Unused2: WalkOnSpotNormalNorth EndMovement -StarkMountainRoom3_UnusedMovement3: +StarkMountainRoom3_Movement_Unused3: Delay8 WalkNormalSouth 9 EndMovement -StarkMountainRoom3_Unused: +StarkMountainRoom3_Buck_Unused: BufferPlayerName 1 NPCMessage StarkMountainRoom3_Text_ThatWasWicked End @@ -117,20 +117,20 @@ StarkMountainRoom3_UnlockVSSeekerLvl5: SetFlag FLAG_UNLOCKED_VS_SEEKER_LVL_5 Return -StarkMountainRoom3_UnusedMovement4: +StarkMountainRoom3_Movement_Unused4: WalkNormalNorth 6 EndMovement -StarkMountainRoom3_UnusedMovement5: +StarkMountainRoom3_Movement_Unused5: WalkNormalSouth 6 EndMovement -StarkMountainRoom3_UnusedMovement6: +StarkMountainRoom3_Movement_Unused6: Delay8 4 WalkOnSpotNormalSouth EndMovement -StarkMountainRoom3_OnFrameCharon: +StarkMountainRoom3_OnFrame_Charon: LockAll Message StarkMountainRoom3_Text_MagmaStoneWillBeMine CloseMessage diff --git a/res/field/scripts/scripts_sunyshore_city.s b/res/field/scripts/scripts_sunyshore_city.s index 7ae69b9b89..1b710298f2 100644 --- a/res/field/scripts/scripts_sunyshore_city.s +++ b/res/field/scripts/scripts_sunyshore_city.s @@ -3,23 +3,23 @@ #include "res/field/events/events_sunyshore_city.h" - ScriptEntry SunyshoreCity_OnFrameFlint - ScriptEntry SunyshoreCity_Unused2 + ScriptEntry SunyshoreCity_OnFrame_Flint + ScriptEntry SunyshoreCity_Dummy2 ScriptEntry SunyshoreCity_Sailor2 ScriptEntry SunyshoreCity_Sailor1 ScriptEntry SunyshoreCity_Worker ScriptEntry SunyshoreCity_PokefanF ScriptEntry SunyshoreCity_PokemonBreederF - ScriptEntry SunyshoreCity_TriggerRivalAndJasmine + ScriptEntry SunyshoreCity_CoordEvent_RivalAndJasmine ScriptEntry SunyshoreCity_Jasmine - ScriptEntry SunyshoreCity_MapSign - ScriptEntry SunyshoreCity_GymSign - ScriptEntry SunyshoreCity_SignVistaLighthouse - ScriptEntry SunyshoreCity_SignSunyshoreMarket - ScriptEntry SunyshoreCity_SignJuliasHouse - ScriptEntry SunyshoreCity_SignBlank - ScriptEntry SunyshoreCity_SignPokemonRock - ScriptEntry SunyshoreCity_UnusedSealMerchant + ScriptEntry SunyshoreCity_MapSignpost + ScriptEntry SunyshoreCity_GymSignpost + ScriptEntry SunyshoreCity_SignboardVistaLighthouse + ScriptEntry SunyshoreCity_SignboardSunyshoreMarket + ScriptEntry SunyshoreCity_SignboardJuliasHouse + ScriptEntry SunyshoreCity_SignboardBlank + ScriptEntry SunyshoreCity_SignboardPokemonRock + ScriptEntry SunyshoreCity_SealMerchant_Unused ScriptEntry SunyshoreCity_Flint ScriptEntry SunyshoreCity_OnTransition ScriptEntryEnd @@ -41,7 +41,7 @@ SunyshoreCity_SetFlintPositionAtGate: SetObjectEventDir LOCALID_FLINT, DIR_WEST End -SunyshoreCity_TriggerRivalAndJasmine: +SunyshoreCity_CoordEvent_RivalAndJasmine: LockAll ApplyMovement LOCALID_JASMINE, SunyshoreCity_Movement_JasmineNoticePlayer WaitMovement @@ -446,7 +446,7 @@ SunyshoreCity_GiveWaterfall: Message SunyshoreCity_Text_ThatHMContainsWaterfall Return -SunyshoreCity_OnFrameFlint: +SunyshoreCity_OnFrame_Flint: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 790, SunyshoreCity_FlintWalkToPlayerZ790 @@ -519,7 +519,7 @@ SunyshoreCity_Movement_FlintLeave: WalkNormalEast 9 EndMovement -SunyshoreCity_Unused2: +SunyshoreCity_Dummy2: NPCMessage SunyshoreCity_Text_Dummy14 End @@ -543,35 +543,35 @@ SunyshoreCity_PokemonBreederF: NPCMessage SunyshoreCity_Text_MajorPortTown End -SunyshoreCity_MapSign: +SunyshoreCity_MapSignpost: ShowMapSign SunyshoreCity_Text_MapSign End -SunyshoreCity_GymSign: +SunyshoreCity_GymSignpost: ShowScrollingSign SunyshoreCity_Text_SignPokemonGym End -SunyshoreCity_SignVistaLighthouse: +SunyshoreCity_SignboardVistaLighthouse: ShowLandmarkSign SunyshoreCity_Text_SignVistaLighthouse End -SunyshoreCity_SignSunyshoreMarket: +SunyshoreCity_SignboardSunyshoreMarket: ShowLandmarkSign SunyshoreCity_Text_SignSunyshoreMarket End -SunyshoreCity_SignJuliasHouse: +SunyshoreCity_SignboardJuliasHouse: ShowLandmarkSign SunyshoreCity_Text_SignJuliasHouse End -SunyshoreCity_SignBlank: +SunyshoreCity_SignboardBlank: ShowLandmarkSign SunyshoreCity_Text_SignBlank End -SunyshoreCity_SignPokemonRock: +SunyshoreCity_SignboardPokemonRock: ShowLandmarkSign SunyshoreCity_Text_SignPokemonRock End -SunyshoreCity_UnusedSealMerchant: +SunyshoreCity_SealMerchant_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer @@ -579,44 +579,44 @@ SunyshoreCity_UnusedSealMerchant: CloseMessageWithoutErasing GetDayOfWeek VAR_RESULT SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, DAY_OF_WEEK_SUNDAY, SunyshoreCity_UnusedSealMerchantSunday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_MONDAY, SunyshoreCity_UnusedSealMerchantMonday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_TUESDAY, SunyshoreCity_UnusedSealMerchantTuesday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_WEDNESDAY, SunyshoreCity_UnusedSealMerchantWednesday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_THURSDAY, SunyshoreCity_UnusedSealMerchantThursday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_FRIDAY, SunyshoreCity_UnusedSealMerchantFriday - GoToIfEq VAR_0x8008, DAY_OF_WEEK_SATURDAY, SunyshoreCity_UnusedSealMerchantSaturday + GoToIfEq VAR_0x8008, DAY_OF_WEEK_SUNDAY, SunyshoreCity_SealMerchantSunday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_MONDAY, SunyshoreCity_SealMerchantMonday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_TUESDAY, SunyshoreCity_SealMerchantTuesday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_WEDNESDAY, SunyshoreCity_SealMerchantWednesday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_THURSDAY, SunyshoreCity_SealMerchantThursday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_FRIDAY, SunyshoreCity_SealMerchantFriday_Unused + GoToIfEq VAR_0x8008, DAY_OF_WEEK_SATURDAY, SunyshoreCity_SealMerchantSaturday_Unused End -SunyshoreCity_UnusedSealMerchantSunday: +SunyshoreCity_SealMerchantSunday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_MONDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantMonday: +SunyshoreCity_SealMerchantMonday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_TUESDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantTuesday: +SunyshoreCity_SealMerchantTuesday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_WEDNESDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantWednesday: +SunyshoreCity_SealMerchantWednesday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_THURSDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantThursday: +SunyshoreCity_SealMerchantThursday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_FRIDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantFriday: +SunyshoreCity_SealMerchantFriday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_SATURDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantSaturday: +SunyshoreCity_SealMerchantSaturday_Unused: PokeMartSeal MART_SEAL_ID_SUNYSHORE_SUNDAY - GoTo SunyshoreCity_UnusedSealMerchantEnd + GoTo SunyshoreCity_SealMerchantEnd_Unused -SunyshoreCity_UnusedSealMerchantEnd: +SunyshoreCity_SealMerchantEnd_Unused: ReleaseAll End diff --git a/res/field/scripts/scripts_sunyshore_city_gym_room_2.s b/res/field/scripts/scripts_sunyshore_city_gym_room_2.s index d1a10ab55b..89b292a894 100644 --- a/res/field/scripts/scripts_sunyshore_city_gym_room_2.s +++ b/res/field/scripts/scripts_sunyshore_city_gym_room_2.s @@ -5,7 +5,7 @@ ScriptEntry SunyshoreGymRoom2_Init ScriptEntry SunyshoreGymRoom2_BottomButton ScriptEntry SunyshoreGymRoom2_TopButtons - ScriptEntry SunyshoreGymRoom2_Empty + ScriptEntry SunyshoreGymRoom2_Dummy4 ScriptEntryEnd SunyshoreGymRoom2_Init: @@ -21,7 +21,7 @@ SunyshoreGymRoom2_TopButtons: PressSunyshoreGymButton SUNYSHORE_GYM_BUTTON_REVERSE End -SunyshoreGymRoom2_Empty: +SunyshoreGymRoom2_Dummy4: End .balign 4, 0 diff --git a/res/field/scripts/scripts_sunyshore_city_gym_room_3.s b/res/field/scripts/scripts_sunyshore_city_gym_room_3.s index 7a5ca421fe..40de00b0f3 100644 --- a/res/field/scripts/scripts_sunyshore_city_gym_room_3.s +++ b/res/field/scripts/scripts_sunyshore_city_gym_room_3.s @@ -27,7 +27,7 @@ SunyshoreGymRoom3_Volkner: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_BEACON, SunyshoreGymRoom3_VolknerAlreadyHaveBeaconBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 156, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_SUNYSHORE_CITY_GYM_ROOM_3, 0, 0, 0 Message SunyshoreGymRoom3_Text_VolknerIntro CloseMessage StartTrainerBattle TRAINER_LEADER_VOLKNER @@ -50,7 +50,7 @@ SunyshoreGymRoom3_Volkner: SetTrainerFlag TRAINER_SCHOOL_KID_TIERA SetVar VAR_SUNYSHORE_STATE, 2 // BUG: TRAINER_LEADER_ROARK should be TRAINER_LEADER_VOLKNER - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 156, TRAINER_LEADER_ROARK, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_SUNYSHORE_CITY_GYM_ROOM_3, TRAINER_LEADER_ROARK, 0, 0 Message SunyshoreGymRoom3_Text_VolknerExplainBeaconBadge GoTo SunyshoreGymRoom3_VolknerTryGiveTM57 diff --git a/res/field/scripts/scripts_sunyshore_city_pokecenter_2f.s b/res/field/scripts/scripts_sunyshore_city_pokecenter_2f.s index f9e422a945..ea360a5b8b 100644 --- a/res/field/scripts/scripts_sunyshore_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_sunyshore_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SunyshoreCityPokecenter2F_UnusedEntry1 + ScriptEntry SunyshoreCityPokecenter2F_Dummy1 ScriptEntryEnd -SunyshoreCityPokecenter2F_UnusedEntry1: +SunyshoreCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_sunyshore_city_pokecenter_b1f.s b/res/field/scripts/scripts_sunyshore_city_pokecenter_b1f.s index 35bedd618e..06050ee61a 100644 --- a/res/field/scripts/scripts_sunyshore_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_sunyshore_city_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SunyshoreCityPokecenterB1F_UnusedEntry1 + ScriptEntry SunyshoreCityPokecenterB1F_Dummy1 ScriptEntryEnd -SunyshoreCityPokecenterB1F_UnusedEntry1: +SunyshoreCityPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_sunyshore_city_unknown_house_1.s b/res/field/scripts/scripts_sunyshore_city_unknown_house_1.s deleted file mode 100644 index 78c4327c84..0000000000 --- a/res/field/scripts/scripts_sunyshore_city_unknown_house_1.s +++ /dev/null @@ -1,8 +0,0 @@ -#include "macros/scrcmd.inc" - - - ScriptEntry SunyshoreCityUnknownHouse1_Unused - ScriptEntryEnd - -SunyshoreCityUnknownHouse1_Unused: - End diff --git a/res/field/scripts/scripts_sunyshore_city_unknown_house_2.s b/res/field/scripts/scripts_sunyshore_city_unknown_house_2.s deleted file mode 100644 index 4b7b08bac8..0000000000 --- a/res/field/scripts/scripts_sunyshore_city_unknown_house_2.s +++ /dev/null @@ -1,8 +0,0 @@ -#include "macros/scrcmd.inc" - - - ScriptEntry SunyshoreCityUnknownHouse2_Unused - ScriptEntryEnd - -SunyshoreCityUnknownHouse2_Unused: - End diff --git a/res/field/scripts/scripts_sunyshore_market.s b/res/field/scripts/scripts_sunyshore_market.s index 25536be8a1..7d13add26c 100644 --- a/res/field/scripts/scripts_sunyshore_market.s +++ b/res/field/scripts/scripts_sunyshore_market.s @@ -8,10 +8,10 @@ ScriptEntry SunyshoreMarket_Sailor ScriptEntry SunyshoreMarket_SealShop ScriptEntry SunyshoreMarket_PokefanM - ScriptEntry SunyshoreMarket_Dummy + ScriptEntry SunyshoreMarket_Dummy5 ScriptEntry SunyshoreMarket_BattleGirl -SunyshoreMarket_Dummy: +SunyshoreMarket_Dummy5: End SunyshoreMarket_EffortRibbonWoman: diff --git a/res/field/scripts/scripts_survival_area.s b/res/field/scripts/scripts_survival_area.s index 52e8fb64d7..ef0c5c5376 100644 --- a/res/field/scripts/scripts_survival_area.s +++ b/res/field/scripts/scripts_survival_area.s @@ -7,7 +7,7 @@ ScriptEntry SurvivalArea_BattleGirl ScriptEntry SurvivalArea_RuinManiac ScriptEntry SurvivalArea_Cameraman - ScriptEntry SurvivalArea_MapSign + ScriptEntry SurvivalArea_MapSignpost ScriptEntry SurvivalArea_Buck ScriptEntry SurvivalArea_Door ScriptEntry SurvivalArea_OnTransition @@ -62,7 +62,7 @@ SurvivalArea_AllSetToProduce: ReleaseAll End -SurvivalArea_MapSign: +SurvivalArea_MapSignpost: ShowMapSign SurvivalArea_Text_MapSign End diff --git a/res/field/scripts/scripts_survival_area_mart.s b/res/field/scripts/scripts_survival_area_mart.s index 63fff86577..b8301cf9bf 100644 --- a/res/field/scripts/scripts_survival_area_mart.s +++ b/res/field/scripts/scripts_survival_area_mart.s @@ -3,7 +3,7 @@ ScriptEntry SurvivalAreaMart_CommonVendor - ScriptEntry SurvivalAreaMart_Unused + ScriptEntry SurvivalAreaMart_Dummy2 ScriptEntry SurvivalAreaMart_Hiker ScriptEntry SurvivalAreaMart_AceTrainerF ScriptEntryEnd @@ -12,7 +12,7 @@ SurvivalAreaMart_CommonVendor: PokeMartCommonWithGreeting End -SurvivalAreaMart_Unused: +SurvivalAreaMart_Dummy2: End SurvivalAreaMart_Hiker: diff --git a/res/field/scripts/scripts_survival_area_pokecenter_2f.s b/res/field/scripts/scripts_survival_area_pokecenter_2f.s index cf425a75b7..b7fb69c37d 100644 --- a/res/field/scripts/scripts_survival_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_survival_area_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SurvivalAreaPokecenter2F_UnusedEntry1 + ScriptEntry SurvivalAreaPokecenter2F_Dummy1 ScriptEntryEnd -SurvivalAreaPokecenter2F_UnusedEntry1: +SurvivalAreaPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_survival_area_pokecenter_b1f.s b/res/field/scripts/scripts_survival_area_pokecenter_b1f.s index 74a06acf73..dace9f3f5d 100644 --- a/res/field/scripts/scripts_survival_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_survival_area_pokecenter_b1f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry SurvivalAreaPokecenterB1F_UnusedEntry1 + ScriptEntry SurvivalAreaPokecenterB1F_Dummy1 ScriptEntryEnd -SurvivalAreaPokecenterB1F_UnusedEntry1: +SurvivalAreaPokecenterB1F_Dummy1: End diff --git a/res/field/scripts/scripts_team_galactic_eterna_building_1f.s b/res/field/scripts/scripts_team_galactic_eterna_building_1f.s index c814506990..e5df032842 100644 --- a/res/field/scripts/scripts_team_galactic_eterna_building_1f.s +++ b/res/field/scripts/scripts_team_galactic_eterna_building_1f.s @@ -6,9 +6,9 @@ ScriptEntry TeamGalacticEternaBuilding1F_GruntM1 ScriptEntry TeamGalacticEternaBuilding1F_GruntM2 - ScriptEntry TeamGalacticEternaBuilding1F_Sign + ScriptEntry TeamGalacticEternaBuilding1F_BgSign ScriptEntry TeamGalacticEternaBuilding1F_Looker - ScriptEntry TeamGalacticEternaBuilding1F_OnFrameLooker + ScriptEntry TeamGalacticEternaBuilding1F_OnFrame_Looker ScriptEntry TeamGalacticEternaBuilding1F_WallBlockingRotomsRoom ScriptEntry TeamGalacticEternaBuilding1F_OnTransition ScriptEntryEnd @@ -24,7 +24,7 @@ TeamGalacticEternaBuilding1F_GruntM2: NPCMessage TeamGalacticEternaBuilding1F_Text_AsAGroupTeamGalacticHasItsSightsSetOnTheStarsNotOnThisWorld End -TeamGalacticEternaBuilding1F_Sign: +TeamGalacticEternaBuilding1F_BgSign: EventMessage TeamGalacticEternaBuilding1F_Text_ThePathYouChoseLeadsToGlory End @@ -32,7 +32,7 @@ TeamGalacticEternaBuilding1F_Looker: NPCMessage TeamGalacticEternaBuilding1F_Text_NowIHaveBeenConductingMyInvestigationIntoTeamGalactic End -TeamGalacticEternaBuilding1F_OnFrameLooker: +TeamGalacticEternaBuilding1F_OnFrame_Looker: LockAll ApplyMovement LOCALID_GRUNT_M_LOOKER, TeamGalacticEternaBuilding1F_Movement_LookerNoticeAndWalkToPlayer ApplyMovement LOCALID_PLAYER, TeamGalacticEternaBuilding1F_Movement_PlayerFaceLooker diff --git a/res/field/scripts/scripts_team_galactic_eterna_building_2f.s b/res/field/scripts/scripts_team_galactic_eterna_building_2f.s index 4c94a3483b..dd235b71ef 100644 --- a/res/field/scripts/scripts_team_galactic_eterna_building_2f.s +++ b/res/field/scripts/scripts_team_galactic_eterna_building_2f.s @@ -4,7 +4,7 @@ ScriptEntry TeamGalacticEternaBuilding2F_GruntM ScriptEntry TeamGalacticEternaBuilding2F_GruntF - ScriptEntry TeamGalacticEternaBuilding2F_Sign + ScriptEntry TeamGalacticEternaBuilding2F_BgSign ScriptEntryEnd TeamGalacticEternaBuilding2F_GruntM: @@ -15,7 +15,7 @@ TeamGalacticEternaBuilding2F_GruntF: NPCMessage TeamGalacticEternaBuilding2F_Text_WeAreConductingResearchOnNewFormsOfEnergy End -TeamGalacticEternaBuilding2F_Sign: +TeamGalacticEternaBuilding2F_BgSign: EventMessage TeamGalacticEternaBuilding2F_Text_LetUsMakeProgressTogether End diff --git a/res/field/scripts/scripts_team_galactic_eterna_building_3f.s b/res/field/scripts/scripts_team_galactic_eterna_building_3f.s index 7fe1fdee61..4bdbf131ef 100644 --- a/res/field/scripts/scripts_team_galactic_eterna_building_3f.s +++ b/res/field/scripts/scripts_team_galactic_eterna_building_3f.s @@ -3,14 +3,14 @@ ScriptEntry TeamGalacticEternaBuilding3F_GruntM - ScriptEntry TeamGalacticEternaBuilding3F_Sign + ScriptEntry TeamGalacticEternaBuilding3F_BgSign ScriptEntryEnd TeamGalacticEternaBuilding3F_GruntM: NPCMessage TeamGalacticEternaBuilding3F_Text_OrdinaryPeopleLikeYouCantUnderstandTeamGalacticGrandDesigns End -TeamGalacticEternaBuilding3F_Sign: +TeamGalacticEternaBuilding3F_BgSign: EventMessage TeamGalacticEternaBuilding3F_Text_QuestionNotAndFollowThisPathTheRoadToSuccess End diff --git a/res/field/scripts/scripts_team_galactic_eterna_building_4f.s b/res/field/scripts/scripts_team_galactic_eterna_building_4f.s index 042fa5d4f6..6a7a963b68 100644 --- a/res/field/scripts/scripts_team_galactic_eterna_building_4f.s +++ b/res/field/scripts/scripts_team_galactic_eterna_building_4f.s @@ -8,7 +8,7 @@ ScriptEntry TeamGalacticEternaBuilding4F_Clefairy ScriptEntry TeamGalacticEternaBuilding4F_Buneary ScriptEntry TeamGalacticEternaBuilding4F_PokefanM - ScriptEntry TeamGalacticEternaBuilding4F_Sign + ScriptEntry TeamGalacticEternaBuilding4F_BgSign ScriptEntryEnd TeamGalacticEternaBuilding4F_OnLoad: @@ -100,7 +100,7 @@ TeamGalacticEternaBuilding4F_Movement_PokefanMWalkToPlayerNorth: WalkNormalNorth EndMovement -TeamGalacticEternaBuilding4F_UnusedMovement: +TeamGalacticEternaBuilding4F_Movement_Unused: Delay8 WalkNormalEast 2 WalkOnSpotNormalNorth @@ -124,13 +124,13 @@ TeamGalacticEternaBuilding4F_Movement_PlayerFacePokefanM: WalkOnSpotNormalSouth EndMovement -TeamGalacticEternaBuilding4F_UnusedMovement2: +TeamGalacticEternaBuilding4F_Movement_Unused2: WalkOnSpotNormalWest Delay4 WalkOnSpotNormalSouth EndMovement -TeamGalacticEternaBuilding4F_UnusedMovement3: +TeamGalacticEternaBuilding4F_Movement_Unused3: WalkOnSpotNormalWest EndMovement @@ -160,6 +160,6 @@ TeamGalacticEternaBuilding4F_ICantThankYouEnoughRightNowButCruiseByMyCycleShopOK ReleaseAll End -TeamGalacticEternaBuilding4F_Sign: +TeamGalacticEternaBuilding4F_BgSign: EventMessage TeamGalacticEternaBuilding4F_Text_WorkingForWorldPeace End diff --git a/res/field/scripts/scripts_trainers_school.s b/res/field/scripts/scripts_trainers_school.s index 5e03e560c5..4b3d48b459 100644 --- a/res/field/scripts/scripts_trainers_school.s +++ b/res/field/scripts/scripts_trainers_school.s @@ -6,12 +6,12 @@ ScriptEntry TrainersSchool_Rival ScriptEntry TrainersSchool_AceTrainerF - ScriptEntry TrainersSchool_Unused3 + ScriptEntry TrainersSchool_Dummy3 ScriptEntry TrainersSchool_Youngster1 ScriptEntry TrainersSchool_Youngster2 ScriptEntry TrainersSchool_Lass - ScriptEntry TrainersSchool_Unused7 - ScriptEntry TrainersSchool_Unused8 + ScriptEntry TrainersSchool_Dummy7 + ScriptEntry TrainersSchool_Dummy8 ScriptEntry TrainersSchool_SchoolKidHarrison ScriptEntry TrainersSchool_SchoolKidChristine ScriptEntry TrainersSchool_Blackboard @@ -110,7 +110,7 @@ TrainersSchool_AceTrainerF: NPCMessage TrainersSchool_Text_DevelopAtOwnPace End -TrainersSchool_Unused3: +TrainersSchool_Dummy3: End TrainersSchool_Youngster1: @@ -125,10 +125,10 @@ TrainersSchool_Lass: NPCMessage TrainersSchool_Text_PokemonUseItems End -TrainersSchool_Unused7: +TrainersSchool_Dummy7: End -TrainersSchool_Unused8: +TrainersSchool_Dummy8: End TrainersSchool_SchoolKidHarrison: diff --git a/res/field/scripts/scripts_trophy_garden.s b/res/field/scripts/scripts_trophy_garden.s index 7453ab3747..0b4332d5c9 100644 --- a/res/field/scripts/scripts_trophy_garden.s +++ b/res/field/scripts/scripts_trophy_garden.s @@ -1,14 +1,14 @@ #include "macros/scrcmd.inc" - ScriptEntry TrophyGarden_Unused1 + ScriptEntry TrophyGarden_SetFlagFirstArrival_Unused ScriptEntryEnd -TrophyGarden_Unused1: +TrophyGarden_SetFlagFirstArrival_Unused: SetFlag FLAG_FIRST_ARRIVAL_TROPHY_GARDEN End -TrophyGarden_Unused2: +TrophyGarden_Unused: End .balign 4, 0 diff --git a/res/field/scripts/scripts_tv_reporter_interviews.s b/res/field/scripts/scripts_tv_reporter_interviews.s index 351ae690af..3e9d49c786 100644 --- a/res/field/scripts/scripts_tv_reporter_interviews.s +++ b/res/field/scripts/scripts_tv_reporter_interviews.s @@ -2,122 +2,122 @@ #include "res/text/bank/tv_reporter_interviews.h" - ScriptEntry _004E - ScriptEntry _005A - ScriptEntry _0066 - ScriptEntry _0072 - ScriptEntry _007E - ScriptEntry _008A - ScriptEntry _0096 - ScriptEntry _00A2 - ScriptEntry _00AE - ScriptEntry _00BA - ScriptEntry _00C6 - ScriptEntry _00D2 - ScriptEntry _00DE - ScriptEntry _00EA - ScriptEntry _00F6 - ScriptEntry _0129 - ScriptEntry _0135 - ScriptEntry _0141 - ScriptEntry _014D + ScriptEntry TVReporterInterviews_Interview1_Unused + ScriptEntry TVReporterInterviews_BattleTower + ScriptEntry TVReporterInterviews_Interview3_Unused + ScriptEntry TVReporterInterviews_HearthomeCityPokemonFanClub + ScriptEntry TVReporterInterviews_Interview5_Unused + ScriptEntry TVReporterInterviews_PoketchCo1F + ScriptEntry TVReporterInterviews_ContestHallLobby + ScriptEntry TVReporterInterviews_Interview8_Unused + ScriptEntry TVReporterInterviews_JubilifeTV2F + ScriptEntry TVReporterInterviews_CanalaveCityWestHouse + ScriptEntry TVReporterInterviews_PoffinHouse + ScriptEntry TVReporterInterviews_Interview12_Unused + ScriptEntry TVReporterInterviews_HearthomeCityGates + ScriptEntry TVReporterInterviews_BattleHall + ScriptEntry TVReporterInterviews_Route214GateToVeilstoneCity + ScriptEntry TVReporterInterviews_SetSegmentInYourFace2 + ScriptEntry TVReporterInterviews_SetSegmentInYourFace3 + ScriptEntry TVReporterInterviews_SetSegmentInYourFace4 + ScriptEntry TVReporterInterviews_BattleFrontier ScriptEntryEnd -_004E: - SetVar VAR_0x8000, 1 - GoTo _0159 +TVReporterInterviews_Interview1_Unused: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_01 + GoTo TVReporterInterviews_AskDoInterview -_005A: - SetVar VAR_0x8000, 2 - GoTo _0159 +TVReporterInterviews_BattleTower: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_BATTLE_TOWER_CORNER + GoTo TVReporterInterviews_AskDoInterview -_0066: - SetVar VAR_0x8000, 3 - GoTo _0159 +TVReporterInterviews_Interview3_Unused: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_03 + GoTo TVReporterInterviews_AskDoInterview -_0072: - SetVar VAR_0x8000, 4 - GoTo _0159 +TVReporterInterviews_HearthomeCityPokemonFanClub: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_YOUR_POKEMON_CORNER + GoTo TVReporterInterviews_AskDoInterview -_007E: - SetVar VAR_0x8000, 5 - GoTo _0159 +TVReporterInterviews_Interview5_Unused: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_05 + GoTo TVReporterInterviews_AskDoInterview -_008A: - SetVar VAR_0x8000, 6 - GoTo _0159 +TVReporterInterviews_PoketchCo1F: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_THE_POKETCH_WATCH + GoTo TVReporterInterviews_AskDoInterview -_0096: - SetVar VAR_0x8000, 7 - GoTo _0159 +TVReporterInterviews_ContestHallLobby: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_CONTEST_HALL + GoTo TVReporterInterviews_AskDoInterview -_00A2: - SetVar VAR_0x8000, 8 - GoTo _0159 +TVReporterInterviews_Interview8_Unused: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_08 + GoTo TVReporterInterviews_AskDoInterview -_00AE: - SetVar VAR_0x8000, 9 - GoTo _0159 +TVReporterInterviews_JubilifeTV2F: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_RIGHT_ON_PHOTO_CORNER + GoTo TVReporterInterviews_AskDoInterview -_00BA: - SetVar VAR_0x8000, 10 - GoTo _0159 +TVReporterInterviews_CanalaveCityWestHouse: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_STREET_CORNER_PERSONALITY_CHECKUP + GoTo TVReporterInterviews_AskDoInterview -_00C6: - SetVar VAR_0x8000, 11 - GoTo _0159 +TVReporterInterviews_PoffinHouse: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_THREE_CHEERS_FOR_POFFIN_CORNER + GoTo TVReporterInterviews_AskDoInterview -_00D2: - SetVar VAR_0x8000, 12 - GoTo _0159 +TVReporterInterviews_Interview12_Unused: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_12 + GoTo TVReporterInterviews_AskDoInterview -_00DE: - SetVar VAR_0x8000, 13 - GoTo _0159 +TVReporterInterviews_HearthomeCityGates: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_AMITY_SQUARE_WATCH + GoTo TVReporterInterviews_AskDoInterview -_00EA: - SetVar VAR_0x8000, 14 - GoTo _0159 +TVReporterInterviews_BattleHall: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_BATTLE_FRONTIER_FRONTLINE_NEWS_SINGLE + GoTo TVReporterInterviews_AskDoInterview -_00F6: - GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 1, _0129 - GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 2, _0135 - GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 3, _0141 - SetVar VAR_0x8000, 15 - GoTo _0159 +TVReporterInterviews_Route214GateToVeilstoneCity: + GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 1, TVReporterInterviews_SetSegmentInYourFace2 + GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 2, TVReporterInterviews_SetSegmentInYourFace3 + GoToIfEq VAR_RANDOM_INTERVIEW_QUESTION, 3, TVReporterInterviews_SetSegmentInYourFace4 + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_1 + GoTo TVReporterInterviews_AskDoInterview -_0129: - SetVar VAR_0x8000, 16 - GoTo _0159 +TVReporterInterviews_SetSegmentInYourFace2: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_2 + GoTo TVReporterInterviews_AskDoInterview -_0135: - SetVar VAR_0x8000, 17 - GoTo _0159 +TVReporterInterviews_SetSegmentInYourFace3: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_3 + GoTo TVReporterInterviews_AskDoInterview -_0141: - SetVar VAR_0x8000, 18 - GoTo _0159 +TVReporterInterviews_SetSegmentInYourFace4: + SetVar VAR_0x8000, TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_4 + GoTo TVReporterInterviews_AskDoInterview -_014D: +TVReporterInterviews_BattleFrontier: SetVar VAR_0x8000, 19 - GoTo _0159 + GoTo TVReporterInterviews_AskDoInterview -_0159: +TVReporterInterviews_AskDoInterview: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer CheckTVInterviewEligible VAR_0x8000, VAR_RESULT - GoToIfEq VAR_RESULT, 0, _02A1 - Message 0 + GoToIfEq VAR_RESULT, FALSE, TVReporterInterviews_ThanksForSharingThoughts + Message TVReporterInterviews_Text_MayIDoQuickInterview ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0190 - GoTo _02AE + GoToIfEq VAR_RESULT, MENU_YES, TVReporterInterviews_DoInterview + GoTo TVReporterInterviews_ThatsTooBad End -_0190: +TVReporterInterviews_DoInterview: LoadTVInterviewMessage VAR_0x8000, VAR_0x8004, VAR_0x8005 MessageFromBank VAR_0x8004, VAR_0x8005 - GoToIfEq VAR_0x8000, 10, _01F0 + GoToIfEq VAR_0x8000, TV_PROGRAM_SEGMENT_STREET_CORNER_PERSONALITY_CHECKUP, TVReporterInterviews_TypeMenu FadeScreenOut WaitFadeScreen CloseMessage @@ -125,49 +125,49 @@ _0190: ReturnToField FadeScreenIn WaitFadeScreen - GoToIfEq VAR_RESULT, 0, _02AE + GoToIfEq VAR_RESULT, 0, TVReporterInterviews_ThatsTooBad SaveTVInterviewResponse VAR_0x8000, VAR_0x8004 - GoTo _02A1 + GoTo TVReporterInterviews_ThanksForSharingThoughts End -_01F0: +TVReporterInterviews_TypeMenu: InitLocalTextListMenu 1, 1, 0, VAR_0x8004 - AddListMenuEntry 22, 1 - AddListMenuEntry 23, 2 - AddListMenuEntry 24, 3 - AddListMenuEntry 25, 4 - AddListMenuEntry 26, 5 - AddListMenuEntry 27, 6 - AddListMenuEntry 28, 7 - AddListMenuEntry 29, 8 - AddListMenuEntry 30, 9 - AddListMenuEntry 31, 10 - AddListMenuEntry 32, 11 - AddListMenuEntry 33, 12 - AddListMenuEntry 34, 13 - AddListMenuEntry 35, 14 - AddListMenuEntry 36, 15 - AddListMenuEntry 37, 16 - AddListMenuEntry 38, 17 + AddListMenuEntry TVReporterInterviews_Text_Normal, 1 + AddListMenuEntry TVReporterInterviews_Text_Fire, 2 + AddListMenuEntry TVReporterInterviews_Text_Water, 3 + AddListMenuEntry TVReporterInterviews_Text_Electric, 4 + AddListMenuEntry TVReporterInterviews_Text_Grass, 5 + AddListMenuEntry TVReporterInterviews_Text_Ice, 6 + AddListMenuEntry TVReporterInterviews_Text_Fighting, 7 + AddListMenuEntry TVReporterInterviews_Text_Poison, 8 + AddListMenuEntry TVReporterInterviews_Text_Ground, 9 + AddListMenuEntry TVReporterInterviews_Text_Flying, 10 + AddListMenuEntry TVReporterInterviews_Text_Psychic, 11 + AddListMenuEntry TVReporterInterviews_Text_Bug, 12 + AddListMenuEntry TVReporterInterviews_Text_Rock, 13 + AddListMenuEntry TVReporterInterviews_Text_Ghost, 14 + AddListMenuEntry TVReporterInterviews_Text_Dragon, 15 + AddListMenuEntry TVReporterInterviews_Text_Dark, 16 + AddListMenuEntry TVReporterInterviews_Text_Steel, 17 ShowListMenu - GoToIfEq VAR_0x8004, -2, _02AE + GoToIfEq VAR_0x8004, -2, TVReporterInterviews_ThatsTooBad SaveTVInterviewResponse VAR_0x8000, VAR_0x8004 - GoTo _02A1 + GoTo TVReporterInterviews_ThanksForSharingThoughts End -_02A1: - Message 2 +TVReporterInterviews_ThanksForSharingThoughts: + Message TVReporterInterviews_Text_ThanksForSharingThoughts WaitButton - GoTo _02BB + GoTo TVReporterInterviews_End End -_02AE: - Message 1 +TVReporterInterviews_ThatsTooBad: + Message TVReporterInterviews_Text_ThatsTooBad WaitButton - GoTo _02BB + GoTo TVReporterInterviews_End End -_02BB: +TVReporterInterviews_End: CloseMessage ReleaseAll End diff --git a/res/field/scripts/scripts_twinleaf_town.s b/res/field/scripts/scripts_twinleaf_town.s index 19d3478d27..a41561343c 100644 --- a/res/field/scripts/scripts_twinleaf_town.s +++ b/res/field/scripts/scripts_twinleaf_town.s @@ -4,14 +4,14 @@ ScriptEntry TwinleafTown_OnTransition - ScriptEntry TwinleafTown_RivalThudTrigger + ScriptEntry TwinleafTown_CoordEvent_RivalThud ScriptEntry TwinleafTown_Guitarist - ScriptEntry TwinleafTown_RivalWasLookingForYouTrigger + ScriptEntry TwinleafTown_CoordEvent_RivalWasLookingForYou ScriptEntry TwinleafTown_Collector ScriptEntry TwinleafTown_BreederF - ScriptEntry TwinleafTown_MapSign - ScriptEntry TwinleafTown_LandmarkSignPlayerMailbox - ScriptEntry TwinleafTown_LandmarkSignRivalMailbox + ScriptEntry TwinleafTown_MapSignpost + ScriptEntry TwinleafTown_MailboxPlayer + ScriptEntry TwinleafTown_MailboxRival ScriptEntryEnd TwinleafTown_OnTransition: @@ -71,7 +71,7 @@ TwinleafTown_RivalWentTearingOff: ReleaseAll End -TwinleafTown_RivalWasLookingForYouTrigger: +TwinleafTown_CoordEvent_RivalWasLookingForYou: LockAll ApplyMovement LOCALID_GUITARIST, TwinleafTown_Movement_GuitaristNoticePlayer WaitMovement @@ -386,7 +386,7 @@ TwinleafTown_Movement_GuitaristWalkBackX115: WalkNormalSouth 2 EndMovement -TwinleafTown_RivalThudTrigger: +TwinleafTown_CoordEvent_RivalThud: LockAll LoadDoorAnimation 3, 27, 9, 11, ANIMATION_TAG_DOOR_1 PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 @@ -498,16 +498,16 @@ TwinleafTown_PokemonYouLookGoodTogether: ReleaseAll End -TwinleafTown_MapSign: +TwinleafTown_MapSignpost: ShowMapSign TwinleafTown_Text_MapSign End -TwinleafTown_LandmarkSignPlayerMailbox: +TwinleafTown_MailboxPlayer: BufferPlayerName 0 ShowLandmarkSign TwinleafTown_Text_PlayerMailbox End -TwinleafTown_LandmarkSignRivalMailbox: +TwinleafTown_MailboxRival: BufferRivalName 0 ShowLandmarkSign TwinleafTown_Text_RivalMailbox End diff --git a/res/field/scripts/scripts_twinleaf_town_player_house_1f.s b/res/field/scripts/scripts_twinleaf_town_player_house_1f.s index d2367e8b69..b2692d679c 100644 --- a/res/field/scripts/scripts_twinleaf_town_player_house_1f.s +++ b/res/field/scripts/scripts_twinleaf_town_player_house_1f.s @@ -7,7 +7,7 @@ ScriptEntry TwinleafTownPlayerHouse1F_OnFrame_RivalAlreadyLeft ScriptEntry TwinleafTownPlayerHouse1F_OnFrame_CutsceneAfterRivalBattle ScriptEntry TwinleafTownPlayerHouse1F_Mom - ScriptEntry TwinleafTownPlayerHouse1F_DontGoIntoTheTallGrassTrigger + ScriptEntry TwinleafTownPlayerHouse1F_CoordEvent_DontGoIntoTheTallGrass ScriptEntry TwinleafTownPlayerHouse1F_RivalsMom ScriptEntry TwinleafTownPlayerHouse1F_TV ScriptEntry TwinleafTownPlayerHouse1F_Fridge @@ -733,7 +733,7 @@ TwinleafTownPlayerHouse1F_Movement_PlayerWatchRivalsMomLeaveEast: WalkOnSpotNormalSouth EndMovement -TwinleafTownPlayerHouse1F_DontGoIntoTheTallGrassTrigger: +TwinleafTownPlayerHouse1F_CoordEvent_DontGoIntoTheTallGrass: LockAll GoTo TwinleafTownPlayerHouse1F_PlayerAndMomFaceEachOther End diff --git a/res/field/scripts/scripts_twinleaf_town_player_house_2f.s b/res/field/scripts/scripts_twinleaf_town_player_house_2f.s index 8bc540ca00..b52f2ce3b6 100644 --- a/res/field/scripts/scripts_twinleaf_town_player_house_2f.s +++ b/res/field/scripts/scripts_twinleaf_town_player_house_2f.s @@ -6,13 +6,13 @@ ScriptEntry TwinleafTownPlayerHouse2F_Wii ScriptEntry TwinleafTownPlayerHouse2F_PC ScriptEntry TwinleafTownPlayerHouse2F_OnFrame_ConcludeSpecialProgram - ScriptEntry TwinleafTownPlayerHouse2F_ScrollingSign + ScriptEntry TwinleafTownPlayerHouse2F_ScrollingSignpost ScriptEntry TwinleafTownPlayerHouse2F_OnTransition ScriptEntry TwinleafTownPlayerHouse2F_TV - ScriptEntry TwinleafTownPlayerHouse2F_RivalTriggerNorth - ScriptEntry TwinleafTownPlayerHouse2F_RivalTriggerWest - ScriptEntry TwinleafTownPlayerHouse2F_RivalTriggerEast - ScriptEntry TwinleafTownPlayerHouse2F_RivalTriggerSouth + ScriptEntry TwinleafTownPlayerHouse2F_CoordEvent_RivalNorth + ScriptEntry TwinleafTownPlayerHouse2F_CoordEvent_RivalWest + ScriptEntry TwinleafTownPlayerHouse2F_CoordEvent_RivalEast + ScriptEntry TwinleafTownPlayerHouse2F_CoordEvent_RivalSouth ScriptEntryEnd TwinleafTownPlayerHouse2F_OnTransition: @@ -49,7 +49,7 @@ TwinleafTownPlayerHouse2F_PC: ReleaseAll End -TwinleafTownPlayerHouse2F_ScrollingSign: +TwinleafTownPlayerHouse2F_ScrollingSignpost: ShowScrollingSign TwinleafTownPlayerHouse2F_Text_TheXButtonOpensTheMenu End @@ -57,22 +57,22 @@ TwinleafTownPlayerHouse2F_TV: EventMessage TwinleafTownPlayerHouse2F_Text_MomBoughThisTVAsAGift End -TwinleafTownPlayerHouse2F_RivalTriggerNorth: +TwinleafTownPlayerHouse2F_CoordEvent_RivalNorth: SetVar VAR_MAP_LOCAL_0, 0 GoTo TwinleafTownPlayerHouse2F_Rival End -TwinleafTownPlayerHouse2F_RivalTriggerWest: +TwinleafTownPlayerHouse2F_CoordEvent_RivalWest: SetVar VAR_MAP_LOCAL_0, 1 GoTo TwinleafTownPlayerHouse2F_Rival End -TwinleafTownPlayerHouse2F_RivalTriggerEast: +TwinleafTownPlayerHouse2F_CoordEvent_RivalEast: SetVar VAR_MAP_LOCAL_0, 2 GoTo TwinleafTownPlayerHouse2F_Rival End -TwinleafTownPlayerHouse2F_RivalTriggerSouth: +TwinleafTownPlayerHouse2F_CoordEvent_RivalSouth: SetVar VAR_MAP_LOCAL_0, 3 GoTo TwinleafTownPlayerHouse2F_Rival End diff --git a/res/field/scripts/scripts_underground.s b/res/field/scripts/scripts_underground.s index 357ea3967a..4e2aefbc71 100644 --- a/res/field/scripts/scripts_underground.s +++ b/res/field/scripts/scripts_underground.s @@ -48,10 +48,10 @@ Underground_PutRoarkNextToPlayer: Underground_TrapsVendor_Unused: UndergroundNPCMessage UndergroundNPCs_Text_IllTradeYouSomething - GoTo Underground_TrapsVendorShopMenu_Dummy + GoTo Underground_TrapsVendorShopMenu_Unused End -Underground_TrapsVendorShopMenu_Dummy: +Underground_TrapsVendorShopMenu_Unused: Dummy19E 1, VAR_RESULT SetVar VAR_0x8004, VAR_RESULT SetVar VAR_0x8008, VAR_RESULT @@ -85,7 +85,7 @@ Underground_VendorSeeYou_Unused: Underground_TrapsVendorNeedAnythingElse_Unused: WaitABPress UndergroundNPCMessage UndergroundNPCs_Text_DoYouNeedAnythingElse - GoTo Underground_TrapsVendorShopMenu_Dummy + GoTo Underground_TrapsVendorShopMenu_Unused End Underground_TrapsVendorWaitABPress_Unused: @@ -100,10 +100,10 @@ Underground_VendorClose_Unused: Underground_GoodsVendor_Unused: UndergroundNPCMessage UndergroundNPCs_Text_IllTradeYouSomething - GoTo Underground_GoodsVendorShopMenu_Dummy + GoTo Underground_GoodsVendorShopMenu_Unused End -Underground_GoodsVendorShopMenu_Dummy: +Underground_GoodsVendorShopMenu_Unused: Dummy19E 0, VAR_RESULT SetVar VAR_0x8004, VAR_RESULT SetVar VAR_0x8008, VAR_RESULT @@ -137,37 +137,37 @@ Underground_GoodsVendorWaitABPress_Unused: Underground_GoodsVendorNeedAnythingElse_Unused: WaitABPress UndergroundNPCMessage UndergroundNPCs_Text_DoYouNeedAnythingElse - GoTo Underground_GoodsVendorShopMenu_Dummy + GoTo Underground_GoodsVendorShopMenu_Unused End Underground_TreasuresVendor_Unused: UndergroundNPCMessage UndergroundNPCs_Text_IllTradeSpheresForTreasures - GoTo _0231 + GoTo Underground_TreasuresVendorShopMenu_Unused End -_0231: +Underground_TreasuresVendorShopMenu_Unused: Dummy19E 2, VAR_RESULT SetVar VAR_0x8004, VAR_RESULT SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, -4, _0265 + GoToIfEq VAR_0x8008, -4, Underground_TreasuresVendorNoRoom_Unused GoToIfEq VAR_0x8008, -1, Underground_VendorSeeYou_Unused - GoTo _0271 + GoTo Underground_TreasuresVendorWaitABPress_Unused End -_0265: +Underground_TreasuresVendorNoRoom_Unused: UndergroundNPCMessage UndergroundNPCs_Text_YouDontHaveRoom - GoTo _027B + GoTo Underground_TreasuresVendorNeedAnythingElse_Unused End -_0271: +Underground_TreasuresVendorWaitABPress_Unused: WaitABPress - GoTo _027B + GoTo Underground_TreasuresVendorNeedAnythingElse_Unused End -_027B: +Underground_TreasuresVendorNeedAnythingElse_Unused: WaitABPress UndergroundNPCMessage UndergroundNPCs_Text_DoYouNeedAnythingElse - GoTo _0231 + GoTo Underground_TreasuresVendorShopMenu_Unused End Underground_RoarkIntro: @@ -188,7 +188,7 @@ Underground_RoarkIntro: End .balign 4, 0 -Underground_UnusedMovement: +Underground_Movement_Unused: Delay8 WalkOnSpotNormalEast EndMovement diff --git a/res/field/scripts/scripts_union_room.s b/res/field/scripts/scripts_union_room.s index 06d73896a9..625871e5cb 100644 --- a/res/field/scripts/scripts_union_room.s +++ b/res/field/scripts/scripts_union_room.s @@ -8,7 +8,7 @@ ScriptEntry UnionRoom_OnResume ScriptEntry UnionRoom_Player ScriptEntry UnionRoom_PlayerContactedYou - ScriptEntry UnionRoom_UnusedEntry6 + ScriptEntry UnionRoom_Dummy6 ScriptEntry UnionRoom_PlayerBusy ScriptEntry UnionRoom_Teala ScriptEntryEnd @@ -409,7 +409,7 @@ UnionRoom_OtherPlayerDeclinedTrade: GoTo UnionRoom_OtherPlayerDeclinedEnd End -UnionRoom_UnusedDecline: +UnionRoom_Declined_Unused: GetUnionRoomMessage UR_MSG_DECLINED_UNUSED, VAR_RESULT MessageVar VAR_RESULT WaitTime 30, VAR_RESULT @@ -720,7 +720,7 @@ UnionRoom_InitCommFieldCmd: FadeScreenIn Return -UnionRoom_UnusedEntry6: +UnionRoom_Dummy6: NPCMessage UnionRoom_Text_Dummy207 End diff --git a/res/field/scripts/scripts_unk_0397.s b/res/field/scripts/scripts_unk_0397.s index 0f3c6428f0..58d5ad6ab0 100644 --- a/res/field/scripts/scripts_unk_0397.s +++ b/res/field/scripts/scripts_unk_0397.s @@ -43,7 +43,7 @@ _005C: _0078: SetFlag FLAG_HIDE_BLOCK_POKECENTER_BASEMENT SetVar VAR_GTS_ACCESS_STATE, 1 - SetVar VAR_UNK_0x40D4, 1 + SetVar VAR_VISITED_POKEMON_CENTER_B1F, 1 End _008A: diff --git a/res/field/scripts/scripts_unused_battle_park.s b/res/field/scripts/scripts_unused_battle_park.s index 5b395cf884..4251b564b5 100644 --- a/res/field/scripts/scripts_unused_battle_park.s +++ b/res/field/scripts/scripts_unused_battle_park.s @@ -3,10 +3,10 @@ #include "res/field/events/events_unused_battle_park.h" - ScriptEntry BattlePark_TriggerPalmerRival - ScriptEntry BattlePark_Unused2 - ScriptEntry BattlePark_SignExchangeServiceCorner - ScriptEntry BattlePark_SignBattleTower + ScriptEntry BattlePark_CoordEvent_PalmerRival + ScriptEntry BattlePark_Rival_Unused + ScriptEntry BattlePark_SignboardExchangeServiceCorner + ScriptEntry BattlePark_SignboardBattleTower ScriptEntry BattlePark_Beauty ScriptEntry BattlePark_SchoolKidM ScriptEntry BattlePark_ExpertF @@ -17,7 +17,7 @@ ScriptEntry BattlePark_BlackBelt ScriptEntryEnd -BattlePark_TriggerPalmerRival: +BattlePark_CoordEvent_PalmerRival: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 CallIfEq VAR_0x8004, 23, BattlePark_SetPalmerRivalPositionX23 @@ -210,7 +210,7 @@ BattlePark_Movement_PalmerRivalLeaveEast: WalkFastNorth 8 EndMovement -BattlePark_Unused2: +BattlePark_Rival_Unused: NPCMessage BattlePark_Text_MeasureUpForMyQuest End @@ -246,11 +246,11 @@ BattlePark_BlackBelt: NPCMessage BattlePark_Text_HookUpWithBeauty End -BattlePark_SignExchangeServiceCorner: +BattlePark_SignboardExchangeServiceCorner: ShowLandmarkSign BattlePark_Text_SignExchangeServiceCorner End -BattlePark_SignBattleTower: +BattlePark_SignboardBattleTower: ShowLandmarkSign BattlePark_Text_SignBattleTower End diff --git a/res/field/scripts/scripts_unused_battle_park_exchange_service_corner.s b/res/field/scripts/scripts_unused_battle_park_exchange_service_corner.s index 168209a65a..760221c7df 100644 --- a/res/field/scripts/scripts_unused_battle_park_exchange_service_corner.s +++ b/res/field/scripts/scripts_unused_battle_park_exchange_service_corner.s @@ -39,34 +39,34 @@ BattleParkExchangeServiceCorner_PokeMartFrontierLeft: ReleaseAll End -BattleParkExchangeServiceCorner_Unused: +BattleParkExchangeServiceCorner_PrizeExchange_Unused: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer ShowBattlePoints 21, 1 Message BattleParkExchangeServiceCorner_Text_ExchangeBPForItems -BattleParkExchangeServiceCorner_UnusedWhichPrize: +BattleParkExchangeServiceCorner_WhichPrize_Unused: Message BattleParkExchangeServiceCorner_Text_ExchangeBPForWhichPrize - Call BattleParkExchangeServiceCorner_UnusedInitPrizeMenu - GoToIfEq VAR_RESULT, -2, BattleParkExchangeServiceCorner_UnusedThanksForVisiting - GoToIfEq VAR_RESULT, VAR_MAP_LOCAL_1, BattleParkExchangeServiceCorner_UnusedThanksForVisiting + Call BattleParkExchangeServiceCorner_InitPrizeMenu_Unused + GoToIfEq VAR_RESULT, -2, BattleParkExchangeServiceCorner_ThanksForVisiting_Unused + GoToIfEq VAR_RESULT, VAR_MAP_LOCAL_1, BattleParkExchangeServiceCorner_ThanksForVisiting_Unused SetVar VAR_MAP_LOCAL_3, VAR_RESULT GetExchangeServiceCornerItemAndCost VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_3, VAR_0x8000, VAR_0x8001 - CallIfEq VAR_MAP_LOCAL_0, 0, BattleParkExchangeServiceCorner_UnusedYouveChosenThisItem - CallIfEq VAR_MAP_LOCAL_0, 1, BattleParkExchangeServiceCorner_UnusedYouveChosenThisTM + CallIfEq VAR_MAP_LOCAL_0, 0, BattleParkExchangeServiceCorner_YouveChosenThisItem_Unused + CallIfEq VAR_MAP_LOCAL_0, 1, BattleParkExchangeServiceCorner_YouveChosenThisTM_Unused ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, BattleParkExchangeServiceCorner_UnusedWhichPrize + GoToIfEq VAR_RESULT, MENU_NO, BattleParkExchangeServiceCorner_WhichPrize_Unused CheckBattlePoints VAR_0x8001, VAR_RESULT - GoToIfEq VAR_RESULT, FALSE, BattleParkExchangeServiceCorner_UnusedNotEnoughBP + GoToIfEq VAR_RESULT, FALSE, BattleParkExchangeServiceCorner_NotEnoughBP_Unused CanFitItem VAR_0x8000, 1, VAR_RESULT - GoToIfEq VAR_RESULT, FALSE, BattleParkExchangeServiceCorner_UnusedNoRoomForItem + GoToIfEq VAR_RESULT, FALSE, BattleParkExchangeServiceCorner_NoRoomForItem_Unused Message BattleParkExchangeServiceCorner_Text_HereIsYourPrize AddItem VAR_0x8000, 1, VAR_RESULT RemoveBattlePoints VAR_0x8001 UpdateBPDisplay - GoTo BattleParkExchangeServiceCorner_UnusedWhichPrize + GoTo BattleParkExchangeServiceCorner_WhichPrize_Unused -BattleParkExchangeServiceCorner_UnusedThanksForVisiting: +BattleParkExchangeServiceCorner_ThanksForVisiting_Unused: Message BattleParkExchangeServiceCorner_Text_ThanksForVisiting WaitButton CloseMessage @@ -74,37 +74,37 @@ BattleParkExchangeServiceCorner_UnusedThanksForVisiting: ReleaseAll End -BattleParkExchangeServiceCorner_UnusedYouveChosenThisItem: +BattleParkExchangeServiceCorner_YouveChosenThisItem_Unused: BufferItemName 0, VAR_0x8000 Message BattleParkExchangeServiceCorner_Text_YouveChosenThisItem Return -BattleParkExchangeServiceCorner_UnusedYouveChosenThisTM: +BattleParkExchangeServiceCorner_YouveChosenThisTM_Unused: BufferItemName 0, VAR_0x8000 BufferTMHMMoveName 1, VAR_0x8000 Message BattleParkExchangeServiceCorner_Text_YouveChosenThisTM Return -BattleParkExchangeServiceCorner_UnusedNotEnoughBP: +BattleParkExchangeServiceCorner_NotEnoughBP_Unused: Message BattleParkExchangeServiceCorner_Text_NotEnoughBP - GoTo BattleParkExchangeServiceCorner_UnusedWhichPrize + GoTo BattleParkExchangeServiceCorner_WhichPrize_Unused -BattleParkExchangeServiceCorner_UnusedNoRoomForItem: +BattleParkExchangeServiceCorner_NoRoomForItem_Unused: BufferItemName 0, VAR_0x8000 Message BattleParkExchangeServiceCorner_Text_NoRoomForItem - GoTo BattleParkExchangeServiceCorner_UnusedWhichPrize + GoTo BattleParkExchangeServiceCorner_WhichPrize_Unused -BattleParkExchangeServiceCorner_UnusedInitPrizeMenu: +BattleParkExchangeServiceCorner_InitPrizeMenu_Unused: SetVar VAR_0x8008, 0 SetVar VAR_0x8009, 0 InitGlobalTextListMenu 1, 1, 0, VAR_RESULT -BattleParkExchangeServiceCorner_UnusedAddPrizeMenuEntries: +BattleParkExchangeServiceCorner_AddPrizeMenuEntries_Unused: GetExchangeServiceCornerItemAndCost VAR_MAP_LOCAL_0, VAR_0x8008, VAR_0x8000, VAR_0x8001 BufferItemName 0, VAR_0x8000 BufferVarPaddingDigits 1, VAR_0x8001, PADDING_MODE_SPACES, 3 AddListMenuEntry MenuEntries_Text_UnusedPrizeExchange_Prize, VAR_0x8008 AddVar VAR_0x8008, 1 - GoToIfLt VAR_0x8008, VAR_MAP_LOCAL_1, BattleParkExchangeServiceCorner_UnusedAddPrizeMenuEntries + GoToIfLt VAR_0x8008, VAR_MAP_LOCAL_1, BattleParkExchangeServiceCorner_AddPrizeMenuEntries_Unused AddListMenuEntry MenuEntries_Text_UnusedPrizeExchange_NoThanks, VAR_0x8008 ShowListMenu Return diff --git a/res/field/scripts/scripts_unused_battle_park_gate_to_fight_area.s b/res/field/scripts/scripts_unused_battle_park_gate_to_fight_area.s index ee37a376ce..8db9a91bf2 100644 --- a/res/field/scripts/scripts_unused_battle_park_gate_to_fight_area.s +++ b/res/field/scripts/scripts_unused_battle_park_gate_to_fight_area.s @@ -1,19 +1,19 @@ #include "macros/scrcmd.inc" - ScriptEntry BattleParkGateToFightArea_Unused1 + ScriptEntry BattleParkGateToFightArea_Dummy1 ScriptEntry BattleParkGateToFightArea_Maid2 ScriptEntry BattleParkGateToFightArea_Maid1 ScriptEntry BattleParkGateToFightArea_Maid5 ScriptEntry BattleParkGateToFightArea_Maid3And4 ScriptEntry BattleParkGateToFightArea_Collector - ScriptEntry BattleParkGateToFightArea_Unused7 + ScriptEntry BattleParkGateToFightArea_Dummy7 ScriptEntryEnd -BattleParkGateToFightArea_Unused7: +BattleParkGateToFightArea_Dummy7: End -BattleParkGateToFightArea_Unused1: +BattleParkGateToFightArea_Dummy1: End BattleParkGateToFightArea_Maid2: diff --git a/res/field/scripts/scripts_unused_eterna_city_condominiums_4f.s b/res/field/scripts/scripts_unused_eterna_city_condominiums_4f.s index d5b6b49981..a28abf82a6 100644 --- a/res/field/scripts/scripts_unused_eterna_city_condominiums_4f.s +++ b/res/field/scripts/scripts_unused_eterna_city_condominiums_4f.s @@ -9,8 +9,8 @@ EternaCityCondominiums4F_ExpertF: PlaySE SEQ_SE_CONFIRM LockAll FacePlayer - GoToIfSet FLAG_RECEIVED_ETERNA_CITY_CONDOMINIUMS_4F_TM04, EternaCityCondominiums4F_FolksLikeMeHaveALongHistoryWeCanLookBackOn - Message EternaCityCondominiums4F_Text_IveHadThisTMRecycleForSuchALongTimeNow + GoToIfSet FLAG_RECEIVED_ETERNA_CITY_CONDOMINIUMS_4F_TM04, EternaCityCondominiums4F_LongHistory + Message EternaCityCondominiums4F_Text_HadTMLongTimeNow SetVar VAR_0x8004, ITEM_TM04 SetVar VAR_0x8005, 1 GoToIfCannotFitItem VAR_0x8004, VAR_0x8005, VAR_RESULT, EternaCityCondominiums4F_BagIsFull @@ -20,8 +20,8 @@ EternaCityCondominiums4F_ExpertF: ReleaseAll End -EternaCityCondominiums4F_FolksLikeMeHaveALongHistoryWeCanLookBackOn: - Message EternaCityCondominiums4F_Text_FolksLikeMeHaveALongHistoryWeCanLookBackOn +EternaCityCondominiums4F_LongHistory: + Message EternaCityCondominiums4F_Text_LongHistory WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_unused_gate_between_eterna_city_route_206.s b/res/field/scripts/scripts_unused_gate_between_eterna_city_route_206.s index f56cd8dcb4..a641cba377 100644 --- a/res/field/scripts/scripts_unused_gate_between_eterna_city_route_206.s +++ b/res/field/scripts/scripts_unused_gate_between_eterna_city_route_206.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry GateBetweenEternaCityRoute206_UnusedEntry1 + ScriptEntry GateBetweenEternaCityRoute206_Dummy1 ScriptEntryEnd -GateBetweenEternaCityRoute206_UnusedEntry1: +GateBetweenEternaCityRoute206_Dummy1: End diff --git a/res/field/scripts/scripts_unused_jubilife_city_house_1.s b/res/field/scripts/scripts_unused_jubilife_city_house_1.s new file mode 100644 index 0000000000..da495dad93 --- /dev/null +++ b/res/field/scripts/scripts_unused_jubilife_city_house_1.s @@ -0,0 +1,12 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/unused_jubilife_city_house_1.h" + + + ScriptEntry JubilifeCityHouse1_Dummy1 + ScriptEntryEnd + +JubilifeCityHouse1_Dummy1: + NPCMessage JubilifeCityHouse1_Text_Dummy0 + End + + .balign 4, 0 diff --git a/res/field/scripts/scripts_unused_jubilife_city_house_2.s b/res/field/scripts/scripts_unused_jubilife_city_house_2.s new file mode 100644 index 0000000000..38911a6634 --- /dev/null +++ b/res/field/scripts/scripts_unused_jubilife_city_house_2.s @@ -0,0 +1,12 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/unused_jubilife_city_house_2.h" + + + ScriptEntry JubilifeCityHouse2_Dummy1 + ScriptEntryEnd + +JubilifeCityHouse2_Dummy1: + NPCMessage JubilifeCityHouse2_Text_Dummy0 + End + + .balign 4, 0 diff --git a/res/field/scripts/scripts_unused_jubilife_city_house_3.s b/res/field/scripts/scripts_unused_jubilife_city_house_3.s new file mode 100644 index 0000000000..98b41f04b6 --- /dev/null +++ b/res/field/scripts/scripts_unused_jubilife_city_house_3.s @@ -0,0 +1,15 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/unused_jubilife_city_house_3.h" + + + ScriptEntry JubilifeCityHouse3_Dummy1 + ScriptEntry JubilifeCityHouse3_Dummy2 + ScriptEntryEnd + +JubilifeCityHouse3_Dummy1: + NPCMessage JubilifeCityHouse3_Text_Dummy0 + End + +JubilifeCityHouse3_Dummy2: + NPCMessage JubilifeCityHouse3_Text_Dummy1 + End diff --git a/res/field/scripts/scripts_unused_jubilife_city_house_4.s b/res/field/scripts/scripts_unused_jubilife_city_house_4.s new file mode 100644 index 0000000000..45fcc8d750 --- /dev/null +++ b/res/field/scripts/scripts_unused_jubilife_city_house_4.s @@ -0,0 +1,12 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/unused_jubilife_city_house_4.h" + + + ScriptEntry JubilifeCityHouse4_Dummy1 + ScriptEntryEnd + +JubilifeCityHouse4_Dummy1: + NPCMessage JubilifeCityHouse4_Text_Dummy0 + End + + .balign 4, 0 diff --git a/res/field/scripts/scripts_unused_resort_area_mart.s b/res/field/scripts/scripts_unused_resort_area_mart.s index 4a609ea78b..69e903f048 100644 --- a/res/field/scripts/scripts_unused_resort_area_mart.s +++ b/res/field/scripts/scripts_unused_resort_area_mart.s @@ -2,14 +2,14 @@ ScriptEntry ResortAreaMart_CashierF - ScriptEntry ResortAreaMart_UnusedEntry2 + ScriptEntry ResortAreaMart_Dummy2 ScriptEntryEnd ResortAreaMart_CashierF: PokeMartCommonWithGreeting End -ResortAreaMart_UnusedEntry2: +ResortAreaMart_Dummy2: End .balign 4, 0 diff --git a/res/field/scripts/scripts_unused_sunyshore_city_house_1.s b/res/field/scripts/scripts_unused_sunyshore_city_house_1.s new file mode 100644 index 0000000000..1fcede67dc --- /dev/null +++ b/res/field/scripts/scripts_unused_sunyshore_city_house_1.s @@ -0,0 +1,8 @@ +#include "macros/scrcmd.inc" + + + ScriptEntry SunyshoreCityUnknownHouse1_Dummy1 + ScriptEntryEnd + +SunyshoreCityUnknownHouse1_Dummy1: + End diff --git a/res/field/scripts/scripts_unused_sunyshore_city_house_2.s b/res/field/scripts/scripts_unused_sunyshore_city_house_2.s new file mode 100644 index 0000000000..b85f461c99 --- /dev/null +++ b/res/field/scripts/scripts_unused_sunyshore_city_house_2.s @@ -0,0 +1,8 @@ +#include "macros/scrcmd.inc" + + + ScriptEntry SunyshoreCityUnknownHouse2_Dummy1 + ScriptEntryEnd + +SunyshoreCityUnknownHouse2_Dummy1: + End diff --git a/res/field/scripts/scripts_unused_verity_lakefront_house.s b/res/field/scripts/scripts_unused_verity_lakefront_house.s new file mode 100644 index 0000000000..99df03806b --- /dev/null +++ b/res/field/scripts/scripts_unused_verity_lakefront_house.s @@ -0,0 +1,11 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/unused_verity_lakefront_house.h" + + + ScriptEntry VerityLakefrontHouse_Dummy1 + ScriptEntryEnd + +VerityLakefrontHouse_Dummy1: + BufferPlayerName 0 + NPCMessage VerityLakefrontHouse1_Text_Dummy0 + End diff --git a/res/field/scripts/scripts_valley_windworks_building.s b/res/field/scripts/scripts_valley_windworks_building.s index d175ea77c3..1d66881120 100644 --- a/res/field/scripts/scripts_valley_windworks_building.s +++ b/res/field/scripts/scripts_valley_windworks_building.s @@ -4,9 +4,9 @@ ScriptEntry ValleyWindworksBuilding_OnTransition - ScriptEntry ValleyWindworksBuilding_OnFrameFirstEntry + ScriptEntry ValleyWindworksBuilding_OnFrame_FirstEntry ScriptEntry ValleyWindworksBuilding_GruntM - ScriptEntry ValleyWindworksBuilding_TriggerMars + ScriptEntry ValleyWindworksBuilding_CoordEvent_Mars ScriptEntry ValleyWindworksBuilding_ScientistPapa ScriptEntry ValleyWindworksBuilding_Twin ScriptEntry ValleyWindworksBuilding_PCWest @@ -27,7 +27,7 @@ ValleyWindworksBuilding_SetLittleGirlAndScientistPapaPositions: SetObjectEventMovementType LOCALID_SCIENTIST_PAPA, MOVEMENT_TYPE_LOOK_SOUTH End -ValleyWindworksBuilding_OnFrameFirstEntry: +ValleyWindworksBuilding_OnFrame_FirstEntry: LockAll ApplyMovement LOCALID_GALACTIC_GRUNT_1, ValleyWindworksBuilding_Movement_GalacticGrunt1NoticePlayer WaitMovement @@ -61,7 +61,7 @@ ValleyWindworksBuilding_GruntM: NPCMessage ValleyWindworksBuilding_Text_HumphJustYouWaitOurCommanderWillSmooshYou End -ValleyWindworksBuilding_TriggerMars: +ValleyWindworksBuilding_CoordEvent_Mars: LockAll GetPlayerMapPos VAR_0x8004, VAR_0x8005 GoToIfEq VAR_0x8005, 6, ValleyWindworksBuilding_MarsNoticeAndWalkToPlayer diff --git a/res/field/scripts/scripts_valley_windworks_outside.s b/res/field/scripts/scripts_valley_windworks_outside.s index 79d4d338cd..0440f17ab4 100644 --- a/res/field/scripts/scripts_valley_windworks_outside.s +++ b/res/field/scripts/scripts_valley_windworks_outside.s @@ -7,10 +7,10 @@ ScriptEntry ValleyWindworksOutside_OnLoad ScriptEntry ValleyWindworksOutside_GruntM ScriptEntry ValleyWindworksOutside_Door - ScriptEntry ValleyWindworksOutside_LandmarkSignValleyWindworks + ScriptEntry ValleyWindworksOutside_SignboardValleyWindworks ScriptEntry ValleyWindworksOutside_Drifloon ScriptEntry ValleyWindworksOutside_OnResume - ScriptEntry ValleyWindworksOutside_OnFrameLooker + ScriptEntry ValleyWindworksOutside_OnFrame_Looker ScriptEntryEnd ValleyWindworksOutside_OnResume: @@ -130,7 +130,7 @@ ValleyWindworksOutside_AskOpenDoorEnd: ReleaseAll End -ValleyWindworksOutside_LandmarkSignValleyWindworks: +ValleyWindworksOutside_SignboardValleyWindworks: ShowLandmarkSign ValleyWindworksOutside_Text_ValleyWindworksEcologicalWindDrivenEnergy End @@ -156,7 +156,7 @@ ValleyWindworksOutside_BlackOutDrifloon: ReleaseAll End -ValleyWindworksOutside_OnFrameLooker: +ValleyWindworksOutside_OnFrame_Looker: LockAll ApplyMovement LOCALID_LOOKER, ValleyWindworksOutside_Movement_LookerNoticeAndWalkToPlayer ApplyMovement LOCALID_PLAYER, ValleyWindworksOutside_Movement_PlayerFaceLookerWest diff --git a/res/field/scripts/scripts_valor_lakefront.s b/res/field/scripts/scripts_valor_lakefront.s index 1329153a40..73ff436cf4 100644 --- a/res/field/scripts/scripts_valor_lakefront.s +++ b/res/field/scripts/scripts_valor_lakefront.s @@ -9,9 +9,9 @@ ScriptEntry ValorLakefront_CameramanSouth ScriptEntry ValorLakefront_Beauty ScriptEntry ValorLakefront_CameramanNorth - ScriptEntry ValorLakefront_SignSevenStarsRestaurant + ScriptEntry ValorLakefront_SignboardSevenStarsRestaurant ScriptEntry ValorLakefront_Collector - ScriptEntry ValorLakefront_TriggerBlockSunyshore + ScriptEntry ValorLakefront_CoordEvent_BlockSunyshore ScriptEntryEnd ValorLakefront_OnTransition: @@ -421,7 +421,7 @@ ValorLakefront_Movement_CynthiaLeave: WalkNormalNorth 9 EndMovement -ValorLakefront_UnusedMovement: +ValorLakefront_Movement_Unused: Delay8 WalkOnSpotNormalEast EndMovement @@ -444,7 +444,7 @@ ValorLakefront_Movement_PlayerWatchRivalLeave: WalkOnSpotNormalNorth EndMovement -ValorLakefront_UnusedMovement2: +ValorLakefront_Movement_Unused2: Delay8 3 WalkOnSpotNormalNorth EndMovement @@ -505,7 +505,7 @@ ValorLakefront_Movement_WalkNorth: WalkNormalNorth EndMovement -ValorLakefront_SignSevenStarsRestaurant: +ValorLakefront_SignboardSevenStarsRestaurant: ShowLandmarkSign ValorLakefront_Text_SignSevenStarsRestaurant End @@ -513,7 +513,7 @@ ValorLakefront_Collector: NPCMessage ValorLakefront_Text_SunyshoreHadBlackout2 End -ValorLakefront_TriggerBlockSunyshore: +ValorLakefront_CoordEvent_BlockSunyshore: LockAll ApplyMovement LOCALID_COLLECTOR, ValorLakefront_Movement_CollectorExclamationMark WaitMovement diff --git a/res/field/scripts/scripts_veilstone_city.s b/res/field/scripts/scripts_veilstone_city.s index 3555afde82..7e6fa8ff2a 100644 --- a/res/field/scripts/scripts_veilstone_city.s +++ b/res/field/scripts/scripts_veilstone_city.s @@ -12,26 +12,26 @@ ScriptEntry VeilstoneCity_Roughneck2 ScriptEntry VeilstoneCity_Lady ScriptEntry VeilstoneCity_BattleGirl2 - ScriptEntry VeilstoneCity_TriggerGruntBlockWarehouse + ScriptEntry VeilstoneCity_CoordEvent_GruntBlockWarehouse ScriptEntry VeilstoneCity_GruntMWarehouseNorth ScriptEntry VeilstoneCity_GruntMWarehouseSouth ScriptEntry VeilstoneCity_GruntMStorageKey ScriptEntry VeilstoneCity_GruntMSoutheast - ScriptEntry VeilstoneCity_TriggerCrasherWake + ScriptEntry VeilstoneCity_CoordEvent_CrasherWake ScriptEntry VeilstoneCity_Counterpart - ScriptEntry VeilstoneCity_MapSign - ScriptEntry VeilstoneCity_GymSign - ScriptEntry VeilstoneCity_SignGalacticWarehouse - ScriptEntry VeilstoneCity_SignGalacticBuilding - ScriptEntry VeilstoneCity_SignDepartmentStore - ScriptEntry VeilstoneCity_SignGameCorner - ScriptEntry VeilstoneCity_SignPrizeExchange - ScriptEntry VeilstoneCity_SignLakeValor + ScriptEntry VeilstoneCity_MapSignpost + ScriptEntry VeilstoneCity_GymSignpost + ScriptEntry VeilstoneCity_SignboardGalacticWarehouse + ScriptEntry VeilstoneCity_SignboardGalacticBuilding + ScriptEntry VeilstoneCity_SignboardDepartmentStore + ScriptEntry VeilstoneCity_SignboardGameCorner + ScriptEntry VeilstoneCity_SignboardPrizeExchange + ScriptEntry VeilstoneCity_SignboardLakeValor ScriptEntry VeilstoneCity_DeoxysMeteoriteSpeed ScriptEntry VeilstoneCity_DeoxysMeteoriteDefense ScriptEntry VeilstoneCity_DeoxysMeteoriteAttack ScriptEntry VeilstoneCity_DeoxysMeteoriteNormal - ScriptEntry VeilstoneCity_OnFrameCounterpartNeedsHelp + ScriptEntry VeilstoneCity_OnFrame_CounterpartNeedsHelp ScriptEntry VeilstoneCity_Looker ScriptEntry VeilstoneCity_Guitarist3 ScriptEntry VeilstoneCity_BattleGirl3 @@ -65,7 +65,7 @@ VeilstoneCity_SetLookerPositionAtGalacticBuilding: SetObjectEventDir LOCALID_LOOKER, DIR_NORTH Return -VeilstoneCity_TriggerCrasherWake: +VeilstoneCity_CoordEvent_CrasherWake: LockAll ApplyMovement LOCALID_COUNTERPART, VeilstoneCity_Movement_CounterpartNoticePlayerBeforeGym WaitMovement @@ -333,7 +333,7 @@ VeilstoneCity_Movement_CounterpartWatchCrasherWakeLeave: WalkOnSpotNormalSouth EndMovement -VeilstoneCity_UnusedMovement: +VeilstoneCity_Movement_Unused: Delay8 WalkOnSpotNormalNorth EndMovement @@ -792,30 +792,30 @@ VeilstoneCity_Movement_CounterpartWalkToGruntNorth: WalkOnSpotNormalEast EndMovement -VeilstoneCity_UnusedMovement2: +VeilstoneCity_Movement_Unused2: Delay4 WalkOnSpotNormalWest EmoteExclamationMark Delay8 EndMovement -VeilstoneCity_UnusedMovement3: +VeilstoneCity_Movement_Unused3: WalkNormalWest 4 EndMovement -VeilstoneCity_UnusedMovement4: +VeilstoneCity_Movement_Unused4: WalkNormalSouth 2 WalkNormalWest 2 WalkNormalSouth 6 EndMovement -VeilstoneCity_UnusedMovement5: +VeilstoneCity_Movement_Unused5: Delay8 WalkOnSpotNormalNorth WalkOnSpotNormalWest EndMovement -VeilstoneCity_UnusedMovement6: +VeilstoneCity_Movement_Unused6: Delay8 WalkOnSpotNormalSouth WalkOnSpotNormalWest @@ -858,13 +858,13 @@ VeilstoneCity_Movement_PlayerWalkToGruntNorth: WalkOnSpotNormalEast EndMovement -VeilstoneCity_UnusedMovement7: +VeilstoneCity_Movement_Unused7: Delay8 WalkOnSpotNormalSouth WalkOnSpotNormalWest EndMovement -VeilstoneCity_UnusedMovement8: +VeilstoneCity_Movement_Unused8: Delay8 WalkOnSpotNormalNorth WalkOnSpotNormalWest @@ -885,7 +885,7 @@ VeilstoneCity_Movement_PlayerFaceLooker: WalkOnSpotNormalWest EndMovement -VeilstoneCity_UnusedMovement9: +VeilstoneCity_Movement_Unused9: Delay8 WalkOnSpotNormalWest EndMovement @@ -991,7 +991,7 @@ VeilstoneCity_BattleGirl2: NPCMessage VeilstoneCity_Text_IBoughtANewParasol End -VeilstoneCity_TriggerGruntBlockWarehouse: +VeilstoneCity_CoordEvent_GruntBlockWarehouse: LockAll ApplyMovement LOCALID_GRUNT_M_WAREHOUSE_NORTH, VeilstoneCity_Grunt_FaceSouth ApplyMovement LOCALID_PLAYER, VeilstoneCity_Player_FaceNorth @@ -1247,35 +1247,35 @@ VeilstoneCity_GruntMSoutheast: NPCMessage VeilstoneCity_Text_WeHaveHMFlyInWarehouse End -VeilstoneCity_MapSign: +VeilstoneCity_MapSignpost: ShowMapSign VeilstoneCity_Text_MapSign End -VeilstoneCity_GymSign: +VeilstoneCity_GymSignpost: ShowScrollingSign VeilstoneCity_Text_SignPokemonGym End -VeilstoneCity_SignGalacticWarehouse: +VeilstoneCity_SignboardGalacticWarehouse: ShowLandmarkSign VeilstoneCity_Text_SignGalacticWarehouse End -VeilstoneCity_SignGalacticBuilding: +VeilstoneCity_SignboardGalacticBuilding: ShowLandmarkSign VeilstoneCity_Text_SignGalacticVeilstoneBuilding End -VeilstoneCity_SignDepartmentStore: +VeilstoneCity_SignboardDepartmentStore: ShowLandmarkSign VeilstoneCity_Text_SignVeilstoneDepartmentStore End -VeilstoneCity_SignGameCorner: +VeilstoneCity_SignboardGameCorner: ShowLandmarkSign VeilstoneCity_Text_SignVeilstoneGameCorner End -VeilstoneCity_SignPrizeExchange: +VeilstoneCity_SignboardPrizeExchange: ShowLandmarkSign VeilstoneCity_Text_SignPrizeExchange End -VeilstoneCity_SignLakeValor: +VeilstoneCity_SignboardLakeValor: ShowLandmarkSign VeilstoneCity_Text_SignLakeValor End @@ -1342,7 +1342,7 @@ VeilstoneCity_MeteoriteFromTheStars: ReleaseAll End -VeilstoneCity_OnFrameCounterpartNeedsHelp: +VeilstoneCity_OnFrame_CounterpartNeedsHelp: LockAll ApplyMovement LOCALID_COUNTERPART, VeilstoneCity_Movement_CounterpartNoticePlayerAfterGym WaitMovement diff --git a/res/field/scripts/scripts_veilstone_city_galactic_warehouse.s b/res/field/scripts/scripts_veilstone_city_galactic_warehouse.s index 5935f9d2f3..c6d527e6f6 100644 --- a/res/field/scripts/scripts_veilstone_city_galactic_warehouse.s +++ b/res/field/scripts/scripts_veilstone_city_galactic_warehouse.s @@ -4,10 +4,10 @@ ScriptEntry VeilstoneCityGalacticWarehouse_GalacticHQDoor - ScriptEntry VeilstoneCityGalacticWarehouse_OnFrameEnterWithLooker + ScriptEntry VeilstoneCityGalacticWarehouse_OnFrame_EnterWithLooker ScriptEntry VeilstoneCityGalacticWarehouse_Looker ScriptEntry VeilstoneCityGalacticWarehouse_OnTransition - ScriptEntry VeilstoneCityGalacticWarehouse_TriggerLookerOpenDoor + ScriptEntry VeilstoneCityGalacticWarehouse_CoordEvent_LookerOpenDoor ScriptEntryEnd VeilstoneCityGalacticWarehouse_OnTransition: @@ -71,7 +71,7 @@ VeilstoneCityGalacticWarehouse_Movement_GalacticHQDoorEastOpen: WalkFastEast EndMovement -VeilstoneCityGalacticWarehouse_OnFrameEnterWithLooker: +VeilstoneCityGalacticWarehouse_OnFrame_EnterWithLooker: LockAll ApplyMovement LOCALID_LOOKER, VeilstoneCityGalacticWarehouse_Movement_LookerWalkToDoor WaitMovement @@ -135,7 +135,7 @@ VeilstoneCityGalacticWarehouse_Looker: NPCMessage VeilstoneCityGalacticWarehouse_Text_GalacticTransportedToPastoria End -VeilstoneCityGalacticWarehouse_TriggerLookerOpenDoor: +VeilstoneCityGalacticWarehouse_CoordEvent_LookerOpenDoor: LockAll SetObjectEventPos LOCALID_LOOKER, 8, 11 SetObjectEventMovementType LOCALID_LOOKER, MOVEMENT_TYPE_LOOK_NORTH diff --git a/res/field/scripts/scripts_veilstone_city_gym.s b/res/field/scripts/scripts_veilstone_city_gym.s index 834fe39375..7a2b3f5694 100644 --- a/res/field/scripts/scripts_veilstone_city_gym.s +++ b/res/field/scripts/scripts_veilstone_city_gym.s @@ -20,7 +20,7 @@ VeilstoneGym_Maylene: LockAll FacePlayer GoToIfBadgeAcquired BADGE_ID_COBBLE, VeilstoneGym_MayleneAfterBadge - CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, 133, 0, 0, 0 + CreateJournalEvent LOCATION_EVENT_GYM_WAS_TOO_TOUGH, MAP_HEADER_VEILSTONE_CITY_GYM, 0, 0, 0 Message VeilstoneGym_Text_MayleneIntro CloseMessage StartTrainerBattle TRAINER_LEADER_MAYLENE @@ -37,7 +37,7 @@ VeilstoneGym_Maylene: SetTrainerFlag TRAINER_BLACK_BELT_DARREN SetTrainerFlag TRAINER_BLACK_BELT_RAFAEL SetTrainerFlag TRAINER_BLACK_BELT_JEFFERY - CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, 133, TRAINER_LEADER_MAYLENE, 0, 0 + CreateJournalEvent LOCATION_EVENT_BEAT_GYM_LEADER, MAP_HEADER_VEILSTONE_CITY_GYM, TRAINER_LEADER_MAYLENE, 0, 0 SetFlag FLAG_HIDE_GAME_CORNER_LOOKER ClearFlag FLAG_HIDE_VEILSTONE_COUNTERPART SetVar VAR_VEILSTONE_WAREHOUSE_GUARDS_FIGHTABLE, TRUE diff --git a/res/field/scripts/scripts_veilstone_city_pokecenter_2f.s b/res/field/scripts/scripts_veilstone_city_pokecenter_2f.s index ee9720873d..cbfc2172cd 100644 --- a/res/field/scripts/scripts_veilstone_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_veilstone_city_pokecenter_2f.s @@ -1,8 +1,8 @@ #include "macros/scrcmd.inc" - ScriptEntry VeilstoneCityPokecenter2F_UnusedEntry1 + ScriptEntry VeilstoneCityPokecenter2F_Dummy1 ScriptEntryEnd -VeilstoneCityPokecenter2F_UnusedEntry1: +VeilstoneCityPokecenter2F_Dummy1: End diff --git a/res/field/scripts/scripts_veilstone_store_1f.s b/res/field/scripts/scripts_veilstone_store_1f.s index e47dfa9c29..0b644c4870 100644 --- a/res/field/scripts/scripts_veilstone_store_1f.s +++ b/res/field/scripts/scripts_veilstone_store_1f.s @@ -9,7 +9,7 @@ ScriptEntry VeilstoneStore1F_Lady ScriptEntry VeilstoneStore1F_RightVendor ScriptEntry VeilstoneStore1F_LeftVendor - ScriptEntry VeilstoneStore1F_Sign + ScriptEntry VeilstoneStore1F_BgSign ScriptEntry VeilstoneStore1F_Directory ScriptEntry VeilstoneStore1F_Socialite ScriptEntryEnd @@ -34,7 +34,7 @@ VeilstoneStore1F_LeftVendor: PokeMartSpecialtiesWithGreeting MART_SPECIALTIES_ID_VEILSTONE_1F_LEFT End -VeilstoneStore1F_Sign: +VeilstoneStore1F_BgSign: EventMessage VeilstoneStore1F_Text_DiscoverANewYou End diff --git a/res/field/scripts/scripts_veilstone_store_b1f.s b/res/field/scripts/scripts_veilstone_store_b1f.s index 2d82df6fb8..e99ed24b8b 100644 --- a/res/field/scripts/scripts_veilstone_store_b1f.s +++ b/res/field/scripts/scripts_veilstone_store_b1f.s @@ -18,7 +18,7 @@ ScriptEntry VeilstoneStoreB1F_ProfRowan ScriptEntry VeilstoneStoreB1F_LavaCookieVendor ScriptEntry VeilstoneStoreB1F_PoffinVendor - ScriptEntry VeilstoneStoreB1F_Dummy + ScriptEntry VeilstoneStoreB1F_Dummy10 ScriptEntry VeilstoneStoreB1F_BerryVendor ScriptEntry VeilstoneStoreB1F_Directory ScriptEntryEnd @@ -406,7 +406,7 @@ VeilstoneStoreB1F_PoffinVendorMenu: ShowListMenu Return -VeilstoneStoreB1F_Dummy: +VeilstoneStoreB1F_Dummy10: End VeilstoneStoreB1F_IncrementDepartmentStoreRegularCounter: diff --git a/res/field/scripts/scripts_verity_lakefront.s b/res/field/scripts/scripts_verity_lakefront.s index 05dda95a5a..9a0a695033 100644 --- a/res/field/scripts/scripts_verity_lakefront.s +++ b/res/field/scripts/scripts_verity_lakefront.s @@ -4,7 +4,7 @@ ScriptEntry VerityLakefront_OnLoad ScriptEntry VerityLakefront_OnTransition - ScriptEntry VerityLakefront_TriggerWereAtTheLake + ScriptEntry VerityLakefront_CoordEvent_WereAtTheLake ScriptEntry VerityLakefront_TrainerTipsSignpost ScriptEntryEnd @@ -28,7 +28,7 @@ VerityLakefront_OnTransition: GoToIfSet FLAG_DEFEATED_COMMANDER_SATURN_VALOR_CAVERN, VerityLakefront_RemoveWarpsLakeVerityLowWater End -VerityLakefront_TriggerWereAtTheLake: +VerityLakefront_CoordEvent_WereAtTheLake: LockAll ApplyMovement LOCALID_FOLLOWER, VerityLakefront_Movement_RivalWalkOnSpotNorth ApplyMovement LOCALID_PLAYER, VerityLakefront_Movement_PlayerFaceRival diff --git a/res/field/scripts/scripts_verity_lakefront_unknown_house.s b/res/field/scripts/scripts_verity_lakefront_unknown_house.s deleted file mode 100644 index 3be12a9067..0000000000 --- a/res/field/scripts/scripts_verity_lakefront_unknown_house.s +++ /dev/null @@ -1,11 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/verity_lakefront_unknown_house.h" - - - ScriptEntry _0006 - ScriptEntryEnd - -_0006: - BufferPlayerName 0 - NPCMessage 0 - End diff --git a/res/field/scripts/scripts_victory_road_1f_room_2.s b/res/field/scripts/scripts_victory_road_1f_room_2.s index bbd553f74a..d29ac9a1c7 100644 --- a/res/field/scripts/scripts_victory_road_1f_room_2.s +++ b/res/field/scripts/scripts_victory_road_1f_room_2.s @@ -3,9 +3,9 @@ #include "res/field/events/events_victory_road_1f_room_2.h" - ScriptEntry VictoryRoad1FRoom2_TriggerStartFollowingMarley - ScriptEntry VictoryRoad1FRoom2_TriggerPlayerLeaveMarley - ScriptEntry VictoryRoad1FRoom2_TriggerMarleyLeavePlayer + ScriptEntry VictoryRoad1FRoom2_CoordEvent_StartFollowingMarley + ScriptEntry VictoryRoad1FRoom2_CoordEvent_PlayerLeaveMarley + ScriptEntry VictoryRoad1FRoom2_CoordEvent_MarleyLeavePlayer ScriptEntry VictoryRoad1FRoom2_OnTransition ScriptEntryEnd @@ -17,7 +17,7 @@ VictoryRoad1FRoom2_ResetFollowerMarleyState: SetVar VAR_VICTORY_ROAD_1F_ROOM_2_FOLLOWER_MARLEY_STATE, 0 End -VictoryRoad1FRoom2_TriggerStartFollowingMarley: +VictoryRoad1FRoom2_CoordEvent_StartFollowingMarley: LockAll SetPlayerBike FALSE ApplyMovement LOCALID_MARLEY, VictoryRoad1FRoom2_Movement_MarleyNoticePlayer @@ -129,7 +129,7 @@ VictoryRoad1FRoom2_Movement_MarleyWalkToPlayerZ60: WalkNormalWest EndMovement -VictoryRoad1FRoom2_TriggerPlayerLeaveMarley: +VictoryRoad1FRoom2_CoordEvent_PlayerLeaveMarley: LockAll ApplyMovement LOCALID_PLAYER, VictoryRoad1FRoom2_Movement_PlayerWalkOnSpotEast ApplyMovement LOCALID_MARLEY, VictoryRoad1FRoom2_Movement_MarleyFaceWest @@ -187,7 +187,7 @@ VictoryRoad1FRoom2_Movement_PlayerWalkOnSpotEast: WalkOnSpotNormalEast EndMovement -VictoryRoad1FRoom2_UnusedMovement: +VictoryRoad1FRoom2_Movement_Unused: WalkNormalNorth EndMovement @@ -236,7 +236,7 @@ VictoryRoad1FRoom2_Movement_MarleyFaceWest: FaceWest EndMovement -VictoryRoad1FRoom2_TriggerMarleyLeavePlayer: +VictoryRoad1FRoom2_CoordEvent_MarleyLeavePlayer: LockAll ClearHasPartner SetMovementType LOCALID_MARLEY, MOVEMENT_TYPE_LOOK_NORTH diff --git a/res/field/scripts/scripts_villa.s b/res/field/scripts/scripts_villa.s index b1e1f53bb4..55c2feed41 100644 --- a/res/field/scripts/scripts_villa.s +++ b/res/field/scripts/scripts_villa.s @@ -19,10 +19,10 @@ ScriptEntry Villa_Cynthia ScriptEntry Villa_Flint ScriptEntry Villa_MayleneAndCandice - ScriptEntry Villa_TriggerFantina - ScriptEntry Villa_TriggerCrasherWake - ScriptEntry Villa_TriggerCandice - ScriptEntry Villa_TriggerCynthia + ScriptEntry Villa_CoordEvent_Fantina + ScriptEntry Villa_CoordEvent_CrasherWake + ScriptEntry Villa_CoordEvent_Candice + ScriptEntry Villa_CoordEvent_Cynthia ScriptEntry Villa_Furniture_Table ScriptEntry Villa_Furniture_BigSofa ScriptEntry Villa_Furniture_SmallSofa @@ -43,9 +43,9 @@ ScriptEntry Villa_Furniture_Masterpiece ScriptEntry Villa_Furniture_TeaSet ScriptEntry Villa_Furniture_Chandelier - ScriptEntry Villa_OnFrameFirstEntry + ScriptEntry Villa_OnFrame_FirstEntry ScriptEntry Villa_SchoolKidM - ScriptEntry Villa_TriggerDontGoYet + ScriptEntry Villa_CoordEvent_DontGoYet ScriptEntry Villa_OrderForm ScriptEntryEnd @@ -795,7 +795,7 @@ Villa_VisitorEnd: ReleaseAll End -Villa_TriggerFantina: +Villa_CoordEvent_Fantina: LockAll PlaySE SEQ_SE_DP_DOOR_OPEN ClearFlag FLAG_HIDE_VILLA_FANTINA @@ -826,7 +826,7 @@ Villa_Movement_FantinaEnter: WalkNormalWest 3 EndMovement -Villa_TriggerCrasherWake: +Villa_CoordEvent_CrasherWake: LockAll PlaySE SEQ_SE_DP_DOOR_OPEN ClearFlag FLAG_HIDE_VILLA_CRASHER_WAKE @@ -855,7 +855,7 @@ Villa_Movement_PlayerWatchWakeEnter: WalkOnSpotNormalEast EndMovement -Villa_TriggerCandice: +Villa_CoordEvent_Candice: LockAll PlaySE SEQ_SE_DP_DOOR_OPEN ClearFlag FLAG_HIDE_VILLA_CANDICE @@ -886,7 +886,7 @@ Villa_Movement_PlayerWatchCandiceEnter: WalkOnSpotNormalWest EndMovement -Villa_TriggerCynthia: +Villa_CoordEvent_Cynthia: LockAll PlaySE SEQ_SE_DP_DOOR_OPEN ClearFlag FLAG_HIDE_VILLA_CYNTHIA @@ -1099,7 +1099,7 @@ Villa_Furniture_End: ReleaseAll End -Villa_OnFrameFirstEntry: +Villa_OnFrame_FirstEntry: LockAll SetVar VAR_VILLA_STATE, 1 ShowMoney 21, 1 @@ -1488,7 +1488,7 @@ Villa_Movement_SchoolKidMFacePlayer: WalkOnSpotNormalEast EndMovement -Villa_UnusedMovement: +Villa_Movement_Unused: WalkNormalSouth 3 WalkNormalEast WalkOnSpotNormalSouth @@ -1534,7 +1534,7 @@ Villa_TryEnterFurnitureVisitor: CallIfEq VAR_0x8002, VILLA_FURNITURE_PIANO, Villa_EnterPianoCynthia Return -Villa_TriggerDontGoYet: +Villa_CoordEvent_DontGoYet: LockAll ApplyMovement LOCALID_SCHOOL_KID_M, Villa_Movement_SchoolKidMWalkOnSpotSouth WaitMovement diff --git a/res/field/scripts/scripts_vs_seeker.s b/res/field/scripts/scripts_vs_seeker.s index bcb3b6f23b..e894d702b0 100644 --- a/res/field/scripts/scripts_vs_seeker.s +++ b/res/field/scripts/scripts_vs_seeker.s @@ -2,36 +2,36 @@ #include "res/text/bank/vs_seeker.h" - ScriptEntry _0006 + ScriptEntry VsSeeker_Use ScriptEntryEnd -_0006: +VsSeeker_Use: SetVar VAR_RESULT, 0 - ScrCmd_20A VAR_RESULT + StartVsSeeker VAR_RESULT SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0043 - GoToIfEq VAR_0x8008, 1, _0047 - GoToIfEq VAR_0x8008, 2, _0050 - GoTo _0059 + GoToIfEq VAR_0x8008, VS_SEEKER_USE_RESULT_OK, VsSeeker_OK + GoToIfEq VAR_0x8008, VS_SEEKER_USE_RESULT_NO_BATTERY, VsSeeker_NoBattery + GoToIfEq VAR_0x8008, VS_SEEKER_USE_RESULT_NO_TRAINERS, VsSeeker_NoTrainers + GoTo VsSeeker_NoTrainersReadyToBattle -_0043: +VsSeeker_OK: ReleaseAll End -_0047: - Message 0 - GoTo _0068 +VsSeeker_NoBattery: + Message VsSeeker_Text_BatteryIsntChargedEnough + GoTo VsSeeker_End -_0050: - Message 1 - GoTo _0068 +VsSeeker_NoTrainers: + Message VsSeeker_Text_NoTrainersWithinRange + GoTo VsSeeker_End -_0059: +VsSeeker_NoTrainersReadyToBattle: WaitTime 30, VAR_RESULT - Message 2 - GoTo _0068 + Message VsSeeker_Text_NoTrainersReadyToBattle + GoTo VsSeeker_End -_0068: +VsSeeker_End: WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_wayward_cave_1f.s b/res/field/scripts/scripts_wayward_cave_1f.s index a231de1833..06c635086a 100644 --- a/res/field/scripts/scripts_wayward_cave_1f.s +++ b/res/field/scripts/scripts_wayward_cave_1f.s @@ -5,8 +5,8 @@ ScriptEntry WaywardCave1F_OnTransition ScriptEntry WaywardCave1F_Mira - ScriptEntry WaywardCave1F_Unused - ScriptEntry WaywardCave1F_TriggerExit + ScriptEntry WaywardCave1F_Dummy3 + ScriptEntry WaywardCave1F_CoordEvent_Exit ScriptEntryEnd WaywardCave1F_OnTransition: @@ -76,10 +76,10 @@ WaywardCave1F_IncreaseFollowerMiraTimesTalked: ReleaseAll End -WaywardCave1F_Unused: +WaywardCave1F_Dummy3: End -WaywardCave1F_TriggerExit: +WaywardCave1F_CoordEvent_Exit: LockAll ClearHasPartner SetMovementType LOCALID_MIRA, MOVEMENT_TYPE_LOOK_WEST @@ -148,12 +148,12 @@ WaywardCave1F_Movement_PlayerWalkEastOnSpotWest: WalkOnSpotNormalWest EndMovement -WaywardCave1F_UnusedMovement: +WaywardCave1F_Movement_Unused: Delay8 5 WalkNormalWest EndMovement -WaywardCave1F_UnusedMovement2: +WaywardCave1F_Movement_Unused2: Delay8 5 WalkNormalNorth WalkOnSpotNormalWest diff --git a/res/field/scripts/scripts_wifi_plaza_entrance.s b/res/field/scripts/scripts_wifi_plaza_entrance.s index 01801b5bb7..822309fade 100644 --- a/res/field/scripts/scripts_wifi_plaza_entrance.s +++ b/res/field/scripts/scripts_wifi_plaza_entrance.s @@ -72,7 +72,7 @@ WifiPlazaEntrance_TakeWarpPanel: SetVar VAR_0x8004, VAR_RESULT ScrCmd_2F7 VAR_0x8004 ReturnToField - SetVar VAR_UNK_0x4080, 1 + SetVar VAR_ENTERED_WIFI_PLAZA, 1 HideObject LOCALID_PLAYER FadeScreenIn WaitFadeScreen diff --git a/res/text/berry_trees.json b/res/text/berry_trees.json index a32329a913..c6501cd249 100644 --- a/res/text/berry_trees.json +++ b/res/text/berry_trees.json @@ -53,7 +53,7 @@ ] }, { - "id": "BerryTrees_Text_BerryWasPlantedInSoftSoil", + "id": "BerryTrees_Text_BerryWasPlantedInSoil", "en_US": [ "The {STRVAR_1 8, 0, 0} was planted\n", "in the soft, earthy soil." @@ -104,7 +104,7 @@ "en_US": "There! All happy!" }, { - "id": "BerryTrees_Text_ThereAreBerriesWantToPickThem", + "id": "BerryTrees_Text_WantToPickBerries", "en_US": [ "There are {STRVAR_1 51, 1, 0} {STRVAR_1 8, 0, 0}!\n", "Want to pick them?" @@ -119,7 +119,7 @@ "en_US": "NO" }, { - "id": "BerryTrees_Text_PlayerLeftBerriesWhereTheyWere", + "id": "BerryTrees_Text_PlayerLeftBerries", "en_US": [ "{STRVAR_1 3, 0, 0} left the {STRVAR_1 8, 1, 0}\n", "where they were." @@ -130,14 +130,14 @@ "en_US": "You picked the {STRVAR_1 51, 1, 0} {STRVAR_1 8, 0, 0}.\r" }, { - "id": "BerryTrees_Text_BagIsFullBerriesCouldntBeTaken", + "id": "BerryTrees_Text_BagIsFull", "en_US": [ "Your Bag is full.\n", "The {STRVAR_1 8, 0, 0} couldn’t be taken." ] }, { - "id": "BerryTrees_Text_PlayerPutAwayBerriesInBagPocket", + "id": "BerryTrees_Text_PlayerPutBerriesInPocket", "en_US": [ "{STRVAR_1 3, 0, 0} put away the {STRVAR_1 8, 1, 0}\n", "in the Bag’s {STRVAR_1 18, 3, 0} Pocket.\r", @@ -150,11 +150,11 @@ "en_US": "It’s soft, earthy soil." }, { - "id": "BerryTrees_Text_MulchHasBeenLaidDownAfterHarvest", + "id": "BerryTrees_Text_MulchLaidDownAfterHarvest", "en_US": "{STRVAR_1 8, 0, 0} has been laid down." }, { - "id": "BerryTrees_Text_MulchWasScatteredOnSoilAfterHarvest", + "id": "BerryTrees_Text_MulchWasScatteredAfterHarvest", "en_US": [ "The {STRVAR_1 8, 0, 0} was scattered\n", "on the soil." @@ -168,35 +168,35 @@ ] }, { - "id": "BerryTrees_Text_BerryPlantHasSproutedAfterHarvest", + "id": "BerryTrees_Text_PlantHasSproutedAfterHarvest", "en_US": [ "The {STRVAR_1 8, 0, 0} Berry Plant\n", "has sprouted." ] }, { - "id": "BerryTrees_Text_BerryPlantIsGrowingBiggerAfterHarvest", + "id": "BerryTrees_Text_PlantIsGrowingAfterHarvest", "en_US": [ "The {STRVAR_1 8, 0, 0} Plant is growing\n", "bigger." ] }, { - "id": "BerryTrees_Text_BerryPlantIsInBloomAfterHarvest", + "id": "BerryTrees_Text_PlantIsInBloomAfterHarvest", "en_US": [ "This {STRVAR_1 8, 0, 0} Plant is\n", "in bloom!" ] }, { - "id": "BerryTrees_Text_ThereIsBerryWantToPickIt", + "id": "BerryTrees_Text_WantToPickBerry", "en_US": [ "There is {STRVAR_1 8, 0, 0}!\n", "Want to pick it?" ] }, { - "id": "BerryTrees_Text_PlayerLeftBerryWhereItWas", + "id": "BerryTrees_Text_PlayerLeftBerry", "en_US": [ "{STRVAR_1 3, 0, 0} left the {STRVAR_1 8, 1, 0}\n", "where it was." diff --git a/res/text/common_strings.json b/res/text/common_strings.json index 4baaa895d9..f2e17149bf 100644 --- a/res/text/common_strings.json +++ b/res/text/common_strings.json @@ -77,7 +77,7 @@ "en_US": "We hope to see you again!" }, { - "id": "CommonStrings_Text_PokecenterYourPokemonMayBeInfected", + "id": "CommonStrings_Text_PokecenterPokemonMayBeInfected", "en_US": [ "Your Pokémon may be infected with\n", "the Pokérus.\r", @@ -215,14 +215,14 @@ ] }, { - "id": "CommonStrings_Text_PutItemInThePocketNoLineFeed", + "id": "CommonStrings_Text_PutItemInPocket", "en_US": [ "{STRVAR_1 3, 0, 0} put the {STRVAR_1 8, 1, 0}\n", "in the {COLOR 2}{STRVAR_1 31, 2, 0}{COLOR 0} Pocket." ] }, { - "id": "CommonStrings_Text_PutAwayItemInTheFashionCaseNoLineFeed", + "id": "CommonStrings_Text_PutItemInFashionCase", "en_US": [ "{STRVAR_1 3, 0, 0} put away the\n", "{STRVAR_1 31, 1, 0} in the Fashion Case." @@ -321,7 +321,7 @@ ] }, { - "id": "CommonStrings_Text_PokecenterFirstLetsRestoreYourPokemon", + "id": "CommonStrings_Text_PokecenterFirstRestorePokemon", "en_US": [ "First, let’s restore your Pokémon\n", "to full health." @@ -831,14 +831,14 @@ ] }, { - "id": "CommonStrings_Text_PutItemInThePocket", + "id": "CommonStrings_Text_PutItemInPocket_ArrowPrompt", "en_US": [ "{STRVAR_1 3, 0, 0} put the {STRVAR_1 8, 1, 0}\n", "in the {COLOR 2}{STRVAR_1 27, 2, 0}{COLOR 0} Pocket.\r" ] }, { - "id": "CommonStrings_Text_PutAwayItemInTheFashionCase", + "id": "CommonStrings_Text_PutItemInFashionCase_ArrowPrompt", "en_US": [ "{STRVAR_1 3, 0, 0} put away the\n", "{STRVAR_1 31, 1, 0} in the Fashion Case.\r" diff --git a/res/text/contest_hall_lobby.json b/res/text/contest_hall_lobby.json index 8546d3ca75..1190f5e5b4 100644 --- a/res/text/contest_hall_lobby.json +++ b/res/text/contest_hall_lobby.json @@ -18,7 +18,7 @@ ] }, { - "id": "ContestHallLobby_Text_IveNeverSpokenToPlayerAboutContests", + "id": "ContestHallLobby_Text_NeverSpokenAboutContests", "en_US": [ "Mom: Oh, I don’t know about that.\r", "I’ve never spoken to {STRVAR_1 3, 0, 0}\n", @@ -28,7 +28,7 @@ ] }, { - "id": "ContestHallLobby_Text_INeedToThankYouForEarlier", + "id": "ContestHallLobby_Text_ThankYouForEarlier", "en_US": [ "Keira: Oh, yes, that’s right!\r", "I need to thank you for earlier.\n", @@ -36,7 +36,7 @@ ] }, { - "id": "ContestHallLobby_Text_PutThatAccessoryOnYourPokemon", + "id": "ContestHallLobby_Text_PutAccessoryOnPokemon", "en_US": [ "Keira: Put that Accessory on your\n", "Pokémon before a Contest.\r", @@ -53,7 +53,7 @@ "en_US": "OK, Johanna, I’ll see you!\r" }, { - "id": "ContestHallLobby_Text_WereYouSurprisedToSeeMe", + "id": "ContestHallLobby_Text_WereYouSurprised", "en_US": [ "Mom: Were you surprised to see me,\n", "{STRVAR_1 3, 0, 0}?\r", @@ -142,7 +142,7 @@ ] }, { - "id": "ContestHallLobby_Text_TheMildPoffinWasPutAway", + "id": "ContestHallLobby_Text_MildPoffinWasPutAway", "en_US": [ "The Mild Poffin was put away\n", "in the Poffin Case.\r" @@ -175,7 +175,7 @@ ] }, { - "id": "ContestHallLobby_Text_ItTakesPracticeToWinContests", + "id": "ContestHallLobby_Text_TakesPracticeToWin", "en_US": [ "Like everything else, the basics are\n", "important.\r", @@ -190,7 +190,7 @@ ] }, { - "id": "ContestHallLobby_Text_IllGiveItToYouAnotherTime", + "id": "ContestHallLobby_Text_IllGiveItAnotherTime", "en_US": [ "Oh, no.\n", "Your Poffin Case is full.\f", @@ -213,7 +213,7 @@ ] }, { - "id": "ContestHallLobby_Text_AContestHasVisualDanceAndActingParts", + "id": "ContestHallLobby_Text_ContestHasParts", "en_US": [ "A Contest has three parts: Visual!\n", "Dance! And Acting!\r", @@ -222,7 +222,7 @@ ] }, { - "id": "ContestHallLobby_Text_TheyPutUpPhotosOfTheWinners", + "id": "ContestHallLobby_Text_PhotosOfWinners", "en_US": "They put up photos of the winners!" }, { diff --git a/res/text/contest_hall_stage_no_contest.json b/res/text/contest_hall_stage_no_contest.json index 112a3ecbbd..30d939fd61 100644 --- a/res/text/contest_hall_stage_no_contest.json +++ b/res/text/contest_hall_stage_no_contest.json @@ -2,7 +2,7 @@ "key": 35850, "messages": [ { - "id": "ContestHallStageNoContest_Text_ForTheVisualJudgingDressUpYourPokemon", + "id": "ContestHallStageNoContest_Text_DressUpYourPokemon", "en_US": [ "For the Visual judging, you want to\n", "dress up your Pokémon nicely with\f", @@ -12,7 +12,7 @@ ] }, { - "id": "ContestHallStageNoContest_Text_ForTheDanceCompetitionMimicTheLeadDancer", + "id": "ContestHallStageNoContest_Text_MimicTheLeadDancer", "en_US": [ "For the Dance competition, your\n", "Pokémon needs to perfectly mimic\f", @@ -20,7 +20,7 @@ ] }, { - "id": "ContestHallStageNoContest_Text_ForThePerformancePokemonNeedTheRightMoves", + "id": "ContestHallStageNoContest_Text_PokemonNeedTheRightMoves", "en_US": [ "For the performance aspect of\n", "Contests, Pokémon need the right\f", @@ -33,7 +33,7 @@ ] }, { - "id": "ContestHallStageNoContest_Text_AtTheCoolContestPullOffACoolMove", + "id": "ContestHallStageNoContest_Text_PullOffACoolMove", "en_US": [ "At the Cool Contest you gotta pull\n", "off a cool move!\f", diff --git a/res/text/cycle_shop.json b/res/text/cycle_shop.json index c33c7d3fdc..c66c4c482c 100644 --- a/res/text/cycle_shop.json +++ b/res/text/cycle_shop.json @@ -2,7 +2,7 @@ "key": 5123, "messages": [ { - "id": "CycleShop_Text_ThanksForRescuingMeThisIsSomethingToShowMyThanks", + "id": "CycleShop_Text_ThanksForRescuingMe", "en_US": [ "Thanks for rescuing me!\n", "This is something to show my thanks!\r", @@ -11,7 +11,7 @@ ] }, { - "id": "CycleShop_Text_ThisIsTheLatestModelSoIllReadTheOperatingManualToYou", + "id": "CycleShop_Text_IllReadOperatingManual", "en_US": [ "It’s the latest model, so I’ll read\n", "the operating manual to you.\r", @@ -28,7 +28,7 @@ "en_US": "CLEFAIRY: Pip piih!" }, { - "id": "CycleShop_Text_TheManagersGoneOffToTheTeamGalacticBuildingAndHasntReturned", + "id": "CycleShop_Text_ManagersGoneOff", "en_US": [ "The manager’s gone off to the Team\n", "Galactic building and hasn’t returned.\r", @@ -36,14 +36,14 @@ ] }, { - "id": "CycleShop_Text_WhatWasTeamGalacticTryingToDoWithOtherPeoplesPokemon", + "id": "CycleShop_Text_WhatWasTeamGalacticTrying", "en_US": [ "What was Team Galactic trying to do\n", "with other people’s Pokémon?" ] }, { - "id": "CycleShop_Text_ThereIsAManualOnTheLatestModelBicycle", + "id": "CycleShop_Text_ManualOnLatestBicycle", "en_US": [ "There is a manual on the latest\n", "model Bicycle.\r", @@ -54,7 +54,7 @@ ] }, { - "id": "CycleShop_Text_TheresACatalogFromTheHoennRegionOnItsPopularBikes", + "id": "CycleShop_Text_CatalogFromHoenn", "en_US": [ "There’s a catalog from the Hoenn region\n", "on its popular Bikes...\r", diff --git a/res/text/eterna_city.json b/res/text/eterna_city.json index 3afc823174..f2b88f32ab 100644 --- a/res/text/eterna_city.json +++ b/res/text/eterna_city.json @@ -6,7 +6,7 @@ "en_US": "{SIZE 200}Thud!!{SIZE 100}\r" }, { - "id": "EternaCity_Text_YouCameToSeeThePokemonStatueRight", + "id": "EternaCity_Text_YouCameToSeeStatue", "en_US": [ "{STRVAR_1 3, 0, 0}: Hey, {STRVAR_1 3, 1, 0}!\r", "You came to see the Pokémon statue,\n", @@ -18,7 +18,7 @@ "en_US": "{STRVAR_1 3, 0, 0}: What the...\r" }, { - "id": "EternaCity_Text_SoThisIsEternasPokemonStatue", + "id": "EternaCity_Text_SoThisIsEternasStatue", "en_US": [ "Cyrus: ...So, this is Eterna’s Pokémon\n", "statue...\r", @@ -38,7 +38,7 @@ ] }, { - "id": "EternaCity_Text_GoCheckOutThePokemonStatueSeeYouAround", + "id": "EternaCity_Text_GoCheckOutStatueSeeYou", "en_US": [ "{STRVAR_1 3, 0, 0}: Oh, hey!\r", "When we smacked together, a brilliant\n", @@ -56,7 +56,7 @@ ] }, { - "id": "EternaCity_Text_OhThatDeviceYouHaveItIsAPokedex", + "id": "EternaCity_Text_OhYouHaveAPokedex", "en_US": [ "Oh, that device you have...\r", "It is a Pokédex?\n", @@ -72,7 +72,7 @@ ] }, { - "id": "EternaCity_Text_TryUsingThisItShouldBeHelpful", + "id": "EternaCity_Text_TryUsingThis", "en_US": [ "Here in Eterna City, there is a statue\n", "of an ancient Pokémon.\r", @@ -87,7 +87,7 @@ ] }, { - "id": "EternaCity_Text_RememberTheHiddenMoveCutCanBeUsedInTheField", + "id": "EternaCity_Text_CutCanBeUsedInField", "en_US": [ "Cynthia: Remember, the hidden move\n", "Cut can be used in the field.\r", @@ -101,7 +101,7 @@ ] }, { - "id": "EternaCity_Text_IWantedYouToHaveThisPokemonEggWillYouAcceptIt", + "id": "EternaCity_Text_WillYouAcceptEgg", "en_US": [ "Cynthia: Oh, there you are!\r", "I was looking for you.\n", @@ -111,7 +111,7 @@ ] }, { - "id": "EternaCity_Text_ThatsWonderfulThePokemonInsideTheEggIsHappyToo", + "id": "EternaCity_Text_ThatsWonderful", "en_US": [ "Cynthia: That’s wonderful!\r", "The Pokémon inside the Egg is\n", @@ -119,7 +119,7 @@ ] }, { - "id": "EternaCity_Text_OhYouDontHaveRoomForThisEgg", + "id": "EternaCity_Text_NoRoomForEgg", "en_US": [ "Cynthia: Oh?\n", "You have six Pokémon with you already.\f", @@ -132,7 +132,7 @@ ] }, { - "id": "EternaCity_Text_OhYouDontNeedToFeelObligated", + "id": "EternaCity_Text_DontFeelObligated", "en_US": [ "Cynthia: Oh...?\n", "You don’t need to feel obligated.\r", @@ -143,7 +143,7 @@ ] }, { - "id": "EternaCity_Text_DontLeaveWithoutThisPokemonEgg", + "id": "EternaCity_Text_DontLeaveWithoutEgg", "en_US": [ "Cynthia: Oh, wait!\r", "Don’t leave without this Pokémon Egg.\n", @@ -151,7 +151,7 @@ ] }, { - "id": "EternaCity_Text_WillYouAcceptThisPokemonEgg", + "id": "EternaCity_Text_WillYouAcceptThisEgg", "en_US": [ "Cynthia: Well?\n", "Will you accept this Pokémon Egg?" @@ -162,7 +162,7 @@ "garbage": 31 }, { - "id": "EternaCity_Text_KeepThatEggWithYouInYourPartyOfPokemon", + "id": "EternaCity_Text_KeepEggInYourParty", "en_US": [ "Cynthia: Keep that Egg with you in your\n", "party of Pokémon.\r", @@ -174,7 +174,7 @@ ] }, { - "id": "EternaCity_Text_HiImGardeniaImThisTownsGymLeader", + "id": "EternaCity_Text_ImThisTownsGymLeader", "en_US": [ "Hi! I’m Gardenia!\n", "I’m this town’s Gym Leader!\r", @@ -193,7 +193,7 @@ ] }, { - "id": "EternaCity_Text_HeyYouThereKidStayAwayFromThatPokemonStatue", + "id": "EternaCity_Text_StayAwayFromStatue", "en_US": [ "Hey! You there, kid!\n", "Stay away from that Pokémon statue!\r", @@ -202,7 +202,7 @@ ] }, { - "id": "EternaCity_Text_HeyYouYeahYouTrainer", + "id": "EternaCity_Text_IllLetYouKeepPokemon", "en_US": [ "Hey, you! Yeah, you, Trainer!\r", "Errr...\n", @@ -220,7 +220,7 @@ ] }, { - "id": "EternaCity_Text_SinceThatTeamGalacticBuildingWentUp", + "id": "EternaCity_Text_AtmosphereHasGottenCreepy", "en_US": [ "Since that Team Galactic building went\n", "up, the city’s atmosphere has gotten\f", @@ -230,14 +230,14 @@ ] }, { - "id": "EternaCity_Text_WithTeamGalacticGoneWhatsGoingToHappenToTheirBuilding", + "id": "EternaCity_Text_WhatWillHappenToGalacticBuilding", "en_US": [ "With Team Galactic gone, what’s going\n", "to happen to their building?" ] }, { - "id": "EternaCity_Text_MyFriendSaidTeamGalacticTookHisFavoritePokemonAway", + "id": "EternaCity_Text_GalacticTookFavoritePokemon", "en_US": [ "My friend said Team Galactic took his\n", "favorite Pokémon away.\r", @@ -247,7 +247,7 @@ ] }, { - "id": "EternaCity_Text_DoYouUseYourBikesKickstand", + "id": "EternaCity_Text_DoYouUseKickstand", "en_US": [ "Do you use your Bike’s kickstand?\r", "It looks cool to hop off your Bike and\n", @@ -255,7 +255,7 @@ ] }, { - "id": "EternaCity_Text_IfYoureVisitingEternaYouNeedToGetYourselfABicycle", + "id": "EternaCity_Text_GetYourselfABicycle", "en_US": [ "If you’re visiting Eterna, you need to\n", "get yourself a Bicycle and take a\f", @@ -263,7 +263,7 @@ ] }, { - "id": "EternaCity_Text_OhYourPokemonAreRatherFetching", + "id": "EternaCity_Text_PokemonAreRatherFetching", "en_US": [ "Oh, your Pokémon are rather fetching.\r", "Why, they look ready for Contests in\n", @@ -279,21 +279,21 @@ ] }, { - "id": "EternaCity_Text_EternaCitysNotAnythingLikeItWasBefore", + "id": "EternaCity_Text_EternaCitysNotLikeBefore", "en_US": [ "Eterna City’s not anything like it\n", "was before, way back in the day." ] }, { - "id": "EternaCity_Text_TheySayThisIsAnAwesomePokemonThatPeopleSawLongAgo", + "id": "EternaCity_Text_AwesomePokemonFromLongAgo", "en_US": [ "They say this is an awesome Pokémon\n", "that people saw long ago." ] }, { - "id": "EternaCity_Text_OhDontTellMeYouDontHaveAnExplorerKit", + "id": "EternaCity_Text_YouDontHaveExplorerKit_ArrowPrompt", "en_US": [ "Oh, don’t tell me you don’t have\n", "an Explorer Kit?\r", @@ -302,7 +302,7 @@ ] }, { - "id": "EternaCity_Text_OhDontTellMeYouDontHaveAnExplorerKit2", + "id": "EternaCity_Text_YouDontHaveExplorerKit", "en_US": [ "Oh, don’t tell me you don’t have\n", "an Explorer Kit?\r", @@ -311,14 +311,14 @@ ] }, { - "id": "EternaCity_Text_GoingUndergroundWithTheExplorerKitIsABlastIsntIt", + "id": "EternaCity_Text_GoingUndergroundIsABlast", "en_US": [ "Going underground with the Explorer\n", "Kit is a blast, isn’t it?" ] }, { - "id": "EternaCity_Text_OhWowYouGotABicycle", + "id": "EternaCity_Text_YouGotABicycle_ArrowPrompt", "en_US": [ "Oh, wow!\n", "You got a Bicycle!\r", @@ -329,7 +329,7 @@ ] }, { - "id": "EternaCity_Text_OhWowYouGotABicycle2", + "id": "EternaCity_Text_YouGotABicycle", "en_US": [ "Oh, wow!\n", "You got a Bicycle!\r", @@ -340,7 +340,7 @@ ] }, { - "id": "EternaCity_Text_ItFeelsGreatRidingABikeWithTheWindInYourFaceDoesntIt", + "id": "EternaCity_Text_FeelsGreatRidingABike", "en_US": [ "It feels great riding a Bike with the\n", "wind in your face, doesn’t it?" @@ -354,7 +354,7 @@ ] }, { - "id": "EternaCity_Text_EternaCityPokemonGymLeaderGardeniaMasterOfVividPlantPokemon", + "id": "EternaCity_Text_SignPokemonGym", "en_US": [ "Eterna City Pokémon Gym\n", "Leader: Gardenia\f", @@ -362,28 +362,28 @@ ] }, { - "id": "EternaCity_Text_RadRickshawsCycleShopGetOnAndRide", + "id": "EternaCity_Text_SignRadRickshawsCycleShop", "en_US": [ "Rad Rickshaw’s Cycle Shop\n", "Get On and Ride!" ] }, { - "id": "EternaCity_Text_TeamGalacticEternaBuildingWeWantYourPokemon", + "id": "EternaCity_Text_SignTeamGalacticEternaBuilding", "en_US": [ "Team Galactic Eterna Building\n", "We Want Your Pokémon!" ] }, { - "id": "EternaCity_Text_UndergroundMansHouseGoinDownForAdventure", + "id": "EternaCity_Text_SignUndergroundMansHouse", "en_US": [ "Underground Man’s House\n", "Goin’ Down for Adventure!" ] }, { - "id": "EternaCity_Text_EternaCondominiumsNameRatingServicesAvailable", + "id": "EternaCity_Text_SignEternaCondominiums", "en_US": [ "Eterna Condominiums\n", "Name-Rating Services Available" diff --git a/res/text/eterna_city_condominiums_1f.json b/res/text/eterna_city_condominiums_1f.json index cd27f44554..1fc93c1c49 100644 --- a/res/text/eterna_city_condominiums_1f.json +++ b/res/text/eterna_city_condominiums_1f.json @@ -2,7 +2,7 @@ "key": 37906, "messages": [ { - "id": "EternaCityCondominiums1F_Text_WantMeToRateTheNicknamesOfYourPokemon", + "id": "EternaCityCondominiums1F_Text_WantMeToRateNicknames", "en_US": [ "Hello, hello!\n", "I am the official Name Rater!\r", @@ -11,14 +11,14 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_WhichPokemonsNicknameShouldICritique", + "id": "EternaCityCondominiums1F_Text_CritiqueWhichNickname", "en_US": [ "Which Pokémon’s nickname should\n", "I critique?" ] }, { - "id": "EternaCityCondominiums1F_Text_WouldYouLikeToGiveItAnEvenBetterName", + "id": "EternaCityCondominiums1F_Text_GiveItABetterName", "en_US": [ "{STRVAR_1 1, 0, 0}, is it?\n", "That’s a decent nickname!\r", @@ -28,14 +28,14 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_AhGoodThenWhatShallTheNewNicknameBe", + "id": "EternaCityCondominiums1F_Text_WhatShallNewNicknameBe", "en_US": [ "Ah, good. Then, what shall the new\n", "nickname be?" ] }, { - "id": "EternaCityCondominiums1F_Text_ThisPokemonShallBeKnownAsNicknameItIsABetterNameThanBefore", + "id": "EternaCityCondominiums1F_Text_BetterNameThanBefore", "en_US": [ "Done! From now on, this Pokémon\n", "shall be known as {STRVAR_1 1, 0, 0}!\r", @@ -44,14 +44,14 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_ISeePleaseComeVisitAgain", + "id": "EternaCityCondominiums1F_Text_PleaseComeVisitAgain", "en_US": [ "I see.\n", "Please come visit again." ] }, { - "id": "EternaCityCondominiums1F_Text_ThisPokemonShallBeKnownAsNicknameItLooksNoDifferentFromBefore", + "id": "EternaCityCondominiums1F_Text_NoDifferentFromBefore", "en_US": [ "Done! From now on, this Pokémon\n", "shall be known as {STRVAR_1 1, 0, 0}!\r", @@ -61,7 +61,7 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_NicknameIsItThatIsATrulyImpeccableName", + "id": "EternaCityCondominiums1F_Text_TrulyImpeccableName", "en_US": [ "{STRVAR_1 1, 0, 0}, is it?\n", "That is a truly impeccable name!\r", @@ -69,14 +69,14 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_AnEggCanGoByNoOtherName", + "id": "EternaCityCondominiums1F_Text_CantNicknameEgg", "en_US": [ "Now, now. That is merely an Egg!\n", "An Egg can go by no other name!\n" ] }, { - "id": "EternaCityCondominiums1F_Text_DoYouGotThatPokemonNamedBuizelWannTradeItForMyChatot", + "id": "EternaCityCondominiums1F_Text_AskTradeBuizelForChatot", "en_US": [ "Excuse me, but do you got that\n", "Pokémon named BUIZEL?\r", @@ -95,7 +95,7 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_WhatITotallyWantIsABuizel", + "id": "EternaCityCondominiums1F_Text_IWantBuizel", "en_US": "What I totally want is a BUIZEL..." }, { @@ -108,7 +108,7 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_DidThatChatotITradedYouTotallyLearnThatChatterMove", + "id": "EternaCityCondominiums1F_Text_DidChatotLearnChatter", "en_US": [ "Did that CHATOT I traded you totally\n", "learn that Chatter move?\r", @@ -119,14 +119,14 @@ ] }, { - "id": "EternaCityCondominiums1F_Text_HiImTheBuildingSuperintented", + "id": "EternaCityCondominiums1F_Text_ImBuildingSuperintented", "en_US": [ "Hi! I’m the building superintendent.\n", "I maintain a vigilant 24-hour watch!" ] }, { - "id": "EternaCityCondominiums1F_Text_ImBuildingSuperintendentMantain24HourWatchZZZ", + "id": "EternaCityCondominiums1F_Text_Mantain24HourWatchZzz", "en_US": [ "I’m...building...superintendent...\n", "...maintain...24-hour watch... Zzz..." diff --git a/res/text/eterna_city_condominiums_2f.json b/res/text/eterna_city_condominiums_2f.json index 43c3de1bbc..68632a9855 100644 --- a/res/text/eterna_city_condominiums_2f.json +++ b/res/text/eterna_city_condominiums_2f.json @@ -2,7 +2,7 @@ "key": 37918, "messages": [ { - "id": "EternaCityCondominiums2F_Text_IveHadThisTMRecycleForSuchALongTimeNow", + "id": "EternaCityCondominiums2F_Text_HadTMLongTimeNow", "en_US": [ "I’ve had this TM Recycle for such\n", "a long time now.\r", @@ -13,7 +13,7 @@ ] }, { - "id": "EternaCityCondominiums2F_Text_FolksLikeMeHaveALongHistoryWeCanLookBackOn", + "id": "EternaCityCondominiums2F_Text_LongHistory", "en_US": [ "Folks like me have a long history\n", "we can look back on.\r", @@ -22,7 +22,7 @@ ] }, { - "id": "EternaCityCondominiums2F_Text_GardeniaOurGymLeaderGoesOutToEternaForestEverySoOften", + "id": "EternaCityCondominiums2F_Text_GardeniaGoesToEternaForest", "en_US": [ "Gardenia, our Gym Leader, goes out\n", "to Eterna Forest every so often.\r", @@ -30,7 +30,7 @@ ] }, { - "id": "EternaCityCondominiums2F_Text_TheMoveRecycleIsToBeUsedDuringBattle", + "id": "EternaCityCondominiums2F_Text_RecycleUsedDuringBattle", "en_US": [ "The move Recycle is to be used during\n", "battle.\r", diff --git a/res/text/eterna_city_condominiums_3f.json b/res/text/eterna_city_condominiums_3f.json index a86be6c86f..9de33e02f1 100644 --- a/res/text/eterna_city_condominiums_3f.json +++ b/res/text/eterna_city_condominiums_3f.json @@ -2,7 +2,7 @@ "key": 37914, "messages": [ { - "id": "EternaCityCondominiums3F_Text_IGatheredUpALotOfBerriesSoImTradingThemInForAccessories", + "id": "EternaCityCondominiums3F_Text_GatheredUpBerries", "en_US": [ "I gathered up a lot of Berries, so\n", "I’m trading them in for Accessories.\r", @@ -21,14 +21,14 @@ ] }, { - "id": "EternaCityCondominiums3F_Text_HahahaIveGotYouNowImGonnaTakeYourFlag", + "id": "EternaCityCondominiums3F_Text_ImGonnaTakeYourFlag", "en_US": [ "Hahaha! I’ve got you now!\n", "I’m gonna take your Flag!" ] }, { - "id": "EternaCityCondominiums3F_Text_YouCantCatchMeISetSomeTraps", + "id": "EternaCityCondominiums3F_Text_ISetSomeTraps", "en_US": [ "You can’t catch me!\n", "I set some Traps!" diff --git a/res/text/eterna_city_east_house.json b/res/text/eterna_city_east_house.json index 3f3a66a6f0..75c74eb9ed 100644 --- a/res/text/eterna_city_east_house.json +++ b/res/text/eterna_city_east_house.json @@ -2,7 +2,7 @@ "key": 5171, "messages": [ { - "id": "EternaCityEastHouse_Text_EternaCameToBeLongAgoInHonorOfAncientPokemon", + "id": "EternaCityEastHouse_Text_EternaCameToBeLongAgo", "en_US": [ "Eterna came to be long ago in honor\n", "of ancient Pokémon.\r", @@ -13,7 +13,7 @@ ] }, { - "id": "EternaCityEastHouse_Text_HaveYouSeenThePokemonStatue", + "id": "EternaCityEastHouse_Text_HaveYouSeenStatue", "en_US": [ "Have you seen the Pokémon statue?\r", "When I was a wee child, it used to be\n", @@ -21,7 +21,7 @@ ] }, { - "id": "EternaCityEastHouse_Text_SomeoneRippedOffTheDescriptivePlateFromThePokemonStatueWantToKnowWhatItSaid", + "id": "EternaCityEastHouse_Text_WantToKnowWhatPlateSaid", "en_US": [ "Sheesh! \n", "What’s the world coming to?!\r", @@ -33,7 +33,7 @@ ] }, { - "id": "EternaCityEastHouse_Text_TheFirstInscriptionWentLikeThisWantToHearAboutTheOtherInscription", + "id": "EternaCityEastHouse_Text_FirstInscriptionLikeThisHearOther", "en_US": [ "The first inscription went like this,\n", "sort of.\r", @@ -50,7 +50,7 @@ ] }, { - "id": "EternaCityEastHouse_Text_TheSecondInscriptionWentSortOfLikeThis", + "id": "EternaCityEastHouse_Text_SecondInscriptionWentLikeThis", "en_US": [ "The second inscription went sort of\n", "like this.\r", @@ -71,7 +71,7 @@ ] }, { - "id": "EternaCityEastHouse_Text_WellIfYoureNotInterestedDontFeelObligatedOrAnything", + "id": "EternaCityEastHouse_Text_DontFeelObligated", "en_US": [ "Well, if you’re not interested, don’t\n", "feel obligated or anything." diff --git a/res/text/eterna_city_herb_shop.json b/res/text/eterna_city_herb_shop.json index cd8e1d4841..d196fafdd3 100644 --- a/res/text/eterna_city_herb_shop.json +++ b/res/text/eterna_city_herb_shop.json @@ -17,7 +17,7 @@ ] }, { - "id": "EternaCityHerbShop_Text_NonBitterWouldBeMedicalBreakthrough", + "id": "EternaCityHerbShop_Text_InventNonBitterMedicine", "en_US": [ "Someone ought to invent herbal\n", "medicine that isn’t bitter.\r", diff --git a/res/text/eterna_city_pokecenter_1f.json b/res/text/eterna_city_pokecenter_1f.json index 6b13fbef79..8a89c8e26f 100644 --- a/res/text/eterna_city_pokecenter_1f.json +++ b/res/text/eterna_city_pokecenter_1f.json @@ -2,7 +2,7 @@ "key": 11027, "messages": [ { - "id": "EternaCityPokecenter1F_Text_WhenAPokemonFaintsItJustMeansItDoesntHaveThePowerToBattle", + "id": "EternaCityPokecenter1F_Text_FaintMeansNoPowerToBattle", "en_US": [ "When a Pokémon faints, it just means\n", "it doesn’t have the power to battle.\r", @@ -11,7 +11,7 @@ ] }, { - "id": "EternaCityPokecenter1F_Text_TeamGalacticTookMyPokemonAway", + "id": "EternaCityPokecenter1F_Text_TeamGalacticTookMyPokemon", "en_US": [ "Team Galactic took my Pokémon away.\n", "They took other people’s, too.\r", @@ -33,7 +33,7 @@ "en_US": "BUNEARY: Bunbun!" }, { - "id": "EternaCityPokecenter1F_Text_ThisPoketchAppWillShowHowCloseYourPokemonFeelToYou", + "id": "EternaCityPokecenter1F_Text_ShowHowClosePokemonFeel", "en_US": [ "Hi, you cute little Trainer!\n", "What kinds of Pokémon are with you?\r", @@ -42,14 +42,14 @@ ] }, { - "id": "EternaCityPokecenter1F_Text_IfYouSpendEnoughTimeWithThemAllPokemonWillOpenUpToYou", + "id": "EternaCityPokecenter1F_Text_PokemonWillOpenUp", "en_US": [ "If you spend enough time with them,\n", "all Pokémon will open up to you." ] }, { - "id": "EternaCityPokecenter1F_Text_WhatKindsOfPokemonAreWithYouOhYourPokemon", + "id": "EternaCityPokecenter1F_Text_OhYourPokemon", "en_US": [ "Hi, you cute little Trainer!\n", "What kinds of Pokémon are with you?\r", @@ -64,14 +64,14 @@ ] }, { - "id": "EternaCityPokecenter1F_Text_ItsBecomingComfortableAroundYouIThink", + "id": "EternaCityPokecenter1F_Text_ItsBecomingComfortable", "en_US": [ "It’s becoming comfortable around\n", "you, I think." ] }, { - "id": "EternaCityPokecenter1F_Text_HmmItNeedsToGetUsedToYouMore", + "id": "EternaCityPokecenter1F_Text_NeedsToGetUsedToYou", "en_US": [ "Hmm...\n", "It needs to get used to you more." diff --git a/res/text/eterna_city_pokecenter_2f.json b/res/text/eterna_city_pokecenter_2f.json index 4d7e38c5e4..4cc57a449a 100644 --- a/res/text/eterna_city_pokecenter_2f.json +++ b/res/text/eterna_city_pokecenter_2f.json @@ -2,7 +2,7 @@ "key": 11039, "messages": [ { - "id": "EternaCityPokecenter2F_Text_MultiBattlesAreTheUltimateInPulsePoundingAction", + "id": "EternaCityPokecenter2F_Text_MultiBattlesAreUltimateAction", "en_US": [ "Multi Battles are the ultimate in\n", "pulse-pounding action!\r", diff --git a/res/text/eterna_city_south_house.json b/res/text/eterna_city_south_house.json index 6362085cd0..38383d65a1 100644 --- a/res/text/eterna_city_south_house.json +++ b/res/text/eterna_city_south_house.json @@ -2,7 +2,7 @@ "key": 37946, "messages": [ { - "id": "EternaCitySouthHouse_Text_HowIsYourPokedexComingAlong", + "id": "EternaCitySouthHouse_Text_HowIsYourPokedex", "en_US": [ "Oak: Ah, it’s you! Good to see you!\n", "How is your Pokédex coming along?\r", @@ -12,7 +12,7 @@ ] }, { - "id": "EternaCitySouthHouse_Text_AnAcquaintanceFromKantoHasSentSomethingQuiteInteresting", + "id": "EternaCitySouthHouse_Text_AcquaintanceSentSomething", "en_US": [ "Oak: Ah, yes!\r", "An acquaintance from Kanto has sent\n", @@ -22,7 +22,7 @@ ] }, { - "id": "EternaCitySouthHouse_Text_IUnderstandThereIsAPokemonThatEvolvesWhenItIsTradedWhileHoldingThatUpGrade", + "id": "EternaCitySouthHouse_Text_PokemonThatEvolvesTradingWithUpgrade", "en_US": [ "I understand there is a Pokémon that\n", "evolves when it is traded while holding\f", @@ -30,7 +30,7 @@ ] }, { - "id": "EternaCitySouthHouse_Text_IveHeardThatThereHaveBeenSightingsOfArticunoZapdosAndMoltres", + "id": "EternaCitySouthHouse_Text_SightingsOfLegendaryBirds", "en_US": [ "Incidentally, and this is an entirely\n", "different topic...\r", @@ -45,7 +45,7 @@ ] }, { - "id": "EternaCitySouthHouse_Text_ArticunoZapdosAndMoltresAreExtremelyRareEvenInKanto", + "id": "EternaCitySouthHouse_Text_LegendaryBirdsExtremelyRare", "en_US": [ "Oak: ARTICUNO, ZAPDOS, and MOLTRES\n", "are extremely rare even in Kanto.\r", @@ -58,7 +58,7 @@ ] }, { - "id": "EternaCitySouthHouse_Text_YouveCaughtArticunoZapdosAndMoltresAllowMeToExamineYourPokedex", + "id": "EternaCitySouthHouse_Text_YouveCaughtLegendaryBirds", "en_US": [ "Oak: Ah, it’s you!\n", "How goes it?\r", diff --git a/res/text/eterna_city_underground_man_house.json b/res/text/eterna_city_underground_man_house.json index 13c6ab531b..99f6ad31d0 100644 --- a/res/text/eterna_city_underground_man_house.json +++ b/res/text/eterna_city_underground_man_house.json @@ -2,7 +2,7 @@ "key": 5195, "messages": [ { - "id": "EternaCityUndergroundManHouse_Text_YouCanCallMeTheUndergroundManIllMakeAGiftOfThisToYou", + "id": "EternaCityUndergroundManHouse_Text_CallMeUndergroundMan", "en_US": [ "I am! I am the first to have gone\n", "underground and dug some tunnels.\r", @@ -14,7 +14,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_LetMeMentorYouIntoBecomingAFullFledgedSpelunker", + "id": "EternaCityUndergroundManHouse_Text_MentorYouBecomingSpelunker", "en_US": [ "My gift to you, the Explorer Kit,\n", "will instantly take you underground!\r", @@ -29,7 +29,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_LetMeMentorYouAsYouBecomeAFullFledgedSpelunker", + "id": "EternaCityUndergroundManHouse_Text_MentorYouBecomeSpelunker", "en_US": [ "Let me mentor you as you become\n", "a full-fledged spelunker!\r", @@ -37,7 +37,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ICantForceYouToAcceptMyProposalIfYoureNotInclined", + "id": "EternaCityUndergroundManHouse_Text_CantForceAcceptProposal", "en_US": [ "I had hoped to teach a youngster\n", "like you about the many charms of\f", @@ -49,7 +49,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_IWillTeachYouByAssigningMissionsFirstGoUnderground", + "id": "EternaCityUndergroundManHouse_Text_FirstGoUnderground", "en_US": [ "Hm!\n", "Well said, my young friend!\r", @@ -62,7 +62,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ToGetDownToTheUndergroundTunnelsYouNeedOnlyToUseYourExplorerKit", + "id": "EternaCityUndergroundManHouse_Text_UseExplorerKit", "en_US": [ "You’ve not gone underground yet?\r", "To get down to the underground\n", @@ -74,7 +74,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ISeeThatYouveGoneDownToTheUndergroundTunnelsTakeTheseAsRewards", + "id": "EternaCityUndergroundManHouse_Text_YouveGoneDownToUnderground", "en_US": [ "Hm! I see that you’ve gone down to\n", "the underground tunnels!\r", @@ -95,7 +95,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ForMyNextTestIWantYouToDigUpSomeTreasureOrSpheresForMe", + "id": "EternaCityUndergroundManHouse_Text_DigUpTreasureOrSpheres", "en_US": [ "How was it in the underground\n", "tunnels?\r", @@ -113,7 +113,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouveNotLocatedAnyTreasureOrSpheresYet", + "id": "EternaCityUndergroundManHouse_Text_CheckRadarYellowSpots", "en_US": [ "You’ve not located any Treasure \n", "or Spheres yet?\r", @@ -129,7 +129,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouDugUpWhatIWasLookingForTakeTheseAsYourReward", + "id": "EternaCityUndergroundManHouse_Text_YouDugUpWhatIWasLookingFor", "en_US": [ "Ah! You dug up what I was looking for!\n", "Good job on finding it!\r", @@ -138,7 +138,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_DigInTheWallsOfTheUndergroundTunnelsToUnearthHiddenStuff", + "id": "EternaCityUndergroundManHouse_Text_DigInWalls", "en_US": [ "Dig in the walls of the underground\n", "tunnels to unearth hidden stuff.\r", @@ -152,7 +152,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_IWantYouToGoBuryTheseStrangeSpheresInTheUnderground", + "id": "EternaCityUndergroundManHouse_Text_BuryTheseSpheres", "en_US": [ "My tests aren’t over yet!\n", "Next, let’s use some Spheres!\r", @@ -166,7 +166,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouveNotBuriedTheSpheresYet", + "id": "EternaCityUndergroundManHouse_Text_GoBuryThoseSpheres", "en_US": [ "You’ve not buried the Spheres yet?\n", "You’re afraid of losing them?\r", @@ -179,7 +179,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouveBuriedYourSpheresThisIsYourReward", + "id": "EternaCityUndergroundManHouse_Text_YouveBuriedSpheres", "en_US": [ "Good, good!\n", "You’ve buried your Spheres!\r", @@ -192,7 +192,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouMayHaveSeenThemAlreadyButTheseAreSphereCollectors", + "id": "EternaCityUndergroundManHouse_Text_TheseAreSphereCollectors", "en_US": [ "You may have seen them already, but\n", "there are Sphere collectors.\r", @@ -204,7 +204,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YourNextAssignmentIsGoMakeYourOwnSecretBase", + "id": "EternaCityUndergroundManHouse_Text_GoMakeSecretBase", "en_US": [ "Have you grown weary of repeatedly\n", "going back to the Underground?\r", @@ -223,7 +223,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_HmYouDontKnowHowToUseTheDiggerDrill", + "id": "EternaCityUndergroundManHouse_Text_ExplainDiggerDrill", "en_US": [ "Hm? You don’t know how to use\n", "the Digger Drill?\r", @@ -240,7 +240,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AhYouveMadeYourSecretBaseTakeTheseAsYourReward", + "id": "EternaCityUndergroundManHouse_Text_YouveMadeSecretBase", "en_US": [ "Ah, you’ve made your Secret Base!\n", "Excellent!\r", @@ -251,7 +251,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_IncidentallyADiggerDrillCanBeUsedOnlyOnce", + "id": "EternaCityUndergroundManHouse_Text_DiggerDrillUsedOnlyOnce", "en_US": [ "Incidentally, a Digger Drill can\n", "be used only once.\r", @@ -264,7 +264,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ForMyFinalTestIWantYouToDecorateYourSecretBase", + "id": "EternaCityUndergroundManHouse_Text_DecorateSecretBase", "en_US": [ "Hm! You’ve stuck it out to the end!\n", "This is my final test.\r", @@ -279,7 +279,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AhHaveIFinallyManagedToStumpYou", + "id": "EternaCityUndergroundManHouse_Text_FinallyStumpedYou", "en_US": [ "Ah, have I finally managed to stump\n", "you?\r", @@ -295,7 +295,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AhYouveEvenManagedToDecorateYourSecretBaseThisIsYourReward", + "id": "EternaCityUndergroundManHouse_Text_YouveDecoratedSecretBase", "en_US": [ "Ah! You’ve even managed to decorate\n", "your Secret Base!\r", @@ -313,7 +313,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ThereAreWaysOfCollectingMoreDecorationGoods", + "id": "EternaCityUndergroundManHouse_Text_WaysOfCollectingMoreGoods", "en_US": [ "There are ways of collecting more\n", "decoration goods.\r", @@ -324,7 +324,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_IfYouInsistThereIsOneMoreThingIShouldTellYou", + "id": "EternaCityUndergroundManHouse_Text_OneMoreThing", "en_US": [ "I’ve taught you all I know, but if\n", "you insist, there is one more thing\f", @@ -340,7 +340,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_StealYourFriendsFlagIfYouCanDoThatIWillPermitYouToMoveBoulders", + "id": "EternaCityUndergroundManHouse_Text_StealYourFriendsFlag", "en_US": [ "...Hm! However, you are someone I’d\n", "recognized as a born spelunker...\r", @@ -361,7 +361,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_IfYouManageToStealAFlagYouBeSureToComeShowMe", + "id": "EternaCityUndergroundManHouse_Text_IfYouStealFlagShowMe", "en_US": [ "Ah! My spelunker!\n", "Are you spelunking with your friends?\r", @@ -373,7 +373,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_YouveCapturedAFlagThisIsYourReward", + "id": "EternaCityUndergroundManHouse_Text_CapturedAFlagReward", "en_US": [ "Wait! Don’t tell me!\n", "You’ve captured a Flag?\r", @@ -387,7 +387,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ThereReallyIsNothingElseThatICanTeachYou", + "id": "EternaCityUndergroundManHouse_Text_NothingElseICanTeachYou", "en_US": [ "There really is nothing else that\n", "I can teach you.\r", @@ -398,7 +398,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_SoMySpelunkerAreYouGoingUndergroundWithYourFriends", + "id": "EternaCityUndergroundManHouse_Text_AreYouGoingUnderground", "en_US": [ "So, my spelunker, are you going\n", "underground with your friends?\r", @@ -408,7 +408,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AhYouveCapturedThreeFlagsTakeThisAsYourReward", + "id": "EternaCityUndergroundManHouse_Text_CapturedThreeFlagsReward", "en_US": [ "Ah, you’ve captured three Flags!\r", "Well done!\n", @@ -416,7 +416,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AhYouveCapturedTenFlagsTakeThisAsYourReward", + "id": "EternaCityUndergroundManHouse_Text_CapturedTenFlagsReward", "en_US": [ "Ah, you’ve captured ten Flags!\r", "Well done!\n", @@ -424,7 +424,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_MyGoodnessYouveCapturedFiftyFlagsTakeThisAsYourReward", + "id": "EternaCityUndergroundManHouse_Text_CapturedFiftyFlagsReward", "en_US": [ "Oh! Oh! My goodness!\n", "You’ve captured fifty Flags!\r", @@ -433,7 +433,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_FromNowOnYouAreTheSpelunkingMaster", + "id": "EternaCityUndergroundManHouse_Text_YouAreSpelunkingMaster", "en_US": [ "You have been outstanding! There\n", "really is nothing left to teach you.\r", @@ -442,7 +442,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_OhYourUndergroundPCAppearsToBeFull", + "id": "EternaCityUndergroundManHouse_Text_UndergroundPCAppearsFull", "en_US": [ "Oh? Your underground PC appears\n", "to be full.\r", @@ -458,7 +458,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_TheUndergroundTunnelsGoEverywhere", + "id": "EternaCityUndergroundManHouse_Text_TunnelsGoEverywhere", "en_US": [ "The underground tunnels go\n", "everywhere!\r", @@ -468,7 +468,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_AllIEverUnearthAreArmorFossils", + "id": "EternaCityUndergroundManHouse_Text_AllIUnearthAreArmorFossils", "en_US": [ "All I ever unearth are Armor Fossils.\n", "My buddy only digs up Skull Fossils.\f", @@ -498,7 +498,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_OhYoudLikeMoreAdviceOnDiggingUpTreasureAndSpheres", + "id": "EternaCityUndergroundManHouse_Text_YoudLikeMoreAdvice", "en_US": [ "Oh, you’d like more advice on digging\n", "up Treasure and Spheres?\r", @@ -517,7 +517,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_NewAndOnSaleUndergroundRadar", + "id": "EternaCityUndergroundManHouse_Text_OnSaleUndergroundRadar", "en_US": [ "New and on sale!\n", "Underground Radar!\r", @@ -528,18 +528,18 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ShortcutToTheUndergroundIsOnTheScreen", + "id": "EternaCityUndergroundManHouse_Text_ShortcutToTheUnderground", "en_US": [ "“Shortcut to the Underground” is on\n", "the screen.\r" ] }, { - "id": "EternaCityUndergroundManHouse_Text_WhichHeadingWouldYouLikeToRead", + "id": "EternaCityUndergroundManHouse_Text_ReadWhichHeading", "en_US": "Which heading would you like to read?" }, { - "id": "EternaCityUndergroundManHouse_Text_AFlagCanBeFoundInEverySecretBase", + "id": "EternaCityUndergroundManHouse_Text_ExplainFlags", "en_US": [ "Flags: A Flag can be found in every\n", "Secret Base.\r", @@ -551,7 +551,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_InTheUndergroundTunnelsYouCanDigUpPrettyStonesThatAreCalledSpheres", + "id": "EternaCityUndergroundManHouse_Text_ExplainSpheres", "en_US": [ "Spheres: In the underground tunnels,\n", "you can dig up pretty stones that\f", @@ -566,7 +566,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_ThereAreTrapsThatCanBePutDownInTheUndergroundTunnels", + "id": "EternaCityUndergroundManHouse_Text_ExplainTraps", "en_US": [ "Traps: There are Traps that can be\n", "put down in the underground tunnels.\r", @@ -577,7 +577,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_GoodsAreFurnitureAndDecorativeItemsForSecretBases", + "id": "EternaCityUndergroundManHouse_Text_ExplainGoods", "en_US": [ "Goods: These are furniture and\n", "decorative items for Secret Bases.\r", @@ -586,7 +586,7 @@ ] }, { - "id": "EternaCityUndergroundManHouse_Text_TreasuresAreRareItemsThatAppearWhileDiggingUnderground", + "id": "EternaCityUndergroundManHouse_Text_ExplainTreasures", "en_US": [ "Treasure: These are rare items that\n", "appear while digging underground.\r", diff --git a/res/text/eterna_forest.json b/res/text/eterna_forest.json index fb80370a6f..d4ff387dc5 100644 --- a/res/text/eterna_forest.json +++ b/res/text/eterna_forest.json @@ -2,7 +2,7 @@ "key": 1026, "messages": [ { - "id": "EternaForest_Text_PleaseMayIGoThroughWithYou", + "id": "EternaForest_Text_MayIGoWithYou", "en_US": [ "Hello, my name’s Cheryl.\n", "And you are...?\r", @@ -27,14 +27,14 @@ ] }, { - "id": "EternaForest_Text_IllKeepYourPokemonInPerfectHealth", + "id": "EternaForest_Text_IllKeepPokemonHealthy", "en_US": [ "Cheryl: I’ll keep your Pokémon\n", "in perfect health." ] }, { - "id": "EternaForest_Text_LetsGetThroughThisForestTogether", + "id": "EternaForest_Text_LetsGetThroughForestTogether", "en_US": [ "Cheryl: Oh, hi, {STRVAR_1 3, 0, 0}!\n", "I’ve been waiting like I said.\r", @@ -50,7 +50,7 @@ ] }, { - "id": "EternaForest_Text_OhTheresTheExitThankYouSoMuchPlayer", + "id": "EternaForest_Text_ThankYouSoMuch", "en_US": [ "Cheryl: Oh! There’s the exit!\n", "I’m so relieved... We finally got here.\r", @@ -60,21 +60,21 @@ ] }, { - "id": "EternaForest_Text_ThisIsMyTokenOfAppreciation", + "id": "EternaForest_Text_TokenOfAppreciation", "en_US": [ "This is my token of appreciation.\n", "Please accept it!\r" ] }, { - "id": "EternaForest_Text_ImSureWellMeetAgainSomewhere", + "id": "EternaForest_Text_ImSureWellMeetAgain", "en_US": [ "I’m sure we’ll meet again somewhere!\n", "Bye for now!\r" ] }, { - "id": "EternaForest_Text_ThereIsAnOldChateauAhead", + "id": "EternaForest_Text_OldChateauAhead", "en_US": [ "Cheryl: There is an Old Chateau ahead.\r", "No one lives there now.\n", @@ -82,7 +82,7 @@ ] }, { - "id": "EternaForest_Text_ImSearchingForBugPokemonSoICanWinAtTheEternaGym", + "id": "EternaForest_Text_ImSearchingForBugPokemon", "en_US": [ "I’m searching for bug Pokémon so I can\n", "win at the Eterna Gym.\r", @@ -91,21 +91,21 @@ ] }, { - "id": "EternaForest_Text_TheRockIsCoveredInMoss", + "id": "EternaForest_Text_RockIsCoveredInMoss", "en_US": [ "The rock is covered in moss.\n", "It feels pleasantly cool." ] }, { - "id": "EternaForest_Text_HiyaWereYouIngriguedByTheRumorsGoingAroundToo", + "id": "EternaForest_Text_WereYouIngriguedByRumors", "en_US": [ "Gardenia: Hiya! Were you intrigued\n", "by the rumors going around, too?\r" ] }, { - "id": "EternaForest_Text_YouKnowPeopleveBeenTalkingAboutTheGhostPokemonOfTheOldChateau", + "id": "EternaForest_Text_GhostPokemonOfOldChateau", "en_US": [ "You know, people’ve been talking about\n", "the ghost Pokémon of the Old Chateau.\r", @@ -114,7 +114,7 @@ ] }, { - "id": "EternaForest_Text_IShouldCheckItOutMyselfButGoingInThereIs", + "id": "EternaForest_Text_GoodLuckWithInvestigation", "en_US": [ "I should check it out myself, but\n", "going in there is...\r", @@ -127,14 +127,14 @@ ] }, { - "id": "EternaForest_Text_TheEternaForestWhereTimeFlowsEternally", + "id": "EternaForest_Text_SignEternaForest", "en_US": [ "The Eterna Forest\n", "Where Time Flows Eternally" ] }, { - "id": "EternaForest_Text_TrainerTipsInForestsAndCavesThereAreManyItemsOnTheGround", + "id": "EternaForest_Text_TrainerTipsItemsOnGround", "en_US": [ "Trainer Tips!\r", "In forests and caves, there are many\n", diff --git a/res/text/eterna_forest_outside.json b/res/text/eterna_forest_outside.json index 03aeb3200a..7f903fc84b 100644 --- a/res/text/eterna_forest_outside.json +++ b/res/text/eterna_forest_outside.json @@ -2,14 +2,14 @@ "key": 51106, "messages": [ { - "id": "EternaForestOutside_Text_OhAreYouCollectingAccessoriesIveGotSomethingForYou", + "id": "EternaForestOutside_Text_AreYouCollectingAccessories", "en_US": [ "Oh, are you collecting Accessories?\n", "I’ve got something for you.\r" ] }, { - "id": "EternaForestOutside_Text_ICollectBerriesAndTradeThemForAccessoriesInFloaromaTown", + "id": "EternaForestOutside_Text_ITradeBerriesForAccessories", "en_US": [ "I collect Berries and trade them for\n", "Accessories in Floaroma Town.\r", diff --git a/res/text/unk_0443.json b/res/text/feelings.json similarity index 51% rename from res/text/unk_0443.json rename to res/text/feelings.json index 8e34edba28..40f4cc746e 100644 --- a/res/text/unk_0443.json +++ b/res/text/feelings.json @@ -2,191 +2,191 @@ "key": 65470, "messages": [ { - "id": "pl_msg_00000443_00000", + "id": "Feelings_Text_Beauty", "en_US": "BEAUTY" }, { - "id": "pl_msg_00000443_00001", + "id": "Feelings_Text_Delight", "en_US": "DELIGHT" }, { - "id": "pl_msg_00000443_00002", + "id": "Feelings_Text_Strangeness", "en_US": "STRANGENESS" }, { - "id": "pl_msg_00000443_00003", + "id": "Feelings_Text_Cleverness", "en_US": "CLEVERNESS" }, { - "id": "pl_msg_00000443_00004", + "id": "Feelings_Text_Disappointed", "en_US": "DISAPPOINTED" }, { - "id": "pl_msg_00000443_00005", + "id": "Feelings_Text_Coolness", "en_US": "COOLNESS" }, { - "id": "pl_msg_00000443_00006", + "id": "Feelings_Text_Sadness", "en_US": "SADNESS" }, { - "id": "pl_msg_00000443_00007", + "id": "Feelings_Text_Cuteness", "en_US": "CUTENESS" }, { - "id": "pl_msg_00000443_00008", + "id": "Feelings_Text_Anger", "en_US": "ANGER" }, { - "id": "pl_msg_00000443_00009", + "id": "Feelings_Text_Healthy", "en_US": "HEALTHY" }, { - "id": "pl_msg_00000443_00010", + "id": "Feelings_Text_Regret", "en_US": "REGRET" }, { - "id": "pl_msg_00000443_00011", + "id": "Feelings_Text_Happiness", "en_US": "HAPPINESS" }, { - "id": "pl_msg_00000443_00012", + "id": "Feelings_Text_Depressed", "en_US": "DEPRESSED" }, { - "id": "pl_msg_00000443_00013", + "id": "Feelings_Text_Incredible", "en_US": "INCREDIBLE" }, { - "id": "pl_msg_00000443_00014", + "id": "Feelings_Text_Likes", "en_US": "LIKES" }, { - "id": "pl_msg_00000443_00015", + "id": "Feelings_Text_Dislike", "en_US": "DISLIKE" }, { - "id": "pl_msg_00000443_00016", + "id": "Feelings_Text_Bored", "en_US": "BORED" }, { - "id": "pl_msg_00000443_00017", + "id": "Feelings_Text_Important", "en_US": "IMPORTANT" }, { - "id": "pl_msg_00000443_00018", + "id": "Feelings_Text_AllRight", "en_US": "ALL RIGHT" }, { - "id": "pl_msg_00000443_00019", + "id": "Feelings_Text_Adore", "en_US": "ADORE" }, { - "id": "pl_msg_00000443_00020", + "id": "Feelings_Text_Toughness", "en_US": "TOUGHNESS" }, { - "id": "pl_msg_00000443_00021", + "id": "Feelings_Text_Enjoyment", "en_US": "ENJOYMENT" }, { - "id": "pl_msg_00000443_00022", + "id": "Feelings_Text_Useless", "en_US": "USELESS" }, { - "id": "pl_msg_00000443_00023", + "id": "Feelings_Text_Drooling", "en_US": "DROOLING" }, { - "id": "pl_msg_00000443_00024", + "id": "Feelings_Text_Excited", "en_US": "EXCITED" }, { - "id": "pl_msg_00000443_00025", + "id": "Feelings_Text_Skillful", "en_US": "SKILLFUL" }, { - "id": "pl_msg_00000443_00026", + "id": "Feelings_Text_Tears", "en_US": "TEARS" }, { - "id": "pl_msg_00000443_00027", + "id": "Feelings_Text_Hate", "en_US": "HATE" }, { - "id": "pl_msg_00000443_00028", + "id": "Feelings_Text_ROFL", "en_US": "ROFL" }, { - "id": "pl_msg_00000443_00029", + "id": "Feelings_Text_Happy", "en_US": "HAPPY" }, { - "id": "pl_msg_00000443_00030", + "id": "Feelings_Text_Energetic", "en_US": "ENERGETIC" }, { - "id": "pl_msg_00000443_00031", + "id": "Feelings_Text_Surprise", "en_US": "SURPRISE" }, { - "id": "pl_msg_00000443_00032", + "id": "Feelings_Text_Nervous", "en_US": "NERVOUS" }, { - "id": "pl_msg_00000443_00033", + "id": "Feelings_Text_Want", "en_US": "WANT" }, { - "id": "pl_msg_00000443_00034", + "id": "Feelings_Text_Satisfied", "en_US": "SATISFIED" }, { - "id": "pl_msg_00000443_00035", + "id": "Feelings_Text_Rare", "en_US": "RARE" }, { - "id": "pl_msg_00000443_00036", + "id": "Feelings_Text_MessedUp", "en_US": "MESSED UP" }, { - "id": "pl_msg_00000443_00037", + "id": "Feelings_Text_NoWay", "en_US": "NO WAY" }, { - "id": "pl_msg_00000443_00038", + "id": "Feelings_Text_Danger", "en_US": "DANGER" }, { - "id": "pl_msg_00000443_00039", + "id": "Feelings_Text_LoveyDovey", "en_US": "LOVEY-DOVEY" }, { - "id": "pl_msg_00000443_00040", + "id": "Feelings_Text_Anticipation", "en_US": "ANTICIPATION" }, { - "id": "pl_msg_00000443_00041", + "id": "Feelings_Text_Smile", "en_US": "SMILE" }, { - "id": "pl_msg_00000443_00042", + "id": "Feelings_Text_Subtle", "en_US": "SUBTLE" }, { - "id": "pl_msg_00000443_00043", + "id": "Feelings_Text_Recommend", "en_US": "RECOMMEND" }, { - "id": "pl_msg_00000443_00044", + "id": "Feelings_Text_Simple", "en_US": "SIMPLE" }, { - "id": "pl_msg_00000443_00045", + "id": "Feelings_Text_Nice", "en_US": "NICE" }, { - "id": "pl_msg_00000443_00046", + "id": "Feelings_Text_Difficult", "en_US": "DIFFICULT" } ] diff --git a/res/text/unk_0447.json b/res/text/general_sentences.json similarity index 64% rename from res/text/unk_0447.json rename to res/text/general_sentences.json index d0cdaa3e89..7949650bbd 100644 --- a/res/text/unk_0447.json +++ b/res/text/general_sentences.json @@ -2,128 +2,128 @@ "key": 47894, "messages": [ { - "id": "pl_msg_00000447_00000", + "id": "GeneralSentences_Text_HelloBlank", "en_US": [ "Hello!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00001", + "id": "GeneralSentences_Text_ILoveBlank", "en_US": "I love {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000447_00002", + "id": "GeneralSentences_Text_ILoveBlankILoveBlankToo", "en_US": [ "I love {STRVAR_1 28, 0, 0}!\n", "I love {STRVAR_1 28, 1, 0}, too!" ] }, { - "id": "pl_msg_00000447_00003", + "id": "GeneralSentences_Text_ThisBlankIsBlankIsntIt", "en_US": [ "This {STRVAR_1 28, 0, 0} is\n", "{STRVAR_1 28, 1, 0}, isn’t it?" ] }, { - "id": "pl_msg_00000447_00004", + "id": "GeneralSentences_Text_ICanDoAnythingForBlank", "en_US": [ "I can do anything for\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00005", + "id": "GeneralSentences_Text_ThisBlankIsBlank", "en_US": [ "This {STRVAR_1 28, 0, 0} is\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00006", + "id": "GeneralSentences_Text_BlankIsTheRealBlank", "en_US": [ "{STRVAR_1 28, 0, 0} is the real\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00007", + "id": "GeneralSentences_Text_ItMightBeBlank", "en_US": "It might be {STRVAR_1 28, 0, 0}..." }, { - "id": "pl_msg_00000447_00008", + "id": "GeneralSentences_Text_TheresOnlyBlankLeft", "en_US": [ "There’s only {STRVAR_1 28, 0, 0}\n", "left!" ] }, { - "id": "pl_msg_00000447_00009", + "id": "GeneralSentences_Text_ItsBlankItsBlank", "en_US": [ "It’s {STRVAR_1 28, 0, 0}!\n", "It’s {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00010", + "id": "GeneralSentences_Text_IPreferBlankAfterAll", "en_US": [ "I prefer {STRVAR_1 28, 0, 0}\n", "after all!" ] }, { - "id": "pl_msg_00000447_00011", + "id": "GeneralSentences_Text_IsBlankBlank", "en_US": [ "Is {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}?" ] }, { - "id": "pl_msg_00000447_00012", + "id": "GeneralSentences_Text_DoYouLikeBlank", "en_US": "Do you like {STRVAR_1 28, 0, 0}?" }, { - "id": "pl_msg_00000447_00013", + "id": "GeneralSentences_Text_WhatDoYouThinkOfBlank", "en_US": [ "What do you think of\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000447_00014", + "id": "GeneralSentences_Text_BlankIsSoBlank", "en_US": [ "{STRVAR_1 28, 0, 0} is so\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00015", + "id": "GeneralSentences_Text_BlankAreBlank", "en_US": [ "{STRVAR_1 28, 0, 0} are\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00016", + "id": "GeneralSentences_Text_BlankRight", "en_US": "{STRVAR_1 28, 0, 0}, right?" }, { - "id": "pl_msg_00000447_00017", + "id": "GeneralSentences_Text_DidYouKnowBlankItsBlank", "en_US": [ "Did you know {STRVAR_1 28, 0, 0}?\n", "It’s {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000447_00018", + "id": "GeneralSentences_Text_ExcuseMeItsBlank", "en_US": [ "Excuse me...\n", "It’s {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000447_00019", + "id": "GeneralSentences_Text_BlankRightBlank", "en_US": [ "{STRVAR_1 28, 0, 0}, right?\n", "{STRVAR_1 28, 1, 0}!" diff --git a/res/text/unk_0441.json b/res/text/greetings.json similarity index 50% rename from res/text/unk_0441.json rename to res/text/greetings.json index 9c8aee7ce3..eb14ef7748 100644 --- a/res/text/unk_0441.json +++ b/res/text/greetings.json @@ -2,431 +2,431 @@ "key": 64414, "messages": [ { - "id": "pl_msg_00000441_00000", + "id": "Greetings_Text_Konnichiwa", "en_US": "KONNICHIWA" }, { - "id": "pl_msg_00000441_00001", + "id": "Greetings_Text_Hello", "en_US": "HELLO" }, { - "id": "pl_msg_00000441_00002", + "id": "Greetings_Text_Bonjour", "en_US": "BONJOUR" }, { - "id": "pl_msg_00000441_00003", + "id": "Greetings_Text_Ciao", "en_US": "CIAO" }, { - "id": "pl_msg_00000441_00004", + "id": "Greetings_Text_Hallo", "en_US": "HALLO" }, { - "id": "pl_msg_00000441_00005", + "id": "Greetings_Text_Hola", "en_US": "HOLA" }, { - "id": "pl_msg_00000441_00006", + "id": "Greetings_Text_OhWell", "en_US": "OH WELL" }, { - "id": "pl_msg_00000441_00007", + "id": "Greetings_Text_Aah", "en_US": "AAH" }, { - "id": "pl_msg_00000441_00008", + "id": "Greetings_Text_Ahaha", "en_US": "AHAHA" }, { - "id": "pl_msg_00000441_00009", + "id": "Greetings_Text_Huh", "en_US": "HUH?" }, { - "id": "pl_msg_00000441_00010", + "id": "Greetings_Text_Thanks", "en_US": "THANKS" }, { - "id": "pl_msg_00000441_00011", + "id": "Greetings_Text_NoProblem", "en_US": "NO PROBLEM" }, { - "id": "pl_msg_00000441_00012", + "id": "Greetings_Text_Nope", "en_US": "NOPE" }, { - "id": "pl_msg_00000441_00013", + "id": "Greetings_Text_Yes", "en_US": "YES" }, { - "id": "pl_msg_00000441_00014", + "id": "Greetings_Text_HereGoes", "en_US": "HERE GOES" }, { - "id": "pl_msg_00000441_00015", + "id": "Greetings_Text_LetsGo", "en_US": "LET’S GO" }, { - "id": "pl_msg_00000441_00016", + "id": "Greetings_Text_HereICome", "en_US": "HERE I COME" }, { - "id": "pl_msg_00000441_00017", + "id": "Greetings_Text_Yeah", "en_US": "YEAH" }, { - "id": "pl_msg_00000441_00018", + "id": "Greetings_Text_Welcome", "en_US": "WELCOME" }, { - "id": "pl_msg_00000441_00019", + "id": "Greetings_Text_Urgh", "en_US": "URGH" }, { - "id": "pl_msg_00000441_00020", + "id": "Greetings_Text_LetMeThink", "en_US": "LET ME THINK" }, { - "id": "pl_msg_00000441_00021", + "id": "Greetings_Text_Hmm", "en_US": "HMM" }, { - "id": "pl_msg_00000441_00022", + "id": "Greetings_Text_Whoa", "en_US": "WHOA" }, { - "id": "pl_msg_00000441_00023", + "id": "Greetings_Text_Wroooaar", "en_US": "WROOOAAR!" }, { - "id": "pl_msg_00000441_00024", + "id": "Greetings_Text_Wow", "en_US": "WOW" }, { - "id": "pl_msg_00000441_00025", + "id": "Greetings_Text_Snicker", "en_US": "SNICKER" }, { - "id": "pl_msg_00000441_00026", + "id": "Greetings_Text_CuteLaugh", "en_US": "CUTE LAUGH" }, { - "id": "pl_msg_00000441_00027", + "id": "Greetings_Text_Unbelievable", "en_US": "UNBELIEVABLE" }, { - "id": "pl_msg_00000441_00028", + "id": "Greetings_Text_Cries", "en_US": "CRIES" }, { - "id": "pl_msg_00000441_00029", + "id": "Greetings_Text_OK", "en_US": "OK" }, { - "id": "pl_msg_00000441_00030", + "id": "Greetings_Text_Agree", "en_US": "AGREE" }, { - "id": "pl_msg_00000441_00031", + "id": "Greetings_Text_Eh", "en_US": "EH?" }, { - "id": "pl_msg_00000441_00032", + "id": "Greetings_Text_Boohoo", "en_US": "BOO-HOO" }, { - "id": "pl_msg_00000441_00033", + "id": "Greetings_Text_Hehehe", "en_US": "HEHEHE" }, { - "id": "pl_msg_00000441_00034", + "id": "Greetings_Text_Hey", "en_US": "HEY" }, { - "id": "pl_msg_00000441_00035", + "id": "Greetings_Text_OhYeah", "en_US": "OH, YEAH" }, { - "id": "pl_msg_00000441_00036", + "id": "Greetings_Text_OhWow", "en_US": "OH WOW!" }, { - "id": "pl_msg_00000441_00037", + "id": "Greetings_Text_Heeey", "en_US": "HEEEY" }, { - "id": "pl_msg_00000441_00038", + "id": "Greetings_Text_Greetings", "en_US": "GREETINGS" }, { - "id": "pl_msg_00000441_00039", + "id": "Greetings_Text_Oops", "en_US": "OOPS" }, { - "id": "pl_msg_00000441_00040", + "id": "Greetings_Text_WellDone", "en_US": "WELL DONE" }, { - "id": "pl_msg_00000441_00041", + "id": "Greetings_Text_OhMy", "en_US": "OH MY" }, { - "id": "pl_msg_00000441_00042", + "id": "Greetings_Text_Eek", "en_US": "EEK" }, { - "id": "pl_msg_00000441_00043", + "id": "Greetings_Text_Yaaah", "en_US": "YAAAH" }, { - "id": "pl_msg_00000441_00044", + "id": "Greetings_Text_Giggle", "en_US": "GIGGLE" }, { - "id": "pl_msg_00000441_00045", + "id": "Greetings_Text_GiveMe", "en_US": "GIVE ME" }, { - "id": "pl_msg_00000441_00046", + "id": "Greetings_Text_Gwahahaha", "en_US": "GWAHAHAHA" }, { - "id": "pl_msg_00000441_00047", + "id": "Greetings_Text_Ugh", "en_US": "UGH" }, { - "id": "pl_msg_00000441_00048", + "id": "Greetings_Text_Sorry", "en_US": "SORRY" }, { - "id": "pl_msg_00000441_00049", + "id": "Greetings_Text_ForgiveMe", "en_US": "FORGIVE ME" }, { - "id": "pl_msg_00000441_00050", + "id": "Greetings_Text_ImSorry", "en_US": "I’M SORRY" }, { - "id": "pl_msg_00000441_00051", + "id": "Greetings_Text_HeyExclamation", "en_US": "HEY!" }, { - "id": "pl_msg_00000441_00052", + "id": "Greetings_Text_GoodBye", "en_US": "GOOD-BYE" }, { - "id": "pl_msg_00000441_00053", + "id": "Greetings_Text_ThankYou", "en_US": "THANK YOU" }, { - "id": "pl_msg_00000441_00054", + "id": "Greetings_Text_IveArrived", "en_US": "I’VE ARRIVED" }, { - "id": "pl_msg_00000441_00055", + "id": "Greetings_Text_Weep", "en_US": "WEEP" }, { - "id": "pl_msg_00000441_00056", + "id": "Greetings_Text_PardonMe", "en_US": "PARDON ME" }, { - "id": "pl_msg_00000441_00057", + "id": "Greetings_Text_SoSorry", "en_US": "SO SORRY" }, { - "id": "pl_msg_00000441_00058", + "id": "Greetings_Text_SeeYa", "en_US": "SEE YA" }, { - "id": "pl_msg_00000441_00059", + "id": "Greetings_Text_ExcuseMe", "en_US": "EXCUSE ME" }, { - "id": "pl_msg_00000441_00060", + "id": "Greetings_Text_OkayThen", "en_US": "OKAY THEN" }, { - "id": "pl_msg_00000441_00061", + "id": "Greetings_Text_Tut", "en_US": "TUT" }, { - "id": "pl_msg_00000441_00062", + "id": "Greetings_Text_Blush", "en_US": "BLUSH" }, { - "id": "pl_msg_00000441_00063", + "id": "Greetings_Text_GoAhead", "en_US": "GO AHEAD" }, { - "id": "pl_msg_00000441_00064", + "id": "Greetings_Text_Cheers", "en_US": "CHEERS" }, { - "id": "pl_msg_00000441_00065", + "id": "Greetings_Text_HeyQuestion", "en_US": "HEY?" }, { - "id": "pl_msg_00000441_00066", + "id": "Greetings_Text_WhatsUp", "en_US": "WHAT’S UP?" }, { - "id": "pl_msg_00000441_00067", + "id": "Greetings_Text_Huh2", "en_US": "HUH?" }, { - "id": "pl_msg_00000441_00068", + "id": "Greetings_Text_No", "en_US": "NO" }, { - "id": "pl_msg_00000441_00069", + "id": "Greetings_Text_Sigh", "en_US": "SIGH" }, { - "id": "pl_msg_00000441_00070", + "id": "Greetings_Text_Hi", "en_US": "HI" }, { - "id": "pl_msg_00000441_00071", + "id": "Greetings_Text_Yep", "en_US": "YEP" }, { - "id": "pl_msg_00000441_00072", + "id": "Greetings_Text_YeahYeah", "en_US": "YEAH, YEAH" }, { - "id": "pl_msg_00000441_00073", + "id": "Greetings_Text_ByeBye", "en_US": "BYE-BYE" }, { - "id": "pl_msg_00000441_00074", + "id": "Greetings_Text_MeetYou", "en_US": "MEET YOU" }, { - "id": "pl_msg_00000441_00075", + "id": "Greetings_Text_Hahaha", "en_US": "HAHAHA" }, { - "id": "pl_msg_00000441_00076", + "id": "Greetings_Text_Aiyeeh", "en_US": "AIYEEH" }, { - "id": "pl_msg_00000441_00077", + "id": "Greetings_Text_Hiyah", "en_US": "HIYAH" }, { - "id": "pl_msg_00000441_00078", + "id": "Greetings_Text_Muhahaha", "en_US": "MUHAHAHA" }, { - "id": "pl_msg_00000441_00079", + "id": "Greetings_Text_LOL", "en_US": "LOL" }, { - "id": "pl_msg_00000441_00080", + "id": "Greetings_Text_Snort", "en_US": "SNORT" }, { - "id": "pl_msg_00000441_00081", + "id": "Greetings_Text_Humph", "en_US": "HUMPH" }, { - "id": "pl_msg_00000441_00082", + "id": "Greetings_Text_Hey2", "en_US": "HEY" }, { - "id": "pl_msg_00000441_00083", + "id": "Greetings_Text_HeheheHyphens", "en_US": "HE-HE-HE" }, { - "id": "pl_msg_00000441_00084", + "id": "Greetings_Text_Heh", "en_US": "HEH" }, { - "id": "pl_msg_00000441_00085", + "id": "Greetings_Text_Hohoho", "en_US": "HOHOHO" }, { - "id": "pl_msg_00000441_00086", + "id": "Greetings_Text_ThereYouGo", "en_US": "THERE YOU GO" }, { - "id": "pl_msg_00000441_00087", + "id": "Greetings_Text_OhDear", "en_US": "OH, DEAR" }, { - "id": "pl_msg_00000441_00088", + "id": "Greetings_Text_ByeForNow", "en_US": "BYE FOR NOW" }, { - "id": "pl_msg_00000441_00089", + "id": "Greetings_Text_Angry", "en_US": "ANGRY" }, { - "id": "pl_msg_00000441_00090", + "id": "Greetings_Text_Mufufu", "en_US": "MUFUFU" }, { - "id": "pl_msg_00000441_00091", + "id": "Greetings_Text_Mmm", "en_US": "MMM" }, { - "id": "pl_msg_00000441_00092", + "id": "Greetings_Text_HelloQuestion", "en_US": "HELLO?" }, { - "id": "pl_msg_00000441_00093", + "id": "Greetings_Text_HiThere", "en_US": "HI THERE" }, { - "id": "pl_msg_00000441_00094", + "id": "Greetings_Text_NoWay", "en_US": "NO WAY" }, { - "id": "pl_msg_00000441_00095", + "id": "Greetings_Text_Yahoo", "en_US": "YAHOO" }, { - "id": "pl_msg_00000441_00096", + "id": "Greetings_Text_Yo", "en_US": "YO" }, { - "id": "pl_msg_00000441_00097", + "id": "Greetings_Text_Welcome2", "en_US": "WELCOME" }, { - "id": "pl_msg_00000441_00098", + "id": "Greetings_Text_OK2", "en_US": "OK" }, { - "id": "pl_msg_00000441_00099", + "id": "Greetings_Text_Regards", "en_US": "REGARDS" }, { - "id": "pl_msg_00000441_00100", + "id": "Greetings_Text_Lalala", "en_US": "LALALA" }, { - "id": "pl_msg_00000441_00101", + "id": "Greetings_Text_Yay", "en_US": "YAY" }, { - "id": "pl_msg_00000441_00102", + "id": "Greetings_Text_Wail", "en_US": "WAIL" }, { - "id": "pl_msg_00000441_00103", + "id": "Greetings_Text_Wow2", "en_US": "WOW" }, { - "id": "pl_msg_00000441_00104", + "id": "Greetings_Text_Boo", "en_US": "BOO!" }, { - "id": "pl_msg_00000441_00105", + "id": "Greetings_Text_Wahaha", "en_US": "WAHAHA" }, { - "id": "pl_msg_00000441_00106", + "id": "Greetings_Text_Ellipsis", "en_US": "..." } ] diff --git a/res/text/unk_0442.json b/res/text/lifestyle_words.json similarity index 100% rename from res/text/unk_0442.json rename to res/text/lifestyle_words.json diff --git a/res/text/unk_0446.json b/res/text/loss_sentences.json similarity index 66% rename from res/text/unk_0446.json rename to res/text/loss_sentences.json index adf2fdbf44..f4dde499db 100644 --- a/res/text/unk_0446.json +++ b/res/text/loss_sentences.json @@ -2,137 +2,137 @@ "key": 56070, "messages": [ { - "id": "pl_msg_00000446_00000", + "id": "LossSentences_Text_YouWinBlank", "en_US": [ "You win...\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00001", + "id": "LossSentences_Text_BlankWasThingIWantedToAvoid", "en_US": [ "{STRVAR_1 28, 0, 0} was the one\n", "thing I wanted to avoid..." ] }, { - "id": "pl_msg_00000446_00002", + "id": "LossSentences_Text_WaaahBlank", "en_US": [ "Waaah!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00003", + "id": "LossSentences_Text_WantToGoHomeWithBlank", "en_US": [ "I want to go home with\n", "{STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00004", + "id": "LossSentences_Text_BlankBlank", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000446_00005", + "id": "LossSentences_Text_CouldItBeBlank", "en_US": [ "Could it be...?\n", "{STRVAR_1 28, 0, 0}...?" ] }, { - "id": "pl_msg_00000446_00006", + "id": "LossSentences_Text_BlankHowAwful", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "How awful!" ] }, { - "id": "pl_msg_00000446_00007", + "id": "LossSentences_Text_WasConfidentBlankAboutToo", "en_US": [ "I was confident about\n", "{STRVAR_1 28, 0, 0}, too." ] }, { - "id": "pl_msg_00000446_00008", + "id": "LossSentences_Text_YoureBlankArentYou", "en_US": [ "You’re {STRVAR_1 28, 0, 0},\n", "aren’t you?" ] }, { - "id": "pl_msg_00000446_00009", + "id": "LossSentences_Text_BlankCantBeAnythingElse", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Can’t be anything else but." ] }, { - "id": "pl_msg_00000446_00010", + "id": "LossSentences_Text_FeelHelplesslyAngryItsBlank", "en_US": [ "I feel so helplessly angry...\n", "It’s {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00011", + "id": "LossSentences_Text_BlankMakesMeSad", "en_US": "{STRVAR_1 28, 0, 0} makes me sad..." }, { - "id": "pl_msg_00000446_00012", + "id": "LossSentences_Text_IFeelSorryForBlank", "en_US": [ "I feel sorry for\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00013", + "id": "LossSentences_Text_WayIFeelNowIsBlank", "en_US": [ "The way I feel now is\n", "{STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00014", + "id": "LossSentences_Text_ILostButWonAtBlank", "en_US": [ "I lost, but I won at\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000446_00015", + "id": "LossSentences_Text_WouldveWonIfBlank", "en_US": [ "I would’ve won if this\n", "were {STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00016", + "id": "LossSentences_Text_HeadsFilledWithBlank", "en_US": [ "My head’s filled with only\n", "{STRVAR_1 28, 0, 0} now!" ] }, { - "id": "pl_msg_00000446_00017", + "id": "LossSentences_Text_WayILostItsLikeBlank", "en_US": [ "The way I lost...\n", "It’s like {STRVAR_1 28, 0, 0}..." ] }, { - "id": "pl_msg_00000446_00018", + "id": "LossSentences_Text_IsntBlankBlank", "en_US": [ "Isn’t {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}?" ] }, { - "id": "pl_msg_00000446_00019", + "id": "LossSentences_Text_AwwThatsReallyBlank", "en_US": [ "Aww... That’s really\n", "{STRVAR_1 28, 0, 0}..." diff --git a/res/text/menu_entries.json b/res/text/menu_entries.json index 8c2f3abe82..915d6f01fe 100644 --- a/res/text/menu_entries.json +++ b/res/text/menu_entries.json @@ -638,15 +638,15 @@ "en_US": "CHALLENGE EARLIER ROOM" }, { - "id": "pl_msg_00000361_00153", + "id": "MenuEntries_Text_PalPadInfo_RegisterAFriend", "en_US": "REGISTER A FRIEND?" }, { - "id": "pl_msg_00000361_00154", + "id": "MenuEntries_Text_PalPadInfo_Understood", "en_US": "UNDERSTOOD!" }, { - "id": "pl_msg_00000361_00155", + "id": "MenuEntries_Text_PalPadInfo_TellMeAgain", "en_US": "TELL ME AGAIN" }, { diff --git a/res/text/unk_0440.json b/res/text/people_words.json similarity index 100% rename from res/text/unk_0440.json rename to res/text/people_words.json diff --git a/res/text/pokemon_center_2f_attendants.json b/res/text/pokemon_center_2f_common.json similarity index 56% rename from res/text/pokemon_center_2f_attendants.json rename to res/text/pokemon_center_2f_common.json index 0bb24c494d..8b676e9b96 100644 --- a/res/text/pokemon_center_2f_attendants.json +++ b/res/text/pokemon_center_2f_common.json @@ -2,7 +2,7 @@ "key": 24069, "messages": [ { - "id": "pl_msg_00000221_00000", + "id": "PokemonCenter2FCommon_Text_WelcomeToColosseum", "en_US": [ "Welcome to the Pokémon Communication\n", "Club Colosseum.\r", @@ -11,14 +11,14 @@ ] }, { - "id": "pl_msg_00000221_00001", + "id": "PokemonCenter2FCommon_Text_WhichBattleMode", "en_US": [ "Which Battle Mode would you like\n", "to play?" ] }, { - "id": "pl_msg_00000221_00002", + "id": "PokemonCenter2FCommon_Text_BattleModesInfo", "en_US": [ "There are four Battle Modes.\r", "Single Battle is for two Trainers\n", @@ -42,62 +42,62 @@ ] }, { - "id": "pl_msg_00000221_00003", + "id": "PokemonCenter2FCommon_Text_Dummy3", "garbage": 266 }, { - "id": "pl_msg_00000221_00004", + "id": "PokemonCenter2FCommon_Text_Dummy4", "garbage": 41 }, { - "id": "pl_msg_00000221_00005", + "id": "PokemonCenter2FCommon_Text_Dummy5", "garbage": 32 }, { - "id": "pl_msg_00000221_00006", + "id": "PokemonCenter2FCommon_Text_NeedTwoPokemonDoubleBattle", "en_US": [ "For a Double Battle, you must\n", "have at least two Pokémon." ] }, { - "id": "pl_msg_00000221_00007", + "id": "PokemonCenter2FCommon_Text_Dummy7", "garbage": 27 }, { - "id": "pl_msg_00000221_00008", + "id": "PokemonCenter2FCommon_Text_Dummy8", "garbage": 35 }, { - "id": "pl_msg_00000221_00009", + "id": "PokemonCenter2FCommon_Text_SaveTheGame", "en_US": "Would you like to save the game?" }, { - "id": "pl_msg_00000221_00010", + "id": "PokemonCenter2FCommon_Text_Dummy10", "garbage": 31 }, { - "id": "pl_msg_00000221_00011", + "id": "PokemonCenter2FCommon_Text_Dummy11", "garbage": 35 }, { - "id": "pl_msg_00000221_00012", + "id": "PokemonCenter2FCommon_Text_Dummy12", "garbage": 26 }, { - "id": "pl_msg_00000221_00013", + "id": "PokemonCenter2FCommon_Text_Dummy13", "garbage": 16 }, { - "id": "pl_msg_00000221_00014", + "id": "PokemonCenter2FCommon_Text_Dummy14", "garbage": 26 }, { - "id": "pl_msg_00000221_00015", + "id": "PokemonCenter2FCommon_Text_PleaseVisitAgain", "en_US": "Please do visit again." }, { - "id": "pl_msg_00000221_00016", + "id": "PokemonCenter2FCommon_Text_RepeatProcessFromBeginning", "en_US": [ "Communication error.\r", "Please repeat the registration\n", @@ -105,27 +105,27 @@ ] }, { - "id": "pl_msg_00000221_00017", + "id": "PokemonCenter2FCommon_Text_Dummy17", "garbage": 12 }, { - "id": "pl_msg_00000221_00018", + "id": "PokemonCenter2FCommon_Text_Dummy18", "garbage": 17 }, { - "id": "pl_msg_00000221_00019", + "id": "PokemonCenter2FCommon_Text_Dummy19", "garbage": 25 }, { - "id": "pl_msg_00000221_00020", + "id": "PokemonCenter2FCommon_Text_Dummy20", "garbage": 12 }, { - "id": "pl_msg_00000221_00021", + "id": "PokemonCenter2FCommon_Text_Dummy21", "garbage": 11 }, { - "id": "pl_msg_00000221_00022", + "id": "PokemonCenter2FCommon_Text_DecideWhichOfTwoBecomesLeader", "en_US": [ "Please decide which of you two\n", "will become the leader.\r", @@ -134,87 +134,87 @@ ] }, { - "id": "pl_msg_00000221_00023", + "id": "PokemonCenter2FCommon_Text_Dummy23", "garbage": 24 }, { - "id": "pl_msg_00000221_00024", + "id": "PokemonCenter2FCommon_Text_Dummy24", "garbage": 20 }, { - "id": "pl_msg_00000221_00025", + "id": "PokemonCenter2FCommon_Text_Dummy25", "garbage": 27 }, { - "id": "pl_msg_00000221_00026", + "id": "PokemonCenter2FCommon_Text_Dummy26", "garbage": 23 }, { - "id": "pl_msg_00000221_00027", + "id": "PokemonCenter2FCommon_Text_Dummy27", "garbage": 29 }, { - "id": "pl_msg_00000221_00028", + "id": "PokemonCenter2FCommon_Text_Dummy28", "garbage": 35 }, { - "id": "pl_msg_00000221_00029", + "id": "PokemonCenter2FCommon_Text_Dummy29", "garbage": 22 }, { - "id": "pl_msg_00000221_00030", + "id": "PokemonCenter2FCommon_Text_Dummy30", "garbage": 13 }, { - "id": "pl_msg_00000221_00031", + "id": "PokemonCenter2FCommon_Text_Dummy31", "garbage": 25 }, { - "id": "pl_msg_00000221_00032", + "id": "PokemonCenter2FCommon_Text_Dummy32", "garbage": 25 }, { - "id": "pl_msg_00000221_00033", + "id": "PokemonCenter2FCommon_Text_Dummy33", "garbage": 26 }, { - "id": "pl_msg_00000221_00034", + "id": "PokemonCenter2FCommon_Text_Dummy34", "garbage": 29 }, { - "id": "pl_msg_00000221_00035", + "id": "PokemonCenter2FCommon_Text_Dummy35", "garbage": 28 }, { - "id": "pl_msg_00000221_00036", + "id": "PokemonCenter2FCommon_Text_Dummy36", "garbage": 29 }, { - "id": "pl_msg_00000221_00037", + "id": "PokemonCenter2FCommon_Text_Dummy37", "garbage": 30 }, { - "id": "pl_msg_00000221_00038", + "id": "PokemonCenter2FCommon_Text_Dummy38", "garbage": 29 }, { - "id": "pl_msg_00000221_00039", + "id": "PokemonCenter2FCommon_Text_Dummy39", "garbage": 30 }, { - "id": "pl_msg_00000221_00040", + "id": "PokemonCenter2FCommon_Text_Dummy40", "garbage": 32 }, { - "id": "pl_msg_00000221_00041", + "id": "PokemonCenter2FCommon_Text_Dummy41", "garbage": 14 }, { - "id": "pl_msg_00000221_00042", + "id": "PokemonCenter2FCommon_Text_Dummy42", "garbage": 17 }, { - "id": "pl_msg_00000221_00043", + "id": "PokemonCenter2FCommon_Text_DecideWhichOfFourBecomesLeader", "en_US": [ "Please decide which of you four\n", "will become the group leader.\r", @@ -223,80 +223,80 @@ ] }, { - "id": "pl_msg_00000221_00044", + "id": "PokemonCenter2FCommon_Text_ChooseLeaderMultiBattle", "en_US": [ "Please choose the leader\n", "for a Multi Battle." ] }, { - "id": "pl_msg_00000221_00045", + "id": "PokemonCenter2FCommon_Text_PlayerAskedToRegisterAsMember", "en_US": [ "{STRVAR_1 3, 0, 0} was asked to register\n", "you as a member. Please wait." ] }, { - "id": "pl_msg_00000221_00046", + "id": "PokemonCenter2FCommon_Text_PlayerRepliedNo", "en_US": "{STRVAR_1 3, 0, 0} replied, “No...”" }, { - "id": "pl_msg_00000221_00047", + "id": "PokemonCenter2FCommon_Text_PlayerOKdRegistration", "en_US": [ "{STRVAR_1 3, 0, 0} OK’d your registration\n", "as a member." ] }, { - "id": "pl_msg_00000221_00048", + "id": "PokemonCenter2FCommon_Text_MultiBattleAwaitingMembers", "en_US": [ "Multi Battle!\n", "Awaiting other members!" ] }, { - "id": "pl_msg_00000221_00049", + "id": "PokemonCenter2FCommon_Text_MultiBattleAwaitingCommunication", "en_US": [ "Multi Battle! Awaiting\n", "communication from another player." ] }, { - "id": "pl_msg_00000221_00050", + "id": "PokemonCenter2FCommon_Text_CancelMultiBattle", "en_US": [ "Cancel the Multi Battle Mode\n", "with these members?" ] }, { - "id": "pl_msg_00000221_00051", + "id": "PokemonCenter2FCommon_Text_PlayerContactedYou", "en_US": "{STRVAR_1 3, 0, 0} contacted you." }, { - "id": "pl_msg_00000221_00052", + "id": "PokemonCenter2FCommon_Text_MembersGatheredEnterRoom", "en_US": [ "The members have gathered.\n", "Please enter the room." ] }, { - "id": "pl_msg_00000221_00053", + "id": "PokemonCenter2FCommon_Text_Dummy53", "garbage": 46 }, { - "id": "pl_msg_00000221_00054", + "id": "PokemonCenter2FCommon_Text_Dummy54", "garbage": 23 }, { - "id": "pl_msg_00000221_00055", + "id": "PokemonCenter2FCommon_Text_Dummy55", "garbage": 17 }, { - "id": "pl_msg_00000221_00056", + "id": "PokemonCenter2FCommon_Text_Dummy56", "garbage": 13 }, { - "id": "pl_msg_00000221_00057", + "id": "PokemonCenter2FCommon_Text_WelcomeEnterUnionRoom", "en_US": [ "Welcome to the Pokémon Wireless\n", "Club Union Room.\r", @@ -306,7 +306,7 @@ ] }, { - "id": "pl_msg_00000221_00058", + "id": "PokemonCenter2FCommon_Text_UnionRoomInfo", "en_US": [ "The Trainers in the Union Room\n", "will be those players around you\f", @@ -325,206 +325,206 @@ ] }, { - "id": "pl_msg_00000221_00059", + "id": "PokemonCenter2FCommon_Text_SaveTheGame2", "en_US": "Would you like to save the game?" }, { - "id": "pl_msg_00000221_00060", + "id": "PokemonCenter2FCommon_Text_OverwriteSavedFile", "en_US": [ "There is already a saved file.\n", "Is it OK to overwrite it?" ] }, { - "id": "pl_msg_00000221_00061", + "id": "PokemonCenter2FCommon_Text_SavingDontTurnOffPower", "en_US": [ "Saving...\n", "Don’t turn off the power." ] }, { - "id": "pl_msg_00000221_00062", + "id": "PokemonCenter2FCommon_Text_SavedTheGame", "en_US": "{STRVAR_1 3, 0, 0} saved the game." }, { - "id": "pl_msg_00000221_00063", + "id": "PokemonCenter2FCommon_Text_EnjoyUnionRoom", "en_US": [ "I hope you enjoy your time in\n", "the Union Room.\r" ] }, { - "id": "pl_msg_00000221_00064", + "id": "PokemonCenter2FCommon_Text_Dummy64", "garbage": 92 }, { - "id": "pl_msg_00000221_00065", + "id": "PokemonCenter2FCommon_Text_Dummy65", "garbage": 115 }, { - "id": "pl_msg_00000221_00066", + "id": "PokemonCenter2FCommon_Text_Dummy66", "garbage": 30 }, { - "id": "pl_msg_00000221_00067", + "id": "PokemonCenter2FCommon_Text_Dummy67", "garbage": 31 }, { - "id": "pl_msg_00000221_00068", + "id": "PokemonCenter2FCommon_Text_Dummy68", "garbage": 35 }, { - "id": "pl_msg_00000221_00069", + "id": "PokemonCenter2FCommon_Text_Dummy69", "garbage": 26 }, { - "id": "pl_msg_00000221_00070", + "id": "PokemonCenter2FCommon_Text_Dummy70", "garbage": 63 }, { - "id": "pl_msg_00000221_00071", + "id": "PokemonCenter2FCommon_Text_Dummy71", "garbage": 25 }, { - "id": "pl_msg_00000221_00072", + "id": "PokemonCenter2FCommon_Text_Dummy72", "garbage": 34 }, { - "id": "pl_msg_00000221_00073", + "id": "PokemonCenter2FCommon_Text_Dummy73", "garbage": 28 }, { - "id": "pl_msg_00000221_00074", + "id": "PokemonCenter2FCommon_Text_Dummy74", "garbage": 30 }, { - "id": "pl_msg_00000221_00075", + "id": "PokemonCenter2FCommon_Text_Dummy75", "garbage": 24 }, { - "id": "pl_msg_00000221_00076", + "id": "PokemonCenter2FCommon_Text_Dummy76", "garbage": 16 }, { - "id": "pl_msg_00000221_00077", + "id": "PokemonCenter2FCommon_Text_Dummy77", "garbage": 26 }, { - "id": "pl_msg_00000221_00078", + "id": "PokemonCenter2FCommon_Text_Dummy78", "garbage": 27 }, { - "id": "pl_msg_00000221_00079", + "id": "PokemonCenter2FCommon_Text_Dummy79", "garbage": 96 }, { - "id": "pl_msg_00000221_00080", + "id": "PokemonCenter2FCommon_Text_Dummy80", "garbage": 158 }, { - "id": "pl_msg_00000221_00081", + "id": "PokemonCenter2FCommon_Text_Dummy81", "garbage": 87 }, { - "id": "pl_msg_00000221_00082", + "id": "PokemonCenter2FCommon_Text_Dummy82", "garbage": 90 }, { - "id": "pl_msg_00000221_00083", + "id": "PokemonCenter2FCommon_Text_Dummy83", "garbage": 61 }, { - "id": "pl_msg_00000221_00084", + "id": "PokemonCenter2FCommon_Text_Dummy84", "garbage": 85 }, { - "id": "pl_msg_00000221_00085", + "id": "PokemonCenter2FCommon_Text_Dummy85", "garbage": 105 }, { - "id": "pl_msg_00000221_00086", + "id": "PokemonCenter2FCommon_Text_Dummy86", "garbage": 65 }, { - "id": "pl_msg_00000221_00087", + "id": "PokemonCenter2FCommon_Text_Dummy87", "garbage": 63 }, { - "id": "pl_msg_00000221_00088", + "id": "PokemonCenter2FCommon_Text_Dummy88", "garbage": 25 }, { - "id": "pl_msg_00000221_00089", + "id": "PokemonCenter2FCommon_Text_Dummy89", "garbage": 75 }, { - "id": "pl_msg_00000221_00090", + "id": "PokemonCenter2FCommon_Text_Dummy90", "garbage": 26 }, { - "id": "pl_msg_00000221_00091", + "id": "PokemonCenter2FCommon_Text_Dummy91", "garbage": 73 }, { - "id": "pl_msg_00000221_00092", + "id": "PokemonCenter2FCommon_Text_Dummy92", "garbage": 5 }, { - "id": "pl_msg_00000221_00093", + "id": "PokemonCenter2FCommon_Text_Dummy93", "garbage": 5 }, { - "id": "pl_msg_00000221_00094", + "id": "PokemonCenter2FCommon_Text_Dummy94", "garbage": 4 }, { - "id": "pl_msg_00000221_00095", + "id": "PokemonCenter2FCommon_Text_Dummy95", "garbage": 5 }, { - "id": "pl_msg_00000221_00096", + "id": "PokemonCenter2FCommon_Text_Dummy96", "garbage": 4 }, { - "id": "pl_msg_00000221_00097", + "id": "PokemonCenter2FCommon_Text_Dummy97", "garbage": 22 }, { - "id": "pl_msg_00000221_00098", + "id": "PokemonCenter2FCommon_Text_Dummy98", "garbage": 4 }, { - "id": "pl_msg_00000221_00099", + "id": "PokemonCenter2FCommon_Text_Dummy99", "garbage": 4 }, { - "id": "pl_msg_00000221_00100", + "id": "PokemonCenter2FCommon_Text_Dummy100", "garbage": 3 }, { - "id": "pl_msg_00000221_00101", + "id": "PokemonCenter2FCommon_Text_Dummy101", "garbage": 4 }, { - "id": "pl_msg_00000221_00102", + "id": "PokemonCenter2FCommon_Text_YouMaySignTrainerCard", "en_US": [ "You may sign the back of your\n", "Trainer Card here.\r" ] }, { - "id": "pl_msg_00000221_00103", + "id": "PokemonCenter2FCommon_Text_WouldYouSignTrainerCard", "en_US": [ "Would you like to sign your\n", "Trainer Card?" ] }, { - "id": "pl_msg_00000221_00104", + "id": "PokemonCenter2FCommon_Text_PleaseVisitAgain2", "en_US": "Please do visit again." }, { - "id": "pl_msg_00000221_00105", + "id": "PokemonCenter2FCommon_Text_SignTrainerCardInfo", "en_US": [ "You may sign the back of your\n", "Trainer Card here.\r", @@ -536,14 +536,14 @@ ] }, { - "id": "pl_msg_00000221_00106", + "id": "PokemonCenter2FCommon_Text_WhichSetOfRules", "en_US": [ "Which set of rules would you like\n", "to use?" ] }, { - "id": "pl_msg_00000221_00107", + "id": "PokemonCenter2FCommon_Text_NeedXPokemonForCup", "en_US": [ "You need at least {STRVAR_1 50, 1, 0} Pokémon that\n", "qualify under {STRVAR_1 26, 0, 0} Cup\f", @@ -551,59 +551,59 @@ ] }, { - "id": "pl_msg_00000221_00108", + "id": "PokemonCenter2FCommon_Text_Dummy108", "garbage": 8 }, { - "id": "pl_msg_00000221_00109", + "id": "PokemonCenter2FCommon_Text_Dummy109", "garbage": 7 }, { - "id": "pl_msg_00000221_00110", + "id": "PokemonCenter2FCommon_Text_Dummy110", "garbage": 6 }, { - "id": "pl_msg_00000221_00111", + "id": "PokemonCenter2FCommon_Text_Dummy111", "garbage": 6 }, { - "id": "pl_msg_00000221_00112", + "id": "PokemonCenter2FCommon_Text_Dummy112", "garbage": 6 }, { - "id": "pl_msg_00000221_00113", + "id": "PokemonCenter2FCommon_Text_Cup", "en_US": "{STRVAR_1 26, 0, 0} Cup" }, { - "id": "pl_msg_00000221_00114", + "id": "PokemonCenter2FCommon_Text_Cancel", "en_US": "CANCEL" }, { - "id": "pl_msg_00000221_00115", + "id": "PokemonCenter2FCommon_Text_Confirm", "en_US": "CONFIRM" }, { - "id": "pl_msg_00000221_00116", + "id": "PokemonCenter2FCommon_Text_Rules", "en_US": "RULES" }, { - "id": "pl_msg_00000221_00117", + "id": "PokemonCenter2FCommon_Text_Dummy117", "garbage": 28 }, { - "id": "pl_msg_00000221_00118", + "id": "PokemonCenter2FCommon_Text_Dummy118", "garbage": 26 }, { - "id": "pl_msg_00000221_00119", + "id": "PokemonCenter2FCommon_Text_Dummy119", "garbage": 28 }, { - "id": "pl_msg_00000221_00120", + "id": "PokemonCenter2FCommon_Text_Dummy120", "garbage": 17 }, { - "id": "pl_msg_00000221_00121", + "id": "PokemonCenter2FCommon_Text_CantFormTeamWithLevelLimit", "en_US": [ "It’s impossible to form a team of\n", "Pokémon that qualify under the\r", @@ -612,36 +612,36 @@ ] }, { - "id": "pl_msg_00000221_00122", + "id": "PokemonCenter2FCommon_Text_Dummy122", "garbage": 18 }, { - "id": "pl_msg_00000221_00123", + "id": "PokemonCenter2FCommon_Text_NoRestrictions", "en_US": "NO RESTRICTIONS" }, { - "id": "PokeCenter2FAttendants_Text_CommsWillBeLaunched", + "id": "PokemonCenter2FCommon_Text_CommsWillBeLaunched", "en_US": [ "DS Wireless Communications will be\n", "launched." ] }, { - "id": "pl_msg_00000221_00125", + "id": "PokemonCenter2FCommon_Text_NeedThreePokemonMultiBattle", "en_US": [ "For a Multi Battle, you must have\n", "at least three Pokémon." ] }, { - "id": "pl_msg_00000221_00126", + "id": "PokemonCenter2FCommon_Text_NeedThreePokemonMixBattle", "en_US": [ "For a Mix Battle, you must have\n", "at least three Pokémon." ] }, { - "id": "pl_msg_00000221_00127", + "id": "PokemonCenter2FCommon_Text_AtLeastOnePokemonCantBeTaken", "en_US": [ "You have at least one Pokémon\n", "that can’t be taken." diff --git a/res/text/pokemon_center_b1f_attendants.json b/res/text/pokemon_center_b1f_common.json similarity index 74% rename from res/text/pokemon_center_b1f_attendants.json rename to res/text/pokemon_center_b1f_common.json index 5a4cbadf1e..503a1d49e6 100644 --- a/res/text/pokemon_center_b1f_attendants.json +++ b/res/text/pokemon_center_b1f_common.json @@ -2,14 +2,14 @@ "key": 1593, "messages": [ { - "id": "pl_msg_00000430_00000", + "id": "PokemonCenterB1FCommon_Text_HelloRightThisWay", "en_US": [ "Oh, hello!\n", "Right this way, please!\r" ] }, { - "id": "pl_msg_00000430_00001", + "id": "PokemonCenterB1FCommon_Text_GuideToWiFiClub", "en_US": [ "Hello.\n", "I’m glad to meet you.\r", @@ -19,7 +19,7 @@ ] }, { - "id": "pl_msg_00000430_00002", + "id": "PokemonCenterB1FCommon_Text_ExplainPalPad", "en_US": [ "That’s your Pal Pad. You may register\n", "your friends in it.\r", @@ -30,7 +30,7 @@ ] }, { - "id": "pl_msg_00000430_00003", + "id": "PokemonCenterB1FCommon_Text_ExplainRegisterAFriend", "en_US": [ "You may meet people on the second\n", "floor of a Pokémon Center for trades\f", @@ -44,14 +44,14 @@ ] }, { - "id": "pl_msg_00000430_00004", + "id": "PokemonCenterB1FCommon_Text_EnjoyNintendoWFC", "en_US": [ "I hope you enjoy using Nintendo\n", "WFC!" ] }, { - "id": "pl_msg_00000430_00005", + "id": "PokemonCenterB1FCommon_Text_MayIHelpWithAnything", "en_US": [ "Welcome to the Pokémon Center Wi-Fi\n", "Club!\r", @@ -59,7 +59,7 @@ ] }, { - "id": "pl_msg_00000430_00006", + "id": "PokemonCenterB1FCommon_Text_ExplainWiFiClub", "en_US": [ "Let me explain how the Pokémon Wi-Fi\n", "Club is set up.\r", @@ -71,7 +71,7 @@ ] }, { - "id": "pl_msg_00000430_00007", + "id": "PokemonCenterB1FCommon_Text_WiFiClubUseNintendoWFC", "en_US": [ "Welcome to the Pokémon Wi-Fi Club!\r", "Would you like to use Nintendo Wi-Fi\n", @@ -79,22 +79,22 @@ ] }, { - "id": "pl_msg_00000430_00008", + "id": "PokemonCenterB1FCommon_Text_PleaseComeAgain", "en_US": "Please come again." }, { - "id": "pl_msg_00000430_00009", + "id": "PokemonCenterB1FCommon_Text_LaunchNintendoWFC", "en_US": [ "Would you like to launch\n", "Nintendo WFC?" ] }, { - "id": "pl_msg_00000430_00010", + "id": "PokemonCenterB1FCommon_Text_RightThisWay", "en_US": "Right this way, please.\r" }, { - "id": "pl_msg_00000430_00011", + "id": "PokemonCenterB1FCommon_Text_NoFriendsGetAFriendCode", "en_US": [ "...Oh?\r", "I’m sorry, but you don’t have any\n", @@ -106,7 +106,7 @@ ] }, { - "id": "pl_msg_00000430_00012", + "id": "PokemonCenterB1FCommon_Text_NoRegisteredFriends", "en_US": [ "...Oh?\r", "I’m sorry, but you don’t have any\n", @@ -118,7 +118,7 @@ ] }, { - "id": "pl_msg_00000430_00013", + "id": "PokemonCenterB1FCommon_Text_WiFiClubInfo", "en_US": [ "At any Wi-Fi Club, you may play using\n", "Nintendo Wi-Fi Connection.\r", @@ -136,19 +136,19 @@ ] }, { - "id": "pl_msg_00000430_00014", + "id": "PokemonCenterB1FCommon_Text_GoToWiFiClub", "en_US": "GO TO WI-FI CLUB" }, { - "id": "pl_msg_00000430_00015", + "id": "PokemonCenterB1FCommon_Text_InfoWiFiClub", "en_US": "INFO" }, { - "id": "pl_msg_00000430_00016", + "id": "PokemonCenterB1FCommon_Text_ExitWiFiClub", "en_US": "EXIT" }, { - "id": "pl_msg_00000430_00017", + "id": "PokemonCenterB1FCommon_Text_WiFiPlazaUseNintendoWFC", "en_US": [ "Hello, you may enter our Pokémon\n", "Center Wi-Fi Plaza from here.\r", @@ -157,19 +157,19 @@ ] }, { - "id": "pl_msg_00000430_00018", + "id": "PokemonCenterB1FCommon_Text_Dummy18", "garbage": 21 }, { - "id": "pl_msg_00000430_00019", + "id": "PokemonCenterB1FCommon_Text_PleaseEnterThisWay", "en_US": "Please enter this way.\r" }, { - "id": "pl_msg_00000430_00020", + "id": "PokemonCenterB1FCommon_Text_LookForwardToNextVisit", "en_US": "We look forward to your next visit." }, { - "id": "pl_msg_00000430_00021", + "id": "PokemonCenterB1FCommon_Text_WiFiPlazaInfo", "en_US": [ "The Wi-Fi Plaza is a facility where you\n", "may meet Trainers from around the\f", @@ -187,19 +187,19 @@ ] }, { - "id": "pl_msg_00000430_00022", + "id": "PokemonCenterB1FCommon_Text_GoToWiFiPlaza", "en_US": "GO TO WI-FI PLAZA" }, { - "id": "pl_msg_00000430_00023", + "id": "PokemonCenterB1FCommon_Text_InfoWiFiPlaza", "en_US": "INFO" }, { - "id": "pl_msg_00000430_00024", + "id": "PokemonCenterB1FCommon_Text_ExitWiFiPlaza", "en_US": "EXIT" }, { - "id": "pl_msg_00000430_00025", + "id": "PokemonCenterB1FCommon_Text_PleaseComeBackLater", "en_US": [ "Sorry, we’re getting things ready.\n", "Please come back later." diff --git a/res/text/unk_0448.json b/res/text/pre_battle_sentences.json similarity index 62% rename from res/text/unk_0448.json rename to res/text/pre_battle_sentences.json index 6080c46ed5..c02ede29f5 100644 --- a/res/text/unk_0448.json +++ b/res/text/pre_battle_sentences.json @@ -2,119 +2,119 @@ "key": 5861, "messages": [ { - "id": "pl_msg_00000448_00000", + "id": "PreBattleSentences_Text_PleaseBlank", "en_US": [ "Please!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00001", + "id": "PreBattleSentences_Text_GoBlank", "en_US": "Go! {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00002", + "id": "PreBattleSentences_Text_IllBattleWithBlank", "en_US": [ "I’ll battle with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00003", + "id": "PreBattleSentences_Text_ItsBlank", "en_US": "It’s {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00004", + "id": "PreBattleSentences_Text_BlankImGoingWithBlank", "en_US": [ "{STRVAR_1 28, 0, 0}, I’m going\n", "with {STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000448_00005", + "id": "PreBattleSentences_Text_LookAtBlank", "en_US": "Look at {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00006", + "id": "PreBattleSentences_Text_IllShowYouBlank", "en_US": "I’ll show you {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00007", + "id": "PreBattleSentences_Text_NowBlank", "en_US": [ "Now!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00008", + "id": "PreBattleSentences_Text_IllShowYouMyBlankStrategy", "en_US": [ "I’ll show you my\n", "{STRVAR_1 28, 0, 0} strategy!" ] }, { - "id": "pl_msg_00000448_00009", + "id": "PreBattleSentences_Text_IllBlank", "en_US": "I’ll {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000448_00010", + "id": "PreBattleSentences_Text_IllShockYouWithBlank", "en_US": [ "I’ll shock you with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00011", + "id": "PreBattleSentences_Text_ThisIsBeginningOfBlank", "en_US": [ "This is the beginning\n", "of {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00012", + "id": "PreBattleSentences_Text_ThisBattleIsBlank", "en_US": [ "This battle is\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00013", + "id": "PreBattleSentences_Text_DontThinkIllLoseAtBlank", "en_US": [ "I don’t think I’ll\n", "ever lose at {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000448_00014", + "id": "PreBattleSentences_Text_TeamBlankIsHere", "en_US": "Team {STRVAR_1 28, 0, 0} is here!" }, { - "id": "pl_msg_00000448_00015", + "id": "PreBattleSentences_Text_ThinkYouCanBeatBlank", "en_US": [ "You think you can beat\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000448_00016", + "id": "PreBattleSentences_Text_BlankBlankPower", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0} power!" ] }, { - "id": "pl_msg_00000448_00017", + "id": "PreBattleSentences_Text_ThisIsTheBlankPokemon", "en_US": [ "This is the {STRVAR_1 28, 0, 0}\n", "Pokémon!" ] }, { - "id": "pl_msg_00000448_00018", + "id": "PreBattleSentences_Text_BlankWontLose", "en_US": "{STRVAR_1 28, 0, 0} won’t lose!" }, { - "id": "pl_msg_00000448_00019", + "id": "PreBattleSentences_Text_PleaseBlankBlank", "en_US": [ "Please {STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" diff --git a/res/text/scratch_off_cards.json b/res/text/scratch_off_cards.json index fad469c2cd..6cd1058ad7 100644 --- a/res/text/scratch_off_cards.json +++ b/res/text/scratch_off_cards.json @@ -2,7 +2,7 @@ "key": 51441, "messages": [ { - "id": "pl_msg_00000541_00000", + "id": "ScratchOffCards_Text_WouldYouLikeCards", "en_US": [ "Welcome!\r", "Would you like some Scratch-Off Cards?\n", @@ -10,27 +10,27 @@ ] }, { - "id": "pl_msg_00000541_00001", + "id": "ScratchOffCards_Text_WillYouBuyCards", "en_US": "Will you buy some Scratch-Off Cards?" }, { - "id": "pl_msg_00000541_00002", + "id": "ScratchOffCards_Text_Scratch", "en_US": "SCRATCH" }, { - "id": "pl_msg_00000541_00003", + "id": "ScratchOffCards_Text_Info", "en_US": "INFO" }, { - "id": "pl_msg_00000541_00004", + "id": "ScratchOffCards_Text_Cancel", "en_US": "CANCEL" }, { - "id": "pl_msg_00000541_00005", + "id": "ScratchOffCards_Text_PleaseVisitAgain", "en_US": "Please visit again." }, { - "id": "pl_msg_00000541_00006", + "id": "ScratchOffCards_Text_ScratchOffCardsInfo", "en_US": [ "You may buy three Scratch-Off Cards\n", "for {STRVAR_1 50, 0, 0} BP.\r", @@ -43,54 +43,54 @@ ] }, { - "id": "pl_msg_00000541_00007", + "id": "ScratchOffCards_Text_XBPForThreeCards", "en_US": [ "It will be {STRVAR_1 50, 2, 0} BP for three\n", "Scratch-Off Cards. Is that OK?" ] }, { - "id": "pl_msg_00000541_00008", + "id": "ScratchOffCards_Text_Dummy8", "garbage": 2 }, { - "id": "pl_msg_00000541_00009", + "id": "ScratchOffCards_Text_Dummy9", "garbage": 3 }, { - "id": "pl_msg_00000541_00010", + "id": "ScratchOffCards_Text_SelectThreeCards", "en_US": [ "OK, please select three\n", "Scratch-Off Cards.\r" ] }, { - "id": "pl_msg_00000541_00011", + "id": "ScratchOffCards_Text_YouWonOnXCards", "en_US": [ "Congratulations!\r", "You won on {STRVAR_1 50, 0, 0} Scratch-Off Card(s)!\r" ] }, { - "id": "pl_msg_00000541_00012", + "id": "ScratchOffCards_Text_NoRoomForItem", "en_US": [ "Too bad! There is no more room for\n", "the {STRVAR_1 8, 0, 0}!\r" ] }, { - "id": "pl_msg_00000541_00013", + "id": "ScratchOffCards_Text_ReceivedXItems", "en_US": "Received {STRVAR_1 50, 1, 0} {STRVAR_1 8, 0, 0}!\r" }, { - "id": "pl_msg_00000541_00014", + "id": "ScratchOffCards_Text_NotEnoughBP", "en_US": [ "I’m sorry, but you don’t have enough\n", "BP. Please come again." ] }, { - "id": "pl_msg_00000541_00015", + "id": "ScratchOffCards_Text_IntroduceScratchOffCards", "en_US": [ "Welcome!\n", "Would you like some Scratch-Off Cards?\r", diff --git a/res/text/sunyshore_city_unknown_house_2.json b/res/text/sunyshore_city_unknown_house_2.json deleted file mode 100644 index 332cd23f3d..0000000000 --- a/res/text/sunyshore_city_unknown_house_2.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "key": 21562, - "messages": [ - { - "id": "pl_msg_00000172_00000", - "garbage": 51 - }, - { - "id": "pl_msg_00000172_00001", - "garbage": 71 - }, - { - "id": "pl_msg_00000172_00002", - "garbage": 34 - }, - { - "id": "pl_msg_00000172_00003", - "garbage": 65 - }, - { - "id": "pl_msg_00000172_00004", - "garbage": 59 - }, - { - "id": "pl_msg_00000172_00005", - "garbage": 38 - }, - { - "id": "pl_msg_00000172_00006", - "garbage": 33 - }, - { - "id": "pl_msg_00000172_00007", - "garbage": 67 - } - ] -} diff --git a/res/text/unk_0444.json b/res/text/tough_words.json similarity index 100% rename from res/text/unk_0444.json rename to res/text/tough_words.json diff --git a/res/text/trainer_words.json b/res/text/trainer_words.json new file mode 100644 index 0000000000..f150842b88 --- /dev/null +++ b/res/text/trainer_words.json @@ -0,0 +1,157 @@ +{ + "key": 64422, + "messages": [ + { + "id": "TrainerWords_Text_MatchUp", + "en_US": "MATCH UP" + }, + { + "id": "TrainerWords_Text_No1", + "en_US": "NO. 1" + }, + { + "id": "TrainerWords_Text_Preparation", + "en_US": "PREPARATION" + }, + { + "id": "TrainerWords_Text_Wins", + "en_US": "WINS" + }, + { + "id": "TrainerWords_Text_NoMatch", + "en_US": "NO MATCH" + }, + { + "id": "TrainerWords_Text_Spirit", + "en_US": "SPIRIT" + }, + { + "id": "TrainerWords_Text_AceCard", + "en_US": "ACE CARD" + }, + { + "id": "TrainerWords_Text_ComeOn", + "en_US": "COME ON" + }, + { + "id": "TrainerWords_Text_Attack", + "en_US": "ATTACK" + }, + { + "id": "TrainerWords_Text_Surrender", + "en_US": "SURRENDER" + }, + { + "id": "TrainerWords_Text_Courage", + "en_US": "COURAGE" + }, + { + "id": "TrainerWords_Text_Talent", + "en_US": "TALENT" + }, + { + "id": "TrainerWords_Text_Strategy", + "en_US": "STRATEGY" + }, + { + "id": "TrainerWords_Text_Match", + "en_US": "MATCH" + }, + { + "id": "TrainerWords_Text_Victory", + "en_US": "VICTORY" + }, + { + "id": "TrainerWords_Text_Sense", + "en_US": "SENSE" + }, + { + "id": "TrainerWords_Text_Versus", + "en_US": "VERSUS" + }, + { + "id": "TrainerWords_Text_Fights", + "en_US": "FIGHTS" + }, + { + "id": "TrainerWords_Text_Power", + "en_US": "POWER" + }, + { + "id": "TrainerWords_Text_Challenge", + "en_US": "CHALLENGE" + }, + { + "id": "TrainerWords_Text_Strong", + "en_US": "STRONG" + }, + { + "id": "TrainerWords_Text_TakeItEasy", + "en_US": "TAKE IT EASY" + }, + { + "id": "TrainerWords_Text_Foe", + "en_US": "FOE" + }, + { + "id": "TrainerWords_Text_Genius", + "en_US": "GENIUS" + }, + { + "id": "TrainerWords_Text_Legend", + "en_US": "LEGEND" + }, + { + "id": "TrainerWords_Text_Battle", + "en_US": "BATTLE" + }, + { + "id": "TrainerWords_Text_Fight", + "en_US": "FIGHT" + }, + { + "id": "TrainerWords_Text_Revive", + "en_US": "REVIVE" + }, + { + "id": "TrainerWords_Text_Points", + "en_US": "POINTS" + }, + { + "id": "TrainerWords_Text_Serious", + "en_US": "SERIOUS" + }, + { + "id": "TrainerWords_Text_Loss", + "en_US": "LOSS" + }, + { + "id": "TrainerWords_Text_Partner", + "en_US": "PARTNER" + }, + { + "id": "TrainerWords_Text_Invincible", + "en_US": "INVINCIBLE" + }, + { + "id": "TrainerWords_Text_Easy", + "en_US": "EASY" + }, + { + "id": "TrainerWords_Text_Weak", + "en_US": "WEAK" + }, + { + "id": "TrainerWords_Text_EasyWin", + "en_US": "EASY WIN" + }, + { + "id": "TrainerWords_Text_Move", + "en_US": "MOVE" + }, + { + "id": "TrainerWords_Text_Trainer", + "en_US": "TRAINER" + } + ] +} diff --git a/res/text/tv_reporter_interviews.json b/res/text/tv_reporter_interviews.json index 6f39a22e73..4484c0c43f 100644 --- a/res/text/tv_reporter_interviews.json +++ b/res/text/tv_reporter_interviews.json @@ -2,7 +2,7 @@ "key": 17598, "messages": [ { - "id": "pl_msg_00000621_00000", + "id": "TVReporterInterviews_Text_MayIDoQuickInterview", "en_US": [ "Hello!\n", "I’m with Jubilife TV!\r", @@ -11,14 +11,14 @@ ] }, { - "id": "pl_msg_00000621_00001", + "id": "TVReporterInterviews_Text_ThatsTooBad", "en_US": [ "Oh, that’s too bad.\n", "I hope you can oblige another time!" ] }, { - "id": "pl_msg_00000621_00002", + "id": "TVReporterInterviews_Text_ThanksForSharingThoughts", "en_US": [ "Thank you for sharing your thoughts\n", "with us.\r", @@ -29,11 +29,11 @@ ] }, { - "id": "pl_msg_00000621_00003", + "id": "TVReporterInterviews_Text_Dummy3", "garbage": 7 }, { - "id": "pl_msg_00000621_00004", + "id": "TVReporterInterviews_Text_BattleTowerCorner", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -43,11 +43,11 @@ ] }, { - "id": "pl_msg_00000621_00005", + "id": "TVReporterInterviews_Text_Dummy5", "garbage": 7 }, { - "id": "pl_msg_00000621_00006", + "id": "TVReporterInterviews_Text_YourPokemonCorner", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -58,11 +58,11 @@ ] }, { - "id": "pl_msg_00000621_00007", + "id": "TVReporterInterviews_Text_Dummy7", "garbage": 7 }, { - "id": "pl_msg_00000621_00008", + "id": "TVReporterInterviews_Text_ThePoketchWatch", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -75,7 +75,7 @@ ] }, { - "id": "pl_msg_00000621_00009", + "id": "TVReporterInterviews_Text_ContestHall", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -86,11 +86,11 @@ ] }, { - "id": "pl_msg_00000621_00010", + "id": "TVReporterInterviews_Text_Dummy10", "garbage": 7 }, { - "id": "pl_msg_00000621_00011", + "id": "TVReporterInterviews_Text_RightOnPhotoCorner", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -99,7 +99,7 @@ ] }, { - "id": "pl_msg_00000621_00012", + "id": "TVReporterInterviews_Text_StreetCornerPersonalityCheckup", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -108,7 +108,7 @@ ] }, { - "id": "pl_msg_00000621_00013", + "id": "TVReporterInterviews_Text_ThreeCheersForPoffinCorner", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -117,11 +117,11 @@ ] }, { - "id": "pl_msg_00000621_00014", + "id": "TVReporterInterviews_Text_Dummy14", "garbage": 7 }, { - "id": "pl_msg_00000621_00015", + "id": "TVReporterInterviews_Text_AmitySquareWatch", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -132,7 +132,7 @@ ] }, { - "id": "pl_msg_00000621_00016", + "id": "TVReporterInterviews_Text_BattleFrontierFrontlineNews_Single", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -142,7 +142,7 @@ ] }, { - "id": "pl_msg_00000621_00017", + "id": "TVReporterInterviews_Text_InYourFaceInterview_Question1", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -151,7 +151,7 @@ ] }, { - "id": "pl_msg_00000621_00018", + "id": "TVReporterInterviews_Text_InYourFaceInterview_Question2", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -160,7 +160,7 @@ ] }, { - "id": "pl_msg_00000621_00019", + "id": "TVReporterInterviews_Text_InYourFaceInterview_Question3", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -169,7 +169,7 @@ ] }, { - "id": "pl_msg_00000621_00020", + "id": "TVReporterInterviews_Text_InYourFaceInterview_Question4", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -181,7 +181,7 @@ ] }, { - "id": "pl_msg_00000621_00021", + "id": "TVReporterInterviews_Text_BattleFrontierFrontlineNews_Multi", "en_US": [ "Thank you very much!\n", "Let’s not waste any time...\r", @@ -191,71 +191,71 @@ ] }, { - "id": "pl_msg_00000621_00022", + "id": "TVReporterInterviews_Text_Normal", "en_US": "Normal" }, { - "id": "pl_msg_00000621_00023", + "id": "TVReporterInterviews_Text_Fire", "en_US": "Fire" }, { - "id": "pl_msg_00000621_00024", + "id": "TVReporterInterviews_Text_Water", "en_US": "Water" }, { - "id": "pl_msg_00000621_00025", + "id": "TVReporterInterviews_Text_Electric", "en_US": "Electric" }, { - "id": "pl_msg_00000621_00026", + "id": "TVReporterInterviews_Text_Grass", "en_US": "Grass" }, { - "id": "pl_msg_00000621_00027", + "id": "TVReporterInterviews_Text_Ice", "en_US": "Ice" }, { - "id": "pl_msg_00000621_00028", + "id": "TVReporterInterviews_Text_Fighting", "en_US": "Fighting" }, { - "id": "pl_msg_00000621_00029", + "id": "TVReporterInterviews_Text_Poison", "en_US": "Poison" }, { - "id": "pl_msg_00000621_00030", + "id": "TVReporterInterviews_Text_Ground", "en_US": "Ground" }, { - "id": "pl_msg_00000621_00031", + "id": "TVReporterInterviews_Text_Flying", "en_US": "Flying" }, { - "id": "pl_msg_00000621_00032", + "id": "TVReporterInterviews_Text_Psychic", "en_US": "Psychic" }, { - "id": "pl_msg_00000621_00033", + "id": "TVReporterInterviews_Text_Bug", "en_US": "Bug" }, { - "id": "pl_msg_00000621_00034", + "id": "TVReporterInterviews_Text_Rock", "en_US": "Rock" }, { - "id": "pl_msg_00000621_00035", + "id": "TVReporterInterviews_Text_Ghost", "en_US": "Ghost" }, { - "id": "pl_msg_00000621_00036", + "id": "TVReporterInterviews_Text_Dragon", "en_US": "Dragon" }, { - "id": "pl_msg_00000621_00037", + "id": "TVReporterInterviews_Text_Dark", "en_US": "Dark" }, { - "id": "pl_msg_00000621_00038", + "id": "TVReporterInterviews_Text_Steel", "en_US": "Steel" } ] diff --git a/res/text/unk_0449.json b/res/text/union_room_sentences.json similarity index 60% rename from res/text/unk_0449.json rename to res/text/union_room_sentences.json index 4b041425a3..cfc22ffdbd 100644 --- a/res/text/unk_0449.json +++ b/res/text/union_room_sentences.json @@ -2,116 +2,116 @@ "key": 25225, "messages": [ { - "id": "pl_msg_00000449_00000", + "id": "UnionRoomSentences_Text_BlankHello", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Hello!" ] }, { - "id": "pl_msg_00000449_00001", + "id": "UnionRoomSentences_Text_GladToMeetYouILoveBlank", "en_US": [ "Glad to meet you!\n", "I love {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00002", + "id": "UnionRoomSentences_Text_ImBlankPleaseBattleMe", "en_US": [ "I’m a {STRVAR_1 28, 0, 0} Trainer!\n", "Please battle me!" ] }, { - "id": "pl_msg_00000449_00003", + "id": "UnionRoomSentences_Text_PleaseTradeImOfferingBlank", "en_US": [ "Please trade!\n", "I’m offering {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00004", + "id": "UnionRoomSentences_Text_PleaseTradeIWantBlank", "en_US": [ "Please trade!\n", "I want a {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00005", + "id": "UnionRoomSentences_Text_IveEnteredUnionRoom", "en_US": "I’ve entered the Union Room." }, { - "id": "pl_msg_00000449_00006", + "id": "UnionRoomSentences_Text_IWantToDrawBlank", "en_US": [ "Let’s draw! I want to draw\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00007", + "id": "UnionRoomSentences_Text_IveGotToGoBlank", "en_US": [ "I’ve got to go!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000449_00008", + "id": "UnionRoomSentences_Text_PleaseLeaveMeAlone", "en_US": "Please leave me alone..." }, { - "id": "pl_msg_00000449_00009", + "id": "UnionRoomSentences_Text_AnyoneWantToBlank", "en_US": [ "Anyone want to\n", "{STRVAR_1 28, 0, 0}?" ] }, { - "id": "pl_msg_00000449_00010", + "id": "UnionRoomSentences_Text_LetsBlank", "en_US": "Let’s {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000449_00011", + "id": "UnionRoomSentences_Text_WantToBlank", "en_US": "Want to {STRVAR_1 28, 0, 0}?" }, { - "id": "pl_msg_00000449_00012", + "id": "UnionRoomSentences_Text_IWantToBlank", "en_US": "I want to {STRVAR_1 28, 0, 0}!" }, { - "id": "pl_msg_00000449_00013", + "id": "UnionRoomSentences_Text_OK", "en_US": "OK!" }, { - "id": "pl_msg_00000449_00014", + "id": "UnionRoomSentences_Text_IDontWantToBlank", "en_US": [ "I don’t want to\n", "{STRVAR_1 28, 0, 0}." ] }, { - "id": "pl_msg_00000449_00015", + "id": "UnionRoomSentences_Text_IllWaitAtColosseum", "en_US": [ "I’ll go wait at the Colosseum\n", "now." ] }, { - "id": "pl_msg_00000449_00016", + "id": "UnionRoomSentences_Text_PleaseTalkToMe", "en_US": "Please talk to me!" }, { - "id": "pl_msg_00000449_00017", + "id": "UnionRoomSentences_Text_DoYouKnowWhereIAm", "en_US": "Do you know where I am?" }, { - "id": "pl_msg_00000449_00018", + "id": "UnionRoomSentences_Text_IWantToTradeMyBlank", "en_US": [ "I want to trade my {STRVAR_1 28, 0, 0}.\n", "Please talk to me." ] }, { - "id": "pl_msg_00000449_00019", + "id": "UnionRoomSentences_Text_IWantABlankBattle", "en_US": [ "I want a {STRVAR_1 28, 0, 0} battle!\n", "Please talk to me!" diff --git a/res/text/unk_0445.json b/res/text/union_words.json similarity index 100% rename from res/text/unk_0445.json rename to res/text/union_words.json diff --git a/res/text/unk_0353.json b/res/text/unk_0353.json index dcbd0e42b6..86e4c9fe48 100644 --- a/res/text/unk_0353.json +++ b/res/text/unk_0353.json @@ -442,111 +442,111 @@ "garbage": 1 }, { - "id": "pl_msg_00000353_00070", + "id": "Unk0353_Text_StandardCup", "en_US": "STANDARD" }, { - "id": "pl_msg_00000353_00071", + "id": "Unk0353_Text_FancyCup", "en_US": "FANCY" }, { - "id": "pl_msg_00000353_00072", + "id": "Unk0353_Text_LittleCup", "en_US": "LITTLE" }, { - "id": "pl_msg_00000353_00073", + "id": "Unk0353_Text_LightCup", "en_US": "LIGHT" }, { - "id": "pl_msg_00000353_00074", + "id": "Unk0353_Text_DoubleCup", "en_US": "DOUBLE" }, { - "id": "pl_msg_00000353_00075", + "id": "Unk0353_Text_RuleNoOfPokemon", "en_US": "No. of Pokémon:" }, { - "id": "pl_msg_00000353_00076", + "id": "Unk0353_Text_RulePokemonLevel", "en_US": "Pokémon level:" }, { - "id": "pl_msg_00000353_00077", + "id": "Unk0353_Text_RuleTotalLevels", "en_US": "Total levels:" }, { - "id": "pl_msg_00000353_00078", + "id": "Unk0353_Text_RuleHeight", "en_US": "Height:" }, { - "id": "pl_msg_00000353_00079", + "id": "Unk0353_Text_RuleWeight", "en_US": "Weight:" }, { - "id": "pl_msg_00000353_00080", + "id": "Unk0353_Text_RuleEvolvedPokemon", "en_US": "Evolved Pokémon:" }, { - "id": "pl_msg_00000353_00081", + "id": "Unk0353_Text_RuleSpecialPokemon", "en_US": "Special Pokémon:" }, { - "id": "pl_msg_00000353_00082", + "id": "Unk0353_Text_RuleSamePokemon", "en_US": "Same Pokémon:" }, { - "id": "pl_msg_00000353_00083", + "id": "Unk0353_Text_RuleSameItems", "en_US": "Same items:" }, { - "id": "pl_msg_00000353_00084", + "id": "Unk0353_Text_ValueNoOfPokemon", "en_US": "{STRVAR_1 50, 0, 0}" }, { - "id": "pl_msg_00000353_00085", + "id": "Unk0353_Text_ValueMaxLevel", "en_US": "Max. {STRVAR_1 52, 0, 0}" }, { - "id": "pl_msg_00000353_00086", + "id": "Unk0353_Text_ValueMaxTotalLevels", "en_US": "Max. {STRVAR_1 52, 0, 0}" }, { - "id": "pl_msg_00000353_00087", + "id": "Unk0353_Text_ValueMaxHeight", "en_US": "Max. {STRVAR_1 50, 0, 0}’ {STRVAR_1 50, 1, 0}”" }, { - "id": "pl_msg_00000353_00088", + "id": "Unk0353_Text_ValueMinHeight", "en_US": "Min. {STRVAR_1 50, 0, 0}’ {STRVAR_1 50, 1, 0}”" }, { - "id": "pl_msg_00000353_00089", + "id": "Unk0353_Text_ValueMaxWeight", "en_US": "Max. {STRVAR_1 51, 0, 0} lbs." }, { - "id": "pl_msg_00000353_00090", + "id": "Unk0353_Text_ValueMinWeight", "en_US": "Min. {STRVAR_1 51, 0, 0} lbs." }, { - "id": "pl_msg_00000353_00091", + "id": "Unk0353_Text_ValuePokemonPermitted", "en_US": "Permitted" }, { - "id": "pl_msg_00000353_00092", + "id": "Unk0353_Text_ValuePokemonBanned", "en_US": "Banned" }, { - "id": "pl_msg_00000353_00093", + "id": "Unk0353_Text_ValueItemsPermitted", "en_US": "Permitted" }, { - "id": "pl_msg_00000353_00094", + "id": "Unk0353_Text_ValueItemsBanned", "en_US": "Banned" }, { - "id": "pl_msg_00000353_00095", + "id": "Unk0353_Text_Cup", "en_US": "{STRVAR_1 26, 0, 0} Cup" }, { - "id": "pl_msg_00000353_00096", + "id": "Unk0353_Text_NoRestrictions", "en_US": "NO RESTRICTIONS" }, { diff --git a/res/text/unk_0439.json b/res/text/unk_0439.json deleted file mode 100644 index 83f574efcd..0000000000 --- a/res/text/unk_0439.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "key": 64422, - "messages": [ - { - "id": "pl_msg_00000439_00000", - "en_US": "MATCH UP" - }, - { - "id": "pl_msg_00000439_00001", - "en_US": "NO. 1" - }, - { - "id": "pl_msg_00000439_00002", - "en_US": "PREPARATION" - }, - { - "id": "pl_msg_00000439_00003", - "en_US": "WINS" - }, - { - "id": "pl_msg_00000439_00004", - "en_US": "NO MATCH" - }, - { - "id": "pl_msg_00000439_00005", - "en_US": "SPIRIT" - }, - { - "id": "pl_msg_00000439_00006", - "en_US": "ACE CARD" - }, - { - "id": "pl_msg_00000439_00007", - "en_US": "COME ON" - }, - { - "id": "pl_msg_00000439_00008", - "en_US": "ATTACK" - }, - { - "id": "pl_msg_00000439_00009", - "en_US": "SURRENDER" - }, - { - "id": "pl_msg_00000439_00010", - "en_US": "COURAGE" - }, - { - "id": "pl_msg_00000439_00011", - "en_US": "TALENT" - }, - { - "id": "pl_msg_00000439_00012", - "en_US": "STRATEGY" - }, - { - "id": "pl_msg_00000439_00013", - "en_US": "MATCH" - }, - { - "id": "pl_msg_00000439_00014", - "en_US": "VICTORY" - }, - { - "id": "pl_msg_00000439_00015", - "en_US": "SENSE" - }, - { - "id": "pl_msg_00000439_00016", - "en_US": "VERSUS" - }, - { - "id": "pl_msg_00000439_00017", - "en_US": "FIGHTS" - }, - { - "id": "pl_msg_00000439_00018", - "en_US": "POWER" - }, - { - "id": "pl_msg_00000439_00019", - "en_US": "CHALLENGE" - }, - { - "id": "pl_msg_00000439_00020", - "en_US": "STRONG" - }, - { - "id": "pl_msg_00000439_00021", - "en_US": "TAKE IT EASY" - }, - { - "id": "pl_msg_00000439_00022", - "en_US": "FOE" - }, - { - "id": "pl_msg_00000439_00023", - "en_US": "GENIUS" - }, - { - "id": "pl_msg_00000439_00024", - "en_US": "LEGEND" - }, - { - "id": "pl_msg_00000439_00025", - "en_US": "BATTLE" - }, - { - "id": "pl_msg_00000439_00026", - "en_US": "FIGHT" - }, - { - "id": "pl_msg_00000439_00027", - "en_US": "REVIVE" - }, - { - "id": "pl_msg_00000439_00028", - "en_US": "POINTS" - }, - { - "id": "pl_msg_00000439_00029", - "en_US": "SERIOUS" - }, - { - "id": "pl_msg_00000439_00030", - "en_US": "LOSS" - }, - { - "id": "pl_msg_00000439_00031", - "en_US": "PARTNER" - }, - { - "id": "pl_msg_00000439_00032", - "en_US": "INVINCIBLE" - }, - { - "id": "pl_msg_00000439_00033", - "en_US": "EASY" - }, - { - "id": "pl_msg_00000439_00034", - "en_US": "WEAK" - }, - { - "id": "pl_msg_00000439_00035", - "en_US": "EASY WIN" - }, - { - "id": "pl_msg_00000439_00036", - "en_US": "MOVE" - }, - { - "id": "pl_msg_00000439_00037", - "en_US": "TRAINER" - } - ] -} diff --git a/res/text/unused_eterna_city_condominiums_4f.json b/res/text/unused_eterna_city_condominiums_4f.json index c7c61aa4e3..37e5992682 100644 --- a/res/text/unused_eterna_city_condominiums_4f.json +++ b/res/text/unused_eterna_city_condominiums_4f.json @@ -2,7 +2,7 @@ "key": 37894, "messages": [ { - "id": "EternaCityCondominiums4F_Text_IveHadThisTMRecycleForSuchALongTimeNow", + "id": "EternaCityCondominiums4F_Text_HadTMLongTimeNow", "en_US": [ "I’ve had this TM Recycle for such\n", "a long time now.\r", @@ -13,7 +13,7 @@ ] }, { - "id": "EternaCityCondominiums4F_Text_FolksLikeMeHaveALongHistoryWeCanLookBackOn", + "id": "EternaCityCondominiums4F_Text_LongHistory", "en_US": [ "Folks like me have a long history\n", "we can look back on.\r", diff --git a/res/text/jubilife_city_unknown_house_1.json b/res/text/unused_jubilife_city_house_1.json similarity index 61% rename from res/text/jubilife_city_unknown_house_1.json rename to res/text/unused_jubilife_city_house_1.json index 3e0f9326c1..6f5f3ce074 100644 --- a/res/text/jubilife_city_unknown_house_1.json +++ b/res/text/unused_jubilife_city_house_1.json @@ -2,7 +2,7 @@ "key": 39278, "messages": [ { - "id": "pl_msg_00000025_00000", + "id": "JubilifeCityHouse1_Text_Dummy0", "garbage": 40 } ] diff --git a/res/text/jubilife_city_unknown_house_2.json b/res/text/unused_jubilife_city_house_2.json similarity index 61% rename from res/text/jubilife_city_unknown_house_2.json rename to res/text/unused_jubilife_city_house_2.json index b032dbf64d..6a167e0ef2 100644 --- a/res/text/jubilife_city_unknown_house_2.json +++ b/res/text/unused_jubilife_city_house_2.json @@ -2,7 +2,7 @@ "key": 17451, "messages": [ { - "id": "pl_msg_00000041_00000", + "id": "JubilifeCityHouse2_Text_Dummy0", "garbage": 32 } ] diff --git a/res/text/jubilife_city_unknown_house_3.json b/res/text/unused_jubilife_city_house_3.json similarity index 53% rename from res/text/jubilife_city_unknown_house_3.json rename to res/text/unused_jubilife_city_house_3.json index df7e794732..7131a686d7 100644 --- a/res/text/jubilife_city_unknown_house_3.json +++ b/res/text/unused_jubilife_city_house_3.json @@ -2,11 +2,11 @@ "key": 50242, "messages": [ { - "id": "pl_msg_00000052_00000", + "id": "JubilifeCityHouse3_Text_Dummy0", "garbage": 26 }, { - "id": "pl_msg_00000052_00001", + "id": "JubilifeCityHouse3_Text_Dummy1", "garbage": 34 } ] diff --git a/res/text/jubilife_city_unknown_house_4.json b/res/text/unused_jubilife_city_house_4.json similarity index 61% rename from res/text/jubilife_city_unknown_house_4.json rename to res/text/unused_jubilife_city_house_4.json index 4394893508..9c87e43f86 100644 --- a/res/text/jubilife_city_unknown_house_4.json +++ b/res/text/unused_jubilife_city_house_4.json @@ -2,7 +2,7 @@ "key": 19467, "messages": [ { - "id": "pl_msg_00000053_00000", + "id": "JubilifeCityHouse4_Text_Dummy0", "garbage": 81 } ] diff --git a/res/text/sunyshore_city_unknown_house_1.json b/res/text/unused_sunyshore_city_house_1.json similarity index 75% rename from res/text/sunyshore_city_unknown_house_1.json rename to res/text/unused_sunyshore_city_house_1.json index 0356a31068..80d7b34789 100644 --- a/res/text/sunyshore_city_unknown_house_1.json +++ b/res/text/unused_sunyshore_city_house_1.json @@ -2,7 +2,7 @@ "key": 21538, "messages": [ { - "id": "pl_msg_00000171_00000", + "id": "SunyshoreCityHouse1_Text_BurmyInterestingExample", "en_US": [ "Hmmm... The Pokémon BURMY is an\n", "interesting example...\r", @@ -11,7 +11,7 @@ ] }, { - "id": "pl_msg_00000171_00001", + "id": "SunyshoreCityHouse1_Text_DoYouHaveAllBurmy", "en_US": [ "You know that Pokémon BURMY, and how\n", "it comes in different forms?\r", @@ -20,7 +20,7 @@ ] }, { - "id": "pl_msg_00000171_00002", + "id": "SunyshoreCityHouse1_Text_NotASingleBurmy", "en_US": [ "Aww, you don’t even have a single\n", "BURMY?\r", @@ -29,7 +29,7 @@ ] }, { - "id": "pl_msg_00000171_00003", + "id": "SunyshoreCityHouse1_Text_CoolIfDifferentBurmy", "en_US": [ "Hmm...\r", "It’d be cool if you had all the\n", @@ -37,7 +37,7 @@ ] }, { - "id": "pl_msg_00000171_00004", + "id": "SunyshoreCityHouse1_Text_ThatsAllBurmy", "en_US": [ "Cool! That’s all the different kinds\n", "of BURMY! I feel giddy!\r", @@ -46,14 +46,14 @@ ] }, { - "id": "pl_msg_00000171_00005", + "id": "SunyshoreCityHouse1_Text_BagIsCrammedFull", "en_US": [ "Whoops, your Bag is crammed full!\n", "I’ll give this to you later." ] }, { - "id": "pl_msg_00000171_00006", + "id": "SunyshoreCityHouse1_Text_YoureGood", "en_US": [ "You’re good!\n", "You’d make an awesome Bug Maniac!" diff --git a/res/text/unused_sunyshore_city_house_2.json b/res/text/unused_sunyshore_city_house_2.json new file mode 100644 index 0000000000..c893ea9e26 --- /dev/null +++ b/res/text/unused_sunyshore_city_house_2.json @@ -0,0 +1,37 @@ +{ + "key": 21562, + "messages": [ + { + "id": "SunyshoreCityHouse2_Text_Dummy0", + "garbage": 51 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy1", + "garbage": 71 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy2", + "garbage": 34 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy3", + "garbage": 65 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy4", + "garbage": 59 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy5", + "garbage": 38 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy6", + "garbage": 33 + }, + { + "id": "SunyshoreCityHouse2_Text_Dummy7", + "garbage": 67 + } + ] +} diff --git a/res/text/verity_lakefront_unknown_house.json b/res/text/unused_verity_lakefront_house.json similarity index 59% rename from res/text/verity_lakefront_unknown_house.json rename to res/text/unused_verity_lakefront_house.json index 1ee50550ba..5fb01fac7c 100644 --- a/res/text/verity_lakefront_unknown_house.json +++ b/res/text/unused_verity_lakefront_house.json @@ -2,7 +2,7 @@ "key": 9216, "messages": [ { - "id": "pl_msg_00000400_00000", + "id": "VerityLakefrontHouse1_Text_Dummy0", "garbage": 32 } ] diff --git a/res/text/vs_seeker.json b/res/text/vs_seeker.json index 718ef1432a..0d8d58d32b 100644 --- a/res/text/vs_seeker.json +++ b/res/text/vs_seeker.json @@ -2,7 +2,7 @@ "key": 12640, "messages": [ { - "id": "pl_msg_00000539_00000", + "id": "VsSeeker_Text_BatteryIsntChargedEnough", "en_US": [ "The battery isn’t charged enough.\r", "Number of steps required to fully\n", @@ -10,7 +10,7 @@ ] }, { - "id": "pl_msg_00000539_00001", + "id": "VsSeeker_Text_NoTrainersWithinRange", "en_US": [ "There are no Trainers within range\n", "who can battle...\r", @@ -18,7 +18,7 @@ ] }, { - "id": "pl_msg_00000539_00002", + "id": "VsSeeker_Text_NoTrainersReadyToBattle", "en_US": [ "The other Trainers don’t appear\n", "to be ready for battle.\r", diff --git a/res/text/unk_0450.json b/res/text/win_sentences.json similarity index 66% rename from res/text/unk_0450.json rename to res/text/win_sentences.json index 6463102cce..63057958ec 100644 --- a/res/text/unk_0450.json +++ b/res/text/win_sentences.json @@ -2,134 +2,134 @@ "key": 2295, "messages": [ { - "id": "pl_msg_00000450_00000", + "id": "WinSentences_Text_IWinBlank", "en_US": [ "I win!\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00001", + "id": "WinSentences_Text_IWonWithBlank", "en_US": [ "I won!\n", "I won with {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00002", + "id": "WinSentences_Text_BlankIsStrongIsntIt", "en_US": [ "{STRVAR_1 28, 0, 0} is strong,\n", "isn’t it?" ] }, { - "id": "pl_msg_00000450_00003", + "id": "WinSentences_Text_ItsBlankBlankAfterAll", "en_US": [ "It’s {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0} after all!" ] }, { - "id": "pl_msg_00000450_00004", + "id": "WinSentences_Text_BlankYay", "en_US": "{STRVAR_1 28, 0, 0}, yay!" }, { - "id": "pl_msg_00000450_00005", + "id": "WinSentences_Text_YayBlankBlank", "en_US": [ "Yay, {STRVAR_1 28, 0, 0}!\n", "{STRVAR_1 28, 1, 0}!" ] }, { - "id": "pl_msg_00000450_00006", + "id": "WinSentences_Text_SorryItsBlankBlank", "en_US": [ "Sorry, it’s {STRVAR_1 28, 0, 0}\n", "{STRVAR_1 28, 1, 0}." ] }, { - "id": "pl_msg_00000450_00007", + "id": "WinSentences_Text_BlankThankYou", "en_US": [ "{STRVAR_1 28, 0, 0}!\n", "Thank you!" ] }, { - "id": "pl_msg_00000450_00008", + "id": "WinSentences_Text_TheWayIFeelNowIsBlank", "en_US": [ "The way I feel now is\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00009", + "id": "WinSentences_Text_LookAtMyBlank", "en_US": [ "I wanted people to look at\n", "my {STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00010", + "id": "WinSentences_Text_AllThanksToBlank", "en_US": [ "It’s all thanks to\n", "{STRVAR_1 28, 0, 0}." ] }, { - "id": "pl_msg_00000450_00011", + "id": "WinSentences_Text_MightHaveWonWithBlank", "en_US": [ "I might have won with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00012", + "id": "WinSentences_Text_IGetHappiestWithBlank", "en_US": [ "I get the happiest with\n", "{STRVAR_1 28, 0, 0}!" ] }, { - "id": "pl_msg_00000450_00013", + "id": "WinSentences_Text_BlankSecuredTheVictory", "en_US": [ "{STRVAR_1 28, 0, 0} secured\n", "the victory!" ] }, { - "id": "pl_msg_00000450_00014", + "id": "WinSentences_Text_ThisBlankWasReallyGood", "en_US": [ "This {STRVAR_1 28, 0, 0}\n", "was really good!" ] }, { - "id": "pl_msg_00000450_00015", + "id": "WinSentences_Text_BlankWasFunWasntIt", "en_US": [ "{STRVAR_1 28, 0, 0}\n", "was fun, wasn’t it?" ] }, { - "id": "pl_msg_00000450_00016", + "id": "WinSentences_Text_HuhBlank", "en_US": [ "Huh?\n", "{STRVAR_1 28, 0, 0}?!" ] }, { - "id": "pl_msg_00000450_00017", + "id": "WinSentences_Text_BlankIsToughest", "en_US": "{STRVAR_1 28, 0, 0} is the toughest!" }, { - "id": "pl_msg_00000450_00018", + "id": "WinSentences_Text_HappyBlankHappy", "en_US": [ "Happy!\n", "{STRVAR_1 28, 0, 0} happy!" ] }, { - "id": "pl_msg_00000450_00019", + "id": "WinSentences_Text_HowsThatBlank", "en_US": [ "How’s that?!\n", "{STRVAR_1 28, 0, 0}!" diff --git a/res/trainers/meson.build b/res/trainers/meson.build index 0f38a158c4..d9f0b4dae6 100644 --- a/res/trainers/meson.build +++ b/res/trainers/meson.build @@ -6,26 +6,6 @@ # AI behavior flags, and items on-hand. # - trpoke - party information for individual trainers in-game -trainer_data_dir = meson.current_source_dir() / 'data' - -# 1. Build the list of trainer stems, which define the files to be scanned -# by the batch processor below. While building this list, assert that each -# stem must have a corresponding data file. -trainer_consts = fs.read(trainers_txt).splitlines() -trainer_stems = [] -trainer_data_files = [] -foreach trainer : trainer_consts - # `substring` here strips the `TRAINER_` prefix - trainer_stem = trainer.substring(8).to_lower() - trainer_stems += trainer_stem - trainer_data_files += files(trainer_data_dir / (trainer_stem + '.json')) -endforeach - -# 2. Build the environment of trainer stems to be passed to the batch processor. -trainer_env = environment() -trainer_env.append('TRAINERS', trainer_stems, separator: ';') - -# 3. Process the trainer data files in batch and emit header data + party lists. trainer_data = custom_target('trainer_data', output: [ 'trdata.narc', @@ -41,13 +21,10 @@ trainer_data = custom_target('trainer_data', trainerproc_exe, '-M', '@DEPFILE@', '-o', meson.current_build_dir(), - trainer_data_dir, + meson.global_build_root() / 'generated' / 'trainers.h', + meson.current_source_dir() / 'data', ], - env: trainer_env, - depend_files: [ - trainer_data_files, - ], depfile: 'trainer_data.d', ) diff --git a/src/applications/easy_chat/main.c b/src/applications/easy_chat/main.c index f6f7399c09..3e031f270b 100644 --- a/src/applications/easy_chat/main.c +++ b/src/applications/easy_chat/main.c @@ -3,7 +3,6 @@ #include #include "struct_decls/struct_020998EC_decl.h" -#include "struct_defs/sentence.h" #include "applications/easy_chat/abc_mode.h" #include "applications/easy_chat/defs.h" @@ -11,6 +10,8 @@ #include "applications/easy_chat/struct_ov20_021D2128_decl.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "heap.h" #include "overlay_manager.h" #include "sound.h" @@ -19,7 +20,6 @@ #include "system.h" #include "touch_screen.h" #include "touch_screen_actions.h" -#include "unk_02014A84.h" #include "unk_020998EC.h" enum EasyChatTouchButton { @@ -34,7 +34,7 @@ enum EasyChatTouchButton { #define EC_JOY_REPEAT(buttons) (easyChatApp->pressedKeysRepeatable & (buttons)) static EasyChatApp *EasyChatApp_New(ApplicationManager *appMan); -static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, Sentence *param1); +static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1); static void EasyChat_FreeAppData(EasyChatApp *easyChatApp, ApplicationManager *appMan); static int EasyChat_Main_Initial(EasyChatApp *easyChatApp, int *param1); static int EasyChat_Main_OneWord(EasyChatApp *easyChatApp, int *param1); @@ -201,14 +201,14 @@ static EasyChatApp *EasyChatApp_New(ApplicationManager *appMan) return easyChatApp; } -static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0F64(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { - param0->unk_00 = Sentence_GetType(param1); - param0->unk_03 = sub_02014CD4(param0->unk_00); - param0->unk_02 = Sentence_GetID(param1); + param0->unk_00 = EasyChatSentence_GetType(param1); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); + param0->unk_02 = EasyChatSentence_GetID(param1); } -static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { param0->unk_02++; @@ -220,13 +220,13 @@ static void ov20_021D0F88(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) param0->unk_00 = 0; } - param0->unk_03 = sub_02014CD4(param0->unk_00); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); } - sub_02014CE0(param1, param0->unk_00, param0->unk_02); + EasyChatSentence_SetTypeAndID(param1, param0->unk_00, param0->unk_02); } -static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) +static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, EasyChatSentence *param1) { param0->unk_02--; @@ -237,11 +237,11 @@ static void ov20_021D0FCC(UnkStruct_ov20_021D0F64 *param0, Sentence *param1) param0->unk_00 = (5 - 1); } - param0->unk_03 = sub_02014CD4(param0->unk_00); + param0->unk_03 = EasyChatSentence_GetBankEntryCountForType(param0->unk_00); param0->unk_02 = (param0->unk_03 - 1); } - sub_02014CE0(param1, param0->unk_00, param0->unk_02); + EasyChatSentence_SetTypeAndID(param1, param0->unk_00, param0->unk_02); } static void EasyChat_FreeAppData(EasyChatApp *easyChatApp, ApplicationManager *appMan) @@ -990,7 +990,7 @@ static BOOL ov20_021D1BB0(EasyChatApp *easyChatApp) easyChatApp->words[easyChatApp->currentWordSlot] = v1; break; case EASY_CHAT_TYPE_SENTENCE: - Sentence_SetWord(&easyChatApp->sentence, easyChatApp->currentWordSlot, v1); + EasyChatSentence_SetWord(&easyChatApp->sentence, easyChatApp->currentWordSlot, v1); break; } @@ -1074,7 +1074,7 @@ static void ov20_021D1C90(EasyChatApp *easyChatApp, int *param1) Sound_PlayEffect(SEQ_SE_CONFIRM); if (easyChatApp->type == EASY_CHAT_TYPE_SENTENCE) { - Sentence_ClearUnusedWords(&easyChatApp->sentence); + EasyChatSentence_ClearUnusedWords(&easyChatApp->sentence); } EasyChatArgs_UpdateContent(easyChatApp->args, easyChatApp->words, &easyChatApp->sentence); @@ -1148,7 +1148,7 @@ static BOOL EasyChat_IsEntryComplete(EasyChatApp *easyChatApp) case EASY_CHAT_TYPE_TWO_WORDS: return easyChatApp->words[0] != WORD_NONE && easyChatApp->words[1] != WORD_NONE; case EASY_CHAT_TYPE_SENTENCE: - return Sentence_IsComplete(&easyChatApp->sentence); + return EasyChatSentence_IsComplete(&easyChatApp->sentence); } return FALSE; @@ -1231,13 +1231,13 @@ u32 EasyChat_GetMode(const EasyChatApp *easyChatApp) u32 ov20_021D1F9C(const EasyChatApp *easyChatApp) { - return Sentence_GetType(&easyChatApp->sentence); + return EasyChatSentence_GetType(&easyChatApp->sentence); } u16 EasyChat_GetWordAtSlot(const EasyChatApp *easyChatApp, int slot) { if (easyChatApp->type == EASY_CHAT_TYPE_SENTENCE) { - return Sentence_GetWord(&easyChatApp->sentence, slot); + return EasyChatSentence_GetWord(&easyChatApp->sentence, slot); } else { return easyChatApp->words[slot]; } @@ -1245,7 +1245,7 @@ u16 EasyChat_GetWordAtSlot(const EasyChatApp *easyChatApp, int slot) String *ov20_021D1FC0(const EasyChatApp *easyChatApp, u32 param1) { - return Sentence_GetTemplateString(&easyChatApp->sentence, param1); + return EasyChatSentence_GetTemplateString(&easyChatApp->sentence, param1); } u32 EasyChat_GetCurrentWordSlot(const EasyChatApp *easyChatApp) diff --git a/src/applications/easy_chat/ov20_021D2EA4.c b/src/applications/easy_chat/ov20_021D2EA4.c index ce45258ea3..2f9cf1a251 100644 --- a/src/applications/easy_chat/ov20_021D2EA4.c +++ b/src/applications/easy_chat/ov20_021D2EA4.c @@ -12,6 +12,7 @@ #include "bg_window.h" #include "charcode.h" #include "colored_arrow.h" +#include "easy_chat_words.h" #include "font.h" #include "graphics.h" #include "heap.h" @@ -22,7 +23,6 @@ #include "string_gf.h" #include "string_template.h" #include "text.h" -#include "unk_02014D38.h" typedef struct { s16 unk_00; @@ -406,7 +406,7 @@ static void ov20_021D351C(UnkStruct_ov20_021D30F8 *param0, Window *param1, const u32 v1; ov20_021D34CC(param2, &v0); - sub_02014DB8(param3, param0->unk_4C); + EasyChatWord_ToString(param3, param0->unk_4C); v1 = (v0.unk_00 + (96 / 2)) - (Font_CalcStringWidth(FONT_MESSAGE, param0->unk_4C, 0) / 2); diff --git a/src/applications/frontier/battle_arcade/main.c b/src/applications/frontier/battle_arcade/main.c index 8dbe2a7e19..c43e16d9f6 100644 --- a/src/applications/frontier/battle_arcade/main.c +++ b/src/applications/frontier/battle_arcade/main.c @@ -728,7 +728,7 @@ static void FreeAssets(BattleArcadeApp *app) } } - u8 numMons = BattleArcade_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleArcade_GetPlayerPartySize(app->challengeType, TRUE); for (i = 0; i < numMons; i++) { if (app->monSprites[i] != NULL) { @@ -813,7 +813,7 @@ static void LoadAssets(BattleArcadeApp *app) BattleArcadeAppSprite_SetDrawFlag(app->tileSprites[i], FALSE); } - u8 numMons = BattleArcade_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleArcade_GetPlayerPartySize(app->challengeType, TRUE); u16 monYOffset, itemsYOffset; if (!BattleArcade_IsMultiPlayerChallenge(app->challengeType)) { @@ -1430,7 +1430,7 @@ static u8 GetRandomCategory(BattleArcadeApp *app, u8 weightsIndex) static void UpdateItemSprites(BattleArcadeApp *app) { - u8 partySize = BattleArcade_GetPartySize(app->challengeType, TRUE); + u8 partySize = BattleArcade_GetPlayerPartySize(app->challengeType, TRUE); u8 opponentPartySize = BattleArcade_GetOpponentPartySize(app->challengeType, TRUE); for (u8 i = 0; i < partySize; i++) { diff --git a/src/applications/frontier/battle_castle/opponent_app.c b/src/applications/frontier/battle_castle/opponent_app.c index b82586b013..2a03b81be5 100644 --- a/src/applications/frontier/battle_castle/opponent_app.c +++ b/src/applications/frontier/battle_castle/opponent_app.c @@ -1082,7 +1082,7 @@ static void FreeAssets(BattleCastleOpponentApp *app) } } - u8 numMons = ov104_0223B7DC(app->challengeType, 1); + u8 numMons = BattleCastle_GetOpponentPartySize(app->challengeType, 1); for (i = 0; i < numMons; i++) { BattleCastleAppSprite_Free(app->ballSprites[i]); @@ -1161,7 +1161,7 @@ static void LoadAssets(BattleCastleOpponentApp *app) ballXOffset = 28; } - u8 numMons = ov104_0223B7DC(app->challengeType, 1); + u8 numMons = BattleCastle_GetOpponentPartySize(app->challengeType, 1); for (i = 0; i < numMons; i++) { app->ballSprites[i] = BattleCastleAppSprite_New(&app->spriteMan, 0, 0, 0, ANIM_ID_SHAKING_POKE_BALL, 64 * i + ballXOffset, 62, 2, NULL); @@ -1579,7 +1579,7 @@ static void PrintAllMonsHP(BattleCastleOpponentApp *app, Window *window) baseXOffset = 4; } - u8 numMons = ov104_0223B7DC(app->challengeType, 1); + u8 numMons = BattleCastle_GetOpponentPartySize(app->challengeType, 1); for (int i = 0; i < numMons; i++) { if (!app->identityUnlockedForSlot[i]) { @@ -1610,7 +1610,7 @@ static void PrintAllMonsLevelAndGender(BattleCastleOpponentApp *app, Window *win genderXOffset = 48; } - u8 numMons = ov104_0223B7DC(app->challengeType, 1); + u8 numMons = BattleCastle_GetOpponentPartySize(app->challengeType, 1); for (int i = 0; i < numMons; i++) { Pokemon *mon = Party_GetPokemonBySlotIndex(app->opponentsParty, i); @@ -2752,7 +2752,7 @@ static void FreeListMenu(BattleCastleOpponentApp *app) static void UpdatePokemonGraphics(BattleCastleOpponentApp *app) { - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { Pokemon *mon = Party_GetPokemonBySlotIndex(app->opponentsParty, i); @@ -2812,7 +2812,7 @@ static const u16 sRankUpMessages[3][3] = { static void IncreaseRank(BattleCastleOpponentApp *app, u8 slot, u8 menuOption) { - u8 unused = BattleCastle_GetPartySize(app->challengeType, FALSE); + u8 unused = BattleCastle_GetPlayerPartySize(app->challengeType, FALSE); u8 rankType; if (menuOption == MENU_ENTRY_RANK_UP_SUMMARY) { @@ -2874,7 +2874,7 @@ static void IncreaseRank(BattleCastleOpponentApp *app, u8 slot, u8 menuOption) static void UpdateAllFlagSprites(BattleCastleOpponentApp *app) { - u8 numMons = ov104_0223B7DC(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetOpponentPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { UpdateFlagSprites(app, i); diff --git a/src/applications/frontier/battle_castle/self_app.c b/src/applications/frontier/battle_castle/self_app.c index 15d4067c4c..37b51cd6d7 100644 --- a/src/applications/frontier/battle_castle/self_app.c +++ b/src/applications/frontier/battle_castle/self_app.c @@ -1404,7 +1404,7 @@ static void FreeAssets(BattleCastleSelfApp *app) BattleCastleAppSprite_Free(app->partnerCursorSprite); BattleCastleAppSprite_Free(app->itemSelectCursorSprite); - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { BattleCastleAppSprite_Free(app->monSprites[i]); @@ -1493,7 +1493,7 @@ static void LoadAssets(BattleCastleSelfApp *app) iconXOffset = 32 + 8; } - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { app->itemIconSprites[i] = BattleCastleAppSprite_New(&app->spriteMan, 2, 2, 2, 0, 64 * i + iconXOffset, 62, 2, NULL); @@ -1917,7 +1917,7 @@ static void PrintAllMonsHP(BattleCastleSelfApp *app, Window *window) { Window_FillTilemap(window, 0); - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { PrintMonHP(app, window, i, FALSE); @@ -1960,7 +1960,7 @@ static void PrintMonHP(BattleCastleSelfApp *app, Window *window, u8 slot, u8 isI static void PrintAllMonsLevelAndGender(BattleCastleSelfApp *app, Window *window) { - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { PrintMonLevelAndGender(app, window, i, FALSE); @@ -3449,7 +3449,7 @@ static void CloseSummaryScreen(BattleCastleSelfApp *app) static void UpdatePokemonGraphics(BattleCastleSelfApp *app) { - u8 numMons = BattleCastle_GetPartySize(app->challengeType, TRUE); + u8 numMons = BattleCastle_GetPlayerPartySize(app->challengeType, TRUE); for (int i = 0; i < numMons; i++) { Pokemon *mon = Party_GetPokemonBySlotIndex(app->party, i); @@ -3469,7 +3469,7 @@ static void UpdatePokemonGraphics(BattleCastleSelfApp *app) static void IncreaseRank(BattleCastleSelfApp *app, u8 slot, u8 menuOption) { - u8 unused = BattleCastle_GetPartySize(app->challengeType, FALSE); + u8 unused = BattleCastle_GetPlayerPartySize(app->challengeType, FALSE); u8 rankType; if (menuOption == MENU_ENTRY_RANK_UP_HEALING) { diff --git a/src/applications/frontier/battle_factory/main.c b/src/applications/frontier/battle_factory/main.c index f62233b511..7ba2caac66 100644 --- a/src/applications/frontier/battle_factory/main.c +++ b/src/applications/frontier/battle_factory/main.c @@ -743,7 +743,7 @@ static BOOL State_SetupAppStrings(BattleFactoryApp *app) static void PrintStringsForInitialSelect(BattleFactoryApp *app) { int i; - u8 numMons = BattleFactory_GetPartySize(app->challengeType); + u8 numMons = BattleFactory_GetPlayerPartySize(app->challengeType); SetMenuWasCancelled(app, FALSE); app->monCursor = BattleFactoryAppCursor_New(&app->spriteMan, app->numPokeballs, app->numPokeballs, CURSOR_MODE_MON_ONLY, app->startingSlot, sInitialSelectCursorPositions, NULL); @@ -1062,7 +1062,7 @@ static void RemoveSelectedMonUnderCursor(BattleFactoryApp *app) static BOOL State_ConfirmPartySelection(BattleFactoryApp *app) { int i; - u8 numMons = BattleFactory_GetPartySize(app->challengeType); + u8 numMons = BattleFactory_GetPlayerPartySize(app->challengeType); switch (app->subState) { case 0: @@ -1245,7 +1245,7 @@ static BOOL State_ConfirmPartySelection(BattleFactoryApp *app) static BOOL State_ReturnToInitialPartySelection(BattleFactoryApp *app) { - u8 numMons = BattleFactory_GetPartySize(app->challengeType); + u8 numMons = BattleFactory_GetPlayerPartySize(app->challengeType); switch (app->subState) { case 0: @@ -1352,7 +1352,7 @@ static BOOL State_ReturnToInitialPartySelection(BattleFactoryApp *app) static void RedisplayInfoForInitialSelection(BattleFactoryApp *app) { - BattleFactory_GetPartySize(app->challengeType); + BattleFactory_GetPlayerPartySize(app->challengeType); for (int i = 0; i < app->numMonsSelected; i++) { PrintMonNameAndGender(app, &app->windows[WINDOW_SELECTED_MON_NAME_1 + i], app->selectedIndices[i], 0, 0, 15, 2, 0, FONT_SYSTEM, app->personalParty); @@ -1781,7 +1781,7 @@ static void RecreateReceivableMonSprite(BattleFactoryApp *app) static BOOL State_ChangeExchangeToReceiveSelect(BattleFactoryApp *app) { int i; - u8 numMons = BattleFactory_GetPartySize(app->challengeType); + u8 numMons = BattleFactory_GetPlayerPartySize(app->challengeType); switch (app->subState) { case 0: @@ -2887,7 +2887,7 @@ void CommCmd_BattleFactoryHandleSelectionUpdate(int netID, int unused, void *dat const u16 *payload = data; int offset = 0; - BattleFactory_GetPartySize(app->challengeType); + BattleFactory_GetPlayerPartySize(app->challengeType); if (CommSys_CurNetId() == netID) { return; @@ -2915,7 +2915,7 @@ void CommCmd_BattleFactoryDummy2(int netID, int unused, void *data, void *contex static void UpdatePartnersMonsListing(BattleFactoryApp *app) { - u8 numMons = BattleFactory_GetPartySize(app->challengeType); + u8 numMons = BattleFactory_GetPlayerPartySize(app->challengeType); if (app->clearPartnerInfo == TRUE) { Window_ClearAndCopyToVRAM(&app->windows[WINDOW_PARTNERS_NAME]); diff --git a/src/applications/frontier/battle_hall/main.c b/src/applications/frontier/battle_hall/main.c index fd725ece4d..8ac2141c2e 100644 --- a/src/applications/frontier/battle_hall/main.c +++ b/src/applications/frontier/battle_hall/main.c @@ -11,6 +11,7 @@ #include "overlay104/ov104_0222DCE0.h" #include "overlay104/ov104_0223AF58.h" +#include "battle_hall_save.h" #include "bg_window.h" #include "comm_command_frontier.h" #include "communication_system.h" @@ -45,7 +46,6 @@ #include "system.h" #include "text.h" #include "trainer_info.h" -#include "unk_02030108.h" #include "unk_020363E8.h" #include "vram_transfer.h" diff --git a/src/applications/mail.c b/src/applications/mail.c index f65581ae96..b98406d3f5 100644 --- a/src/applications/mail.c +++ b/src/applications/mail.c @@ -10,6 +10,7 @@ #include "applications/mail_viewer.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "game_records.h" #include "heap.h" #include "item.h" @@ -19,7 +20,6 @@ #include "save_player.h" #include "savedata.h" #include "string_gf.h" -#include "unk_02014A84.h" #include "res/text/bank/easy_chat.h" @@ -32,7 +32,7 @@ typedef struct MailApp { EasyChatArgs *easyChatArgs; ApplicationManager *appMan; MailViewerAppArgs *viewerArgs; - Sentence selectedSentence; + EasyChatSentence selectedSentence; } MailApp; enum MailAppState { @@ -214,7 +214,7 @@ static MailViewerAppArgs *MailViewerAppArgs_New(Mail *mail, enum HeapID heapID) } for (u16 i = 0; i < MAIL_MAX_SENTENCES; i++) { - Sentence_Copy(&args->sentences[i], Mail_GetSentence(mail, i)); + EasyChatSentence_Copy(&args->sentences[i], Mail_GetSentence(mail, i)); } return args; @@ -337,10 +337,10 @@ static BOOL MailApp_Main(ApplicationManager *appMan, int *state) case MAIL_STATE_EDIT_SENTENCE_START: mailApp->easyChatArgs = EasyChatArgs_New(EASY_CHAT_TYPE_SENTENCE, EasyChat_Text_ChooseWordOrPhrase, args->saveData, mailApp->heapID); - if (Sentence_IsValid(&mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex])) { - Sentence_Copy(&mailApp->selectedSentence, &mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex]); + if (EasyChatSentence_IsValid(&mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex])) { + EasyChatSentence_Copy(&mailApp->selectedSentence, &mailApp->viewerArgs->sentences[mailApp->viewerArgs->sentenceIndex]); } else { - Sentence_InitWithType(&mailApp->selectedSentence, 3); + EasyChatSentence_InitWithType(&mailApp->selectedSentence, EASY_CHAT_SENTENCE_TYPE_GENERAL); } EasyChatArgs_SetSentence(mailApp->easyChatArgs, &mailApp->selectedSentence); diff --git a/src/applications/mail_viewer.c b/src/applications/mail_viewer.c index d9fcf8e258..f07e2e4c35 100644 --- a/src/applications/mail_viewer.c +++ b/src/applications/mail_viewer.c @@ -7,6 +7,7 @@ #include "applications/mail.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "font.h" #include "game_options.h" @@ -30,7 +31,6 @@ #include "sys_task_manager.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "vram_transfer.h" #include "res/fonts/pl_font.naix" @@ -188,7 +188,7 @@ BOOL MailViewer_Exit(ApplicationManager *appMan, int *state) static BOOL MailViewer_AreSentencesEmpty(MailViewerApp *mailViewerApp) { for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - if (Sentence_IsValid(&mailViewerApp->args->sentences[i])) { + if (EasyChatSentence_IsValid(&mailViewerApp->args->sentences[i])) { return FALSE; } } @@ -815,11 +815,11 @@ static void MailViewer_RemoveWindows(MailViewerApp *mailViewerApp) static void MailViewer_PrintText(MailViewerApp *mailViewerApp) { for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - if (!Sentence_IsValid(&mailViewerApp->args->sentences[i])) { + if (!EasyChatSentence_IsValid(&mailViewerApp->args->sentences[i])) { continue; } - String *sentenceStr = Sentence_AsString(&mailViewerApp->args->sentences[i], mailViewerApp->heapID); + String *sentenceStr = EasyChatSentence_ToString(&mailViewerApp->args->sentences[i], mailViewerApp->heapID); Text_AddPrinterWithParamsAndColor(&mailViewerApp->windows[i], FONT_MESSAGE, sentenceStr, 0, 0, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 0), NULL); String_Free(sentenceStr); diff --git a/src/applications/party_menu/main.c b/src/applications/party_menu/main.c index 07b8bfbd26..4d76f6bcaf 100644 --- a/src/applications/party_menu/main.c +++ b/src/applications/party_menu/main.c @@ -2149,10 +2149,10 @@ static int HandleGameWindowEvent(PartyMenuApplication *application) if (application->partyMenu->battleRegulation != NULL) { switch (BattleRegulation_ValidatePartySelection(application->partyMenu->battleRegulation, application->partyMenu->party, application->heightWeight, application->partyMenu->selectionOrder)) { - case BATTLE_REGULATION_VALIDATION_SUCCESS: + case BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS: break; - case BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED: { + case BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED: { String *v1; int v2; @@ -2167,12 +2167,12 @@ static int HandleGameWindowEvent(PartyMenuApplication *application) application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); return PARTY_MENU_STATE_SHOW_MESSAGE_THEN_NEXT_STATE; - case BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES: + case BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES: PartyMenu_PrintLongMessage(application, PartyMenu_Text_IdenticalMonNotPermitted, TRUE); application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); return PARTY_MENU_STATE_SHOW_MESSAGE_THEN_NEXT_STATE; - case BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS: + case BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS: PartyMenu_PrintLongMessage(application, PartyMenu_Text_SomeMonHoldingIdenticalItems, TRUE); application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); diff --git a/src/applications/party_menu/windows.c b/src/applications/party_menu/windows.c index bc2242f549..c1b4bbc2a2 100644 --- a/src/applications/party_menu/windows.c +++ b/src/applications/party_menu/windows.c @@ -3,9 +3,9 @@ #include "constants/graphics.h" #include "constants/heap.h" #include "constants/pokemon.h" +#include "constants/string.h" #include "generated/genders.h" #include "generated/species.h" -#include "generated/string_padding_mode.h" #include "applications/party_menu/defs.h" #include "applications/party_menu/main.h" diff --git a/src/applications/pc_hall_of_fame/display.c b/src/applications/pc_hall_of_fame/display.c index 8412ef9635..699b2c6987 100644 --- a/src/applications/pc_hall_of_fame/display.c +++ b/src/applications/pc_hall_of_fame/display.c @@ -3,8 +3,8 @@ #include #include +#include "constants/string.h" #include "generated/genders.h" -#include "generated/string_padding_mode.h" #include "struct_defs/pc_hall_of_fame_screen_def.h" diff --git a/src/applications/town_map/context.c b/src/applications/town_map/context.c index 8d2a53a23c..0d430ade23 100644 --- a/src/applications/town_map/context.c +++ b/src/applications/town_map/context.c @@ -87,8 +87,8 @@ void TownMapContext_Init(FieldSystem *fieldSystem, TownMapContext *ctx, enum Tow memset(ctx, 0, sizeof(TownMapContext)); - playerX = Player_GetXPos(fieldSystem->playerAvatar); - playerZ = Player_GetZPos(fieldSystem->playerAvatar); + playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); int j = NELEMS(sDistWorldMapOffsets) - 1; Location *playerLocation = FieldOverworldState_GetPlayerLocation(fieldState); diff --git a/src/bag_context.c b/src/bag_context.c index 48316bbe34..8e928f0562 100644 --- a/src/bag_context.c +++ b/src/bag_context.c @@ -2,8 +2,8 @@ #include +#include "constants/string.h" #include "generated/items.h" -#include "generated/string_padding_mode.h" #include "generated/text_banks.h" #include "struct_defs/image_clips.h" diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c index b872d966fb..cdba54889c 100644 --- a/src/battle/battle_controller_player.c +++ b/src/battle/battle_controller_player.c @@ -462,7 +462,7 @@ static void BattleControllerPlayer_CommandSelectionInput(BattleSystem *battleSys break; case PLAYER_INPUT_ITEM: - if (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_NO_ITEMS) { + if (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_FRONTIER_LINK) { msg.id = 593; // "Items can’t be used here." msg.tags = TAG_NONE; BattleController_EmitSetAlertMessage(battleSys, i, msg); @@ -2117,7 +2117,7 @@ static int BattleControllerPlayer_CheckObedience(BattleSystem *battleSys, Battle TrainerInfo *trInfo = BattleSystem_GetTrainerInfo(battleSys, 0); // These separate sentinels do not match if chained into a single sentinel - if (battleType & BATTLE_TYPE_NO_OBEDIENCE_CHECK) { + if (battleType & BATTLE_TYPE_FRONTIER_LINK) { return OBEY_CHECK_SUCCESS; } if (BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker)) { diff --git a/src/battle/battle_lib.c b/src/battle/battle_lib.c index ba01e62049..438d6434a1 100644 --- a/src/battle/battle_lib.c +++ b/src/battle/battle_lib.c @@ -1875,7 +1875,7 @@ BOOL BattleSystem_CheckTrainerMessage(BattleSystem *battleSys, BattleContext *ba { int battleType = BattleSystem_GetBattleType(battleSys); - if (battleType & BATTLE_TYPE_NO_TRAINER_MESSAGES) { + if (battleType & BATTLE_TYPE_FRONTIER_LINK) { return FALSE; } diff --git a/src/battle/battle_script.c b/src/battle/battle_script.c index 110e3ad9b6..da6397bae5 100644 --- a/src/battle/battle_script.c +++ b/src/battle/battle_script.c @@ -5100,7 +5100,7 @@ static BOOL BtlCmd_TryStealItem(BattleSystem *battleSys, BattleContext *battleCt u32 battleType = BattleSystem_GetBattleType(battleSys); int attackingSide = BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker); - if (BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker) && (battleType & BATTLE_TYPE_RESTORE_ITEMS_AFTER) == FALSE) { + if (BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker) && (battleType & BATTLE_TYPE_FRONTIER_LINK) == FALSE) { // AI trainers are unable to steal items outside of the Battle Frontier. PvP trainers can steal items. BattleScript_Iter(battleCtx, jumpOnFail); } else if (battleCtx->sideConditions[attackingSide].knockedOffItemsMask & FlagIndex(battleCtx->selectedPartySlot[battleCtx->attacker])) { @@ -6344,7 +6344,7 @@ static BOOL BtlCmd_TrySwapItems(BattleSystem *battleSys, BattleContext *battleCt int attacking = BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker); int defending = BattleSystem_GetBattlerSide(battleSys, battleCtx->defender); - if (BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker) && (battleType & BATTLE_TYPE_RESTORE_ITEMS_AFTER) == FALSE) { + if (BattleSystem_GetBattlerSide(battleSys, battleCtx->attacker) && (battleType & BATTLE_TYPE_FRONTIER_LINK) == FALSE) { BattleScript_Iter(battleCtx, jumpOnFail); } else if ((battleCtx->sideConditions[attacking].knockedOffItemsMask & FlagIndex(battleCtx->selectedPartySlot[battleCtx->attacker])) || (battleCtx->sideConditions[defending].knockedOffItemsMask & FlagIndex(battleCtx->selectedPartySlot[battleCtx->defender]))) { diff --git a/src/battle/battle_system.c b/src/battle/battle_system.c index 4f7934ae35..b878a5e262 100644 --- a/src/battle/battle_system.c +++ b/src/battle/battle_system.c @@ -38,6 +38,7 @@ #include "bag.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "field_battle_data_transfer.h" #include "flags.h" @@ -70,7 +71,6 @@ #include "trainer_data.h" #include "trainer_info.h" #include "tv_segment.h" -#include "unk_02014A84.h" #include "unk_0202F1D4.h" static void BattleMessage_CheckSide(BattleSystem *battleSys, BattleMessage *battleMsg); @@ -1602,9 +1602,9 @@ u8 BattleMessage_PrintTrainerMessage(BattleSystem *battleSys, int trainerID, int String *string; if (msgType == TRMSG_WIN) { - string = Sentence_AsString(&battleSys->trainers[battler].winMsg, HEAP_ID_BATTLE); + string = EasyChatSentence_ToString(&battleSys->trainers[battler].winMsg, HEAP_ID_BATTLE); } else { - string = Sentence_AsString(&battleSys->trainers[battler].loseMsg, HEAP_ID_BATTLE); + string = EasyChatSentence_ToString(&battleSys->trainers[battler].loseMsg, HEAP_ID_BATTLE); } Window_FillTilemap(window, 0xFF); diff --git a/src/battle/healthbox.c b/src/battle/healthbox.c index b984cfa52b..40203806fb 100644 --- a/src/battle/healthbox.c +++ b/src/battle/healthbox.c @@ -7,7 +7,7 @@ #include "constants/graphics.h" #include "constants/heap.h" #include "constants/pokemon.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "battle/battle_system.h" #include "graphics/battle/sprites.naix" diff --git a/src/battle/trainer_ai/script.s b/src/battle/trainer_ai/script.s index 50c57e26e5..17a2d672ce 100644 --- a/src/battle/trainer_ai/script.s +++ b/src/battle/trainer_ai/script.s @@ -6372,7 +6372,7 @@ EvalAttack_MaybeDeprioritize: AddToMoveScore -2 EvalAttack_CheckQuadEffective: - // If quad-effective, 31.25% chance of score +2. + // If quad-effective, 68.75% chance of score +2. IfMoveEffectivenessEquals TYPE_MULTI_QUADRUPLE_DAMAGE, EvalAttack_TryScorePlus2 PopOrEnd diff --git a/src/battle_frontier_stats.c b/src/battle_frontier_stats.c index e6f94e53ec..99d522dd33 100644 --- a/src/battle_frontier_stats.c +++ b/src/battle_frontier_stats.c @@ -4,10 +4,10 @@ #include "struct_defs/battle_frontier.h" +#include "battle_hall_save.h" #include "savedata.h" #include "unk_0202D05C.h" #include "unk_0202FF4C.h" -#include "unk_02030108.h" #include "unk_020302D0.h" #include "unk_02030494.h" #include "wifi_list.h" @@ -25,7 +25,7 @@ void BattleFrontier_Init(BattleFrontier *frontier) sub_0202D080(&frontier->unk_950.unk_168); sub_0202D0AC(&frontier->unk_950.unk_188); sub_020300A4(&frontier->unk_1614.unk_00); - sub_02030260(&frontier->unk_1618.unk_00); + BattleHallStreakFlags_Init(&frontier->hall.streakFlags); sub_02030410(&frontier->unk_161C.unk_00); sub_020305AC(&frontier->unk_1620.unk_00); } diff --git a/src/battle_hall_save.c b/src/battle_hall_save.c new file mode 100644 index 0000000000..c20c038704 --- /dev/null +++ b/src/battle_hall_save.c @@ -0,0 +1,147 @@ +#include "battle_hall_save.h" + +#include + +#include "generated/pokemon_types.h" + +#include "struct_defs/battle_frontier.h" + +#include "savedata.h" + +void BattleHallSave_Init(BattleHallSave *challenge) +{ + MI_CpuClear8(challenge, sizeof(BattleHallSave)); +} + +BattleHallSave *BattleHallSave_Get(SaveData *saveData) +{ + BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); + return &frontier->hallSave; +} + +BOOL BattleHallSave_HasSaved(BattleHallSave *save) +{ + return save->didSave; +} + +void BattleHallSave_RecordSave(BattleHallSave *save, BOOL didSave) +{ + save->didSave = didSave; +} + +void BattleHallSave_SetMember(BattleHallSave *save, u8 field, u8 index, u8 unused, void *value) +{ + switch (field) { + case HALL_SAVE_CHALLENGE_TYPE: + save->challengeType = *(u8 *)value; + break; + case HALL_SAVE_UNK_1: + save->unk_01 = *(u8 *)value; + break; + case HALL_SAVE_TRAINER_IDS: + save->trainerIDs[index] = *(u16 *)value; + break; + case HALL_SAVE_PARTY_SLOTS: + save->partySlots[index] = *(u8 *)value; + break; + case HALL_SAVE_UNK_4: + save->unk_2C[index] = *(u16 *)value; + break; + default: + GF_ASSERT(FALSE); + break; + } +} + +u32 BattleHallSave_GetMember(BattleHallSave *save, u8 field, u8 index, u8 unused, void *unused2) +{ + switch (field) { + case HALL_SAVE_CHALLENGE_TYPE: + return save->challengeType; + case HALL_SAVE_UNK_1: + return save->unk_01; + case HALL_SAVE_TRAINER_IDS: + return save->trainerIDs[index]; + case HALL_SAVE_PARTY_SLOTS: + return save->partySlots[index]; + case HALL_SAVE_UNK_4: + return save->unk_2C[index]; + default: + GF_ASSERT(FALSE); + break; + } + + return 0; +} + +u8 BattleHall_GetRankOfType(u8 idx, u8 *typeRanks) +{ + u8 byte = idx / 2; + u8 nybble = idx % 2; + u8 rank = (typeRanks[byte] >> (4 * nybble)) & 0xf; + + return rank; +} + +void BattleHall_SetRankOfType(u8 pokemonType, u8 *typeRanks, u8 value) +{ + u8 byte = pokemonType / 2; + u8 nybble = pokemonType % 2; + + if (nybble == 0) { + typeRanks[byte] = typeRanks[byte] & 0xf0; + } else { + typeRanks[byte] = typeRanks[byte] & 0xf; + } + + u8 rankPair = value << (4 * nybble); + typeRanks[byte] |= rankPair; +} + +void BattleHall_ResetRankOfAllTypes(u8 *typeRanks) +{ + for (int i = 0; i < NUM_POKEMON_TYPES; i++) { + BattleHall_SetRankOfType(i, typeRanks, 0); + } +} + +void BattleHallStreakFlags_Init(BattleHallStreakFlags *flags) +{ + MI_CpuClear8(flags, sizeof(BattleHallStreakFlags)); +} + +BattleHallStreakFlags *BattleHallStreakFlags_Get(SaveData *saveData) +{ + BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); + return &frontier->hall.streakFlags; +} + +void BattleHallStreakFlags_SetFlag(BattleHallStreakFlags *flags, u8 field, u8 challengeType, u8 unused, u8 *value) +{ + u8 *value_dupe = (u8 *)value; + switch (field) { + case HALL_SAVE_STREAK_FLAGS: + if (*value_dupe >= 1) { + flags->streakActiveFlags |= (1 << challengeType); + } else { + flags->streakActiveFlags &= (0xff ^ (1 << challengeType)); + } + break; + default: + GF_ASSERT(FALSE); + break; + } +} + +u32 BattleHallStreakFlags_GetFlag(BattleHallStreakFlags *flags, u8 field, u8 challengeType, u8 unused, void *unused2) +{ + switch (field) { + case HALL_SAVE_STREAK_FLAGS: + return (flags->streakActiveFlags >> challengeType) & 0x1; + default: + GF_ASSERT(FALSE); + break; + } + + return FALSE; +} diff --git a/src/battle_regulation.c b/src/battle_regulation.c index b4e5d1cd5f..943b39dc66 100644 --- a/src/battle_regulation.c +++ b/src/battle_regulation.c @@ -58,8 +58,8 @@ int BattleRegulation_GetRuleValue(const BattleRegulation *regulation, enum Battl case BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL: ruleValue = regulation->maxTotalLevel; break; - case BATTLE_REGULATION_RULE_SPECIES_RESTRICT: - ruleValue = regulation->speciesRestriction; + case BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT: + ruleValue = regulation->evolutionRestriction; break; case BATTLE_REGULATION_RULE_HEIGHT_RESTRICT: ruleValue = regulation->heightRestriction; @@ -87,8 +87,8 @@ int BattleRegulation_GetRuleValue(const BattleRegulation *regulation, enum Battl case BATTLE_REGULATION_RULE_SPECIES_UNIQUE: ruleValue = regulation->speciesUniqueness; break; - case BATTLE_REGULATION_RULE_ITEM_RESTRICT: - ruleValue = regulation->itemRestriction; + case BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT: + ruleValue = regulation->specialSpeciesRestriction; break; case BATTLE_REGULATION_RULE_MOVE_RESTRICTIONS: ruleValue = regulation->moveRestrictions; @@ -124,8 +124,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 0, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -137,8 +137,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 30, .heightRestriction = -20, .weightRestriction = -20, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -150,8 +150,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 5, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 1, @@ -163,8 +163,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = -99, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -176,8 +176,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 0, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -191,8 +191,8 @@ BattleRegulation BattleRegulation_DefaultRule = { .maxLevel = 100, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 1, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 1, .speciesUniqueness = 1, .itemUniqueness = 1, .moveRestrictions = 0, @@ -217,7 +217,7 @@ void BattleRegulation_GetNameByIndex(SaveData *saveData, int index, String *stri if (index < NELEMS(BattleRegulation_PredefinedRules)) { messageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, heapID); - MessageLoader_GetString(messageLoader, pl_msg_00000353_00070 + index, string); + MessageLoader_GetString(messageLoader, Unk0353_Text_StandardCup + index, string); MessageLoader_Free(messageLoader); } else { BattleRegulation_GetName(BattleRegulation_Load(saveData, 0), string); diff --git a/src/battle_regulation_validation.c b/src/battle_regulation_validation.c index d2027009fe..45bb39a6f2 100644 --- a/src/battle_regulation_validation.c +++ b/src/battle_regulation_validation.c @@ -28,7 +28,7 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo return FALSE; } - ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_RESTRICT); + ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT); if (ruleValue == 0) { if (species != Pokemon_GetBaseSpeciesForBattle(species)) { @@ -68,7 +68,7 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo } } - ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_ITEM_RESTRICT); + ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT); if (ruleValue == 0) { if (Pokemon_IsBannedFromBattleFrontier(mon)) { @@ -79,14 +79,14 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo return TRUE; } -enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots) +enum BattleRegulationValidationResult BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots) { Pokemon *mon; int ruleValue, selectedCount = 0, i, j, totalLevel = 0; u16 species[MAX_PARTY_SIZE], heldItems[MAX_PARTY_SIZE]; if (regulation == NULL) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } for (i = 0; i < MAX_PARTY_SIZE; i++) { @@ -101,7 +101,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_TEAM_SIZE); if (selectedCount != ruleValue) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE; } for (i = 0; i < MAX_PARTY_SIZE; i++) { @@ -111,7 +111,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con mon = Party_GetPokemonBySlotIndex(party, slotIndex); if (BattleRegulation_ValidatePokemon(regulation, mon, heightWeightData) == FALSE) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_POKEMON; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_POKEMON; } species[i] = (u16)Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); @@ -124,7 +124,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); if (totalLevel > ruleValue && ruleValue != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED; + return BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED; } ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_UNIQUE); @@ -137,7 +137,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con for (i = 0; i < (MAX_PARTY_SIZE - 1); i++) { for (j = i + 1; j < MAX_PARTY_SIZE; j++) { if (species[i] == species[j] && species[i] != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES; + return BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES; } } } @@ -152,13 +152,13 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con for (i = 0; i < (MAX_PARTY_SIZE - 1); i++) { for (j = i + 1; j < MAX_PARTY_SIZE; j++) { if (heldItems[i] == heldItems[j] && species[i] != 0 && heldItems[i] != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS; + return BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS; } } } } - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } static BOOL BattleRegulation_FindValidTeamCombination(u16 *species, u16 *levels, u16 *used, int maxLevelSum, int slotIndex, int remainingSlots, int totalSlots) @@ -198,7 +198,7 @@ static BOOL BattleRegulation_FindValidTeamCombination(u16 *species, u16 *levels, return FALSE; } -enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData) +enum BattleRegulationValidationResult BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData) { Pokemon *mon; int ruleValue, partyCount, i, j, validCount = 0; @@ -223,10 +223,10 @@ enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const B ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_UNIQUE); - // Remove duplicate species by keeping the higher-level Pokémon + // Remove duplicate species by keeping the lower-level Pokémon if (ruleValue == 0 && partyCount > 1) { // Compare all pairs of Pokémon to find duplicates - for (i = 0; i < (partyCount - 1); i++) { + for (i = 0; i < partyCount - 1; i++) { for (j = i + 1; j < partyCount; j++) { if (species[i] == species[j] && species[i] != 0) { if (levels[i] > levels[j]) { @@ -244,21 +244,21 @@ enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const B ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_TEAM_SIZE); if (validCount < ruleValue) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE; } requiredCount = ruleValue; ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); if (ruleValue == 0) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } for (i = 0; i < partyCount; i++) { if (BattleRegulation_FindValidTeamCombination(species, levels, used, ruleValue, i, requiredCount, partyCount)) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } } - return BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED; + return BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED; } diff --git a/src/berry_patch_manager.c b/src/berry_patch_manager.c index 3f021e0eb6..589623df54 100644 --- a/src/berry_patch_manager.c +++ b/src/berry_patch_manager.c @@ -265,8 +265,8 @@ static const MapObjectAnimCmd BerryWatering_RightAnimation[] = { static BOOL BerryPatches_CheckCollision(FieldSystem *fieldSystem, BerryWateringTask *task, enum FaceDirection direction) { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); if (direction == FACE_LEFT) { playerX--; @@ -289,8 +289,8 @@ static BOOL BerryPatches_CheckCollision(FieldSystem *fieldSystem, BerryWateringT static MapObject *BerryPatches_GetAdjacentObject(FieldSystem *fieldSystem, enum FaceDirection direction) { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); playerZ -= 1; if (direction == FACE_LEFT) { @@ -304,8 +304,8 @@ static MapObject *BerryPatches_GetAdjacentObject(FieldSystem *fieldSystem, enum static MapObject *BerryPatches_GetTargetPatch(FieldSystem *fieldSystem, BerryWateringTask *task) { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); if (task->direction == FACE_UP) { playerZ -= 1; @@ -334,7 +334,7 @@ static void BerryPatches_WaterPatch(FieldSystem *fieldSystem, BerryWateringTask static void BerryPatches_StartAnimation(FieldSystem *fieldSystem, BerryWateringTask *task, const MapObjectAnimCmd *animationCmd) { - MapObject *playerObject = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerObject = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); task->animationTask = MapObject_StartAnimation(playerObject, animationCmd); } @@ -347,7 +347,7 @@ static BOOL BerryPatches_TaskMain(FieldTask *taskManager) case BERRY_WATERING_STATE_INIT: PlayerAvatar_SetTransitionState(fieldSystem->playerAvatar, PLAYER_TRANSITION_WATER_BERRIES); PlayerAvatar_RequestChangeState(fieldSystem->playerAvatar); - MapObject_SetPauseMovementOff(Player_MapObject(fieldSystem->playerAvatar)); + MapObject_SetPauseMovementOff(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar)); task->state = BERRY_WATERING_STATE_WATERING; break; case BERRY_WATERING_STATE_WATERING: @@ -378,7 +378,7 @@ static BOOL BerryPatches_TaskMain(FieldTask *taskManager) break; } } else if ((gSystem.heldKeys & PAD_KEY_UP) && (task->direction == FACE_DOWN)) { - Player_SetDir(fieldSystem->playerAvatar, FACE_UP); + PlayerAvatar_TryFace(fieldSystem->playerAvatar, FACE_UP); task->state = BERRY_WATERING_STATE_CLEANUP; break; } else if ((gSystem.heldKeys & PAD_KEY_DOWN) && (task->direction == FACE_UP)) { @@ -389,7 +389,7 @@ static BOOL BerryPatches_TaskMain(FieldTask *taskManager) task->timer++; if (task->timer > 30 * 3) { - Player_SetDir(fieldSystem->playerAvatar, task->direction); + PlayerAvatar_TryFace(fieldSystem->playerAvatar, task->direction); task->state = BERRY_WATERING_STATE_CLEANUP; } break; @@ -403,14 +403,14 @@ static BOOL BerryPatches_TaskMain(FieldTask *taskManager) if ((targetPatch != NULL) && BerryPatches_IsBerryPatch(targetPatch)) { task->state = BERRY_WATERING_STATE_WATERING; } else { - Player_SetDir(fieldSystem->playerAvatar, task->direction); + PlayerAvatar_TryFace(fieldSystem->playerAvatar, task->direction); task->state = BERRY_WATERING_STATE_CLEANUP; } } break; case BERRY_WATERING_STATE_CLEANUP: - Player_SetDir(fieldSystem->playerAvatar, task->direction); - MapObject_SetPauseMovementOn(Player_MapObject(fieldSystem->playerAvatar)); + PlayerAvatar_TryFace(fieldSystem->playerAvatar, task->direction); + MapObject_SetPauseMovementOn(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar)); Heap_Free(task); return TRUE; } @@ -424,7 +424,7 @@ void BerryPatches_StartWatering(FieldSystem *fieldSystem) task->state = BERRY_WATERING_STATE_INIT; task->animationTask = NULL; - task->direction = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + task->direction = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); FieldTask_InitCall(fieldSystem->task, BerryPatches_TaskMain, task); } diff --git a/src/binoculars_vista_lighthouse.c b/src/binoculars_vista_lighthouse.c index 97f283748b..fe268f38f1 100644 --- a/src/binoculars_vista_lighthouse.c +++ b/src/binoculars_vista_lighthouse.c @@ -52,8 +52,8 @@ static BOOL Task_UseVistaLighthouseBinoculars(FieldTask *taskMan) switch (binoculars->state) { case 0: - binoculars->xPos = Player_GetXPos(fieldSystem->playerAvatar); - binoculars->zPos = Player_GetZPos(fieldSystem->playerAvatar); + binoculars->xPos = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + binoculars->zPos = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); sub_02070428(fieldSystem, 1); FieldTransition_FadeOut(taskMan); binoculars->state++; @@ -125,7 +125,7 @@ static BOOL Task_UseVistaLighthouseBinoculars(FieldTask *taskMan) static void VistaLighthouseBinoculars_SetPlayerHidden(PlayerAvatar *playerAvatar, BOOL hidden) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); MapObject_SetHidden(mapObj, hidden); } diff --git a/src/comm_player_manager.c b/src/comm_player_manager.c index 54cfec4148..c8f9e0f147 100644 --- a/src/comm_player_manager.c +++ b/src/comm_player_manager.c @@ -189,7 +189,7 @@ void CommPlayerMan_Reinit(void) if (sCommPlayerManager->playerAvatar[netId] != NULL) { if (sCommPlayerManager->fieldSystem->playerAvatar != sCommPlayerManager->playerAvatar[netId]) { if (sCommPlayerManager->isUnderground) { - Player_DeleteAll(sCommPlayerManager->playerAvatar[netId]); + PlayerAvatar_Delete(sCommPlayerManager->playerAvatar[netId]); } } @@ -236,12 +236,12 @@ void CommPlayer_InitPersonal(void) { sCommPlayerManager->playerAvatar[CommSys_CurNetId()] = sCommPlayerManager->fieldSystem->playerAvatar; sCommPlayerManager->isActive[CommSys_CurNetId()] = TRUE; - sCommPlayerManager->playerLocation[CommSys_CurNetId()].x = Player_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); - sCommPlayerManager->playerLocation[CommSys_CurNetId()].z = Player_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); - sCommPlayerManager->playerLocation[CommSys_CurNetId()].dir = PlayerAvatar_GetDir(sCommPlayerManager->fieldSystem->playerAvatar); - sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].x = Player_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); - sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].z = Player_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); - sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].dir = PlayerAvatar_GetDir(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocation[CommSys_CurNetId()].x = PlayerAvatar_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocation[CommSys_CurNetId()].z = PlayerAvatar_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocation[CommSys_CurNetId()].dir = PlayerAvatar_GetFacingDir(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].x = PlayerAvatar_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].z = PlayerAvatar_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); + sCommPlayerManager->playerLocationServer[CommSys_CurNetId()].dir = PlayerAvatar_GetFacingDir(sCommPlayerManager->fieldSystem->playerAvatar); } void CommPlayer_CopyPersonal(int netJd) @@ -270,7 +270,7 @@ void CommPlayer_CopyPersonal(int netJd) void CommPlayer_SendXZPos(BOOL param0, int x, int z) { u8 data[5 + 1]; - int dir = PlayerAvatar_GetDir(sCommPlayerManager->fieldSystem->playerAvatar); + int dir = PlayerAvatar_GetFacingDir(sCommPlayerManager->fieldSystem->playerAvatar); data[0] = x; data[1] = x >> 8; @@ -288,8 +288,8 @@ void CommPlayer_SendXZPos(BOOL param0, int x, int z) void CommPlayer_SendPos(BOOL param0) { - int x = Player_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); - int z = Player_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(sCommPlayerManager->fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(sCommPlayerManager->fieldSystem->playerAvatar); CommPlayer_SendXZPos(param0, x, z); } @@ -336,8 +336,8 @@ static void CommPlayer_SendPosNetId(int netId, const CommPlayerLocation *playerL void CommPlayer_SendDataTask(void *data) { - int v0 = PlayerAvatar_MoveState(sCommPlayerManager->fieldSystem->playerAvatar); - int moveState = Player_MoveState(sCommPlayerManager->fieldSystem->playerAvatar); + int v0 = PlayerAvatar_GetMoveState(sCommPlayerManager->fieldSystem->playerAvatar); + int moveState = PlayerAvatar_GetPlayerMoveState(sCommPlayerManager->fieldSystem->playerAvatar); if ((0 == v0) && CommSys_IsPlayerConnected(CommSys_CurNetId())) { if (!sCommPlayerManager->unk_2BA) { @@ -401,12 +401,12 @@ static void CommPlayer_Add(u8 netId) version = 1; } - playerAvatar = PlayerAvatar_Init(sCommPlayerManager->fieldSystem->mapObjMan, sCommPlayerManager->playerLocation[netId].x, sCommPlayerManager->playerLocation[netId].z, sCommPlayerManager->playerLocation[netId].dir, 0x0, TrainerInfo_Gender(trainerInfo), version, NULL); + playerAvatar = PlayerAvatar_New(sCommPlayerManager->fieldSystem->mapObjMan, sCommPlayerManager->playerLocation[netId].x, sCommPlayerManager->playerLocation[netId].z, sCommPlayerManager->playerLocation[netId].dir, 0x0, TrainerInfo_Gender(trainerInfo), version, NULL); GF_ASSERT(playerAvatar != NULL); sCommPlayerManager->playerAvatar[netId] = playerAvatar; - MapObject_SetLocalID(Player_MapObject(playerAvatar), 0xff + netId + 1); + MapObject_SetLocalID(PlayerAvatar_GetMapObject(playerAvatar), 0xff + netId + 1); if (sCommPlayerManager->isUnderground) { UndergroundMan_SetLeftUndergroundMessage(netId); @@ -439,9 +439,9 @@ void CommPlayer_Destroy(u8 netId, BOOL param1, BOOL param2) if (sCommPlayerManager->playerAvatar[netId] != NULL) { if (sCommPlayerManager->fieldSystem->playerAvatar != sCommPlayerManager->playerAvatar[netId]) { if (sCommPlayerManager->isUnderground || param2) { - Player_DeleteAll(sCommPlayerManager->playerAvatar[netId]); + PlayerAvatar_Delete(sCommPlayerManager->playerAvatar[netId]); } else { - Player_Delete(sCommPlayerManager->playerAvatar[netId]); + PlayerAvatar_Free(sCommPlayerManager->playerAvatar[netId]); } } @@ -940,11 +940,11 @@ static BOOL CommPlayer_SlideAnimation(int netId, int param1, int unused, int ani return TRUE; } - MapObject *obj = Player_MapObject(sCommPlayerManager->playerAvatar[netId]); + MapObject *obj = PlayerAvatar_GetMapObject(sCommPlayerManager->playerAvatar[netId]); - if (PlayerAvatar_GetDir(sCommPlayerManager->playerAvatar[netId]) != CommPlayer_GetOppositeDir(sCommPlayerManager->slideAnimationDir[netId])) { + if (PlayerAvatar_GetFacingDir(sCommPlayerManager->playerAvatar[netId]) != CommPlayer_GetOppositeDir(sCommPlayerManager->slideAnimationDir[netId])) { MapObject_SetStatusFlagOff(obj, MAP_OBJ_STATUS_LOCK_DIR); - Player_SetDir(sCommPlayerManager->playerAvatar[netId], CommPlayer_GetOppositeDir(sCommPlayerManager->slideAnimationDir[netId])); + PlayerAvatar_TryFace(sCommPlayerManager->playerAvatar[netId], CommPlayer_GetOppositeDir(sCommPlayerManager->slideAnimationDir[netId])); MapObject_SetStatusFlagOn(obj, MAP_OBJ_STATUS_LOCK_DIR); } @@ -1000,9 +1000,9 @@ static void CommPlayer_MoveClient(int netId) playerAvatar = sCommPlayerManager->playerAvatar[netId]; if (playerAvatar) { - int dx = Player_GetXPos(playerAvatar) - playerLocation->x; - int dy = Player_GetZPos(playerAvatar) - playerLocation->z; - int dir = PlayerAvatar_GetDir(playerAvatar); + int dx = PlayerAvatar_GetXPos(playerAvatar) - playerLocation->x; + int dy = PlayerAvatar_GetZPos(playerAvatar) - playerLocation->z; + int dir = PlayerAvatar_GetFacingDir(playerAvatar); if ((dx == 0) && (dy == 0)) { pad = 0; @@ -1193,7 +1193,7 @@ void CommPlayer_StartSlideAnimation(int netId, int dir, BOOL unused) return; } - MapObject *obj = Player_MapObject(sCommPlayerManager->playerAvatar[netId]); + MapObject *obj = PlayerAvatar_GetMapObject(sCommPlayerManager->playerAvatar[netId]); MapObject_SetStatusFlagOn(obj, MAP_OBJ_STATUS_LOCK_DIR); MapObject_SetStatusFlagOn(obj, MAP_OBJ_STATUS_PAUSE_ANIMATION); @@ -1208,7 +1208,7 @@ void CommPlayer_StopSlideAnimation(int netId) } if (sCommPlayerManager->slideAnimationDir[netId] != DIR_NONE) { - MapObject *obj = Player_MapObject(sCommPlayerManager->playerAvatar[netId]); + MapObject *obj = PlayerAvatar_GetMapObject(sCommPlayerManager->playerAvatar[netId]); sub_020656AC(obj); MapObject_SetStatusFlagOff(obj, MAP_OBJ_STATUS_LOCK_DIR); @@ -1640,7 +1640,7 @@ int CommPlayer_GetMovementTimerServer(int netId) void CommPlayer_SetDir(int dir) { - Player_SetDir(sCommPlayerManager->fieldSystem->playerAvatar, dir); + PlayerAvatar_TryFace(sCommPlayerManager->fieldSystem->playerAvatar, dir); sCommPlayerManager->playerLocation[CommSys_CurNetId()].dir = dir; CommPlayer_SendPos(FALSE); } @@ -1648,7 +1648,7 @@ void CommPlayer_SetDir(int dir) void CommPlayer_SetDirClient(int netId, int dir) { sCommPlayerManager->playerLocation[netId].dir = dir; - Player_SetDir(sCommPlayerManager->playerAvatar[netId], dir); + PlayerAvatar_TryFace(sCommPlayerManager->playerAvatar[netId], dir); } int CommPlayer_DirClient(int netId) @@ -1657,7 +1657,7 @@ int CommPlayer_DirClient(int netId) return -1; } - return PlayerAvatar_GetDir(sCommPlayerManager->playerAvatar[netId]); + return PlayerAvatar_GetFacingDir(sCommPlayerManager->playerAvatar[netId]); } void CommPlayerMan_PauseFieldSystemWithContextBit(int contextBit) @@ -1753,7 +1753,7 @@ void CommPlayerMan_ForcePos(void) continue; } - obj = Player_MapObject(sCommPlayerManager->playerAvatar[netId]); + obj = PlayerAvatar_GetMapObject(sCommPlayerManager->playerAvatar[netId]); x = sCommPlayerManager->playerLocation[netId].x; z = sCommPlayerManager->playerLocation[netId].z; dir = sCommPlayerManager->playerLocation[netId].dir; diff --git a/src/cutscenes/boat_cutscene/boat_cutscene.c b/src/cutscenes/boat_cutscene/boat_cutscene.c index 0d9d9c0e85..e0db90d061 100644 --- a/src/cutscenes/boat_cutscene/boat_cutscene.c +++ b/src/cutscenes/boat_cutscene/boat_cutscene.c @@ -99,13 +99,13 @@ void FieldSystem_PlayBoatCutscene(FieldSystem *fieldSystem, const u8 travelDir, if (travelDir == BOAT_TRAVEL_DIR_NORTH_TO_SOUTH) { targetMapPropModelID = regular_ship_nsbmd; - TerrainCollisionHitbox_Init(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), 1, -3, 3, 6, &hitbox); + TerrainCollisionHitbox_Init(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), 1, -3, 3, 6, &hitbox); moveBeforeFadeOut = TRUE; goalDistance = (25 * MAP_OBJECT_TILE_SIZE); boatCutscene->bridgeDistance = (14 * MAP_OBJECT_TILE_SIZE); } else if (travelDir == BOAT_TRAVEL_DIR_WEST_TO_EAST) { targetMapPropModelID = screw_steamship_spiral_nsbmd; - TerrainCollisionHitbox_Init(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), -2, 2, 6, 3, &hitbox); + TerrainCollisionHitbox_Init(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), -2, 2, 6, 3, &hitbox); moveBeforeFadeOut = TRUE; goalDistance = (12 * MAP_OBJECT_TILE_SIZE); } @@ -119,7 +119,7 @@ void FieldSystem_PlayBoatCutscene(FieldSystem *fieldSystem, const u8 travelDir, boatCutscene->speedTick = 0; boatCutscene->speed = FX32_ONE / 4; - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &boatCutscene->cameraPos); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &boatCutscene->cameraPos); Camera_ReleaseTarget(fieldSystem->camera); Camera_TrackTarget(&boatCutscene->cameraPos, fieldSystem->camera); diff --git a/src/dummy/dummy.c b/src/dummy/dummy.c index 1dd961d616..923c2cef39 100644 --- a/src/dummy/dummy.c +++ b/src/dummy/dummy.c @@ -1,7 +1,7 @@ #include // function gets optimized out but is necessary to match due to the variable inside it -void Dummy(void) +void Dummy_021D0DA0(void) { static int dummy = 0; } diff --git a/src/dynamic_map_features.c b/src/dynamic_map_features.c index d335ff8ca7..afbf42107f 100644 --- a/src/dynamic_map_features.c +++ b/src/dynamic_map_features.c @@ -9,7 +9,7 @@ #include "field/field_system.h" #include "overlay005/villa_furniture.h" #include "overlay006/great_marsh_tram.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "overlay009/ov9_02249960.h" #include "field_system.h" diff --git a/src/easy_chat_args.c b/src/easy_chat_args.c index 2b9b741add..81204de0f2 100644 --- a/src/easy_chat_args.c +++ b/src/easy_chat_args.c @@ -2,19 +2,16 @@ #include -#include "struct_decls/struct_02014EC4_decl.h" -#include "struct_defs/sentence.h" - #include "applications/easy_chat/defs.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "game_options.h" #include "heap.h" #include "pokedex.h" #include "save_player.h" #include "savedata.h" #include "system_flags.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "vars_flags.h" EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *saveData, enum HeapID heapID) @@ -24,7 +21,7 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *sav args->type = type; args->instructionBankEntry = instructionBankEntry; args->pokedex = SaveData_GetPokedex(saveData); - args->unk_10 = sub_02014EC4(saveData); + args->unlockedWords = SaveData_GetUnlockedEasyChatWords(saveData); args->isGameCompleted = SystemFlag_CheckGameCompleted(SaveData_GetVarsFlags(saveData)); args->unk_05 = FALSE; args->isUnmodified = TRUE; @@ -32,10 +29,10 @@ EasyChatArgs *EasyChatArgs_New(u32 type, u32 instructionBankEntry, SaveData *sav args->frame = Options_Frame(SaveData_GetOptions(saveData)); if (type == EASY_CHAT_TYPE_SENTENCE) { - Sentence_InitWithType(&args->sentence, 3); + EasyChatSentence_InitWithType(&args->sentence, EASY_CHAT_SENTENCE_TYPE_GENERAL); } else { - for (int v1 = 0; v1 < MAX_EASY_CHAT_WORDS; v1++) { - args->words[v1] = WORD_NONE; + for (int i = 0; i < MAX_EASY_CHAT_WORDS; i++) { + args->words[i] = WORD_NONE; } } @@ -58,7 +55,7 @@ void EasyChatArgs_SetTwoWords(EasyChatArgs *args, u16 word1, u16 word2) args->words[1] = word2; } -void EasyChatArgs_SetSentence(EasyChatArgs *args, const Sentence *sentence) +void EasyChatArgs_SetSentence(EasyChatArgs *args, const EasyChatSentence *sentence) { args->sentence = *sentence; } @@ -95,9 +92,9 @@ void EasyChatArgs_CopyTwoWordsTo(const EasyChatArgs *args, u16 *dest) dest[1] = args->words[1]; } -void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, Sentence *dest) +void EasyChatArgs_CopySentenceTo(const EasyChatArgs *args, EasyChatSentence *dest) { - Sentence_Copy(dest, &args->sentence); + EasyChatSentence_Copy(dest, &args->sentence); } u32 EasyChatArgs_GetType(const EasyChatArgs *args) @@ -120,9 +117,9 @@ const Pokedex *EasyChatArgs_GetPokedex(const EasyChatArgs *args) return args->pokedex; } -const UnkStruct_02014EC4 *sub_02097560(const EasyChatArgs *args) +const UnlockedEasyChatWords *EasyChatArgs_GetUnlockedWords(const EasyChatArgs *args) { - return args->unk_10; + return args->unlockedWords; } BOOL EasyChatArgs_IsGameCompleted(const EasyChatArgs *args) @@ -135,7 +132,7 @@ BOOL sub_02097568(const EasyChatArgs *args) return args->unk_05; } -void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence *outSentence) +void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, EasyChatSentence *outSentence) { switch (args->type) { case EASY_CHAT_TYPE_ONE_WORD: @@ -151,7 +148,7 @@ void EasyChatArgs_GetContent(const EasyChatArgs *args, u16 *outWords, Sentence * } } -BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sentence *sentence) +BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence) { switch (args->type) { case EASY_CHAT_TYPE_ONE_WORD: @@ -160,11 +157,11 @@ BOOL EasyChatArgs_Compare(const EasyChatArgs *args, const u16 *words, const Sent return words[0] == args->words[0] && words[1] == args->words[1]; case EASY_CHAT_TYPE_SENTENCE: default: - return sub_02014C88(&args->sentence, sentence); + return EasyChatSentence_Compare(&args->sentence, sentence); } } -void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *words, const Sentence *sentence) +void EasyChatArgs_UpdateContent(EasyChatArgs *args, const u16 *words, const EasyChatSentence *sentence) { args->wasUpdated = !EasyChatArgs_Compare(args, words, sentence); args->isUnmodified = FALSE; diff --git a/src/easy_chat_sentence.c b/src/easy_chat_sentence.c new file mode 100644 index 0000000000..b4240eefbe --- /dev/null +++ b/src/easy_chat_sentence.c @@ -0,0 +1,231 @@ +#include "easy_chat_sentence.h" + +#include + +#include "constants/charcode.h" +#include "generated/text_banks.h" + +#include "applications/easy_chat/defs.h" + +#include "charcode.h" +#include "easy_chat_words.h" +#include "message.h" +#include "message_util.h" +#include "string_gf.h" +#include "string_template.h" + +#include "res/text/bank/feelings.h" +#include "res/text/bank/general_sentences.h" +#include "res/text/bank/loss_sentences.h" +#include "res/text/bank/pre_battle_sentences.h" +#include "res/text/bank/trainer_words.h" +#include "res/text/bank/union_room_sentences.h" +#include "res/text/bank/win_sentences.h" + +static u32 EasyChatSentence_CountSelectableWords(u32 type, u32 id); + +static const u16 sTextBanksByType[] = { + [EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE] = TEXT_BANK_PRE_BATTLE_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_WIN] = TEXT_BANK_WIN_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_LOSS] = TEXT_BANK_LOSS_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_GENERAL] = TEXT_BANK_GENERAL_SENTENCES, + [EASY_CHAT_SENTENCE_TYPE_UNION_ROOM] = TEXT_BANK_UNION_ROOM_SENTENCES +}; + +void EasyChatSentence_Init(EasyChatSentence *sentence) +{ + sentence->type = EASY_CHAT_SENTENCE_TYPE_NONE; + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} + +void EasyChatSentence_InitWithType(EasyChatSentence *sentence, u32 type) +{ + sentence->type = type; + sentence->id = 0; + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} + +void EasyChatSentence_InitWithEnteredUnionRoom(EasyChatSentence *sentence) +{ + EasyChatSentence_InitWithType(sentence, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); + sentence->id = UnionRoomSentences_Text_IveEnteredUnionRoom; +} + +void EasyChatSentence_SetDefaultFrontierFields(EasyChatSentence *sentence, int type) +{ + static const struct { + u8 type; + u8 id; + s16 word1Bank; + u16 word1BankEntry; + s16 word2Bank; + u16 word2BankEntry; + } defaultFrontierSentenceData[] = { + [EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE] = { EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE, PreBattleSentences_Text_PleaseBlank, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_ComeOn, -1, 0 }, + [EASY_CHAT_SENTENCE_TYPE_WIN] = { EASY_CHAT_SENTENCE_TYPE_WIN, WinSentences_Text_IWinBlank, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_Easy, -1, 0 }, + [EASY_CHAT_SENTENCE_TYPE_LOSS] = { EASY_CHAT_SENTENCE_TYPE_LOSS, LossSentences_Text_YouWinBlank, TEXT_BANK_FEELINGS, Feelings_Text_Regret, -1, 0 }, + [FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1] = { EASY_CHAT_SENTENCE_TYPE_WIN, WinSentences_Text_BlankYay, TEXT_BANK_TRAINER_WORDS, TrainerWords_Text_No1, -1, 0 } + }; + + GF_ASSERT(type < NELEMS(defaultFrontierSentenceData)); + + if (type < NELEMS(defaultFrontierSentenceData)) { + EasyChatSentence_InitWithType(sentence, defaultFrontierSentenceData[type].type); + sentence->id = defaultFrontierSentenceData[type].id; + + if (defaultFrontierSentenceData[type].word1Bank != -1) { + sentence->words[0] = EasyChatWord_FromBankAndEntry(defaultFrontierSentenceData[type].word1Bank, defaultFrontierSentenceData[type].word1BankEntry); + } + + if (defaultFrontierSentenceData[type].word2Bank != -1) { + sentence->words[1] = EasyChatWord_FromBankAndEntry(defaultFrontierSentenceData[type].word2Bank, defaultFrontierSentenceData[type].word2BankEntry); + } + } +} + +String *EasyChatSentence_ToString(const EasyChatSentence *sentence, enum HeapID heapID) +{ + StringTemplate *template = StringTemplate_Default(heapID); + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + if (sentence->words[i] != WORD_NONE) { + StringTemplate_SetEasyChatWord(template, i, sentence->words[i]); + } else { + break; + } + } + + MessageLoader *loader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[sentence->type], heapID); + String *string = MessageUtil_ExpandedString(template, loader, sentence->id, heapID); + + MessageLoader_Free(loader); + StringTemplate_Free(template); + + return string; +} + +String *EasyChatSentence_GetTemplateString(const EasyChatSentence *sentence, enum HeapID heapID) +{ + return MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[sentence->type], sentence->id, heapID); +} + +BOOL EasyChatSentence_IsValid(const EasyChatSentence *sentence) +{ + return sentence->type != EASY_CHAT_SENTENCE_TYPE_NONE; +} + +BOOL EasyChatSentence_IsComplete(const EasyChatSentence *sentence) +{ + u32 count = EasyChatSentence_CountSelectableWords(sentence->type, sentence->id); + + for (u32 i = 0; i < count; i++) { + if (sentence->words[i] == WORD_NONE) { + return FALSE; + } + } + + return TRUE; +} + +static u32 EasyChatSentence_CountSelectableWords(u32 type, u32 id) +{ + GF_ASSERT(type < EASY_CHAT_SENTENCE_TYPE_COUNT); + GF_ASSERT(id < EasyChatSentence_GetBankEntryCountForType(type)); + + String *string = MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, sTextBanksByType[type], id, HEAP_ID_SYSTEM); + const charcode_t *iter = String_GetData(string); + u32 count = 0; + + while (*iter != CHAR_EOS) { + if (*iter == CHAR_FORMAT_ARG) { + if (CharCode_IsFormatArg(iter)) { + count++; + } + + iter = CharCode_SkipFormatArg(iter); + } else { + iter++; + } + } + + String_Free(string); + return count; +} + +u16 EasyChatSentence_GetWord(const EasyChatSentence *sentence, int slot) +{ + return sentence->words[slot]; +} + +u32 EasyChatSentence_GetType(const EasyChatSentence *sentence) +{ + return sentence->type; +} + +u32 EasyChatSentence_GetID(const EasyChatSentence *sentence) +{ + return sentence->id; +} + +BOOL EasyChatSentence_Compare(const EasyChatSentence *sentence1, const EasyChatSentence *sentence2) +{ + if (sentence1->type != sentence2->type || sentence1->id != sentence2->id) { + return FALSE; + } + + for (int i = 0; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + if (sentence1->words[i] != sentence2->words[i]) { + return FALSE; + } + } + + return TRUE; +} + +void EasyChatSentence_Copy(EasyChatSentence *dest, const EasyChatSentence *src) +{ + *dest = *src; +} + +u32 EasyChatSentence_GetBankEntryCountForType(u32 type) +{ + SDK_COMPILER_ASSERT(TEXT_BANK_PRE_BATTLE_SENTENCES_ENTRY_COUNT == TEXT_BANK_WIN_SENTENCES_ENTRY_COUNT + && TEXT_BANK_WIN_SENTENCES_ENTRY_COUNT == TEXT_BANK_LOSS_SENTENCES_ENTRY_COUNT + && TEXT_BANK_LOSS_SENTENCES_ENTRY_COUNT == TEXT_BANK_UNION_ROOM_SENTENCES_ENTRY_COUNT + && TEXT_BANK_UNION_ROOM_SENTENCES_ENTRY_COUNT == TEXT_BANK_GENERAL_SENTENCES_ENTRY_COUNT); + + if (type < NELEMS(sTextBanksByType)) { + return TEXT_BANK_GENERAL_SENTENCES_ENTRY_COUNT; + } + + return 0; +} + +void EasyChatSentence_SetTypeAndID(EasyChatSentence *sentence, u32 type, u32 id) +{ + GF_ASSERT(type < EASY_CHAT_SENTENCE_TYPE_COUNT); + + sentence->type = type; + sentence->id = id; +} + +void EasyChatSentence_SetWord(EasyChatSentence *sentence, u32 index, u16 word) +{ + GF_ASSERT(index < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS); + sentence->words[index] = word; +} + +void EasyChatSentence_ClearUnusedWords(EasyChatSentence *sentence) +{ + u32 count = EasyChatSentence_CountSelectableWords(sentence->type, sentence->id); + + for (u32 i = count; i < MAX_EASY_CHAT_SENTENCE_WORD_SLOTS; i++) { + sentence->words[i] = WORD_NONE; + } +} diff --git a/src/easy_chat_words.c b/src/easy_chat_words.c new file mode 100644 index 0000000000..9a69896301 --- /dev/null +++ b/src/easy_chat_words.c @@ -0,0 +1,380 @@ +#include "easy_chat_words.h" + +#include + +#include "constants/versions.h" +#include "generated/text_banks.h" + +#include "graphics.h" +#include "heap.h" +#include "math_util.h" +#include "message.h" +#include "savedata.h" +#include "string_gf.h" + +#include "res/text/bank/ability_names_uppercase.h" +#include "res/text/bank/feelings.h" +#include "res/text/bank/greetings.h" +#include "res/text/bank/lifestyle_words.h" +#include "res/text/bank/move_names_uppercase.h" +#include "res/text/bank/people_words.h" +#include "res/text/bank/pokemon_type_names.h" +#include "res/text/bank/species_name.h" +#include "res/text/bank/tough_words.h" +#include "res/text/bank/trainer_words.h" +#include "res/text/bank/union_words.h" + +static const u16 sTextBankEntryCounts[] = { + TEXT_BANK_SPECIES_NAME_ENTRY_COUNT, + TEXT_BANK_MOVE_NAMES_UPPERCASE_ENTRY_COUNT, + TEXT_BANK_POKEMON_TYPE_NAMES_ENTRY_COUNT, + TEXT_BANK_ABILITY_NAMES_UPPERCASE_ENTRY_COUNT, + TEXT_BANK_TRAINER_WORDS_ENTRY_COUNT, + TEXT_BANK_PEOPLE_WORDS_ENTRY_COUNT, + TEXT_BANK_GREETINGS_ENTRY_COUNT, + TEXT_BANK_LIFESTYLE_WORDS_ENTRY_COUNT, + TEXT_BANK_FEELINGS_ENTRY_COUNT, + TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT, + TEXT_BANK_UNION_WORDS_ENTRY_COUNT +}; + +static const u16 sTextBanks[] = { + TEXT_BANK_SPECIES_NAME, + TEXT_BANK_MOVE_NAMES_UPPERCASE, + TEXT_BANK_POKEMON_TYPE_NAMES, + TEXT_BANK_ABILITY_NAMES_UPPERCASE, + TEXT_BANK_TRAINER_WORDS, + TEXT_BANK_PEOPLE_WORDS, + TEXT_BANK_GREETINGS, + TEXT_BANK_LIFESTYLE_WORDS, + TEXT_BANK_FEELINGS, + TEXT_BANK_TOUGH_WORDS, + TEXT_BANK_UNION_WORDS +}; + +static const u16 sDummy[] = { + 0x441, + 0x599 +}; + +static const u16 sDummy2[] = { + 0x4C0, + 0x4F0 +}; + +static const u16 sDummy3[] = { + 0x4A7, + 0x4E1 +}; + +static const u16 sDummy4[] = { + 0x479, + 0x498, + 0x49B, + 0x49C +}; + +static const u16 sDummy5[] = { + 0x48F, + 0x497 +}; + +static const u16 sDummy6[] = { + 0x4FC, + 0x596 +}; + +static const u16 sDummy7[] = { + 0x4BB, + 0x500 +}; + +static const u16 sDummy8[] = { + 0x24E, + 0x3D2 +}; + +static const u16 sDummy9[] = { + 0x42C, + 0x59D +}; + +static const u16 sDummy10[] = { + 0x4B0, + 0x4FF +}; + +static const u16 sDummy11[] = { + 0x4B6, + 0x505 +}; + +static const u16 sDummy12[] = { + 0x47A, + 0x48D +}; + +static const struct { + const u16 *dummy; + int length; +} sDummy13[] = { + { sDummy, 2 }, + { sDummy2, 2 }, + { sDummy3, 2 }, + { sDummy4, 4 }, + { sDummy5, 2 }, + { sDummy6, 2 }, + { sDummy7, 2 }, + { sDummy8, 2 }, + { sDummy9, 2 }, + { sDummy10, 2 }, + { sDummy11, 2 }, + { sDummy12, 2 } +}; + +// function gets optimized out but is necessary to match due to the data inside it +void Dummy_020E5538(void) +{ + sDummy13[0]; +} + +EasyChatWordLoader *EasyChatWordLoader_New(enum HeapID heapID) +{ + EasyChatWordLoader *wordLoader = Heap_Alloc(heapID, sizeof(EasyChatWordLoader)); + + for (int i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + wordLoader->heapID = heapID; + wordLoader->loaders[i] = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, sTextBanks[i], heapID); + } + + return wordLoader; +} + +void EasyChatWordLoader_Free(EasyChatWordLoader *wordLoader) +{ + for (int i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + MessageLoader_Free(wordLoader->loaders[i]); + } + + Heap_Free(wordLoader); +} + +void EasyChatWordLoader_GetString(EasyChatWordLoader *wordLoader, u16 word, String *out) +{ + u32 loaderIndex, bankEntry; + + EasyChatWord_GetLoaderIndexAndEntry(word, &loaderIndex, &bankEntry); + MessageLoader_GetString(wordLoader->loaders[loaderIndex], bankEntry, out); +} + +void EasyChatWord_ToString(u16 word, String *out) +{ + if (word != WORD_NONE) { + u32 bankID, bankEntry; + + EasyChatWord_GetLoaderIndexAndEntry(word, &bankID, &bankEntry); + bankID = sTextBanks[bankID]; + MessageBank_GetStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, bankID, bankEntry, 0, out); + } else { + String_Clear(out); + } +} + +u16 EasyChatWord_FromBankAndEntry(u32 bankID, u32 bankEntry) +{ + for (u32 i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + if (sTextBanks[i] == bankID) { + u16 total, j; + + for (j = 0, total = 0; j < i; j++) { + total += sTextBankEntryCounts[j]; + } + + return total + bankEntry; + } + } + + return WORD_NONE; +} + +BOOL EasyChatWord_GetLoaderIndexAndEntry(u16 word, u32 *outLoaderIndex, u32 *outBankEntry) +{ + u32 i, total; + + u32 clampedWord = word & 0xFFF; // why? + total = 0; + + for (i = 0; i < EASY_CHAT_WORD_TEXT_BANK_COUNT; i++) { + total += sTextBankEntryCounts[i]; + + if (clampedWord < total) { + *outLoaderIndex = i; + *outBankEntry = clampedWord - (total - sTextBankEntryCounts[i]); + return TRUE; + } + } + + return FALSE; +} + +u32 UnlockedEasyChatWords_SaveSize(void) +{ + return sizeof(UnlockedEasyChatWords); +} + +void UnlockedEasyChatWords_Init(UnlockedEasyChatWords *unlockedWords) +{ + static const struct { + u8 language; + u8 bankEntry; + } greetingMapping[] = { + { LANGUAGE_JAPANESE, Greetings_Text_Konnichiwa }, + { LANGUAGE_ENGLISH, Greetings_Text_Hello }, + { LANGUAGE_FRENCH, Greetings_Text_Bonjour }, + { LANGUAGE_ITALIAN, Greetings_Text_Ciao }, + { LANGUAGE_GERMAN, Greetings_Text_Hallo }, + { LANGUAGE_SPANISH, Greetings_Text_Hola } + }; + + unlockedWords->unlockedGreetingBits = 0; + unlockedWords->unlockedToughWordBits = 0; + + for (int i = 0; i < NELEMS(greetingMapping); i++) { + if (GAME_LANGUAGE == greetingMapping[i].language) { + EasyChatWords_UnlockGreeting(unlockedWords, greetingMapping[i].bankEntry); + break; + } + } + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +UnlockedEasyChatWords *SaveData_GetUnlockedEasyChatWords(SaveData *saveData) +{ + SaveData_Checksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + return SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +BOOL EasyChatWords_IsToughWordUnlocked(const UnlockedEasyChatWords *unlockedWords, u32 bankEntry) +{ + return (unlockedWords->unlockedToughWordBits >> bankEntry) & 1; +} + +u32 EasyChatWords_TryUnlockRandomToughWord(UnlockedEasyChatWords *unlockedWords) +{ + u32 i, lockedCount; + + for (i = 0, lockedCount = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + lockedCount++; + } + } + + if (lockedCount) { + int counter = LCRNG_Next() % lockedCount; + + for (i = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + if (counter == 0) { + unlockedWords->unlockedToughWordBits |= (1 << i); + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + + return i; + } else { + counter--; + } + } + } + } + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); + + return TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; +} + +BOOL EasyChatWords_AreAllToughWordsUnlocked(UnlockedEasyChatWords *unlockedWords) +{ + for (u32 i = 0; i < TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT; i++) { + if (((unlockedWords->unlockedToughWordBits >> i) & 1) == 0) { + return FALSE; + } + } + + return TRUE; +} + +u16 EasyChatWords_GetToughWordFromBankEntry(u32 bankEntry) +{ + int i; + u16 wordID = 0; + + for (i = 0; i < EASY_CHAT_WORD_TEXT_BANK_TOUGH_WORDS; i++) { + wordID += sTextBankEntryCounts[i]; + } + + return wordID + bankEntry; +} + +BOOL EasyChatWords_IsGreetingUnlocked(const UnlockedEasyChatWords *unlockedWords, int bankEntry) +{ + return (unlockedWords->unlockedGreetingBits >> bankEntry) & 1; +} + +void EasyChatWords_UnlockGreeting(UnlockedEasyChatWords *unlockedWords, int bankEntry) +{ + unlockedWords->unlockedGreetingBits |= (1 << bankEntry); + + SaveData_SetChecksum(SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS); +} + +UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID) +{ + UnkStruct_02014FB0 *v0; + u32 fileSize; + + v0 = Heap_Alloc(heapID, sizeof(UnkStruct_02014FB0)); + memset(v0, 0, sizeof(UnkStruct_02014FB0)); + + v0->unk_04 = LoadMemberFromNARC_OutFileSize(NARC_INDEX_RESOURCE__ENG__PMS_AIKOTOBA__PMS_AIKOTOBA, 0, FALSE, heapID, FALSE, &fileSize); + v0->unk_00 = fileSize / sizeof(u32); + + return v0; +} + +void sub_02014FF0(UnkStruct_02014FB0 *param0) +{ + Heap_Free(param0->unk_04); + Heap_Free(param0); +} + +u32 sub_02015004(const UnkStruct_02014FB0 *param0) +{ + return param0->unk_00; +} + +u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1) +{ + GF_ASSERT(param0); + + if (param0->unk_00 <= param1) { + return 0xffff; + } + + return param0->unk_04[param1]; +} + +s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1) +{ + int v0; + + GF_ASSERT(param0); + + for (v0 = 0; v0 < param0->unk_00; v0++) { + if (param0->unk_04[v0] == param1) { + return v0; + } + } + + return -1; +} diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 2f2c7baefe..e555d0eaf2 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -28,12 +28,12 @@ #include "pokemon.h" #include "pokemon_anim.h" #include "pokemon_sprite.h" +#include "save_catchrecords.h" #include "save_player.h" #include "screen_fade.h" #include "sound_playback.h" #include "system.h" #include "trainer_info.h" -#include "unk_0202F180.h" #include "unk_02092494.h" #include "vram_transfer.h" diff --git a/src/encounter.c b/src/encounter.c index 22ca94f7a4..a704aec273 100644 --- a/src/encounter.c +++ b/src/encounter.c @@ -804,7 +804,7 @@ void Encounter_NewVsWiFi(FieldTask *task, int param1, int normalizedLevel, int w dto = FieldBattleDTO_New(HEAP_ID_FIELD2, battleType); v5 = (UnkEnum_0202F510_07); } else { - battleType = BATTLE_TYPE_FRONTIER_DOUBLES | BATTLE_TYPE_LINK | BATTLE_TYPE_2vs2; + battleType = BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; dto = FieldBattleDTO_New(HEAP_ID_FIELD2, battleType); dto->trainerIDs[BATTLER_ENEMY_1] = 1; dto->trainerIDs[BATTLER_ENEMY_2] = 2; diff --git a/src/field_battle_data_transfer.c b/src/field_battle_data_transfer.c index 247232b4dc..dba4a8559b 100644 --- a/src/field_battle_data_transfer.c +++ b/src/field_battle_data_transfer.c @@ -497,7 +497,7 @@ static void SetBackgroundAndTerrain(FieldBattleDTO *dto, const FieldSystem *fiel { PlayerData *player = FieldOverworldState_GetPlayerData(SaveData_GetFieldOverworldState(fieldSystem->saveData)); dto->background = MapHeader_GetBattleBG(fieldSystem->location->mapId); - if (player->form == PLAYER_AVATAR_SURFING) { + if (player->playerState == PLAYER_AVATAR_SURFING) { dto->background = BACKGROUND_WATER; } diff --git a/src/field_bgm.c b/src/field_bgm.c index 3f7b901841..ce53169262 100644 --- a/src/field_bgm.c +++ b/src/field_bgm.c @@ -139,7 +139,7 @@ u16 FieldBGM_GetEffective(FieldSystem *fieldSystem, enum MapHeader mapID) PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; int playerState = PlayerAvatar_GetPlayerState(playerAvatar); - if (playerState == PLAYER_STATE_SURFING) { + if (playerState == PLAYER_AVATAR_SURFING) { switch (mapID) { case MAP_HEADER_DISTORTION_WORLD_1F: case MAP_HEADER_DISTORTION_WORLD_B1F: @@ -201,8 +201,8 @@ static u16 FieldBGM_GetAltMusicForCyclingRoad(FieldSystem *fieldSystem, int head FieldOverworldState *fieldState = SaveData_GetFieldOverworldState(fieldSystem->saveData); Location *location = FieldOverworldState_GetPrevLocation(fieldState); - x = Player_GetXPos(fieldSystem->playerAvatar); - y = Player_GetZPos(fieldSystem->playerAvatar); + x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + y = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); if (headerID != MAP_HEADER_ROUTE_206) { return SEQ_NONE; @@ -245,7 +245,7 @@ BOOL FieldBGM_TryFadeOut(FieldSystem *fieldSystem, u16 bgmID, int mode) FieldBGM_GetFadeOutAndWaitFrames(fieldSystem, mode, &fadeOutFrames, &waitFrames); // Yes, it's checking bike twice. Maybe there was a point were Acro and Mach Bikes were still a thing? - if ((playerState == PLAYER_STATE_CYCLING) || (playerState == PLAYER_STATE_CYCLING)) { + if ((playerState == PLAYER_AVATAR_CYCLING) || (playerState == PLAYER_AVATAR_CYCLING)) { Sound_FadeToBGM(4, bgmID, fadeOutFrames, waitFrames, 30, 0, NULL); } else { Sound_FadeOutAndPlayBGM(4, bgmID, fadeOutFrames, waitFrames, 0, NULL); diff --git a/src/field_map_change.c b/src/field_map_change.c index 1b1b367157..600362ba45 100644 --- a/src/field_map_change.c +++ b/src/field_map_change.c @@ -72,7 +72,7 @@ #include "unk_02070428.h" #include "vars_flags.h" -#include "res/text/bank/pokemon_center_2f_attendants.h" +#include "res/text/bank/pokemon_center_2f_common.h" FS_EXTERN_OVERLAY(underground); @@ -346,7 +346,7 @@ static void FieldMapChange_CreateObjects(FieldSystem *fieldSystem) FieldOverworldState *fieldState = SaveData_GetFieldOverworldState(fieldSystem->saveData); PlayerData *playerData = FieldOverworldState_GetPlayerData(fieldState); - fieldSystem->playerAvatar = PlayerAvatar_Init(fieldSystem->mapObjMan, fieldSystem->location->x, fieldSystem->location->z, fieldSystem->location->faceDirection, playerData->form, gender, 0, playerData); + fieldSystem->playerAvatar = PlayerAvatar_New(fieldSystem->mapObjMan, fieldSystem->location->x, fieldSystem->location->z, fieldSystem->location->faceDirection, playerData->playerState, gender, 0, playerData); sub_0203A418(fieldSystem); MapObjectMan_StopAllMovement(fieldSystem->mapObjMan); @@ -354,7 +354,7 @@ static void FieldMapChange_CreateObjects(FieldSystem *fieldSystem) static void FieldMapChange_DeleteObjects(FieldSystem *fieldSystem) { - Player_Delete(fieldSystem->playerAvatar); + PlayerAvatar_Free(fieldSystem->playerAvatar); MapObjectMan_DeleteAll(fieldSystem->mapObjMan); MapObjectMan_Delete(fieldSystem->mapObjMan); } @@ -368,7 +368,7 @@ static void FieldMapChange_LoadObjects(FieldSystem *fieldSystem) PlayerData *playerData = FieldOverworldState_GetPlayerData(fieldState); int gender = TrainerInfo_Gender(SaveData_GetTrainerInfo(fieldSystem->saveData)); - fieldSystem->playerAvatar = sub_0205E820(fieldSystem->mapObjMan, playerData, gender); + fieldSystem->playerAvatar = PlayerAvatar_NewLoad(fieldSystem->mapObjMan, playerData, gender); MapObjectMan_StopAllMovement(fieldSystem->mapObjMan); } @@ -434,7 +434,7 @@ static void sub_020534BC(FieldSystem *fieldSystem) static void Location_SetToPlayerLocation(Location *location, const FieldSystem *fieldSystem) { - Location_Set(location, fieldSystem->location->mapId, WARP_ID_NONE, Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), DIR_SOUTH); + Location_Set(location, fieldSystem->location->mapId, WARP_ID_NONE, PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), DIR_SOUTH); } static BOOL FieldSystem_IsSaveInUnionRoom(const FieldSystem *fieldSystem) @@ -884,7 +884,7 @@ static void FieldTask_FadeInFly(FieldTask *task) return; } - mapChangeData->task = FieldTask_FlyLanding_InitTask(fieldSystem, PlayerAvatar_Gender(fieldSystem->playerAvatar)); + mapChangeData->task = FieldTask_FlyLanding_InitTask(fieldSystem, PlayerAvatar_GetGender(fieldSystem->playerAvatar)); FieldTask_InitCall(task, FieldTask_WaitFadeInFly, mapChangeData); } @@ -1075,7 +1075,7 @@ void FieldSystem_StartMapChangeWarpTask(FieldSystem *fieldSystem, int param1, in MI_CpuClear8(mapChangeWarpData, sizeof(MapChangeWarpData)); - Location_Set(&nextLocation, param1, param2, 0, 0, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + Location_Set(&nextLocation, param1, param2, 0, 0, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); mapChangeWarpData->nextLocation = nextLocation; FieldSystem_CreateTask(fieldSystem, FieldTask_MapChangeWarp, mapChangeWarpData); } @@ -1135,9 +1135,9 @@ BOOL FieldTask_MapChangeToUnderground(FieldTask *task) switch (ctx->state) { case ENTER_UNDERGROUND_INIT: - MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS, HEAP_ID_FIELD2); + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_COMMON, HEAP_ID_FIELD2); - ctx->string = MessageLoader_GetNewString(msgLoader, PokeCenter2FAttendants_Text_CommsWillBeLaunched); + ctx->string = MessageLoader_GetNewString(msgLoader, PokemonCenter2FCommon_Text_CommsWillBeLaunched); MessageLoader_Free(msgLoader); FieldMessage_AddWindow(fieldSystem->bgConfig, &ctx->window, BG_LAYER_MAIN_3); diff --git a/src/field_move_tasks.c b/src/field_move_tasks.c index 64a510e74f..92d7bda345 100644 --- a/src/field_move_tasks.c +++ b/src/field_move_tasks.c @@ -195,7 +195,7 @@ BOOL FieldMoves_FlyTask(FieldTask *task) switch (ctx->state) { case FLY_STATE_START_CUT_IN: - ctx->cutInTask = HMCutIn_StartTask(ctx->fieldSystem, TRUE, ctx->mon, PlayerAvatar_Gender(ctx->fieldSystem->playerAvatar)); + ctx->cutInTask = HMCutIn_StartTask(ctx->fieldSystem, TRUE, ctx->mon, PlayerAvatar_GetGender(ctx->fieldSystem->playerAvatar)); ctx->state++; break; case FLY_STATE_MAIN: @@ -260,8 +260,8 @@ void FieldMoves_SetUsableMoves(FieldSystem *fieldSystem, FieldMoveContext *field } } - playerX = Player_GetXPos(fieldSystem->playerAvatar); - playerY = Player_GetZPos(fieldSystem->playerAvatar); + playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + playerY = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); currTileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, playerX, playerY); PlayerAvatar_GetFacingTileCoords(fieldSystem->playerAvatar, &playerX, &playerY); @@ -271,7 +271,7 @@ void FieldMoves_SetUsableMoves(FieldSystem *fieldSystem, FieldMoveContext *field fieldMoveContext->usableMoves |= FIELD_MOVE_FLAG(FIELD_MOVE_SURF); } - if (PlayerAvatar_CanUseRockClimb(nextTileBehavior, PlayerAvatar_GetDir(fieldSystem->playerAvatar))) { + if (PlayerAvatar_CanUseRockClimb(nextTileBehavior, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar))) { fieldMoveContext->usableMoves |= FIELD_MOVE_FLAG(FIELD_MOVE_ROCK_CLIMB); } diff --git a/src/great_marsh_lookout.c b/src/great_marsh_lookout.c index 23c62bedda..4830f4d9dc 100644 --- a/src/great_marsh_lookout.c +++ b/src/great_marsh_lookout.c @@ -82,7 +82,7 @@ static BOOL Task_GreatMarshLookout(FieldTask *taskMan) lookout->state = 4; break; case 4: { - MapObject *playerAvatar = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerAvatar = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); lookout->numCycles++; diff --git a/src/item_use_functions.c b/src/item_use_functions.c index 3cefcf38d6..a654c0059b 100644 --- a/src/item_use_functions.c +++ b/src/item_use_functions.c @@ -188,12 +188,12 @@ void ItemUseContext_Init(FieldSystem *fieldSystem, ItemUseContext *ctxOut) ctxOut->hasPartner = SystemFlag_CheckHasPartner(SaveData_GetVarsFlags(fieldSystem->saveData)); ctxOut->playerState = PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar); - int x = Player_GetXPos(fieldSystem->playerAvatar); - int z = Player_GetZPos(fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); ctxOut->currTileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, x, z); - int playerDirection = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDirection = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); switch (playerDirection) { case DIR_NORTH: @@ -380,7 +380,7 @@ static enum ItemUseCheckResult CanUseExplorerKit(const ItemUseContext *usageCont return ITEM_USE_CANNOT_USE_GENERIC; } - if (PlayerAvatar_GetPlayerState(usageContext->playerAvatar) == PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(usageContext->playerAvatar) == PLAYER_AVATAR_SURFING) { return ITEM_USE_CANNOT_USE_GENERIC; } @@ -392,8 +392,8 @@ static enum ItemUseCheckResult CanUseExplorerKit(const ItemUseContext *usageCont return ITEM_USE_CANNOT_USE_GENERIC; } - u16 x = Player_GetXPos(usageContext->fieldSystem->playerAvatar); - u16 z = Player_GetZPos(usageContext->fieldSystem->playerAvatar); + u16 x = PlayerAvatar_GetXPos(usageContext->fieldSystem->playerAvatar); + u16 z = PlayerAvatar_GetZPos(usageContext->fieldSystem->playerAvatar); // doesn't match as !MapHeaderData_IsPosFreeOfObjectEvents if (MapHeaderData_IsPosFreeOfObjectEvents(usageContext->fieldSystem, x, z) == FALSE) { @@ -432,7 +432,7 @@ static BOOL MountOrUnmountBicycle(FieldTask *task) break; case 1: if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) == 0x1) { - MapObject_SetPauseMovementOff(Player_MapObject(fieldSystem->playerAvatar)); + MapObject_SetPauseMovementOff(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar)); PlayerAvatar_SetTransitionState(fieldSystem->playerAvatar, PLAYER_TRANSITION_WALKING); PlayerAvatar_RequestChangeState(fieldSystem->playerAvatar); @@ -441,7 +441,7 @@ static BOOL MountOrUnmountBicycle(FieldTask *task) } else { FieldBGM_SetOverride(fieldSystem, SEQ_BICYCLE); FieldBGM_TryFadeOut(fieldSystem, SEQ_BICYCLE, 1); - MapObject_SetPauseMovementOff(Player_MapObject(fieldSystem->playerAvatar)); + MapObject_SetPauseMovementOff(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar)); PlayerAvatar_SetTransitionState(fieldSystem->playerAvatar, PLAYER_TRANSITION_CYCLING); PlayerAvatar_RequestChangeState(fieldSystem->playerAvatar); @@ -479,7 +479,7 @@ static enum ItemUseCheckResult CanUseBicycle(const ItemUseContext *usageContext) } { - MapObject *v1 = Player_MapObject(usageContext->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(usageContext->playerAvatar); if (MapObject_IsOnBikeBridgeNorthSouth(v1, usageContext->currTileBehavior) == TRUE || MapObject_IsOnBikeBridgeEastWest(v1, usageContext->currTileBehavior) == TRUE) { return ITEM_USE_CANNOT_DISMOUNT; @@ -494,7 +494,7 @@ static enum ItemUseCheckResult CanUseBicycle(const ItemUseContext *usageContext) return ITEM_USE_CANNOT_USE_GENERIC; } - if (usageContext->playerState == PLAYER_STATE_SURFING) { + if (usageContext->playerState == PLAYER_AVATAR_SURFING) { return ITEM_USE_CANNOT_USE_GENERIC; } @@ -574,7 +574,7 @@ static void UseBerryFromMenu(ItemMenuUseContext *usageContext, const ItemUseCont v1 = FieldTask_GetEnv(usageContext->fieldTask); if (additionalContext->berryPatchFlags & BERRY_PATCH_FLAG_EMPTY) { - sub_02068540(usageContext, additionalContext, 2801); + sub_02068540(usageContext, additionalContext, SCRIPT_ID(BERRY_TREE_INTERACTIONS, 1)); } else { UseHealingItemFromMenu(usageContext, additionalContext); } @@ -675,12 +675,12 @@ static enum ItemUseCheckResult CanUsePokeRadar(const ItemUseContext *usageContex static void UseSprayDuckFromMenu(ItemMenuUseContext *usageContext, const ItemUseContext *additionalContext) { - sub_02068540(usageContext, additionalContext, 2802); + sub_02068540(usageContext, additionalContext, SCRIPT_ID(BERRY_TREE_INTERACTIONS, 2)); } static BOOL UseSprayDuckInField(ItemFieldUseContext *usageContext) { - sub_02068584(usageContext, 2802); + sub_02068584(usageContext, SCRIPT_ID(BERRY_TREE_INTERACTIONS, 2)); return FALSE; } @@ -699,7 +699,7 @@ static enum ItemUseCheckResult CanUseSprayDuck(const ItemUseContext *usageContex static void UseMulchFromMenu(ItemMenuUseContext *usageContext, const ItemUseContext *additionalContext) { - sub_02068540(usageContext, additionalContext, 2803); + sub_02068540(usageContext, additionalContext, SCRIPT_ID(BERRY_TREE_INTERACTIONS, 3)); } static enum ItemUseCheckResult CanUseMulch(const ItemUseContext *usageContext) @@ -837,7 +837,7 @@ static enum ItemUseCheckResult CanUseFishingRod(const ItemUseContext *usageConte if (TileBehavior_IsSurfable(usageContext->facingTileBehavior) == TRUE) { if ((TileBehavior_IsBridge(usageContext->currTileBehavior) == TRUE) || (TileBehavior_IsBridgeStart(usageContext->currTileBehavior) == TRUE)) { - MapObject *playerObj = Player_MapObject(usageContext->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(usageContext->playerAvatar); if (MapObject_IsStatusOnElevatedBridge(playerObj) == TRUE) { return ITEM_USE_CANNOT_USE_GENERIC; diff --git a/src/mail.c b/src/mail.c index 43c0b0e020..db8b44d7b4 100644 --- a/src/mail.c +++ b/src/mail.c @@ -8,6 +8,7 @@ #include "generated/species.h" #include "charcode_util.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "party.h" #include "pokemon.h" @@ -15,7 +16,6 @@ #include "save_player.h" #include "savedata.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "res/pokemon/pl_poke_icon.naix" #include "res/pokemon/species_icon_palettes.h" @@ -58,7 +58,7 @@ void Mail_Reset(Mail *mail) mail->platExclusiveFormIcons = 0; for (int i = 0; i < MAIL_MAX_SENTENCES; i++) { - Sentence_Init(&mail->sentences[i]); + EasyChatSentence_Init(&mail->sentences[i]); } } @@ -204,7 +204,7 @@ u16 Mail_GetPlatExclusiveFormIcons(const Mail *mail) return mail->platExclusiveFormIcons; } -Sentence *Mail_GetSentence(Mail *mail, u8 index) +EasyChatSentence *Mail_GetSentence(Mail *mail, u8 index) { if (index < MAIL_MAX_SENTENCES) { return &mail->sentences[index]; @@ -213,13 +213,13 @@ Sentence *Mail_GetSentence(Mail *mail, u8 index) } } -void Mail_SetSentence(Mail *mail, Sentence *sentence, u8 index) +void Mail_SetSentence(Mail *mail, EasyChatSentence *sentence, u8 index) { if (index >= MAIL_MAX_SENTENCES) { return; } - Sentence_Copy(&mail->sentences[index], sentence); + EasyChatSentence_Copy(&mail->sentences[index], sentence); } Mailbox *SaveData_GetMailbox(SaveData *saveData) diff --git a/src/main_menu/main_menu.c b/src/main_menu/main_menu.c index 247e54f553..46ba58efe0 100644 --- a/src/main_menu/main_menu.c +++ b/src/main_menu/main_menu.c @@ -4,8 +4,8 @@ #include "constants/communication/comm_available_connections.h" #include "constants/graphics.h" #include "constants/narc.h" +#include "constants/string.h" #include "generated/genders.h" -#include "generated/string_padding_mode.h" #include "generated/text_banks.h" #include "game_opening/const_ov77_021D742C.h" diff --git a/src/main_menu/mystery_gift_app.c b/src/main_menu/mystery_gift_app.c index 572a3ac28d..bffb3c5190 100644 --- a/src/main_menu/mystery_gift_app.c +++ b/src/main_menu/mystery_gift_app.c @@ -6,7 +6,7 @@ #include "constants/graphics.h" #include "constants/narc.h" #include "constants/savedata/savedata.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "generated/text_banks.h" #include "game_opening/const_ov77_021D742C.h" diff --git a/src/main_menu/wonder_cards_app.c b/src/main_menu/wonder_cards_app.c index b450e938c1..cf2f65145c 100644 --- a/src/main_menu/wonder_cards_app.c +++ b/src/main_menu/wonder_cards_app.c @@ -5,7 +5,7 @@ #include "constants/heap.h" #include "constants/narc.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "main_menu/main_menu_util.h" #include "main_menu/mystery_gift_app.h" diff --git a/src/map_tile_behavior.c b/src/map_tile_behavior.c index 66426a2718..df39827e80 100644 --- a/src/map_tile_behavior.c +++ b/src/map_tile_behavior.c @@ -93,7 +93,7 @@ static const u8 sTileBehaviorFlags[] = { [TILE_BEHAVIOR_PASTORIA_GYM_H_GROUND] = TILE_BEHAVIOR_FLAG_NONE, [TILE_BEHAVIOR_PASTORIA_GYM_M_GROUND] = TILE_BEHAVIOR_FLAG_NONE, [TILE_BEHAVIOR_PASTORIA_GYM_L_GROUND] = TILE_BEHAVIOR_FLAG_NONE, - [TILE_BEHAVIOR_PASTORIA_GYM_WATER] = TILE_BEHAVIOR_FLAG_NONE, + [TILE_BEHAVIOR_DYNAMIC_HEIGHT_COLLISION] = TILE_BEHAVIOR_FLAG_NONE, [TILE_BEHAVIOR_JUMP_NORTH_TWICE] = TILE_BEHAVIOR_FLAG_NONE, [TILE_BEHAVIOR_JUMP_SOUTH_TWICE] = TILE_BEHAVIOR_FLAG_NONE, [TILE_BEHAVIOR_JUMP_WEST_TWICE] = TILE_BEHAVIOR_FLAG_NONE, @@ -403,9 +403,9 @@ BOOL TileBehavior_IsPastoriaGymLowGround(u8 behavior) return behavior == TILE_BEHAVIOR_PASTORIA_GYM_L_GROUND; } -BOOL TileBehavior_IsPastoriaGymWater(u8 behavior) +BOOL TileBehavior_HasDynamicHeightCollision(u8 behavior) { - return behavior == TILE_BEHAVIOR_PASTORIA_GYM_WATER; + return behavior == TILE_BEHAVIOR_DYNAMIC_HEIGHT_COLLISION; } BOOL TileBehavior_IsEscalatorFlipFace(u8 behavior) diff --git a/src/meson.build b/src/meson.build index edfdbb861b..e753c4da20 100644 --- a/src/meson.build +++ b/src/meson.build @@ -51,8 +51,8 @@ pokeplatinum_c = files( 'screen_scroll_manager.c', 'particle_system.c', 'colored_arrow.c', - 'unk_02014A84.c', - 'unk_02014D38.c', + 'easy_chat_sentence.c', + 'easy_chat_words.c', 'software_sprite.c', 'unk_0201567C.c', 'poffin_types.c', @@ -129,10 +129,10 @@ pokeplatinum_c = files( 'rankings.c', 'pal_park_transfers.c', 'link_contest_records.c', - 'unk_0202F180.c', + 'save_catchrecords.c', 'unk_0202F1D4.c', 'unk_0202FF4C.c', - 'unk_02030108.c', + 'battle_hall_save.c', 'unk_020302D0.c', 'unk_02030494.c', 'battle_frontier_stats.c', @@ -427,7 +427,7 @@ pokeplatinum_c = files( 'overlay005/ov5_021F3D00.c', 'overlay005/ov5_021F3E74.c', 'overlay005/ov5_021F4018.c', - 'overlay005/ov5_021F428C.c', + 'overlay005/veilstone_gym_object_renderer.c', 'overlay005/ov5_021F47B0.c', 'overlay005/ov5_021F4DAC.c', 'overlay005/ov5_021F4E08.c', @@ -479,10 +479,10 @@ pokeplatinum_c = files( 'overlay006/ov6_02248948.c', 'overlay006/ov6_022489E4.c', 'overlay007/communication_club.c', - 'overlay007/ov7_0224B4E8.c', + 'overlay007/battle_regulation_menu.c', 'overlay007/accessory_shop.c', 'overlay007/shop_menu.c', - 'overlay008/ov8_02249960.c', + 'overlay008/gym_features.c', 'overlay009/ov9_02249960.c', 'overlay010/ov10_0221F800.c', 'overlay011/move_palettes.c', diff --git a/src/overlay005/dist_world_surf_mount_renderer.c b/src/overlay005/dist_world_surf_mount_renderer.c index 1feb50ff0a..bdd0e8b170 100644 --- a/src/overlay005/dist_world_surf_mount_renderer.c +++ b/src/overlay005/dist_world_surf_mount_renderer.c @@ -102,7 +102,7 @@ OverworldAnimManager *DistWorldSurfMountRenderer_HandleSurfBegin(PlayerAvatar *p { VecFx32 mountPos = { 0, 0, 0 }; DistWorldSurfMountUserData userData; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); userData.dir = dir; userData.avatarDistortionState = avatarDistortionState; diff --git a/src/overlay005/field_control.c b/src/overlay005/field_control.c index cb185f02fb..984e0f7177 100644 --- a/src/overlay005/field_control.c +++ b/src/overlay005/field_control.c @@ -24,7 +24,7 @@ #include "overlay005/vs_seeker.h" #include "overlay006/repel_step_update.h" #include "overlay006/wild_encounters.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "overlay009/ov9_02249960.h" #include "underground/manager.h" @@ -117,9 +117,9 @@ void FieldInput_Update(FieldInput *input, FieldSystem *fieldSystem, u16 pressedK { FieldInput_Clear(input); - int moveState = Player_MoveState(fieldSystem->playerAvatar); - int avatarState = PlayerAvatar_MoveState(fieldSystem->playerAvatar); - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int moveState = PlayerAvatar_GetPlayerMoveState(fieldSystem->playerAvatar); + int avatarState = PlayerAvatar_GetMoveState(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); input->pressedKeys = pressedKeys; input->heldKeys = heldKeys; @@ -215,7 +215,7 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) playerEvent |= PLAYER_EVENT_USED_WATERFALL; } - if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == TRUE && ov9_02250F74(fieldSystem) == TRUE) { + if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == TRUE && DistWorld_ArePersistedFeaturesInit(fieldSystem) == TRUE) { playerEvent |= PLAYER_EVENT_DISTORTION_WORLD; } @@ -237,17 +237,17 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) int direction = (s8)input->playerDir; if (direction == DIR_NONE) { - direction = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + direction = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); } - if (ov9_0224A67C(fieldSystem, direction) == TRUE) { + if (DistWorld_HandlePlayerMovementEnd(fieldSystem, direction) == TRUE) { return TRUE; } } } if (input->sign - && PlayerAvatar_GetDir(fieldSystem->playerAvatar) == input->playerDir + && PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar) == input->playerDir && Field_CheckSign(fieldSystem) == TRUE) { return TRUE; } @@ -264,7 +264,7 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) if (validInteraction == TRUE) { if (sub_0205F588(fieldSystem->playerAvatar) == TRUE) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } if (MapObject_GetTrainerType(object) != 0x9) { @@ -306,7 +306,7 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) } int playerX, playerZ; - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); Field_Step(fieldSystem, &playerX, &playerZ); @@ -317,7 +317,7 @@ BOOL FieldInput_Process(const FieldInput *input, FieldSystem *fieldSystem) if (input->mapTransition) { if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == TRUE) { - ov9_0224A800(fieldSystem, input->transitionDir); + DistWorld_CheckMapTransition(fieldSystem, input->transitionDir); } else if (Field_CheckMapTransition(fieldSystem, input) == TRUE) { Field_TrySetMapConnection(fieldSystem); return TRUE; @@ -404,7 +404,7 @@ BOOL FieldInput_Process_Colosseum(FieldInput *input, FieldSystem *fieldSystem) if (sub_0203CA40(fieldSystem, &object) == TRUE && MapObject_GetMovementType(object) != 0x1) { if (sub_0205F588(fieldSystem->playerAvatar) == TRUE) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } ScriptManager_Set(fieldSystem, MapObject_GetScript(object), object); @@ -459,7 +459,7 @@ BOOL FieldInput_Process_UnionRoom(const FieldInput *input, FieldSystem *fieldSys if (sub_0203CA40(fieldSystem, &object) == TRUE) { if (sub_0205F588(fieldSystem->playerAvatar) == TRUE) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } CommManager_PauseUnionClient(); @@ -496,7 +496,7 @@ int FieldInput_Process_BattleTower(const FieldInput *input, FieldSystem *fieldSy if (sub_0203CA40(fieldSystem, &object) == TRUE) { if (sub_0205F588(fieldSystem->playerAvatar) == TRUE) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } if (MapObject_GetTrainerType(object) != 0x9) { @@ -564,7 +564,7 @@ static BOOL Field_CheckMapTransition(FieldSystem *fieldSystem, const FieldInput return FALSE; } - if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM) == TRUE && ov8_0224BF4C(fieldSystem) == TRUE) { + if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM) == TRUE && VeilstoneGym_HitPunchingBag(fieldSystem) == TRUE) { return TRUE; } @@ -649,7 +649,7 @@ static BOOL Field_CheckMapTransition(FieldSystem *fieldSystem, const FieldInput u16 Field_TileBehaviorToScript(FieldSystem *fieldSystem, u8 behavior) { - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (TileBehavior_IsPC(behavior) && playerDir == DIR_NORTH) { return SCRIPT_ID(COMMON_SCRIPTS, 18); @@ -683,7 +683,7 @@ u16 Field_TileBehaviorToScript(FieldSystem *fieldSystem, u8 behavior) return SCRIPT_ID(FIELD_MOVES, 3); } - if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) != PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) != PLAYER_AVATAR_SURFING) { TrainerInfo *info = SaveData_GetTrainerInfo(fieldSystem->saveData); u32 distortionBehavior = PlayerAvatar_GetDistortionCurrTileBehaviour(fieldSystem->playerAvatar); @@ -703,18 +703,18 @@ static BOOL Field_ProcessStep(FieldSystem *fieldSystem) return TRUE; } - if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == TRUE && ov9_0224A71C(fieldSystem) == TRUE) { + if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == TRUE && DistWorld_HandlePlayerPositionChanged(fieldSystem) == TRUE) { return TRUE; } - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (ov5_021E1154(fieldSystem, fieldSystem->playerAvatar, playerDir) == TRUE) { return TRUE; } - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); u8 tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, playerX, playerZ); if (Field_CheckCoordEvent(fieldSystem) == TRUE) { @@ -726,7 +726,7 @@ static BOOL Field_ProcessStep(FieldSystem *fieldSystem) return TRUE; } - if (sub_0205EF58(fieldSystem->playerAvatar)) { + if (PlayerAvatar_CheckForcedMovement(fieldSystem->playerAvatar)) { return FALSE; } @@ -785,7 +785,7 @@ static BOOL Field_CheckTransition(FieldSystem *fieldSystem, const int playerX, c } if (TileBehavior_IsEscalatorFlipFace(curTileBehavior) == TRUE) { - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (playerDir == DIR_WEST) { playerDir = DIR_EAST; @@ -799,7 +799,7 @@ static BOOL Field_CheckTransition(FieldSystem *fieldSystem, const int playerX, c sub_02056BDC(fieldSystem, nextMap.mapId, nextMap.warpId, 0, 0, playerDir, 2); return TRUE; } else if (TileBehavior_IsEscalator(curTileBehavior) == TRUE) { - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (playerDir != DIR_WEST && playerDir != DIR_EAST) { GF_ASSERT(FALSE); @@ -946,13 +946,13 @@ static BOOL Field_UpdateSafari(FieldSystem *fieldSystem) static void Field_GetPlayerPos(const FieldSystem *fieldSystem, int *playerX, int *playerZ) { - *playerX = Player_GetXPos(fieldSystem->playerAvatar); - *playerZ = Player_GetZPos(fieldSystem->playerAvatar); + *playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + *playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); } static void Field_Step(const FieldSystem *fieldSystem, int *playerX, int *playerZ) { - int playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); Field_StepInDirection(fieldSystem, playerDir, playerX, playerZ); } @@ -1015,7 +1015,7 @@ static BOOL Field_MapConnection(const FieldSystem *fieldSystem, int playerX, int } Location *v2 = FieldOverworldState_GetEntranceLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - Location_Set(v2, fieldSystem->location->mapId, v1, playerX, playerZ, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + Location_Set(v2, fieldSystem->location->mapId, v1, playerX, playerZ, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); return TRUE; } @@ -1047,7 +1047,7 @@ static void Field_TrySetMapConnection(FieldSystem *fieldSystem) if (Field_MapConnection(fieldSystem, playerX, playerZ, &nextMap)) { if (MapHeader_IsOnMainMatrix(fieldSystem->location->mapId) == TRUE && MapHeader_IsOnMainMatrix(nextMap.mapId) == FALSE) { - Field_SetMapConnection(fieldSystem, playerX, playerZ, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + Field_SetMapConnection(fieldSystem, playerX, playerZ, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } } else { Field_Step(fieldSystem, &playerX, &playerZ); @@ -1056,7 +1056,7 @@ static void Field_TrySetMapConnection(FieldSystem *fieldSystem) && MapHeader_IsOnMainMatrix(fieldSystem->location->mapId) == TRUE && MapHeader_IsOnMainMatrix(nextMap.mapId) == FALSE) { - Field_SetMapConnection(fieldSystem, playerX, playerZ, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + Field_SetMapConnection(fieldSystem, playerX, playerZ, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } } } diff --git a/src/overlay005/field_effect_renderer.c b/src/overlay005/field_effect_renderer.c index b94212ab5f..ac84817fde 100644 --- a/src/overlay005/field_effect_renderer.c +++ b/src/overlay005/field_effect_renderer.c @@ -23,7 +23,6 @@ #include "overlay005/ov5_021F3D00.h" #include "overlay005/ov5_021F3E74.h" #include "overlay005/ov5_021F4018.h" -#include "overlay005/ov5_021F428C.h" #include "overlay005/ov5_021F47B0.h" #include "overlay005/ov5_021F4DAC.h" #include "overlay005/ov5_021F4E08.h" @@ -38,6 +37,7 @@ #include "overlay005/ov5_021F600C.h" #include "overlay005/ov5_021F61BC.h" #include "overlay005/surf_mount_renderer.h" +#include "overlay005/veilstone_gym_object_renderer.h" const FieldEffectRendererFuncs sFieldEffectRendererHandlers[FIELD_EFFECT_RENDERER_COUNT + 1] = { { FIELD_EFFECT_RENDERER_00, ov5_021F134C, ov5_021F1370 }, @@ -71,7 +71,7 @@ const FieldEffectRendererFuncs sFieldEffectRendererHandlers[FIELD_EFFECT_RENDERE { FIELD_EFFECT_RENDERER_BERRY_PATCH_EFFECT_COUNTER, BerryPatchGraphicsManager_NewEffectCounter, BerryPatchGraphicsManager_FreeEffectCounter }, { FIELD_EFFECT_RENDERER_1D, ov5_021F10E8, ov5_021F10FC }, { FIELD_EFFECT_RENDERER_1E, ov5_021F4018, ov5_021F4034 }, - { FIELD_EFFECT_RENDERER_1F, ov5_021F428C, ov5_021F42A8 }, + { FIELD_EFFECT_RENDERER_VEILSTONE_GYM_OBJECTS, VeilstoneGymObjectRenderer_New, VeilstoneGymObjectRenderer_Free }, { FIELD_EFFECT_RENDERER_20, ov5_021F47B0, ov5_021F47CC }, { FIELD_EFFECT_RENDERER_DISTORTION_WORLD_SURF_MOUNT, DistWorldSurfMountRenderer_New, DistWorldSurfMountRenderer_Free }, { FIELD_EFFECT_RENDERER_INVALID, NULL, NULL } diff --git a/src/overlay005/fieldmap.c b/src/overlay005/fieldmap.c index 82a2c552bb..b8569bdaee 100644 --- a/src/overlay005/fieldmap.c +++ b/src/overlay005/fieldmap.c @@ -88,7 +88,7 @@ FS_EXTERN_OVERLAY(overlay6); FS_EXTERN_OVERLAY(overlay7); -FS_EXTERN_OVERLAY(overlay8); +FS_EXTERN_OVERLAY(gym_features); FS_EXTERN_OVERLAY(overlay9); struct UnkStruct_ov5_021D1A68_t { @@ -175,7 +175,7 @@ static BOOL FieldMap_Init(ApplicationManager *appMan, int *state) switch (FieldMap_GetExtOverlayForActiveDynMapFeatures(fieldSystem)) { case FIELD_EXTENSION_OVERLAY_GYM: - Overlay_LoadByID(FS_OVERLAY_ID(overlay8), OVERLAY_LOAD_ASYNC); + Overlay_LoadByID(FS_OVERLAY_ID(gym_features), OVERLAY_LOAD_ASYNC); break; case FIELD_EXTENSION_OVERLAY_GENERIC: @@ -279,9 +279,9 @@ static BOOL FieldMap_Exit(ApplicationManager *appMan, int *param1) DynamicMapFeatures_Free(fieldSystem); LandDataManager_ForgetTrackedTarget(fieldSystem->landDataMan); - fieldSystem->location->x = Player_GetXPos(fieldSystem->playerAvatar); - fieldSystem->location->z = Player_GetZPos(fieldSystem->playerAvatar); - fieldSystem->location->faceDirection = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + fieldSystem->location->x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + fieldSystem->location->z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); + fieldSystem->location->faceDirection = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); DynamicTerrainHeightManager_Free(fieldSystem->dynamicTerrainHeightMan); @@ -352,7 +352,7 @@ static BOOL FieldMap_Exit(ApplicationManager *appMan, int *param1) if (fieldSystem->mapLoadMode->loadExtOverlay) { Overlay_UnloadByID(FS_OVERLAY_ID(overlay6)); - Overlay_UnloadByID(FS_OVERLAY_ID(overlay8)); + Overlay_UnloadByID(FS_OVERLAY_ID(gym_features)); Overlay_UnloadByID(FS_OVERLAY_ID(overlay7)); Overlay_UnloadByID(FS_OVERLAY_ID(overlay9)); } @@ -388,8 +388,8 @@ static enum FieldExtensionOverlay FieldMap_GetExtOverlayForActiveDynMapFeatures( static BOOL FieldSystem_UpdateLocationToPlayerPosition(FieldSystem *fieldSystem) { - int x = Player_GetXPos(fieldSystem->playerAvatar); - int z = Player_GetZPos(fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); if ((x != fieldSystem->location->x) || (z != fieldSystem->location->z)) { fieldSystem->location->x = x; @@ -406,8 +406,8 @@ static BOOL FieldMap_ChangeZone(FieldSystem *fieldSystem) return FALSE; } - int x = (Player_GetXPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileX(fieldSystem->landDataMan)) / MAP_TILES_COUNT_X; - int y = (Player_GetZPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileZ(fieldSystem->landDataMan)) / MAP_TILES_COUNT_Z; + int x = (PlayerAvatar_GetXPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileX(fieldSystem->landDataMan)) / MAP_TILES_COUNT_X; + int y = (PlayerAvatar_GetZPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileZ(fieldSystem->landDataMan)) / MAP_TILES_COUNT_Z; u32 newMapID = MapMatrix_GetMapHeaderIDAtCoords(fieldSystem->mapMatrix, x, y); u32 oldMapID = fieldSystem->location->mapId; @@ -511,9 +511,9 @@ static void ov5_021D13B4(FieldSystem *fieldSystem) } OverworldMapHistory *mapHistory = FieldOverworldState_GetMapHistory(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - int mapX = (Player_GetXPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileX(fieldSystem->landDataMan)) / MAP_TILES_COUNT_X; - int mapZ = (Player_GetZPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileZ(fieldSystem->landDataMan)) / MAP_TILES_COUNT_Z; - int faceDirection = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int mapX = (PlayerAvatar_GetXPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileX(fieldSystem->landDataMan)) / MAP_TILES_COUNT_X; + int mapZ = (PlayerAvatar_GetZPos(fieldSystem->playerAvatar) - LandDataManager_GetOffsetTileZ(fieldSystem->landDataMan)) / MAP_TILES_COUNT_Z; + int faceDirection = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); OverworldMapHistory_Push(mapHistory, mapX, mapZ, faceDirection); } @@ -861,13 +861,13 @@ static void ov5_021D1878(FieldSystem *fieldSystem) PersistedMapFeatures *v3 = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); int v4 = PersistedMapFeatures_GetID(v3); - PlayerAvatar_InitDraw(fieldSystem->playerAvatar, v4); + PlayerAvatar_InitMapFeatures(fieldSystem->playerAvatar, v4); } sub_02061C48(fieldSystem->mapObjMan); CommPlayerMan_ForcePos(); sub_02062C3C(fieldSystem->mapObjMan); - LandDataManager_TrackTarget(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem->landDataMan); + LandDataManager_TrackTarget(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem->landDataMan); fieldSystem->unk_04->berryPatchManager = BerryPatchManager_New(fieldSystem, HEAP_ID_FIELD1); } @@ -882,7 +882,7 @@ static void ov5_021D1968(FieldSystem *fieldSystem) { int v0 = FieldOverworldState_GetCameraType(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - FieldCamera_Create(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem, v0, 1); + FieldCamera_Create(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem, v0, 1); } fieldSystem->areaLightMan = AreaLightManager_New(fieldSystem->areaModelAttrs, AreaDataManager_GetAreaLightArchiveID(fieldSystem->areaDataManager)); diff --git a/src/overlay005/fishing.c b/src/overlay005/fishing.c index db2bb2c2f8..63bd8fea42 100644 --- a/src/overlay005/fishing.c +++ b/src/overlay005/fishing.c @@ -200,7 +200,7 @@ static void GoFish(SysTask *task, void *fishingTaskParam) { FishingTask *fishingTask = fishingTaskParam; PlayerAvatar *playerAvatar = fishingTask->fieldSystem->playerAvatar; - MapObject *playerMapObject = Player_MapObject(playerAvatar); + MapObject *playerMapObject = PlayerAvatar_GetMapObject(playerAvatar); while (sFishingActions[fishingTask->fishingTask](fishingTask, playerAvatar, playerMapObject)) {} } diff --git a/src/overlay005/honey_tree.c b/src/overlay005/honey_tree.c index 3f09c91a64..f8625a6cfd 100644 --- a/src/overlay005/honey_tree.c +++ b/src/overlay005/honey_tree.c @@ -102,10 +102,10 @@ BOOL HoneyTree_TryInteract(FieldSystem *fieldSystem, int *eventId) *eventId = SCRIPT_ID(COMMON_SCRIPTS, 8); - x = Player_GetXPos(fieldSystem->playerAvatar); - z = Player_GetZPos(fieldSystem->playerAvatar); + x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); - if (PlayerAvatar_GetDir(fieldSystem->playerAvatar) == DIR_NORTH) { // Honey Trees can only be interacted with from below. + if (PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar) == DIR_NORTH) { // Honey Trees can only be interacted with from below. TerrainCollisionHitbox_Init(x, z, 0, -1, 1, 1, &v0); isFacingHoneyTree = FieldSystem_FindCollidingLoadedMapPropByModelID(fieldSystem, honey_tree_nsbmd, &v0, NULL); } else { diff --git a/src/overlay005/map_prop_animation.c b/src/overlay005/map_prop_animation.c index d942486ca0..4c6300a336 100644 --- a/src/overlay005/map_prop_animation.c +++ b/src/overlay005/map_prop_animation.c @@ -4,7 +4,7 @@ #include "constants/heap.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "heap.h" #include "narc.h" diff --git a/src/overlay005/ov5_021D431C.c b/src/overlay005/ov5_021D431C.c index a72c95cae0..cc92815abd 100644 --- a/src/overlay005/ov5_021D431C.c +++ b/src/overlay005/ov5_021D431C.c @@ -169,12 +169,12 @@ BOOL ov5_021D433C(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1) } } break; case 3: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_WALK_NORMAL_NORTH); (param1->unk_00)++; break; case 4: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -334,18 +334,18 @@ BOOL ov5_021D453C(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1) v12 = MapPropOneShotAnimationManager_IsAnimationLoopFinished(fieldSystem->mapPropOneShotAnimMan, 1); if (v12) { - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v0, 0); (param1->unk_00)++; } } break; case 3: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_WALK_NORMAL_SOUTH); (param1->unk_00)++; break; case 4: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -513,7 +513,7 @@ BOOL ov5_021D4858(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons return 1; } - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_PAUSE_ANIMATION); @@ -527,7 +527,7 @@ BOOL ov5_021D4858(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons FieldMap_FadeScreen(FADE_TYPE_BRIGHTNESS_IN); MapPropOneShotAnimationManager_PlayAnimationWithSoundEffect(fieldSystem->mapPropOneShotAnimMan, 2, 0, 1557); - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { int v8; @@ -546,7 +546,7 @@ BOOL ov5_021D4858(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons (param1->unk_00)++; break; case 2: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_RESUME_ANIMATION); @@ -554,7 +554,7 @@ BOOL ov5_021D4858(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons } break; case 3: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { int v9; @@ -570,7 +570,7 @@ BOOL ov5_021D4858(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons } break; case 4: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -630,7 +630,7 @@ BOOL ov5_021D4A24(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons return 1; } - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_PAUSE_ANIMATION); @@ -642,7 +642,7 @@ BOOL ov5_021D4A24(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons } break; case 1: MapPropOneShotAnimationManager_PlayAnimationWithSoundEffect(fieldSystem->mapPropOneShotAnimMan, 2, 0, 1557); - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { int v8; @@ -661,7 +661,7 @@ BOOL ov5_021D4A24(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons (param1->unk_00)++; break; case 2: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 1) { LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_RESUME_ANIMATION); @@ -671,7 +671,7 @@ BOOL ov5_021D4A24(FieldSystem *fieldSystem, UnkStruct_ov5_021D432C *param1, cons } break; case 3: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -880,9 +880,9 @@ BOOL ov5_021D4E10(FieldTask *param0) switch (v2->unk_00) { case 0: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); - if (PlayerAvatar_GetDir(fieldSystem->playerAvatar) == 1) { + if (PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar) == 1) { MapObject_SetHidden(v0, 1); (v2->unk_00) = 1; } else { @@ -902,13 +902,13 @@ BOOL ov5_021D4E10(FieldTask *param0) v2->unk_08 = 1; break; case 1: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v0, 0); LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_WALK_NORMAL_SOUTH); (v2->unk_00)++; break; case 2: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -939,7 +939,7 @@ BOOL ov5_021D4F14(FieldTask *param0) case 0: { MapObject *v2; - v2 = Player_MapObject(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v2, 1); @@ -1009,8 +1009,8 @@ BOOL ov5_021D5020(FieldTask *param0) u8 v3; u8 v4; - v0 = Player_MapObject(fieldSystem->playerAvatar); - v3 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); + v3 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (v3 == 1) { MapObject_SetHidden(v0, 1); @@ -1049,13 +1049,13 @@ BOOL ov5_021D5020(FieldTask *param0) v2->unk_08 = 1; } break; case 1: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v0, 0); LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_WALK_NORMAL_SOUTH); (v2->unk_00)++; break; case 2: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); @@ -1088,8 +1088,8 @@ BOOL ov5_021D5150(FieldTask *param0) u8 v3; u8 v4; - v0 = Player_MapObject(fieldSystem->playerAvatar); - v3 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); + v3 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (v3 == 1) { MapObject_SetHidden(v0, 1); @@ -1102,13 +1102,13 @@ BOOL ov5_021D5150(FieldTask *param0) sub_02056B30(param0, 0, 1, 1, 0x0, 6, 1, HEAP_ID_FIELD2); } break; case 1: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v0, 0); LocalMapObj_SetAnimationCode(v0, MOVEMENT_ACTION_WALK_NORMAL_SOUTH); (v2->unk_00)++; break; case 2: - v0 = Player_MapObject(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v0) == 1) { sub_020656AC(v0); diff --git a/src/overlay005/ov5_021DFB54.c b/src/overlay005/ov5_021DFB54.c index ca3ed6a5c8..25f78bc72a 100644 --- a/src/overlay005/ov5_021DFB54.c +++ b/src/overlay005/ov5_021DFB54.c @@ -228,7 +228,7 @@ void PlayerAvatar_SetTransitionState(PlayerAvatar *playerAvatar, u32 bit) void PlayerAvatar_RequestChangeState(PlayerAvatar *playerAvatar) { u32 state = 0; - u32 flag = PlayerAvatar_RequestStateFlag(playerAvatar); + u32 flag = PlayerAvatar_GetRequestStateFlag(playerAvatar); do { if (flag & 0x1) { @@ -244,20 +244,20 @@ void PlayerAvatar_RequestChangeState(PlayerAvatar *playerAvatar) static void PlayerAvatar_RequestStateWalking(PlayerAvatar *playerAvatar) { int v0; - int v1 = 0x0; + int v1 = PLAYER_AVATAR_WALKING; if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) { - v1 = 0x18; + v1 = PLAYER_AVATAR_DISTORTION_WORLD; } else { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_HEARTHOME_GYM) == 1) { - v1 = 0x1c; + v1 = PLAYER_AVATAR_HEARTHOME_GYM; } } - v0 = Player_MoveStateFromGender(v1, PlayerAvatar_Gender(playerAvatar)); + v0 = Player_GetSpriteFromStateAndGender(v1, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); PlayerAvatar_SetPlayerState(playerAvatar, 0x0); @@ -276,10 +276,10 @@ static void PlayerAvatar_RequestStateWalking(PlayerAvatar *playerAvatar) static void PlayerAvatar_RequestStateCycle(PlayerAvatar *playerAvatar) { - int v0 = Player_MoveStateFromGender(PLAYER_STATE_CYCLING, PlayerAvatar_Gender(playerAvatar)); + int v0 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_CYCLING, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); - PlayerAvatar_SetPlayerState(playerAvatar, PLAYER_STATE_CYCLING); + PlayerAvatar_SetPlayerState(playerAvatar, PLAYER_AVATAR_CYCLING); PlayerAvatar_ClearSpeed(playerAvatar); { @@ -298,7 +298,7 @@ static void PlayerAvatar_RequestStateCycle(PlayerAvatar *playerAvatar) static void PlayerAvatar_RequestStateSurf(PlayerAvatar *playerAvatar) { int v0, v1; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar); OverworldAnimManager *v5 = PlayerAvatar_GetSurfMountAnimManager(playerAvatar); @@ -310,94 +310,94 @@ static void PlayerAvatar_RequestStateSurf(PlayerAvatar *playerAvatar) PlayerAvatar_SetSurfMountAnimManager(playerAvatar, NULL); if (PlayerAvatar_DistortionStateOnFloor(playerAvatar) == TRUE) { - v1 = PlayerAvatar_GetDir(playerAvatar); + v1 = PlayerAvatar_GetFacingDir(playerAvatar); } else { - v1 = PlayerAvatar_GetMoveDir(playerAvatar); + v1 = PlayerAvatar_GetMovingDir(playerAvatar); } if (distortionState == AVATAR_DISTORTION_STATE_NONE) { v5 = SurfMountRenderer_HandleSurfBegin(mapObj, 0, 0, v1, TRUE); - v0 = PLAYER_STATE_SURFING; + v0 = PLAYER_AVATAR_SURFING; } else { v5 = DistWorldSurfMountRenderer_HandleSurfBegin(playerAvatar, 0, 0, 0, v1, 1, distortionState); - v0 = 0x19; + v0 = PLAYER_AVATAR_DISTORTION_WORLD_SURF; } PlayerAvatar_SetSurfMountAnimManager(playerAvatar, v5); - v0 = Player_MoveStateFromGender(v0, PlayerAvatar_Gender(playerAvatar)); + v0 = Player_GetSpriteFromStateAndGender(v0, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); - PlayerAvatar_SetPlayerState(playerAvatar, PLAYER_STATE_SURFING); + PlayerAvatar_SetPlayerState(playerAvatar, PLAYER_AVATAR_SURFING); PlayerAvatar_ClearSpeed(playerAvatar); } static void ov5_021DFCE4(PlayerAvatar *playerAvatar) { - sub_0205EF6C(playerAvatar, 1); + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 1); } static void ov5_021DFCF0(PlayerAvatar *playerAvatar) { - int v0 = Player_MoveStateFromGender(0x11, PlayerAvatar_Gender(playerAvatar)); + int v0 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_SPRAYDUCK, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } static void ov5_021DFD0C(PlayerAvatar *playerAvatar) { - int v0 = Player_MoveStateFromGender(0x13, PlayerAvatar_Gender(playerAvatar)); + int v0 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_FISHING, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } static void PlayerAvatar_RequestStatePoketch(PlayerAvatar *playerAvatar) { int v0; - int v1 = 0x14; + int v1 = PLAYER_AVATAR_POKETCH; if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) { - v1 = 0x1b; + v1 = PLAYER_AVATAR_27; } else { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_HEARTHOME_GYM) == 1) { - v1 = 0x1e; + v1 = PLAYER_AVATAR_30; } } - v0 = Player_MoveStateFromGender(v1, PlayerAvatar_Gender(playerAvatar)); + v0 = Player_GetSpriteFromStateAndGender(v1, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } static void PlayerAvatar_RequestStateSave(PlayerAvatar *playerAvatar) { int v0; - int v1 = 0x15; + int v1 = PLAYER_AVATAR_SAVE; if (PlayerAvatar_MapDistortionState(playerAvatar) != AVATAR_DISTORTION_STATE_NONE) { - v1 = 0x1a; + v1 = PLAYER_AVATAR_26; } else { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_HEARTHOME_GYM) == 1) { - v1 = 0x1d; + v1 = PLAYER_AVATAR_29; } } - v0 = Player_MoveStateFromGender(v1, PlayerAvatar_Gender(playerAvatar)); + v0 = Player_GetSpriteFromStateAndGender(v1, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } static void PlayerAvatar_RequestStateHeal(PlayerAvatar *playerAvatar) { - int v0 = Player_MoveStateFromGender(0x16, PlayerAvatar_Gender(playerAvatar)); + int v0 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_HEAL, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } static void ov5_021DFDC4(PlayerAvatar *playerAvatar) { - int v0 = Player_MoveStateFromGender(0x17, PlayerAvatar_Gender(playerAvatar)); + int v0 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_VS_SEEKER, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_Redraw(playerAvatar, v0); } @@ -420,11 +420,11 @@ int ov5_021DFDE0(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, enum Face MapObject *v0; GF_ASSERT(playerAvatar != NULL); - v0 = Player_MapObject(playerAvatar); + v0 = PlayerAvatar_GetMapObject(playerAvatar); GF_ASSERT(v0 != NULL); } - if (sub_0205EF58(playerAvatar) == 1) { + if (PlayerAvatar_CheckForcedMovement(playerAvatar) == 1) { if (ov5_021E067C(fieldSystem, playerAvatar, param3) == 1) { return 1; } @@ -553,7 +553,7 @@ static void ov5_021DFF88(int param0, FieldSystem *fieldSystem, PlayerAvatar *pla static BOOL ov5_021DFFBC(FieldTask *param0) { UnkStruct_ov5_021DFF88 *v0 = FieldTask_GetEnv(param0); - MapObject *v1 = Player_MapObject(v0->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(v0->playerAvatar); MapObject *v2 = v0->unk_10; switch (v0->unk_00) { @@ -620,7 +620,7 @@ static void SurfTask_Start(FieldSystem *fieldSystem, int direction, const MonRid taskEnv->direction = direction; taskEnv->fieldSystem = fieldSystem; taskEnv->playerAvatar = fieldSystem->playerAvatar; - taskEnv->playerObject = Player_MapObject(taskEnv->playerAvatar); + taskEnv->playerObject = PlayerAvatar_GetMapObject(taskEnv->playerAvatar); taskEnv->monRideTask = *monRideTask; FieldTask_InitCall(fieldSystem->task, FieldTask_UseSurf, taskEnv); @@ -638,7 +638,7 @@ void FieldTask_StartUseSurf(FieldTask *task, int direction, int partySlot) BOOL PlayerAvatar_CanUseSurf(PlayerAvatar *playerAvatar, u32 currTileBehavior, u32 nextTileBehavior) { - MapObject *playerObj = Player_MapObject(playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(playerAvatar); if (TileBehavior_IsSurfable(nextTileBehavior) == TRUE) { if ((TileBehavior_IsBridge(currTileBehavior) == TRUE) || (TileBehavior_IsBridgeStart(currTileBehavior) == TRUE)) { @@ -678,8 +678,8 @@ static BOOL FieldTask_UseSurf(FieldTask *task) break; case 2: { if (PlayerAvatar_MapDistortionState(taskEnv->playerAvatar) == AVATAR_DISTORTION_STATE_NONE) { - int playerXPos = Player_GetXPos(taskEnv->playerAvatar) + MapObject_GetDxFromDir(taskEnv->direction); - int playerZPos = Player_GetZPos(taskEnv->playerAvatar) + MapObject_GetDzFromDir(taskEnv->direction); + int playerXPos = PlayerAvatar_GetXPos(taskEnv->playerAvatar) + MapObject_GetDxFromDir(taskEnv->direction); + int playerZPos = PlayerAvatar_GetZPos(taskEnv->playerAvatar) + MapObject_GetDzFromDir(taskEnv->direction); taskEnv->unk_28 = SurfMountRenderer_HandleSurfBegin(taskEnv->playerObject, playerXPos, playerZPos, taskEnv->direction, FALSE); } else { int mountXPos = MapObject_GetX(taskEnv->playerObject); @@ -728,13 +728,13 @@ static BOOL FieldTask_UseSurf(FieldTask *task) int moveState; SurfMountRenderer_SetSyncPos(taskEnv->unk_28, TRUE); - moveState = Player_MoveStateFromGender(0x2, PlayerAvatar_Gender(taskEnv->playerAvatar)); + moveState = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_SURFING, PlayerAvatar_GetGender(taskEnv->playerAvatar)); PlayerAvatar_Redraw(taskEnv->playerAvatar, moveState); } else { int moveState; DistWorldSurfMountRenderer_SetFlags(taskEnv->unk_28, DIST_WORLD_SURF_MOUNT_RENDERER_FLAG_MASK_TICK); - moveState = Player_MoveStateFromGender(0x19, PlayerAvatar_Gender(taskEnv->playerAvatar)); + moveState = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_DISTORTION_WORLD_SURF, PlayerAvatar_GetGender(taskEnv->playerAvatar)); PlayerAvatar_Redraw(taskEnv->playerAvatar, moveState); } @@ -747,13 +747,13 @@ static BOOL FieldTask_UseSurf(FieldTask *task) static int ov5_021E032C(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, int param2, int param3) { - if ((param3 != 1) || (PlayerAvatar_GetPlayerState(playerAvatar) != 0x2)) { + if ((param3 != 1) || (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_SURFING)) { return 0; } { u32 v0; - MapObject *v1 = Player_MapObject(playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(playerAvatar); if (PlayerAvatar_DistortionGravityChanged(playerAvatar) == FALSE) { v0 = sub_02060B7C(playerAvatar, v1, param2); @@ -783,7 +783,7 @@ static void ov5_021E0390(int param0, FieldSystem *fieldSystem, PlayerAvatar *par v0->unk_04 = param0; v0->fieldSystem = fieldSystem; v0->playerAvatar = param2; - v0->unk_10 = Player_MapObject(param2); + v0->unk_10 = PlayerAvatar_GetMapObject(param2); v0->unk_14 = PlayerAvatar_GetSurfMountAnimManager(param2); FieldSystem_CreateTask(fieldSystem, ov5_021E03C8, v0); @@ -805,10 +805,10 @@ static BOOL ov5_021E03C8(FieldTask *param0) if (distortionState == AVATAR_DISTORTION_STATE_NONE) { SurfMountRenderer_SetSyncPos(v0->unk_14, FALSE); - v1 = Player_MoveStateFromGender(0x0, PlayerAvatar_Gender(v0->playerAvatar)); + v1 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_WALKING, PlayerAvatar_GetGender(v0->playerAvatar)); } else { DistWorldSurfMountRenderer_ClearFlags(v0->unk_14, DIST_WORLD_SURF_MOUNT_RENDERER_FLAG_MASK_TICK); - v1 = Player_MoveStateFromGender(0x18, PlayerAvatar_Gender(v0->playerAvatar)); + v1 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_DISTORTION_WORLD, PlayerAvatar_GetGender(v0->playerAvatar)); } PlayerAvatar_Redraw(v0->playerAvatar, v1); @@ -841,7 +841,7 @@ static BOOL ov5_021E03C8(FieldTask *param0) static int ov5_021E04A8(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, int param2, int param3) { - if ((param2 != 1) || (param3 != 1) || (PlayerAvatar_GetPlayerState(playerAvatar) != 0x2)) { + if ((param2 != 1) || (param3 != 1) || (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_SURFING)) { return 0; } @@ -863,7 +863,7 @@ static BOOL FieldSystem_TryGetStuckInDeepMud(FieldSystem *fieldSystem, PlayerAva return FALSE; } - MapObject *playerMapObject = Player_MapObject(playerAvatar); + MapObject *playerMapObject = PlayerAvatar_GetMapObject(playerAvatar); u8 tileBehavior = MapObject_GetCurrTileBehavior(playerMapObject); if (TileBehavior_IsDeepMud(tileBehavior) != TRUE && TileBehavior_IsDeepMudWithGrass(tileBehavior) != TRUE) { @@ -888,7 +888,7 @@ static void FieldSystem_CreateTaskStuckInDeepMud(FieldSystem *fieldSystem, Playe static BOOL FieldTask_StuckInDeepMud(FieldTask *fieldTaskEnv) { StuckInDeepMudTaskEnv *stuckInDeepMudTaskEnv = FieldTask_GetEnv(fieldTaskEnv); - MapObject *playerMapObject = Player_MapObject(stuckInDeepMudTaskEnv->playerAvatar); + MapObject *playerMapObject = PlayerAvatar_GetMapObject(stuckInDeepMudTaskEnv->playerAvatar); switch (stuckInDeepMudTaskEnv->state) { case 0: @@ -910,7 +910,7 @@ static BOOL FieldTask_StuckInDeepMud(FieldTask *fieldTaskEnv) stuckInDeepMudTaskEnv->state++; case 2: { - enum FaceDirection playerInitialDirection = PlayerAvatar_GetDir(stuckInDeepMudTaskEnv->playerAvatar); + enum FaceDirection playerInitialDirection = PlayerAvatar_GetFacingDir(stuckInDeepMudTaskEnv->playerAvatar); u32 movementAction; u32 pressedKeys = gSystem.pressedKeys; u32 heldKeys = gSystem.heldKeys; @@ -954,7 +954,7 @@ static BOOL FieldTask_StuckInDeepMud(FieldTask *fieldTaskEnv) static int ov5_021E067C(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, int param2) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); if (LocalMapObj_IsAnimationSet(v0) == 0) { return 0; @@ -969,12 +969,12 @@ static int ov5_021E067C(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, in static int ov5_021E06A8(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar) { - if (PlayerAvatar_Speed(playerAvatar) < 1) { + if (PlayerAvatar_GetSpeed(playerAvatar) < 1) { return 0; } { - int v0 = PlayerAvatar_GetMoveDir(playerAvatar); + int v0 = PlayerAvatar_GetMovingDir(playerAvatar); MapObject *v1 = ov5_021E10D4(playerAvatar, v0); if (v1 == NULL) { @@ -1004,7 +1004,7 @@ static void RockClimbTask_Start(FieldSystem *fieldSystem, int direction, const M taskEnv->direction = direction; taskEnv->fieldSystem = fieldSystem; taskEnv->playerAvatar = fieldSystem->playerAvatar; - taskEnv->playerObject = Player_MapObject(taskEnv->playerAvatar); + taskEnv->playerObject = PlayerAvatar_GetMapObject(taskEnv->playerAvatar); taskEnv->monRideTask = *monRideTask; FieldTask_InitCall(fieldSystem->task, FieldTask_UseRockClimb, taskEnv); @@ -1075,8 +1075,8 @@ static int SubTask_RockClimb_WaitCutIn(RockClimbTaskEnv *taskEnv) static int SubTask_RockClimb_CreateMount(RockClimbTaskEnv *taskEnv) { - int xPos = Player_GetXPos(taskEnv->playerAvatar) + MapObject_GetDxFromDir(taskEnv->direction); - int zPos = Player_GetZPos(taskEnv->playerAvatar) + MapObject_GetDzFromDir(taskEnv->direction); + int xPos = PlayerAvatar_GetXPos(taskEnv->playerAvatar) + MapObject_GetDxFromDir(taskEnv->direction); + int zPos = PlayerAvatar_GetZPos(taskEnv->playerAvatar) + MapObject_GetDzFromDir(taskEnv->direction); taskEnv->unk_18 = ov5_021F28F4(taskEnv->playerObject, xPos, zPos, taskEnv->direction, 0); taskEnv->unk_2C = ov6_0224892C(taskEnv->fieldSystem); @@ -1166,7 +1166,7 @@ static WaterfallTaskEnv *WaterfallTaskEnv_New(FieldSystem *fieldSystem, int dire taskEnv->direction = direction; taskEnv->fieldSystem = fieldSystem; taskEnv->playerAvatar = fieldSystem->playerAvatar; - taskEnv->playerObject = Player_MapObject(fieldSystem->playerAvatar); + taskEnv->playerObject = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (monRideTask != NULL) { taskEnv->monRideTask = *monRideTask; @@ -1525,8 +1525,8 @@ static void ov5_021E0DE0(FieldSystem *fieldSystem) v0->fieldSystem = fieldSystem; v0->playerAvatar = fieldSystem->playerAvatar; - v0->playerObject = Player_MapObject(v0->playerAvatar); - v0->playerGender = PlayerAvatar_Gender(v0->playerAvatar); + v0->playerObject = PlayerAvatar_GetMapObject(v0->playerAvatar); + v0->playerGender = PlayerAvatar_GetGender(v0->playerAvatar); FieldTask_InitCall(fieldSystem->task, ov5_021E0E10, v0); } @@ -1542,7 +1542,7 @@ static BOOL ov5_021E0E10(FieldTask *param0) break; case 1: if (MapObject_HasAnimationEnded(v0->unk_14) == 1) { - int v1 = Player_MoveStateFromGender(0x12, v0->playerGender); + int v1 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_CONTEST, v0->playerGender); PlayerAvatar_Redraw(v0->playerAvatar, v1); MapObject_FinishAnimation(v0->unk_14); @@ -1565,7 +1565,7 @@ static BOOL ov5_021E0E10(FieldTask *param0) void ov5_021E0E94(PlayerAvatar *playerAvatar) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); if (sub_02062DFC(v0) == 0) { return; @@ -1574,7 +1574,7 @@ void ov5_021E0E94(PlayerAvatar *playerAvatar) { int v1 = PlayerAvatar_GetPlayerState(playerAvatar); - if (v1 != 0x0) { + if (v1 != PLAYER_AVATAR_WALKING) { return; } } @@ -1588,7 +1588,7 @@ void ov5_021E0E94(PlayerAvatar *playerAvatar) } { - u32 v3 = PlayerAvatar_RequestStateFlag(playerAvatar); + u32 v3 = PlayerAvatar_GetRequestStateFlag(playerAvatar); PlayerAvatar_SetTransitionState(playerAvatar, PLAYER_TRANSITION_POKETCH); PlayerAvatar_RequestChangeState(playerAvatar); @@ -1598,7 +1598,7 @@ void ov5_021E0E94(PlayerAvatar *playerAvatar) void ov5_021E0EEC(PlayerAvatar *playerAvatar) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); if (sub_02062DFC(v0) == 0) { return; @@ -1607,7 +1607,7 @@ void ov5_021E0EEC(PlayerAvatar *playerAvatar) { int v1 = PlayerAvatar_GetPlayerState(playerAvatar); - if (v1 != 0x0) { + if (v1 != PLAYER_AVATAR_WALKING) { return; } } @@ -1621,7 +1621,7 @@ void ov5_021E0EEC(PlayerAvatar *playerAvatar) } { - u32 v3 = PlayerAvatar_RequestStateFlag(playerAvatar); + u32 v3 = PlayerAvatar_GetRequestStateFlag(playerAvatar); PlayerAvatar_SetTransitionState(playerAvatar, PLAYER_TRANSITION_WALKING); PlayerAvatar_RequestChangeState(playerAvatar); @@ -1634,13 +1634,13 @@ static SysTask *ov5_021E0F54(FieldSystem *fieldSystem, u32 param1) PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; int v1 = PlayerAvatar_GetPlayerState(playerAvatar); - if (v1 != 0x0) { + if (v1 != PLAYER_AVATAR_WALKING) { return NULL; } { SysTask *v2; - MapObject *v3 = Player_MapObject(playerAvatar); + MapObject *v3 = PlayerAvatar_GetMapObject(playerAvatar); UnkStruct_ov5_021E0FF0 *v4 = Heap_AllocAtEnd(HEAP_ID_FIELD1, sizeof(UnkStruct_ov5_021E0FF0)); v4->unk_00 = 0; @@ -1668,7 +1668,7 @@ static void ov5_021E0FC0(SysTask *param0) { UnkStruct_ov5_021E0FF0 *v0 = SysTask_GetParam(param0); PlayerAvatar *playerAvatar = v0->playerAvatar; - int v2 = Player_MoveStateFromGender(0x0, PlayerAvatar_Gender(playerAvatar)); + int v2 = Player_GetSpriteFromStateAndGender(PLAYER_AVATAR_WALKING, PlayerAvatar_GetGender(playerAvatar)); PlayerAvatar_RequestStateWalking(playerAvatar); Heap_Free(v0); @@ -1679,7 +1679,7 @@ static void ov5_021E0FC0(SysTask *param0) static void ov5_021E0FF0(SysTask *param0, void *param1) { UnkStruct_ov5_021E0FF0 *v0 = param1; - MapObject *v1 = Player_MapObject(v0->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(v0->playerAvatar); sub_02062B68(v1); } @@ -1708,7 +1708,7 @@ static void MonRideTask_Init(FieldSystem *fieldSystem, Pokemon *partyMon, MonRid { monRideTask->playCutIn = TRUE; monRideTask->partyMon = partyMon; - monRideTask->playerGender = PlayerAvatar_Gender(fieldSystem->playerAvatar); + monRideTask->playerGender = PlayerAvatar_GetGender(fieldSystem->playerAvatar); } static void NewMonRideCutIn(FieldSystem *fieldSystem, MonRideTask *monRideTask) @@ -1728,7 +1728,7 @@ static BOOL CheckMonRideCutInFinished(MonRideTask *monRideTask) static void PlayerAvatar_Redraw(PlayerAvatar *playerAvatar, int param1) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); if (PlayerAvatar_MapDistortionState(playerAvatar) == AVATAR_DISTORTION_STATE_NONE) { ov5_021EE3FC(v0, param1, NULL, NULL); } else { @@ -1749,7 +1749,7 @@ static void PlayerAvatar_Redraw(PlayerAvatar *playerAvatar, int param1) static void ov5_021E10C0(void *param0, const Billboard *param1) { PlayerAvatar *playerAvatar = param0; - MapObject *v1 = Player_MapObject(playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(v1); DistWorld_UnbindMapObjectRotator(fieldSystem, param1); @@ -1757,9 +1757,9 @@ static void ov5_021E10C0(void *param0, const Billboard *param1) static MapObject *ov5_021E10D4(PlayerAvatar *playerAvatar, int param1) { - int v0 = Player_GetXPos(playerAvatar) + MapObject_GetDxFromDir(param1); - int v1 = Player_GetZPos(playerAvatar) + MapObject_GetDzFromDir(param1); - const MapObjectManager *v2 = MapObject_MapObjectManager(Player_MapObject(playerAvatar)); + int v0 = PlayerAvatar_GetXPos(playerAvatar) + MapObject_GetDxFromDir(param1); + int v1 = PlayerAvatar_GetZPos(playerAvatar) + MapObject_GetDzFromDir(param1); + const MapObjectManager *v2 = MapObject_MapObjectManager(PlayerAvatar_GetMapObject(playerAvatar)); MapObject *v3 = sub_0206326C(v2, v0, v1, 0); return v3; diff --git a/src/overlay005/ov5_021E1154.c b/src/overlay005/ov5_021E1154.c index d2294e9f63..8af476d2ee 100644 --- a/src/overlay005/ov5_021E1154.c +++ b/src/overlay005/ov5_021E1154.c @@ -32,7 +32,7 @@ static void ov5_021E1350(void *param0); int ov5_021E1154(FieldSystem *fieldSystem, PlayerAvatar *playerAvatar, int param2) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); u8 v1 = MapObject_GetCurrTileBehavior(v0); int v2; @@ -83,7 +83,7 @@ static int ov5_021E11E0(int param0) static BOOL ov5_021E120C(FieldTask *param0) { UnkStruct_ov5_021E11B0 *v0 = FieldTask_GetEnv(param0); - MapObject *v1 = Player_MapObject(v0->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(v0->playerAvatar); u8 v2 = MapObject_GetCurrTileBehavior(v1); switch (v0->unk_08) { @@ -97,7 +97,7 @@ static BOOL ov5_021E120C(FieldTask *param0) v3 = MovementAction_TurnActionTowardsDir(v0->unk_00, v3); PlayerAvatar_SetAnimationCode(v0->playerAvatar, v3, 1); - Player_SetDir(v0->playerAvatar, v0->unk_00); + PlayerAvatar_TryFace(v0->playerAvatar, v0->unk_00); v0->unk_08++; v0->unk_04 = 7; } @@ -108,7 +108,7 @@ static BOOL ov5_021E120C(FieldTask *param0) case 4: case 2: v0->unk_00 = ov5_021E11E0(v0->unk_00); - Player_SetDir(v0->playerAvatar, v0->unk_00); + PlayerAvatar_TryFace(v0->playerAvatar, v0->unk_00); break; default: break; @@ -137,7 +137,7 @@ static BOOL ov5_021E120C(FieldTask *param0) } else { MapObject_SetStatusFlagOff(v1, MAP_OBJ_STATUS_LOCK_DIR); MapObject_SetStatusFlagOff(v1, MAP_OBJ_STATUS_PAUSE_ANIMATION); - Player_SetDir(v0->playerAvatar, v0->unk_00); + PlayerAvatar_TryFace(v0->playerAvatar, v0->unk_00); ov5_021E1350(v0); Sound_StopEffect(1624, 0); return 1; diff --git a/src/overlay005/ov5_021E135C.c b/src/overlay005/ov5_021E135C.c index 121aeb8a83..9eaaf2974a 100644 --- a/src/overlay005/ov5_021E135C.c +++ b/src/overlay005/ov5_021E135C.c @@ -42,13 +42,13 @@ static void ov5_021E135C(UnkStruct_ov5_021E135C *param0) break; } - Player_SetDir(param0->fieldSystem->playerAvatar, param0->unk_10); + PlayerAvatar_TryFace(param0->fieldSystem->playerAvatar, param0->unk_10); } static void ov5_021E139C(SysTask *param0, void *param1) { UnkStruct_ov5_021E135C *v0 = param1; - MapObject *v1 = Player_MapObject(v0->fieldSystem->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(v0->fieldSystem->playerAvatar); VecFx32 v2; switch (v0->unk_08) { @@ -81,7 +81,7 @@ static void ov5_021E139C(SysTask *param0, void *param1) static void ov5_021E1470(SysTask *param0, void *param1) { UnkStruct_ov5_021E135C *v0 = param1; - MapObject *v1 = Player_MapObject(v0->fieldSystem->playerAvatar); + MapObject *v1 = PlayerAvatar_GetMapObject(v0->fieldSystem->playerAvatar); VecFx32 v2; int v3; @@ -118,7 +118,7 @@ static void ov5_021E1470(SysTask *param0, void *param1) break; case 2: if (IsScreenFadeDone()) { - Player_SetDir(v0->fieldSystem->playerAvatar, 1); + PlayerAvatar_TryFace(v0->fieldSystem->playerAvatar, 1); *v0->unk_04 = 1; Heap_Free(v0); SysTask_Done(param0); @@ -135,7 +135,7 @@ void FieldSystem_StartWarpAnimation(FieldSystem *fieldSystem, BOOL param1, BOOL v0->fieldSystem = fieldSystem; v0->unk_04 = param2; - v0->unk_10 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + v0->unk_10 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (param1) { SysTask_Start(ov5_021E139C, v0, 100); diff --git a/src/overlay005/ov5_021EA874.c b/src/overlay005/ov5_021EA874.c index 5d2c5d881f..3aec0c8bf0 100644 --- a/src/overlay005/ov5_021EA874.c +++ b/src/overlay005/ov5_021EA874.c @@ -106,7 +106,7 @@ static BOOL ov5_021EA8F0(UnkStruct_ov5_021EAE78 *param0) WiFiList *v2 = SaveData_GetWiFiList(param0->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v2, v0)) { + if (!WiFiList_IsValidFriendData(v2, v0)) { sub_02039298(param0->saveData, param0->unk_8C, v0, HEAP_ID_FIELD1, 0); break; } @@ -149,7 +149,7 @@ static BOOL ov5_021EA9F8(UnkStruct_ov5_021EAE78 *param0) WiFiList *v4 = SaveData_GetWiFiList(param0->saveData); for (v2 = 0; v2 < 32; v2++) { - if (!sub_0202AF78(v4, v2)) { + if (!WiFiList_IsValidFriendData(v4, v2)) { sub_02039298(param0->saveData, param0->unk_8C, v2, HEAP_ID_FIELD1, 0); break; } @@ -254,7 +254,7 @@ static BOOL ov5_021EAB58(UnkStruct_ov5_021EAE78 *param0) { WiFiList *v0 = SaveData_GetWiFiList(param0->saveData); ListMenuTemplate v1; - int v2 = sub_0202AF94(v0); + int v2 = WiFiList_GetValidFriendsCount(v0); int v3 = 5; param0->unk_00 = StringList_New(v2 + 1, HEAP_ID_FIELD1); @@ -267,7 +267,7 @@ static BOOL ov5_021EAB58(UnkStruct_ov5_021EAE78 *param0) int v5 = 0; for (v5 = 0; v5 < 32; v5++) { - if (sub_0202AF78(v0, v5)) { + if (WiFiList_IsValidFriendData(v0, v5)) { String_CopyChars(param0->unk_08, sub_0202AEF0(v0, v5)); StringList_AddFromString(param0->unk_00, param0->unk_08, v5); } diff --git a/src/overlay005/ov5_021EE75C.c b/src/overlay005/ov5_021EE75C.c index f072b4228d..8af532ca45 100644 --- a/src/overlay005/ov5_021EE75C.c +++ b/src/overlay005/ov5_021EE75C.c @@ -39,8 +39,8 @@ static void ov5_021EE768(UnkStruct_ov5_021D1BEC *param0, FieldSystem *fieldSyste u8 v3; UnkStruct_ov5_021EE75C *v4 = (UnkStruct_ov5_021EE75C *)param2; - v1 = Player_GetXPos(fieldSystem->playerAvatar); - v2 = Player_GetZPos(fieldSystem->playerAvatar); + v1 = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); if ((v4->unk_00 == v1) && (v4->unk_04 == v2)) { return; diff --git a/src/overlay005/ov5_021F007C.c b/src/overlay005/ov5_021F007C.c index 564930fee5..e98e591572 100644 --- a/src/overlay005/ov5_021F007C.c +++ b/src/overlay005/ov5_021F007C.c @@ -473,8 +473,8 @@ BOOL ov5_021F0488(FieldTask *param0) u8 v3; int v4, v5; - v4 = Player_GetXPos(fieldSystem->playerAvatar); - v5 = Player_GetZPos(fieldSystem->playerAvatar); + v4 = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + v5 = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); v3 = (u8)TerrainCollisionManager_GetTileBehavior(fieldSystem, v4, v5); if (WildEncounters_TileHasEncounterRate(fieldSystem, v3)) { diff --git a/src/overlay005/ov5_021F101C.c b/src/overlay005/ov5_021F101C.c index 19fa102860..e0d2af3d50 100644 --- a/src/overlay005/ov5_021F101C.c +++ b/src/overlay005/ov5_021F101C.c @@ -41,7 +41,7 @@ BOOL ov5_021F101C(FieldTask *param0) (*v2)++; break; case 2: { - int v5 = PlayerAvatar_Gender(fieldSystem->playerAvatar); + int v5 = PlayerAvatar_GetGender(fieldSystem->playerAvatar); v3->unk_00 = HMCutIn_StartTask(fieldSystem, 0, v1->unk_00, v5); } (*v2)++; diff --git a/src/overlay005/ov5_021F428C.c b/src/overlay005/ov5_021F428C.c deleted file mode 100644 index 96de8180d4..0000000000 --- a/src/overlay005/ov5_021F428C.c +++ /dev/null @@ -1,455 +0,0 @@ -#include "overlay005/ov5_021F428C.h" - -#include -#include - -#include "field/field_system.h" -#include "overlay005/field_effect_manager.h" - -#include "heap.h" -#include "map_object_move.h" -#include "overworld_anim_manager.h" -#include "simple3d.h" - -typedef struct { - int unk_00; - int unk_04; - FieldEffectManager *unk_08; - Simple3DModel unk_0C[3]; - Simple3DAnimation unk_48[12]; - OverworldAnimManager **unk_1F8; - OverworldAnimManager **unk_1FC; -} UnkStruct_ov5_021F431C; - -typedef struct { - u8 unk_00; - s8 unk_01; - s16 unk_02; - s16 unk_04; - fx32 unk_08; - UnkStruct_ov5_021F431C *unk_0C; - FieldSystem *fieldSystem; -} UnkStruct_ov5_021F440C; - -typedef struct { - u8 unk_00_0 : 6; - u8 unk_00_6 : 1; - u8 unk_00_7 : 1; - s8 unk_01; - s16 unk_02; - s16 unk_04; - fx32 unk_08; - Simple3DAnimation unk_0C; - Simple3DRenderObj unk_30; - UnkStruct_ov5_021F440C unk_84; -} UnkStruct_ov5_021F4698; - -typedef struct { - u32 unk_00; - Simple3DAnimation unk_04[4]; -} UnkStruct_ov5_021F45F8; - -typedef struct { - int unk_00; - s16 unk_04; - s16 unk_06; - s16 unk_08; - Simple3DRenderObj unk_0C; - UnkStruct_ov5_021F440C unk_60; - UnkStruct_ov5_021F45F8 *unk_74; -} UnkStruct_ov5_021F44A4; - -static void ov5_021F431C(UnkStruct_ov5_021F431C *param0); -static void ov5_021F4370(UnkStruct_ov5_021F431C *param0); -static OverworldAnimManager **ov5_021F439C(FieldSystem *fieldSystem, int param1, int param2, fx32 param3, int param4, UnkStruct_ov5_021F440C *param5); -static void ov5_021F440C(OverworldAnimManager *param0, UnkStruct_ov5_021F4698 *param1); - -static const OverworldAnimManagerFuncs Unk_ov5_0220070C; -static const OverworldAnimManagerFuncs Unk_ov5_022006F8; -static const u32 Unk_ov5_022006DC[3]; -static const u32 Unk_ov5_02200720[12]; -static const u32 Unk_ov5_022006E8[4]; - -void *ov5_021F428C(FieldEffectManager *param0) -{ - UnkStruct_ov5_021F431C *v0 = FieldEffectManager_HeapAllocInit(param0, (sizeof(UnkStruct_ov5_021F431C)), 0, 0); - v0->unk_08 = param0; - - ov5_021F431C(v0); - return v0; -} - -void ov5_021F42A8(void *param0) -{ - UnkStruct_ov5_021F431C *v0 = param0; - - if (v0->unk_1F8 != NULL) { - Heap_Free(v0->unk_1F8); - } - - if (v0->unk_1FC != NULL) { - Heap_Free(v0->unk_1FC); - } - - ov5_021F4370(v0); - FieldEffectManager_HeapFree(v0); -} - -void ov5_021F42D8(FieldEffectManager *param0, int param1, int param2) -{ - int v0; - OverworldAnimManager *v1; - UnkStruct_ov5_021F431C *v2 = FieldEffectManager_GetRendererContext(param0, 31); - - v2->unk_04 = param2; - v2->unk_00 = param1; - - if (param1) { - v0 = sizeof(v1) * param1; - v2->unk_1F8 = FieldEffectManager_HeapAllocInit(param0, v0, 0, 0); - } - - if (param2) { - v0 = sizeof(v1) * param2; - v2->unk_1FC = FieldEffectManager_HeapAllocInit(param0, v0, 0, 0); - } -} - -static void ov5_021F431C(UnkStruct_ov5_021F431C *param0) -{ - int v0; - - for (v0 = 0; v0 < 3; v0++) { - FieldEffectManager_LoadModel(param0->unk_08, ¶m0->unk_0C[v0], 0, Unk_ov5_022006DC[v0], 0); - } - - for (v0 = 0; v0 < 12; v0++) { - FieldEffectManager_LoadAnimation(param0->unk_08, ¶m0->unk_48[v0], 0, Unk_ov5_02200720[v0], 0); - } -} - -static void ov5_021F4370(UnkStruct_ov5_021F431C *param0) -{ - int v0; - - for (v0 = 0; v0 < 3; v0++) { - Simple3D_FreeModel(¶m0->unk_0C[v0]); - } - - for (v0 = 0; v0 < 12; v0++) { - Simple3D_FreeAnimation(¶m0->unk_48[v0]); - } -} - -static OverworldAnimManager **ov5_021F439C(FieldSystem *fieldSystem, int param1, int param2, fx32 param3, int param4, UnkStruct_ov5_021F440C *param5) -{ - int v0, v1; - FieldEffectManager *v2; - UnkStruct_ov5_021F431C *v3; - OverworldAnimManager **v4; - - v2 = fieldSystem->fieldEffMan; - v3 = FieldEffectManager_GetRendererContext(v2, 31); - - if (param4 == 0) { - v1 = v3->unk_00; - v4 = v3->unk_1F8; - } else { - v1 = v3->unk_04; - v4 = v3->unk_1FC; - } - - GF_ASSERT(v1); - - param5->unk_02 = param1; - param5->unk_04 = param2; - param5->unk_08 = param3; - param5->fieldSystem = fieldSystem; - param5->unk_0C = v3; - - for (v0 = 0; v0 < v1; v0++) { - if (v4[v0] == NULL) { - return &v4[v0]; - } - } - - GF_ASSERT(FALSE); - return NULL; -} - -static void ov5_021F440C(OverworldAnimManager *param0, UnkStruct_ov5_021F4698 *param1) -{ - VecFx32 v0; - const UnkStruct_ov5_021F440C *v1 = OverworldAnimManager_GetUserData(param0); - - param1->unk_84 = *v1; - param1->unk_02 = v1->unk_02; - param1->unk_04 = v1->unk_04; - param1->unk_01 = v1->unk_01; - param1->unk_08 = FX32_ONE; - - VecFx32_SetPosFromMapCoords(param1->unk_02, param1->unk_04, &v0); - MapObject_RecalculatePositionHeight(param1->unk_84.fieldSystem, &v0); - - v0.y += (FX32_ONE * 6) + param1->unk_84.unk_08; - - OverworldAnimManager_SetPosition(param0, &v0); -} - -OverworldAnimManager *ov5_021F4474(FieldSystem *fieldSystem, int param1, int param2, fx32 param3) -{ - FieldEffectManager *v0; - OverworldAnimManager **v1; - UnkStruct_ov5_021F440C v2; - - v0 = fieldSystem->fieldEffMan; - v1 = ov5_021F439C(fieldSystem, param1, param2, param3, 0, &v2); - *v1 = FieldEffectManager_InitAnimManager(v0, &Unk_ov5_0220070C, NULL, 0, &v2, 0); - - return *v1; -} - -void ov5_021F44A4(OverworldAnimManager *param0) -{ - int v0; - UnkStruct_ov5_021F44A4 *v2 = OverworldAnimManager_GetFuncsContext(param0); - UnkStruct_ov5_021F431C *v1 = v2->unk_60.unk_0C; - - GF_ASSERT(v2->unk_74 == NULL); - - v2->unk_00 = 1; - v2->unk_74 = FieldEffectManager_HeapAllocInit(v1->unk_08, sizeof(UnkStruct_ov5_021F45F8), 1, 0); - - Simple3D_CreateRenderObject(&v2->unk_0C, &v2->unk_60.unk_0C->unk_0C[0]); - - for (v0 = 0; v0 < 4; v0++) { - FieldEffectManager_ApplyAnimCopyToModel(v1->unk_08, &v2->unk_74->unk_04[v0], &v1->unk_0C[0], &v1->unk_48[Unk_ov5_022006E8[v0]], 0); - Simple3D_BindAnimToRenderObj(&v2->unk_0C, &v2->unk_74->unk_04[v0]); - } -} - -BOOL ov5_021F453C(OverworldAnimManager *param0) -{ - UnkStruct_ov5_021F44A4 *v0 = OverworldAnimManager_GetFuncsContext(param0); - GF_ASSERT(v0->unk_74 != NULL); - - if (v0->unk_74->unk_00 == ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))) { - return 1; - } - - return 0; -} - -static int ov5_021F4560(OverworldAnimManager *param0, void *param1) -{ - VecFx32 v0; - UnkStruct_ov5_021F44A4 *v1 = param1; - const UnkStruct_ov5_021F440C *v2 = OverworldAnimManager_GetUserData(param0); - - v1->unk_60 = *v2; - v1->unk_04 = v2->unk_02; - v1->unk_06 = v2->unk_04; - v1->unk_08 = v2->unk_01; - - VecFx32_SetPosFromMapCoords(v1->unk_04, v1->unk_06, &v0); - MapObject_RecalculatePositionHeight(v1->unk_60.fieldSystem, &v0); - - v0.y += (FX32_ONE * 6) + v1->unk_60.unk_08; - - OverworldAnimManager_SetPosition(param0, &v0); - Simple3D_CreateRenderObject(&v1->unk_0C, &v1->unk_60.unk_0C->unk_0C[1]); - - return 1; -} - -static void ov5_021F45D0(OverworldAnimManager *param0, void *param1) -{ - UnkStruct_ov5_021F44A4 *v0 = param1; - - if (v0->unk_74 != NULL) { - int v1; - - for (v1 = 0; v1 < 4; v1++) { - Simple3D_FreeAnimation(&v0->unk_74->unk_04[v1]); - } - - Heap_Free(v0->unk_74); - } -} - -static void ov5_021F45F8(OverworldAnimManager *param0, void *param1) -{ - UnkStruct_ov5_021F44A4 *v0 = param1; - - switch (v0->unk_00) { - case 0: - break; - case 1: { - int v1; - UnkStruct_ov5_021F45F8 *v2; - - GF_ASSERT(v0->unk_74 != NULL); - v2 = v0->unk_74; - - for (v1 = 0; v1 < 4; v1++) { - if (Simple3D_UpdateAnim(&v2->unk_04[v1], FX32_ONE, 0)) { - v2->unk_00 |= 1 << v1; - } - } - - if (v2->unk_00 == ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3))) { - v0->unk_00 = 0; - } - } break; - } -} - -static void ov5_021F464C(OverworldAnimManager *param0, void *param1) -{ - VecFx32 v0; - UnkStruct_ov5_021F44A4 *v1 = param1; - - OverworldAnimManager_GetPosition(param0, &v0); - Simple3D_DrawRenderObjWithPos(&v1->unk_0C, &v0); -} - -static const OverworldAnimManagerFuncs Unk_ov5_0220070C = { - sizeof(UnkStruct_ov5_021F44A4), - ov5_021F4560, - ov5_021F45D0, - ov5_021F45F8, - ov5_021F464C -}; - -OverworldAnimManager *ov5_021F4668(FieldSystem *fieldSystem, int param1, int param2, fx32 param3) -{ - FieldEffectManager *v0; - OverworldAnimManager **v1; - UnkStruct_ov5_021F440C v2; - - v0 = fieldSystem->fieldEffMan; - v1 = ov5_021F439C(fieldSystem, param1, param2, param3, 1, &v2); - *v1 = FieldEffectManager_InitAnimManager(v0, &Unk_ov5_022006F8, NULL, 0, &v2, 0); - - return *v1; -} - -void ov5_021F4698(OverworldAnimManager *param0, int param1, BOOL param2) -{ - Simple3DAnimation *v0; - UnkStruct_ov5_021F4698 *v2 = OverworldAnimManager_GetFuncsContext(param0); - UnkStruct_ov5_021F431C *v1 = v2->unk_84.unk_0C; - - if (v2->unk_00_6 == 1) { - Simple3D_FreeAnimObject(&v2->unk_0C); - } - - v2->unk_00_6 = 1; - v2->unk_00_7 = 0; - v2->unk_00_0 = 1; - - param1 = Direction_GetOpposite(param1); - - if (param2 == 1) { - param1 += 4; - } else { - param1 += 0; - } - - FieldEffectManager_ApplyAnimCopyToModel(v1->unk_08, &v2->unk_0C, &v1->unk_0C[2], &v1->unk_48[param1], 0); - Simple3D_CreateRenderObjectWithAnim(&v2->unk_30, &v1->unk_0C[2], &v2->unk_0C); -} - -void ov5_021F4714(OverworldAnimManager *param0, fx32 param1) -{ - Simple3DAnimation *v0; - UnkStruct_ov5_021F431C *v1; - UnkStruct_ov5_021F4698 *v2 = OverworldAnimManager_GetFuncsContext(param0); - v2->unk_08 = param1; -} - -BOOL ov5_021F4720(OverworldAnimManager *param0) -{ - UnkStruct_ov5_021F4698 *v0 = OverworldAnimManager_GetFuncsContext(param0); - return v0->unk_00_7; -} - -static int ov5_021F4730(OverworldAnimManager *param0, void *param1) -{ - UnkStruct_ov5_021F4698 *v0 = param1; - - ov5_021F440C(param0, v0); - Simple3D_CreateRenderObject(&v0->unk_30, &v0->unk_84.unk_0C->unk_0C[2]); - - return 1; -} - -static void ov5_021F474C(OverworldAnimManager *param0, void *param1) -{ - UnkStruct_ov5_021F4698 *v0 = param1; - - if (v0->unk_00_6) { - Simple3D_FreeAnimation(&v0->unk_0C); - } -} - -static void ov5_021F4760(OverworldAnimManager *param0, void *param1) -{ - UnkStruct_ov5_021F4698 *v0 = param1; - - switch (v0->unk_00_0) { - case 0: - break; - case 1: - if (Simple3D_UpdateAnim(&v0->unk_0C, v0->unk_08, 0)) { - v0->unk_00_0 = 0; - v0->unk_00_7 = 1; - } - break; - } -} - -static void ov5_021F4794(OverworldAnimManager *param0, void *param1) -{ - VecFx32 v0; - UnkStruct_ov5_021F4698 *v1 = param1; - - OverworldAnimManager_GetPosition(param0, &v0); - Simple3D_DrawRenderObjWithPos(&v1->unk_30, &v0); -} - -static const OverworldAnimManagerFuncs Unk_ov5_022006F8 = { - sizeof(UnkStruct_ov5_021F4698), - ov5_021F4730, - ov5_021F474C, - ov5_021F4760, - ov5_021F4794 -}; - -static const u32 Unk_ov5_022006DC[3] = { - 0x70, - 0x72, - 0x71 -}; - -static const u32 Unk_ov5_02200720[12] = { - 0xB6, - 0xB7, - 0xB8, - 0xB9, - 0xBA, - 0xBB, - 0xBC, - 0xBD, - 0xBE, - 0xC3, - 0xC4, - 0xA8 -}; - -static const u32 Unk_ov5_022006E8[4] = { - 0x8, - 0x9, - 0xA, - 0xB -}; diff --git a/src/overlay005/ov5_021F61BC.c b/src/overlay005/ov5_021F61BC.c index c65c21cebc..900256fa42 100644 --- a/src/overlay005/ov5_021F61BC.c +++ b/src/overlay005/ov5_021F61BC.c @@ -84,7 +84,7 @@ void ov5_021F6218(PlayerAvatar *playerAvatar) MapObject *v4; VecFx32 v5 = { 0, 0, 0 }; - v4 = Player_MapObject(playerAvatar); + v4 = PlayerAvatar_GetMapObject(playerAvatar); v3 = MapObject_GetFieldEffectManager(v4); v2.unk_00 = v3; @@ -104,7 +104,7 @@ static int ov5_021F6264(OverworldAnimManager *param0, void *param1) v0 = param1; v2 = OverworldAnimManager_GetUserData(param0); v0->unk_24 = *v2; - v1 = Player_MapObject(v2->playerAvatar); + v1 = PlayerAvatar_GetMapObject(v2->playerAvatar); v0->unk_04 = -1; v0->unk_14 = MapObject_GetLocalID(v1); @@ -123,7 +123,7 @@ static void ov5_021F62A0(OverworldAnimManager *param0, void *param1) int v0; UnkStruct_021F6264 *v1 = param1; PlayerAvatar *playerAvatar = v1->unk_24.playerAvatar; - MapObject *v3 = Player_MapObject(playerAvatar); + MapObject *v3 = PlayerAvatar_GetMapObject(playerAvatar); if (sub_02062764(v3, v1->unk_14, v1->unk_18) == 0) { FieldEffectManager_FinishAnimManager(param0); @@ -136,7 +136,7 @@ static void ov5_021F62A0(OverworldAnimManager *param0, void *param1) v1->unk_04 = ov5_021F6414(v1->unk_08); v1->unk_00 = 0; - if ((v1->unk_04 == -1) || (v1->unk_04 != PlayerAvatar_GetDir(playerAvatar))) { + if ((v1->unk_04 == -1) || (v1->unk_04 != PlayerAvatar_GetFacingDir(playerAvatar))) { v1->unk_1C = 0; v1->unk_20 = 0; v1->unk_00 = 1; diff --git a/src/overlay005/ov5_021F6454.c b/src/overlay005/ov5_021F6454.c index 2b62a6d7b4..c91ba7123f 100644 --- a/src/overlay005/ov5_021F6454.c +++ b/src/overlay005/ov5_021F6454.c @@ -448,74 +448,72 @@ BOOL ScrCmd_JudgeStats(ScriptContext *ctx) return 0; } -BOOL ScrCmd_31D(ScriptContext *param0) +BOOL ScrCmd_TryRevertPartyPokemonForms(ScriptContext *ctx) { - Pokemon *v0; - Party *v1; - int v2, v3, v4; - int v5, v6; - u32 v7; - int v8[6]; - int v9 = 0; - FieldSystem *fieldSystem = param0->fieldSystem; - u16 *v11 = ScriptContext_GetVarPointer(param0); + Pokemon *mon; + int slot, bagNotFull; + int species, form; + int items[MAX_PARTY_SIZE]; + int griseousOrbCount = 0; + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 *destVar = ScriptContext_GetVarPointer(ctx); - v1 = SaveData_GetParty(fieldSystem->saveData); - v2 = Party_GetCurrentCount(v1); - *v11 = 0; + Party *party = SaveData_GetParty(fieldSystem->saveData); + int partyCount = Party_GetCurrentCount(party); + *destVar = 0; - for (v3 = 0; v3 < v2; v3++) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - v8[v3] = Pokemon_GetValue(v0, MON_DATA_HELD_ITEM, NULL); + for (slot = 0; slot < partyCount; slot++) { + mon = Party_GetPokemonBySlotIndex(party, slot); + items[slot] = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); - if (v8[v3] == ITEM_GRISEOUS_ORB) { - v9++; + if (items[slot] == ITEM_GRISEOUS_ORB) { + griseousOrbCount++; } } - if (v9 > 0) { - v4 = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, v9, HEAP_ID_FIELD1); + if (griseousOrbCount > 0) { + bagNotFull = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, griseousOrbCount, HEAP_ID_FIELD1); - if (v4 == 0) { - *v11 = 0xff; - return 0; + if (bagNotFull == FALSE) { + *destVar = 0xFF; + return FALSE; } - v7 = 0; + u32 emptyHeldItem = ITEM_NONE; - for (v3 = 0; v3 < v2; v3++) { - if (v8[v3] == ITEM_GRISEOUS_ORB) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - Pokemon_SetValue(v0, MON_DATA_HELD_ITEM, &v7); + for (slot = 0; slot < partyCount; slot++) { + if (items[slot] == ITEM_GRISEOUS_ORB) { + mon = Party_GetPokemonBySlotIndex(party, slot); + Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &emptyHeldItem); } } } - for (v3 = 0; v3 < v2; v3++) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - v6 = Pokemon_GetValue(v0, MON_DATA_FORM, NULL); + for (slot = 0; slot < partyCount; slot++) { + mon = Party_GetPokemonBySlotIndex(party, slot); + form = Pokemon_GetValue(mon, MON_DATA_FORM, NULL); - if (v6 > 0) { - v5 = Pokemon_GetValue(v0, MON_DATA_SPECIES, NULL); + if (form > 0) { + species = Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); - switch (v5) { + switch (species) { case SPECIES_GIRATINA: - Pokemon_SetGiratinaFormByHeldItem(v0); + Pokemon_SetGiratinaFormByHeldItem(mon); break; case SPECIES_ROTOM: - Pokemon_SetRotomForm(v0, ROTOM_FORM_BASE, 0); + Pokemon_SetRotomForm(mon, ROTOM_FORM_BASE, 0); break; case SPECIES_SHAYMIN: - Pokemon_SetShayminForm(v0, SHAYMIN_FORM_LAND); + Pokemon_SetShayminForm(mon, SHAYMIN_FORM_LAND); break; } } } - return 0; + return FALSE; } -BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) +BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *ctx) { Pokemon *mon; Party *party; @@ -523,9 +521,9 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) u32 emptyHeldItem; int currentHeldItem; int bagNotFull; - FieldSystem *fieldSystem = param0->fieldSystem; - u16 partySlot = ScriptContext_GetVar(param0); - u16 *result = ScriptContext_GetVarPointer(param0); + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 partySlot = ScriptContext_GetVar(ctx); + u16 *result = ScriptContext_GetVarPointer(ctx); party = SaveData_GetParty(fieldSystem->saveData); mon = Party_GetPokemonBySlotIndex(party, partySlot); @@ -533,7 +531,7 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) *result = 0; if (partySlot == 0xff) { - return 0; + return FALSE; } currentHeldItem = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); @@ -541,12 +539,12 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) if (currentHeldItem == ITEM_GRISEOUS_ORB) { bagNotFull = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, 1, HEAP_ID_FIELD1); - if (bagNotFull == 0) { - *result = 0xff; - return 0; + if (bagNotFull == FALSE) { + *result = 0xFF; + return FALSE; } - emptyHeldItem = 0; + emptyHeldItem = ITEM_NONE; Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &emptyHeldItem); } @@ -568,7 +566,7 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) } } - return 0; + return FALSE; } BOOL ScrCmd_2F1(ScriptContext *param0) @@ -921,7 +919,7 @@ BOOL ScrCmd_32D(ScriptContext *ctx) int v3 = 0; FieldSystem *fieldSystem = ctx->fieldSystem; MapObjectManager *mapObjMan = fieldSystem->mapObjMan; - MapObject *v6 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v6 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject *v7; MapObject_GetPosPtr(v6, &v1); @@ -962,7 +960,7 @@ BOOL ScrCmd_32E(ScriptContext *ctx) int v0 = 0; FieldSystem *fieldSystem = ctx->fieldSystem; MapObjectManager *mapObjMan = fieldSystem->mapObjMan; - MapObject *v3 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v3 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject *v4; while (MapObjectMan_FindObjectWithStatus(mapObjMan, &v4, &v0, MAP_OBJ_STATUS_0) == 1) { diff --git a/src/overlay005/save_info_window.c b/src/overlay005/save_info_window.c index 7f14a8ca30..652c8bda45 100644 --- a/src/overlay005/save_info_window.c +++ b/src/overlay005/save_info_window.c @@ -196,10 +196,10 @@ static void FieldSystem_SaveObjectsAndLocation(FieldSystem *fieldSystem) FieldSystem_SaveObjects(fieldSystem); FieldSystem_SendPoketchEvent(fieldSystem, POKETCH_EVENT_SAVE, 0); - fieldSystem->location->x = Player_GetXPos(fieldSystem->playerAvatar); - fieldSystem->location->z = Player_GetZPos(fieldSystem->playerAvatar); + fieldSystem->location->x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + fieldSystem->location->z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); fieldSystem->location->warpId = WARP_ID_NONE; - fieldSystem->location->faceDirection = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + fieldSystem->location->faceDirection = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); } void FieldSystem_SaveStateIfCommunicationOff(FieldSystem *fieldSystem) diff --git a/src/overlay005/script_message.c b/src/overlay005/script_message.c index 333b062963..a0278bcf02 100644 --- a/src/overlay005/script_message.c +++ b/src/overlay005/script_message.c @@ -1,10 +1,9 @@ #include "overlay005/script_message.h" -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_script_context.h" #include "font.h" @@ -15,7 +14,6 @@ #include "string_gf.h" #include "string_template.h" #include "text.h" -#include "unk_02014A84.h" typedef struct ScriptMessage { String *msgBuf; @@ -79,7 +77,6 @@ void ScriptMessage_ShowInstant(ScriptContext *ctx, const MessageLoader *msgLoade void ScriptMessage_ShowSentence(ScriptContext *ctx, u16 sentenceType, u16 sentenceID, u16 word1, s16 word2, u8 canSkipDelay) { ScriptMessage msgData; - Sentence unused; InitScriptMessage(ctx->fieldSystem, &msgData); OpenMessageBox(ctx->fieldSystem, &msgData); @@ -146,15 +143,15 @@ static void LoadAndFormatMessage(ScriptMessage *msgData, const MessageLoader *ms static void GetStringFromSentence(ScriptMessage *msgData, u16 sentenceType, u16 sentenceID, u16 word1, u16 word2) { - Sentence sentence; + EasyChatSentence sentence; String *string; - Sentence_Init(&sentence); - sub_02014CE0(&sentence, sentenceType, sentenceID); - Sentence_SetWord(&sentence, 0, word1); - Sentence_SetWord(&sentence, 1, word2); + EasyChatSentence_Init(&sentence); + EasyChatSentence_SetTypeAndID(&sentence, sentenceType, sentenceID); + EasyChatSentence_SetWord(&sentence, 0, word1); + EasyChatSentence_SetWord(&sentence, 1, word2); - string = Sentence_AsString(&sentence, HEAP_ID_FIELD3); + string = EasyChatSentence_ToString(&sentence, HEAP_ID_FIELD3); String_Copy(msgData->msgBuf, string); String_Free(string); diff --git a/src/overlay005/size_contest.c b/src/overlay005/size_contest.c index a1adc94a2d..1e2bb6820b 100644 --- a/src/overlay005/size_contest.c +++ b/src/overlay005/size_contest.c @@ -3,8 +3,8 @@ #include #include +#include "constants/string.h" #include "generated/size_contest_results.h" -#include "generated/string_padding_mode.h" #include "field/field_system.h" diff --git a/src/overlay005/veilstone_gym_object_renderer.c b/src/overlay005/veilstone_gym_object_renderer.c new file mode 100644 index 0000000000..0d4238f085 --- /dev/null +++ b/src/overlay005/veilstone_gym_object_renderer.c @@ -0,0 +1,430 @@ +#include "overlay005/veilstone_gym_object_renderer.h" + +#include + +#include "constants/field/field_effect_renderer.h" + +#include "field/field_system.h" +#include "overlay005/field_effect_manager.h" + +#include "heap.h" +#include "map_object_move.h" +#include "overworld_anim_manager.h" +#include "simple3d.h" + +#define NUM_MODELS 3 +#define NUM_ANIMATIONS 12 + +#define NUM_TIRE_STACK_ANIMATIONS 4 +#define ALL_ANIMATIONS_FINISHED ((1 << NUM_TIRE_STACK_ANIMATIONS) - 1) + +#define MODEL_IDX_TOPPLED_TIRE_STACK 0 +#define MODEL_IDX_INTACT_TIRE_STACK 1 +#define MODEL_IDX_PUNCHING_BAG 2 + +typedef struct VeilstoneGymObjectRendererResources { + int numTireStacks; + int numPunchingBags; + FieldEffectManager *fieldEffMan; + Simple3DModel models[NUM_MODELS]; + Simple3DAnimation animations[NUM_ANIMATIONS]; + OverworldAnimManager **tireStacks; + OverworldAnimManager **punchingBags; +} VeilstoneGymObjectRendererResources; + +typedef struct VeilstoneGymObjectRendererContext { + u8 unused; + s8 unused2; + s16 x; + s16 z; + fx32 yOffset; + VeilstoneGymObjectRendererResources *resources; + FieldSystem *fieldSystem; +} VeilstoneGymObjectRendererContext; + +typedef struct VeilstoneGymPunchingBagRenderer { + u8 updateAnimation : 6; + u8 loaded : 1; + u8 animationFinished : 1; + s8 unused; + s16 x; + s16 z; + fx32 frameDelta; + Simple3DAnimation animation; + Simple3DRenderObj renderObj; + VeilstoneGymObjectRendererContext context; +} VeilstoneGymPunchingBagRenderer; + +typedef struct VeilstoneGymTireStackAnimations { + u32 finishedFlags; + Simple3DAnimation animation[NUM_TIRE_STACK_ANIMATIONS]; +} VeilstoneGymTireStackAnimations; + +typedef struct VeilstoneGymTireStackRenderer { + BOOL updateAnimations; + s16 x; + s16 z; + s16 unused; + Simple3DRenderObj renderObj; + VeilstoneGymObjectRendererContext context; + VeilstoneGymTireStackAnimations *animations; +} VeilstoneGymTireStackRenderer; + +static void LoadModelsAndAnimations(VeilstoneGymObjectRendererResources *resources); +static void FreeModelsAndAnimations(VeilstoneGymObjectRendererResources *resources); + +static const OverworldAnimManagerFuncs sTireStackAnimFuncs; +static const OverworldAnimManagerFuncs sPunchingBagAnimFuncs; +static const u32 sVeilstoneGymObjectModelIDs[NUM_MODELS]; +static const u32 sVeilstoneGymObjectAnimationsIDs[NUM_ANIMATIONS]; +static const u32 sTireStackAnimIndices[NUM_TIRE_STACK_ANIMATIONS]; + +void *VeilstoneGymObjectRenderer_New(FieldEffectManager *fieldEffMan) +{ + VeilstoneGymObjectRendererResources *resources = FieldEffectManager_HeapAllocInit(fieldEffMan, sizeof(VeilstoneGymObjectRendererResources), FALSE, 0); + resources->fieldEffMan = fieldEffMan; + + LoadModelsAndAnimations(resources); + return resources; +} + +void VeilstoneGymObjectRenderer_Free(void *context) +{ + VeilstoneGymObjectRendererResources *resources = context; + + if (resources->tireStacks != NULL) { + Heap_Free(resources->tireStacks); + } + + if (resources->punchingBags != NULL) { + Heap_Free(resources->punchingBags); + } + + FreeModelsAndAnimations(resources); + FieldEffectManager_HeapFree(resources); +} + +void VeilstoneGymObjectRenderer_InitContext(FieldEffectManager *fieldEffMan, int numTireStacks, int numPunchingBags) +{ + VeilstoneGymObjectRendererResources *resources = FieldEffectManager_GetRendererContext(fieldEffMan, FIELD_EFFECT_RENDERER_VEILSTONE_GYM_OBJECTS); + resources->numPunchingBags = numPunchingBags; + resources->numTireStacks = numTireStacks; + + if (numTireStacks) { + resources->tireStacks = FieldEffectManager_HeapAllocInit(fieldEffMan, sizeof(OverworldAnimManager *) * numTireStacks, FALSE, 0); + } + + if (numPunchingBags) { + resources->punchingBags = FieldEffectManager_HeapAllocInit(fieldEffMan, sizeof(OverworldAnimManager *) * numPunchingBags, FALSE, 0); + } +} + +static void LoadModelsAndAnimations(VeilstoneGymObjectRendererResources *resources) +{ + for (int i = 0; i < NUM_MODELS; i++) { + FieldEffectManager_LoadModel(resources->fieldEffMan, &resources->models[i], 0, sVeilstoneGymObjectModelIDs[i], FALSE); + } + + for (int i = 0; i < NUM_ANIMATIONS; i++) { + FieldEffectManager_LoadAnimation(resources->fieldEffMan, &resources->animations[i], 0, sVeilstoneGymObjectAnimationsIDs[i], FALSE); + } +} + +static void FreeModelsAndAnimations(VeilstoneGymObjectRendererResources *resources) +{ + for (int i = 0; i < NUM_MODELS; i++) { + Simple3D_FreeModel(&resources->models[i]); + } + + for (int i = 0; i < NUM_ANIMATIONS; i++) { + Simple3D_FreeAnimation(&resources->animations[i]); + } +} + +static OverworldAnimManager **SetupRendererContext(FieldSystem *fieldSystem, int x, int z, fx32 yOffset, BOOL isPunchingBag, VeilstoneGymObjectRendererContext *context) +{ + FieldEffectManager *fieldEffMan = fieldSystem->fieldEffMan; + VeilstoneGymObjectRendererResources *resources = FieldEffectManager_GetRendererContext(fieldEffMan, FIELD_EFFECT_RENDERER_VEILSTONE_GYM_OBJECTS); + + int count; + OverworldAnimManager **animManagers; + if (!isPunchingBag) { + count = resources->numTireStacks; + animManagers = resources->tireStacks; + } else { + count = resources->numPunchingBags; + animManagers = resources->punchingBags; + } + + GF_ASSERT(count); + + context->x = x; + context->z = z; + context->yOffset = yOffset; + context->fieldSystem = fieldSystem; + context->resources = resources; + + for (int i = 0; i < count; i++) { + if (animManagers[i] == NULL) { + return &animManagers[i]; + } + } + + GF_ASSERT(FALSE); + return NULL; +} + +static void InitPunchingBagRenderer(OverworldAnimManager *animManager, VeilstoneGymPunchingBagRenderer *renderer) +{ + VecFx32 pos; + const VeilstoneGymObjectRendererContext *context = OverworldAnimManager_GetUserData(animManager); + + renderer->context = *context; + renderer->x = context->x; + renderer->z = context->z; + renderer->unused = context->unused2; + renderer->frameDelta = FX32_ONE; + + VecFx32_SetPosFromMapCoords(renderer->x, renderer->z, &pos); + MapObject_RecalculatePositionHeight(renderer->context.fieldSystem, &pos); + + pos.y += FX32_CONST(6) + renderer->context.yOffset; + + OverworldAnimManager_SetPosition(animManager, &pos); +} + +OverworldAnimManager *VeilstoneGymObjectRenderer_InitTireStackRenderer(FieldSystem *fieldSystem, int x, int z, fx32 yOffset) +{ + VeilstoneGymObjectRendererContext context; + + FieldEffectManager *fieldEffMan = fieldSystem->fieldEffMan; + OverworldAnimManager **animManager = SetupRendererContext(fieldSystem, x, z, yOffset, FALSE, &context); + *animManager = FieldEffectManager_InitAnimManager(fieldEffMan, &sTireStackAnimFuncs, NULL, 0, &context, 0); + + return *animManager; +} + +void VeilstoneGymObjectRenderer_PlayToppleTireStackAnim(OverworldAnimManager *animManager) +{ + int i; + VeilstoneGymTireStackRenderer *renderer = OverworldAnimManager_GetFuncsContext(animManager); + VeilstoneGymObjectRendererResources *resources = renderer->context.resources; + + GF_ASSERT(renderer->animations == NULL); + + renderer->updateAnimations = TRUE; + renderer->animations = FieldEffectManager_HeapAllocInit(resources->fieldEffMan, sizeof(VeilstoneGymTireStackAnimations), TRUE, 0); + + Simple3D_CreateRenderObject(&renderer->renderObj, &renderer->context.resources->models[MODEL_IDX_TOPPLED_TIRE_STACK]); + + for (i = 0; i < NUM_TIRE_STACK_ANIMATIONS; i++) { + FieldEffectManager_ApplyAnimCopyToModel(resources->fieldEffMan, &renderer->animations->animation[i], &resources->models[MODEL_IDX_TOPPLED_TIRE_STACK], &resources->animations[sTireStackAnimIndices[i]], 0); + Simple3D_BindAnimToRenderObj(&renderer->renderObj, &renderer->animations->animation[i]); + } +} + +BOOL VeilstoneGymObjectRenderer_IsTireStackAnimationFinished(OverworldAnimManager *animManager) +{ + VeilstoneGymTireStackRenderer *renderer = OverworldAnimManager_GetFuncsContext(animManager); + GF_ASSERT(renderer->animations != NULL); + + return renderer->animations->finishedFlags == ALL_ANIMATIONS_FINISHED; +} + +static BOOL TireStackAnim_Init(OverworldAnimManager *animManager, void *context) +{ + VecFx32 pos; + VeilstoneGymTireStackRenderer *renderer = context; + const VeilstoneGymObjectRendererContext *renderContext = OverworldAnimManager_GetUserData(animManager); + + renderer->context = *renderContext; + renderer->x = renderContext->x; + renderer->z = renderContext->z; + renderer->unused = renderContext->unused2; + + VecFx32_SetPosFromMapCoords(renderer->x, renderer->z, &pos); + MapObject_RecalculatePositionHeight(renderer->context.fieldSystem, &pos); + + pos.y += FX32_CONST(6) + renderer->context.yOffset; + + OverworldAnimManager_SetPosition(animManager, &pos); + Simple3D_CreateRenderObject(&renderer->renderObj, &renderer->context.resources->models[MODEL_IDX_INTACT_TIRE_STACK]); + + return TRUE; +} + +static void TireStackAnim_Free(OverworldAnimManager *animManager, void *context) +{ + VeilstoneGymTireStackRenderer *renderer = context; + + if (renderer->animations != NULL) { + for (int i = 0; i < NUM_TIRE_STACK_ANIMATIONS; i++) { + Simple3D_FreeAnimation(&renderer->animations->animation[i]); + } + + Heap_Free(renderer->animations); + } +} + +static void TireStackAnim_Update(OverworldAnimManager *animManager, void *context) +{ + VeilstoneGymTireStackRenderer *renderer = context; + + switch (renderer->updateAnimations) { + case FALSE: + break; + case TRUE: + GF_ASSERT(renderer->animations != NULL); + VeilstoneGymTireStackAnimations *animations = renderer->animations; + + for (int i = 0; i < NUM_TIRE_STACK_ANIMATIONS; i++) { + if (Simple3D_UpdateAnim(&animations->animation[i], FX32_ONE, FALSE)) { + animations->finishedFlags |= 1 << i; + } + } + + if (animations->finishedFlags == ALL_ANIMATIONS_FINISHED) { + renderer->updateAnimations = FALSE; + } + break; + } +} + +static void TireStackAnim_Render(OverworldAnimManager *animManager, void *context) +{ + VecFx32 pos; + VeilstoneGymTireStackRenderer *renderer = context; + + OverworldAnimManager_GetPosition(animManager, &pos); + Simple3D_DrawRenderObjWithPos(&renderer->renderObj, &pos); +} + +static const OverworldAnimManagerFuncs sTireStackAnimFuncs = { + .ctxSize = sizeof(VeilstoneGymTireStackRenderer), + .initFunc = TireStackAnim_Init, + .exitFunc = TireStackAnim_Free, + .tickFunc = TireStackAnim_Update, + .renderFunc = TireStackAnim_Render +}; + +OverworldAnimManager *VeilstoneGymObjectRenderer_InitPunchingBagRenderer(FieldSystem *fieldSystem, int x, int z, fx32 yOffset) +{ + VeilstoneGymObjectRendererContext context; + + FieldEffectManager *fieldEffMan = fieldSystem->fieldEffMan; + OverworldAnimManager **animManager = SetupRendererContext(fieldSystem, x, z, yOffset, TRUE, &context); + *animManager = FieldEffectManager_InitAnimManager(fieldEffMan, &sPunchingBagAnimFuncs, NULL, 0, &context, 0); + + return *animManager; +} + +void VeilstoneGymObjectRenderer_StartPunchingBagAnimation(OverworldAnimManager *animManager, int animId, BOOL isMoving) +{ + VeilstoneGymPunchingBagRenderer *renderer = OverworldAnimManager_GetFuncsContext(animManager); + VeilstoneGymObjectRendererResources *resources = renderer->context.resources; + + if (renderer->loaded == TRUE) { + Simple3D_FreeAnimObject(&renderer->animation); + } + + renderer->loaded = TRUE; + renderer->animationFinished = FALSE; + renderer->updateAnimation = TRUE; + + animId = Direction_GetOpposite(animId); + + if (isMoving == TRUE) { + animId += 4; + } + + FieldEffectManager_ApplyAnimCopyToModel(resources->fieldEffMan, &renderer->animation, &resources->models[MODEL_IDX_PUNCHING_BAG], &resources->animations[animId], 0); + Simple3D_CreateRenderObjectWithAnim(&renderer->renderObj, &resources->models[MODEL_IDX_PUNCHING_BAG], &renderer->animation); +} + +void VeilstoneGymObjectRenderer_UpdateBagFrameDelta(OverworldAnimManager *animManager, fx32 frameDelta) +{ + VeilstoneGymPunchingBagRenderer *renderer = OverworldAnimManager_GetFuncsContext(animManager); + renderer->frameDelta = frameDelta; +} + +BOOL VeilstoneGymObjectRenderer_IsPunchingBagAnimFinished(OverworldAnimManager *animManager) +{ + VeilstoneGymPunchingBagRenderer *renderer = OverworldAnimManager_GetFuncsContext(animManager); + return renderer->animationFinished; +} + +static BOOL PunchingBagAnim_Init(OverworldAnimManager *animManager, void *context) +{ + VeilstoneGymPunchingBagRenderer *renderer = context; + + InitPunchingBagRenderer(animManager, renderer); + Simple3D_CreateRenderObject(&renderer->renderObj, &renderer->context.resources->models[MODEL_IDX_PUNCHING_BAG]); + + return TRUE; +} + +static void PunchingBagAnim_Free(OverworldAnimManager *animManager, void *context) +{ + VeilstoneGymPunchingBagRenderer *renderer = context; + + if (renderer->loaded) { + Simple3D_FreeAnimation(&renderer->animation); + } +} + +static void PunchingBagAnim_Update(OverworldAnimManager *animManager, void *context) +{ + VeilstoneGymPunchingBagRenderer *renderer = context; + + switch (renderer->updateAnimation) { + case FALSE: + break; + case TRUE: + if (Simple3D_UpdateAnim(&renderer->animation, renderer->frameDelta, FALSE)) { + renderer->updateAnimation = FALSE; + renderer->animationFinished = TRUE; + } + break; + } +} + +static void PunchingBagAnim_Render(OverworldAnimManager *animManager, void *context) +{ + VecFx32 pos; + VeilstoneGymPunchingBagRenderer *renderer = context; + + OverworldAnimManager_GetPosition(animManager, &pos); + Simple3D_DrawRenderObjWithPos(&renderer->renderObj, &pos); +} + +static const OverworldAnimManagerFuncs sPunchingBagAnimFuncs = { + sizeof(VeilstoneGymPunchingBagRenderer), + PunchingBagAnim_Init, + PunchingBagAnim_Free, + PunchingBagAnim_Update, + PunchingBagAnim_Render +}; + +// TODO Replace values with naix constants when fldeff.narc is unpacked +static const u32 sVeilstoneGymObjectModelIDs[NUM_MODELS] = { + 112, + 114, + 113 +}; + +static const u32 sVeilstoneGymObjectAnimationsIDs[NUM_ANIMATIONS] = { + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 195, + 196, + 168 +}; + +static const u32 sTireStackAnimIndices[NUM_TIRE_STACK_ANIMATIONS] = { 8, 9, 10, 11 }; diff --git a/src/overlay005/vs_seeker.c b/src/overlay005/vs_seeker.c index 4edac89e63..d7dc08db81 100644 --- a/src/overlay005/vs_seeker.c +++ b/src/overlay005/vs_seeker.c @@ -3,6 +3,7 @@ #include #include +#include "constants/vs_seeker.h" #include "generated/movement_actions.h" #include "generated/movement_types.h" #include "generated/trainer_types.h" @@ -47,11 +48,6 @@ // until the Vs. Seeker has to be used again #define VS_SEEKER_MAX_NUM_ACTIVE_STEPS 100 -#define VS_SEEKER_USE_RESULT_OK 0 -#define VS_SEEKER_USE_RESULT_NO_BATTERY 1 -#define VS_SEEKER_USE_RESULT_NO_TRAINERS 2 -#define VS_SEEKER_USE_RESULT_NO_TRAINERS_PICKED 3 // No trainers were picked for a rematch (e.g. all the random chances failed) - #define VS_SEEKER_REMATCH_DATA_INDEX_NONE 0xFF #define NoUniqueRematches(trainerID) { trainerID, trainerID, VS_SEEKER_REMATCH_DATA_END, VS_SEEKER_REMATCH_DATA_END, VS_SEEKER_REMATCH_DATA_END, VS_SEEKER_REMATCH_DATA_END } @@ -514,8 +510,8 @@ static void VsSeekerSystem_CollectViableNPCs(VsSeekerSystem *vsSeeker) vsSeeker->trainers[i] = NULL; } - int playerX = Player_GetXPos(vsSeeker->fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(vsSeeker->fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(vsSeeker->fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(vsSeeker->fieldSystem->playerAvatar); xMin = playerX - VS_SEEKER_SEARCH_RADIUS_LEFT; xMax = playerX + VS_SEEKER_SEARCH_RADIUS_RIGHT; zMin = playerZ - VS_SEEKER_SEARCH_RADIUS_UP; diff --git a/src/overlay006/field_warp.c b/src/overlay006/field_warp.c index 8b92ba5900..86c45c5d02 100644 --- a/src/overlay006/field_warp.c +++ b/src/overlay006/field_warp.c @@ -138,7 +138,7 @@ FieldWarp *FieldWarp_InitEscapeRope(FieldSystem *fieldSystem, enum HeapID heapID fieldWarp->warpType = FIELD_WARP_TYPE_ESCAPE_ROPE; fieldWarp->fieldSystem = fieldSystem; - fieldWarp->player = Player_MapObject(fieldSystem->playerAvatar); + fieldWarp->player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); return fieldWarp; } @@ -250,7 +250,7 @@ FieldWarp *FieldWarp_InitFadeIn(FieldSystem *fieldSystem, enum HeapID heapID, en fieldWarp->warpType = warpType; fieldWarp->fieldSystem = fieldSystem; - fieldWarp->player = Player_MapObject(fieldSystem->playerAvatar); + fieldWarp->player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); return fieldWarp; } @@ -359,7 +359,7 @@ FieldWarp *FieldWarp_InitDig(FieldSystem *fieldSystem, Pokemon *mon, enum HeapID fieldWarp->warpType = FIELD_WARP_TYPE_DIG; fieldWarp->fieldSystem = fieldSystem; - fieldWarp->player = Player_MapObject(fieldSystem->playerAvatar); + fieldWarp->player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); fieldWarp->mon = mon; return fieldWarp; @@ -384,7 +384,7 @@ BOOL FieldWarp_DigFadeOut(FieldTask *task) static enum FieldWarpStateResult StartFieldMoveCutIn(FieldTask *task, FieldSystem *fieldSystem, FieldWarp *fieldWarp) { - int gender = PlayerAvatar_Gender(fieldSystem->playerAvatar); + int gender = PlayerAvatar_GetGender(fieldSystem->playerAvatar); fieldWarp->cutInTask = HMCutIn_StartTask(fieldSystem, 0, fieldWarp->mon, gender); fieldWarp->state++; @@ -409,7 +409,7 @@ FieldWarp *FieldWarp_InitTeleport(FieldSystem *fieldSystem, Pokemon *mon, enum H fieldWarp->warpType = FIELD_WARP_TYPE_TELEPORT; fieldWarp->fieldSystem = fieldSystem; - fieldWarp->player = Player_MapObject(fieldSystem->playerAvatar); + fieldWarp->player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); fieldWarp->mon = mon; return fieldWarp; diff --git a/src/overlay006/great_marsh_binoculars.c b/src/overlay006/great_marsh_binoculars.c index d4da4cb33d..a0e01cce36 100644 --- a/src/overlay006/great_marsh_binoculars.c +++ b/src/overlay006/great_marsh_binoculars.c @@ -54,8 +54,8 @@ GreatMarshBinoculars *GreatMarshBinoculars_InitData(const enum HeapID heapID, Fi binocularsData->coordsList[i].z = coordData[randIndex].z; } - binocularsData->coordsList[BINOCULARS_CYCLE_COUNT].x = Player_GetXPos(fieldSystem->playerAvatar); - binocularsData->coordsList[BINOCULARS_CYCLE_COUNT].z = Player_GetZPos(fieldSystem->playerAvatar); + binocularsData->coordsList[BINOCULARS_CYCLE_COUNT].x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + binocularsData->coordsList[BINOCULARS_CYCLE_COUNT].z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); binocularsData->lookoutMapId = fieldSystem->location->mapId; Heap_Free(coordData); diff --git a/src/overlay006/great_marsh_tram.c b/src/overlay006/great_marsh_tram.c index f89b143dc7..9b1e0424b3 100644 --- a/src/overlay006/great_marsh_tram.c +++ b/src/overlay006/great_marsh_tram.c @@ -278,8 +278,8 @@ static BOOL CallTramToPlayer(FieldSystem *fieldSystem, GreatMarshTramMovementTas static BOOL RideTramToArea(FieldSystem *fieldSystem, GreatMarshTramMovementTask *task, const fx32 *destZ, VecFx32 *tramPosition) { VecFx32 playerPos; - MapObject *playerObj = Player_MapObject(fieldSystem->playerAvatar); - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &playerPos); + MapObject *playerObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &playerPos); tramPosition->z = playerPos.z + FX32_CONST(8); @@ -289,13 +289,13 @@ static BOOL RideTramToArea(FieldSystem *fieldSystem, GreatMarshTramMovementTask if (LocalMapObj_IsAnimationSet(playerObj) == TRUE) { LocalMapObj_SetAnimationCode(playerObj, sRidingTramNorthMovements[task->speedLevel]); - if (task->speedLevel < NELEMS(sRidingTramNorthMovements) - 1 && Player_GetZPos(fieldSystem->playerAvatar) > task->slowDownZ) { + if (task->speedLevel < NELEMS(sRidingTramNorthMovements) - 1 && PlayerAvatar_GetZPos(fieldSystem->playerAvatar) > task->slowDownZ) { if (task->speedLevel == 0) { Sound_PlayEffect(SEQ_SE_DP_TRAIN02); } task->speedLevel++; - } else if (Player_GetZPos(fieldSystem->playerAvatar) <= task->slowDownZ) { + } else if (PlayerAvatar_GetZPos(fieldSystem->playerAvatar) <= task->slowDownZ) { if (task->speedLevel != 0) { if (task->speedLevel == NELEMS(sRidingTramNorthMovements) - 1) { Sound_PlayEffect(SEQ_SE_DP_TRAIN03); @@ -308,13 +308,13 @@ static BOOL RideTramToArea(FieldSystem *fieldSystem, GreatMarshTramMovementTask } else if (LocalMapObj_IsAnimationSet(playerObj) == TRUE) { LocalMapObj_SetAnimationCode(playerObj, sRidingTramSouthMovements[task->speedLevel]); - if (task->speedLevel < NELEMS(sRidingTramSouthMovements) - 1 && Player_GetZPos(fieldSystem->playerAvatar) < task->slowDownZ) { + if (task->speedLevel < NELEMS(sRidingTramSouthMovements) - 1 && PlayerAvatar_GetZPos(fieldSystem->playerAvatar) < task->slowDownZ) { if (task->speedLevel == 0) { Sound_PlayEffect(SEQ_SE_DP_TRAIN02); } task->speedLevel++; - } else if (Player_GetZPos(fieldSystem->playerAvatar) >= task->slowDownZ) { + } else if (PlayerAvatar_GetZPos(fieldSystem->playerAvatar) >= task->slowDownZ) { if (task->speedLevel != 0) { if (task->speedLevel == NELEMS(sRidingTramSouthMovements) - 1) { Sound_PlayEffect(SEQ_SE_DP_TRAIN03); diff --git a/src/overlay006/hm_cut_in.c b/src/overlay006/hm_cut_in.c index ac835f6ce4..2e8ffb37c4 100644 --- a/src/overlay006/hm_cut_in.c +++ b/src/overlay006/hm_cut_in.c @@ -1031,7 +1031,7 @@ static void FadeOut(void) static void HidePlayerMapObj(FieldSystem *fieldSystem, BOOL hidden) { - MapObject *playerMapObject = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerMapObject = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(playerMapObject, hidden); } @@ -3049,7 +3049,7 @@ static void *FlyLanding_AllocFromHeapAtEnd(enum HeapID heapID, int size) static void HideAndStopPlayerMapObj(HMCutIn *cutIn, BOOL hidden) { - MapObject *playObj = Player_MapObject(cutIn->fieldSystem->playerAvatar); + MapObject *playObj = PlayerAvatar_GetMapObject(cutIn->fieldSystem->playerAvatar); MapObject_SetPauseMovementOff(playObj); MapObject_SetHidden(playObj, hidden); diff --git a/src/overlay006/npc_trade.c b/src/overlay006/npc_trade.c index be45d4fb16..f82b61da88 100644 --- a/src/overlay006/npc_trade.c +++ b/src/overlay006/npc_trade.c @@ -14,10 +14,10 @@ #include "message.h" #include "party.h" #include "pokemon.h" +#include "save_catchrecords.h" #include "save_player.h" #include "string_gf.h" #include "trainer_info.h" -#include "unk_0202F180.h" #include "unk_020559DC.h" #include "unk_02092494.h" diff --git a/src/overlay006/ov6_0223E140.c b/src/overlay006/ov6_0223E140.c index 6edd9b8558..cdbc6a6d3f 100644 --- a/src/overlay006/ov6_0223E140.c +++ b/src/overlay006/ov6_0223E140.c @@ -1072,7 +1072,7 @@ static void ov6_0223EB4C(UnkStruct_ov5_021D1BEC *param0, FieldSystem *fieldSyste v0->fieldSystem = fieldSystem; v0->unk_108 = MapObjMan_LocalMapObjByIndex(v0->fieldSystem->mapObjMan, 1); v0->unk_10C = MapObjMan_LocalMapObjByIndex(v0->fieldSystem->mapObjMan, 0); - v0->unk_110 = Player_MapObject(FieldSystem_GetPlayerAvatar(v0->fieldSystem)); + v0->unk_110 = PlayerAvatar_GetMapObject(FieldSystem_GetPlayerAvatar(v0->fieldSystem)); HeapExp_FndInitAllocator(&v0->unk_C0, HEAP_ID_FIELD1, 32); ov6_0223EA98(v0); diff --git a/src/overlay006/ov6_02247830.c b/src/overlay006/ov6_02247830.c index 1729ff0b4f..6dfbcb3828 100644 --- a/src/overlay006/ov6_02247830.c +++ b/src/overlay006/ov6_02247830.c @@ -3,10 +3,8 @@ #include #include -#include "struct_decls/struct_02014FB0_decl.h" - +#include "easy_chat_words.h" #include "trainer_info.h" -#include "unk_02014D38.h" static void ov6_02247830(u8 *param0, u8 param1, u8 param2) { diff --git a/src/overlay006/ov6_02248050.c b/src/overlay006/ov6_02248050.c index fac9ce8172..5a5ecf5081 100644 --- a/src/overlay006/ov6_02248050.c +++ b/src/overlay006/ov6_02248050.c @@ -104,11 +104,11 @@ static void ov6_022480BC(PlayerAvatar *const playerAvatar, Easy3DObject *param1) int v1, v2; VecFx32 v3; - PlayerAvatar_PosVectorOut(playerAvatar, &v3); + PlayerAvatar_GetPosPtr(playerAvatar, &v3); - v1 = Player_GetXPos(playerAvatar); - v2 = Player_GetZPos(playerAvatar); - v0 = PlayerAvatar_GetDir(playerAvatar); + v1 = PlayerAvatar_GetXPos(playerAvatar); + v2 = PlayerAvatar_GetZPos(playerAvatar); + v0 = PlayerAvatar_GetFacingDir(playerAvatar); switch (v0) { case 0: @@ -135,7 +135,7 @@ static void ov6_02248124(PlayerAvatar *const playerAvatar, Easy3DObject *param1) { VecFx32 v0; - PlayerAvatar_PosVectorOut(playerAvatar, &v0); + PlayerAvatar_GetPosPtr(playerAvatar, &v0); Easy3DObject_SetPosition(param1, v0.x, v0.y, v0.z); } @@ -490,7 +490,7 @@ static void ov6_02248610(UnkStruct_ov6_022486B4 *param0, PlayerAvatar *const pla GF_ASSERT(param0->unk_C8 == 0); - PlayerAvatar_PosVectorOut(playerAvatar, &v0); + PlayerAvatar_GetPosPtr(playerAvatar, &v0); Easy3DObject_SetPosition(¶m0->unk_00, v0.x, v0.y + param2, v0.z + param3); param0->unk_C8 = 1; @@ -554,7 +554,7 @@ static void ov6_02248728(UnkStruct_ov6_022487F8 *param0) { VecFx32 v0; - PlayerAvatar_PosVectorOut(param0->fieldSystem->playerAvatar, &v0); + PlayerAvatar_GetPosPtr(param0->fieldSystem->playerAvatar, &v0); if (((v0.x - param0->unk_CF0.x) == 0) && (v0.y < param0->unk_CF0.y) && (v0.z > param0->unk_CF0.z)) { param0->unk_CE8 = 0; @@ -614,7 +614,7 @@ static void ov6_022487F8(UnkStruct_ov5_021D1BEC *param0, FieldSystem *fieldSyste } v0->fieldSystem = fieldSystem; - PlayerAvatar_PosVectorOut(v0->fieldSystem->playerAvatar, &v0->unk_CF0); + PlayerAvatar_GetPosPtr(v0->fieldSystem->playerAvatar, &v0->unk_CF0); v0->unk_D0C = 0; NARC_dtor(v2); diff --git a/src/overlay006/wild_encounters.c b/src/overlay006/wild_encounters.c index 77ee3dd7f0..1f7f4d36cf 100644 --- a/src/overlay006/wild_encounters.c +++ b/src/overlay006/wild_encounters.c @@ -242,8 +242,8 @@ BOOL WildEncounters_TryWildEncounter(FieldSystem *fieldSystem) EncounterSlot encounterTable[MAX_GRASS_ENCOUNTERS]; WildEncounters_FieldParams encounterFieldParams; - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, playerX, playerZ); u8 encounterRate = GetTileEncounterRateAndType(fieldSystem, tileBehavior, &encounterType); @@ -459,8 +459,8 @@ BOOL WildEncounters_TrySweetScentEncounter(FieldSystem *fieldSystem, FieldTask * EncounterSlot encounterTable[MAX_GRASS_ENCOUNTERS]; WildEncounters_FieldParams encounterFieldParams; - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); u8 tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, playerX, playerZ); u8 encounterRate = GetTileEncounterRateAndType(fieldSystem, tileBehavior, &encounterType); @@ -570,8 +570,8 @@ BOOL WildEncounters_TryMudEncounter(FieldSystem *fieldSystem, FieldBattleDTO **b *battleParams = NULL; - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); u8 tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, playerX, playerZ); u8 encounterRate = GetTileEncounterRateAndType(fieldSystem, tileBehavior, &encounterType); @@ -710,8 +710,8 @@ static BOOL TryGenerateGrassEncounter_WithRadar(FieldSystem *fieldSystem, Pokemo if (encounterSuccess) { { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); RadarSpawnPatches(fieldSystem, playerX, playerZ, fieldSystem->chain); } @@ -765,7 +765,7 @@ static BOOL ShouldGetRandomEncounter(FieldSystem *fieldSystem, const u32 encount if (TileBehavior_IsVeryTallGrass(tileBehavior)) { flatEncounterRate += 30; - } else if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) == PLAYER_STATE_CYCLING) { + } else if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) == PLAYER_AVATAR_CYCLING) { flatEncounterRate += 30; } diff --git a/src/overlay007/battle_regulation_menu.c b/src/overlay007/battle_regulation_menu.c new file mode 100644 index 0000000000..ea9eeeac2f --- /dev/null +++ b/src/overlay007/battle_regulation_menu.c @@ -0,0 +1,580 @@ +#include "overlay007/battle_regulation_menu.h" + +#include +#include + +#include "constants/field_base_tiles.h" +#include "constants/heap.h" + +#include "field/field_system.h" + +#include "battle_regulation.h" +#include "battle_regulation_validation.h" +#include "bg_window.h" +#include "field_message.h" +#include "field_task.h" +#include "font.h" +#include "heap.h" +#include "height_weight_data.h" +#include "list_menu.h" +#include "message.h" +#include "party.h" +#include "pokedex_heightweight.h" +#include "render_window.h" +#include "save_player.h" +#include "sound_playback.h" +#include "string_gf.h" +#include "string_list.h" +#include "string_template.h" +#include "system.h" +#include "text.h" + +#include "res/text/bank/pokemon_center_2f_common.h" +#include "res/text/bank/unk_0353.h" + +typedef struct BattleRegulationMenu { + ListMenu *listMenuRegulations; + ListMenu *listMenuConfirm; + StringList *strListRegulations; + StringList *strListConfirm; + FieldSystem *fieldSystem; + String *fmtString; + String *dstString; + String *regulationName; + String *cupString; + Window windowRules; + Window windowRegulations; + Window windowConfirm; + Window windowMsgBox; + StringTemplate *strTemplate; + MessageLoader *msgLoader; + HeightWeightData *heighWeightData; + u16 *result; + int printerID; + u16 cursorPosRegulations; + u16 cursorPosConfirm; + int state; + u16 unk_80; + u16 unk_82; +} BattleRegulationMenu; + +typedef struct ConfirmMenuEntry { + u32 bankEntry; + u32 index; +} ConfirmMenuEntry; + +static const ListMenuTemplate sListMenuTemplate = { + .choices = NULL, + .cursorCallback = NULL, + .printCallback = NULL, + .window = NULL, + .count = 0, + .maxDisplay = 0, + .headerXOffset = 0, + .textXOffset = 8, + .cursorXOffset = 0, + .yOffset = 0, + .textColorFg = 1, + .textColorBg = 15, + .textColorShadow = 2, + .letterSpacing = 0, + .lineSpacing = 16, + .pagerMode = PAGER_MODE_LEFT_RIGHT_PAD, + .fontID = FONT_SYSTEM, + .cursorType = 0, + .parent = NULL +}; + +static void PrintMessage(BattleRegulationMenu *menu, int entryID) +{ + if (Window_IsInUse(&menu->windowMsgBox) == FALSE) { + Window_Init(&menu->windowMsgBox); + FieldMessage_AddWindow(menu->fieldSystem->bgConfig, &menu->windowMsgBox, BG_LAYER_MAIN_3); + FieldMessage_DrawWindow(&menu->windowMsgBox, SaveData_GetOptions(menu->fieldSystem->saveData)); + } else { + FieldMessage_ClearWindow(&menu->windowMsgBox); + } + + MessageLoader_GetString(menu->msgLoader, entryID, menu->fmtString); + StringTemplate_Format(menu->strTemplate, menu->dstString, menu->fmtString); + + menu->printerID = FieldMessage_Print(&menu->windowMsgBox, menu->dstString, SaveData_GetOptions(menu->fieldSystem->saveData), 1); +} + +static void RemoveMsgBox(BattleRegulationMenu *menu, BOOL clear) +{ + if (clear) { + Window_EraseMessageBox(&menu->windowMsgBox, FALSE); + Window_ClearAndCopyToVRAM(&menu->windowMsgBox); + } + + Window_Remove(&menu->windowMsgBox); +} + +static void GetBattleRegulationName(BattleRegulationMenu *menu, int index) +{ + BattleRegulation_GetNameByIndex(menu->fieldSystem->saveData, index, menu->regulationName, HEAP_ID_FIELD1); + StringTemplate_SetString(menu->strTemplate, 0, menu->regulationName, 0, 1, GAME_LANGUAGE); +} + +static void ShowListMenuRegulations(BattleRegulationMenu *menu) +{ + ListMenuTemplate template; + Window *window = &(menu->windowRegulations); + BattleRegulation *battleRegulation = BattleRegulation_Load(menu->fieldSystem->saveData, 0); + int count = 5; + + if (battleRegulation) { + count++; + } + + if (Window_IsInUse(window) == FALSE) { + menu->strListRegulations = StringList_New(count + 2, HEAP_ID_FIELD1); + + Window_Add(menu->fieldSystem->bgConfig, window, BG_LAYER_MAIN_3, 1, 1, 16, (count + 2) * 2, 13, 1); + Window_DrawStandardFrame(&menu->windowRegulations, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + StringList_AddFromMessageBank(menu->strListRegulations, menu->msgLoader, PokemonCenter2FCommon_Text_NoRestrictions, 12); + + for (int i = 0; i < count; i++) { + GetBattleRegulationName(menu, i); + + MessageLoader_GetString(menu->msgLoader, PokemonCenter2FCommon_Text_Cup, menu->regulationName); + StringTemplate_Format(menu->strTemplate, menu->cupString, menu->regulationName); + StringList_AddFromString(menu->strListRegulations, menu->cupString, i); + } + + StringList_AddFromMessageBank(menu->strListRegulations, menu->msgLoader, PokemonCenter2FCommon_Text_Cancel, MENU_CANCEL); + } + + template = sListMenuTemplate; + template.count = count + 2; + template.maxDisplay = count + 2; + template.choices = menu->strListRegulations; + template.window = &menu->windowRegulations; + template.parent = menu; + + menu->listMenuRegulations = ListMenu_New(&template, 0, menu->cursorPosRegulations, HEAP_ID_FIELD1); + Window_CopyToVRAM(&menu->windowRegulations); +} + +static void RemoveListMenuRegulations(BattleRegulationMenu *menu) +{ + if (menu->listMenuRegulations) { + ListMenu_Free(menu->listMenuRegulations, NULL, NULL); + Window_EraseStandardFrame(&menu->windowRegulations, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowRegulations.bgConfig, menu->windowRegulations.bgLayer); + Window_Remove(&menu->windowRegulations); + StringList_Free(menu->strListRegulations); + + menu->listMenuRegulations = NULL; + } +} + +static int ProcessListMenuInputRegulations(BattleRegulationMenu *menu) +{ + int input = ListMenu_ProcessInput(menu->listMenuRegulations); + ListMenu_GetListAndCursorPos(menu->listMenuRegulations, NULL, &menu->cursorPosRegulations); + + u16 v1 = menu->unk_80; + ListMenu_CalcTrueCursorPos(menu->listMenuRegulations, &menu->unk_80); + + if (v1 != menu->unk_80) { + Sound_PlayEffect(SEQ_SE_CONFIRM); + } + + switch (input) { + case MENU_NOTHING_CHOSEN: + return 0; + case 12: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = NULL; + RemoveListMenuRegulations(menu); + return 2; + case MENU_CANCEL: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = NULL; + RemoveListMenuRegulations(menu); + return -1; + default: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = BattleRegulation_GetByIndex(menu->fieldSystem->saveData, input); + break; + } + + return 1; +} + +static ConfirmMenuEntry sConfirmMenuEntries[] = { + { PokemonCenter2FCommon_Text_Confirm, 1 }, + { PokemonCenter2FCommon_Text_Rules, 2 }, + { PokemonCenter2FCommon_Text_Cancel, MENU_CANCEL } +}; + +static void ShowListMenuConfirm(BattleRegulationMenu *menu) +{ + ListMenuTemplate template; + int count = 3; + int tilemapTop = 10; + int width = 9; + int tilemapLeft = 22; + ConfirmMenuEntry *menuEntry = sConfirmMenuEntries; + + menu->strListConfirm = StringList_New(count, HEAP_ID_FIELD1); + + Window_Add(menu->fieldSystem->bgConfig, &menu->windowConfirm, BG_LAYER_MAIN_3, tilemapLeft, tilemapTop, width, count * 2, 13, BASE_TILE_MESSAGE_WINDOW - width * count * 2); + Window_DrawStandardFrame(&menu->windowConfirm, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + + for (int i = 0; i < count; i++) { + StringList_AddFromMessageBank(menu->strListConfirm, menu->msgLoader, menuEntry->bankEntry, menuEntry->index); + menuEntry++; + } + + template = sListMenuTemplate; + template.count = count; + template.maxDisplay = count; + template.choices = menu->strListConfirm; + template.window = &menu->windowConfirm; + template.parent = menu; + + menu->listMenuConfirm = ListMenu_New(&template, 0, menu->cursorPosConfirm, HEAP_ID_FIELD1); + Window_CopyToVRAM(&menu->windowConfirm); +} + +static int ProcessListMenuInputConfirm(BattleRegulationMenu *menu) +{ + int input = ListMenu_ProcessInput(menu->listMenuConfirm); + ListMenu_GetListAndCursorPos(menu->listMenuConfirm, NULL, &menu->cursorPosConfirm); + + u16 v1 = menu->unk_82; + ListMenu_CalcTrueCursorPos(menu->listMenuConfirm, &menu->unk_82); + + if (v1 != menu->unk_82) { + Sound_PlayEffect(SEQ_SE_CONFIRM); + } + + switch (input) { + case MENU_NOTHING_CHOSEN: + return 0; + case MENU_CANCEL: + Sound_PlayEffect(SEQ_SE_CONFIRM); + input = -1; + break; + default: + Sound_PlayEffect(SEQ_SE_CONFIRM); + RemoveListMenuRegulations(menu); + break; + } + + if (menu->listMenuConfirm) { + ListMenu_Free(menu->listMenuConfirm, NULL, NULL); + Window_EraseStandardFrame(&menu->windowConfirm, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowConfirm.bgConfig, menu->windowConfirm.bgLayer); + Window_Remove(&menu->windowConfirm); + StringList_Free(menu->strListConfirm); + + menu->listMenuConfirm = NULL; + } + + return input; +} + +#define RULES_COUNT 9 + +static u8 sBattleRegulationRules[RULES_COUNT] = { + BATTLE_REGULATION_RULE_TEAM_SIZE, + BATTLE_REGULATION_RULE_MAX_LEVEL, + BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL, + BATTLE_REGULATION_RULE_HEIGHT_RESTRICT, + BATTLE_REGULATION_RULE_WEIGHT_RESTRICT, + BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT, + BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT, + BATTLE_REGULATION_RULE_SPECIES_UNIQUE, + BATTLE_REGULATION_RULE_ITEM_UNIQUE +}; + +static u8 sBattleRegulationValueMessages[RULES_COUNT] = { + Unk0353_Text_ValueNoOfPokemon, + Unk0353_Text_ValueMaxLevel, + Unk0353_Text_ValueMaxTotalLevels, + Unk0353_Text_ValueMaxHeight, + Unk0353_Text_ValueMaxWeight, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValueItemsPermitted +}; + +static void ShowBattleRegulationRules(BattleRegulationMenu *menu) +{ + StringTemplate *strTemplate = menu->strTemplate; + int i, ruleValue, valueMessage; + const int yOffset = 16; + const int xOffset = 2; + const int lineHeight = 15; + const int xOffsetCupName = 55; + const int xRightSide = (24 * 8) - 1; + + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, HEAP_ID_FIELD1); + String *fmtString = String_Init(180, HEAP_ID_FIELD1); + String *dstString = String_Init(180, HEAP_ID_FIELD1); + Window *window = &menu->windowRules; + + Window_Add(menu->fieldSystem->bgConfig, window, BG_LAYER_MAIN_3, 4, 2, 24, 19, 13, 1); + Window_DrawStandardFrame(window, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + Window_FillTilemap(window, 15); + + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + + MessageLoader_GetString(msgLoader, Unk0353_Text_Cup, fmtString); + StringTemplate_Format(strTemplate, dstString, fmtString); + Text_AddPrinterWithParams(window, FONT_SYSTEM, dstString, xOffset + xOffsetCupName, 0, TEXT_SPEED_NO_TRANSFER, NULL); + + for (i = 0; i < RULES_COUNT; i++) { + MessageLoader_GetString(msgLoader, Unk0353_Text_RuleNoOfPokemon + i, fmtString); + Text_AddPrinterWithParams(window, FONT_SYSTEM, fmtString, xOffset, yOffset + lineHeight * i, TEXT_SPEED_NO_TRANSFER, NULL); + } + + for (i = 0; i < RULES_COUNT; i++) { + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, sBattleRegulationRules[i]); + valueMessage = sBattleRegulationValueMessages[i]; + + switch (sBattleRegulationRules[i]) { + case BATTLE_REGULATION_RULE_TEAM_SIZE: + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 1, 1, 1); + break; + case BATTLE_REGULATION_RULE_MAX_LEVEL: + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 3, 0, 1); + break; + case BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL: + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else { + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 3, 0, 1); + } + break; + case BATTLE_REGULATION_RULE_HEIGHT_RESTRICT: + ruleValue = (ruleValue >= 0) ? (((ruleValue * 10 * 1000) / 254 + 5) / 10) : -(((-ruleValue * 10 * 1000) / 254 + 5) / 10); + + StringTemplate_SetNumber(strTemplate, 0, abs(ruleValue / 12), 2, 0, 1); + StringTemplate_SetNumber(strTemplate, 1, abs(ruleValue % 12), 2, 2, 1); + + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else if (ruleValue > 0) { + valueMessage++; + } + break; + case BATTLE_REGULATION_RULE_WEIGHT_RESTRICT: + ruleValue = (ruleValue >= 0) ? (((ruleValue * 220462) + 50000) / 100000) : -(((-ruleValue * 220462) + 50000) / 100000); + StringTemplate_SetNumber(strTemplate, 0, abs(ruleValue), 3, 0, 1); + + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else if (ruleValue > 0) { + valueMessage++; + } + break; + case BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT: + case BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT: + case BATTLE_REGULATION_RULE_SPECIES_UNIQUE: + case BATTLE_REGULATION_RULE_ITEM_UNIQUE: + if (ruleValue == 0) { + valueMessage++; + } + break; + default: + break; + } + + MessageLoader_GetString(msgLoader, valueMessage, fmtString); + StringTemplate_Format(strTemplate, dstString, fmtString); + int valueWidth = Font_CalcStringWidth(FONT_SYSTEM, dstString, 0); + int valueXOffset = xRightSide - valueWidth; + + Text_AddPrinterWithParams(window, FONT_SYSTEM, dstString, valueXOffset, yOffset + lineHeight * i, TEXT_SPEED_NO_TRANSFER, NULL); + } + + String_Free(fmtString); + String_Free(dstString); + MessageLoader_Free(msgLoader); + Window_CopyToVRAM(window); +} + +static void RemoveRulesWindow(BattleRegulationMenu *menu) +{ + Window_EraseStandardFrame(&menu->windowRules, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowRules.bgConfig, menu->windowRules.bgLayer); + Window_Remove(&menu->windowRules); +} + +static BOOL HandleBattleRegulationValidationResult(BattleRegulationMenu *menu) +{ + Party *party = SaveData_GetParty(menu->fieldSystem->saveData); + enum BattleRegulationValidationResult result = BattleRegulation_SelectValidPokemon(menu->fieldSystem->battleRegulation, party, menu->heighWeightData); + int ruleValue; + + switch (result) { + case BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS: + return TRUE; + case BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE: + Sound_PlayEffect(SEQ_SE_DP_BOX03); + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_TEAM_SIZE); + StringTemplate_SetNumber(menu->strTemplate, 1, ruleValue, 1, PADDING_MODE_SPACES, CHARSET_MODE_EN); + PrintMessage(menu, PokemonCenter2FCommon_Text_NeedXPokemonForCup); + break; + default: + case BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED: + Sound_PlayEffect(SEQ_SE_DP_BOX03); + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); + StringTemplate_SetNumber(menu->strTemplate, 1, ruleValue, 3, PADDING_MODE_NONE, CHARSET_MODE_EN); + PrintMessage(menu, PokemonCenter2FCommon_Text_CantFormTeamWithLevelLimit); + break; + } + + return FALSE; +} + +enum BattleRegulationMenuState { + STATE_PRINT_WHICH_RULESET = 0, + STATE_SHOW_LIST_MENU_REGULATIONS, + STATE_HANDLE_INPUT_REGULATIONS, + STATE_SHOW_LIST_MENU_CONFIRM, + STATE_HANDLE_INPUT_CONFIRM, + STATE_CHECK_VALID_TEAM, + STATE_WAIT_MESSAGE_INVALID_TEAM, + STATE_PRINT_RULES, + STATE_RESHOW_MENU_AFTER_RULES, + STATE_WAIT_RESHOW_CONFIRM_MENU, + STATE_UNUSED, + STATE_EXIT, +}; + +static BOOL FieldTask_BattleRegulationMenu(FieldTask *task) +{ + FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task); + BattleRegulationMenu *menu = FieldTask_GetEnv(task); + int input; + + switch (menu->state) { + case STATE_PRINT_WHICH_RULESET: + PrintMessage(menu, PokemonCenter2FCommon_Text_WhichSetOfRules); + menu->state++; + break; + case STATE_SHOW_LIST_MENU_REGULATIONS: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + ShowListMenuRegulations(menu); + menu->state++; + } + break; + case STATE_HANDLE_INPUT_REGULATIONS: + input = ProcessListMenuInputRegulations(menu); + + if (input == -1) { + *menu->result = 2; + menu->state = STATE_EXIT; + } else if (input == 2) { + *menu->result = 3; + menu->state = STATE_EXIT; + } else if (input == 1) { + menu->state = STATE_SHOW_LIST_MENU_CONFIRM; + } + break; + case STATE_SHOW_LIST_MENU_CONFIRM: + ShowListMenuConfirm(menu); + menu->state++; + break; + case STATE_HANDLE_INPUT_CONFIRM: + input = ProcessListMenuInputConfirm(menu); + + if (input == -1) { + menu->state = STATE_HANDLE_INPUT_REGULATIONS; + } else if (input == 1) { + menu->state = STATE_CHECK_VALID_TEAM; + } else if (input == 2) { + menu->state = STATE_PRINT_RULES; + } + break; + case STATE_CHECK_VALID_TEAM: + if (HandleBattleRegulationValidationResult(menu)) { + *menu->result = 1; + menu->state = STATE_EXIT; + } else { + menu->state = STATE_WAIT_MESSAGE_INVALID_TEAM; + } + break; + case STATE_WAIT_MESSAGE_INVALID_TEAM: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + menu->state = STATE_PRINT_WHICH_RULESET; + } + } + break; + case STATE_PRINT_RULES: + RemoveMsgBox(menu, TRUE); + ShowBattleRegulationRules(menu); + menu->state++; + break; + case STATE_RESHOW_MENU_AFTER_RULES: + if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + RemoveRulesWindow(menu); + PrintMessage(menu, PokemonCenter2FCommon_Text_WhichSetOfRules); + ShowListMenuRegulations(menu); + menu->state = STATE_WAIT_RESHOW_CONFIRM_MENU; + } + break; + case STATE_WAIT_RESHOW_CONFIRM_MENU: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + menu->state = STATE_SHOW_LIST_MENU_CONFIRM; + } + break; + case STATE_UNUSED: + break; + case STATE_EXIT: + RemoveListMenuRegulations(menu); + RemoveMsgBox(menu, FALSE); + StringTemplate_Free(menu->strTemplate); + MessageLoader_Free(menu->msgLoader); + String_Free(menu->fmtString); + String_Free(menu->dstString); + String_Free(menu->regulationName); + String_Free(menu->cupString); + HeightWeightData_Free(menu->heighWeightData); + Heap_Free(menu); + return TRUE; + default: + return TRUE; + } + + return FALSE; +} + +static BattleRegulationMenu *NewBattleRegulationMenu(FieldSystem *fieldSystem) +{ + BattleRegulationMenu *menu = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(BattleRegulationMenu)); + + MI_CpuClear8(menu, sizeof(BattleRegulationMenu)); + + menu->state = 0; + menu->fieldSystem = fieldSystem; + menu->fieldSystem->battleRegulation = NULL; + menu->strTemplate = StringTemplate_Default(HEAP_ID_FIELD1); + menu->msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_COMMON, HEAP_ID_FIELD1); + menu->fmtString = String_Init(180, HEAP_ID_FIELD1); + menu->dstString = String_Init(180, HEAP_ID_FIELD1); + menu->regulationName = String_Init(180, HEAP_ID_FIELD1); + menu->cupString = String_Init(180, HEAP_ID_FIELD1); + menu->heighWeightData = HeightWeightData_Load(HEAP_ID_FIELD2); + + return menu; +} + +void OpenBattleRegulationMenu(FieldTask *task, u16 *result) +{ + FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task); + BattleRegulationMenu *menu = NewBattleRegulationMenu(fieldSystem); + + menu->result = result; + FieldTask_InitCall(task, FieldTask_BattleRegulationMenu, menu); +} diff --git a/src/overlay007/ov7_0224B4E8.c b/src/overlay007/ov7_0224B4E8.c deleted file mode 100644 index 6c4386c0ef..0000000000 --- a/src/overlay007/ov7_0224B4E8.c +++ /dev/null @@ -1,577 +0,0 @@ -#include "overlay007/ov7_0224B4E8.h" - -#include -#include - -#include "constants/heap.h" - -#include "field/field_system.h" - -#include "battle_regulation.h" -#include "battle_regulation_validation.h" -#include "bg_window.h" -#include "field_message.h" -#include "field_task.h" -#include "font.h" -#include "heap.h" -#include "height_weight_data.h" -#include "list_menu.h" -#include "message.h" -#include "party.h" -#include "pokedex_heightweight.h" -#include "render_window.h" -#include "save_player.h" -#include "sound_playback.h" -#include "string_gf.h" -#include "string_list.h" -#include "string_template.h" -#include "system.h" -#include "text.h" - -typedef struct { - ListMenu *unk_00; - ListMenu *unk_04; - StringList *unk_08; - StringList *unk_0C; - FieldSystem *fieldSystem; - String *unk_14; - String *unk_18; - String *unk_1C; - String *unk_20; - Window unk_24; - Window unk_34; - Window unk_44; - Window unk_54; - StringTemplate *unk_64; - MessageLoader *unk_68; - HeightWeightData *unk_6C; - u16 *unk_70; - int unk_74; - u16 unk_78; - u16 unk_7A; - int unk_7C; - u16 unk_80; - u16 unk_82; -} UnkStruct_ov7_0224B4E8; - -typedef struct { - u32 unk_00; - u32 unk_04; -} UnkStruct_ov7_0224F4D8; - -static const ListMenuTemplate Unk_ov7_0224F188 = { - NULL, - NULL, - NULL, - NULL, - 0x0, - 0x0, - 0x0, - 0x8, - 0x0, - 0x0, - 0x1, - 0xF, - 0x2, - 0x0, - 0x10, - 0x1, - 0x0, - 0x0, - NULL -}; - -static void ov7_0224B4E8(UnkStruct_ov7_0224B4E8 *param0, int param1) -{ - if (Window_IsInUse(¶m0->unk_54) == 0) { - Window_Init(¶m0->unk_54); - FieldMessage_AddWindow(param0->fieldSystem->bgConfig, ¶m0->unk_54, 3); - FieldMessage_DrawWindow(¶m0->unk_54, SaveData_GetOptions(param0->fieldSystem->saveData)); - } else { - FieldMessage_ClearWindow(¶m0->unk_54); - } - - MessageLoader_GetString(param0->unk_68, param1, param0->unk_14); - StringTemplate_Format(param0->unk_64, param0->unk_18, param0->unk_14); - - param0->unk_74 = FieldMessage_Print(¶m0->unk_54, param0->unk_18, SaveData_GetOptions(param0->fieldSystem->saveData), 1); -} - -static void ov7_0224B558(UnkStruct_ov7_0224B4E8 *param0, BOOL param1) -{ - if (param1) { - Window_EraseMessageBox(¶m0->unk_54, 0); - Window_ClearAndCopyToVRAM(¶m0->unk_54); - } - - Window_Remove(¶m0->unk_54); -} - -static void ov7_0224B57C(UnkStruct_ov7_0224B4E8 *param0, int param1) -{ - BattleRegulation_GetNameByIndex(param0->fieldSystem->saveData, param1, param0->unk_1C, HEAP_ID_FIELD1); - StringTemplate_SetString(param0->unk_64, 0, param0->unk_1C, 0, 1, GAME_LANGUAGE); -} - -static void ov7_0224B5A8(UnkStruct_ov7_0224B4E8 *param0) -{ - ListMenuTemplate v0; - Window *v1 = &(param0->unk_34); - BattleRegulation *v2 = BattleRegulation_Load(param0->fieldSystem->saveData, 0); - int v3 = 5; - - if (v2) { - v3++; - } - - if (Window_IsInUse(v1) == 0) { - int v4; - - param0->unk_08 = StringList_New(v3 + 2, HEAP_ID_FIELD1); - - Window_Add(param0->fieldSystem->bgConfig, v1, 3, 1, 1, 16, (v3 + 2) * 2, 13, 1); - Window_DrawStandardFrame(¶m0->unk_34, 1, 1024 - (18 + 12) - 9, 11); - StringList_AddFromMessageBank(param0->unk_08, param0->unk_68, 123, 12); - - for (v4 = 0; v4 < v3; v4++) { - ov7_0224B57C(param0, v4); - - MessageLoader_GetString(param0->unk_68, 113, param0->unk_1C); - StringTemplate_Format(param0->unk_64, param0->unk_20, param0->unk_1C); - StringList_AddFromString(param0->unk_08, param0->unk_20, v4); - } - - StringList_AddFromMessageBank(param0->unk_08, param0->unk_68, 114, 0xfffffffe); - } - - v0 = Unk_ov7_0224F188; - v0.count = v3 + 2; - v0.maxDisplay = v3 + 2; - v0.choices = param0->unk_08; - v0.window = ¶m0->unk_34; - v0.parent = param0; - - param0->unk_00 = ListMenu_New(&v0, 0, param0->unk_78, HEAP_ID_FIELD1); - Window_CopyToVRAM(¶m0->unk_34); -} - -static void ov7_0224B6AC(UnkStruct_ov7_0224B4E8 *param0) -{ - if (param0->unk_00) { - ListMenu_Free(param0->unk_00, NULL, NULL); - Window_EraseStandardFrame(¶m0->unk_34, 1); - Bg_ScheduleTilemapTransfer(param0->unk_34.bgConfig, param0->unk_34.bgLayer); - Window_Remove(¶m0->unk_34); - StringList_Free(param0->unk_08); - - param0->unk_00 = NULL; - } -} - -static int ov7_0224B6E8(UnkStruct_ov7_0224B4E8 *param0) -{ - int v0; - u16 v1; - - v0 = ListMenu_ProcessInput(param0->unk_00); - ListMenu_GetListAndCursorPos(param0->unk_00, NULL, ¶m0->unk_78); - - v1 = param0->unk_80; - ListMenu_CalcTrueCursorPos(param0->unk_00, ¶m0->unk_80); - - if (v1 != param0->unk_80) { - Sound_PlayEffect(SEQ_SE_CONFIRM); - } - - switch (v0) { - case 0xffffffff: - return 0; - case 12: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = NULL; - ov7_0224B6AC(param0); - return 2; - case 0xfffffffe: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = NULL; - ov7_0224B6AC(param0); - return -1; - default: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = BattleRegulation_GetByIndex(param0->fieldSystem->saveData, v0); - break; - } - - return 1; -} - -static UnkStruct_ov7_0224F4D8 Unk_ov7_0224F4D8[] = { - { 0x73, (u32)1 }, - { 0x74, (u32)2 }, - { 0x72, (u32)0xfffffffe } -}; - -static void ov7_0224B788(UnkStruct_ov7_0224B4E8 *param0) -{ - ListMenuTemplate v0; - int v1 = 3, v2; - int v3 = 10; - int v4 = 9; - int v5 = 22; - UnkStruct_ov7_0224F4D8 *v6 = Unk_ov7_0224F4D8; - - param0->unk_0C = StringList_New(v1, HEAP_ID_FIELD1); - - Window_Add(param0->fieldSystem->bgConfig, ¶m0->unk_44, 3, v5, v3, v4, v1 * 2, 13, (((1024 - (18 + 12) - 9 - (32 * 8)) - (18 + 12 + 24)) - (27 * 4)) - v4 * v1 * 2); - Window_DrawStandardFrame(¶m0->unk_44, 1, 1024 - (18 + 12) - 9, 11); - - { - int v7; - - for (v7 = 0; v7 < v1; v7++) { - StringList_AddFromMessageBank(param0->unk_0C, param0->unk_68, v6->unk_00, v6->unk_04); - v6++; - } - } - - v0 = Unk_ov7_0224F188; - v0.count = v1; - v0.maxDisplay = v1; - v0.choices = param0->unk_0C; - v0.window = ¶m0->unk_44; - v0.parent = param0; - - param0->unk_04 = ListMenu_New(&v0, 0, param0->unk_7A, HEAP_ID_FIELD1); - Window_CopyToVRAM(¶m0->unk_44); -} - -static int ov7_0224B83C(UnkStruct_ov7_0224B4E8 *param0) -{ - int v0; - u16 v1; - - v0 = ListMenu_ProcessInput(param0->unk_04); - ListMenu_GetListAndCursorPos(param0->unk_04, NULL, ¶m0->unk_7A); - - v1 = param0->unk_82; - ListMenu_CalcTrueCursorPos(param0->unk_04, ¶m0->unk_82); - - if (v1 != param0->unk_82) { - Sound_PlayEffect(SEQ_SE_CONFIRM); - } - - switch (v0) { - case 0xffffffff: - return 0; - case 0xfffffffe: - Sound_PlayEffect(SEQ_SE_CONFIRM); - v0 = -1; - break; - default: - Sound_PlayEffect(SEQ_SE_CONFIRM); - ov7_0224B6AC(param0); - break; - } - - if (param0->unk_04) { - ListMenu_Free(param0->unk_04, NULL, NULL); - Window_EraseStandardFrame(¶m0->unk_44, 1); - Bg_ScheduleTilemapTransfer(param0->unk_44.bgConfig, param0->unk_44.bgLayer); - Window_Remove(¶m0->unk_44); - StringList_Free(param0->unk_0C); - - param0->unk_04 = NULL; - } - - return v0; -} - -static u8 Unk_ov7_0224F4C0[] = { - 0x1, - 0x2, - 0x3, - 0x5, - 0x7, - 0x4, - 0xB, - 0xA, - 0x9 -}; - -static u8 Unk_ov7_0224F4CC[] = { - 0x54, - 0x55, - 0x56, - 0x57, - 0x59, - 0x5B, - 0x5B, - 0x5B, - 0x5D -}; - -static void ov7_0224B8DC(UnkStruct_ov7_0224B4E8 *param0) -{ - MessageLoader *v0; - StringTemplate *v1 = param0->unk_64; - String *v2; - String *v3; - Window *v4; - int v5, v6, v7, v8; - const int v9 = 16; - const int v10 = 2; - const int v11 = 15; - const int v12 = 55; - const int v13 = (24 * 8) - 1; - - v0 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, HEAP_ID_FIELD1); - v2 = String_Init((90 * 2), HEAP_ID_FIELD1); - v3 = String_Init((90 * 2), HEAP_ID_FIELD1); - v4 = ¶m0->unk_24; - - Window_Add(param0->fieldSystem->bgConfig, v4, 3, 4, 2, 24, 19, 13, 1); - Window_DrawStandardFrame(v4, 1, 1024 - (18 + 12) - 9, 11); - Window_FillTilemap(v4, 15); - - ov7_0224B57C(param0, param0->unk_78 - 1); - - MessageLoader_GetString(v0, 95, v2); - StringTemplate_Format(v1, v3, v2); - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v3, v10 + v12, 0, TEXT_SPEED_NO_TRANSFER, NULL); - - for (v5 = 0; v5 < 9; v5++) { - MessageLoader_GetString(v0, 75 + v5, v2); - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v2, v10, v9 + v11 * v5, TEXT_SPEED_NO_TRANSFER, NULL); - } - - for (v5 = 0; v5 < 9; v5++) { - v6 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, Unk_ov7_0224F4C0[v5]); - v7 = Unk_ov7_0224F4CC[v5]; - - switch (Unk_ov7_0224F4C0[v5]) { - case 1: - StringTemplate_SetNumber(v1, 0, v6, 1, 1, 1); - break; - case 2: - StringTemplate_SetNumber(v1, 0, v6, 3, 0, 1); - break; - case 3: - if (v6 == 0) { - v7 = 96; - } else { - StringTemplate_SetNumber(v1, 0, v6, 3, 0, 1); - } - break; - case 5: - v6 = (v6 >= 0) ? (((v6 * 10 * 1000) / 254 + 5) / 10) : -(((-v6 * 10 * 1000) / 254 + 5) / 10); - - StringTemplate_SetNumber(v1, 0, abs(v6 / 12), 2, 0, 1); - StringTemplate_SetNumber(v1, 1, abs(v6 % 12), 2, 2, 1); - - if (v6 == 0) { - v7 = 96; - } else if (v6 > 0) { - v7++; - } - break; - case 7: - v6 = (v6 >= 0) ? (((v6 * 220462) + 50000) / 100000) : -(((-v6 * 220462) + 50000) / 100000); - StringTemplate_SetNumber(v1, 0, abs(v6), 3, 0, 1); - - if (v6 == 0) { - v7 = 96; - } else if (v6 > 0) { - v7++; - } - break; - case 4: - case 11: - case 10: - case 9: - if (v6 == 0) { - v7++; - } - break; - default: - break; - } - - MessageLoader_GetString(v0, v7, v2); - StringTemplate_Format(v1, v3, v2); - { - int v14 = Font_CalcStringWidth(FONT_SYSTEM, v3, 0); - int v15 = v13 - v14; - - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v3, v15, v9 + v11 * v5, TEXT_SPEED_NO_TRANSFER, NULL); - } - } - - String_Free(v2); - String_Free(v3); - MessageLoader_Free(v0); - Window_CopyToVRAM(v4); -} - -static void ov7_0224BBA0(UnkStruct_ov7_0224B4E8 *param0) -{ - Window_EraseStandardFrame(¶m0->unk_24, 1); - Bg_ScheduleTilemapTransfer(param0->unk_24.bgConfig, param0->unk_24.bgLayer); - Window_Remove(¶m0->unk_24); -} - -static BOOL ov7_0224BBC4(UnkStruct_ov7_0224B4E8 *param0) -{ - Party *v0 = SaveData_GetParty(param0->fieldSystem->saveData); - int v1 = BattleRegulation_SelectValidPokemon(param0->fieldSystem->battleRegulation, v0, param0->unk_6C); - int v2; - - switch (v1) { - case 0: - return 1; - case 4: - Sound_PlayEffect(SEQ_SE_DP_BOX03); - ov7_0224B57C(param0, param0->unk_78 - 1); - v2 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_TEAM_SIZE); - StringTemplate_SetNumber(param0->unk_64, 1, v2, 1, 1, 1); - ov7_0224B4E8(param0, 107); - break; - default: - case 1: - Sound_PlayEffect(SEQ_SE_DP_BOX03); - ov7_0224B57C(param0, param0->unk_78 - 1); - v2 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); - StringTemplate_SetNumber(param0->unk_64, 1, v2, 3, 0, 1); - ov7_0224B4E8(param0, 121); - break; - } - - return 0; -} - -static BOOL ov7_0224BC74(FieldTask *param0) -{ - FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0); - UnkStruct_ov7_0224B4E8 *v1 = FieldTask_GetEnv(param0); - int v2; - - switch (v1->unk_7C) { - case 0: - ov7_0224B4E8(v1, 106); - v1->unk_7C++; - break; - case 1: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - ov7_0224B5A8(v1); - v1->unk_7C++; - } - break; - case 2: - v2 = ov7_0224B6E8(v1); - - if (v2 == -1) { - *v1->unk_70 = 2; - v1->unk_7C = 11; - } else if (v2 == 2) { - *v1->unk_70 = 3; - v1->unk_7C = 11; - } else if (v2 == 1) { - v1->unk_7C = 3; - } - break; - case 3: - ov7_0224B788(v1); - v1->unk_7C++; - break; - case 4: - v2 = ov7_0224B83C(v1); - - if (v2 == -1) { - v1->unk_7C = 2; - } else if (v2 == 1) { - v1->unk_7C = 5; - } else if (v2 == 2) { - v1->unk_7C = 7; - } - break; - case 5: - if (ov7_0224BBC4(v1)) { - *v1->unk_70 = 1; - v1->unk_7C = 11; - } else { - v1->unk_7C = 6; - } - break; - case 6: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { - v1->unk_7C = 0; - } - } - break; - case 7: - ov7_0224B558(v1, 1); - ov7_0224B8DC(v1); - v1->unk_7C++; - break; - case 8: - if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { - ov7_0224BBA0(v1); - ov7_0224B4E8(v1, 106); - ov7_0224B5A8(v1); - v1->unk_7C = 9; - } - break; - case 9: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - v1->unk_7C = 3; - } - break; - case 10: - break; - case 11: - ov7_0224B6AC(v1); - ov7_0224B558(v1, 0); - StringTemplate_Free(v1->unk_64); - MessageLoader_Free(v1->unk_68); - String_Free(v1->unk_14); - String_Free(v1->unk_18); - String_Free(v1->unk_1C); - String_Free(v1->unk_20); - HeightWeightData_Free(v1->unk_6C); - Heap_Free(v1); - return 1; - default: - return 1; - } - - return 0; -} - -static UnkStruct_ov7_0224B4E8 *ov7_0224BE10(FieldSystem *fieldSystem) -{ - UnkStruct_ov7_0224B4E8 *v0 = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(UnkStruct_ov7_0224B4E8)); - - MI_CpuClear8(v0, sizeof(UnkStruct_ov7_0224B4E8)); - - v0->unk_7C = 0; - v0->fieldSystem = fieldSystem; - v0->fieldSystem->battleRegulation = NULL; - v0->unk_64 = StringTemplate_Default(HEAP_ID_FIELD1); - v0->unk_68 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS, HEAP_ID_FIELD1); - v0->unk_14 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_18 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_1C = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_20 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_6C = HeightWeightData_Load(HEAP_ID_FIELD2); - - return v0; -} - -void ov7_0224BE7C(FieldTask *param0, u16 *param1) -{ - FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0); - UnkStruct_ov7_0224B4E8 *v1 = ov7_0224BE10(fieldSystem); - - v1->unk_70 = param1; - FieldTask_InitCall(param0, ov7_0224BC74, v1); -} diff --git a/src/overlay007/shop_menu.c b/src/overlay007/shop_menu.c index 3acdadbb49..8273fcf913 100644 --- a/src/overlay007/shop_menu.c +++ b/src/overlay007/shop_menu.c @@ -271,7 +271,7 @@ void Shop_Start(FieldTask *task, FieldSystem *fieldSystem, u16 *shopItems, u8 ma static u8 Shop_GetCameraPosDest(FieldSystem *fieldSystem) { - int dir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int dir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if ((dir == DIR_NORTH) || (dir == DIR_SOUTH) || (dir == DIR_EAST)) { return 10; diff --git a/src/overlay008/ov8_02249960.c b/src/overlay008/gym_features.c similarity index 79% rename from src/overlay008/ov8_02249960.c rename to src/overlay008/gym_features.c index 3675ef6770..7ec172e95f 100644 --- a/src/overlay008/ov8_02249960.c +++ b/src/overlay008/gym_features.c @@ -1,9 +1,10 @@ -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include #include #include "constants/field/dynamic_map_features.h" +#include "constants/field/field_effect_renderer.h" #include "constants/field/map.h" #include "constants/graphics.h" #include "constants/scrcmd.h" @@ -14,7 +15,6 @@ #include "struct_decls/map_object.h" #include "struct_decls/map_object_manager.h" -#include "struct_defs/struct_02071BF8.h" #include "field/field_system.h" #include "field/field_system_sub2_t.h" @@ -25,13 +25,14 @@ #include "overlay005/map_prop.h" #include "overlay005/map_prop_animation.h" #include "overlay005/ov5_021F4018.h" -#include "overlay005/ov5_021F428C.h" #include "overlay005/ov5_021F47B0.h" #include "overlay005/ov5_021F5A10.h" +#include "overlay005/veilstone_gym_object_renderer.h" #include "badges.h" #include "bg_window.h" #include "camera.h" +#include "coordinates.h" #include "field_message.h" #include "field_system.h" #include "field_task.h" @@ -86,6 +87,35 @@ #define ETERNA_GYM_ONE_HOUR_ROTATION 0x1559 #define ETERNA_GYM_MAX_ROTATION 0x10000 +#define VEILSTONE_GYM_OBJECT_LOCALID 0xFD +#define VEILSTONE_NUM_TIRE_STACKS 11 +#define VEILSTONE_NUM_PUNCHING_BAGS 9 + +#define VEILSTONE_OBJ_IS_TIRE_STACK(obj) (MapObject_GetDataAt(obj, 0) == FALSE) + +#define VEILSTONE_TILE_FLAG_BAG_CANT_MOVE_THAT_WAY (1 << 0) +#define VEILSTONE_TILE_FLAG_TIRE_STACK_PRESENT (1 << 1) +#define VEILSTONE_TILE_FLAG_BAG_PAUSE_POINT (1 << 2) + +enum VeilstoneGymAnimationState { + VEILSTONE_ANIM_STATE_INIT = 0, + VEILSTONE_ANIM_STATE_KICK_BAG, + VEILSTONE_ANIM_STATE_START_MOVEMENT, + VEILSTONE_ANIM_STATE_MOVE_BAG, + VEILSTONE_ANIM_STATE_TOPPLE_STACK, + VEILSTONE_ANIM_STATE_REMOVE_STACK, + VEILSTONE_ANIM_STATE_PREP_CAMERA_TO_PLAYER, + VEILSTONE_ANIM_STATE_CAMERA_TO_PLAYER, + VEILSTONE_ANIM_STATE_FINISH_BAG_ANIMATION, + VEILSTONE_ANIM_STATE_WAIT_FINISH, + VEILSTONE_ANIM_STATE_FREE, + NUM_VEILSTONE_ANIM_STATE, +}; + +#define VEILSTONE_STATE_RESULT_ADVANCE_FRAME 0 +#define VEILSTONE_STATE_RESULT_CONTINUE 1 +#define VEILSTONE_STATE_RESULT_FINISH 2 + #define PASTORIA_WATER_HEIGHT_LOW 0 #define PASTORIA_WATER_HEIGHT_MIDDLE (MAP_OBJECT_TILE_SIZE * 2) #define PASTORIA_WATER_HEIGHT_HIGH (MAP_OBJECT_TILE_SIZE * 4) @@ -238,70 +268,67 @@ typedef struct EternaGymClockUpdateManager { String *msgBuf; } EternaGymClockUpdateManager; -typedef struct { - int unk_00; - int unk_04; -} UnkStruct_ov8_0224C90C; +typedef struct VeilstoneGymMapObjectManager { + int x; + int z; + MapObject *mapObj; + OverworldAnimManager *animManager; +} VeilstoneGymMapObjectManager; -typedef struct { - int unk_00; - int unk_04; - MapObject *unk_08; - OverworldAnimManager *unk_0C; -} UnkStruct_ov8_0224B80C; +typedef struct VeilstoneGymPunchingBag { + int exists; + int unused; + VeilstoneGymMapObjectManager obj; +} VeilstoneGymPunchingBag; -typedef struct { - int unk_00; - int unk_04; - UnkStruct_ov8_0224B80C unk_08; -} UnkStruct_ov8_0224BCA8; +typedef struct VeilstoneGymTireStack { + int exists; + int unused; + VeilstoneGymMapObjectManager obj; +} VeilstoneGymTireStack; -typedef struct { - int unk_00; - int unk_04; - UnkStruct_ov8_0224B80C unk_08; -} UnkStruct_ov8_0224B8A0; - -typedef struct { +typedef struct VeilstoneGymSystem { FieldSystem *fieldSystem; - UnkStruct_ov8_0224B8A0 unk_04[11]; - UnkStruct_ov8_0224BCA8 unk_10C[9]; -} UnkStruct_ov8_0224B8D0; + VeilstoneGymTireStack tireStacks[VEILSTONE_NUM_TIRE_STACKS]; + VeilstoneGymPunchingBag punchingBags[VEILSTONE_NUM_PUNCHING_BAGS]; +} VeilstoneGymSystem; -typedef struct { - int unk_00; - int unk_04; - int unk_08; - int unk_0C; - int unk_10; - int unk_14; - int unk_18; - int unk_1C; - int unk_20; - int unk_24; - int unk_28; - int unk_2C; - MapObject *unk_30; +typedef struct VeilstoneGymCameraManager { + int movementState; + int unused; + int bagX; + int bagZ; + int playerX; + int playerZ; + int destX; + int destZ; + int movementDirection; + int distanceToTravel; + int traveledDistance; + BOOL movementFinished; + MapObject *cameraObj; FieldSystem *fieldSystem; -} UnkStruct_ov8_0224C0C4; +} VeilstoneGymCameraManager; -typedef struct { - int unk_00; - int unk_04; - int unk_08; - int unk_0C; - int unk_10; - int unk_14; - int unk_18; - int unk_1C; - VecFx32 unk_20; - fx32 unk_2C; - fx32 unk_30; - UnkStruct_ov8_0224BCA8 *unk_34; - UnkStruct_ov8_0224B8A0 *unk_38; - UnkStruct_ov8_0224B8D0 *unk_3C; - UnkStruct_ov8_0224C0C4 unk_40; -} UnkStruct_ov8_0224C098; +typedef struct VeilstoneGym_BagAnimation { + int state; + int elapsedFrames; + int direction; + int bagX; + int bagZ; + int traveledCoordinates; + int moveCamera; + int distanceToTravel; + VecFx32 bagPosition; + fx32 movingSpeed; + fx32 traveledDistance; + VeilstoneGymPunchingBag *punchingBag; + VeilstoneGymTireStack *tireStack; + VeilstoneGymSystem *gymSystem; + VeilstoneGymCameraManager cameraMan; +} VeilstoneGym_BagAnimation; + +typedef int (*VeilstoneGymAnimationStateFunc)(VeilstoneGym_BagAnimation *); typedef struct HearthomeGymTrainerRoomLayout { int mapID; @@ -349,33 +376,35 @@ struct HearthomeGymSystem { SysTask *emptyTask; }; -static u8 CanalaveGym_CheckIfPlatformInPositionB(const u8 index, const int platformStates); -static void CanalaveGym_TogglePlatformState(const u8 index, int *platformStates); +static void VeilstoneGym_InitMapObjects(VeilstoneGymSystem *gymSystem); +static void VeilstoneGym_ReinitMapObjects(VeilstoneGymSystem *gymSystem); +static void VeilstoneGym_InitCameraManager(FieldSystem *fieldSystem, VeilstoneGym_BagAnimation *bagAnim, VeilstoneGymMapObjectManager *bagObj, int direction); +static void VeilStoneGym_ReturnCameraFocusToPlayer(VeilstoneGym_BagAnimation *bagAnim); +static BOOL VeilstoneGym_CheckIfCameraMovementFinished(VeilstoneGym_BagAnimation *bagAnim); +static BOOL VeilstoneGym_CheckIfCameraNeedsToMove(VeilstoneGym_BagAnimation *bagAnim, VeilstoneGymMapObjectManager *obj, int direction); +static void VeilstoneGym_PrepareForCameraMovement(VeilstoneGym_BagAnimation *bagAnim, BOOL reverseDirection); +static void VeilstoneGym_MoveCamera(VeilstoneGym_BagAnimation *bagAnim, enum MovementAction movementAction); +static void VeilstoneGym_UpdateCamera(VeilstoneGym_BagAnimation *bagAnim, fx32 speed); + static BOOL PastoriaGym_PressOrangeButton(FieldTask *taskMan); static BOOL PastoriaGym_PressGreenButton(FieldTask *taskMan); static BOOL PastoriaGym_PressBlueButton(FieldTask *taskMan); static void PastoriaGym_UpdateButtonAnimations(const u8 pressedButton, MapPropAnimationManager *mapPropAnimMan); static BOOL HearthomeGymDP_RaiseLift(FieldTask *taskMan); static BOOL HearthomeGymDP_LowerLift(FieldTask *taskMan); -static BOOL FieldTask_CanalaveGym_MovePlatformUpDown(FieldTask *taskMan); -static BOOL FieldTask_CanalaveGym_MovePlatformEastWest(FieldTask *taskMan); -static BOOL FieldTask_CanalaveGym_MovePlatformNorthSouth(FieldTask *taskMan); -static BOOL FieldTask_SunyshoreGym_RotateGears(FieldTask *task); -static void ov8_0224B8D0(UnkStruct_ov8_0224B8D0 *param0); -static void ov8_0224B958(UnkStruct_ov8_0224B8D0 *param0); -static void ov8_0224BFCC(FieldSystem *fieldSystem, UnkStruct_ov8_0224C098 *param1, UnkStruct_ov8_0224B80C *param2, int param3); -static void ov8_0224C098(UnkStruct_ov8_0224C098 *param0); -static BOOL ov8_0224C0C4(UnkStruct_ov8_0224C098 *param0); -static BOOL ov8_0224C0C8(UnkStruct_ov8_0224C098 *param0, UnkStruct_ov8_0224B80C *param1, int param2); -static void ov8_0224C0FC(UnkStruct_ov8_0224C098 *param0, int param1); -static void ov8_0224C11C(UnkStruct_ov8_0224C098 *param0, int param1); -static void ov8_0224C170(UnkStruct_ov8_0224C098 *param0, fx32 param1); + static void HearthomeGym_EmptyTask(SysTask *task, void *data); static void HearthomeGym_InitFog(HearthomeGymSystem *gymSystem); static void HearthomeGym_InitTrainers(HearthomeGymSystem *gymSystem); static void HearthomeGym_FreeTrainers(HearthomeGymSystem *gymSystem); static void HearthomeGym_EmptyTrainerTask(SysTask *task, void *data); +static BOOL FieldTask_CanalaveGym_MovePlatformUpDown(FieldTask *taskMan); +static BOOL FieldTask_CanalaveGym_MovePlatformEastWest(FieldTask *taskMan); +static BOOL FieldTask_CanalaveGym_MovePlatformNorthSouth(FieldTask *taskMan); + +static BOOL FieldTask_SunyshoreGym_RotateGears(FieldTask *task); + static u8 CanalaveGym_CheckIfPlatformInPositionB(const u8 index, const int platformStates) { u8 isInPositionB = platformStates >> index & 1; @@ -398,8 +427,8 @@ void PastoriaGym_PressButton(FieldSystem *fieldSystem) pastoria_gym_orange_button_nsbmd }; - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerY = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerY = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); TerrainCollisionHitbox_Init(playerX, playerY, 0, 0, 1, 1, &terrainCollision); @@ -749,7 +778,7 @@ void HearthomeGym_MoveLift(FieldSystem *fieldSystem) HearthomeGymPersistedFeatureDP *features = PersistedMapFeatures_GetBuffer(mapFeatures, DYNAMIC_MAP_FEATURES_HEARTHOME_GYM); VecFx32 currentPosition; - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, ¤tPosition); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, ¤tPosition); if (currentPosition.y == HEARTHOME_DP_LIFT_HEIGHT_DOWN) { FieldTask_InitCall(fieldSystem->task, HearthomeGymDP_RaiseLift, movementState); @@ -1199,7 +1228,7 @@ static void CanalaveGym_UpdatePlatformsVisibility(const CanalaveGymSystem *gymSy static u8 CanalaveGym_GetPlaformPlayerIsOn(CanalaveGymSystem *gymSystem) { VecFx32 playerPos; - PlayerAvatar_PosVectorOut(gymSystem->fieldSystem->playerAvatar, &playerPos); + PlayerAvatar_GetPosPtr(gymSystem->fieldSystem->playerAvatar, &playerPos); u8 playerY = playerPos.y / MAP_OBJECT_TILE_SIZE; u8 playerX = playerPos.x / MAP_OBJECT_TILE_SIZE; @@ -1364,7 +1393,7 @@ static BOOL FieldTask_CanalaveGym_MovePlatformEastWest(FieldTask *taskMan) FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); int *state = FieldTask_GetEnv(taskMan); CanalaveGymSystem *gymSystem = fieldSystem->unk_04->dynamicMapFeaturesData; - MapObject *playerObj = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); switch (*state) { case 0: @@ -1381,7 +1410,7 @@ static BOOL FieldTask_CanalaveGym_MovePlatformEastWest(FieldTask *taskMan) VecFx32 platformPos, playerPos; platformPos = MapProp_GetPosition(platformProp); - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &playerPos); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &playerPos); platformPos.x = playerPos.x; if (gymSystem->movementDir == CANALAVE_PLATFORM_MOVE_EAST) { @@ -1437,7 +1466,7 @@ static BOOL FieldTask_CanalaveGym_MovePlatformNorthSouth(FieldTask *taskMan) FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); int *state = FieldTask_GetEnv(taskMan); CanalaveGymSystem *gymSystem = fieldSystem->unk_04->dynamicMapFeaturesData; - MapObject *playerObj = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); switch (*state) { case 0: @@ -1454,7 +1483,7 @@ static BOOL FieldTask_CanalaveGym_MovePlatformNorthSouth(FieldTask *taskMan) VecFx32 platformPos, playerPos; platformPos = MapProp_GetPosition(platformProp); - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &playerPos); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &playerPos); platformPos.z = playerPos.z; if (gymSystem->movementDir == CANALAVE_PLATFORM_MOVE_SOUTH) { @@ -1492,7 +1521,7 @@ static BOOL FieldTask_CanalaveGym_MovePlatformNorthSouth(FieldTask *taskMan) } break; case 3: { - MapObject *playerObj = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(playerObj) == TRUE) { sub_020656AC(playerObj); @@ -1556,7 +1585,7 @@ void CanalaveGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem) } VecFx32 playerPos; - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &playerPos); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &playerPos); CanalaveGym_UpdateVisibleProps(gymSystem, playerPos.y); Camera_SetClipping(FX32_CONST(100), FX32_CONST(1700), fieldSystem->camera); @@ -2527,8 +2556,8 @@ BOOL EternaGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, const static void EternaGym_SetupCameraMoveAwayFromPlayer(FieldSystem *fieldSystem, EternaGymCameraManager *cameraMan, int destX, int destZ) { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); cameraMan->startX = playerX; cameraMan->startZ = playerZ; @@ -2631,7 +2660,7 @@ static void EternaGym_SetupCameraMoveToNewPosition(EternaGymCameraManager *camer static void EternaGym_FreeCameraObject(FieldSystem *fieldSystem, EternaGymCameraManager *cameraMan) { - const VecFx32 *playerPos = PlayerAvatar_PosVector(fieldSystem->playerAvatar); + const VecFx32 *playerPos = PlayerAvatar_GetPos(fieldSystem->playerAvatar); LandDataManager_TrackTarget(playerPos, fieldSystem->landDataMan); Camera_TrackTarget(playerPos, fieldSystem->camera); @@ -2852,8 +2881,8 @@ static BOOL FieldTask_EternaGym_AdvanceClockState(FieldTask *task) clockMan->state++; case 12: if (JOY_NEW(PAD_BUTTON_A | PAD_BUTTON_B)) { - int playerX = Player_GetXPos(fieldSystem->playerAvatar); - int playerY = Player_GetZPos(fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerY = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); EternaGym_SetupCameraMoveFromLastPosition(&clockMan->cameraMan, playerX, playerY); Window_EraseMessageBox(clockMan->window, FALSE); @@ -2915,73 +2944,112 @@ BOOL EternaGym_IsHourHandJumpTile(FieldSystem *fieldSystem, int tileX, int tileZ return FALSE; } -static const UnkStruct_ov8_0224C90C Unk_ov8_0224C90C[9] = { - { 0x3, 0xC }, - { 0x4, 0x18 }, - { 0x8, 0x9 }, - { 0x8, 0x16 }, - { 0xF, 0x1C }, - { 0x10, 0xC }, - { 0x14, 0x13 }, - { 0x15, 0x1A }, - { 0x17, 0xD } +static const CoordinatesInt sPunchingBagPositions[VEILSTONE_NUM_PUNCHING_BAGS] = { + { .x = 3, .z = 12 }, + { .x = 4, .z = 24 }, + { .x = 8, .z = 9 }, + { .x = 8, .z = 22 }, + { .x = 15, .z = 28 }, + { .x = 16, .z = 12 }, + { .x = 20, .z = 19 }, + { .x = 21, .z = 26 }, + { .x = 23, .z = 13 } }; -static const UnkStruct_ov8_0224C90C Unk_ov8_0224C99C[11] = { - { 0x3, 0x17 }, - { 0x8, 0xC }, - { 0x8, 0xE }, - { 0x8, 0x10 }, - { 0xC, 0x9 }, - { 0xC, 0xC }, - { 0x13, 0xC }, - { 0x14, 0xD }, - { 0x14, 0x1C }, - { 0x16, 0x9 }, - { 0x17, 0x1E } +static const CoordinatesInt sTireStackPositions[VEILSTONE_NUM_TIRE_STACKS] = { + { .x = 3, .z = 23 }, + { .x = 8, .z = 12 }, + { .x = 8, .z = 14 }, + { .x = 8, .z = 16 }, + { .x = 12, .z = 9 }, + { .x = 12, .z = 12 }, + { .x = 19, .z = 12 }, + { .x = 20, .z = 13 }, + { .x = 20, .z = 28 }, + { .x = 22, .z = 9 }, + { .x = 23, .z = 30 } }; -static __attribute__((aligned(4))) const u8 Unk_ov8_0224E33C[1024] = { - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +// clang-format off +// These values determine how punching bags behave at each coordinate on the map +// 0 = Bag can be here, 1 = Bag can not be here +// 2 = Bag can not go north or south from here (unused) +// 3 = Bag can not go west or east from here +// 4 = Bag stops when passing through this position +// 5 = Bag can not go west from here +static const u8 sVeilstoneTileBehaviors[MAP_TILES_COUNT_X * MAP_TILES_COUNT_Z] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 5, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; +// clang-format on + +static const int sVeilstoneTravelDistanceRequiringCameraMovement[MAX_DIR] = { + [DIR_NORTH] = 3, + [DIR_SOUTH] = 4, + [DIR_WEST] = 4, + [DIR_EAST] = 4 }; -static const int Unk_ov8_0224C764[4] = { - 0x3, - 0x4, - 0x4, - 0x4 -}; - -static int (*const Unk_ov8_0224C818[11])(UnkStruct_ov8_0224C098 *); +static const VeilstoneGymAnimationStateFunc sVeilstoneGymBagAnimationStates[NUM_VEILSTONE_ANIM_STATE]; void VeilstoneGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem) { - PersistedMapFeatures *v0 = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); - UnkStruct_02071BF8 *v1 = PersistedMapFeatures_GetBuffer(v0, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM); - UnkStruct_ov8_0224B8D0 *v2 = Heap_Alloc(HEAP_ID_FIELD1, sizeof(UnkStruct_ov8_0224B8D0)); + PersistedMapFeatures *mapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); + VeilstoneGymPersistedFeature *feature = PersistedMapFeatures_GetBuffer(mapFeatures, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM); + VeilstoneGymSystem *gymSystem = Heap_Alloc(HEAP_ID_FIELD1, sizeof(VeilstoneGymSystem)); - memset(v2, 0, sizeof(UnkStruct_ov8_0224B8D0)); + memset(gymSystem, 0, sizeof(VeilstoneGymSystem)); - fieldSystem->unk_04->dynamicMapFeaturesData = v2; - v2->fieldSystem = fieldSystem; + fieldSystem->unk_04->dynamicMapFeaturesData = gymSystem; + gymSystem->fieldSystem = fieldSystem; - FieldEffectManager_InitRenderer(fieldSystem->fieldEffMan, 31); - ov5_021F42D8(fieldSystem->fieldEffMan, 11, 9); + FieldEffectManager_InitRenderer(fieldSystem->fieldEffMan, FIELD_EFFECT_RENDERER_VEILSTONE_GYM_OBJECTS); + VeilstoneGymObjectRenderer_InitContext(fieldSystem->fieldEffMan, VEILSTONE_NUM_TIRE_STACKS, VEILSTONE_NUM_PUNCHING_BAGS); - if (v1->unk_00 == 1) { - ov8_0224B958(v2); + if (feature->initialized == TRUE) { + VeilstoneGym_ReinitMapObjects(gymSystem); } else { - ov8_0224B8D0(v2); + VeilstoneGym_InitMapObjects(gymSystem); } - v1->unk_00 = 1; + feature->initialized = TRUE; } void VeilstoneGym_DynamicMapFeaturesFree(FieldSystem *fieldSystem) { - UnkStruct_ov8_0224B8D0 *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; + VeilstoneGymSystem *gymSystem = fieldSystem->unk_04->dynamicMapFeaturesData; - Heap_Free(v0); + Heap_Free(gymSystem); fieldSystem->unk_04->dynamicMapFeaturesData = NULL; } @@ -2990,662 +3058,629 @@ BOOL VeilstoneGym_DynamicMapFeaturesCheckCollision(FieldSystem *fieldSystem, con return FALSE; } -static MapObject *ov8_0224B7D8(FieldSystem *fieldSystem, int param1, int param2, int param3) +static MapObject *VeilstoneGym_CreateObject(FieldSystem *fieldSystem, int x, int z, BOOL isPunchingBag) { - MapObject *v0 = MapObjectMan_AddMapObject(fieldSystem->mapObjMan, param1, param2, 0, 0x2000, 0x0, fieldSystem->location->mapId); + MapObject *mapObj = MapObjectMan_AddMapObject(fieldSystem->mapObjMan, x, z, 0, OBJ_EVENT_GFX_INVISIBLE, MOVEMENT_TYPE_NONE, fieldSystem->location->mapId); - MapObject_SetLocalID(v0, 0xfd); - MapObject_SetDataAt(v0, param3, 0); + MapObject_SetLocalID(mapObj, VEILSTONE_GYM_OBJECT_LOCALID); + MapObject_SetDataAt(mapObj, isPunchingBag, 0); - return v0; + return mapObj; } -static void ov8_0224B80C(UnkStruct_ov8_0224B80C *param0, MapObject *param1, FieldSystem *fieldSystem) +static void VeilstoneGym_InitAnimManagerForObject(VeilstoneGymMapObjectManager *objMan, MapObject *mapObj, FieldSystem *fieldSystem) { - param0->unk_08 = param1; - param0->unk_00 = MapObject_GetX(param1); - param0->unk_04 = MapObject_GetZ(param1); + objMan->mapObj = mapObj; + objMan->x = MapObject_GetX(mapObj); + objMan->z = MapObject_GetZ(mapObj); - if (MapObject_GetDataAt(param1, 0) == 0) { - param0->unk_0C = ov5_021F4474(fieldSystem, param0->unk_00, param0->unk_04, 0); + if (VEILSTONE_OBJ_IS_TIRE_STACK(mapObj)) { + objMan->animManager = VeilstoneGymObjectRenderer_InitTireStackRenderer(fieldSystem, objMan->x, objMan->z, 0); } else { - param0->unk_0C = ov5_021F4668(fieldSystem, param0->unk_00, param0->unk_04, 0); + objMan->animManager = VeilstoneGymObjectRenderer_InitPunchingBagRenderer(fieldSystem, objMan->x, objMan->z, 0); } } -static UnkStruct_ov8_0224BCA8 *ov8_0224B854(UnkStruct_ov8_0224B8D0 *param0, int param1, int param2) +static VeilstoneGymPunchingBag *VeilstoneGym_GetPunchingBagAtPosition(VeilstoneGymSystem *gymSystem, int x, int z) { - int v0 = 0; - UnkStruct_ov8_0224BCA8 *v1 = param0->unk_10C; + int i = 0; + VeilstoneGymPunchingBag *punchingBag = gymSystem->punchingBags; do { - if ((v1->unk_08.unk_00 == param1) && (v1->unk_08.unk_04 == param2)) { - return v1; + if (punchingBag->obj.x == x && punchingBag->obj.z == z) { + return punchingBag; } - v1++; - v0++; - } while (v0 < 9); + punchingBag++; + i++; + } while (i < VEILSTONE_NUM_PUNCHING_BAGS); return NULL; } -static UnkStruct_ov8_0224B8A0 *ov8_0224B878(UnkStruct_ov8_0224B8D0 *param0, int param1, int param2) +static VeilstoneGymTireStack *VeilstoneGym_GetTireStackAtPosition(VeilstoneGymSystem *gymSystem, int x, int z) { - int v0 = 0; - UnkStruct_ov8_0224B8A0 *v1 = param0->unk_04; + int i = 0; + VeilstoneGymTireStack *tireStack = gymSystem->tireStacks; do { - if (v1->unk_00) { - if ((v1->unk_08.unk_00 == param1) && (v1->unk_08.unk_04 == param2)) { - return v1; + if (tireStack->exists) { + if (tireStack->obj.x == x && tireStack->obj.z == z) { + return tireStack; } } - v1++; - v0++; - } while (v0 < 11); + tireStack++; + i++; + } while (i < VEILSTONE_NUM_TIRE_STACKS); return NULL; } -static void ov8_0224B8A0(UnkStruct_ov8_0224B8A0 *param0) +static void VeilstoneGym_RemoveTireStack(VeilstoneGymTireStack *tireStack) { - GF_ASSERT(param0); - GF_ASSERT(param0->unk_08.unk_0C); - GF_ASSERT(param0->unk_08.unk_08); + GF_ASSERT(tireStack); + GF_ASSERT(tireStack->obj.animManager); + GF_ASSERT(tireStack->obj.mapObj); - OverworldAnimManager_Finish(param0->unk_08.unk_0C); - MapObject_Delete(param0->unk_08.unk_08); + OverworldAnimManager_Finish(tireStack->obj.animManager); + MapObject_Delete(tireStack->obj.mapObj); - param0->unk_00 = 0; + tireStack->exists = FALSE; } -static void ov8_0224B8D0(UnkStruct_ov8_0224B8D0 *param0) +static void VeilstoneGym_InitMapObjects(VeilstoneGymSystem *gymSystem) { - int v0; - MapObject *v1; - const UnkStruct_ov8_0224C90C *v2; - FieldSystem *fieldSystem = param0->fieldSystem; - UnkStruct_ov8_0224B8A0 *v4 = param0->unk_04; - UnkStruct_ov8_0224BCA8 *v5 = param0->unk_10C; + FieldSystem *fieldSystem = gymSystem->fieldSystem; + VeilstoneGymTireStack *tireStack = gymSystem->tireStacks; + VeilstoneGymPunchingBag *punchingBag = gymSystem->punchingBags; - memset((u8 *)v4, 0, sizeof(UnkStruct_ov8_0224B8A0) * 11); - memset((u8 *)v5, 0, sizeof(UnkStruct_ov8_0224BCA8) * 9); + memset(tireStack, 0, sizeof(VeilstoneGymTireStack) * VEILSTONE_NUM_TIRE_STACKS); + memset(punchingBag, 0, sizeof(VeilstoneGymPunchingBag) * VEILSTONE_NUM_PUNCHING_BAGS); - for (v0 = 0, v2 = Unk_ov8_0224C99C; v0 < 11; v0++, v2++, v4++) { - v1 = ov8_0224B7D8(fieldSystem, v2->unk_00 + 0, v2->unk_04 + -2, 0); - ov8_0224B80C(&v4->unk_08, v1, fieldSystem); - v4->unk_00 = 1; + int i; + const CoordinatesInt *pos; + for (i = 0, pos = sTireStackPositions; i < SNELEMS(sTireStackPositions); i++, pos++, tireStack++) { + MapObject *stackObj = VeilstoneGym_CreateObject(fieldSystem, pos->x, pos->z - 2, FALSE); + VeilstoneGym_InitAnimManagerForObject(&tireStack->obj, stackObj, fieldSystem); + tireStack->exists = TRUE; } - for (v0 = 0, v2 = Unk_ov8_0224C90C; v0 < 9; v0++, v2++, v5++) { - v1 = ov8_0224B7D8(fieldSystem, v2->unk_00 + 0, v2->unk_04 + -2, 1); - ov8_0224B80C(&v5->unk_08, v1, fieldSystem); - v5->unk_00 = 1; + for (i = 0, pos = sPunchingBagPositions; i < SNELEMS(sPunchingBagPositions); i++, pos++, punchingBag++) { + MapObject *bagObj = VeilstoneGym_CreateObject(fieldSystem, pos->x, pos->z - 2, TRUE); + VeilstoneGym_InitAnimManagerForObject(&punchingBag->obj, bagObj, fieldSystem); + punchingBag->exists = TRUE; } } -static void ov8_0224B958(UnkStruct_ov8_0224B8D0 *param0) +static void VeilstoneGym_ReinitMapObjects(VeilstoneGymSystem *gymSystem) { - int v0 = 0, v1 = 0; - MapObject *v2; - FieldSystem *fieldSystem = param0->fieldSystem; + int objIndex = 0, numObjInited = 0; + MapObject *mapObj; + FieldSystem *fieldSystem = gymSystem->fieldSystem; MapObjectManager *mapObjMan = fieldSystem->mapObjMan; - UnkStruct_ov8_0224B8A0 *v5 = param0->unk_04; - UnkStruct_ov8_0224BCA8 *v6 = param0->unk_10C; + VeilstoneGymTireStack *tireStack = gymSystem->tireStacks; + VeilstoneGymPunchingBag *punchingBag = gymSystem->punchingBags; - while (MapObjectMan_FindObjectWithStatus(mapObjMan, &v2, &v0, 1 << 0) == 1) { - if (MapObject_GetLocalID(v2) == 0xfd) { - if (MapObject_GetDataAt(v2, 0) == 0) { - ov8_0224B80C(&v5->unk_08, v2, fieldSystem); - v5->unk_00 = 1; - v5++; + while (MapObjectMan_FindObjectWithStatus(mapObjMan, &mapObj, &objIndex, MAP_OBJ_STATUS_0) == TRUE) { + if (MapObject_GetLocalID(mapObj) == VEILSTONE_GYM_OBJECT_LOCALID) { + if (VEILSTONE_OBJ_IS_TIRE_STACK(mapObj)) { + VeilstoneGym_InitAnimManagerForObject(&tireStack->obj, mapObj, fieldSystem); + tireStack->exists = TRUE; + tireStack++; } else { - ov8_0224B80C(&v6->unk_08, v2, fieldSystem); - v6->unk_00 = 1; - v6++; + VeilstoneGym_InitAnimManagerForObject(&punchingBag->obj, mapObj, fieldSystem); + punchingBag->exists = TRUE; + punchingBag++; } - v1++; - GF_ASSERT(v1 <= (11 + 9)); + numObjInited++; + GF_ASSERT(numObjInited <= VEILSTONE_NUM_TIRE_STACKS + VEILSTONE_NUM_PUNCHING_BAGS); } } } -static int ov8_0224B9D8(int param0, int param1) +static int VeilstoneGym_GetTileBehavior(int x, int z) { - GF_ASSERT(param0 >= 0); - GF_ASSERT(param0 < 32); - GF_ASSERT(param1 >= 0); - GF_ASSERT(param1 < 32); + GF_ASSERT(x >= 0); + GF_ASSERT(x < MAP_TILES_COUNT_X); + GF_ASSERT(z >= 0); + GF_ASSERT(z < MAP_TILES_COUNT_Z); - { - int v0 = Unk_ov8_0224E33C[param0 + (param1 * 32)]; - return v0; - } + return sVeilstoneTileBehaviors[x + (z * MAP_TILES_COUNT_X)]; } -static u32 ov8_0224BA0C(UnkStruct_ov8_0224B8D0 *param0, int param1, int param2, int param3) +static u32 VeilstoneGym_GetTileFlags(VeilstoneGymSystem *gymSystem, int x, int z, int direction) { - u32 v0 = 0; - int v1, v2; + u32 flags = 0; - v1 = ov8_0224B9D8(param1, param2); - - switch (v1) { + switch (VeilstoneGym_GetTileBehavior(x, z)) { case 4: - v0 |= (1 << 2); + flags |= VEILSTONE_TILE_FLAG_BAG_PAUSE_POINT; break; case 2: - if ((param3 == 0) || (param3 == 1)) { - v0 |= (1 << 0); + if (direction == DIR_NORTH || direction == DIR_SOUTH) { + flags |= VEILSTONE_TILE_FLAG_BAG_CANT_MOVE_THAT_WAY; } break; case 3: - if ((param3 == 2) || (param3 == 3)) { - v0 |= (1 << 0); + if (direction == DIR_WEST || direction == DIR_EAST) { + flags |= VEILSTONE_TILE_FLAG_BAG_CANT_MOVE_THAT_WAY; } break; case 5: - if (param3 == 2) { - v0 |= (1 << 0); + if (direction == DIR_WEST) { + flags |= VEILSTONE_TILE_FLAG_BAG_CANT_MOVE_THAT_WAY; } break; } - param1 += MapObject_GetDxFromDir(param3); - param2 += MapObject_GetDzFromDir(param3); + x += MapObject_GetDxFromDir(direction); + z += MapObject_GetDzFromDir(direction); - v2 = ov8_0224B9D8(param1, param2); - - if (v2 == 1) { - v0 |= (1 << 0); + if (VeilstoneGym_GetTileBehavior(x, z) == 1) { + flags |= VEILSTONE_TILE_FLAG_BAG_CANT_MOVE_THAT_WAY; } - if (ov8_0224B878(param0, param1, param2) != NULL) { - v0 |= (1 << 1); + if (VeilstoneGym_GetTireStackAtPosition(gymSystem, x, z) != NULL) { + flags |= VEILSTONE_TILE_FLAG_TIRE_STACK_PRESENT; } - return v0; + return flags; } -static u32 ov8_0224BAA0(UnkStruct_ov8_0224B8D0 *param0, int param1, int param2, int param3, int *param4) +static u32 VeilstoneGym_CalculateDistanceBagWillTravel(VeilstoneGymSystem *gymSystem, int x, int z, int direction, int *bagTravelDistance) { - u32 v0; + *bagTravelDistance = 0; + u32 flags = VeilstoneGym_GetTileFlags(gymSystem, x, z, direction); - *param4 = 0; - v0 = ov8_0224BA0C(param0, param1, param2, param3); - - if ((v0 != 0) && (v0 != (1 << 2))) { - return v0; + if (flags != 0 && flags != VEILSTONE_TILE_FLAG_BAG_PAUSE_POINT) { + return flags; } do { - param1 += MapObject_GetDxFromDir(param3); - param2 += MapObject_GetDzFromDir(param3); - (*param4)++; - v0 = ov8_0224BA0C(param0, param1, param2, param3); - } while (v0 == 0); + x += MapObject_GetDxFromDir(direction); + z += MapObject_GetDzFromDir(direction); + (*bagTravelDistance)++; + flags = VeilstoneGym_GetTileFlags(gymSystem, x, z, direction); + } while (flags == 0); - return v0; + return flags; } -static BOOL ov8_0224BAF4(FieldTask *taskMan) +static BOOL FieldTask_VeilstoneGym_HitPunchingBagNoMovement(FieldTask *taskMan) { - MapObject *v0; FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); - UnkStruct_ov8_0224C098 *v2 = FieldTask_GetEnv(taskMan); - UnkStruct_ov8_0224B8D0 *v3 = v2->unk_3C; + VeilstoneGym_BagAnimation *bagAnim = FieldTask_GetEnv(taskMan); - v0 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); - switch (v2->unk_00) { + switch (bagAnim->state) { case 0: - if (LocalMapObj_IsAnimationSet(v0) == 1) { - LocalMapObj_SetAnimationCode(v0, MovementAction_TurnActionTowardsDir(v2->unk_08, MOVEMENT_ACTION_WALK_ON_SPOT_FASTER_NORTH)); - ov5_021F4698(v2->unk_34->unk_08.unk_0C, v2->unk_08, 0); + if (LocalMapObj_IsAnimationSet(playerObj) == TRUE) { + LocalMapObj_SetAnimationCode(playerObj, MovementAction_TurnActionTowardsDir(bagAnim->direction, MOVEMENT_ACTION_WALK_ON_SPOT_FASTER_NORTH)); + VeilstoneGymObjectRenderer_StartPunchingBagAnimation(bagAnim->punchingBag->obj.animManager, bagAnim->direction, FALSE); Sound_PlayEffect(SEQ_SE_PL_SUTYA2); - v2->unk_00++; + bagAnim->state++; } break; case 1: - if ((LocalMapObj_CheckAnimationFinished(v0) == 1) && (ov5_021F4720(v2->unk_34->unk_08.unk_0C) == 1)) { - sub_020656AC(v0); - Heap_Free(v2); - return 1; + if (LocalMapObj_CheckAnimationFinished(playerObj) == TRUE && VeilstoneGymObjectRenderer_IsPunchingBagAnimFinished(bagAnim->punchingBag->obj.animManager) == TRUE) { + sub_020656AC(playerObj); + Heap_Free(bagAnim); + return TRUE; } } - return 0; + return FALSE; } -static BOOL ov8_0224BB78(FieldTask *taskMan) +static BOOL FieldTask_VeilstoneGym_HitPunchingBag(FieldTask *taskMan) { - int v0; - UnkStruct_ov8_0224C098 *v1 = FieldTask_GetEnv(taskMan); + int stateResult = 0; + VeilstoneGym_BagAnimation *bagAnim = FieldTask_GetEnv(taskMan); do { - v0 = Unk_ov8_0224C818[v1->unk_00](v1); - } while (v0 == 1); + stateResult = sVeilstoneGymBagAnimationStates[bagAnim->state](bagAnim); + } while (stateResult == VEILSTONE_STATE_RESULT_CONTINUE); - if (v0 == 2) { - return 1; + if (stateResult == VEILSTONE_STATE_RESULT_FINISH) { + return TRUE; } - return 0; + return FALSE; } -static int ov8_0224BBA0(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_Init(VeilstoneGym_BagAnimation *bagAnim) { - u32 v0; - UnkStruct_ov8_0224B80C *v1 = ¶m0->unk_34->unk_08; - int v2 = v1->unk_00; - int v3 = v1->unk_04; + VeilstoneGymMapObjectManager *obj = &bagAnim->punchingBag->obj; + int x = obj->x; + int z = obj->z; - ov8_0224BAA0(param0->unk_3C, v2, v3, param0->unk_08, ¶m0->unk_1C); - OverworldAnimManager_GetPosition(v1->unk_0C, ¶m0->unk_20); + VeilstoneGym_CalculateDistanceBagWillTravel(bagAnim->gymSystem, x, z, bagAnim->direction, &bagAnim->distanceToTravel); + OverworldAnimManager_GetPosition(obj->animManager, &bagAnim->bagPosition); - param0->unk_2C = ((FX32_ONE / 2) / 30); - param0->unk_00 = 1; + bagAnim->movingSpeed = FX32_ONE / 60; + bagAnim->state = VEILSTONE_ANIM_STATE_KICK_BAG; - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BBD0(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_KickBag(VeilstoneGym_BagAnimation *bagAnim) { - MapObject *v0 = Player_MapObject(param0->unk_3C->fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(bagAnim->gymSystem->fieldSystem->playerAvatar); - if (LocalMapObj_IsAnimationSet(v0) == 0) { - return 0; + if (!LocalMapObj_IsAnimationSet(playerObj)) { + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } - LocalMapObj_SetAnimationCode(v0, MovementAction_TurnActionTowardsDir(param0->unk_08, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH)); + LocalMapObj_SetAnimationCode(playerObj, MovementAction_TurnActionTowardsDir(bagAnim->direction, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH)); - { - UnkStruct_ov8_0224BCA8 *v1 = param0->unk_34; - OverworldAnimManager *v2 = v1->unk_08.unk_0C; + VeilstoneGymPunchingBag *punchingBag = bagAnim->punchingBag; + OverworldAnimManager *animManager = punchingBag->obj.animManager; - ov5_021F4698(v2, param0->unk_08, 1); + VeilstoneGymObjectRenderer_StartPunchingBagAnimation(animManager, bagAnim->direction, TRUE); - if (ov8_0224C0C8(param0, &v1->unk_08, param0->unk_08) == 1) { - param0->unk_18 = 1; - ov8_0224BFCC(param0->unk_3C->fieldSystem, param0, &v1->unk_08, param0->unk_08); - ov8_0224C0FC(param0, 0); - } + if (VeilstoneGym_CheckIfCameraNeedsToMove(bagAnim, &punchingBag->obj, bagAnim->direction) == TRUE) { + bagAnim->moveCamera = TRUE; + VeilstoneGym_InitCameraManager(bagAnim->gymSystem->fieldSystem, bagAnim, &punchingBag->obj, bagAnim->direction); + VeilstoneGym_PrepareForCameraMovement(bagAnim, FALSE); } Sound_PlayEffect(SEQ_SE_PL_SUTYA2); - param0->unk_00 = 2; - return 1; + bagAnim->state = VEILSTONE_ANIM_STATE_START_MOVEMENT; + return VEILSTONE_STATE_RESULT_CONTINUE; } -static int ov8_0224BC48(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_StartMovement(VeilstoneGym_BagAnimation *bagAnim) { - VecFx32_StepDirection(param0->unk_08, ¶m0->unk_20, param0->unk_2C); - OverworldAnimManager_SetPosition(param0->unk_34->unk_08.unk_0C, ¶m0->unk_20); + VecFx32_StepDirection(bagAnim->direction, &bagAnim->bagPosition, bagAnim->movingSpeed); + OverworldAnimManager_SetPosition(bagAnim->punchingBag->obj.animManager, &bagAnim->bagPosition); - param0->unk_2C += ((FX32_ONE / 2) / 30); - param0->unk_30 += param0->unk_2C; - param0->unk_04++; + bagAnim->movingSpeed += FX32_ONE / 60; + bagAnim->traveledDistance += bagAnim->movingSpeed; + bagAnim->elapsedFrames++; - if (param0->unk_04 >= 30) { - fx32 v0 = (FX32_ONE * (43 - 30)); + if (bagAnim->elapsedFrames >= 30) { + fx32 frameDelta = FX32_CONST(13); - v0 /= param0->unk_1C * 16 / 2; - ov5_021F4714(param0->unk_34->unk_08.unk_0C, v0); - param0->unk_00 = 3; + frameDelta /= bagAnim->distanceToTravel * 16 / 2; + VeilstoneGymObjectRenderer_UpdateBagFrameDelta(bagAnim->punchingBag->obj.animManager, frameDelta); + bagAnim->state = VEILSTONE_ANIM_STATE_MOVE_BAG; Sound_PlayEffect(SEQ_SE_PL_GYM01); } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BCA8(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_MovePunchingBag(VeilstoneGym_BagAnimation *bagAnim) { - UnkStruct_ov8_0224BCA8 *v0 = param0->unk_34; + VeilstoneGymPunchingBag *punchingBag = bagAnim->punchingBag; - VecFx32_StepDirection(param0->unk_08, ¶m0->unk_20, param0->unk_2C); - OverworldAnimManager_SetPosition(v0->unk_08.unk_0C, ¶m0->unk_20); + VecFx32_StepDirection(bagAnim->direction, &bagAnim->bagPosition, bagAnim->movingSpeed); + OverworldAnimManager_SetPosition(punchingBag->obj.animManager, &bagAnim->bagPosition); - param0->unk_30 += param0->unk_2C; - param0->unk_04++; + bagAnim->traveledDistance += bagAnim->movingSpeed; + bagAnim->elapsedFrames++; - if (param0->unk_04 < 36) { - if (param0->unk_2C < FX32_ONE) { - param0->unk_2C += param0->unk_2C; + if (bagAnim->elapsedFrames < 36) { + if (bagAnim->movingSpeed < FX32_ONE) { + bagAnim->movingSpeed += bagAnim->movingSpeed; } - } else if (param0->unk_04 == 36) { - if (param0->unk_2C <= (FX32_ONE * 2)) { - param0->unk_2C = FX32_ONE * 2; + } else if (bagAnim->elapsedFrames == 36) { + if (bagAnim->movingSpeed <= FX32_CONST(2)) { + bagAnim->movingSpeed = FX32_CONST(2); } } - ov8_0224C170(param0, param0->unk_2C); + VeilstoneGym_UpdateCamera(bagAnim, bagAnim->movingSpeed); - if ((((param0->unk_30) >> 4) / FX32_ONE) > param0->unk_14) { - u32 v1; + if ((bagAnim->traveledDistance >> 4) / FX32_ONE > bagAnim->traveledCoordinates) { + bagAnim->traveledCoordinates = (bagAnim->traveledDistance >> 4) / FX32_ONE; - param0->unk_14 = (((param0->unk_30) >> 4) / FX32_ONE); + punchingBag->obj.x += MapObject_GetDxFromDir(bagAnim->direction); + punchingBag->obj.z += MapObject_GetDzFromDir(bagAnim->direction); - v0->unk_08.unk_00 += MapObject_GetDxFromDir(param0->unk_08); - v0->unk_08.unk_04 += MapObject_GetDzFromDir(param0->unk_08); + u32 tileFlags = VeilstoneGym_GetTileFlags(bagAnim->gymSystem, punchingBag->obj.x, punchingBag->obj.z, bagAnim->direction); - v1 = ov8_0224BA0C(param0->unk_3C, v0->unk_08.unk_00, v0->unk_08.unk_04, param0->unk_08); - - if (v1 == 0) { - (void)0; - } else { - VecFx32_SetPosFromMapCoords(v0->unk_08.unk_00, v0->unk_08.unk_04, ¶m0->unk_20); - MapObject_SetX(v0->unk_08.unk_08, v0->unk_08.unk_00); - MapObject_SetZ(v0->unk_08.unk_08, v0->unk_08.unk_04); - MapObject_UpdateCoords(v0->unk_08.unk_08); - ov5_021F4714(v0->unk_08.unk_0C, FX32_ONE); - Sound_StopEffect(1356, 0); + if (tileFlags != 0) { + VecFx32_SetPosFromMapCoords(punchingBag->obj.x, punchingBag->obj.z, &bagAnim->bagPosition); + MapObject_SetX(punchingBag->obj.mapObj, punchingBag->obj.x); + MapObject_SetZ(punchingBag->obj.mapObj, punchingBag->obj.z); + MapObject_UpdateCoords(punchingBag->obj.mapObj); + VeilstoneGymObjectRenderer_UpdateBagFrameDelta(punchingBag->obj.animManager, FX32_ONE); + Sound_StopEffect(SEQ_SE_PL_GYM01, 0); Sound_PlayEffect(SEQ_SE_PL_SUTYA2); Sound_PlayEffect(SEQ_SE_PL_GYM02); - if ((v1 & (1 << 1)) == 0) { - if (param0->unk_18 == 1) { - param0->unk_00 = 6; + if (!(tileFlags & VEILSTONE_TILE_FLAG_TIRE_STACK_PRESENT)) { + if (bagAnim->moveCamera == TRUE) { + bagAnim->state = VEILSTONE_ANIM_STATE_PREP_CAMERA_TO_PLAYER; } else { - param0->unk_00 = 8; + bagAnim->state = VEILSTONE_ANIM_STATE_FINISH_BAG_ANIMATION; } } else { - param0->unk_38 = ov8_0224B878(param0->unk_3C, v0->unk_08.unk_00 + MapObject_GetDxFromDir(param0->unk_08), v0->unk_08.unk_04 + MapObject_GetDzFromDir(param0->unk_08)); - GF_ASSERT(param0->unk_38 != NULL); - param0->unk_04 = 0; - param0->unk_00 = 4; + bagAnim->tireStack = VeilstoneGym_GetTireStackAtPosition(bagAnim->gymSystem, punchingBag->obj.x + MapObject_GetDxFromDir(bagAnim->direction), punchingBag->obj.z + MapObject_GetDzFromDir(bagAnim->direction)); + GF_ASSERT(bagAnim->tireStack != NULL); + bagAnim->elapsedFrames = 0; + bagAnim->state = VEILSTONE_ANIM_STATE_TOPPLE_STACK; } } } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BDD0(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_ToppleTireStack(VeilstoneGym_BagAnimation *bagAnim) { - ov8_0224C170(param0, param0->unk_2C); - param0->unk_04++; + VeilstoneGym_UpdateCamera(bagAnim, bagAnim->movingSpeed); + bagAnim->elapsedFrames++; - if (param0->unk_04 >= 4) { - param0->unk_04 = 0; - param0->unk_00 = 5; - ov5_021F44A4(param0->unk_38->unk_08.unk_0C); + if (bagAnim->elapsedFrames >= 4) { + bagAnim->elapsedFrames = 0; + bagAnim->state = VEILSTONE_ANIM_STATE_REMOVE_STACK; + VeilstoneGymObjectRenderer_PlayToppleTireStackAnim(bagAnim->tireStack->obj.animManager); Sound_PlayEffect(SEQ_SE_DP_UG_026); } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BE04(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_RemoveTireStack(VeilstoneGym_BagAnimation *bagAnim) { - ov8_0224C170(param0, param0->unk_2C); + VeilstoneGym_UpdateCamera(bagAnim, bagAnim->movingSpeed); - if (ov5_021F453C(param0->unk_38->unk_08.unk_0C)) { - ov8_0224B8A0(param0->unk_38); - param0->unk_04 = 0; + if (VeilstoneGymObjectRenderer_IsTireStackAnimationFinished(bagAnim->tireStack->obj.animManager)) { + VeilstoneGym_RemoveTireStack(bagAnim->tireStack); + bagAnim->elapsedFrames = 0; - if (param0->unk_18 == 1) { - param0->unk_00 = 6; + if (bagAnim->moveCamera == TRUE) { + bagAnim->state = VEILSTONE_ANIM_STATE_PREP_CAMERA_TO_PLAYER; } else { - param0->unk_00 = 8; + bagAnim->state = VEILSTONE_ANIM_STATE_FINISH_BAG_ANIMATION; } } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BE38(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_PrepCameraReturnToPlayer(VeilstoneGym_BagAnimation *bagAnim) { - ov8_0224C170(param0, param0->unk_2C); + VeilstoneGym_UpdateCamera(bagAnim, bagAnim->movingSpeed); - if ((ov8_0224C0C4(param0) == 1) && (ov5_021F4720(param0->unk_34->unk_08.unk_0C) == 1)) { - ov8_0224C0FC(param0, 1); - param0->unk_00 = 7; + if (VeilstoneGym_CheckIfCameraMovementFinished(bagAnim) == TRUE && VeilstoneGymObjectRenderer_IsPunchingBagAnimFinished(bagAnim->punchingBag->obj.animManager) == TRUE) { + VeilstoneGym_PrepareForCameraMovement(bagAnim, TRUE); + bagAnim->state = VEILSTONE_ANIM_STATE_CAMERA_TO_PLAYER; } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BE68(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_MoveCameraToPlayer(VeilstoneGym_BagAnimation *bagAnim) { - ov8_0224C11C(param0, 0x10); + VeilstoneGym_MoveCamera(bagAnim, MOVEMENT_ACTION_WALK_FAST_NORTH); - if (ov8_0224C0C4(param0) == 1) { - ov8_0224C098(param0); - param0->unk_00 = 9; + if (VeilstoneGym_CheckIfCameraMovementFinished(bagAnim) == TRUE) { + VeilStoneGym_ReturnCameraFocusToPlayer(bagAnim); + bagAnim->state = VEILSTONE_ANIM_STATE_WAIT_FINISH; } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BE8C(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_FinishBagAnimation(VeilstoneGym_BagAnimation *bagAnim) { - if (ov5_021F4720(param0->unk_34->unk_08.unk_0C) == 1) { - param0->unk_00 = 9; + if (VeilstoneGymObjectRenderer_IsPunchingBagAnimFinished(bagAnim->punchingBag->obj.animManager) == TRUE) { + bagAnim->state = VEILSTONE_ANIM_STATE_WAIT_FINISH; } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BEA4(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_WaitForAnimationFinished(VeilstoneGym_BagAnimation *bagAnim) { - MapObject *v0 = Player_MapObject(param0->unk_3C->fieldSystem->playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(bagAnim->gymSystem->fieldSystem->playerAvatar); - if (LocalMapObj_CheckAnimationFinished(v0) == 1) { - sub_020656AC(v0); - param0->unk_00 = 10; + if (LocalMapObj_CheckAnimationFinished(playerObj) == TRUE) { + sub_020656AC(playerObj); + bagAnim->state = VEILSTONE_ANIM_STATE_FREE; } - return 0; + return VEILSTONE_STATE_RESULT_ADVANCE_FRAME; } -static int ov8_0224BECC(UnkStruct_ov8_0224C098 *param0) +static int VeilstoneGym_AnimationState_Free(VeilstoneGym_BagAnimation *bagAnim) { - Heap_Free(param0); - return 2; + Heap_Free(bagAnim); + return VEILSTONE_STATE_RESULT_FINISH; } -static int (*const Unk_ov8_0224C818[11])(UnkStruct_ov8_0224C098 *) = { - ov8_0224BBA0, - ov8_0224BBD0, - ov8_0224BC48, - ov8_0224BCA8, - ov8_0224BDD0, - ov8_0224BE04, - ov8_0224BE38, - ov8_0224BE68, - ov8_0224BE8C, - ov8_0224BEA4, - ov8_0224BECC +static const VeilstoneGymAnimationStateFunc sVeilstoneGymBagAnimationStates[NUM_VEILSTONE_ANIM_STATE] = { + [VEILSTONE_ANIM_STATE_INIT] = VeilstoneGym_AnimationState_Init, + [VEILSTONE_ANIM_STATE_KICK_BAG] = VeilstoneGym_AnimationState_KickBag, + [VEILSTONE_ANIM_STATE_START_MOVEMENT] = VeilstoneGym_AnimationState_StartMovement, + [VEILSTONE_ANIM_STATE_MOVE_BAG] = VeilstoneGym_AnimationState_MovePunchingBag, + [VEILSTONE_ANIM_STATE_TOPPLE_STACK] = VeilstoneGym_AnimationState_ToppleTireStack, + [VEILSTONE_ANIM_STATE_REMOVE_STACK] = VeilstoneGym_AnimationState_RemoveTireStack, + [VEILSTONE_ANIM_STATE_PREP_CAMERA_TO_PLAYER] = VeilstoneGym_AnimationState_PrepCameraReturnToPlayer, + [VEILSTONE_ANIM_STATE_CAMERA_TO_PLAYER] = VeilstoneGym_AnimationState_MoveCameraToPlayer, + [VEILSTONE_ANIM_STATE_FINISH_BAG_ANIMATION] = VeilstoneGym_AnimationState_FinishBagAnimation, + [VEILSTONE_ANIM_STATE_WAIT_FINISH] = VeilstoneGym_AnimationState_WaitForAnimationFinished, + [VEILSTONE_ANIM_STATE_FREE] = VeilstoneGym_AnimationState_Free }; -static UnkStruct_ov8_0224C098 *ov8_0224BED8(UnkStruct_ov8_0224B8D0 *param0, UnkStruct_ov8_0224BCA8 *param1, int param2) +static VeilstoneGym_BagAnimation *VeilstoneGym_InitBagAnimation(VeilstoneGymSystem *gymSystem, VeilstoneGymPunchingBag *punchingBag, int direction) { - UnkStruct_ov8_0224C098 *v0 = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(UnkStruct_ov8_0224C098)); - GF_ASSERT(v0 != NULL); + VeilstoneGym_BagAnimation *bagAnim = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(VeilstoneGym_BagAnimation)); + GF_ASSERT(bagAnim != NULL); - memset(v0, 0, sizeof(UnkStruct_ov8_0224C098)); + memset(bagAnim, 0, sizeof(VeilstoneGym_BagAnimation)); - v0->unk_08 = param2; - v0->unk_0C = param1->unk_08.unk_00; - v0->unk_10 = param1->unk_08.unk_04; - v0->unk_34 = param1; - v0->unk_3C = param0; + bagAnim->direction = direction; + bagAnim->bagX = punchingBag->obj.x; + bagAnim->bagZ = punchingBag->obj.z; + bagAnim->punchingBag = punchingBag; + bagAnim->gymSystem = gymSystem; - return v0; + return bagAnim; } -static void ov8_0224BF0C(FieldSystem *fieldSystem, UnkStruct_ov8_0224B8D0 *param1, UnkStruct_ov8_0224BCA8 *param2, int param3) +static void VeilstoneGym_PlayBagNoMoveAnimation(FieldSystem *fieldSystem, VeilstoneGymSystem *gymSystem, VeilstoneGymPunchingBag *punchingBag, int direction) { - UnkStruct_ov8_0224C098 *v0 = ov8_0224BED8(param1, param2, param3); - FieldSystem_CreateTask(fieldSystem, ov8_0224BAF4, v0); + VeilstoneGym_BagAnimation *bagAnim = VeilstoneGym_InitBagAnimation(gymSystem, punchingBag, direction); + FieldSystem_CreateTask(fieldSystem, FieldTask_VeilstoneGym_HitPunchingBagNoMovement, bagAnim); } -static void ov8_0224BF2C(FieldSystem *fieldSystem, UnkStruct_ov8_0224B8D0 *param1, UnkStruct_ov8_0224BCA8 *param2, int param3) +static void VeilstoneGym_PlayBagMoveAnimation(FieldSystem *fieldSystem, VeilstoneGymSystem *gymSystem, VeilstoneGymPunchingBag *punchingBag, int direction) { - UnkStruct_ov8_0224C098 *v0 = ov8_0224BED8(param1, param2, param3); - FieldSystem_CreateTask(fieldSystem, ov8_0224BB78, v0); + VeilstoneGym_BagAnimation *bagAnim = VeilstoneGym_InitBagAnimation(gymSystem, punchingBag, direction); + FieldSystem_CreateTask(fieldSystem, FieldTask_VeilstoneGym_HitPunchingBag, bagAnim); } -BOOL ov8_0224BF4C(FieldSystem *fieldSystem) +BOOL VeilstoneGym_HitPunchingBag(FieldSystem *fieldSystem) { - PersistedMapFeatures *v0 = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); + PersistedMapFeatures *mapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); - if (PersistedMapFeatures_GetID(v0) != DYNAMIC_MAP_FEATURES_VEILSTONE_GYM) { - return 0; + if (PersistedMapFeatures_GetID(mapFeatures) != DYNAMIC_MAP_FEATURES_VEILSTONE_GYM) { + return FALSE; } - { - int v1, v2, v3; - UnkStruct_ov8_0224BCA8 *v4; - int v5 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); - UnkStruct_ov8_0224B8D0 *v6 = fieldSystem->unk_04->dynamicMapFeaturesData; + int x, z, bagTravelDistance; + int playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); + VeilstoneGymSystem *gymSystem = fieldSystem->unk_04->dynamicMapFeaturesData; - PlayerAvatar_MoveCoordsInDirection(fieldSystem->playerAvatar, v5, &v1, &v2); - v4 = ov8_0224B854(v6, v1, v2); + PlayerAvatar_MoveCoordsInDirection(fieldSystem->playerAvatar, playerDir, &x, &z); - if (v4 == NULL) { - return 0; - } - - ov8_0224BAA0(v6, v1, v2, v5, &v3); - - if (v3 == 0) { - ov8_0224BF0C(fieldSystem, v6, v4, v5); - } else { - ov8_0224BF2C(fieldSystem, v6, v4, v5); - } + VeilstoneGymPunchingBag *punchingBag = VeilstoneGym_GetPunchingBagAtPosition(gymSystem, x, z); + if (punchingBag == NULL) { + return FALSE; } - return 1; -} + VeilstoneGym_CalculateDistanceBagWillTravel(gymSystem, x, z, playerDir, &bagTravelDistance); -static void ov8_0224BFCC(FieldSystem *fieldSystem, UnkStruct_ov8_0224C098 *param1, UnkStruct_ov8_0224B80C *param2, int param3) -{ - int v0, v1; - const VecFx32 *v2; - UnkStruct_ov8_0224C0C4 *v3 = ¶m1->unk_40; - memset(v3, 0, sizeof(UnkStruct_ov8_0224C0C4)); - v3->fieldSystem = fieldSystem; - - v0 = param2->unk_00; - v1 = param2->unk_04; - - v3->unk_08 = v0; - v3->unk_0C = v1; - v3->unk_20 = param3; - - ov8_0224BAA0(param1->unk_3C, v0, v1, param3, &v3->unk_24); - GF_ASSERT(v3->unk_24); - - v3->unk_18 = v0 + (MapObject_GetDxFromDir(param3) * v3->unk_24); - v3->unk_1C = v1 + (MapObject_GetDzFromDir(param3) * v3->unk_24); - - v0 = Player_GetXPos(fieldSystem->playerAvatar); - v1 = Player_GetZPos(fieldSystem->playerAvatar); - - v3->unk_10 = v0; - v3->unk_14 = v1; - v3->unk_30 = MapObjectMan_AddMapObject(fieldSystem->mapObjMan, v0, v1, 0, 0x2000, 0x0, fieldSystem->location->mapId); - - MapObject_RecalculateObjectHeight(v3->unk_30); - MapObject_SetHidden(v3->unk_30, 1); - sub_02062D80(v3->unk_30, 0); - MapObject_SetHeightCalculationDisabled(v3->unk_30, TRUE); - - v2 = MapObject_GetPos(v3->unk_30); - - LandDataManager_TrackTarget(v2, fieldSystem->landDataMan); - Camera_TrackTarget(v2, fieldSystem->camera); -} - -static void ov8_0224C098(UnkStruct_ov8_0224C098 *param0) -{ - UnkStruct_ov8_0224C0C4 *v0 = ¶m0->unk_40; - const VecFx32 *v1 = PlayerAvatar_PosVector(v0->fieldSystem->playerAvatar); - - LandDataManager_TrackTarget(v1, v0->fieldSystem->landDataMan); - Camera_TrackTarget(v1, v0->fieldSystem->camera); - MapObject_Delete(v0->unk_30); -} - -static BOOL ov8_0224C0C4(UnkStruct_ov8_0224C098 *param0) -{ - UnkStruct_ov8_0224C0C4 *v0 = ¶m0->unk_40; - return v0->unk_2C; -} - -static BOOL ov8_0224C0C8(UnkStruct_ov8_0224C098 *param0, UnkStruct_ov8_0224B80C *param1, int param2) -{ - int v0; - int v1 = param1->unk_00; - int v2 = param1->unk_04; - - ov8_0224BAA0(param0->unk_3C, v1, v2, param2, &v0); - - if (v0 > Unk_ov8_0224C764[param2]) { - return 1; + if (bagTravelDistance == 0) { + VeilstoneGym_PlayBagNoMoveAnimation(fieldSystem, gymSystem, punchingBag, playerDir); + } else { + VeilstoneGym_PlayBagMoveAnimation(fieldSystem, gymSystem, punchingBag, playerDir); } - return 0; + return TRUE; } -static void ov8_0224C0FC(UnkStruct_ov8_0224C098 *param0, int param1) +static void VeilstoneGym_InitCameraManager(FieldSystem *fieldSystem, VeilstoneGym_BagAnimation *bagAnim, VeilstoneGymMapObjectManager *bagObj, int direction) { - UnkStruct_ov8_0224C0C4 *v0 = ¶m0->unk_40; + VeilstoneGymCameraManager *cameraMan = &bagAnim->cameraMan; + memset(cameraMan, 0, sizeof(VeilstoneGymCameraManager)); + cameraMan->fieldSystem = fieldSystem; - v0->unk_28 = 0; - v0->unk_00 = 1; - v0->unk_2C = 0; + int x = bagObj->x; + int z = bagObj->z; - if (param1 == 1) { - v0->unk_20 = Direction_GetOpposite(v0->unk_20); + cameraMan->bagX = x; + cameraMan->bagZ = z; + cameraMan->movementDirection = direction; + + VeilstoneGym_CalculateDistanceBagWillTravel(bagAnim->gymSystem, x, z, direction, &cameraMan->distanceToTravel); + GF_ASSERT(cameraMan->distanceToTravel); + + cameraMan->destX = x + MapObject_GetDxFromDir(direction) * cameraMan->distanceToTravel; + cameraMan->destZ = z + MapObject_GetDzFromDir(direction) * cameraMan->distanceToTravel; + + x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); + + cameraMan->playerX = x; + cameraMan->playerZ = z; + cameraMan->cameraObj = MapObjectMan_AddMapObject(fieldSystem->mapObjMan, x, z, 0, OBJ_EVENT_GFX_INVISIBLE, MOVEMENT_TYPE_NONE, fieldSystem->location->mapId); + + MapObject_RecalculateObjectHeight(cameraMan->cameraObj); + MapObject_SetHidden(cameraMan->cameraObj, TRUE); + sub_02062D80(cameraMan->cameraObj, FALSE); + MapObject_SetHeightCalculationDisabled(cameraMan->cameraObj, TRUE); + + const VecFx32 *cameraPos = MapObject_GetPos(cameraMan->cameraObj); + + LandDataManager_TrackTarget(cameraPos, fieldSystem->landDataMan); + Camera_TrackTarget(cameraPos, fieldSystem->camera); +} + +static void VeilStoneGym_ReturnCameraFocusToPlayer(VeilstoneGym_BagAnimation *bagAnim) +{ + VeilstoneGymCameraManager *cameraMan = &bagAnim->cameraMan; + const VecFx32 *playerPos = PlayerAvatar_GetPos(cameraMan->fieldSystem->playerAvatar); + + LandDataManager_TrackTarget(playerPos, cameraMan->fieldSystem->landDataMan); + Camera_TrackTarget(playerPos, cameraMan->fieldSystem->camera); + MapObject_Delete(cameraMan->cameraObj); +} + +static BOOL VeilstoneGym_CheckIfCameraMovementFinished(VeilstoneGym_BagAnimation *bagAnim) +{ + return bagAnim->cameraMan.movementFinished; +} + +static BOOL VeilstoneGym_CheckIfCameraNeedsToMove(VeilstoneGym_BagAnimation *bagAnim, VeilstoneGymMapObjectManager *obj, int direction) +{ + int bagTravelDistance; + VeilstoneGym_CalculateDistanceBagWillTravel(bagAnim->gymSystem, obj->x, obj->z, direction, &bagTravelDistance); + + return bagTravelDistance > sVeilstoneTravelDistanceRequiringCameraMovement[direction]; +} + +static void VeilstoneGym_PrepareForCameraMovement(VeilstoneGym_BagAnimation *bagAnim, BOOL reverseDirection) +{ + VeilstoneGymCameraManager *cameraMan = &bagAnim->cameraMan; + + cameraMan->traveledDistance = 0; + cameraMan->movementState = 1; + cameraMan->movementFinished = FALSE; + + if (reverseDirection == TRUE) { + cameraMan->movementDirection = Direction_GetOpposite(cameraMan->movementDirection); } } -static void ov8_0224C11C(UnkStruct_ov8_0224C098 *param0, int param1) +static void VeilstoneGym_MoveCamera(VeilstoneGym_BagAnimation *bagAnim, enum MovementAction movementAction) { - UnkStruct_ov8_0224C0C4 *v0 = ¶m0->unk_40; + VeilstoneGymCameraManager *cameraMan = &bagAnim->cameraMan; - switch (v0->unk_00) { + switch (cameraMan->movementState) { case 0: break; case 1: - if (LocalMapObj_IsAnimationSet(v0->unk_30) == 1) { - if (v0->unk_28 >= v0->unk_24) { - v0->unk_00++; + if (LocalMapObj_IsAnimationSet(cameraMan->cameraObj) == TRUE) { + if (cameraMan->traveledDistance >= cameraMan->distanceToTravel) { + cameraMan->movementState++; } else { - param1 = MovementAction_TurnActionTowardsDir(v0->unk_20, param1); - LocalMapObj_SetAnimationCode(v0->unk_30, param1); - v0->unk_28++; + movementAction = MovementAction_TurnActionTowardsDir(cameraMan->movementDirection, movementAction); + LocalMapObj_SetAnimationCode(cameraMan->cameraObj, movementAction); + cameraMan->traveledDistance++; } } break; case 2: - v0->unk_2C = 1; - v0->unk_00 = 0; + cameraMan->movementFinished = TRUE; + cameraMan->movementState = 0; break; } } -static void ov8_0224C170(UnkStruct_ov8_0224C098 *param0, fx32 param1) +static void VeilstoneGym_UpdateCamera(VeilstoneGym_BagAnimation *bagAnim, fx32 speed) { - if (param0->unk_18 == 1) { - int v0 = ((param1) / FX32_ONE); + if (bagAnim->moveCamera == TRUE) { + int coordinateSpeed = speed / FX32_ONE; - if (v0) { - int v1 = 0x8; + if (coordinateSpeed) { + int movementAction = MOVEMENT_ACTION_WALK_SLOW_NORTH; - if (v0 <= 2) { - v1 = 0xc; - } else if (v0 > 2) { - v1 = 0x10; + if (coordinateSpeed <= 2) { + movementAction = MOVEMENT_ACTION_WALK_NORMAL_NORTH; + } else if (coordinateSpeed > 2) { + movementAction = MOVEMENT_ACTION_WALK_FAST_NORTH; } - ov8_0224C11C(param0, v1); + VeilstoneGym_MoveCamera(bagAnim, movementAction); } } } @@ -3751,9 +3786,9 @@ void HearthomeGym_DynamicMapFeaturesInit(FieldSystem *fieldSystem) int graphicsID = OBJ_EVENT_GFX_PLAYER_M_HEARTHOME_GYM; PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; - MapObject *playerObj = Player_MapObject(playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(playerAvatar); - if (PlayerAvatar_Gender(fieldSystem->playerAvatar) == GENDER_FEMALE) { + if (PlayerAvatar_GetGender(fieldSystem->playerAvatar) == GENDER_FEMALE) { graphicsID = OBJ_EVENT_GFX_PLAYER_F_HEARTHOME_GYM; } @@ -3928,7 +3963,7 @@ BOOL HearthomeGym_CheckIfPlayerSeesTrainer(FieldSystem *fieldSystem) MapObject *trainerObj = NULL; MapObjectManager *mapObjMan = fieldSystem->mapObjMan; PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; - MapObject *playerObj = Player_MapObject(playerAvatar); + MapObject *playerObj = PlayerAvatar_GetMapObject(playerAvatar); playerDirOpposite = Direction_GetOpposite(MapObject_GetFacingDir(playerObj)); while (MapObjectMan_FindObjectWithStatus(mapObjMan, &trainerObj, &objIndex, MAP_OBJ_STATUS_0)) { diff --git a/src/overlay009/ov9_02249960.c b/src/overlay009/ov9_02249960.c index 0b9fd5df11..8d94289fef 100644 --- a/src/overlay009/ov9_02249960.c +++ b/src/overlay009/ov9_02249960.c @@ -90,10 +90,17 @@ #define DISTORTION_WORLD_MAP_COUNT 10 -#define GIRATINA_ROOM_TELEPORT_TILE_X 15 -#define GIRATINA_ROOM_TELEPORT_TILE_Z 25 -#define B7F_TELEPORT_TILE_X 89 -#define B7F_TELEPORT_TILE_Z 57 +#define GIRATINA_ROOM_TELEPORT_TILE_X 15 +#define GIRATINA_ROOM_TELEPORT_TILE_Y 1 +#define GIRATINA_ROOM_TELEPORT_TILE_Z 25 +#define GIRATINA_ROOM_TELEPORT_SCRIPT_ID 4 +#define GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_X 15 +#define GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Y 1 +#define GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Z 15 +#define B7F_TELEPORT_TILE_X 89 +#define B7F_TELEPORT_TILE_Y 65 +#define B7F_TELEPORT_TILE_Z 57 +#define B7F_TELEPORT_SCRIPT_ID 2 #define FIELD_TASK_CONTEXT_MAX_SIZE 128 @@ -740,8 +747,8 @@ typedef struct DistWorldFloatingPlatformJumpPointTemplate { s16 zDisplacement; s16 playerSpriteRotAngle; s16 movementAnimSteps; - u16 unk_1E; - u16 unk_20; + u16 jumpAxis; + u16 invertedJump; s16 finalFacingDir; s16 floatingPlatformKind; u16 floatingPlatformIndex; @@ -860,7 +867,7 @@ typedef struct DistWorldFloatingPlatformJumpTaskContext { int state; int stepsRemaining; VecFx32 positionIncrementVec; - fx32 unk_14; + fx32 jumpOffsetIndex; fx32 positionIncrement; VecFx32 accumulatedMovement; VecFx32 positionIncrementVecAbs; @@ -1510,15 +1517,15 @@ static void InitMapElements(DistWorldSystem *system); static void FreeMapElements(DistWorldSystem *system); static void PrepareLoadingActiveFloor(DistWorldSystem *system, u32 mapHeaderID); static void PrepareLoadingInactiveFloor(DistWorldSystem *system, u32 mapHeaderID); -static void DistWorldMapInfoFile_Load(NARC *param0, DistWorldMapInfoFile *param1); -static void DistWorldMapInfoFile_LoadSafe(DistWorldSystem *param0); -static void DistWorldMapInfoFile_Free(DistWorldMapInfoFile *param0); -static void FreeMapInfoFile(DistWorldSystem *param0); -static const DistWorldMapInfo *DistWorldMapInfoFile_FindForMap(const DistWorldMapInfoFile *param0, enum MapHeader mapHeaderID); +static void DistWorldMapInfoFile_Load(NARC *mainNARC, DistWorldMapInfoFile *mapInfoFile); +static void DistWorldMapInfoFile_LoadSafe(DistWorldSystem *system); +static void DistWorldMapInfoFile_Free(DistWorldMapInfoFile *mapInfoFile); +static void FreeMapInfoFile(DistWorldSystem *system); +static const DistWorldMapInfo *DistWorldMapInfoFile_FindForMap(const DistWorldMapInfoFile *mapInfoFile, enum MapHeader mapHeaderID); static const DistWorldMapInfo *FindMapInfo(DistWorldSystem *system, enum MapHeader mapHeaderID); static u32 FindMapFileIndex(DistWorldSystem *system, enum MapHeader mapHeaderID); -static void DistWorldMapInfoFile_FindMapOffsets(const DistWorldMapInfoFile *param0, int param1, int *param2, int *param3, int *param4); -static void FindMapOffsets(DistWorldSystem *param0, int param1, int *param2, int *param3, int *param4); +static void DistWorldMapInfoFile_FindMapOffsets(const DistWorldMapInfoFile *mapInfoFile, int mapHeaderID, int *offsetTileX, int *offsetAltitude, int *offsetTileZ); +static void FindMapOffsets(DistWorldSystem *system, int mapHeaderID, int *offsetTileX, int *offsetAltitude, int *offsetTileZ); static void DistWorldMapFile_Load(DistWorldSystem *system, DistWorldMapFile *file, enum MapHeader mapHeaderID); static void LoadMapFiles(DistWorldSystem *system, enum MapHeader mapHeaderID, int nextMapHeaderID); static void LoadActiveMapFile(DistWorldSystem *system, enum MapHeader mapHeaderID); @@ -1689,13 +1696,13 @@ static u32 DistWorldSystem_GetMapHeaderID(DistWorldSystem *system); static enum AvatarDistortionState GetAvatarDistortionStateForFloatingPlatformKind(u32 platformKind); static BOOL CheckFlagCondition(DistWorldSystem *system, enum FlagCondition flagCond, u32 val); static void PlaySoundIfNotActive(u16 seqID); -static void ov9_022511F4(MapObject *param0, const VecFx32 *param1); +static void SetMapObjectPos(MapObject *mapObj, const VecFx32 *pos); static const OverworldAnimManagerFuncs sSkyCloudsAnimFuncs; static const OverworldAnimManagerFuncs sMovingPlatformPropAnimFuncs; static const OverworldAnimManagerFuncs sGiratinaShadowPropAnimFuncs; static const OverworldAnimManagerFuncs sSimplePropAnimFuncs; -static const fx32 Unk_ov9_02252CF8[16]; +static const fx32 sFloatingPlatformJumpOffsets[MAP_OBJECT_TILE_SIZE / FX32_ONE]; static const FloatingPlatformJumpPointHandler sFloatingPlatformJumpPointHandlers[1]; static const int sSkyCloudsCharNARCIndexes[SKY_CLOUD_RESOURCE_COUNT]; static const int sSkyCloudsCellNARCIndexes[SKY_CLOUD_RESOURCE_COUNT]; @@ -2590,128 +2597,136 @@ BOOL DistWorld_HandlePlayerMoved(FieldSystem *fieldSystem, enum FaceDirection pl return FALSE; } -BOOL ov9_0224A67C(FieldSystem *fieldSystem, int param1) +BOOL DistWorld_HandlePlayerMovementEnd(FieldSystem *fieldSystem, enum FaceDirection playerDir) { - DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; - u32 v1 = DistWorldSystem_GetMapHeaderID(v0); + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; + u32 mapHeaderID = DistWorldSystem_GetMapHeaderID(system); - switch (v1) { - case 581: - if (param1 == 0) { - VarsFlags *v2 = SaveData_GetVarsFlags(v0->fieldSystem->saveData); + switch (mapHeaderID) { + case MAP_HEADER_DISTORTION_WORLD_B7F: + if (playerDir == FACE_UP) { + VarsFlags *varsFlags = SaveData_GetVarsFlags(system->fieldSystem->saveData); - if (SystemVars_GetDistortionWorldProgress(v2) >= 10) { - int v3, v4, v5; + if (SystemVars_GetDistortionWorldProgress(varsFlags) >= 10) { + int playerX; + int playerY; + int playerZ; + GetPlayerPos(system, &playerX, &playerY, &playerZ); - GetPlayerPos(v0, &v3, &v4, &v5); - - if ((v3 == 89) && (v4 == 65) && (v5 == 57)) { - ScriptManager_Set(fieldSystem, 2, NULL); - return 1; + if (playerX == B7F_TELEPORT_TILE_X && playerY == B7F_TELEPORT_TILE_Y && playerZ == B7F_TELEPORT_TILE_Z) { + ScriptManager_Set(fieldSystem, B7F_TELEPORT_SCRIPT_ID, NULL); + return TRUE; } } } + break; - case 582: - if (param1 == 1) { - int v6, v7, v8; - GetPlayerPos(v0, &v6, &v7, &v8); + case MAP_HEADER_DISTORTION_WORLD_GIRATINA_ROOM: + if (playerDir == FACE_DOWN) { + int playerX; + int playerY; + int playerZ; + GetPlayerPos(system, &playerX, &playerY, &playerZ); - if ((v6 == 15) && (v7 == 1) && (v8 == 25)) { - ScriptManager_Set(fieldSystem, 4, NULL); - return 1; + if (playerX == GIRATINA_ROOM_TELEPORT_TILE_X && playerY == GIRATINA_ROOM_TELEPORT_TILE_Y && playerZ == GIRATINA_ROOM_TELEPORT_TILE_Z) { + ScriptManager_Set(fieldSystem, GIRATINA_ROOM_TELEPORT_SCRIPT_ID, NULL); + return TRUE; } } + break; } - return 0; + return FALSE; } -BOOL ov9_0224A71C(FieldSystem *fieldSystem) +BOOL DistWorld_HandlePlayerPositionChanged(FieldSystem *fieldSystem) { - PersistedMapFeatures *v0 = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); + PersistedMapFeatures *persistedMapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); - if (PersistedMapFeatures_GetID(v0) != DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) { - return 0; + if (PersistedMapFeatures_GetID(persistedMapFeatures) != DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) { + return FALSE; } - { - int v1, v2, v3; - int v4 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); - DistWorldSystem *v5 = fieldSystem->unk_04->dynamicMapFeaturesData; + enum FaceDirection playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; - GetPlayerPos(v5, &v1, &v2, &v3); + int playerX; + int playerY; + int playerZ; + GetPlayerPos(system, &playerX, &playerY, &playerZ); - if (HandleElevatorPlatformPropAnimatorAt(v5, v1, v2, v3) == 1) { - return 1; - } + if (HandleElevatorPlatformPropAnimatorAt(system, playerX, playerY, playerZ) == TRUE) { + return TRUE; + } - if (HandleEventAt(v5, v1, v2, v3) == 1) { - return 1; - } + if (HandleEventAt(system, playerX, playerY, playerZ) == TRUE) { + return TRUE; + } - { - u32 v6 = DistWorldSystem_GetMapHeaderID(v5); - VarsFlags *v7 = SaveData_GetVarsFlags(v5->fieldSystem->saveData); + u32 mapHeaderID = DistWorldSystem_GetMapHeaderID(system); + VarsFlags *varsFlags = SaveData_GetVarsFlags(system->fieldSystem->saveData); - if ((v6 == 581) && (v4 == 0)) { - if (SystemVars_GetDistortionWorldProgress(v7) >= 10) { - if ((v1 == 89) && (v2 == 65) && ((v3 == 56) || (v3 == 57))) { - ScriptManager_Set(fieldSystem, 2, NULL); - return 1; - } - } - } else if ((v6 == 582) && (v4 == 1)) { - if ((v1 == 15) && (v2 == 1) && ((v3 == 25) || (v3 == 26))) { - ScriptManager_Set(fieldSystem, 4, NULL); - return 1; - } + if (mapHeaderID == MAP_HEADER_DISTORTION_WORLD_B7F && playerDir == FACE_UP) { + if (SystemVars_GetDistortionWorldProgress(varsFlags) >= 10) { + if (playerX == B7F_TELEPORT_TILE_X && playerY == B7F_TELEPORT_TILE_Y && (playerZ == B7F_TELEPORT_TILE_Z - 1 || playerZ == B7F_TELEPORT_TILE_Z)) { + ScriptManager_Set(fieldSystem, B7F_TELEPORT_SCRIPT_ID, NULL); + return TRUE; } } + } else if (mapHeaderID == MAP_HEADER_DISTORTION_WORLD_GIRATINA_ROOM && playerDir == FACE_DOWN) { + if (playerX == GIRATINA_ROOM_TELEPORT_TILE_X && playerY == GIRATINA_ROOM_TELEPORT_TILE_Y && (playerZ == GIRATINA_ROOM_TELEPORT_TILE_Z || playerZ == GIRATINA_ROOM_TELEPORT_TILE_Z + 1)) { + ScriptManager_Set(fieldSystem, GIRATINA_ROOM_TELEPORT_SCRIPT_ID, NULL); + return TRUE; + } } - return 0; + return FALSE; } -BOOL ov9_0224A800(FieldSystem *fieldSystem, int param1) +BOOL DistWorld_CheckMapTransition(FieldSystem *fieldSystem, enum FaceDirection transitionDir) { - DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; - u32 v1 = DistWorldSystem_GetMapHeaderID(v0); + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; + u32 mapHeaderID = DistWorldSystem_GetMapHeaderID(system); - switch (v1) { - case 581: - if (param1 == 0) { - VarsFlags *v2 = SaveData_GetVarsFlags(v0->fieldSystem->saveData); + switch (mapHeaderID) { + case MAP_HEADER_DISTORTION_WORLD_B7F: + if (transitionDir == FACE_UP) { + VarsFlags *varsFlags = SaveData_GetVarsFlags(system->fieldSystem->saveData); - if (SystemVars_GetDistortionWorldProgress(v2) >= 10) { - int v3, v4, v5; + if (SystemVars_GetDistortionWorldProgress(varsFlags) >= 10) { + int playerX; + int playerY; + int playerZ; + GetPlayerPos(system, &playerX, &playerY, &playerZ); - GetPlayerPos(v0, &v3, &v4, &v5); - - if ((v3 == 89) && (v4 == 65) && (v5 == 57)) { - ScriptManager_Set(fieldSystem, 2, NULL); - return 1; + if (playerX == B7F_TELEPORT_TILE_X && playerY == B7F_TELEPORT_TILE_Y && playerZ == B7F_TELEPORT_TILE_Z) { + ScriptManager_Set(fieldSystem, B7F_TELEPORT_SCRIPT_ID, NULL); + return TRUE; } } } + break; - case 582: - if (param1 == 1) { - int v6, v7, v8; - GetPlayerPos(v0, &v6, &v7, &v8); + case MAP_HEADER_DISTORTION_WORLD_GIRATINA_ROOM: + if (transitionDir == FACE_DOWN) { + int playerX; + int playerY; + int playerZ; + GetPlayerPos(system, &playerX, &playerY, &playerZ); - if ((v6 == 15) && (v7 == 1) && (v8 == 25)) { - ScriptManager_Set(fieldSystem, 4, NULL); - return 1; + if (playerX == GIRATINA_ROOM_TELEPORT_TILE_X && playerY == GIRATINA_ROOM_TELEPORT_TILE_Y && playerZ == GIRATINA_ROOM_TELEPORT_TILE_Z) { + ScriptManager_Set(fieldSystem, GIRATINA_ROOM_TELEPORT_SCRIPT_ID, NULL); + return TRUE; } } + break; } - return 0; + return FALSE; } static BOOL ApplyCameraAngleForPlayerPosition(DistWorldSystem *system, int playerX, int playerY, int playerZ, enum FaceDirection playerDir) @@ -2734,7 +2749,7 @@ static void InitPlayer(DistWorldSystem *system) int playerState; int rotAngles[6] = { 0, 0, 0, 90, 270, 180 }; PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); GetPlayerPos(system, &playerX, &playerY, &playerZ); @@ -2749,7 +2764,7 @@ static void InitPlayer(DistWorldSystem *system) PlayerAvatar_SetDistortionState(playerAvatar, floatingPlatformKind); - playerState = PLAYER_STATE_WALKING; + playerState = PLAYER_AVATAR_WALKING; u32 playerGraphicsID = MapObject_GetGraphicsID(playerMapObj); switch (playerGraphicsID) { @@ -2766,13 +2781,13 @@ static void InitPlayer(DistWorldSystem *system) case OBJ_EVENT_GFX_PLAYER_M_SURF: case OBJ_EVENT_GFX_DIST_WORLD_PLAYER_M_SURF: playerGraphicsID = OBJ_EVENT_GFX_DIST_WORLD_PLAYER_M_SURF; - playerState = PLAYER_STATE_SURFING; + playerState = PLAYER_AVATAR_SURFING; break; case OBJ_EVENT_GFX_PLAYER_F_SURF: case OBJ_EVENT_GFX_DIST_WORLD_PLAYER_F_SURF: playerGraphicsID = OBJ_EVENT_GFX_DIST_WORLD_PLAYER_F_SURF; - playerState = PLAYER_STATE_SURFING; + playerState = PLAYER_AVATAR_SURFING; break; default: @@ -2786,9 +2801,9 @@ static void InitPlayer(DistWorldSystem *system) GF_ASSERT(MapObject_IsHeightCalculationDisabled(playerMapObj) == TRUE); } - if (playerState == PLAYER_STATE_SURFING) { + if (playerState == PLAYER_AVATAR_SURFING) { OverworldAnimManager *animMan; - enum FaceDirection playerDir = PlayerAvatar_GetDir(playerAvatar); + enum FaceDirection playerDir = PlayerAvatar_GetFacingDir(playerAvatar); animMan = DistWorldSurfMountRenderer_HandleSurfBegin(playerAvatar, playerX, playerY, playerZ, playerDir, TRUE, floatingPlatformKind); PlayerAvatar_SetSurfMountAnimManager(playerAvatar, animMan); @@ -2810,7 +2825,7 @@ static BOOL HandleFloatingPlatformJumpPointAt(DistWorldSystem *system, int playe const DistWorldFloatingPlatformJumpPointTemplate *template = FindFloatingPlatformJumpPointAt(system, playerX, playerY, playerZ, playerDir); if (template) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); sFloatingPlatformJumpPointHandlers[template->handlerIndex](system, template); return TRUE; @@ -2852,7 +2867,7 @@ static BOOL JumpOnFloatingPlatform(FieldTask *task) DistWorldSystem *system = FieldTask_GetEnv(task); DistWorldFloatingPlatformJumpTaskContext *ctx = GetFieldTaskContext(system); PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); switch (ctx->state) { case FLOATING_PLATFORM_JUMP_TASK_STATE_INIT: { @@ -2926,7 +2941,7 @@ static BOOL JumpOnFloatingPlatform(FieldTask *task) enum AvatarDistortionState playerAvatarDistortionState = AVATAR_DISTORTION_STATE_ACTIVE; int particlesDir = 0; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); PrepareNewCurrentFloatingPlatform(system, ctx->template.floatingPlatformIndex); playerAvatarDistortionState = GetAvatarDistortionStateForFloatingPlatformKind(ctx->template.floatingPlatformKind); @@ -3039,39 +3054,40 @@ static BOOL TickJumpOnFloatingPlatformMovementAnimation(DistWorldFloatingPlatfor MapObject_SetZ(playerMapObj, playerZ); } - int v3; - fx32 *v4; - VecFx32 *v5 = MapObject_GetSpriteJumpOffset1(playerMapObj); - const fx32 *v6 = Unk_ov9_02252CF8; + fx32 *targetOffset; + VecFx32 *spriteJumpOffset = MapObject_GetSpriteJumpOffset1(playerMapObj); - ctx->unk_14 += ctx->positionIncrement; - v3 = ((ctx->unk_14) / FX32_ONE); + ctx->jumpOffsetIndex += ctx->positionIncrement; + int offsetIndex = ctx->jumpOffsetIndex / FX32_ONE; - switch (template->unk_1E) { - case 0: - v4 = &v5->x; + switch (template->jumpAxis) { + case AXIS_X: + targetOffset = &spriteJumpOffset->x; break; - case 1: - v4 = &v5->y; + + case AXIS_Y: + targetOffset = &spriteJumpOffset->y; break; - case 2: - v4 = &v5->z; + + case AXIS_Z: + targetOffset = &spriteJumpOffset->z; break; + default: GF_ASSERT(FALSE); break; } - *v4 = v6[v3]; + *targetOffset = sFloatingPlatformJumpOffsets[offsetIndex]; - if (template->unk_20 == 1) { - *v4 = -(*v4); + if (template->invertedJump == TRUE) { + *targetOffset = -(*targetOffset); } ctx->stepsRemaining--; if (ctx->stepsRemaining <= 0) { - *v4 = 0; + *targetOffset = 0; MapObject_UpdateCoords(playerMapObj); sub_02062B68(playerMapObj); @@ -4741,7 +4757,7 @@ static void InitialLoadInactiveFloor(DistWorldSystem *system) NARC *landDataNARC = LandDataManager_GetLandDataNARC(fieldSystem->landDataMan); inactiveFloor->landDataMan = LandDataManager_DistortionWorldNew(inactiveFloor->mapMatrix, inactiveFloor->areaDataMan, landDataNARC); - LandDataManager_TrackTarget(PlayerAvatar_PosVector(fieldSystem->playerAvatar), inactiveFloor->landDataMan); + LandDataManager_TrackTarget(PlayerAvatar_GetPos(fieldSystem->playerAvatar), inactiveFloor->landDataMan); LandDataManager_SetInDistortionWorld(inactiveFloor->landDataMan, TRUE); LandDataManager_SetSkipMapProps(inactiveFloor->landDataMan, TRUE); @@ -4752,15 +4768,15 @@ static void InitialLoadInactiveFloor(DistWorldSystem *system) FindMapOffsets(system, nextMapHeaderID, &offsetTileX, &offsetAltitude, &offsetTileZ); LandDataManager_DistortionWorldSetOffsets(inactiveFloor->landDataMan, offsetTileX, offsetAltitude, offsetTileZ); - int playerPosX = Player_GetXPos(fieldSystem->playerAvatar); - int playerPosZ = Player_GetZPos(fieldSystem->playerAvatar); + int playerPosX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int playerPosZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); LandDataManager_DistortionWorldInitialLoad(inactiveFloor->landDataMan, playerPosX, playerPosZ); inactiveFloor->ready = TRUE; inactiveFloor->valid = TRUE; if (!IsPersistedDataValid(system)) { - MapObject *playerMapObj = Player_MapObject(fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); VecFx32 mapOffset; VecFx32 playerPos; @@ -5009,8 +5025,8 @@ static int FloorLoadNext_MoveInactiveToActive(DistWorldSystem *system, DistWorld PrepareLoadingInactiveFloor(system, mapConnections->nextID); LandDataManager_DistortionWorldEndWithoutFreeing(fieldSystem->landDataMan); - floorLoader->playerPosX = Player_GetXPos(fieldSystem->playerAvatar); - floorLoader->playerPosZ = Player_GetZPos(fieldSystem->playerAvatar); + floorLoader->playerPosX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + floorLoader->playerPosZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); LandDataManager_DistortionWorldPrepareNextFloor(inactiveFloor->mapMatrix, inactiveFloor->areaDataMan, inactiveFloor->landDataMan, fieldSystem->landDataMan, floorLoader->playerPosX, floorLoader->playerPosZ); inactiveFloor->ready = FALSE; @@ -5297,7 +5313,7 @@ static int DistWorldElevatorPlatform_BeginMovement(DistWorldSystem *system, Dist } const DistWorldElevatorPlatformPath *elevatorPath = GetMovingPlatformElevatorPath(elevatorPlatform->pathIndex); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); MapObject_GetPosPtr(playerMapObj, &elevatorPlatform->playerPos); MapObject_SetHeightCalculationDisabled(playerMapObj, TRUE); @@ -5352,7 +5368,7 @@ static int DistWorldElevatorPlatform_BeginMovement(DistWorldSystem *system, Dist static int DistWorldElevatorPlatform_Vibrate(DistWorldSystem *system, DistWorldElevatorPlatform *elevatorPlatform) { PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 *elevatorPlatformPos = GetMovingPlatformPropPos(elevatorPlatform->animator->animMan); VecFx32 spritePosOffset; @@ -5361,7 +5377,7 @@ static int DistWorldElevatorPlatform_Vibrate(DistWorldSystem *system, DistWorldE spritePosOffset.y = elevatorPlatform->initialPlayerY + elevatorPlatform->vibrationYDelta; MapObject_SetSpritePosOffset(playerMapObj, &spritePosOffset); - ov9_022511F4(playerMapObj, &elevatorPlatform->playerPos); + SetMapObjectPos(playerMapObj, &elevatorPlatform->playerPos); if (elevatorPlatform->passengerMapObj != NULL) { MapObject_GetSpritePosOffset(elevatorPlatform->passengerMapObj, &spritePosOffset); @@ -5372,7 +5388,7 @@ static int DistWorldElevatorPlatform_Vibrate(DistWorldSystem *system, DistWorldE MapObject_GetPosPtr(elevatorPlatform->passengerMapObj, &passengerPos); passengerPos.y = elevatorPlatform->playerPos.y; - ov9_022511F4(elevatorPlatform->passengerMapObj, &passengerPos); + SetMapObjectPos(elevatorPlatform->passengerMapObj, &passengerPos); } elevatorPlatformPos->y = elevatorPlatform->initialPlatformY + elevatorPlatform->vibrationYDelta; @@ -5413,7 +5429,7 @@ static int DistWorldElevatorPlatform_Vibrate(DistWorldSystem *system, DistWorldE static int DistWorldElevatorPlatform_MoveFirstHalf(DistWorldSystem *system, DistWorldElevatorPlatform *elevatorPlatform) { PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 *elevatorPlatformPos = GetMovingPlatformPropPos(elevatorPlatform->animator->animMan); if (elevatorPlatform->currPosOffset.x != elevatorPlatform->finalPosOffset.x) { @@ -5434,14 +5450,14 @@ static int DistWorldElevatorPlatform_MoveFirstHalf(DistWorldSystem *system, Dist elevatorPlatformPos->z += elevatorPlatform->posDelta.z; } - ov9_022511F4(playerMapObj, &elevatorPlatform->playerPos); + SetMapObjectPos(playerMapObj, &elevatorPlatform->playerPos); if (elevatorPlatform->passengerMapObj != NULL) { VecFx32 passengerPos; MapObject_GetPosPtr(elevatorPlatform->passengerMapObj, &passengerPos); passengerPos.y = elevatorPlatform->playerPos.y; - ov9_022511F4(elevatorPlatform->passengerMapObj, &passengerPos); + SetMapObjectPos(elevatorPlatform->passengerMapObj, &passengerPos); } if (elevatorPlatform->currPosOffset.x == elevatorPlatform->changeMapsPosOffset.x && elevatorPlatform->currPosOffset.y == elevatorPlatform->changeMapsPosOffset.y && elevatorPlatform->currPosOffset.z == elevatorPlatform->changeMapsPosOffset.z) { @@ -5494,7 +5510,7 @@ static int DistWorldElevatorPlatform_ChangeMaps(DistWorldSystem *system, DistWor static int DistWorldElevatorPlatform_MoveSecondHalf(DistWorldSystem *system, DistWorldElevatorPlatform *elevatorPlatform) { PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 *elevatorPlatformPos = GetMovingPlatformPropPos(elevatorPlatform->animator->animMan); if (elevatorPlatform->currPosOffset.x != elevatorPlatform->finalPosOffset.x) { @@ -5515,14 +5531,14 @@ static int DistWorldElevatorPlatform_MoveSecondHalf(DistWorldSystem *system, Dis elevatorPlatformPos->z += elevatorPlatform->posDelta.z; } - ov9_022511F4(playerMapObj, &elevatorPlatform->playerPos); + SetMapObjectPos(playerMapObj, &elevatorPlatform->playerPos); if (elevatorPlatform->passengerMapObj != NULL) { VecFx32 passengerPos; MapObject_GetPosPtr(elevatorPlatform->passengerMapObj, &passengerPos); passengerPos.y = elevatorPlatform->playerPos.y; - ov9_022511F4(elevatorPlatform->passengerMapObj, &passengerPos); + SetMapObjectPos(elevatorPlatform->passengerMapObj, &passengerPos); } if (elevatorPlatform->currPosOffset.x == elevatorPlatform->finalPosOffset.x && elevatorPlatform->currPosOffset.y == elevatorPlatform->finalPosOffset.y && elevatorPlatform->currPosOffset.z == elevatorPlatform->finalPosOffset.z) { @@ -5530,7 +5546,7 @@ static int DistWorldElevatorPlatform_MoveSecondHalf(DistWorldSystem *system, Dis Sound_StopEffect(SEQ_SE_PL_FW089, 0); elevatorPlatform->state = ELEVATOR_PLATFORM_STATE_END; } else { - MapObject *playerMapObj2 = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj2 = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); MapObject_SetX(playerMapObj2, elevatorPlatform->finalPlayerTileX); MapObject_SetY(playerMapObj2, elevatorPlatform->finalPlayerTileY); @@ -5558,7 +5574,7 @@ static int DistWorldElevatorPlatform_MoveSecondHalf(DistWorldSystem *system, Dis static int DistWorldElevatorPlatform_EndMovement(DistWorldSystem *system, DistWorldElevatorPlatform *elevatorPlatform) { if (!IsFloorLoaderActive(system)) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); MapObject_SetX(playerMapObj, elevatorPlatform->finalPlayerTileX); MapObject_SetY(playerMapObj, elevatorPlatform->finalPlayerTileY); @@ -6557,7 +6573,7 @@ static int EventCmdMovePlatform_BeginMovement(DistWorldSystem *system, FieldTask if (cmdParams->movePlayer == TRUE) { VecFx32 spritePosOffset; - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); MapObject_SetHeightCalculationDisabled(playerMapObj, TRUE); MapObject_GetSpritePosOffset(playerMapObj, &spritePosOffset); @@ -6579,7 +6595,7 @@ static int EventCmdMovePlatform_Vibrate(DistWorldSystem *system, FieldTask *task VecFx32 *movingPlatformPos = GetMovingPlatformPropPos(runData->animator->animMan); if (cmdParams->movePlayer == TRUE) { - playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); } movingPlatformPos->y = runData->initialPlatformY + runData->vibrationYDelta; @@ -6592,7 +6608,7 @@ static int EventCmdMovePlatform_Vibrate(DistWorldSystem *system, FieldTask *task MapObject_SetSpritePosOffset(playerMapObj, &spritePosOffset); MapObject_GetPosPtr(playerMapObj, &spritePosOffset); - ov9_022511F4(playerMapObj, &spritePosOffset); + SetMapObjectPos(playerMapObj, &spritePosOffset); } runData->vibrationYDelta = -runData->vibrationYDelta; @@ -6619,7 +6635,7 @@ static int EventCmdMovePlatform_Vibrate(DistWorldSystem *system, FieldTask *task MapObject_SetSpritePosOffset(playerMapObj, &spritePosOffset); MapObject_GetPosPtr(playerMapObj, &spritePosOffset); - ov9_022511F4(playerMapObj, &spritePosOffset); + SetMapObjectPos(playerMapObj, &spritePosOffset); } *cmdState = EVENT_CMD_MOVE_PLATFORM_STATE_MOVE; @@ -6665,7 +6681,7 @@ static int EventCmdMovePlatform_Move(DistWorldSystem *system, FieldTask *task, u if (cmdParams->movePlayer == TRUE) { VecFx32 playerPos; - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); MapObject_GetPosPtr(playerMapObj, &playerPos); @@ -6673,7 +6689,7 @@ static int EventCmdMovePlatform_Move(DistWorldSystem *system, FieldTask *task, u playerPos.y += posDelta.y; playerPos.z += posDelta.z; - ov9_022511F4(playerMapObj, &playerPos); + SetMapObjectPos(playerMapObj, &playerPos); } if (runData->currPosOffset.x == runData->finalPosOffset.x && runData->currPosOffset.y == runData->finalPosOffset.y && runData->currPosOffset.z == runData->finalPosOffset.z) { @@ -6688,7 +6704,7 @@ static int EventCmdMovePlatform_EndMovement(DistWorldSystem *system, FieldTask * const CmdParamsMovePlatform *cmdParams = params; if (cmdParams->movePlayer == TRUE) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); int finalPlayerTileX = MapObject_GetX(playerMapObj) + cmdParams->finalTileXOffset; int finalPlayerTileY = MapObject_GetY(playerMapObj) + cmdParams->finalTileYOffset * 2; int finalPlayerTileZ = MapObject_GetZ(playerMapObj) + cmdParams->finalTileZOffset; @@ -7986,7 +8002,7 @@ static void RecalculateSkyBackgroundDarkness(DistWorldSystem *system) { DistWorldSkyBackground *skyBg = &system->skyBg; PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - const VecFx32 *playerPos = PlayerAvatar_PosVector(playerAvatar); + const VecFx32 *playerPos = PlayerAvatar_GetPos(playerAvatar); if (skyBg->darknessCalculationDisabled == FALSE) { skyBg->darknessLevel = (playerPos->y - MAP_OBJECT_COORD_EDGE_TO_FX32(DISTORTION_WORLD_MIN_Y)) / (MAP_OBJECT_COORD_EDGE_TO_FX32(DISTORTION_WORLD_MAX_Y - DISTORTION_WORLD_MIN_Y) / SKY_BACKGROUND_MAX_DARKNESS); @@ -8211,7 +8227,7 @@ static const DistWorldCameraAngleTemplate sCascadeDownSecondCameraAngle = { static void UpdateCascadeDownCamera(DistWorldSystem *system, CmdRunDataCascadeDown *runData) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); int yOffset = (runData->base.currPosOffset.y >> 4) / FX32_ONE; if (runData->cameraAngleState == 0 && yOffset == CASCADE_DOWN_FIRST_CAMERA_ANGLE_Y_OFFSET) { @@ -8241,7 +8257,7 @@ static int EventCmdCascadeDown_Init(DistWorldSystem *system, FieldTask *task, u1 const CmdParamsCascadeDown *cmdParams = params; CmdRunDataCascadeBase *baseRunData = &runData->base; PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 playerPos; MapObject_GetPosPtr(playerMapObj, &playerPos); @@ -8295,7 +8311,7 @@ static int EventCmdCascadeDown_Init(DistWorldSystem *system, FieldTask *task, u1 static int EventCmdCascadeDown_RotatePlayer(DistWorldSystem *system, FieldTask *task, u16 *cmdState, const void *params) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeDown *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8357,7 +8373,7 @@ static int EventCmdCascadeDown_CascadeDown(DistWorldSystem *system, FieldTask *t { enum CascadeUpdateResult updateRes; OverworldAnimManager *mountAnimMan = PlayerAvatar_GetSurfMountAnimManager(system->fieldSystem->playerAvatar); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeDown *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8427,7 +8443,7 @@ static int EventCmdCascadeDown_FinishCascading(DistWorldSystem *system, FieldTas { enum CascadeUpdateResult updateRes; OverworldAnimManager *mountAnimMan = PlayerAvatar_GetSurfMountAnimManager(system->fieldSystem->playerAvatar); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeDown *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8507,7 +8523,7 @@ static int EventCmdCascadeDown_MoveAway(DistWorldSystem *system, FieldTask *task { u32 movements[2] = { MOVEMENT_ACTION_WALK_SLOW_WEST, MOVEMENT_ACTION_WALK_SLOWER_WEST }; CmdRunDataCascadeDown *runData = GetLoadedEventDataBuffer(system); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); if (!LocalMapObj_IsAnimationSet(playerMapObj)) { return EVENT_CMD_HANDLER_RES_CONTINUE; @@ -8548,7 +8564,7 @@ static const DistWorldCameraAngleTemplate sCascadeUpCameraAngle = { static void UpdateCascadeUpCamera(DistWorldSystem *system, CmdRunDataCascadeUp *runData) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); int yOffset = (runData->base.currPosOffset.y >> 4) / FX32_ONE; if (runData->cameraAngleState == 0 && yOffset == CASCADE_UP_CAMERA_ANGLE_Y_OFFSET) { @@ -8563,7 +8579,7 @@ static int EventCmdCascadeUp_Init(DistWorldSystem *system, FieldTask *task, u16 CmdRunDataCascadeUp *runData = ResetLoadedEventDataBuffer(system, sizeof(CmdRunDataCascadeUp)); CmdRunDataCascadeBase *baseRunData = &runData->base; PlayerAvatar *playerAvatar = system->fieldSystem->playerAvatar; - MapObject *playerMapObj = Player_MapObject(playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 playerPos; MapObject_GetPosPtr(playerMapObj, &playerPos); @@ -8617,7 +8633,7 @@ static int EventCmdCascadeUp_Init(DistWorldSystem *system, FieldTask *task, u16 static int EventCmdCascadeUp_RotatePlayer(DistWorldSystem *system, FieldTask *task, u16 *cmdState, const void *params) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeUp *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8676,7 +8692,7 @@ static int EventCmdCascadeUp_CascadeUp(DistWorldSystem *system, FieldTask *task, { enum CascadeUpdateResult updateRes; OverworldAnimManager *mountAnimMan = PlayerAvatar_GetSurfMountAnimManager(system->fieldSystem->playerAvatar); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeUp *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8724,7 +8740,7 @@ static int EventCmdCascadeUp_FinishCascading(DistWorldSystem *system, FieldTask { enum CascadeUpdateResult updateRes; OverworldAnimManager *mountAnimMan = PlayerAvatar_GetSurfMountAnimManager(system->fieldSystem->playerAvatar); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); CmdRunDataCascadeUp *runData = GetLoadedEventDataBuffer(system); CmdRunDataCascadeBase *baseRunData = &runData->base; @@ -8801,7 +8817,7 @@ static int EventCmdCascadeUp_MoveAway(DistWorldSystem *system, FieldTask *task, { u32 movements[3] = { MOVEMENT_ACTION_151, MOVEMENT_ACTION_147, MOVEMENT_ACTION_115 }; CmdRunDataCascadeUp *runData = GetLoadedEventDataBuffer(system); - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); if (!LocalMapObj_IsAnimationSet(playerMapObj)) { return EVENT_CMD_HANDLER_RES_CONTINUE; @@ -9396,7 +9412,7 @@ static int EventCmdShowMespritBoulderTuto_Ascend(DistWorldSystem *system, FieldT } runData->mespritAnimTask = MapObject_StartAnimation(runData->mespritMapObj, mespritAnimCmds); - runData->playerAnimTask = MapObject_StartAnimation(Player_MapObject(system->fieldSystem->playerAvatar), playerAnimCmds); + runData->playerAnimTask = MapObject_StartAnimation(PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar), playerAnimCmds); *cmdState = EVENT_CMD_SHOW_MESPRIT_BOULDER_TUTO_STATE_WAIT_FOR_ANIMATION; } @@ -9618,22 +9634,17 @@ static void ApplyRotationToTargetFx32(fx32 *target, fx32 angle) static void GetPlayerPos(DistWorldSystem *system, int *playerX, int *playerY, int *playerZ) { - MapObject *playerMapObj = Player_MapObject(system->fieldSystem->playerAvatar); + MapObject *playerMapObj = PlayerAvatar_GetMapObject(system->fieldSystem->playerAvatar); *playerX = MapObject_GetX(playerMapObj); *playerY = MapObject_GetY(playerMapObj) / 2; *playerZ = MapObject_GetZ(playerMapObj); } -BOOL ov9_02250F74(FieldSystem *fieldSystem) +BOOL DistWorld_ArePersistedFeaturesInit(FieldSystem *fieldSystem) { - PersistedMapFeatures *v0 = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); - - if (PersistedMapFeatures_GetID(v0) != DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) { - return 0; - } - - return 1; + PersistedMapFeatures *persistedMapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); + return PersistedMapFeatures_GetID(persistedMapFeatures) == DYNAMIC_MAP_FEATURES_DISTORTION_WORLD; } BOOL DistWorld_CheckCollisionOnCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ) @@ -9661,21 +9672,21 @@ BOOL DistWorld_IsValidTileOnCurrentFloatingPlatform(FieldSystem *fieldSystem, in return TRUE; } -BOOL ov9_02250FD8(FieldSystem *fieldSystem, int param1, int param2, int param3) +BOOL DistWorld_AreCoordsValidOnCurrentFloatingPlatformKind(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ) { - DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; - s16 v1 = GetCurrentFloatingPlatformKind(v0); + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; + s16 floatingPlatformKind = GetCurrentFloatingPlatformKind(system); - return HasFloatingPlatformAtCoords(v0, param1, param2, param3, v1); + return HasFloatingPlatformAtCoords(system, tileX, tileY, tileZ, floatingPlatformKind); } -void ov9_02251000(FieldSystem *fieldSystem, int param1, int param2, int param3) +void DistWorld_FindAndPrepareNewCurrentFloatingPlatform(FieldSystem *fieldSystem, int tileX, int tileY, int tileZ) { - DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; - s16 v1 = GetCurrentFloatingPlatformKind(v0); + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; + s16 floatingPlatformKind = GetCurrentFloatingPlatformKind(system); - if (HasFloatingPlatformAtCoords(v0, param1, param2, param3, v1) == TRUE) { - FindAndPrepareNewCurrentFloatingPlatform(v0, param1, param2, param3, v1); + if (HasFloatingPlatformAtCoords(system, tileX, tileY, tileZ, floatingPlatformKind) == TRUE) { + FindAndPrepareNewCurrentFloatingPlatform(system, tileX, tileY, tileZ, floatingPlatformKind); return; } @@ -9799,22 +9810,22 @@ static BOOL CheckFlagCondition(DistWorldSystem *system, enum FlagCondition flagC return FALSE; } -BOOL ov9_022511A0(FieldSystem *fieldSystem, int param1, int param2, int param3) +BOOL DistWorld_IsBlockedByCynthia(FieldSystem *fieldSystem, int tileX, int tileZ, int tileY) { - DistWorldSystem *v0 = fieldSystem->unk_04->dynamicMapFeaturesData; + DistWorldSystem *system = fieldSystem->unk_04->dynamicMapFeaturesData; - if (DistWorldSystem_GetMapHeaderID(v0) == 582) { - if ((param2 == 15) && (param1 == 15) && (param3 == 1)) { - VarsFlags *v1 = SaveData_GetVarsFlags(v0->fieldSystem->saveData); - u32 v2 = SystemVars_GetDistortionWorldProgress(v1); + if (DistWorldSystem_GetMapHeaderID(system) == MAP_HEADER_DISTORTION_WORLD_GIRATINA_ROOM) { + if (tileZ == GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_X && tileX == GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Z && tileY == GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Y) { + VarsFlags *varsFlags = SaveData_GetVarsFlags(system->fieldSystem->saveData); + u32 distWorldProgress = SystemVars_GetDistortionWorldProgress(varsFlags); - if (v2 == 14) { - return 1; + if (distWorldProgress == 14) { + return TRUE; } } } - return 0; + return FALSE; } static void PlaySoundIfNotActive(u16 seqID) @@ -9824,17 +9835,17 @@ static void PlaySoundIfNotActive(u16 seqID) } } -static void ov9_022511F4(MapObject *mapObj, const VecFx32 *pos) +static void SetMapObjectPos(MapObject *mapObj, const VecFx32 *pos) { MapObject_SetPos(mapObj, pos); - Billboard *v0 = ov5_021EB1A0(mapObj); + Billboard *billboard = ov5_021EB1A0(mapObj); - if (v0 != NULL) { - ov5_021EDEB4(mapObj, v0); + if (billboard != NULL) { + ov5_021EDEB4(mapObj, billboard); } } -static const fx32 Unk_ov9_02252CF8[16] = { +static const fx32 sFloatingPlatformJumpOffsets[MAP_OBJECT_TILE_SIZE / FX32_ONE] = { 4 * FX32_ONE, 6 * FX32_ONE, 8 * FX32_ONE, @@ -13917,9 +13928,9 @@ static const DistWorldObjectEvent sMapObjectEventGiratinaRoom_CynthiaText = { .data = { 0x0, 0x0, 0x0 }, .movementRangeX = 0x0, .movementRangeZ = 0x0, - .x = 0xF, - .z = 0xF, - .y = (1 << 4) * FX32_ONE, + .x = GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_X, + .z = GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Z, + .y = (GIRATINA_ROOM_POST_BATTLE_CYNTHIA_TILE_Y << 4) * FX32_ONE, }, }; diff --git a/src/overlay022/ov22_0225B660.c b/src/overlay022/ov22_0225B660.c index 7ed892b66c..f6fe875ddc 100644 --- a/src/overlay022/ov22_0225B660.c +++ b/src/overlay022/ov22_0225B660.c @@ -297,7 +297,7 @@ static void ov22_0225BB00(UnkStruct_ov22_0225B85C *param0) String_Free(v7); word = DressUpPhoto_GetTitleWord(param0->photo); - StringTemplate_SetCustomMessageWord(v5, 0, word); + StringTemplate_SetEasyChatWord(v5, 0, word); v7 = String_Init(200, HEAP_ID_13); v6 = MessageLoader_GetNewString(v8, 45); diff --git a/src/overlay056/ov56_022561C0.c b/src/overlay056/ov56_022561C0.c index 772cc1a1fa..51c2955af9 100644 --- a/src/overlay056/ov56_022561C0.c +++ b/src/overlay056/ov56_022561C0.c @@ -4,7 +4,6 @@ #include #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_0205C22C.h" #include "struct_defs/struct_0205C924.h" @@ -14,6 +13,7 @@ #include "overlay056/struct_ov56_02256468_decl.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_task.h" #include "font.h" @@ -37,7 +37,6 @@ #include "text.h" #include "touch_screen.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_02033200.h" #include "unk_0205B33C.h" @@ -107,14 +106,14 @@ static void ov56_02256D04(UnkStruct_ov56_02256468 *param0); static void ov56_022569E0(UnkStruct_ov56_02256468 *param0); static void ov56_02256994(Sprite *param0, int param1); static void ov56_02257098(UnkStruct_ov56_02256468 *param0); -static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence *param2, TrainerInfo *param3); -static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int param2); +static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, EasyChatSentence *param2, TrainerInfo *param3); +static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, EasyChatSentence *param1, int param2); static int ov56_022567E4(UnkStruct_0205C95C *param0, int param1); static int ov56_022567F0(int param0, int param1); static int ov56_02256A68(UnkStruct_ov56_02256468 *param0); static int ov56_02256BC0(UnkStruct_ov56_02256468 *param0); static void ov56_02257100(UnkStruct_ov56_02256468 *param0); -static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, Sentence *param2, u32 param3); +static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, EasyChatSentence *param2, u32 param3); static String *ov56_02256E5C(PalPad *param0, u32 param1, StringTemplate *param2, MessageLoader *param3, TrainerInfo *param4); static void ov56_02256D64(BgConfig *param0, NNSG2dScreenData *param1, UnkStruct_ov56_022562EC *param2, int param3, int param4, int *param5); static void ov56_0225710C(UnkStruct_ov56_02256468 *param0); @@ -776,7 +775,7 @@ static String *ov56_02256E5C(PalPad *param0, u32 param1, StringTemplate *param2, return v0; } -static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence *param2, TrainerInfo *param3) +static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, EasyChatSentence *param2, TrainerInfo *param3) { UnkStruct_0205C95C *v0 = param0->unk_2D4; PalPad *v1 = param0->unk_04->unk_474; @@ -801,7 +800,7 @@ static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence v0->unk_00[*v2].unk_14 = *param2; v0->unk_00[*v2].unk_0C = param1; v0->unk_00[*v2].unk_10 = TrainerInfo_Gender(param3); - v0->unk_00[*v2].unk_04 = Sentence_AsString(param2, HEAP_ID_89); + v0->unk_00[*v2].unk_04 = EasyChatSentence_ToString(param2, HEAP_ID_89); v0->unk_00[*v2].unk_08 = ov56_02256E5C(v1, param1, param0->unk_18, param0->unk_1C, param0->unk_10); (*v2)++; @@ -811,17 +810,17 @@ static void ov56_02256EE8(UnkStruct_ov56_02256468 *param0, u32 param1, Sentence } } -static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int param2) +static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, EasyChatSentence *param1, int param2) { int v0, v1; - if (!Sentence_IsValid(param1)) { + if (!EasyChatSentence_IsValid(param1)) { return 0; } for (v0 = 0; v0 < param0->unk_2D4->unk_348; v0++) { if (param2 == param0->unk_2D4->unk_00[v0].unk_0C) { - if (sub_02014C88(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { + if (EasyChatSentence_Compare(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { break; } } @@ -833,14 +832,14 @@ static int ov56_02256FC8(UnkStruct_ov56_02256468 *param0, Sentence *param1, int if (param2 == param0->unk_2D4->unk_00[v0].unk_0C) { (void)0; - } else if (sub_02014C88(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { + } else if (EasyChatSentence_Compare(param1, ¶m0->unk_2D4->unk_00[v0].unk_14)) { (void)0; } return 1; } -static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, Sentence *param2, u32 param3) +static void ov56_02257048(UnkStruct_ov56_02256468 *param0, TrainerInfo *param1, EasyChatSentence *param2, u32 param3) { int v0 = 0; @@ -864,9 +863,9 @@ static void ov56_02257098(UnkStruct_ov56_02256468 *param0) int v0, v1; WMBssDesc *v2; UnkStruct_0203330C *v3; - Sentence *v4; + EasyChatSentence *v4; TrainerInfo *v5; - Sentence v6; + EasyChatSentence v6; if (FieldSystem_IsRunningTask(param0->fieldSystem)) { return; @@ -877,7 +876,7 @@ static void ov56_02257098(UnkStruct_ov56_02256468 *param0) if (v2 != NULL) { v3 = (UnkStruct_0203330C *)&v2->gameInfo.userGameInfo; - v4 = (Sentence *)&v3->unk_08; + v4 = (EasyChatSentence *)&v3->unk_08; if (ov56_02256FC8(param0, v4, v3->unk_00)) { ov56_02257048(param0, sub_02033FB0(v0), v4, v3->unk_00); diff --git a/src/overlay062/ov62_02231690.c b/src/overlay062/ov62_02231690.c index 11dbba1e80..c339e04f63 100644 --- a/src/overlay062/ov62_02231690.c +++ b/src/overlay062/ov62_02231690.c @@ -5,11 +5,10 @@ #include "constants/graphics.h" #include "constants/narc.h" -#include "generated/string_padding_mode.h" +#include "constants/string.h" #include "struct_decls/struct_0202F298_decl.h" #include "struct_decls/struct_0202F41C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_02030A80.h" #include "struct_defs/struct_0208B878.h" #include "struct_defs/struct_0208C06C.h" @@ -32,6 +31,7 @@ #include "overlay062/struct_ov62_02248CDC.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "enums.h" #include "font.h" #include "game_records.h" @@ -55,7 +55,6 @@ #include "text.h" #include "touch_screen.h" #include "unk_02012744.h" -#include "unk_02014A84.h" #include "unk_0202F1D4.h" #include "unk_02030A80.h" #include "unk_0208B284.h" @@ -510,13 +509,13 @@ static void ov62_02231C78(UnkStruct_ov62_022323B8 *param0, UnkStruct_0208C06C *p String_Free(v8); { - Sentence v15; + EasyChatSentence v15; v10 = ¶m0->unk_0C[7]; v8 = sub_02030C28(v11, &v15, HEAP_ID_102); if (v8 == NULL) { - v8 = Sentence_AsString(&v15, HEAP_ID_102); + v8 = EasyChatSentence_ToString(&v15, HEAP_ID_102); } Window_FillTilemap(v10, 0x00); diff --git a/src/overlay062/ov62_02237D24.c b/src/overlay062/ov62_02237D24.c index 153fedc19b..929d2bbf75 100644 --- a/src/overlay062/ov62_02237D24.c +++ b/src/overlay062/ov62_02237D24.c @@ -1384,7 +1384,7 @@ static void ov62_02239724(UnkStruct_0208C06C *param0) word = DressUpPhoto_GetTitleWord(v5->photo); StringTemplate_SetString(v4, 0, v1, 0, 1, GAME_LANGUAGE); - StringTemplate_SetCustomMessageWord(v4, 1, word); + StringTemplate_SetEasyChatWord(v4, 1, word); StringTemplate_Format(v4, v3, v2); v7 = String_NumLines(v3); @@ -1433,7 +1433,7 @@ static void ov62_02239854(UnkStruct_0208C06C *param0, int param1) word = DressUpPhoto_GetTitleWord(v5->unk_230.photo); StringTemplate_SetString(v4, 0, v1, 0, 1, GAME_LANGUAGE); - StringTemplate_SetCustomMessageWord(v4, 1, word); + StringTemplate_SetEasyChatWord(v4, 1, word); StringTemplate_Format(v4, v3, v2); v7 = String_NumLines(v3); diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index 1c4bd2e5b1..afd17af00e 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -765,7 +765,7 @@ static u32 ov64_0222E09C(UnkStruct_ov64_0222E060 *param0, String *param1, String v5 = DWC_CreateFriendKey(WiFiList_GetUserData(v1)); for (v0 = 0; v0 < 32; v0++) { - v2 = sub_0202AF78(v1, v0); + v2 = WiFiList_IsValidFriendData(v1, v0); if (v2 == 0) { v4 = String_AtoI(param1, &v3); @@ -823,7 +823,7 @@ static void ov64_0222E164(UnkStruct_ov64_0222E060 *param0) param0->unk_08.unk_00 = 0; for (v0 = 0; v0 < (8 * 4); v0++) { - if (sub_0202AF78(v1, v0) == 1) { + if (WiFiList_IsValidFriendData(v1, v0) == 1) { param0->unk_08.unk_04[param0->unk_08.unk_00] = v0; param0->unk_08.unk_00++; } @@ -1550,7 +1550,7 @@ static BOOL ov64_0222F068(UnkStruct_ov64_0222F038 *param0, UnkStruct_ov64_0222E0 v1 = SaveData_GetWiFiList(param1->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v1, v0)) { + if (!WiFiList_IsValidFriendData(v1, v0)) { return 1; } } diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index e96968a4bd..fecc981415 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -2201,7 +2201,7 @@ static int ov65_0222FCDC(UnkStruct_ov65_0222EBE0 *param0, int param1) param0->unk_3AC = 10; param0->unk_3A8 = 34; CommManager_LogoutWifi(); - } else if (0 == sub_0202AF94(param0->unk_00)) { + } else if (0 == WiFiList_GetValidFriendsCount(param0->unk_00)) { ov65_02232B58(param0, 26, 1); param0->unk_3A8 = 59; param0->unk_3BC = 1; diff --git a/src/overlay066/ov66_0222DDF0.c b/src/overlay066/ov66_0222DDF0.c index 9f5dae707a..cc77aea8bb 100644 --- a/src/overlay066/ov66_0222DDF0.c +++ b/src/overlay066/ov66_0222DDF0.c @@ -10,7 +10,6 @@ #include "generated/journal_online_events.h" #include "generated/species.h" -#include "struct_decls/struct_02014FB0_decl.h" #include "struct_decls/struct_0207E060_decl.h" #include "struct_defs/wi_fi_history.h" @@ -40,6 +39,7 @@ #include "overlay066/struct_ov66_022589B4.h" #include "overlay068/struct_ov68_0225DC74.h" +#include "easy_chat_words.h" #include "enums.h" #include "font.h" #include "game_records.h" @@ -57,7 +57,6 @@ #include "string_gf.h" #include "system_data.h" #include "trainer_info.h" -#include "unk_02014D38.h" #include "unk_02030EA4.h" #include "unk_0207E060.h" #include "wifi_history_save_data.h" diff --git a/src/overlay070/ov70_0225D9A4.c b/src/overlay070/ov70_0225D9A4.c index 025fb50878..0e00aa63f8 100644 --- a/src/overlay070/ov70_0225D9A4.c +++ b/src/overlay070/ov70_0225D9A4.c @@ -2006,7 +2006,7 @@ static void ov70_0225F318(UnkStruct_ov70_0225F208 *param0, u32 param1, u32 param static void ov70_0225F32C(UnkStruct_ov70_0225F208 *param0, u32 param1, u16 param2) { - StringTemplate_SetCustomMessageWord(param0->unk_00, param1, param2); + StringTemplate_SetEasyChatWord(param0->unk_00, param1, param2); } static void ov70_0225F338(UnkStruct_ov70_0225F208 *param0) diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index 363264c387..7f43cc9965 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -55,6 +55,7 @@ #include "render_oam.h" #include "render_window.h" #include "rtc.h" +#include "save_catchrecords.h" #include "savedata.h" #include "screen_fade.h" #include "sound.h" @@ -73,7 +74,6 @@ #include "touch_screen.h" #include "trainer_info.h" #include "unk_0202D778.h" -#include "unk_0202F180.h" #include "unk_020363E8.h" #include "unk_02038ED4.h" #include "unk_02038F8C.h" @@ -1876,7 +1876,7 @@ static int ov88_0223D5B8(UnkStruct_02095E80 *param0) static int ov88_0223D69C(UnkStruct_02095E80 *param0) { ListMenuTemplate v0; - int v1 = sub_0202AF94(param0->unk_36EC); + int v1 = WiFiList_GetValidFriendsCount(param0->unk_36EC); int v2 = 5; param0->unk_36D4 = StringList_New(v1 + 1, HEAP_ID_26); @@ -1887,7 +1887,7 @@ static int ov88_0223D69C(UnkStruct_02095E80 *param0) int v5 = 0; for (v5 = 0; v5 < 32; v5++) { - if (sub_0202AF78(param0->unk_36EC, v5)) { + if (WiFiList_IsValidFriendData(param0->unk_36EC, v5)) { String_CopyChars(v4, sub_0202AEF0(param0->unk_36EC, v5)); StringList_AddFromString(param0->unk_36D4, v4, v5); } @@ -1934,7 +1934,7 @@ static int ov88_0223D7AC(UnkStruct_02095E80 *param0) param0->unk_226C = ov88_0223D854; for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(param0->unk_36EC, v0)) { + if (!WiFiList_IsValidFriendData(param0->unk_36EC, v0)) { sub_02039298(param0->saveData, param0->unk_36C4, v0, HEAP_ID_26, 0); break; } @@ -2002,7 +2002,7 @@ static int ov88_0223D854(UnkStruct_02095E80 *param0) WiFiList *v2 = SaveData_GetWiFiList(param0->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v2, v0)) { + if (!WiFiList_IsValidFriendData(v2, v0)) { sub_02039298(param0->saveData, param0->unk_36C4, v0, HEAP_ID_26, 0); break; } diff --git a/src/overlay090/ov90_021D0D80.c b/src/overlay090/ov90_021D0D80.c index 30851fb219..e644a42961 100644 --- a/src/overlay090/ov90_021D0D80.c +++ b/src/overlay090/ov90_021D0D80.c @@ -7,7 +7,6 @@ #include "struct_decls/struct_0202D750_decl.h" #include "struct_decls/struct_0202D764_decl.h" #include "struct_defs/battle_frontier.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_02049A68.h" #include "overlay090/struct_ov90_021D0D80.h" @@ -15,6 +14,7 @@ #include "battle_frontier_stats.h" #include "bg_window.h" +#include "easy_chat_sentence.h" #include "font.h" #include "game_options.h" #include "gx_layers.h" @@ -33,7 +33,6 @@ #include "string_template.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0202D05C.h" #include "unk_0208C098.h" #include "vram_transfer.h" @@ -60,7 +59,7 @@ typedef struct { u8 unk_05; u8 unk_06; u8 unk_07; - Sentence unk_08; + EasyChatSentence unk_08; } UnkStruct_ov90_021D17F8; typedef struct { @@ -824,7 +823,7 @@ static void ov90_021D1A48(UnkStruct_ov90_021D0ECC *param0) String *v0; UnkStruct_ov90_021D17F8 *v1 = &(param0->unk_BC[param0->unk_0B * 3 + param0->unk_0C]); - v0 = Sentence_AsString(&v1->unk_08, param0->heapID); + v0 = EasyChatSentence_ToString(&v1->unk_08, param0->heapID); Window_FillTilemap(¶m0->unk_6C[2], (0 << 4) | 0); Text_AddPrinterWithParamsAndColor(¶m0->unk_6C[2], FONT_SYSTEM, v0, 0, 4, TEXT_SPEED_INSTANT, TEXT_COLOR(1, 2, 0), NULL); diff --git a/src/overlay094/screens/network_handler.c b/src/overlay094/screens/network_handler.c index 2e0020556f..6b42885135 100644 --- a/src/overlay094/screens/network_handler.c +++ b/src/overlay094/screens/network_handler.c @@ -39,6 +39,7 @@ #include "pc_boxes.h" #include "pokemon.h" #include "render_window.h" +#include "save_catchrecords.h" #include "savedata.h" #include "screen_fade.h" #include "string_gf.h" @@ -46,7 +47,6 @@ #include "system_vars.h" #include "text.h" #include "tv_segment.h" -#include "unk_0202F180.h" #include "unk_02038F8C.h" #include "unk_02039814.h" #include "vars_flags.h" diff --git a/src/overlay104/frscrcmd.c b/src/overlay104/frscrcmd.c index fcc424732b..991d789316 100644 --- a/src/overlay104/frscrcmd.c +++ b/src/overlay104/frscrcmd.c @@ -3,10 +3,10 @@ #include #include "constants/field_base_tiles.h" +#include "constants/string.h" #include "generated/game_records.h" #include "generated/genders.h" #include "generated/object_events_gfx.h" -#include "generated/string_padding_mode.h" #include "generated/vars_flags.h" #include "struct_decls/tv_broadcast.h" @@ -217,8 +217,8 @@ static BOOL CheckABPress(FrontierScriptContext *ctx); static BOOL FrontierScrCmd_WaitABPressTime(FrontierScriptContext *ctx); static BOOL DecrementABPressTimer(FrontierScriptContext *ctx); static BOOL FrontierScrCmd_Dummy3C(FrontierScriptContext *ctx); -static BOOL FrontierScrCmd_3D(FrontierScriptContext *ctx); -static BOOL FrontierScrCmd_3E(FrontierScriptContext *ctx); +static BOOL FrontierScrCmd_SetSystemVar(FrontierScriptContext *ctx); +static BOOL FrontierScrCmd_GetSystemVar(FrontierScriptContext *ctx); static BOOL FrontierScrCmd_2A(FrontierScriptContext *ctx); static BOOL FrontierScrCmd_2B(FrontierScriptContext *ctx); static BOOL FrontierScrCmd_2C(FrontierScriptContext *ctx); @@ -1686,7 +1686,7 @@ static BOOL FrontierScrCmd_Dummy3C(FrontierScriptContext *ctx) return TRUE; } -BOOL FrontierScrCmd_3D(FrontierScriptContext *ctx) +BOOL FrontierScrCmd_SetSystemVar(FrontierScriptContext *ctx) { u16 destVarID = FrontierScriptContext_ReadHalfWord(ctx); u16 value = FrontierScriptContext_GetVar(ctx); @@ -1698,14 +1698,14 @@ BOOL FrontierScrCmd_3D(FrontierScriptContext *ctx) return FALSE; } -BOOL FrontierScrCmd_3E(FrontierScriptContext *ctx) +BOOL FrontierScrCmd_GetSystemVar(FrontierScriptContext *ctx) { u16 srcVarID = FrontierScriptContext_ReadHalfWord(ctx); - u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx); + u16 *dest = FrontierScriptContext_TryGetVarPointer(ctx); UnkStruct_ov104_02230BE4 *v3 = sub_0209B970(ctx->scriptMan->unk_00); u16 *srcVar = VarsFlags_GetVarAddress(SaveData_GetVarsFlags(v3->saveData), srcVarID); - *destVar = *srcVar; + *dest = *srcVar; return FALSE; } diff --git a/src/overlay104/frscrcmd_battle_arcade.c b/src/overlay104/frscrcmd_battle_arcade.c index 2722b4f2ed..9289dc8000 100644 --- a/src/overlay104/frscrcmd_battle_arcade.c +++ b/src/overlay104/frscrcmd_battle_arcade.c @@ -130,21 +130,21 @@ BOOL FrontierScrCmd_BattleArcade_CleanupBattle(FrontierScriptContext *ctx) partyIdx2 = BATTLER_PLAYER_2; } - ov104_02239054(dto->parties[partyIdx1], battleArcade->unk_70, 0, 0); - ov104_02239054(dto->parties[partyIdx1], battleArcade->unk_70, 1, 1); + ov104_02239054(dto->parties[partyIdx1], battleArcade->playersParty, 0, 0); + ov104_02239054(dto->parties[partyIdx1], battleArcade->playersParty, 1, 1); if (!BattleCastle_IsMultiPlayerChallenge(battleArcade->challengeType)) { - ov104_02239054(dto->parties[partyIdx1], battleArcade->unk_70, 2, 2); + ov104_02239054(dto->parties[partyIdx1], battleArcade->playersParty, 2, 2); } else { - ov104_02239054(dto->parties[partyIdx2], battleArcade->unk_70, 0, 2); - ov104_02239054(dto->parties[partyIdx2], battleArcade->unk_70, 1, 3); + ov104_02239054(dto->parties[partyIdx2], battleArcade->playersParty, 0, 2); + ov104_02239054(dto->parties[partyIdx2], battleArcade->playersParty, 1, 3); } if (battleArcade->activeEffect == ARCADE_EFFECT_ALLY_LEVEL_UP) { - u8 numMons = BattleArcade_GetPartySize(battleArcade->challengeType, FRONTIER_CHALLENGE_DOUBLE); + u8 numMons = BattleArcade_GetPlayerPartySize(battleArcade->challengeType, FRONTIER_CHALLENGE_DOUBLE); for (i = 0; i < numMons; i++) { - Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->unk_70, i); + Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->playersParty, i); u32 level = Pokemon_GetValue(mon, MON_DATA_LEVEL, NULL); level -= 3; @@ -154,9 +154,9 @@ BOOL FrontierScrCmd_BattleArcade_CleanupBattle(FrontierScriptContext *ctx) } } - numMons = Party_GetCurrentCount(battleArcade->unk_70); + numMons = Party_GetCurrentCount(battleArcade->playersParty); for (i = 0; i < numMons; i++) { - Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->unk_70, i); + Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->playersParty, i); stat = battleArcade->monHP[i]; Pokemon_SetValue(mon, MON_DATA_MAX_HP, &stat); @@ -187,7 +187,7 @@ BOOL FrontierScrCmd_BattleArcade_StartBattle(FrontierScriptContext *ctx) UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00); BattleArcade *battleArcade = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = ov104_0223BDD8(battleArcade, v2); + FieldBattleDTO *dto = FieldBattleDTO_NewBattleArcade(battleArcade, v2); battleArcade->dto = dto; sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 0, NULL); @@ -204,18 +204,18 @@ static void SetupBattleArcadeAppArgs(BattleArcadeAppArgs *args, BattleArcade *ba args->currentStreak = battleArcade->currentStreak; args->partnersStreak = battleArcade->unk_A78; args->rouletteSpeed = &battleArcade->unk_1C; - args->party = battleArcade->unk_70; - args->opponentsParty = battleArcade->unk_74; + args->party = battleArcade->playersParty; + args->opponentsParty = battleArcade->opponentsParty; args->battleArcade = battleArcade; - battleArcade->unk_14 = 0; - args->unk_08 = &battleArcade->unk_14; + battleArcade->weather = 0; + args->unk_08 = &battleArcade->weather; args->randomizeCursorMovement = battleArcade->unk_12; battleArcade->unk_12 = 0; battleArcade->unk_1F = 0; - int numMons = Party_GetCurrentCount(battleArcade->unk_70); + int numMons = Party_GetCurrentCount(battleArcade->playersParty); for (int i = 0; i < numMons; i++) { - Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->unk_70, i); + Pokemon *mon = Party_GetPokemonBySlotIndex(battleArcade->playersParty, i); battleArcade->monHP[i] = Pokemon_GetValue(mon, MON_DATA_MAX_HP, NULL); battleArcade->monAtk[i] = Pokemon_GetValue(mon, MON_DATA_ATK, NULL); @@ -295,9 +295,9 @@ BOOL FrontierScrCmd_CallBattleArcadeFunction(FrontierScriptContext *ctx) break; case BA_FUNC_UNK_15: if (arg1 == 0) { - v1 = Party_GetPokemonBySlotIndex(battleArcade->unk_70, 0); + v1 = Party_GetPokemonBySlotIndex(battleArcade->playersParty, 0); } else { - v1 = Party_GetPokemonBySlotIndex(battleArcade->unk_74, 0); + v1 = Party_GetPokemonBySlotIndex(battleArcade->opponentsParty, 0); } *destVar = Pokemon_GetValue(v1, MON_DATA_HELD_ITEM, NULL); @@ -333,7 +333,7 @@ BOOL FrontierScrCmd_CallBattleArcadeFunction(FrontierScriptContext *ctx) break; case BA_FUNC_UNK_25: if (battleArcade->activeEffect == 27) { - u8 v4 = BattleArcade_GetPartySize(battleArcade->challengeType, 1); + u8 v4 = BattleArcade_GetPlayerPartySize(battleArcade->challengeType, 1); u8 v5 = BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 1); { @@ -382,7 +382,7 @@ BOOL FrontierScrCmd_CallBattleArcadeFunction(FrontierScriptContext *ctx) case BA_FUNC_UNK_31: ov104_02238764(battleArcade, graphics, arg1); - u8 v4 = BattleArcade_GetPartySize(battleArcade->challengeType, 1); + u8 v4 = BattleArcade_GetPlayerPartySize(battleArcade->challengeType, 1); u8 v5 = BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 1); if (arg1 == 0) { @@ -423,7 +423,7 @@ BOOL FrontierScrCmd_CallBattleArcadeFunction(FrontierScriptContext *ctx) TrainerInfo *v16; if (v6 == 0) { - StringTemplate_SetFrontierTrainerName(ctx->scriptMan->strTemplate, arg1, battleArcade->unk_78[ov104_02238498(battleArcade, arg2)]); + StringTemplate_SetFrontierTrainerName(ctx->scriptMan->strTemplate, arg1, battleArcade->trainerIDs[ov104_02238498(battleArcade, arg2)]); } else { if (BattleArcade_IsMultiPlayerChallenge(battleArcade->challengeType) == 0) { v16 = SaveData_GetTrainerInfo(v14->saveData); @@ -439,8 +439,8 @@ BOOL FrontierScrCmd_CallBattleArcadeFunction(FrontierScriptContext *ctx) ov104_02237C0C(ctx, battleArcade, arg1); break; case BA_FUNC_UNK_40: - ov104_0222E278(&(battleArcade->unk_F4[0]), battleArcade->unk_78[battleArcade->unk_11], HEAP_ID_FIELD2, 178); - ov104_0222E278(&(battleArcade->unk_F4[1]), battleArcade->unk_78[battleArcade->unk_11 + 7], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleArcade->unk_F4[0]), battleArcade->trainerIDs[battleArcade->unk_11], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleArcade->unk_F4[1]), battleArcade->trainerIDs[battleArcade->unk_11 + 7], HEAP_ID_FIELD2, 178); break; case BA_FUNC_UNK_41: ov104_0223886C(battleArcade, graphics, arg1, arg2); @@ -594,7 +594,7 @@ BOOL FrontierScrCmd_C4(FrontierScriptContext *param0) return 0; } - v0 = v1->unk_F4[v3].trDataDTO.unk_18; + v0 = v1->unk_F4[v3].trDataDTO.introMsg; ov104_022330FC(param0, v0); return 1; diff --git a/src/overlay104/frscrcmd_battle_castle.c b/src/overlay104/frscrcmd_battle_castle.c index 2008428632..9ab5c8175e 100644 --- a/src/overlay104/frscrcmd_battle_castle.c +++ b/src/overlay104/frscrcmd_battle_castle.c @@ -129,23 +129,23 @@ BOOL FrontierScrCmd_A4(FrontierScriptContext *ctx) BOOL FrontierScrCmd_BattleCastle_CleanupBattle(FrontierScriptContext *ctx) { BattleCastle *battleCastle = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = battleCastle->unk_0C; + FieldBattleDTO *dto = battleCastle->dto; Pokemon *mon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_PLAYER_1], 0); - Party_AddPokemonBySlotIndex(battleCastle->unk_28, 0, mon); + Party_AddPokemonBySlotIndex(battleCastle->playersParty, 0, mon); mon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_PLAYER_1], 1); - Party_AddPokemonBySlotIndex(battleCastle->unk_28, 1, mon); + Party_AddPokemonBySlotIndex(battleCastle->playersParty, 1, mon); if (!BattleCastle_IsMultiPlayerChallenge(battleCastle->challengeType)) { mon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_PLAYER_1], 2); - Party_AddPokemonBySlotIndex(battleCastle->unk_28, 2, mon); + Party_AddPokemonBySlotIndex(battleCastle->playersParty, 2, mon); } else { mon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_PLAYER_2], 0); - Party_AddPokemonBySlotIndex(battleCastle->unk_28, 2, mon); + Party_AddPokemonBySlotIndex(battleCastle->playersParty, 2, mon); mon = Party_GetPokemonBySlotIndex(dto->parties[BATTLER_PLAYER_2], 1); - Party_AddPokemonBySlotIndex(battleCastle->unk_28, 3, mon); + Party_AddPokemonBySlotIndex(battleCastle->playersParty, 3, mon); } battleCastle->wonBattle = CheckPlayerWonBattle(dto->resultMask); @@ -158,8 +158,8 @@ BOOL FrontierScrCmd_BattleCastle_StartBattle(FrontierScriptContext *ctx) UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00); BattleCastle *battleCastle = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = ov104_0223B810(battleCastle, v2); - battleCastle->unk_0C = dto; + FieldBattleDTO *dto = FieldBattleDTO_NewBattleCastle(battleCastle, v2); + battleCastle->dto = dto; sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 0, NULL); return TRUE; @@ -192,8 +192,8 @@ BOOL FrontierScrCmd_OpenBattleCastleOpponentApp(FrontierScriptContext *ctx) static void SetupBattleCastleAppArgs(BattleCastleAppArgs *args, BattleCastle *battleCastle) { args->challengeType = battleCastle->challengeType; - args->party = battleCastle->unk_28; - args->opponentsParty = battleCastle->unk_2C; + args->party = battleCastle->playersParty; + args->opponentsParty = battleCastle->opponentsParty; args->battleCastle = battleCastle; args->partnersCP = battleCastle->partnersCP; @@ -374,8 +374,8 @@ BOOL FrontierScrCmd_CallBattleCastleFunction(FrontierScriptContext *ctx) ov104_0223BB84(v12->bgConfig, battleCastle, 3); } break; case BC_FUNC_UNK_37: - ov104_0222E278(&(battleCastle->unk_4C[0]), battleCastle->unk_30[battleCastle->unk_11], HEAP_ID_FIELD2, 178); - ov104_0222E278(&(battleCastle->unk_4C[1]), battleCastle->unk_30[battleCastle->unk_11 + 7], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleCastle->unk_4C[0]), battleCastle->trainerIDs[battleCastle->unk_11], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleCastle->unk_4C[1]), battleCastle->trainerIDs[battleCastle->unk_11 + 7], HEAP_ID_FIELD2, 178); break; case BC_FUNC_UNK_38: *returnVar = ov104_02237338(battleCastle); @@ -572,7 +572,7 @@ BOOL FrontierScrCmd_A9(FrontierScriptContext *param0) return 0; } - v0 = v1->unk_4C[v3].trDataDTO.unk_18; + v0 = v1->unk_4C[v3].trDataDTO.introMsg; ov104_022330FC(param0, v0); return 1; diff --git a/src/overlay104/frscrcmd_battle_factory.c b/src/overlay104/frscrcmd_battle_factory.c index d218fbe249..be8d4cce1d 100644 --- a/src/overlay104/frscrcmd_battle_factory.c +++ b/src/overlay104/frscrcmd_battle_factory.c @@ -95,8 +95,8 @@ BOOL FrontierScrCmd_OpenBattleFactoryAppInitial(FrontierScriptContext *ctx) args->challengeType = battleFactory->challengeType; args->unk_05 = battleFactory->unk_05; args->isExchangeMode = FALSE; - args->personalParty = battleFactory->unk_4D4; - args->receivableParty = battleFactory->unk_4D8; + args->personalParty = battleFactory->playersParty; + args->receivableParty = battleFactory->opponentsParty; args->battleFactory = battleFactory; sub_0209B988(ctx->scriptMan->unk_00, &sBattleFactoryAppTemplate, args, 0, StoreBattleFactoryAppResult); @@ -106,7 +106,7 @@ BOOL FrontierScrCmd_OpenBattleFactoryAppInitial(FrontierScriptContext *ctx) BOOL FrontierScrCmd_BattleFactory_CleanupBattle(FrontierScriptContext *ctx) { BattleFactory *battleFactory = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = battleFactory->unk_4FC; + FieldBattleDTO *dto = battleFactory->dto; battleFactory->wonBattle = CheckPlayerWonBattle(dto->resultMask); @@ -119,8 +119,8 @@ BOOL FrontierScrCmd_BattleFactory_StartBattle(FrontierScriptContext *ctx) UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00); BattleFactory *battleFactory = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = ov104_0223ABA0(battleFactory, v2); - battleFactory->unk_4FC = dto; + FieldBattleDTO *dto = FieldBattleDTO_NewBattleFactory(battleFactory, v2); + battleFactory->dto = dto; sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 0, NULL); @@ -153,8 +153,8 @@ BOOL FrontierScrCmd_OpenBattleFactoryAppForTrade(FrontierScriptContext *ctx) args->challengeType = battleFactory->challengeType; args->unk_05 = battleFactory->unk_05; args->isExchangeMode = TRUE; - args->personalParty = battleFactory->unk_4D4; - args->receivableParty = battleFactory->unk_4D8; + args->personalParty = battleFactory->playersParty; + args->receivableParty = battleFactory->opponentsParty; args->battleFactory = battleFactory; sub_0209B988(ctx->scriptMan->unk_00, &sBattleFactoryAppTradeTemplate, args, 0, StoreBattleFactoryAppResult); @@ -252,13 +252,13 @@ BOOL FrontierScrCmd_CallBattleFactoryFunction(FrontierScriptContext *ctx) break; case BF_FUNC_UNK_17: { Pokemon *v3 = Pokemon_New(HEAP_ID_FIELD2); - ov104_0222DF40(&battleFactory->unk_3F0[arg1], v3, ov104_0223ADA0(battleFactory)); + FrontierPokemonDataDTO_InitPokemon(&battleFactory->unk_3F0[arg1], v3, BattleFactory_GetPokemonLevel(battleFactory)); *returnVar = Pokemon_GetValue(v3, MON_DATA_TYPE_1, NULL); Heap_Free(v3); } break; case BF_FUNC_UNK_18: { int v0[18]; - u8 v5 = ov104_0223AA74(battleFactory->challengeType, 1); + u8 v5 = BattleFactory_GetOpponentPartySize(battleFactory->challengeType, 1); for (i = 0; i < (17 + 1); i++) { v0[i] = 0; @@ -267,7 +267,7 @@ BOOL FrontierScrCmd_CallBattleFactoryFunction(FrontierScriptContext *ctx) Pokemon *v3 = Pokemon_New(HEAP_ID_FIELD2); for (i = 0; i < v5; i++) { - ov104_0222DF40(&battleFactory->unk_3F0[i], v3, ov104_0223ADA0(battleFactory)); + FrontierPokemonDataDTO_InitPokemon(&battleFactory->unk_3F0[i], v3, BattleFactory_GetPokemonLevel(battleFactory)); u32 v7 = Pokemon_GetValue(v3, MON_DATA_TYPE_1, NULL); u32 v8 = Pokemon_GetValue(v3, MON_DATA_TYPE_2, NULL); @@ -343,14 +343,14 @@ BOOL FrontierScrCmd_CallBattleFactoryFunction(FrontierScriptContext *ctx) } break; case BF_FUNC_UNK_33: - ov104_0222E278(&(battleFactory->unk_34[0]), battleFactory->unk_18[battleFactory->unk_06], HEAP_ID_FIELD2, 178); - ov104_0222E278(&(battleFactory->unk_34[1]), battleFactory->unk_18[battleFactory->unk_06 + 7], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleFactory->unk_34[0]), battleFactory->trainerIDs[battleFactory->unk_06], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleFactory->unk_34[1]), battleFactory->trainerIDs[battleFactory->unk_06 + 7], HEAP_ID_FIELD2, 178); break; case BF_FUNC_UNK_34: { - u8 v6 = BattleFactory_GetPartySize(battleFactory->challengeType); + u8 v6 = BattleFactory_GetPlayerPartySize(battleFactory->challengeType); for (i = 0; i < v6; i++) { - Pokemon *v3 = Party_GetPokemonBySlotIndex(battleFactory->unk_4D4, i); + Pokemon *v3 = Party_GetPokemonBySlotIndex(battleFactory->playersParty, i); StringTemplate_SetSpeciesName(ctx->scriptMan->strTemplate, i, Pokemon_GetBoxPokemon(v3)); } } break; @@ -466,7 +466,7 @@ BOOL FrontierScrCmd_6B(FrontierScriptContext *param0) return 0; } - v0 = v1->unk_34[v3].trDataDTO.unk_18; + v0 = v1->unk_34[v3].trDataDTO.introMsg; ov104_022330FC(param0, v0); return 1; diff --git a/src/overlay104/frscrcmd_battle_hall.c b/src/overlay104/frscrcmd_battle_hall.c index 3d19e71d82..4bd5563b29 100644 --- a/src/overlay104/frscrcmd_battle_hall.c +++ b/src/overlay104/frscrcmd_battle_hall.c @@ -20,6 +20,7 @@ #include "savedata/save_table.h" #include "comm_command_frontier.h" +#include "battle_hall_save.h" #include "field_battle_data_transfer.h" #include "gx_layers.h" #include "heap.h" @@ -27,7 +28,6 @@ #include "pokemon.h" #include "sound.h" #include "tv_segment.h" -#include "unk_02030108.h" #include "unk_0209B6F8.h" #include "constdata/const_020EA358.h" @@ -39,21 +39,19 @@ FS_EXTERN_OVERLAY(battle_hall_app); static BOOL ov104_02234CEC(FrontierScriptContext *param0); static void StoreBattleHallAppResult(void *data); -BOOL FrontierScrCmd_8B(FrontierScriptContext *param0) +BOOL FrontierScrCmd_InitBattleHall(FrontierScriptContext *ctx) { - BattleHall *v0; - UnkStruct_ov104_02230BE4 *v1; - u16 v2 = FrontierScriptContext_GetVar(param0); - u16 v3 = FrontierScriptContext_GetVar(param0); - u16 v4 = FrontierScriptContext_GetVar(param0); - u16 v5 = FrontierScriptContext_GetVar(param0); + u16 resumingFromSave = FrontierScriptContext_GetVar(ctx); + u16 challengeType = FrontierScriptContext_GetVar(ctx); + u16 partySlot1 = FrontierScriptContext_GetVar(ctx); + u16 partySlot2 = FrontierScriptContext_GetVar(ctx); - v1 = sub_0209B970(param0->scriptMan->unk_00); - v0 = ov104_02234DB4(v1->saveData, v2, v3, v4, v5); + UnkStruct_ov104_02230BE4 *v1 = sub_0209B970(ctx->scriptMan->unk_00); + BattleHall *battleHall = BattleHall_Init(v1->saveData, resumingFromSave, challengeType, partySlot1, partySlot2); - sub_0209B980(param0->scriptMan->unk_00, v0); + sub_0209B980(ctx->scriptMan->unk_00, battleHall); - return 0; + return FALSE; } BOOL FrontierScrCmd_8C(FrontierScriptContext *param0) @@ -67,12 +65,12 @@ BOOL FrontierScrCmd_8C(FrontierScriptContext *param0) return 0; } -BOOL FrontierScrCmd_8D(FrontierScriptContext *param0) +BOOL FrontierScrCmd_FreeBattleHall(FrontierScriptContext *ctx) { - BattleHall *v0 = sub_0209B978(param0->scriptMan->unk_00); - ov104_02235190(v0); + BattleHall *battleHall = sub_0209B978(ctx->scriptMan->unk_00); + BattleHall_Free(battleHall); - return 0; + return FALSE; } BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx) @@ -96,8 +94,8 @@ BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx) args->saveData = v5->saveData; args->challengeType = battleHall->challengeType; args->battleHall = battleHall; - args->typeRanks = &battleHall->unk_704[battleHall->challengeType][0]; - args->party = battleHall->unk_264; + args->typeRanks = &battleHall->typeRanks[battleHall->challengeType][0]; + args->party = battleHall->party; args->currentStreak = battleHall->currentStreak; args->cursorPos = battleHall->selectedTypeIdx; args->partnersLevel = &battleHall->unk_D84[0]; @@ -105,15 +103,15 @@ BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx) Party_Init(args->party); Party *party = SaveData_GetParty(v5->saveData); - Pokemon *mon = Party_GetPokemonBySlotIndex(party, battleHall->unk_260[0]); + Pokemon *mon = Party_GetPokemonBySlotIndex(party, battleHall->partySlots[0]); Party_AddPokemon(args->party, mon); if (args->challengeType == FRONTIER_CHALLENGE_DOUBLE) { - mon = Party_GetPokemonBySlotIndex(party, battleHall->unk_260[1]); + mon = Party_GetPokemonBySlotIndex(party, battleHall->partySlots[1]); Party_AddPokemon(args->party, mon); } else if (args->challengeType == FRONTIER_CHALLENGE_MULTI || args->challengeType == FRONTIER_CHALLENGE_MULTI_WFC) { - Party_AddPokemon(args->party, battleHall->unk_D8C); + Party_AddPokemon(args->party, battleHall->partnersMon); } sub_0209B988(ctx->scriptMan->unk_00, &sBattleHallAppTemplate, args, 0, StoreBattleHallAppResult); @@ -123,7 +121,7 @@ BOOL FrontierScrCmd_OpenBattleHallApp(FrontierScriptContext *ctx) BOOL FrontierScrCmd_BattleHall_CleanupBattle(FrontierScriptContext *ctx) { BattleHall *battleHall = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = battleHall->unk_700; + FieldBattleDTO *dto = battleHall->dto; battleHall->wonBattle = CheckPlayerWonBattle(dto->resultMask); FieldBattleDTO_Free(dto); @@ -136,11 +134,11 @@ BOOL FrontierScrCmd_BattleHall_StartBattle(FrontierScriptContext *ctx) UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00); BattleHall *battleHall = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *v0 = ov104_0223B250(battleHall, v2); - battleHall->unk_700 = v0; + FieldBattleDTO *dto = FieldBattleDTO_NewBattleHall(battleHall, v2); + battleHall->dto = dto; Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1); - sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, v0, 0, NULL); + sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 0, NULL); return TRUE; } @@ -183,10 +181,10 @@ BOOL FrontierScrCmd_CallBattleHallFunction(FrontierScriptContext *ctx) OS_ResetSystem(0); break; case BH_FUNC_UNK_9: - *returnVar = sub_02030124(battleHall->unk_6F8); + *returnVar = BattleHallSave_HasSaved(battleHall->hallSave); break; - case BH_FUNC_UNK_10: - ov104_0223526C(battleHall, 2); + case BH_FUNC_QUICKSAVE: + BattleHall_Save(battleHall, 2); break; case BH_FUNC_UNK_14: *returnVar = ov104_022354B0(battleHall); @@ -195,7 +193,7 @@ BOOL FrontierScrCmd_CallBattleHallFunction(FrontierScriptContext *ctx) if (battleHall->challengeType == 2) { *returnVar = 10; } else { - *returnVar = battleHall->unk_0A; + *returnVar = battleHall->currentRound; } break; case BH_FUNC_UNK_20: @@ -213,20 +211,20 @@ BOOL FrontierScrCmd_CallBattleHallFunction(FrontierScriptContext *ctx) case BH_FUNC_UNK_24: *returnVar = battleHall->unk_D88; break; - case BH_FUNC_UPDATE_HELD_ITEMS: { + case BH_FUNC_RESTORE_HELD_ITEMS: { Party *party = SaveData_GetParty(v0->saveData); - partySize = BattleHall_GetPartySize(battleHall->challengeType); + partySize = BattleHall_GetPlayerPartySize(battleHall->challengeType); for (int i = 0; i < partySize; i++) { - Pokemon *mon = Party_GetPokemonBySlotIndex(party, battleHall->unk_260[i]); - Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &battleHall->unk_728[i]); + Pokemon *mon = Party_GetPokemonBySlotIndex(party, battleHall->partySlots[i]); + Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &battleHall->heldItems[i]); } } break; case BH_FUNC_UNK_28: - v4 = BattleHall_GetRankOfType(battleHall->selectedTypeIdx, &battleHall->unk_704[battleHall->challengeType][0]); + v4 = BattleHall_GetRankOfType(battleHall->selectedTypeIdx, &battleHall->typeRanks[battleHall->challengeType][0]); if (v4 < 10) { - sub_02030204(battleHall->selectedTypeIdx, &battleHall->unk_704[battleHall->challengeType][0], v4 + 1); + BattleHall_SetRankOfType(battleHall->selectedTypeIdx, &battleHall->typeRanks[battleHall->challengeType][0], v4 + 1); } break; case BH_FUNC_UNK_29: @@ -246,18 +244,18 @@ BOOL FrontierScrCmd_CallBattleHallFunction(FrontierScriptContext *ctx) } break; case BH_FUNC_UNK_32: - ov104_0222E278(&(battleHall->unk_40[0]), battleHall->unk_18[battleHall->unk_05 * 2], HEAP_ID_FIELD2, 178); - ov104_0222E278(&(battleHall->unk_40[1]), battleHall->unk_18[battleHall->unk_05 * 2 + 1], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleHall->unk_40[0]), battleHall->trainerIDs[battleHall->unk_05 * 2], HEAP_ID_FIELD2, 178); + ov104_0222E278(&(battleHall->unk_40[1]), battleHall->trainerIDs[battleHall->unk_05 * 2 + 1], HEAP_ID_FIELD2, 178); break; case BH_FUNC_UNK_33: - *returnVar = BattleHall_GetRankOfType(battleHall->selectedTypeIdx, &battleHall->unk_704[battleHall->challengeType][0]); + *returnVar = BattleHall_GetRankOfType(battleHall->selectedTypeIdx, &battleHall->typeRanks[battleHall->challengeType][0]); break; case BH_FUNC_UNK_34: *returnVar = ov104_02235578(battleHall); break; case BH_FUNC_UNK_15: { Party *v2 = SaveData_GetParty(v0->saveData); - Pokemon *v1 = Party_GetPokemonBySlotIndex(v2, battleHall->unk_260[0]); + Pokemon *v1 = Party_GetPokemonBySlotIndex(v2, battleHall->partySlots[0]); *returnVar = Pokemon_GetValue(v1, MON_DATA_SPECIES, NULL); } break; case BH_FUNC_UNK_35: @@ -345,7 +343,7 @@ BOOL FrontierScrCmd_95(FrontierScriptContext *param0) return 0; } - v0 = v1->unk_40[v3].trDataDTO.unk_18; + v0 = v1->unk_40[v3].trDataDTO.introMsg; ov104_022330FC(param0, v0); return 1; @@ -371,7 +369,7 @@ BOOL FrontierScrCmd_C7(FrontierScriptContext *param0) v4 = sub_0209B978(param0->scriptMan->unk_00); v2 = SaveData_GetParty(v5->saveData); - v3 = Party_GetPokemonBySlotIndex(v2, v4->unk_260[0]); + v3 = Party_GetPokemonBySlotIndex(v2, v4->partySlots[0]); v1 = Pokemon_GetValue(v3, MON_DATA_SPECIES, NULL); if (v4->challengeType == 0) { diff --git a/src/overlay104/frscrcmd_battle_tower.c b/src/overlay104/frscrcmd_battle_tower.c index ec96c5e6d1..bae7531764 100644 --- a/src/overlay104/frscrcmd_battle_tower.c +++ b/src/overlay104/frscrcmd_battle_tower.c @@ -162,7 +162,7 @@ BOOL FrontierScrCmd_85(FrontierScriptContext *param0) return 0; } - v1 = battleTower->opponentsDataDTO[v4].trDataDTO.unk_18; + v1 = battleTower->opponentsDataDTO[v4].trDataDTO.introMsg; ov104_0223310C(param0, v1, BattleTower_GetTrainerMessagesBankID(battleTower->challengeMode)); return 1; @@ -181,8 +181,8 @@ BOOL FrontierScrCmd_BattleTower_StartBattle(FrontierScriptContext *ctx) UnkStruct_ov104_02230BE4 *v2 = sub_0209B970(ctx->scriptMan->unk_00); BattleTower *battleTower = sub_0209B978(ctx->scriptMan->unk_00); - FieldBattleDTO *dto = ov104_0223A580(battleTower, v2); - battleTower->unk_8D0 = dto; + FieldBattleDTO *dto = FieldBattleDTO_NewBattleTower(battleTower, v2); + battleTower->dto = dto; Sound_SetSceneAndPlayBGM(SOUND_SCENE_BATTLE, SEQ_BATTLE_TRAINER, 1); sub_0209B988(ctx->scriptMan->unk_00, &gBattleApplicationTemplate, dto, 0, NULL); @@ -194,7 +194,7 @@ BOOL FrontierScrCmd_BattleTower_CheckWonBattle(FrontierScriptContext *ctx) { BattleTower *battleTower = sub_0209B978(ctx->scriptMan->unk_00); u16 *destVar = FrontierScriptContext_TryGetVarPointer(ctx); - FieldBattleDTO *dto = battleTower->unk_8D0; + FieldBattleDTO *dto = battleTower->dto; battleTower->wonBattle = CheckPlayerWonBattle(dto->resultMask); *destVar = battleTower->wonBattle; diff --git a/src/overlay104/ov104_0222DCE0.c b/src/overlay104/ov104_0222DCE0.c index 3857fbe8ed..3101f0437d 100644 --- a/src/overlay104/ov104_0222DCE0.c +++ b/src/overlay104/ov104_0222DCE0.c @@ -9,12 +9,12 @@ #include "generated/species_data_params.h" #include "generated/trainer_classes.h" -#include "struct_defs/sentence.h" #include "struct_defs/wi_fi_history.h" #include "charcode_util.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" #include "field_battle_data_transfer.h" #include "flags.h" #include "map_header.h" @@ -101,7 +101,7 @@ static const u16 sTrainerClassToObjectID[][2] = { { TRAINER_CLASS_POKE_KID, OBJ_EVENT_GFX_PIKACHU } }; -BattleFrontierTrainerData *BattleTower_GetTrainerDataFromTrainerIDAndNarcID(u16 battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID) +BattleFrontierTrainerData *BattleFrontier_GetTrainerDataFromTrainerIDAndNarcID(u16 battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID) { return NARC_AllocAndReadWholeMemberByIndexPair(narcID, battleTowerTrainerID, heapID); } @@ -111,17 +111,17 @@ void BattleTower_GetMonDataFromSetIDAndNarcID(BattleFrontierPokemonData *monData NARC_ReadWholeMemberByIndexPair(monData, narcID, setID); } -BattleFrontierTrainerData *BattleTower_GetTrainerData(FrontierTrainerDataDTO *trDataDTO, int battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID) +BattleFrontierTrainerData *BattleFrontier_GetTrainerData(FrontierTrainerDataDTO *trDataDTO, int battleTowerTrainerID, enum HeapID heapID, enum NarcID narcID) { MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_FRONTIER_TRAINER_NAMES, heapID); MI_CpuClear8(trDataDTO, sizeof(FrontierTrainerDataDTO)); - BattleFrontierTrainerData *trData = BattleTower_GetTrainerDataFromTrainerIDAndNarcID(battleTowerTrainerID, heapID, narcID); + BattleFrontierTrainerData *trData = BattleFrontier_GetTrainerDataFromTrainerIDAndNarcID(battleTowerTrainerID, heapID, narcID); trDataDTO->trainerID = battleTowerTrainerID; - trDataDTO->unk_18[0] = 0xFFFF; - trDataDTO->unk_18[1] = battleTowerTrainerID * 3; + trDataDTO->introMsg[0] = 0xFFFF; + trDataDTO->introMsg[1] = battleTowerTrainerID * 3; trDataDTO->trainerType = trData->trainerType; String *string = MessageLoader_GetNewString(msgLoader, battleTowerTrainerID); @@ -234,83 +234,83 @@ u32 ov104_0222DD6C(FrontierPokemonDataDTO *param0, u16 param1, u32 param2, u32 p return v2; } -void ov104_0222DF40(const FrontierPokemonDataDTO *param0, Pokemon *param1, u8 param2) +void FrontierPokemonDataDTO_InitPokemon(const FrontierPokemonDataDTO *pokemonDTO, Pokemon *mon, u8 param2) { - int v0; - u32 v1; - u8 v2, v3, v4; - u16 v5; - u32 v6; + int i; + u32 combinedIVs; + u8 val, maxPP, level; + u16 move; + u32 otID; - Pokemon_Init(param1); + Pokemon_Init(mon); if (param2 == 120) { - v4 = 50; + level = 50; } else if (param2 == 121) { - v4 = 100; + level = 100; } else { - v4 = param2; + level = param2; } - v1 = (param0->combinedIVs & 0x3FFFFFFF); + combinedIVs = (pokemonDTO->combinedIVs & 0x3FFFFFFF); - Pokemon_InitWith(param1, param0->species, v4, v1, TRUE, param0->personality, OTID_NOT_SHINY, 0); - Pokemon_SetValue(param1, MON_DATA_COMBINED_IVS, &v1); - Pokemon_CalcLevelAndStats(param1); + Pokemon_InitWith(mon, pokemonDTO->species, level, combinedIVs, TRUE, pokemonDTO->personality, OTID_NOT_SHINY, 0); + Pokemon_SetValue(mon, MON_DATA_COMBINED_IVS, &combinedIVs); + Pokemon_CalcLevelAndStats(mon); - v2 = param0->form; + val = pokemonDTO->form; - Pokemon_SetValue(param1, MON_DATA_FORM, &v2); - Pokemon_SetValue(param1, MON_DATA_HELD_ITEM, ¶m0->item); + Pokemon_SetValue(mon, MON_DATA_FORM, &val); + Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &pokemonDTO->item); - for (v0 = 0; v0 < LEARNED_MOVES_MAX; v0++) { - v5 = param0->moves[v0]; - Pokemon_SetValue(param1, MON_DATA_MOVE1 + v0, &v5); + for (i = 0; i < LEARNED_MOVES_MAX; i++) { + move = pokemonDTO->moves[i]; + Pokemon_SetValue(mon, MON_DATA_MOVE1 + i, &move); - v2 = (param0->combinedPPUps >> (v0 * 2)) & 0x3; - Pokemon_SetValue(param1, MON_DATA_MOVE1_PP_UPS + v0, &v2); + val = (pokemonDTO->combinedPPUps >> (i * 2)) & 0x3; + Pokemon_SetValue(mon, MON_DATA_MOVE1_PP_UPS + i, &val); - v3 = (u8)Pokemon_GetValue(param1, MON_DATA_MOVE1_MAX_PP + v0, NULL); - Pokemon_SetValue(param1, MON_DATA_MOVE1_PP + v0, &v3); + maxPP = (u8)Pokemon_GetValue(mon, MON_DATA_MOVE1_MAX_PP + i, NULL); + Pokemon_SetValue(mon, MON_DATA_MOVE1_PP + i, &maxPP); } - v6 = param0->otID; - Pokemon_SetValue(param1, MON_DATA_OT_ID, &v6); + otID = pokemonDTO->otID; + Pokemon_SetValue(mon, MON_DATA_OT_ID, &otID); - v2 = param0->hpEV; - Pokemon_SetValue(param1, MON_DATA_HP_EV, &v2); + val = pokemonDTO->hpEV; + Pokemon_SetValue(mon, MON_DATA_HP_EV, &val); - v2 = param0->atkEV; - Pokemon_SetValue(param1, MON_DATA_ATK_EV, &v2); + val = pokemonDTO->atkEV; + Pokemon_SetValue(mon, MON_DATA_ATK_EV, &val); - v2 = param0->defEV; - Pokemon_SetValue(param1, MON_DATA_DEF_EV, &v2); + val = pokemonDTO->defEV; + Pokemon_SetValue(mon, MON_DATA_DEF_EV, &val); - v2 = param0->speedEV; - Pokemon_SetValue(param1, MON_DATA_SPEED_EV, &v2); + val = pokemonDTO->speedEV; + Pokemon_SetValue(mon, MON_DATA_SPEED_EV, &val); - v2 = param0->spAtkEV; - Pokemon_SetValue(param1, MON_DATA_SPATK_EV, &v2); + val = pokemonDTO->spAtkEV; + Pokemon_SetValue(mon, MON_DATA_SPATK_EV, &val); - v2 = param0->spDefEV; - Pokemon_SetValue(param1, MON_DATA_SPDEF_EV, &v2); + val = pokemonDTO->spDefEV; + Pokemon_SetValue(mon, MON_DATA_SPDEF_EV, &val); - Pokemon_SetValue(param1, MON_DATA_ABILITY, ¶m0->ability); - Pokemon_SetValue(param1, MON_DATA_FRIENDSHIP, ¶m0->friendship); + Pokemon_SetValue(mon, MON_DATA_ABILITY, &pokemonDTO->ability); + Pokemon_SetValue(mon, MON_DATA_FRIENDSHIP, &pokemonDTO->friendship); - if (param0->unk_14_val1_30) { - MessageLoader *v7 = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_SPECIES_NAME, HEAP_ID_FIELD1); - String *v8 = MessageLoader_GetNewString(v7, param0->species); + if (pokemonDTO->unk_14_val1_30) { + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_SPECIES_NAME, HEAP_ID_FIELD1); + String *speciesName = MessageLoader_GetNewString(msgLoader, pokemonDTO->species); - Pokemon_SetValue(param1, MON_DATA_NICKNAME_STRING, v8); - String_Free(v8); - MessageLoader_Free(v7); + Pokemon_SetValue(mon, MON_DATA_NICKNAME_STRING, speciesName); + String_Free(speciesName); + MessageLoader_Free(msgLoader); } else { - Pokemon_SetValue(param1, MON_DATA_NICKNAME, param0->nickname); + Pokemon_SetValue(mon, MON_DATA_NICKNAME, pokemonDTO->nickname); } - Pokemon_SetValue(param1, MON_DATA_LANGUAGE, ¶m0->language); - Pokemon_CalcLevelAndStats(param1); + Pokemon_SetValue(mon, MON_DATA_LANGUAGE, &pokemonDTO->language); + Pokemon_CalcLevelAndStats(mon); } u16 BattleTower_GetObjectIDFromTrainerClass(u8 trainerClass) @@ -406,25 +406,25 @@ u8 BattleCastle_GetPokeIconAnimID(u16 hp, u16 maxHp) void ov104_0222E278(FrontierDataDTO *param0, u16 param1, enum HeapID heapID, int param3) { - Heap_Free(BattleTower_GetTrainerData(¶m0->trDataDTO, param1, heapID, param3)); + Heap_Free(BattleFrontier_GetTrainerData(¶m0->trDataDTO, param1, heapID, param3)); return; } -void ov104_0222E284(FieldBattleDTO *param0, FrontierTrainerDataDTO *param1, int param2, int battlerId, enum HeapID heapID) +void FieldBattleDTO_InitFrontierTrainer(FieldBattleDTO *battleDTO, FrontierTrainerDataDTO *trDataDTO, int unused, int battlerId, enum HeapID heapID) { - Sentence *v0; + EasyChatSentence *sentence; - param0->trainerIDs[battlerId] = param1->trainerID; - param0->trainer[battlerId].header.trainerType = param1->trainerType; + battleDTO->trainerIDs[battlerId] = trDataDTO->trainerID; + battleDTO->trainer[battlerId].header.trainerType = trDataDTO->trainerType; - CharCode_Copy(¶m0->trainer[battlerId].name[0], ¶m1->trainerName[0]); + CharCode_Copy(&battleDTO->trainer[battlerId].name[0], &trDataDTO->trainerName[0]); - v0 = (Sentence *)¶m1->unk_20[0]; - param0->trainer[battlerId].winMsg = *v0; + sentence = (EasyChatSentence *)&trDataDTO->winMsg[0]; + battleDTO->trainer[battlerId].winMsg = *sentence; - v0 = (Sentence *)¶m1->unk_28[0]; - param0->trainer[battlerId].loseMsg = *v0; + sentence = (EasyChatSentence *)&trDataDTO->loseMsg[0]; + battleDTO->trainer[battlerId].loseMsg = *sentence; return; } @@ -546,7 +546,7 @@ void ov104_0222E4BC(u8 param0, u16 param1, u16 param2, u16 *param3, FrontierPoke FrontierTrainerDataDTO v4; BattleFrontierPokemonData v6; - BattleFrontierTrainerData *v5 = BattleTower_GetTrainerData(&v4, param1, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); + BattleFrontierTrainerData *v5 = BattleFrontier_GetTrainerData(&v4, param1, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); for (v0 = 0; v0 < param0; v0++) { param5[v0] = ov104_0222E3A8(param1); @@ -564,7 +564,7 @@ void ov104_0222E4BC(u8 param0, u16 param1, u16 param2, u16 *param3, FrontierPoke } Heap_Free(v5); - v5 = BattleTower_GetTrainerData(&v4, param2, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); + v5 = BattleFrontier_GetTrainerData(&v4, param2, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); ov104_0222E3E4(v5, v2, v3, (param0 / 2), (param0 / 2), ¶m3[param0 / 2], 11); for (v0 = 0; v0 < (param0 / 2); v0++) { @@ -599,10 +599,8 @@ enum ObjectEventGfx BattleFrontier_GetPlayerObjEventGfx(const TrainerInfo *playe } } -void ov104_0222E630(SaveData *saveData) +void BattleFrontier_FlagGeonetLinkInfo(SaveData *saveData) { WiFiHistory *wiFiHistory = SaveData_WiFiHistory(saveData); - WiFiHistory_FlagGeonetLinkInfo(wiFiHistory); - return; } diff --git a/src/overlay104/ov104_0222ECE8.c b/src/overlay104/ov104_0222ECE8.c index edffd673cb..9e04b13ba7 100644 --- a/src/overlay104/ov104_0222ECE8.c +++ b/src/overlay104/ov104_0222ECE8.c @@ -148,7 +148,7 @@ BOOL ov104_0222ED44(BattleHall *param0) v3 = 0; for (v2 = 0; v2 < (10 * 2); v2++) { - v4[v2 + v3] = param0->unk_18[v2]; + v4[v2 + v3] = param0->trainerIDs[v2]; } v3 += (10 * 2); @@ -180,7 +180,7 @@ void CommCmd_Frontier_35(int param0, int param1, void *param2, void *param3) } for (v0 = 0; v0 < (10 * 2); v0++) { - v2->unk_18[v0] = v3[v0 + v1]; + v2->trainerIDs[v0] = v3[v0 + v1]; } v1 += (10 * 2); @@ -280,7 +280,7 @@ BOOL ov104_0222EE60(BattleHall *param0) v3 = 512; v4 = Pokemon_StructSize(); v6 = SaveData_GetParty(param0->saveData); - v5 = Party_GetPokemonBySlotIndex(v6, param0->unk_260[0]); + v5 = Party_GetPokemonBySlotIndex(v6, param0->partySlots[0]); MI_CpuCopy8(v5, ¶m0->unk_784[0], v4); @@ -307,7 +307,7 @@ void CommCmd_Frontier_38(int param0, int param1, void *param2, void *param3) } v2 = Pokemon_StructSize(); - MI_CpuCopy8(&v4[0], v3->unk_D8C, v2); + MI_CpuCopy8(&v4[0], v3->partnersMon, v2); return; } @@ -378,7 +378,7 @@ BOOL ov104_0222EF64(BattleFactory *param0) v1 = 0; for (v0 = 0; v0 < 7 * 2; v0++) { - v2[v0 + v1] = param0->unk_18[v0]; + v2[v0 + v1] = param0->trainerIDs[v0]; } v1 += (7 * 2); @@ -410,7 +410,7 @@ void CommCmd_Frontier_23(int param0, int param1, void *param2, void *param3) } for (v0 = 0; v0 < 7 * 2; v0++) { - v2->unk_18[v0] = v3[v0 + v1]; + v2->trainerIDs[v0] = v3[v0 + v1]; } v1 += (7 * 2); @@ -647,10 +647,10 @@ BOOL ov104_0222F238(BattleFactory *param0) v5 = 60; v3 = param0->unk_504; v2 = 0; - v0 = BattleFactory_GetPartySize(param0->challengeType); + v0 = BattleFactory_GetPlayerPartySize(param0->challengeType); for (v1 = 0; v1 < v0; v1++) { - v8 = Party_GetPokemonBySlotIndex(param0->unk_4D4, v1); + v8 = Party_GetPokemonBySlotIndex(param0->playersParty, v1); v7[v1] = Pokemon_GetValue(v8, MON_DATA_ATK_IV, NULL); v6[v1] = Pokemon_GetValue(v8, MON_DATA_PERSONALITY, NULL); } @@ -700,7 +700,7 @@ void CommCmd_Frontier_28(int param0, int param1, void *param2, void *param3) return; } - v2 = BattleFactory_GetPartySize(v6->challengeType); + v2 = BattleFactory_GetPlayerPartySize(v6->challengeType); for (v0 = 0; v0 < v2; v0++) { v6->unk_584[v0] = v7[v0]; @@ -782,7 +782,7 @@ BOOL ov104_0222F44C(BattleCastle *param0) v3 = 40; for (v0 = 0; v0 < (7 * 2); v0++) { - param0->unk_3C0[v0 + v1] = param0->unk_30[v0]; + param0->unk_3C0[v0 + v1] = param0->trainerIDs[v0]; } v1 += (7 * 2); @@ -814,7 +814,7 @@ void CommCmd_Frontier_43(int param0, int param1, void *param2, void *param3) } for (v0 = 0; v0 < (7 * 2); v0++) { - v2->unk_30[v0] = v3[v0 + v1]; + v2->trainerIDs[v0] = v3[v0 + v1]; } v1 += (7 * 2); @@ -1055,11 +1055,11 @@ BOOL ov104_0222F758(BattleCastle *param0) v1 = 0; v3 = 512; - v5 = BattleCastle_GetPartySize(param0->challengeType, 0); + v5 = BattleCastle_GetPlayerPartySize(param0->challengeType, 0); v4 = Pokemon_StructSize(); for (v0 = 0; v0 < v5; v0++) { - v6 = Party_GetPokemonBySlotIndex(param0->unk_28, v0); + v6 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); MI_CpuCopy8(v6, ¶m0->unk_410[v0 * v4], v4); } @@ -1087,20 +1087,20 @@ void CommCmd_Frontier_48(int param0, int param1, void *param2, void *param3) return; } - v0 = BattleCastle_GetPartySize(v5->challengeType, 0); + v0 = BattleCastle_GetPlayerPartySize(v5->challengeType, 0); v3 = Pokemon_StructSize(); v4 = Pokemon_New(HEAP_ID_FIELD2); for (v1 = 0; v1 < v0; v1++) { MI_CpuCopy8(&v6[v3 * v1], v4, v3); - Party_AddPokemon(v5->unk_28, v4); + Party_AddPokemon(v5->playersParty, v4); } Heap_Free(v4); if (CommSys_CurNetId() != 0) { - Party_SwapSlots(v5->unk_28, 0, 2); - Party_SwapSlots(v5->unk_28, 1, 3); + Party_SwapSlots(v5->playersParty, 0, 2); + Party_SwapSlots(v5->playersParty, 1, 3); } return; @@ -1164,7 +1164,7 @@ BOOL ov104_0222F8D0(BattleArcade *param0) v3 = 40; for (v0 = 0; v0 < (7 * 2); v0++) { - param0->unk_424[v0 + v1] = param0->unk_78[v0]; + param0->unk_424[v0 + v1] = param0->trainerIDs[v0]; } v1 += (7 * 2); @@ -1196,7 +1196,7 @@ void CommCmd_Frontier_66(int param0, int param1, void *param2, void *param3) } for (v0 = 0; v0 < (7 * 2); v0++) { - v2->unk_78[v0] = v3[v0 + v1]; + v2->trainerIDs[v0] = v3[v0 + v1]; } v1 += (7 * 2); @@ -1348,11 +1348,11 @@ BOOL ov104_0222FAD0(BattleArcade *param0) v1 = 0; v3 = 512; - v5 = BattleArcade_GetPartySize(param0->challengeType, 0); + v5 = BattleArcade_GetPlayerPartySize(param0->challengeType, 0); v4 = Pokemon_StructSize(); for (v0 = 0; v0 < v5; v0++) { - v6 = Party_GetPokemonBySlotIndex(param0->unk_70, v0); + v6 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); MI_CpuCopy8(v6, ¶m0->unk_474[v0 * v4], v4); } @@ -1380,20 +1380,20 @@ void CommCmd_Frontier_70(int param0, int param1, void *param2, void *param3) return; } - v0 = BattleArcade_GetPartySize(v5->challengeType, 0); + v0 = BattleArcade_GetPlayerPartySize(v5->challengeType, 0); v3 = Pokemon_StructSize(); v4 = Pokemon_New(HEAP_ID_FIELD2); for (v1 = 0; v1 < v0; v1++) { MI_CpuCopy8(&v6[v3 * v1], v4, v3); - Party_AddPokemon(v5->unk_70, v4); + Party_AddPokemon(v5->playersParty, v4); } Heap_Free(v4); if (CommSys_CurNetId() != 0) { - Party_SwapSlots(v5->unk_70, 0, 2); - Party_SwapSlots(v5->unk_70, 1, 3); + Party_SwapSlots(v5->playersParty, 0, 2); + Party_SwapSlots(v5->playersParty, 1, 3); } return; diff --git a/src/overlay104/ov104_02231F74.c b/src/overlay104/ov104_02231F74.c index fadae12c10..b2c8f553c8 100644 --- a/src/overlay104/ov104_02231F74.c +++ b/src/overlay104/ov104_02231F74.c @@ -7,8 +7,6 @@ #include "constants/field_base_tiles.h" #include "constants/narc.h" -#include "struct_defs/sentence.h" - #include "applications/party_menu/main.h" #include "overlay063/ov63_0222BE18.h" #include "overlay063/ov63_0222CCE4.h" @@ -25,6 +23,7 @@ #include "bg_window.h" #include "character_sprite.h" +#include "easy_chat_sentence.h" #include "font.h" #include "game_options.h" #include "heap.h" @@ -50,7 +49,6 @@ #include "sys_task_manager.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0209B6F8.h" #define LIST_MENU_ENTRY_NO_ALT_TEXT 0xFF @@ -166,15 +164,15 @@ static void ShowSentence(FrontierScriptManager *scriptMan, u8 renderDelay, u16 s static void GetStringFromSentence(String *msgBuf, u16 sentenceType, u16 sentenceID, u16 word1, u16 word2) { - Sentence sentence; + EasyChatSentence sentence; String *string; - Sentence_Init(&sentence); - sub_02014CE0(&sentence, sentenceType, sentenceID); - Sentence_SetWord(&sentence, 0, word1); - Sentence_SetWord(&sentence, 1, word2); + EasyChatSentence_Init(&sentence); + EasyChatSentence_SetTypeAndID(&sentence, sentenceType, sentenceID); + EasyChatSentence_SetWord(&sentence, 0, word1); + EasyChatSentence_SetWord(&sentence, 1, word2); - string = Sentence_AsString(&sentence, HEAP_ID_FIELD3); + string = EasyChatSentence_ToString(&sentence, HEAP_ID_FIELD3); String_Copy(msgBuf, string); String_Free(string); } diff --git a/src/overlay104/ov104_022339B4.c b/src/overlay104/ov104_022339B4.c index 1ef8d1afc7..b6cb876fed 100644 --- a/src/overlay104/ov104_022339B4.c +++ b/src/overlay104/ov104_022339B4.c @@ -62,8 +62,8 @@ BattleFactory *ov104_022339B4(SaveData *saveData, u16 param1, u8 param2, u8 para v7->unk_4F4 = sub_0202FF58(saveData); v7->saveData = saveData; v7->unk_00 = 11; - v7->unk_4D4 = Party_New(HEAP_ID_FIELD2); - v7->unk_4D8 = Party_New(HEAP_ID_FIELD2); + v7->playersParty = Party_New(HEAP_ID_FIELD2); + v7->opponentsParty = Party_New(HEAP_ID_FIELD2); v0 = v7->unk_4F4; v1 = sub_020300F4(saveData); @@ -107,7 +107,7 @@ BattleFactory *ov104_022339B4(SaveData *saveData, u16 param1, u8 param2, u8 para v7->unk_0E = (u16)(v7->currentStreak / 7); if (BattleFactory_IsMultiplayerChallenge(v7->challengeType) == 1) { - ov104_0222E630(v7->saveData); + BattleFrontier_FlagGeonetLinkInfo(v7->saveData); } return v7; @@ -132,7 +132,7 @@ static void ov104_02233BAC(BattleFactory *param0) u16 v5[6]; u16 v6[6]; - ov104_0223A860(param0->challengeType, ov104_0223AF34(param0), param0->unk_18, 7 * 2); + ov104_0223A860(param0->challengeType, ov104_0223AF34(param0), param0->trainerIDs, 7 * 2); ov104_0223AAA0(ov104_0223AF34(param0), param0->unk_05, param0->unk_254, param0->unk_280, param0->unk_260, param0->unk_268, param0->unk_08, NULL, NULL); @@ -163,17 +163,17 @@ static void ov104_02233BAC(BattleFactory *param0) } } - ov104_0223AB0C(ov104_0223AA74(param0->challengeType, 1), param0->unk_18[param0->unk_06], param0->unk_05, v2, param0->unk_3D2, param0->unk_3F0, param0->unk_3DA, param0->unk_3E0, v1); + ov104_0223AB0C(BattleFactory_GetOpponentPartySize(param0->challengeType, 1), param0->trainerIDs[param0->unk_06], param0->unk_05, v2, param0->unk_3D2, param0->unk_3F0, param0->unk_3DA, param0->unk_3E0, v1); for (v0 = 0; v0 < 6; v0++) { v4 = Pokemon_New(HEAP_ID_FIELD2); - ov104_0222DF40(¶m0->unk_280[v0], v4, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D4, v4); + FrontierPokemonDataDTO_InitPokemon(¶m0->unk_280[v0], v4, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->playersParty, v4); Heap_Free(v4); } for (v0 = 0; v0 < 6; v0++) { - v4 = Party_GetPokemonBySlotIndex(param0->unk_4D4, v0); + v4 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); } return; @@ -232,10 +232,10 @@ static void ov104_02233F1C(BattleFactory *param0) u16 v6[6]; u32 v7[6]; - u8 v3 = BattleFactory_GetPartySize(param0->challengeType); + u8 v3 = BattleFactory_GetPlayerPartySize(param0->challengeType); for (v0 = 0; v0 < (7 * 2); v0++) { - param0->unk_18[v0] = (u16)sub_02030030(param0->unk_4F4, 3, v0, NULL); + param0->trainerIDs[v0] = (u16)sub_02030030(param0->unk_4F4, 3, v0, NULL); } for (v0 = 0; v0 < 4; v0++) { @@ -251,8 +251,8 @@ static void ov104_02233F1C(BattleFactory *param0) Pokemon *v1 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < 4; v0++) { - ov104_0222DF40(&v4[v0], v1, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D4, v1); + FrontierPokemonDataDTO_InitPokemon(&v4[v0], v1, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->playersParty, v1); } Heap_Free(v1); @@ -270,8 +270,8 @@ static void ov104_02233F1C(BattleFactory *param0) v1 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < 4; v0++) { - ov104_0222DF40(&v4[v0], v1, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D8, v1); + FrontierPokemonDataDTO_InitPokemon(&v4[v0], v1, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->opponentsParty, v1); } Heap_Free(v1); @@ -287,12 +287,12 @@ void ov104_022340D0(BattleFactory *param0) return; } - if (param0->unk_4D4 != NULL) { - Heap_Free(param0->unk_4D4); + if (param0->playersParty != NULL) { + Heap_Free(param0->playersParty); } - if (param0->unk_4D8 != NULL) { - Heap_Free(param0->unk_4D8); + if (param0->opponentsParty != NULL) { + Heap_Free(param0->opponentsParty); } MI_CpuClear8(param0, sizeof(BattleFactory)); @@ -334,8 +334,8 @@ void ov104_02234148(BattleFactory *param0, u8 param1) UnkStruct_020300F4 *v14 = sub_020300F4(param0->saveData); frontier = SaveData_GetBattleFrontier(param0->saveData); - v3 = BattleFactory_GetPartySize(param0->challengeType); - v4 = ov104_0223AA74(param0->challengeType, 1); + v3 = BattleFactory_GetPlayerPartySize(param0->challengeType); + v4 = BattleFactory_GetOpponentPartySize(param0->challengeType, 1); v5[0] = param0->unk_05; sub_0202FF84(param0->unk_4F4, 0, 0, v5); @@ -375,14 +375,14 @@ void ov104_02234148(BattleFactory *param0, u8 param1) } for (v0 = 0; v0 < (7 * 2); v0++) { - v6[0] = param0->unk_18[v0]; + v6[0] = param0->trainerIDs[v0]; sub_0202FF84(param0->unk_4F4, 3, v0, v6); } - v9 = Party_GetCurrentCount(param0->unk_4D4); + v9 = Party_GetCurrentCount(param0->playersParty); for (v0 = 0; v0 < v9; v0++) { - v12 = Party_GetPokemonBySlotIndex(param0->unk_4D4, v0); + v12 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); v6[0] = param0->unk_4E8[v0]; sub_0202FF84(param0->unk_4F4, 4, v0, v6); @@ -394,10 +394,10 @@ void ov104_02234148(BattleFactory *param0, u8 param1) sub_0202FF84(param0->unk_4F4, 6, v0, v7); } - v9 = Party_GetCurrentCount(param0->unk_4D8); + v9 = Party_GetCurrentCount(param0->opponentsParty); for (v0 = 0; v0 < v9; v0++) { - v12 = Party_GetPokemonBySlotIndex(param0->unk_4D8, v0); + v12 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v0); v6[0] = param0->unk_3D2[v0]; sub_0202FF84(param0->unk_4F4, 7, v0, v6); @@ -428,7 +428,7 @@ u16 ov104_02234440(BattleFactory *param0, u8 param1) FrontierTrainerDataDTO v0; u8 v2 = param0->unk_06 + (param1 * 7); - Heap_Free(BattleTower_GetTrainerData(&v0, param0->unk_18[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&v0, param0->trainerIDs[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); return BattleTower_GetObjectIDFromTrainerClass(v0.trainerType); } @@ -460,22 +460,22 @@ void ov104_0223449C(BattleFactory *param0) Pokemon *v3; const UnkStruct_ov104_0224028C *v4; - v1 = BattleFactory_GetPartySize(param0->challengeType); - v2 = ov104_0223AA74(param0->challengeType, 1); + v1 = BattleFactory_GetPlayerPartySize(param0->challengeType); + v2 = BattleFactory_GetOpponentPartySize(param0->challengeType, 1); - Party_Init(param0->unk_4D4); + Party_Init(param0->playersParty); v3 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < v1; v0++) { - ov104_0222DF40(¶m0->unk_280[param0->unk_4DC[v0]], v3, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D4, v3); + FrontierPokemonDataDTO_InitPokemon(¶m0->unk_280[param0->unk_4DC[v0]], v3, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->playersParty, v3); param0->unk_4E8[v0] = param0->unk_254[param0->unk_4DC[v0]]; } for (v0 = 0; v0 < v2; v0++) { - ov104_0222DF40(¶m0->unk_3F0[v0], v3, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D8, v3); + FrontierPokemonDataDTO_InitPokemon(¶m0->unk_3F0[v0], v3, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->opponentsParty, v3); } Heap_Free(v3); @@ -497,27 +497,27 @@ void ov104_02234570(BattleFactory *param0) v5[v0] = 0; } - v3 = ov104_0223AA74(param0->challengeType, 1); - v1 = Party_GetCurrentCount(param0->unk_4D4); + v3 = BattleFactory_GetOpponentPartySize(param0->challengeType, 1); + v1 = Party_GetCurrentCount(param0->playersParty); for (v0 = 0; v0 < v1; v0++) { - v6 = Party_GetPokemonBySlotIndex(param0->unk_4D4, v0); + v6 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); v4[v0] = Pokemon_GetValue(v6, MON_DATA_SPECIES, NULL); v5[v0] = Pokemon_GetValue(v6, MON_DATA_HELD_ITEM, NULL); } v2 = v1; - v1 = Party_GetCurrentCount(param0->unk_4D8); + v1 = Party_GetCurrentCount(param0->opponentsParty); for (v0 = 0; v0 < v1; v0++) { - v6 = Party_GetPokemonBySlotIndex(param0->unk_4D8, v0); + v6 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v0); v4[v0 + v2] = Pokemon_GetValue(v6, MON_DATA_SPECIES, NULL); v5[v0 + v2] = Pokemon_GetValue(v6, MON_DATA_HELD_ITEM, NULL); param0->unk_254[v0] = param0->unk_3D2[v0]; } - v7 = ov104_0223A8A8(param0->unk_18[param0->unk_06], param0->unk_05); + v7 = ov104_0223A8A8(param0->trainerIDs[param0->unk_06], param0->unk_05); ov104_0223A918(v4, v5, v2 + v1, v3, param0->unk_3D2, 11, v7, 0, param0->unk_3DA); ov104_0222E330(param0->unk_3F0, param0->unk_3D2, param0->unk_3DA, NULL, param0->unk_3E0, v3, 11, 179); @@ -532,8 +532,8 @@ void ov104_022346A4(BattleFactory *param0) if (param0->unk_4DC[0] == 0xff) { (void)0; } else { - v0 = Party_GetPokemonBySlotIndex(param0->unk_4D8, param0->unk_4DC[1]); - Party_AddPokemonBySlotIndex(param0->unk_4D4, param0->unk_4DC[0], v0); + v0 = Party_GetPokemonBySlotIndex(param0->opponentsParty, param0->unk_4DC[1]); + Party_AddPokemonBySlotIndex(param0->playersParty, param0->unk_4DC[0], v0); param0->unk_4E8[param0->unk_4DC[0]] = param0->unk_254[param0->unk_4DC[1]]; @@ -551,22 +551,22 @@ void ov104_0223470C(BattleFactory *param0) Pokemon *v3; int v4; - v1 = BattleFactory_GetPartySize(param0->challengeType); - v2 = ov104_0223AA74(param0->challengeType, 1); + v1 = BattleFactory_GetPlayerPartySize(param0->challengeType); + v2 = BattleFactory_GetOpponentPartySize(param0->challengeType, 1); - Party_Init(param0->unk_4D8); + Party_Init(param0->opponentsParty); v3 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < v2; v0++) { - ov104_0222DF40(¶m0->unk_3F0[v0], v3, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D8, v3); + FrontierPokemonDataDTO_InitPokemon(¶m0->unk_3F0[v0], v3, BattleFactory_GetPokemonLevel(param0)); + ov104_0222E1C0(param0->saveData, param0->opponentsParty, v3); } Heap_Free(v3); for (v0 = 0; v0 < v2; v0++) { - v3 = Party_GetPokemonBySlotIndex(param0->unk_4D8, v0); + v3 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v0); } return; diff --git a/src/overlay104/ov104_02234DB4.c b/src/overlay104/ov104_02234DB4.c index e0650b0cee..f2e1a3f373 100644 --- a/src/overlay104/ov104_02234DB4.c +++ b/src/overlay104/ov104_02234DB4.c @@ -4,8 +4,6 @@ #include "constants/battle_frontier.h" -#include "struct_decls/struct_02030114_decl.h" -#include "struct_decls/struct_0203026C_decl.h" #include "struct_defs/battle_frontier.h" #include "applications/frontier/battle_hall/main.h" @@ -15,124 +13,111 @@ #include "overlay104/struct_battle_hall.h" #include "battle_frontier_stats.h" +#include "battle_hall_save.h" #include "battle_hall_win_records.h" #include "heap.h" #include "party.h" #include "pokemon.h" #include "savedata.h" #include "system_vars.h" -#include "unk_02030108.h" #include "unk_0205DFC4.h" #include "vars_flags.h" -BattleHall *ov104_02234DB4(SaveData *saveData, u16 param1, u8 param2, u8 param3, u8 param4); -void ov104_022350B0(BattleHall *param0, u16 param1); static void ov104_022350B8(BattleHall *param0); -void ov104_02235190(BattleHall *param0); static u16 GetBattleHallAppSelectedCell(BattleHallAppArgs *args, u8 unused); -BOOL ov104_02235534(BattleHall *param0, u16 param1, u16 param2); -static u16 ov104_022355C0(SaveData *saveData, u8 param1, u8 param2, u16 *param3, u16 *param4); -static void ov104_02235620(SaveData *saveData, u8 param1, u8 param2, u8 param3); -void ov104_022356A0(BattleHall *param0); +static u16 BattleHall_LoadTypeRanks(SaveData *saveData, u8 challengeType, u8 type, u16 *type1Rank, u16 *type2Rank); +static void BattleHall_SaveTypeRank(SaveData *saveData, u8 challengeType, u8 type, u8 value); static u16 ov104_02235704(BattleHall *param0); -void ov104_0223526C(BattleHall *param0, u8 param1); -u16 ov104_022354B0(BattleHall *param0); -u16 ov104_022354BC(BattleHall *param0); -u16 ov104_022354C0(BattleHall *param0, u8 param1); -void ov104_022354F4(BattleHall *param0); -void ov104_02235518(BattleHall *param0); -u16 ov104_02235578(BattleHall *param0); -BattleHall *ov104_02234DB4(SaveData *saveData, u16 param1, u8 param2, u8 param3, u8 param4) +BattleHall *BattleHall_Init(SaveData *saveData, u16 resumingFromSave, u8 challengeType, u8 partySlot1, u8 partySlot2) { - UnkStruct_02030114 *v0; - UnkStruct_0203026C *v1; - u8 v2, v3, v4; - u16 v5, v6, v7, v8; - Pokemon *v9; - static BattleHall *v10; + u16 i; - v10 = Heap_Alloc(HEAP_ID_FIELD2, sizeof(BattleHall)); - MI_CpuClear8(v10, sizeof(BattleHall)); + static BattleHall *battleHall; + battleHall = Heap_Alloc(HEAP_ID_FIELD2, sizeof(BattleHall)); - v10->unk_6F8 = sub_02030114(saveData); - v10->saveData = saveData; - v10->unk_00 = 11; - v10->unk_264 = Party_New(HEAP_ID_FIELD2); - v10->unk_D8C = Pokemon_New(HEAP_ID_FIELD2); + MI_CpuClear8(battleHall, sizeof(BattleHall)); - v0 = v10->unk_6F8; - v1 = sub_0203026C(saveData); + battleHall->hallSave = BattleHallSave_Get(saveData); + battleHall->saveData = saveData; + battleHall->unused = 11; + battleHall->party = Party_New(HEAP_ID_FIELD2); + battleHall->partnersMon = Pokemon_New(HEAP_ID_FIELD2); - if (param1 == 0) { - v10->challengeType = param2; - v4 = BattleHall_GetPartySize(v10->challengeType); - v10->unk_05 = 0; + BattleHallSave *currentChallenge = battleHall->hallSave; + BattleHallStreakFlags *streakFlags = BattleHallStreakFlags_Get(saveData); - sub_02030108(v0); + u8 streakActive, partySize; + if (!resumingFromSave) { + battleHall->challengeType = challengeType; + partySize = BattleHall_GetPlayerPartySize(battleHall->challengeType); + battleHall->unk_05 = 0; - if (v10->challengeType == 3) { - v2 = SystemVars_GetWiFiFrontierCleared(SaveData_GetVarsFlags(v10->saveData)); + BattleHallSave_Init(currentChallenge); + + if (battleHall->challengeType == FRONTIER_CHALLENGE_MULTI_WFC) { + streakActive = SystemVars_GetWiFiFrontierCleared(SaveData_GetVarsFlags(battleHall->saveData)); } else { - v2 = (u8)sub_020302B4(v1, 5, v10->challengeType, 0, NULL); + streakActive = BattleHallStreakFlags_GetFlag(streakFlags, HALL_SAVE_STREAK_FLAGS, battleHall->challengeType, 0, NULL); } - if (v2 == 1) { - v10->currentStreak = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(v10->saveData), BattleFrontierStats_GetHallLatestStreakIndex(v10->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(v10->challengeType))); + if (streakActive == TRUE) { + battleHall->currentStreak = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(battleHall->saveData), BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType))); } else { - v10->currentStreak = 0; + battleHall->currentStreak = 0; - for (v5 = 0; v5 < 18; v5++) { - ov104_02235620(v10->saveData, v10->challengeType, v5, 0); + for (i = 0; i < NUM_POKEMON_TYPES; i++) { + BattleHall_SaveTypeRank(battleHall->saveData, battleHall->challengeType, i, 0); } } - v10->unk_260[0] = param3; - v10->unk_260[1] = param4; + battleHall->partySlots[0] = partySlot1; + battleHall->partySlots[1] = partySlot2; } else { - v10->challengeType = (u8)sub_02030198(v0, 0, 0, 0, NULL); - v4 = BattleHall_GetPartySize(v10->challengeType); - v10->unk_05 = (u8)sub_02030198(v0, 1, 0, 0, NULL); - v10->currentStreak = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(v10->saveData), BattleFrontierStats_GetHallLatestStreakIndex(v10->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(v10->challengeType))); + battleHall->challengeType = BattleHallSave_GetMember(currentChallenge, HALL_SAVE_CHALLENGE_TYPE, 0, 0, NULL); + partySize = BattleHall_GetPlayerPartySize(battleHall->challengeType); + battleHall->unk_05 = BattleHallSave_GetMember(currentChallenge, HALL_SAVE_UNK_1, 0, 0, NULL); + battleHall->currentStreak = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(battleHall->saveData), BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType))); - for (v5 = 0; v5 < v4; v5++) { - v10->unk_260[v5] = (u8)sub_02030198(v0, 3, v5, 0, NULL); + for (i = 0; i < partySize; i++) { + battleHall->partySlots[i] = BattleHallSave_GetMember(currentChallenge, HALL_SAVE_PARTY_SLOTS, i, 0, NULL); } - for (v5 = 0; v5 < (10 * 2); v5++) { - v10->unk_18[v5] = (u16)sub_02030198(v0, 2, v5, 0, NULL); + for (i = 0; i < BATTLES_PER_ROUND_HALL * 2; i++) { + battleHall->trainerIDs[i] = BattleHallSave_GetMember(currentChallenge, HALL_SAVE_TRAINER_IDS, i, 0, NULL); } - for (v5 = 0; v5 < (10 * 2); v5++) { - v10->unk_268[v5] = (u8)sub_02030198(v0, 4, v5, 0, NULL); + for (i = 0; i < (10 * 2); i++) { + battleHall->unk_268[i] = (u8)BattleHallSave_GetMember(currentChallenge, HALL_SAVE_UNK_4, i, 0, NULL); } } - for (v5 = 0; v5 < v4; v5++) { - v9 = Party_GetPokemonBySlotIndex(SaveData_GetParty(v10->saveData), v10->unk_260[v5]); - v10->unk_728[v5] = Pokemon_GetValue(v9, MON_DATA_HELD_ITEM, NULL); + for (i = 0; i < partySize; i++) { + Pokemon *mon = Party_GetPokemonBySlotIndex(SaveData_GetParty(battleHall->saveData), battleHall->partySlots[i]); + battleHall->heldItems[i] = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); } - v10->unk_10 = 0; - v10->unk_0A = (u16)(v10->currentStreak / 10); + battleHall->unk_10 = 0; + battleHall->currentRound = battleHall->currentStreak / 10; - if (v10->challengeType == 2) { - for (v5 = 0; v5 < 18; v5++) { - sub_02030204(v5, &v10->unk_704[2][0], 10 - 1); + if (battleHall->challengeType == FRONTIER_CHALLENGE_MULTI) { + for (i = 0; i < NUM_POKEMON_TYPES; i++) { + BattleHall_SetRankOfType(i, &battleHall->typeRanks[2][0], 10 - 1); } } else { - for (v5 = 0; v5 < 18; v5++) { - v8 = ov104_022355C0(saveData, v10->challengeType, v5, &v6, &v7); + for (i = 0; i < NUM_POKEMON_TYPES; i++) { + u16 ptr1, ptr2; + u16 rank = BattleHall_LoadTypeRanks(saveData, battleHall->challengeType, i, &ptr1, &ptr2); - sub_02030204(v5, &v10->unk_704[v10->challengeType][0], v8); + BattleHall_SetRankOfType(i, &battleHall->typeRanks[battleHall->challengeType][0], rank); } } - if (BattleHall_IsMultiPlayerChallenge(v10->challengeType) == 1) { - ov104_0222E630(v10->saveData); + if (BattleHall_IsMultiPlayerChallenge(battleHall->challengeType) == TRUE) { + BattleFrontier_FlagGeonetLinkInfo(battleHall->saveData); } - return v10; + return battleHall; } void ov104_022350B0(BattleHall *param0, u16 param1) @@ -159,53 +144,51 @@ static void ov104_022350B8(BattleHall *param0) v1 = 2; } - v0 = BattleHall_GetRankOfType(param0->selectedTypeIdx, ¶m0->unk_704[param0->challengeType][0]); + v0 = BattleHall_GetRankOfType(param0->selectedTypeIdx, ¶m0->typeRanks[param0->challengeType][0]); param0->unk_07 = ov104_02235704(param0); - ov104_0223AF58(param0->selectedTypeIdx, v1, v0, param0->unk_05, param0->unk_18); - ov104_0223AFB4(param0->challengeType, v1, param0->unk_0A, v0, param0->unk_05, param0->unk_18); + ov104_0223AF58(param0->selectedTypeIdx, v1, v0, param0->unk_05, param0->trainerIDs); + ov104_0223AFB4(param0->challengeType, v1, param0->currentRound, v0, param0->unk_05, param0->trainerIDs); v2 = (param0->unk_05 * 2); - if ((param0->unk_18[v2] == 307) || (param0->unk_18[v2] == 308)) { + if ((param0->trainerIDs[v2] == 307) || (param0->trainerIDs[v2] == 308)) { v5 = ov104_0223B5C0(param0); v0 = v5; } - if (param0->unk_18[v2] == 307) { + if (param0->trainerIDs[v2] == 307) { v3 = 1; } - if (param0->unk_18[v2] == 308) { + if (param0->trainerIDs[v2] == 308) { v3 = 2; } - v6 = Party_GetPokemonBySlotIndex(param0->unk_264, 0); + v6 = Party_GetPokemonBySlotIndex(param0->party, 0); ov104_0223B0C8(1, param0->selectedType, v0, param0->unk_05, Pokemon_GetValue(v6, MON_DATA_SPECIES, NULL), param0->unk_268, v3); return; } -void ov104_02235190(BattleHall *param0) +void BattleHall_Free(BattleHall *battleHall) { - if (param0 == NULL) { + if (battleHall == NULL) { return; } - if (param0->unk_264 != NULL) { - Heap_Free(param0->unk_264); + if (battleHall->party != NULL) { + Heap_Free(battleHall->party); } - if (param0->unk_D8C != NULL) { - Heap_Free(param0->unk_D8C); + if (battleHall->partnersMon != NULL) { + Heap_Free(battleHall->partnersMon); } - MI_CpuClear8(param0, sizeof(BattleHall)); + MI_CpuClear8(battleHall, sizeof(BattleHall)); - Heap_Free(param0); - param0 = NULL; - - return; + Heap_Free(battleHall); + battleHall = NULL; } void BattleHall_GetTypeSelectionAppResult(BattleHall *battleHall, void *args) @@ -229,79 +212,76 @@ void BattleHall_UpdateWinRecordForCurrentMon(BattleHall *battleHall, u16 *update int unused, unused2; if (battleHall->challengeType != FRONTIER_CHALLENGE_MULTI_WFC) { - *updated = BattleHallWinRecords_UpdateRecord(battleHall->saveData, sub_0205E534(battleHall->challengeType), BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(sub_0205E534(battleHall->challengeType)), BattleFrontierStats_GetHallRecordStreakIndex(battleHall->challengeType), HEAP_ID_FIELD2, &unused, &unused2); + *updated = BattleHallWinRecords_UpdateRecord(battleHall->saveData, BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType)), BattleFrontierStats_GetHallRecordStreakIndex(battleHall->challengeType), HEAP_ID_FIELD2, &unused, &unused2); } else { *updated = 0; } } -void ov104_0223526C(BattleHall *param0, u8 param1) +void BattleHall_Save(BattleHall *battleHall, u8 saveType) { - u16 v0; - u8 v1[4]; - u16 v2[4]; - u32 v3[4]; + u16 i; + u8 u8Ptr[4]; + u16 u16Ptr[4]; + u32 u32Ptr[4]; BattleFrontier *frontier; - u16 v5, v6, v7, v8, v9; - Pokemon *v10; - UnkStruct_02030114 *v11 = param0->unk_6F8; - UnkStruct_0203026C *v12 = sub_0203026C(param0->saveData); + Pokemon *mon; + BattleHallStreakFlags *streakFlags = BattleHallStreakFlags_Get(battleHall->saveData); - frontier = SaveData_GetBattleFrontier(param0->saveData); - v1[0] = param0->challengeType; + frontier = SaveData_GetBattleFrontier(battleHall->saveData); - sub_02030140(param0->unk_6F8, 0, 0, 0, v1); - sub_0203012C(param0->unk_6F8, 1); + *u8Ptr = battleHall->challengeType; + BattleHallSave_SetMember(battleHall->hallSave, HALL_SAVE_CHALLENGE_TYPE, 0, 0, u8Ptr); + BattleHallSave_RecordSave(battleHall->hallSave, TRUE); - v10 = Party_GetPokemonBySlotIndex(SaveData_GetParty(param0->saveData), param0->unk_260[0]); - v9 = Pokemon_GetValue(v10, MON_DATA_SPECIES, NULL); - v8 = BattleFrontierStats_GetStat(frontier, BattleFrontierStats_GetHallLatestSpeciesIndex(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestSpeciesIndex(param0->challengeType))); - v1[0] = param0->unk_05; + mon = Party_GetPokemonBySlotIndex(SaveData_GetParty(battleHall->saveData), battleHall->partySlots[0]); + u16 currentSpecies = Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); + u16 speciesOnRecord = BattleFrontierStats_GetStat(frontier, BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType))); - sub_02030140(param0->unk_6F8, 1, 0, 0, v1); - BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallLatestStreakIndex(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(param0->challengeType)), param0->currentStreak); + *u8Ptr = battleHall->unk_05; + BattleHallSave_SetMember(battleHall->hallSave, HALL_SAVE_UNK_1, 0, 0, u8Ptr); + BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestStreakIndex(battleHall->challengeType)), battleHall->currentStreak); - if (param1 != 2) { - if (param0->challengeType != 3) { - BattleFrontierStats_SetStat(frontier, sub_0205E534(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(sub_0205E534(param0->challengeType)), param0->currentStreak); + if (saveType != 2) { + if (battleHall->challengeType != FRONTIER_CHALLENGE_MULTI_WFC) { + BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType)), battleHall->currentStreak); } else { - if (v8 != v9) { - BattleFrontierStats_SetStat(frontier, sub_0205E534(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(sub_0205E534(param0->challengeType)), param0->currentStreak); + if (speciesOnRecord != currentSpecies) { + BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType)), battleHall->currentStreak); } else { - BattleFrontierStats_SetIfBetter(frontier, sub_0205E534(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(sub_0205E534(param0->challengeType)), param0->currentStreak); + BattleFrontierStats_SetIfBetter(frontier, BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentStreakIndex(battleHall->challengeType)), battleHall->currentStreak); } } - v1[0] = param0->unk_06; - sub_02030280(v12, 5, param0->challengeType, 0, v1); + *u8Ptr = battleHall->streakActive; + BattleHallStreakFlags_SetFlag(streakFlags, HALL_SAVE_STREAK_FLAGS, battleHall->challengeType, 0, u8Ptr); - if (param0->challengeType == 3) { - BattleFrontierStats_SetStat(frontier, STAT_HALL_WFC_STREAK_ACTIVE, BattleFrontierStats_GetHostFriendIdx(STAT_HALL_WFC_STREAK_ACTIVE), param0->unk_06); + if (battleHall->challengeType == FRONTIER_CHALLENGE_MULTI_WFC) { + BattleFrontierStats_SetStat(frontier, STAT_HALL_WFC_STREAK_ACTIVE, BattleFrontierStats_GetHostFriendIdx(STAT_HALL_WFC_STREAK_ACTIVE), battleHall->streakActive); } } - for (v0 = 0; v0 < (10 * 2); v0++) { - v2[0] = param0->unk_18[v0]; - sub_02030140(param0->unk_6F8, 2, v0, 0, v2); + for (i = 0; i < (10 * 2); i++) { + *u16Ptr = battleHall->trainerIDs[i]; + BattleHallSave_SetMember(battleHall->hallSave, HALL_SAVE_TRAINER_IDS, i, 0, u16Ptr); } - for (v0 = 0; v0 < 2; v0++) { - v1[0] = param0->unk_260[v0]; - sub_02030140(param0->unk_6F8, 3, v0, 0, v1); + for (i = 0; i < 2; i++) { + *u8Ptr = battleHall->partySlots[i]; + BattleHallSave_SetMember(battleHall->hallSave, HALL_SAVE_PARTY_SLOTS, i, 0, u8Ptr); } - for (v0 = 0; v0 < 18; v0++) { - v1[0] = BattleHall_GetRankOfType(v0, ¶m0->unk_704[param0->challengeType][0]); - ov104_02235620(param0->saveData, param0->challengeType, v0, v1[0]); + for (i = 0; i < NUM_POKEMON_TYPES; i++) { + *u8Ptr = BattleHall_GetRankOfType(i, &battleHall->typeRanks[battleHall->challengeType][0]); + BattleHall_SaveTypeRank(battleHall->saveData, battleHall->challengeType, i, *u8Ptr); } - for (v0 = 0; v0 < (10 * 2); v0++) { - v2[0] = param0->unk_268[v0]; - sub_02030140(param0->unk_6F8, 4, v0, 0, v2); + for (i = 0; i < (10 * 2); i++) { + *u16Ptr = battleHall->unk_268[i]; + BattleHallSave_SetMember(battleHall->hallSave, HALL_SAVE_UNK_4, i, 0, u16Ptr); } - BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallLatestSpeciesIndex(param0->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestSpeciesIndex(param0->challengeType)), Pokemon_GetValue(v10, MON_DATA_SPECIES, NULL)); - return; + BattleFrontierStats_SetStat(frontier, BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallLatestSpeciesIndex(battleHall->challengeType)), Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL)); } u16 ov104_022354B0(BattleHall *param0) @@ -320,7 +300,7 @@ u16 ov104_022354C0(BattleHall *param0, u8 param1) FrontierTrainerDataDTO v0; u8 v2 = (param0->unk_05 * 2) + param1; - Heap_Free(BattleTower_GetTrainerData(&v0, param0->unk_18[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&v0, param0->trainerIDs[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); return BattleTower_GetObjectIDFromTrainerClass(v0.trainerType); } @@ -329,8 +309,8 @@ void ov104_022354F4(BattleHall *param0) { int v0; - sub_02030244(¶m0->unk_704[param0->challengeType][0]); - ov104_0223526C(param0, 1); + BattleHall_ResetRankOfAllTypes(¶m0->typeRanks[param0->challengeType][0]); + BattleHall_Save(param0, 1); return; } @@ -339,14 +319,14 @@ void ov104_02235518(BattleHall *param0) { Pokemon *v0; - param0->unk_06 = 1; + param0->streakActive = 1; - if (param0->unk_0A < 18) { - param0->unk_0A++; + if (param0->currentRound < 18) { + param0->currentRound++; } param0->unk_05 = 0; - ov104_0223526C(param0, 0); + BattleHall_Save(param0, 0); return; } @@ -383,16 +363,16 @@ u16 ov104_02235578(BattleHall *param0) static const u8 v2[18 + 1] = { 0, 6, 6, 6, 8, 8, 8, 10, 10, 10, 12, 12, 14, 15, 17, 17, 20, 20, 23 }; if ((param0->challengeType == 0) || (param0->challengeType == 1)) { - if (param0->unk_0A >= 18) { + if (param0->currentRound >= 18) { v0 = v1[18]; } else { - v0 = v1[param0->unk_0A]; + v0 = v1[param0->currentRound]; } } else { - if (param0->unk_0A >= 18) { + if (param0->currentRound >= 18) { v0 = v2[18]; } else { - v0 = v2[param0->unk_0A]; + v0 = v2[param0->currentRound]; } } @@ -407,45 +387,39 @@ u16 ov104_02235578(BattleHall *param0) return v0; } -static u16 ov104_022355C0(SaveData *saveData, u8 param1, u8 param2, u16 *param3, u16 *param4) +static u16 BattleHall_LoadTypeRanks(SaveData *saveData, u8 challengeType, u8 type, u16 *type1Rank, u16 *type2Rank) { - u16 v0 = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(saveData), sub_0205E4E0(param1, param2), BattleFrontierStats_GetHostFriendIdx(sub_0205E4E0(param1, param2))); - v0 &= 0xff; + u16 rankPair = BattleFrontierStats_GetStat(SaveData_GetBattleFrontier(saveData), BattleFrontierStats_GetHallCurrentTypeRanksIndex(challengeType, type), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentTypeRanksIndex(challengeType, type))); + rankPair &= 0xff; - *param3 = (v0 & 0xf); - *param4 = (v0 >> 4); + *type1Rank = rankPair & 0xf; + *type2Rank = rankPair >> 4; - if ((param2 % 2) == 0) { - return *param3; + if (type % 2 == 0) { + return *type1Rank; } else { - return *param4; + return *type2Rank; } } -static void ov104_02235620(SaveData *saveData, u8 param1, u8 param2, u8 param3) +static void BattleHall_SaveTypeRank(SaveData *saveData, u8 challengeType, u8 type, u8 value) { - u8 v0; - u8 v1; - u8 v2, v3; - u16 v4, v5; + u16 type1Rank, type2Rank; + BattleHall_LoadTypeRanks(saveData, challengeType, type, &type1Rank, &type2Rank); - ov104_022355C0(saveData, param1, param2, &v4, &v5); + u8 currentRanks = (type2Rank << 4) | type1Rank; + u8 nybble = type % 2; - v3 = ((v5 << 4) | v4); - v0 = (param2 / 2); - v1 = (param2 % 2); - - if (v1 == 0) { - v3 = v3 & 0xf0; + if (nybble == 0) { + currentRanks = currentRanks & 0xf0; } else { - v3 = v3 & 0xf; + currentRanks = currentRanks & 0xf; } - v2 = (param3 << (4 * v1)); - v3 |= v2; + u8 newRank = value << (4 * nybble); + currentRanks |= newRank; - BattleFrontierStats_SetStat(SaveData_GetBattleFrontier(saveData), sub_0205E4E0(param1, param2), BattleFrontierStats_GetHostFriendIdx(sub_0205E4E0(param1, param2)), v3); - return; + BattleFrontierStats_SetStat(SaveData_GetBattleFrontier(saveData), BattleFrontierStats_GetHallCurrentTypeRanksIndex(challengeType, type), BattleFrontierStats_GetHostFriendIdx(BattleFrontierStats_GetHallCurrentTypeRanksIndex(challengeType, type)), currentRanks); } void ov104_022356A0(BattleHall *param0) @@ -455,7 +429,7 @@ void ov104_022356A0(BattleHall *param0) if (param0->challengeType != 2) { for (v1 = 0; v1 < (18 - 1); v1++) { - v0 = BattleHall_GetRankOfType(v1, ¶m0->unk_704[param0->challengeType][0]); + v0 = BattleHall_GetRankOfType(v1, ¶m0->typeRanks[param0->challengeType][0]); if (v0 < 10) { break; @@ -464,7 +438,7 @@ void ov104_022356A0(BattleHall *param0) if (v1 == (18 - 1)) { for (v1 = 0; v1 < (18 - 1); v1++) { - sub_02030204(v1, ¶m0->unk_704[param0->challengeType][0], 10 - 1); + BattleHall_SetRankOfType(v1, ¶m0->typeRanks[param0->challengeType][0], 10 - 1); } } } @@ -486,7 +460,7 @@ static u16 ov104_02235704(BattleHall *param0) u8 v5; float v6, v7; - v5 = BattleHall_GetRankOfType(param0->selectedTypeIdx, ¶m0->unk_704[param0->challengeType][0]); + v5 = BattleHall_GetRankOfType(param0->selectedTypeIdx, ¶m0->typeRanks[param0->challengeType][0]); v2 = BattleHall_GetHighestLevelInParty(param0); if (param0->challengeType == 2) { @@ -510,7 +484,7 @@ static u16 ov104_02235704(BattleHall *param0) if (v3 == param0->selectedTypeIdx) { v7 += 1.0; } else { - if (BattleHall_GetRankOfType(v3, ¶m0->unk_704[param0->challengeType][0]) > 0) { + if (BattleHall_GetRankOfType(v3, ¶m0->typeRanks[param0->challengeType][0]) > 0) { v7 += 1.0; } } diff --git a/src/overlay104/ov104_022361B4.c b/src/overlay104/ov104_022361B4.c index 83825802e1..ce4798076f 100644 --- a/src/overlay104/ov104_022361B4.c +++ b/src/overlay104/ov104_022361B4.c @@ -73,8 +73,8 @@ BattleCastle *ov104_022361B4(SaveData *saveData, u16 param1, u8 param2, u16 para v9->unk_08 = sub_020302DC(saveData); v9->saveData = saveData; v9->unk_00 = 11; - v9->unk_28 = Party_New(HEAP_ID_FIELD2); - v9->unk_2C = Party_New(HEAP_ID_FIELD2); + v9->playersParty = Party_New(HEAP_ID_FIELD2); + v9->opponentsParty = Party_New(HEAP_ID_FIELD2); v9->unk_A20 = param6; v4 = v9->unk_08; @@ -130,12 +130,12 @@ BattleCastle *ov104_022361B4(SaveData *saveData, u16 param1, u8 param2, u16 para } v2 = SaveData_GetParty(v9->saveData); - v6 = BattleCastle_GetPartySize(v9->challengeType, 0); + v6 = BattleCastle_GetPlayerPartySize(v9->challengeType, 0); for (v7 = 0; v7 < v6; v7++) { - Party_AddPokemon(v9->unk_28, Party_GetPokemonBySlotIndex(v2, v9->unk_24[v7])); + Party_AddPokemon(v9->playersParty, Party_GetPokemonBySlotIndex(v2, v9->unk_24[v7])); - v3 = Party_GetPokemonBySlotIndex(v9->unk_28, v7); + v3 = Party_GetPokemonBySlotIndex(v9->playersParty, v7); v0 = 0; Pokemon_SetValue(v3, MON_DATA_HELD_ITEM, &v0); @@ -148,7 +148,7 @@ BattleCastle *ov104_022361B4(SaveData *saveData, u16 param1, u8 param2, u16 para } if (BattleCastle_IsMultiPlayerChallenge(v9->challengeType) == 1) { - ov104_0222E630(v9->saveData); + BattleFrontier_FlagGeonetLinkInfo(v9->saveData); } return v9; @@ -167,10 +167,10 @@ void ov104_02236514(BattleCastle *param0, u16 param1) static void ov104_02236528(BattleCastle *param0) { - u8 v0 = Party_GetCurrentCount(param0->unk_28); + u8 v0 = Party_GetCurrentCount(param0->playersParty); for (int i = 0; i < v0; i++) { - Pokemon *mon = Party_GetPokemonBySlotIndex(param0->unk_28, i); + Pokemon *mon = Party_GetPokemonBySlotIndex(param0->playersParty, i); param0->unk_394[i][0] = Pokemon_GetValue(mon, MON_DATA_MOVE1_PP, NULL); param0->unk_394[i][1] = Pokemon_GetValue(mon, MON_DATA_MOVE2_PP, NULL); @@ -178,9 +178,9 @@ static void ov104_02236528(BattleCastle *param0) param0->unk_394[i][3] = Pokemon_GetValue(mon, MON_DATA_MOVE4_PP, NULL); } - ov104_0223B760(param0->challengeType, ov104_0223BB60(param0), param0->unk_30, 7 * 2); + ov104_0223B760(param0->challengeType, ov104_0223BB60(param0), param0->trainerIDs, 7 * 2); - ov104_0222E4BC(ov104_0223B7DC(param0->challengeType, 1), param0->unk_30[param0->unk_11], param0->unk_30[param0->unk_11 + 7], param0->unk_26C, param0->unk_288, param0->unk_274, param0->unk_278, BattleCastle_IsMultiPlayerChallenge(param0->challengeType)); + ov104_0222E4BC(BattleCastle_GetOpponentPartySize(param0->challengeType, 1), param0->trainerIDs[param0->unk_11], param0->trainerIDs[param0->unk_11 + 7], param0->unk_26C, param0->unk_288, param0->unk_274, param0->unk_278, BattleCastle_IsMultiPlayerChallenge(param0->challengeType)); return; } @@ -199,7 +199,7 @@ static void ov104_022365F8(BattleCastle *param0) ov104_022366A4(param0); for (v1 = 0; v1 < (7 * 2); v1++) { - param0->unk_30[v1] = (u16)sub_02030398(param0->unk_08, 6, v1, 0, NULL); + param0->trainerIDs[v1] = (u16)sub_02030398(param0->unk_08, 6, v1, 0, NULL); } for (v1 = 0; v1 < 4; v1++) { @@ -212,8 +212,8 @@ static void ov104_022365F8(BattleCastle *param0) v2 = Pokemon_New(HEAP_ID_FIELD2); for (v1 = 0; v1 < 4; v1++) { - ov104_0222DF40(&v4[v1], v2, ov104_0223BA10(param0)); - ov104_0223BAA0(param0, param0->unk_2C, v2); + FrontierPokemonDataDTO_InitPokemon(&v4[v1], v2, BattleCastle_GetOpponentLevel(param0)); + ov104_0223BAA0(param0, param0->opponentsParty, v2); } Heap_Free(v2); @@ -230,10 +230,10 @@ static void ov104_022366A4(BattleCastle *param0) int v4; Pokemon *v5; - v0 = Party_GetCurrentCount(param0->unk_28); + v0 = Party_GetCurrentCount(param0->playersParty); for (v4 = 0; v4 < v0; v4++) { - v5 = Party_GetPokemonBySlotIndex(param0->unk_28, v4); + v5 = Party_GetPokemonBySlotIndex(param0->playersParty, v4); v2 = (u16)sub_02030398(param0->unk_08, 2, v4, 0, NULL); Pokemon_SetValue(v5, MON_DATA_HP, &v2); @@ -268,12 +268,12 @@ void ov104_022367AC(BattleCastle *param0) return; } - if (param0->unk_28 != NULL) { - Heap_Free(param0->unk_28); + if (param0->playersParty != NULL) { + Heap_Free(param0->playersParty); } - if (param0->unk_2C != NULL) { - Heap_Free(param0->unk_2C); + if (param0->opponentsParty != NULL) { + Heap_Free(param0->opponentsParty); } MI_CpuClear8(param0, sizeof(BattleCastle)); @@ -324,7 +324,7 @@ void ov104_02236848(BattleCastle *param0, u8 param1) UnkStruct_0203041C *v13 = sub_0203041C(param0->saveData); frontier = SaveData_GetBattleFrontier(param0->saveData); - v3 = ov104_0223B7DC(param0->challengeType, 1); + v3 = BattleCastle_GetOpponentPartySize(param0->challengeType, 1); v4[0] = param0->challengeType; sub_02030308(param0->unk_08, 0, 0, 0, v4); @@ -356,7 +356,7 @@ void ov104_02236848(BattleCastle *param0, u8 param1) } for (v0 = 0; v0 < (7 * 2); v0++) { - v5[0] = param0->unk_30[v0]; + v5[0] = param0->trainerIDs[v0]; sub_02030308(param0->unk_08, 6, v0, 0, v5); } @@ -365,10 +365,10 @@ void ov104_02236848(BattleCastle *param0, u8 param1) sub_02030308(param0->unk_08, 7, v0, 0, v4); } - v8 = Party_GetCurrentCount(param0->unk_28); + v8 = Party_GetCurrentCount(param0->playersParty); for (v0 = 0; v0 < v8; v0++) { - v11 = Party_GetPokemonBySlotIndex(param0->unk_28, v0); + v11 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); v5[0] = Pokemon_GetValue(v11, MON_DATA_HP, NULL); sub_02030308(param0->unk_08, 2, v0, 0, v5); @@ -392,10 +392,10 @@ void ov104_02236848(BattleCastle *param0, u8 param1) sub_02030308(param0->unk_08, 5, v0, 0, v5); } - v8 = Party_GetCurrentCount(param0->unk_2C); + v8 = Party_GetCurrentCount(param0->opponentsParty); for (v0 = 0; v0 < v8; v0++) { - v11 = Party_GetPokemonBySlotIndex(param0->unk_2C, v0); + v11 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v0); v5[0] = param0->unk_26C[v0]; sub_02030308(param0->unk_08, 8, v0, 0, v5); @@ -420,7 +420,7 @@ u16 ov104_02236B58(BattleCastle *param0, u8 param1) FrontierTrainerDataDTO v0; u8 v2 = param0->unk_11 + (param1 * 7); - Heap_Free(BattleTower_GetTrainerData(&v0, param0->unk_30[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&v0, param0->trainerIDs[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); return BattleTower_GetObjectIDFromTrainerClass(v0.trainerType); } @@ -465,7 +465,7 @@ void ov104_02236BF8(BattleCastle *param0) { int v0, v1, v2; - ov104_0222E4BC(ov104_0223B7DC(param0->challengeType, 1), param0->unk_30[param0->unk_11], param0->unk_30[param0->unk_11 + 7], param0->unk_26C, param0->unk_288, param0->unk_274, param0->unk_278, BattleCastle_IsMultiPlayerChallenge(param0->challengeType)); + ov104_0222E4BC(BattleCastle_GetOpponentPartySize(param0->challengeType, 1), param0->trainerIDs[param0->unk_11], param0->trainerIDs[param0->unk_11 + 7], param0->unk_26C, param0->unk_288, param0->unk_274, param0->unk_278, BattleCastle_IsMultiPlayerChallenge(param0->challengeType)); for (v0 = 0; v0 < 4; v0++) { (void)0; @@ -487,11 +487,11 @@ void ov104_02236C50(BattleCastle *param0) v0 = 2; } - v1 = BattleCastle_GetPartySize(param0->challengeType, 0); - v3 = Party_GetCurrentCount(param0->unk_28); + v1 = BattleCastle_GetPlayerPartySize(param0->challengeType, 0); + v3 = Party_GetCurrentCount(param0->playersParty); for (v2 = v0; v2 < (v1 + v0); v2++) { - v4 = Party_GetPokemonBySlotIndex(param0->unk_28, v2); + v4 = Party_GetPokemonBySlotIndex(param0->playersParty, v2); param0->unk_394[v2 - v0][0] = Pokemon_GetValue(v4, MON_DATA_MOVE1_PP, NULL); param0->unk_394[v2 - v0][1] = Pokemon_GetValue(v4, MON_DATA_MOVE2_PP, NULL); @@ -499,7 +499,7 @@ void ov104_02236C50(BattleCastle *param0) param0->unk_394[v2 - v0][3] = Pokemon_GetValue(v4, MON_DATA_MOVE4_PP, NULL); } - ov104_0223BA24(param0->unk_28); + ov104_0223BA24(param0->playersParty); for (v2 = 0; v2 < 4; v2++) { param0->appIdentityUnlocked[v2] = 0; @@ -533,11 +533,11 @@ int ov104_02236D10(BattleCastle *param0) v2 = 2; } - v0 = BattleCastle_GetPartySize(param0->challengeType, 0); - v1 = ov104_0223B7DC(param0->challengeType, 1); + v0 = BattleCastle_GetPlayerPartySize(param0->challengeType, 0); + v1 = BattleCastle_GetOpponentPartySize(param0->challengeType, 1); for (v5 = v2; v5 < (v0 + v2); v5++) { - v9 = Party_GetPokemonBySlotIndex(param0->unk_28, v5); + v9 = Party_GetPokemonBySlotIndex(param0->playersParty, v5); if (Pokemon_GetValue(v9, MON_DATA_SPECIES_EXISTS, NULL) == 0) { continue; diff --git a/src/overlay104/ov104_02237DD8.c b/src/overlay104/ov104_02237DD8.c index f28f87ef62..dd6fb3135e 100644 --- a/src/overlay104/ov104_02237DD8.c +++ b/src/overlay104/ov104_02237DD8.c @@ -151,8 +151,8 @@ BattleArcade *ov104_02237DD8(SaveData *saveData, u16 param1, u8 param2, u16 para v9->unk_08 = sub_020304A0(saveData); v9->saveData = saveData; v9->unk_00 = 11; - v9->unk_70 = Party_New(HEAP_ID_FIELD2); - v9->unk_74 = Party_New(HEAP_ID_FIELD2); + v9->playersParty = Party_New(HEAP_ID_FIELD2); + v9->opponentsParty = Party_New(HEAP_ID_FIELD2); v9->unk_A80 = param6; v9->activeEffect = 32; @@ -204,12 +204,12 @@ BattleArcade *ov104_02237DD8(SaveData *saveData, u16 param1, u8 param2, u16 para } v2 = SaveData_GetParty(v9->saveData); - v6 = BattleArcade_GetPartySize(v9->challengeType, 0); + v6 = BattleArcade_GetPlayerPartySize(v9->challengeType, 0); for (v7 = 0; v7 < v6; v7++) { - Party_AddPokemon(v9->unk_70, Party_GetPokemonBySlotIndex(v2, v9->unk_2C[v7])); + Party_AddPokemon(v9->playersParty, Party_GetPokemonBySlotIndex(v2, v9->unk_2C[v7])); - v3 = Party_GetPokemonBySlotIndex(v9->unk_70, v7); + v3 = Party_GetPokemonBySlotIndex(v9->playersParty, v7); v0 = 0; Pokemon_SetValue(v3, MON_DATA_HELD_ITEM, &v0); @@ -222,7 +222,7 @@ BattleArcade *ov104_02237DD8(SaveData *saveData, u16 param1, u8 param2, u16 para } if (BattleArcade_IsMultiPlayerChallenge(v9->challengeType) == 1) { - ov104_0222E630(v9->saveData); + BattleFrontier_FlagGeonetLinkInfo(v9->saveData); } return v9; @@ -241,9 +241,9 @@ void ov104_0223806C(BattleArcade *param0, u16 param1) static void ov104_02238080(BattleArcade *param0) { - ov104_0223BD28(param0->challengeType, ov104_0223C124(param0), param0->unk_78, 7 * 2); + ov104_0223BD28(param0->challengeType, ov104_0223C124(param0), param0->trainerIDs, 7 * 2); - ov104_0222E4BC(BattleArcade_GetOpponentPartySize(param0->challengeType, 1), param0->unk_78[param0->unk_11], param0->unk_78[param0->unk_11 + 7], param0->unk_314, param0->unk_330, param0->unk_31C, param0->unk_320, BattleArcade_IsMultiPlayerChallenge(param0->challengeType)); + ov104_0222E4BC(BattleArcade_GetOpponentPartySize(param0->challengeType, 1), param0->trainerIDs[param0->unk_11], param0->trainerIDs[param0->unk_11 + 7], param0->unk_314, param0->unk_330, param0->unk_31C, param0->unk_320, BattleArcade_IsMultiPlayerChallenge(param0->challengeType)); u16 v0 = ov104_0223C124(param0); @@ -268,7 +268,7 @@ static void ov104_02238114(BattleArcade *param0) ov104_022381C4(param0); for (v1 = 0; v1 < (7 * 2); v1++) { - param0->unk_78[v1] = (u16)sub_0203054C(param0->unk_08, 5, v1, 0, NULL); + param0->trainerIDs[v1] = (u16)sub_0203054C(param0->unk_08, 5, v1, 0, NULL); } for (v1 = 0; v1 < 4; v1++) { @@ -281,8 +281,8 @@ static void ov104_02238114(BattleArcade *param0) Pokemon *v2 = Pokemon_New(HEAP_ID_FIELD2); for (v1 = 0; v1 < 4; v1++) { - ov104_0222DF40(&v4[v1], v2, ov104_0223BFFC(param0)); - ov104_0223C034(param0, param0->unk_74, v2); + FrontierPokemonDataDTO_InitPokemon(&v4[v1], v2, BattleArcade_GetPokemonLevel(param0)); + ov104_0223C034(param0, param0->opponentsParty, v2); } Heap_Free(v2); @@ -297,10 +297,10 @@ static void ov104_022381C4(BattleArcade *param0) int v2; Pokemon *v3; - v0 = Party_GetCurrentCount(param0->unk_70); + v0 = Party_GetCurrentCount(param0->playersParty); for (v2 = 0; v2 < v0; v2++) { - v3 = Party_GetPokemonBySlotIndex(param0->unk_70, v2); + v3 = Party_GetPokemonBySlotIndex(param0->playersParty, v2); v1 = (u16)sub_0203054C(param0->unk_08, 4, v2, 0, NULL); Pokemon_SetValue(v3, MON_DATA_HELD_ITEM, &v1); @@ -317,12 +317,12 @@ void ov104_02238210(BattleArcade *param0) return; } - if (param0->unk_70 != NULL) { - Heap_Free(param0->unk_70); + if (param0->playersParty != NULL) { + Heap_Free(param0->playersParty); } - if (param0->unk_74 != NULL) { - Heap_Free(param0->unk_74); + if (param0->opponentsParty != NULL) { + Heap_Free(param0->opponentsParty); } MI_CpuClear8(param0, sizeof(BattleArcade)); @@ -390,7 +390,7 @@ void ov104_02238278(BattleArcade *param0, u8 param1) } for (v0 = 0; v0 < (7 * 2); v0++) { - v3[0] = param0->unk_78[v0]; + v3[0] = param0->trainerIDs[v0]; sub_020304CC(param0->unk_08, 5, v0, 0, v3); } @@ -399,18 +399,18 @@ void ov104_02238278(BattleArcade *param0, u8 param1) sub_020304CC(param0->unk_08, 6, v0, 0, v2); } - v6 = Party_GetCurrentCount(param0->unk_70); + v6 = Party_GetCurrentCount(param0->playersParty); for (v0 = 0; v0 < v6; v0++) { - v7 = Party_GetPokemonBySlotIndex(param0->unk_70, v0); + v7 = Party_GetPokemonBySlotIndex(param0->playersParty, v0); v3[0] = Pokemon_GetValue(v7, MON_DATA_HELD_ITEM, NULL); sub_020304CC(param0->unk_08, 4, v0, 0, v3); } - v6 = Party_GetCurrentCount(param0->unk_74); + v6 = Party_GetCurrentCount(param0->opponentsParty); for (v0 = 0; v0 < v6; v0++) { - v7 = Party_GetPokemonBySlotIndex(param0->unk_74, v0); + v7 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v0); v3[0] = param0->unk_314[v0]; sub_020304CC(param0->unk_08, 7, v0, 0, v3); } @@ -434,7 +434,7 @@ u16 ov104_02238464(BattleArcade *param0, u8 param1) FrontierTrainerDataDTO v0; u8 v2 = ov104_02238498(param0, param1); - Heap_Free(BattleTower_GetTrainerData(&v0, param0->unk_78[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&v0, param0->trainerIDs[v2], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); return BattleTower_GetObjectIDFromTrainerClass(v0.trainerType); } @@ -478,7 +478,7 @@ void ov104_022384DC(BattleArcade *param0) int v0, v1, v2; u8 v3; - ov104_0222E4BC(BattleArcade_GetOpponentPartySize(param0->challengeType, 1), param0->unk_78[param0->unk_11], param0->unk_78[param0->unk_11 + 7], param0->unk_314, param0->unk_330, param0->unk_31C, param0->unk_320, BattleArcade_IsMultiPlayerChallenge(param0->challengeType)); + ov104_0222E4BC(BattleArcade_GetOpponentPartySize(param0->challengeType, 1), param0->trainerIDs[param0->unk_11], param0->trainerIDs[param0->unk_11 + 7], param0->unk_314, param0->unk_330, param0->unk_31C, param0->unk_320, BattleArcade_IsMultiPlayerChallenge(param0->challengeType)); for (v0 = 0; v0 < 4; v0++) { (void)0; @@ -519,7 +519,7 @@ int ov104_02238538(BattleArcade *param0, Party *param1, Party *param2, int param int v1; Pokemon *v2; int v3 = 0; - v0 = BattleArcade_GetPartySize(param0->challengeType, 0); + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 0); v3 += ov104_02238584(param0, param1, param2, v0); @@ -656,18 +656,18 @@ void ov104_02238764(BattleArcade *param0, FrontierGraphics *param1, u16 param2) int v2; Pokemon *v3; - v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); v1 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); if (param2 == 0) { for (v2 = 0; v2 < v0; v2++) { - v3 = Party_GetPokemonBySlotIndex(param0->unk_70, v2); + v3 = Party_GetPokemonBySlotIndex(param0->playersParty, v2); param0->unk_30[v2] = ov104_02232F4C(param1, v3, v2, Unk_ov104_0223FB18[v2].unk_00, Unk_ov104_0223FB18[v2].unk_02); Sprite_SetAnimateFlag(param0->unk_30[v2]->sprite, 0); } } else { for (v2 = 0; v2 < v1; v2++) { - v3 = Party_GetPokemonBySlotIndex(param0->unk_74, v2); + v3 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v2); param0->unk_40[v2] = ov104_02232F4C(param1, v3, v2 + v0, Unk_ov104_0223FB28[v2].unk_00, Unk_ov104_0223FB28[v2].unk_02); Sprite_SetAnimateFlag(param0->unk_40[v2]->sprite, 0); } @@ -681,7 +681,7 @@ void ov104_02238814(BattleArcade *param0, FrontierGraphics *param1, u16 param2) u8 v0, v1; int v2; - v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); v1 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); if (param2 == 0) { @@ -699,7 +699,7 @@ void ov104_02238814(BattleArcade *param0, FrontierGraphics *param1, u16 param2) void ov104_0223886C(BattleArcade *param0, FrontierGraphics *param1, u16 param2, u16 param3) { - u8 v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + u8 v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); if (param3 >= v0) { return; @@ -737,14 +737,14 @@ void ov104_022388DC(BattleArcade *param0, FrontierGraphics *param1, u16 param2) int v2; Pokemon *v3; - v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); v1 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); if (param2 == 0) { for (v2 = 0; v2 < v0; v2++) { param0->unk_50[v2] = ov104_022330AC(param1, Unk_ov104_0223FB18[v2].unk_00 + 8, Unk_ov104_0223FB18[v2].unk_02 + 4); - v3 = Party_GetPokemonBySlotIndex(param0->unk_70, v2); + v3 = Party_GetPokemonBySlotIndex(param0->playersParty, v2); if (Pokemon_GetValue(v3, MON_DATA_HELD_ITEM, NULL) == 0) { Sprite_SetDrawFlag(param0->unk_50[v2]->sprite, FALSE); @@ -754,7 +754,7 @@ void ov104_022388DC(BattleArcade *param0, FrontierGraphics *param1, u16 param2) for (v2 = 0; v2 < v1; v2++) { param0->unk_60[v2] = ov104_022330AC(param1, Unk_ov104_0223FB28[v2].unk_00 + 8, Unk_ov104_0223FB28[v2].unk_02 + 4); - v3 = Party_GetPokemonBySlotIndex(param0->unk_74, v2); + v3 = Party_GetPokemonBySlotIndex(param0->opponentsParty, v2); if (Pokemon_GetValue(v3, MON_DATA_HELD_ITEM, NULL) == 0) { Sprite_SetDrawFlag(param0->unk_60[v2]->sprite, FALSE); @@ -770,7 +770,7 @@ void ov104_022389A0(BattleArcade *param0, FrontierGraphics *param1, u16 param2) u8 v0, v1; int v2; - v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); v1 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); if (param2 == 0) { @@ -792,7 +792,7 @@ void ov104_022389F4(BattleArcade *param0, FrontierGraphics *param1, u16 param2, u8 v1, v2; Pokemon *mon; - v1 = BattleArcade_GetPartySize(param0->challengeType, 1); + v1 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); v2 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); if (param2 == 0) { @@ -800,7 +800,7 @@ void ov104_022389F4(BattleArcade *param0, FrontierGraphics *param1, u16 param2, return; } - mon = Party_GetPokemonBySlotIndex(param0->unk_70, slot); + mon = Party_GetPokemonBySlotIndex(param0->playersParty, slot); item = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); if (param4 == 1) { @@ -817,7 +817,7 @@ void ov104_022389F4(BattleArcade *param0, FrontierGraphics *param1, u16 param2, return; } - mon = Party_GetPokemonBySlotIndex(param0->unk_74, slot); + mon = Party_GetPokemonBySlotIndex(param0->opponentsParty, slot); item = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); if (param4 == 1) { @@ -1043,11 +1043,11 @@ void ov104_02238B88(BattleArcade *param0, u8 param1) UnkFuncPtr_ov104_02238B88 v2; if (param1 < 9) { - v1 = param0->unk_74; + v1 = param0->opponentsParty; v0 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); } else { - v1 = param0->unk_70; - v0 = BattleArcade_GetPartySize(param0->challengeType, 1); + v1 = param0->playersParty; + v0 = BattleArcade_GetPlayerPartySize(param0->challengeType, 1); } v2 = Unk_ov104_02241A38[param1]; @@ -1324,7 +1324,7 @@ static void ov104_02238FAC(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 1001; + param0->weather = 1001; return; } @@ -1332,7 +1332,7 @@ static void ov104_02238FB8(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 2; + param0->weather = 2; return; } @@ -1340,7 +1340,7 @@ static void ov104_02238FC0(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 10; + param0->weather = 10; return; } @@ -1348,7 +1348,7 @@ static void ov104_02238FC8(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 5; + param0->weather = 5; return; } @@ -1356,7 +1356,7 @@ static void ov104_02238FD0(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 14; + param0->weather = 14; return; } @@ -1364,7 +1364,7 @@ static void ov104_02238FD8(BattleArcade *param0, Party *param1, u8 param2) { Pokemon *v0; - param0->unk_14 = 1002; + param0->weather = 1002; return; } diff --git a/src/overlay104/ov104_022394A4.c b/src/overlay104/ov104_022394A4.c index 0a212b9390..980f113b84 100644 --- a/src/overlay104/ov104_022394A4.c +++ b/src/overlay104/ov104_022394A4.c @@ -21,7 +21,7 @@ void BattleTower_CreateOpponentParties(BattleTower *battleTower, SaveData *saveD switch (battleTower->challengeMode) { case BATTLE_TOWER_MODE_WIFI: case BATTLE_TOWER_MODE_5: - ov104_0223A30C(saveData, battleTower->opponentsDataDTO, battleTower->nextOpponentNum - 1); + BattleTower_CreateWiFiTrainerParty(saveData, battleTower->opponentsDataDTO, battleTower->nextOpponentNum - 1); break; case BATTLE_TOWER_MODE_MULTI: case BATTLE_TOWER_MODE_LINK_MULTI: diff --git a/src/overlay104/ov104_022395F0.c b/src/overlay104/ov104_022395F0.c index 4c1c107005..6ca8a919c1 100644 --- a/src/overlay104/ov104_022395F0.c +++ b/src/overlay104/ov104_022395F0.c @@ -18,13 +18,13 @@ #include "overlay104/struct_ov104_02230BE4.h" #include "battle_frontier_stats.h" +#include "battle_hall_save.h" #include "comm_command_frontier.h" #include "communication_system.h" #include "heap.h" #include "item_use_pokemon.h" #include "party.h" #include "unk_0202D05C.h" -#include "unk_02030108.h" #include "unk_02049D08.h" #include "unk_0204FA34.h" #include "unk_0205DFC4.h" @@ -229,7 +229,7 @@ BOOL FrontierScrCmd_B2(FrontierScriptContext *param0) *v9 = v4->unk_76[v7]; break; case 6: - sub_0204FA50(v5->saveData, sub_0203026C(v5->saveData), 3); + sub_0204FA50(v5->saveData, BattleHallStreakFlags_Get(v5->saveData), 3); break; case 7: v4->unk_A0 = v7; @@ -316,7 +316,7 @@ BOOL FrontierScrCmd_B3(FrontierScriptContext *param0) sub_0209B980(param0->scriptMan->unk_00, battleTower); if (battleTower->challengeMode == BATTLE_TOWER_MODE_6) { - ov104_0222E630(v2->saveData); + BattleFrontier_FlagGeonetLinkInfo(v2->saveData); } for (v0 = 0; v0 < battleTower->partySize; v0++) { diff --git a/src/overlay104/ov104_0223A0C4.c b/src/overlay104/ov104_0223A0C4.c index 657554f5e2..ad106ef7fc 100644 --- a/src/overlay104/ov104_0223A0C4.c +++ b/src/overlay104/ov104_0223A0C4.c @@ -4,7 +4,11 @@ #include #include "constants/battle_tower.h" +#include "constants/charcode.h" +#include "constants/pokemon.h" +#include "generated/ai_flags.h" #include "generated/battle_tower_modes.h" +#include "generated/moves.h" #include "generated/species_data_params.h" #include "struct_defs/battle_frontier_pokemon_data.h" @@ -26,565 +30,565 @@ #include "unk_0202D05C.h" #include "unk_02049D08.h" -const FrontierPokemonDataDTO Unk_ov104_0223FE30[] = { +const FrontierPokemonDataDTO sDummyPokemonDTOs[] = { { - 0x1, - 0x0, - 0xEA, - { 0x16, 0x4B, 0xEB, 0x4C }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x86, 0x68, 0x5f, 0x71, 0x7E, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_BULBASAUR, + .form = 0, + .item = ITEM_LEFTOVERS, + .moves = { MOVE_VINE_WHIP, MOVE_RAZOR_LEAF, MOVE_SYNTHESIS, MOVE_SOLAR_BEAM }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_FU, CHAR_KATAKANA_SHI, CHAR_KATAKANA_GI, CHAR_KATAKANA_DA, CHAR_KATAKANA_NE, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x4, - 0x0, - 0xFD, - { 0x34, 0x53, 0x35, 0x7E }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x83, 0x79, 0x5C, 0x63, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_CHARMANDER, + .form = 0, + .item = ITEM_SHELL_BELL, + .moves = { MOVE_EMBER, MOVE_FIRE_SPIN, MOVE_FLAMETHROWER, MOVE_FIRE_BLAST }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_HI, CHAR_KATAKANA_TO, CHAR_KATAKANA_KA, CHAR_KATAKANA_GE, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x7, - 0x0, - 0xF3, - { 0x37, 0x39, 0x160, 0x38 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x6D, 0x7C, 0x5D, 0x92, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SQUIRTLE, + .form = 0, + .item = ITEM_MYSTIC_WATER, + .moves = { MOVE_WATER_GUN, MOVE_SURF, MOVE_WATER_PULSE, MOVE_HYDRO_PUMP }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_ZE, CHAR_KATAKANA_NI, CHAR_KATAKANA_GA, CHAR_KATAKANA_ME, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x7B, - 0x0, - 0xDD, - { 0x13E, 0xD3, 0x68, 0x13A }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x6A, 0x79, 0x9A, 0x55, 0x60, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SCYTHER, + .form = 0, + .item = ITEM_KINGS_ROCK, + .moves = { MOVE_SILVER_WIND, MOVE_STEEL_WING, MOVE_DOUBLE_TEAM, MOVE_AIR_CUTTER }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_SU, CHAR_KATAKANA_TO, CHAR_KATAKANA_RA, CHAR_KATAKANA_I, CHAR_KATAKANA_KU, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x16B, - 0x0, - 0xF6, - { 0x12D, 0x160, 0x102, 0xBD }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x70, 0x8f, 0x67, 0x9A, 0x68, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SPHEAL, + .form = 0, + .item = ITEM_NEVERMELTICE, + .moves = { MOVE_ICE_BALL, MOVE_WATER_PULSE, MOVE_HAIL, MOVE_MUD_SLAP }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_TA, CHAR_KATAKANA_MA, CHAR_KATAKANA_ZA, CHAR_KATAKANA_RA, CHAR_KATAKANA_SHI, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x51, - 0x0, - 0x99, - { 0x15F, 0x30, 0x13F, 0x73 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x64, 0x55, 0x9C, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_MAGNEMITE, + .form = 0, + .item = ITEM_ASPEAR_BERRY, + .moves = { MOVE_SHOCK_WAVE, MOVE_SUPERSONIC, MOVE_METAL_SOUND, MOVE_REFLECT }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_KO, CHAR_KATAKANA_I, CHAR_KATAKANA_RU, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x12C, - 0x0, - 0xD9, - { 0x2F, 0x139, 0xCC, 0x3 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x59, 0x7E, 0x64, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SKITTY, + .form = 0, + .item = ITEM_QUICK_CLAW, + .moves = { MOVE_SING, MOVE_FAKE_TEARS, MOVE_CHARM, MOVE_DOUBLE_SLAP }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_E, CHAR_KATAKANA_NE, CHAR_KATAKANA_KO, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x128, - 0x0, - 0xE8, - { 0xFC, 0x45, 0xC5, 0x12 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x8f, 0x60, 0x7f, 0x68, 0x70, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_MAKUHITA, + .form = 0, + .item = ITEM_SCOPE_LENS, + .moves = { MOVE_FAKE_OUT, MOVE_SEISMIC_TOSS, MOVE_DETECT, MOVE_WHIRLWIND }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_MA, CHAR_KATAKANA_KU, CHAR_KATAKANA_NO, CHAR_KATAKANA_SHI, CHAR_KATAKANA_TA, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0xA7, - 0x0, - 0xC9, - { 0x144, 0x65, 0xA9, 0xB8 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x55, 0x79, 0x8f, 0x9C, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SPINARAK, + .form = 0, + .item = ITEM_LIECHI_BERRY, + .moves = { MOVE_SIGNAL_BEAM, MOVE_NIGHT_SHADE, MOVE_SPIDER_WEB, MOVE_SCARY_FACE }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_I, CHAR_KATAKANA_TO, CHAR_KATAKANA_MA, CHAR_KATAKANA_RU, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x1B, - 0x0, - 0xED, - { 0x5B, 0x13D, 0xC9, 0x1C }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x66, 0xA1, 0x7A, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_SANDSHREW, + .form = 0, + .item = ITEM_SOFT_SAND, + .moves = { MOVE_DIG, MOVE_ROCK_TOMB, MOVE_SANDSTORM, MOVE_SAND_ATTACK }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_SA, CHAR_KATAKANA_N, CHAR_KATAKANA_DO, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x114, - 0x0, - 0xCB, - { 0x13, 0x62, 0x11B, 0x74 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x6A, 0x81, 0x92, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_TAILLOW, + .form = 0, + .item = ITEM_SALAC_BERRY, + .moves = { MOVE_FLY, MOVE_QUICK_ATTACK, MOVE_ENDEAVOR, MOVE_FOCUS_ENERGY }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_SU, CHAR_KATAKANA_BA, CHAR_KATAKANA_ME, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x66, - 0x0, - 0x97, - { 0x5D, 0xF6, 0x49, 0x71 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x70, 0x8f, 0x70, 0x8f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_EXEGGCUTE, + .form = 0, + .item = ITEM_PECHA_BERRY, + .moves = { MOVE_CONFUSION, MOVE_ANCIENT_POWER, MOVE_LEECH_SEED, MOVE_LIGHT_SCREEN }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_TA, CHAR_KATAKANA_MA, CHAR_KATAKANA_TA, CHAR_KATAKANA_MA, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x4A, - 0x0, - 0xE6, - { 0xDE, 0x15E, 0x46, 0xB6 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x55, 0x68, 0x75, 0x87, 0x77, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_GEODUDE, + .form = 0, + .item = ITEM_FOCUS_BAND, + .moves = { MOVE_MAGNITUDE, MOVE_ROCK_BLAST, MOVE_STRENGTH, MOVE_PROTECT }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_I, CHAR_KATAKANA_SHI, CHAR_KATAKANA_TSU, CHAR_KATAKANA_BU, CHAR_KATAKANA_TE, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0xC8, - 0x0, - 0xD5, - { 0xDC, 0xF7, 0x6D, 0x56 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x91, 0x57, 0x8f, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_MISDREAVUS, + .form = 0, + .item = ITEM_BRIGHTPOWDER, + .moves = { MOVE_PAIN_SPLIT, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY, MOVE_THUNDER_WAVE }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_MU, CHAR_KATAKANA_U, CHAR_KATAKANA_MA, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x173, - 0x0, - 0x9D, - { 0xE1, 0x1D, 0x118, 0xB8 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x70, 0x75, 0x8A, 0x55, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_BAGON, + .form = 0, + .item = ITEM_LUM_BERRY, + .moves = { MOVE_DRAGON_BREATH, MOVE_HEADBUTT, MOVE_BRICK_BREAK, MOVE_SCARY_FACE }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_TA, CHAR_KATAKANA_TSU, CHAR_KATAKANA_BE, CHAR_KATAKANA_I, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0xE4, - 0x0, - 0xF9, - { 0xF2, 0x34, 0x2E, 0xB6 }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x78, 0x9C, 0x84, 0x9C, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_HOUNDOUR, + .form = 0, + .item = ITEM_CHARCOAL, + .moves = { MOVE_CRUNCH, MOVE_EMBER, MOVE_ROAR, MOVE_PROTECT }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_DE, CHAR_KATAKANA_RU, CHAR_KATAKANA_BI, CHAR_KATAKANA_RU, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, }, { - 0x131, - 0x0, - 0x9E, - { 0xE8, 0x13D, 0x14E, 0x6A }, - 0x12345678, - 0x98765432, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x1F, - 0x0, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x20, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0xFF, - { 0x64, 0x7A, 0x9A, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff }, + .species = SPECIES_LAIRON, + .form = 0, + .item = ITEM_SITRUS_BERRY, + .moves = { MOVE_METAL_CLAW, MOVE_ROCK_TOMB, MOVE_IRON_DEFENSE, MOVE_HARDEN }, + .otID = 0x12345678, + .personality = 0x98765432, + .hpIV = MAX_IVS_SINGLE_STAT, + .atkIV = MAX_IVS_SINGLE_STAT, + .defIV = MAX_IVS_SINGLE_STAT, + .speedIV = MAX_IVS_SINGLE_STAT, + .spAtkIV = MAX_IVS_SINGLE_STAT, + .spDefIV = MAX_IVS_SINGLE_STAT, + .unk_14_val1_30 = 0, + .hpEV = 32, + .atkEV = 32, + .defEV = 32, + .speedEV = 32, + .spAtkEV = 32, + .spDefEV = 32, + .move0PPUps = 0, + .move1PPUps = 0, + .move2PPUps = 0, + .move3PPUps = 0, + .language = 0, + .ability = 0, + .friendship = MAX_FRIENDSHIP_VALUE, + .nickname = { CHAR_KATAKANA_KO, CHAR_KATAKANA_DO, CHAR_KATAKANA_RA, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS, CHAR_EOS }, } }; -const FrontierTrainerDataDTO Unk_ov104_0223FCE0[] = { +const FrontierTrainerDataDTO sDummyTrainerDTOs[] = { { - 0x12345678, - 0x2, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA3, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0x0, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0x2, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_1, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0x0, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0x9, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA4, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0x3, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0x9, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_2, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0x3, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0xB, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA5, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0x6, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0xB, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_3, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0x6, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0x1E, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA6, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0x9, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0x1E, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_4, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0x9, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0x55, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA7, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0xC, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = CHAR_KATAKANA_I, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_5, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0xC, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0x50, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA8, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0xF, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0x50, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_6, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0xF, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, { - 0x12345678, - 0x1D, - 0x0, - { 0x71, 0x90, 0xf1, 0xA2, 0xA9, 0xffff, 0xffff, 0xffff }, - { 0xFFFF, 0x12, 0x0, 0x0 }, - { 0xFFFF, 0x1, 0x0, 0x0 }, - { 0xFFFF, 0x2, 0x0, 0x0 }, + .trainerID = 0x12345678, + .trainerType = 0x1D, + .unk_06 = 0x0, + .trainerName = { CHAR_KATAKANA_DA, CHAR_KATAKANA_MI, CHAR_WIDE_MINUS, CHAR_WIDE_0, CHAR_WIDE_7, CHAR_EOS, CHAR_EOS, CHAR_EOS }, + .introMsg = { 0xFFFF, 0x12, 0x0, 0x0 }, + .winMsg = { 0xFFFF, 0x1, 0x0, 0x0 }, + .loseMsg = { 0xFFFF, 0x2, 0x0, 0x0 }, }, }; @@ -625,24 +629,24 @@ static const UnkStruct_ov104_0223FCB4 Unk_ov104_0223FCB4[] = { }; void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *dto); -void ov104_0223A30C(SaveData *saveData, FrontierDataDTO *dto, const u8 param2); -FieldBattleDTO *ov104_0223A580(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1); +void BattleTower_CreateWiFiTrainerParty(SaveData *saveData, FrontierDataDTO *dto, const u8 opponentID); +FieldBattleDTO *FieldBattleDTO_NewBattleTower(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1); void ov104_0223A734(BattleTower *battleTower, u16 param1); u16 ov104_0223A750(BattleTower *battleTower, const u16 *param1); int BattleTower_GetPokemonDataNarcID(u8 challengeMode); -int BattleTower_GetTrainerDataNarcID(u8 challengeMode); +int BattleFrontier_GetTrainerDataNarcID(u8 challengeMode); int BattleTower_GetTrainerMessagesBankID(u8 challengeMode); static BOOL BattleTower_CreateRandomTrainerParty(BattleTower *battleTower, BattleFrontierTrainerData *trData, u16 battleTowerTrainerID, FrontierPokemonDataDTO *monDataDTO, u8 partySize, u16 *species, u16 *items, UnkStruct_0204B404 *param7, enum HeapID heapID); -static void ov104_0223A348(FrontierDataDTO *param0, const u8 param1); +static void BattleTower_CreateDummyWiFiTrainer(FrontierDataDTO *dto, const u8 opponentID); static u32 BattleTower_CopySetToPokemonDataDTO(BattleTower *battleTower, FrontierPokemonDataDTO *monDataDTO, u16 setID, u32 otID, u32 givenPersonality, u8 ivs, u8 partyIndex, BOOL giveReservedItem, enum HeapID heapID); static u32 BattleTower_GetBattleTypeFromChallengeMode(u8 challengeMode); -static void ov104_0223A6AC(FieldBattleDTO *param0, FrontierDataDTO *param1, int param2, int battlerId, enum HeapID heapID); +static void FieldBattleDTO_InitBattleTowerTrainer(FieldBattleDTO *battleDTO, FrontierDataDTO *frontierDTO, int partySize, int battlerId, enum HeapID heapID); static int BattleTower_AreAllConnectedGamesPlatinum(u8 challengeMode); BOOL BattleTower_CreateTrainerParty(BattleTower *battleTower, FrontierDataDTO *opponentDataDTO, u16 battleTowerTrainerID, int partySize, u16 *species, u16 *items, UnkStruct_0204B404 *param6, enum HeapID heapID) { BOOL v0 = 0; - BattleFrontierTrainerData *trData = BattleTower_GetTrainerData(&opponentDataDTO->trDataDTO, battleTowerTrainerID, heapID, BattleTower_GetTrainerDataNarcID(battleTower->challengeMode)); + BattleFrontierTrainerData *trData = BattleFrontier_GetTrainerData(&opponentDataDTO->trDataDTO, battleTowerTrainerID, heapID, BattleFrontier_GetTrainerDataNarcID(battleTower->challengeMode)); v0 = BattleTower_CreateRandomTrainerParty(battleTower, trData, battleTowerTrainerID, &opponentDataDTO->monDataDTO[0], partySize, species, items, param6, heapID); Heap_Free(trData); @@ -757,34 +761,34 @@ static BOOL BattleTower_CreateRandomTrainerParty(BattleTower *battleTower, Battl return giveReservedItem; } -void ov104_0223A30C(SaveData *saveData, FrontierDataDTO *dto, const u8 param2) +void BattleTower_CreateWiFiTrainerParty(SaveData *saveData, FrontierDataDTO *dto, const u8 opponentID) { MI_CpuClear8(dto, sizeof(FrontierDataDTO)); UnkStruct_0202D764 *v1 = sub_0202D764(saveData); if (!sub_0202D5E8(v1)) { - ov104_0223A348(dto, param2); + BattleTower_CreateDummyWiFiTrainer(dto, opponentID); return; } - sub_0202D63C(v1, dto, param2); + sub_0202D63C(v1, dto, opponentID); } -static void ov104_0223A348(FrontierDataDTO *param0, const u8 param1) +static void BattleTower_CreateDummyWiFiTrainer(FrontierDataDTO *dto, const u8 opponentID) { - int v0; - MI_CpuClear8(param0, sizeof(FrontierDataDTO)); + int i; + MI_CpuClear8(dto, sizeof(FrontierDataDTO)); - const FrontierTrainerDataDTO *v1 = &(Unk_ov104_0223FCE0[param1]); - const FrontierPokemonDataDTO *v2 = Unk_ov104_0223FE30; - const UnkStruct_ov104_0223FCB4 *v3 = &(Unk_ov104_0223FCB4[param1]); + const FrontierTrainerDataDTO *trDataDTO = &(sDummyTrainerDTOs[opponentID]); + const FrontierPokemonDataDTO *monDataDTO = sDummyPokemonDTOs; + const UnkStruct_ov104_0223FCB4 *v3 = &(Unk_ov104_0223FCB4[opponentID]); - MI_CpuCopy8(v1, ¶m0->trDataDTO, sizeof(FrontierTrainerDataDTO)); - param0->trDataDTO.unk_06 = v3->unk_00; + MI_CpuCopy8(trDataDTO, &dto->trDataDTO, sizeof(FrontierTrainerDataDTO)); + dto->trDataDTO.unk_06 = v3->unk_00; - for (v0 = 0; v0 < 4; v0++) { - MI_CpuCopy8(&(v2[v3->unk_02[v0]]), &(param0->monDataDTO[v0]), sizeof(FrontierPokemonDataDTO)); + for (i = 0; i < 4; i++) { + MI_CpuCopy8(&(monDataDTO[v3->unk_02[i]]), &(dto->monDataDTO[i]), sizeof(FrontierPokemonDataDTO)); } } @@ -885,69 +889,69 @@ static u32 BattleTower_CopySetToPokemonDataDTO(BattleTower *battleTower, Frontie return randomPersonality; } -FieldBattleDTO *ov104_0223A580(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1) +FieldBattleDTO *FieldBattleDTO_NewBattleTower(BattleTower *battleTower, UnkStruct_ov104_02230BE4 *param1) { - int v0; + int i; - FieldBattleDTO *v3 = FieldBattleDTO_New(battleTower->heapID, BattleTower_GetBattleTypeFromChallengeMode(battleTower->challengeMode)); + FieldBattleDTO *dto = FieldBattleDTO_New(battleTower->heapID, BattleTower_GetBattleTypeFromChallengeMode(battleTower->challengeMode)); SaveData *saveData = param1->saveData; Party *party = SaveData_GetParty(saveData); - FieldBattleDTO_InitFromGameState(v3, NULL, param1->saveData, param1->unk_1C, param1->journalEntry, param1->bagCursor, param1->unk_20); + FieldBattleDTO_InitFromGameState(dto, NULL, param1->saveData, param1->mapHeaderID, param1->journalEntry, param1->bagCursor, param1->subscreenCursorOn); - v3->background = BACKGROUND_BATTLE_TOWER; - v3->terrain = TERRAIN_BATTLE_TOWER; + dto->background = BACKGROUND_BATTLE_TOWER; + dto->terrain = TERRAIN_BATTLE_TOWER; Pokemon *mon = Pokemon_New(battleTower->heapID); u8 level = 50; - Party_InitWithCapacity(v3->parties[BATTLER_PLAYER_1], battleTower->partySize); + Party_InitWithCapacity(dto->parties[BATTLER_PLAYER_1], battleTower->partySize); - for (v0 = 0; v0 < battleTower->partySize; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(party, battleTower->unk_2A[v0]), mon); + for (i = 0; i < battleTower->partySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(party, battleTower->unk_2A[i]), mon); if (Pokemon_GetValue(mon, MON_DATA_LEVEL, NULL) > level) { - u32 v2 = Pokemon_GetSpeciesBaseExpAt(Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL), level); + u32 exp = Pokemon_GetSpeciesBaseExpAt(Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL), level); - Pokemon_SetValue(mon, MON_DATA_EXPERIENCE, &v2); + Pokemon_SetValue(mon, MON_DATA_EXPERIENCE, &exp); Pokemon_CalcLevelAndStats(mon); } - FieldBattleDTO_AddPokemonToBattler(v3, mon, BATTLER_PLAYER_1); + FieldBattleDTO_AddPokemonToBattler(dto, mon, BATTLER_PLAYER_1); } Heap_Free(mon); - FieldBattleDTO_CopyPlayerInfoToTrainerData(v3); + FieldBattleDTO_CopyPlayerInfoToTrainerData(dto); - ov104_0223A6AC(v3, &(battleTower->opponentsDataDTO[0]), battleTower->partySize, BATTLER_ENEMY_1, battleTower->heapID); + FieldBattleDTO_InitBattleTowerTrainer(dto, &(battleTower->opponentsDataDTO[0]), battleTower->partySize, BATTLER_ENEMY_1, battleTower->heapID); - for (v0 = 0; v0 < MAX_BATTLERS; v0++) { - v3->trainer[v0].header.aiMask = (0x1 | 0x2 | 0x4); + for (i = 0; i < MAX_BATTLERS; i++) { + dto->trainer[i].header.aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } switch (battleTower->challengeMode) { case BATTLE_TOWER_MODE_MULTI: - ov104_0223A6AC(v3, &(battleTower->partnersDataDTO[battleTower->partnerID]), battleTower->partySize, BATTLER_PLAYER_2, battleTower->heapID); + FieldBattleDTO_InitBattleTowerTrainer(dto, &(battleTower->partnersDataDTO[battleTower->partnerID]), battleTower->partySize, BATTLER_PLAYER_2, battleTower->heapID); // fall through case BATTLE_TOWER_MODE_LINK_MULTI: case BATTLE_TOWER_MODE_6: - ov104_0223A6AC(v3, &(battleTower->opponentsDataDTO[1]), battleTower->partySize, BATTLER_ENEMY_2, battleTower->heapID); + FieldBattleDTO_InitBattleTowerTrainer(dto, &(battleTower->opponentsDataDTO[1]), battleTower->partySize, BATTLER_ENEMY_2, battleTower->heapID); break; default: break; } - return v3; + return dto; } -static void ov104_0223A6AC(FieldBattleDTO *param0, FrontierDataDTO *param1, int param2, int battlerId, enum HeapID heapID) +static void FieldBattleDTO_InitBattleTowerTrainer(FieldBattleDTO *battleDTO, FrontierDataDTO *frontierDTO, int partySize, int battlerId, enum HeapID heapID) { - ov104_0222E284(param0, ¶m1->trDataDTO, param2, battlerId, heapID); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &frontierDTO->trDataDTO, partySize, battlerId, heapID); Pokemon *mon = Pokemon_New(heapID); - for (int v0 = 0; v0 < param2; v0++) { - ov104_0222DF40(¶m1->monDataDTO[v0], mon, 120); - Party_AddPokemon(param0->parties[battlerId], mon); + for (int i = 0; i < partySize; i++) { + FrontierPokemonDataDTO_InitPokemon(&frontierDTO->monDataDTO[i], mon, 120); + Party_AddPokemon(battleDTO->parties[battlerId], mon); } Heap_Free(mon); @@ -958,17 +962,17 @@ static u32 BattleTower_GetBattleTypeFromChallengeMode(u8 challengeMode) switch (challengeMode) { case BATTLE_TOWER_MODE_SINGLE: case BATTLE_TOWER_MODE_WIFI: - return (BATTLE_TYPE_SINGLES | BATTLE_TYPE_TRAINER) | BATTLE_TYPE_FRONTIER; + return BATTLE_TYPE_FRONTIER_SINGLES; case BATTLE_TOWER_MODE_DOUBLE: return BATTLE_TYPE_FRONTIER_DOUBLES; case BATTLE_TOWER_MODE_MULTI: return BATTLE_TYPE_FRONTIER_WITH_AI_PARTNER; case BATTLE_TOWER_MODE_LINK_MULTI: case BATTLE_TOWER_MODE_6: - return (BATTLE_TYPE_LINK_DOUBLES | BATTLE_TYPE_2vs2) | BATTLE_TYPE_FRONTIER; + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; } - return (BATTLE_TYPE_SINGLES | BATTLE_TYPE_TRAINER) | BATTLE_TYPE_FRONTIER; + return BATTLE_TYPE_FRONTIER_SINGLES; } void ov104_0223A734(BattleTower *battleTower, u16 param1) @@ -997,7 +1001,7 @@ int BattleTower_GetPokemonDataNarcID(u8 challengeMode) return NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDPM; } -int BattleTower_GetTrainerDataNarcID(u8 challengeMode) +int BattleFrontier_GetTrainerDataNarcID(u8 challengeMode) { if (BattleTower_AreAllConnectedGamesPlatinum(challengeMode) == FALSE) { return NARC_INDEX_BATTLE__B_TOWER__BTDTR; diff --git a/src/overlay104/ov104_0223A7F4.c b/src/overlay104/ov104_0223A7F4.c index fedd5dd11f..a5d1e1df51 100644 --- a/src/overlay104/ov104_0223A7F4.c +++ b/src/overlay104/ov104_0223A7F4.c @@ -4,6 +4,8 @@ #include #include "constants/battle_frontier.h" +#include "generated/ai_flags.h" +#include "generated/frontier_trainers.h" #include "struct_defs/battle_frontier_pokemon_data.h" #include "struct_defs/battle_frontier_trainer_data.h" @@ -82,15 +84,15 @@ static int ov104_0223A7F4(u8 param0, int param1, int param2); const UnkStruct_ov104_0224028C *ov104_0223A8A8(int param0, int param1); const UnkStruct_ov104_0224028C *ov104_0223A8F4(int param0, int param1); void ov104_0223A860(u8 param0, int param1, u16 param2[], u8 param3); -u8 BattleFactory_GetPartySize(u8 param0); -u8 ov104_0223AA74(u8 param0, BOOL param1); -static u32 ov104_0223AD74(u8 param0); -u8 ov104_0223ADA0(BattleFactory *param0); -void ov104_0223ADB0(BattleFactory *param0); -void ov104_0223AE30(BattleFactory *param0); -static u16 ov104_0223AEE4(BattleFactory *param0); -u16 ov104_0223AF34(BattleFactory *param0); -void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *param0); +u8 BattleFactory_GetPlayerPartySize(u8 challengeType); +u8 BattleFactory_GetOpponentPartySize(u8 challengeType, BOOL param1); +static u32 BattleFactory_GetBattleType(u8 challengeType); +u8 BattleFactory_GetPokemonLevel(BattleFactory *battleFactory); +void ov104_0223ADB0(BattleFactory *battleFactory); +void ov104_0223AE30(BattleFactory *battleFactory); +static u16 BattleFactory_GetAIMask(BattleFactory *battleFactory); +u16 ov104_0223AF34(BattleFactory *battleFactory); +void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *dto); static int ov104_0223A7F4(u8 param0, int param1, int param2) { @@ -104,9 +106,9 @@ static int ov104_0223A7F4(u8 param0, int param1, int param2) v3 = (param1 * 7) + (param2 + 1); if (v3 == 21) { - return 309; + return FRONTIER_TRAINER_FACTORY_HEAD_THORTON_SILVER; } else if (v3 == 49) { - return 310; + return FRONTIER_TRAINER_FACTORY_HEAD_THORTON_GOLD; } } @@ -259,7 +261,7 @@ BOOL ov104_0223A918(const u16 param0[], const u16 param1[], int param2, int para return 0; } -u8 BattleFactory_GetPartySize(u8 challengeType) +u8 BattleFactory_GetPlayerPartySize(u8 challengeType) { switch (challengeType) { case FRONTIER_CHALLENGE_SINGLE: @@ -273,14 +275,14 @@ u8 BattleFactory_GetPartySize(u8 challengeType) return 0; } -u8 ov104_0223AA74(u8 param0, BOOL param1) +u8 BattleFactory_GetOpponentPartySize(u8 challengeType, BOOL param1) { - switch (param0) { - case 0: - case 1: + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + case FRONTIER_CHALLENGE_DOUBLE: return 3; - case 2: - case 3: + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: if (param1 == 0) { return 2; } else { @@ -329,120 +331,116 @@ void ov104_0223AB0C(u8 param0, u16 param1, u8 param2, FrontierPokemonDataDTO *pa return; } -FieldBattleDTO *ov104_0223ABA0(BattleFactory *param0, UnkStruct_ov104_02230BE4 *param1) +FieldBattleDTO *FieldBattleDTO_NewBattleFactory(BattleFactory *battleFactory, UnkStruct_ov104_02230BE4 *param1) { - int v0; - u32 v1; - u8 v2, v3; - FieldBattleDTO *v4; - Pokemon *v5; - FrontierTrainerDataDTO v6; + int i; + FrontierTrainerDataDTO trDataDTO; - v2 = BattleFactory_GetPartySize(param0->challengeType); - v3 = ov104_0223AA74(param0->challengeType, 0); + u8 playerPartySize = BattleFactory_GetPlayerPartySize(battleFactory->challengeType); + u8 opponentPartySize = BattleFactory_GetOpponentPartySize(battleFactory->challengeType, 0); - Party_HealAllMembers(param0->unk_4D4); - Party_HealAllMembers(param0->unk_4D8); + Party_HealAllMembers(battleFactory->playersParty); + Party_HealAllMembers(battleFactory->opponentsParty); - v4 = FieldBattleDTO_New(HEAP_ID_FIELD2, ov104_0223AD74(param0->challengeType)); - FieldBattleDTO_InitFromGameState(v4, NULL, param1->saveData, param1->unk_1C, param1->journalEntry, param1->bagCursor, param1->unk_20); + FieldBattleDTO *battleDTO = FieldBattleDTO_New(HEAP_ID_FIELD2, BattleFactory_GetBattleType(battleFactory->challengeType)); + FieldBattleDTO_InitFromGameState(battleDTO, NULL, param1->saveData, param1->mapHeaderID, param1->journalEntry, param1->bagCursor, param1->subscreenCursorOn); - v4->background = BACKGROUND_BATTLE_FACTORY; - v4->terrain = TERRAIN_BATTLE_FACTORY; + battleDTO->background = BACKGROUND_BATTLE_FACTORY; + battleDTO->terrain = TERRAIN_BATTLE_FACTORY; - Party_InitWithCapacity(v4->parties[0], v2); - v5 = Pokemon_New(HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_PLAYER_1], playerPartySize); + Pokemon *mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v2; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_4D4, v0), v5); - FieldBattleDTO_AddPokemonToBattler(v4, v5, 0); + for (i = 0; i < playerPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleFactory->playersParty, i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_PLAYER_1); } - Heap_Free(v5); - FieldBattleDTO_CopyPlayerInfoToTrainerData(v4); + Heap_Free(mon); + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - Heap_Free(BattleTower_GetTrainerData(&v6, param0->unk_18[param0->unk_06], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleFactory->trainerIDs[battleFactory->unk_06], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v4, &v6, v3, 1, 11); - Party_InitWithCapacity(v4->parties[1], ov104_0223AA74(param0->challengeType, 0)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_1, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_1], BattleFactory_GetOpponentPartySize(battleFactory->challengeType, 0)); - for (v0 = 0; v0 < 4; v0++) { - v4->trainer[v0].header.aiMask = ov104_0223AEE4(param0); + for (i = 0; i < MAX_BATTLERS; i++) { + battleDTO->trainer[i].header.aiMask = BattleFactory_GetAIMask(battleFactory); } - v5 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_4D8, v0), v5); - FieldBattleDTO_AddPokemonToBattler(v4, v5, 1); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleFactory->opponentsParty, i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_1); } - Heap_Free(v5); + Heap_Free(mon); - switch (param0->challengeType) { - case 2: - case 3: - FieldBattleDTO_CopyPlayerInfoToTrainerData(v4); + switch (battleFactory->challengeType) { + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), v4->trainerInfo[2]); + TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), battleDTO->trainerInfo[BATTLER_PLAYER_2]); - Heap_Free(BattleTower_GetTrainerData(&v6, param0->unk_18[param0->unk_06 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleFactory->trainerIDs[battleFactory->unk_06 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v4, &v6, v3, 3, 11); - Party_InitWithCapacity(v4->parties[3], ov104_0223AA74(param0->challengeType, 0)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_2, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_2], BattleFactory_GetOpponentPartySize(battleFactory->challengeType, 0)); - v5 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_4D8, v3 + v0), v5); - FieldBattleDTO_AddPokemonToBattler(v4, v5, 3); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleFactory->opponentsParty, opponentPartySize + i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_2); } - Heap_Free(v5); + Heap_Free(mon); break; } - return v4; + return battleDTO; } -static u32 ov104_0223AD74(u8 param0) +static u32 BattleFactory_GetBattleType(u8 challengeType) { - switch (param0) { - case 0: - return (0x0 | 0x1) | 0x80; - case 1: - return (0x2 | 0x1) | 0x80; - case 2: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; - case 3: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + return BATTLE_TYPE_FRONTIER_SINGLES; + case FRONTIER_CHALLENGE_DOUBLE: + return BATTLE_TYPE_FRONTIER_DOUBLES; + case FRONTIER_CHALLENGE_MULTI: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; + case FRONTIER_CHALLENGE_MULTI_WFC: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; } - return (0x0 | 0x1) | 0x80; + return BATTLE_TYPE_FRONTIER_SINGLES; } -u8 ov104_0223ADA0(BattleFactory *param0) +u8 BattleFactory_GetPokemonLevel(BattleFactory *battleFactory) { - if (param0->unk_05 == 0) { + if (battleFactory->unk_05 == 0) { return 50; } return 100; } -void ov104_0223ADB0(BattleFactory *param0) +void ov104_0223ADB0(BattleFactory *battleFactory) { int v0; Pokemon *v1; - ov104_0222E330(param0->unk_280, param0->unk_254, param0->unk_260, param0->unk_268, NULL, 6, 11, 179); - Party_Init(param0->unk_4D4); + ov104_0222E330(battleFactory->unk_280, battleFactory->unk_254, battleFactory->unk_260, battleFactory->unk_268, NULL, 6, 11, 179); + Party_Init(battleFactory->playersParty); v1 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < 6; v0++) { - ov104_0222DF40(¶m0->unk_280[v0], v1, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D4, v1); + FrontierPokemonDataDTO_InitPokemon(&battleFactory->unk_280[v0], v1, BattleFactory_GetPokemonLevel(battleFactory)); + ov104_0222E1C0(battleFactory->saveData, battleFactory->playersParty, v1); } Heap_Free(v1); @@ -450,26 +448,26 @@ void ov104_0223ADB0(BattleFactory *param0) return; } -void ov104_0223AE30(BattleFactory *param0) +void ov104_0223AE30(BattleFactory *battleFactory) { int v0, v1; Pokemon *v2; FrontierPokemonDataDTO v3[2]; - v1 = Party_GetCurrentCount(param0->unk_4D4); + v1 = Party_GetCurrentCount(battleFactory->playersParty); for (v0 = v1; v0 > 2; v0--) { - Party_RemovePokemonBySlotIndex(param0->unk_4D4, v0 - 1); + Party_RemovePokemonBySlotIndex(battleFactory->playersParty, v0 - 1); } - ov104_0222E330(v3, param0->unk_584, param0->unk_590, param0->unk_598, NULL, 2, 11, 179); + ov104_0222E330(v3, battleFactory->unk_584, battleFactory->unk_590, battleFactory->unk_598, NULL, 2, 11, 179); v2 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < 2; v0++) { - ov104_0222DF40(&v3[v0], v2, ov104_0223ADA0(param0)); - ov104_0222E1C0(param0->saveData, param0->unk_4D4, v2); - param0->unk_4E8[v0 + 2] = param0->unk_584[v0]; + FrontierPokemonDataDTO_InitPokemon(&v3[v0], v2, BattleFactory_GetPokemonLevel(battleFactory)); + ov104_0222E1C0(battleFactory->saveData, battleFactory->playersParty, v2); + battleFactory->unk_4E8[v0 + 2] = battleFactory->unk_584[v0]; } Heap_Free(v2); @@ -481,40 +479,41 @@ BOOL BattleFactory_IsMultiplayerChallenge(u8 challengeType) return challengeType == FRONTIER_CHALLENGE_MULTI || challengeType == FRONTIER_CHALLENGE_MULTI_WFC; } -static u16 ov104_0223AEE4(BattleFactory *param0) +static u16 BattleFactory_GetAIMask(BattleFactory *battleFactory) { - u16 v0, v1; + u16 aiMask, v1; - if (param0->challengeType == 0) { - if ((param0->unk_18[param0->unk_06] == 309) || (param0->unk_18[param0->unk_06] == 310)) { - return 0x1 | 0x2 | 0x4; + if (battleFactory->challengeType == FRONTIER_CHALLENGE_SINGLE) { + if (battleFactory->trainerIDs[battleFactory->unk_06] == FRONTIER_TRAINER_FACTORY_HEAD_THORTON_SILVER + || battleFactory->trainerIDs[battleFactory->unk_06] == FRONTIER_TRAINER_FACTORY_HEAD_THORTON_GOLD) { + return AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } } - v1 = ov104_0223AF34(param0); - v0 = (0x1 | 0x2 | 0x4); + v1 = ov104_0223AF34(battleFactory); + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; switch (v1 + 1) { case 1: case 2: - v0 = 0; + aiMask = AI_FLAG_NONE; break; case 3: case 4: - v0 = 0x1; + aiMask = AI_FLAG_BASIC; break; } - return v0; + return aiMask; } -u16 ov104_0223AF34(BattleFactory *param0) +u16 ov104_0223AF34(BattleFactory *battleFactory) { - u16 v0 = param0->unk_0E; + u16 v0 = battleFactory->unk_0E; - if (BattleFactory_IsMultiplayerChallenge(param0->challengeType) == 1) { - if (param0->unk_57E > param0->unk_0E) { - v0 = param0->unk_57E; + if (BattleFactory_IsMultiplayerChallenge(battleFactory->challengeType) == TRUE) { + if (battleFactory->unk_57E > battleFactory->unk_0E) { + v0 = battleFactory->unk_57E; } } diff --git a/src/overlay104/ov104_0223AF58.c b/src/overlay104/ov104_0223AF58.c index bc15412a96..e8b6208113 100644 --- a/src/overlay104/ov104_0223AF58.c +++ b/src/overlay104/ov104_0223AF58.c @@ -4,11 +4,14 @@ #include #include "constants/battle_frontier.h" +#include "generated/ai_flags.h" +#include "generated/frontier_trainers.h" #include "overlay104/ov104_0222DCE0.h" #include "overlay104/struct_battle_hall.h" #include "overlay104/struct_ov104_02230BE4.h" +#include "battle_hall_save.h" #include "communication_information.h" #include "communication_system.h" #include "field_battle_data_transfer.h" @@ -17,7 +20,6 @@ #include "math_util.h" #include "party.h" #include "pokemon.h" -#include "unk_02030108.h" typedef struct { u8 unk_00; @@ -34,18 +36,18 @@ void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *param0); void ov104_0223AF58(u8 param0, u8 param1, u8 param2, u8 param3, u16 param4[]); void ov104_0223AFB4(u8 param0, u8 param1, int param2, u8 param3, u8 param4, u16 param5[]); void ov104_0223B0C8(u8 param0, u8 param1, u8 param2, u8 param3, u16 param4, u16 param5[], u8 param6); -u8 BattleHall_GetPartySize(u8 param0); -u8 ov104_0223B50C(u8 param0); -FieldBattleDTO *ov104_0223B250(BattleHall *param0, UnkStruct_ov104_02230BE4 *param1); -static u32 ov104_0223B4D4(u8 param0); +u8 BattleHall_GetPlayerPartySize(u8 challengeType); +u8 BattleHall_GetOpponentPartySize(u8 challengeType); +FieldBattleDTO *FieldBattleDTO_NewBattleHall(BattleHall *battleHall, UnkStruct_ov104_02230BE4 *param1); +static u32 BattleHall_GetBattleType(u8 challengeType); static void ov104_0223B518(FrontierPokemonDataDTO *param0, u8 param1, u16 param2, u16 param3[], int param4, int param5, int param6); -static u32 ov104_0223B57C(BattleHall *param0, u8 param1); -u8 ov104_0223B5C0(BattleHall *param0); +static u32 BattleHall_GetOpponentLevel(BattleHall *battleHall, u8 param1); +u8 ov104_0223B5C0(BattleHall *battleHall); static u8 ov104_0223B5F0(u8 param0); -static u16 ov104_0223B604(BattleHall *param0, u8 param1, u8 param2); +static u16 BattleHall_GetAIMask(BattleHall *battleHall, u8 param1, u8 rank); static u16 ov104_0223B644(u8 param0); -u16 BattleHall_GetHighestLevelInParty(BattleHall *param0); -static BOOL ov104_0223B4A4(BattleHall *param0, u8 param1); +u16 BattleHall_GetHighestLevelInParty(BattleHall *battleHall); +static BOOL ov104_0223B4A4(BattleHall *battleHall, u8 param1); static const u16 Unk_ov104_0224041C[10][8] = { { 0x2, 0x3, 0x14, 0x15, 0x25, 0x24, 0x16, 0x1C }, @@ -1396,10 +1398,10 @@ void ov104_0223AFB4(u8 param0, u8 param1, int param2, u8 param3, u8 param4, u16 v2 = (param2 * 10) + (param4 + 1); if (v2 == 50) { - param5[v7] = 307; + param5[v7] = FRONTIER_TRAINER_HALL_MATRON_ARGENTA_SILVER; return; } else if (v2 == 170) { - param5[v7] = 308; + param5[v7] = FRONTIER_TRAINER_HALL_MATRON_ARGENTA_GOLD; return; } } @@ -1561,131 +1563,131 @@ void ov104_0223B0C8(u8 param0, u8 param1, u8 param2, u8 param3, u16 param4, u16 return; } -FieldBattleDTO *ov104_0223B250(BattleHall *param0, UnkStruct_ov104_02230BE4 *param1) +FieldBattleDTO *FieldBattleDTO_NewBattleHall(BattleHall *battleHall, UnkStruct_ov104_02230BE4 *param1) { - int v1; - u8 v7; - Pokemon *v9; - FrontierTrainerDataDTO v10; + int i; + u8 rank; + Pokemon *mon; + FrontierTrainerDataDTO trDataDTO; - u8 v6 = (param0->unk_05 * 2); - u8 v4 = BattleHall_GetPartySize(param0->challengeType); - u8 v5 = ov104_0223B50C(param0->challengeType); - Party *v13 = SaveData_GetParty(param0->saveData); + u8 v6 = battleHall->unk_05 * 2; + u8 playerPartySize = BattleHall_GetPlayerPartySize(battleHall->challengeType); + u8 opponentPartySize = BattleHall_GetOpponentPartySize(battleHall->challengeType); + Party *party = SaveData_GetParty(battleHall->saveData); - Party_HealAllMembers(v13); + Party_HealAllMembers(party); - FieldBattleDTO *v8 = FieldBattleDTO_New(HEAP_ID_FIELD2, ov104_0223B4D4(param0->challengeType)); - FieldBattleDTO_InitFromGameState(v8, NULL, param1->saveData, param1->unk_1C, param1->journalEntry, param1->bagCursor, param1->unk_20); + FieldBattleDTO *battleDTO = FieldBattleDTO_New(HEAP_ID_FIELD2, BattleHall_GetBattleType(battleHall->challengeType)); + FieldBattleDTO_InitFromGameState(battleDTO, NULL, param1->saveData, param1->mapHeaderID, param1->journalEntry, param1->bagCursor, param1->subscreenCursorOn); - v8->background = BACKGROUND_BATTLE_HALL; - v8->terrain = TERRAIN_BATTLE_HALL; - Party_InitWithCapacity(v8->parties[0], v4); + battleDTO->background = BACKGROUND_BATTLE_HALL; + battleDTO->terrain = TERRAIN_BATTLE_HALL; + Party_InitWithCapacity(battleDTO->parties[BATTLER_PLAYER_1], playerPartySize); - v9 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v1 = 0; v1 < v4; v1++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(v13, param0->unk_260[v1]), v9); - FieldBattleDTO_AddPokemonToBattler(v8, v9, 0); + for (i = 0; i < playerPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(party, battleHall->partySlots[i]), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_PLAYER_1); } - Heap_Free(v9); - FieldBattleDTO_CopyPlayerInfoToTrainerData(v8); + Heap_Free(mon); + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - Heap_Free(BattleTower_GetTrainerData(&v10, param0->unk_18[v6], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v8, &v10, v5, 1, 11); - Party_InitWithCapacity(v8->parties[1], v5); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleHall->trainerIDs[v6], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_1, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_1], opponentPartySize); - v7 = BattleHall_GetRankOfType(param0->selectedTypeIdx, ¶m0->unk_704[param0->challengeType][0]); + rank = BattleHall_GetRankOfType(battleHall->selectedTypeIdx, &battleHall->typeRanks[battleHall->challengeType][0]); - if (param0->challengeType == 2) { - v7 = (10 - 1); + if (battleHall->challengeType == FRONTIER_CHALLENGE_MULTI) { + rank = 9; } - u16 v2 = ov104_0223B604(param0, v6, v7); + u16 aiMask = BattleHall_GetAIMask(battleHall, v6, rank); - for (v1 = 0; v1 < 4; v1++) { - v8->trainer[v1].header.aiMask = v2; + for (i = 0; i < MAX_BATTLERS; i++) { + battleDTO->trainer[i].header.aiMask = aiMask; } - ov104_0223B518(¶m0->unk_290[v6], v7, param0->unk_18[v6], ¶m0->unk_268[v6], v5, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_STAGE__PL_BSDPM); + ov104_0223B518(&battleHall->unk_290[v6], rank, battleHall->trainerIDs[v6], &battleHall->unk_268[v6], opponentPartySize, HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_STAGE__PL_BSDPM); - v9 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v1 = 0; v1 < v5; v1++) { + for (i = 0; i < opponentPartySize; i++) { while (TRUE) { - if (ov104_0223B4A4(param0, v6) == 0) { + if (ov104_0223B4A4(battleHall, v6) == 0) { break; } } - ov104_0222DF40(¶m0->unk_290[v6], v9, ov104_0223B57C(param0, v7)); + FrontierPokemonDataDTO_InitPokemon(&battleHall->unk_290[v6], mon, BattleHall_GetOpponentLevel(battleHall, rank)); - Pokemon_CalcAbility(v9); - FieldBattleDTO_AddPokemonToBattler(v8, v9, 1); + Pokemon_CalcAbility(mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_1); } - Heap_Free(v9); + Heap_Free(mon); - switch (param0->challengeType) { - case 2: - case 3: - FieldBattleDTO_CopyPlayerInfoToTrainerData(v8); + switch (battleHall->challengeType) { + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), v8->trainerInfo[2]); + TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), battleDTO->trainerInfo[BATTLER_PLAYER_2]); - Heap_Free(BattleTower_GetTrainerData(&v10, param0->unk_18[v6 + 1], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleHall->trainerIDs[v6 + 1], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v8, &v10, v5, 3, 11); - Party_InitWithCapacity(v8->parties[3], v5); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_2, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_2], opponentPartySize); - v9 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); while (TRUE) { - if (ov104_0223B4A4(param0, v6) == 0) { + if (ov104_0223B4A4(battleHall, v6) == 0) { break; } } - ov104_0222DF40(¶m0->unk_290[v6], v9, ov104_0223B57C(param0, v7)); + FrontierPokemonDataDTO_InitPokemon(&battleHall->unk_290[v6], mon, BattleHall_GetOpponentLevel(battleHall, rank)); - Pokemon_CalcAbility(v9); - FieldBattleDTO_AddPokemonToBattler(v8, v9, 3); - Heap_Free(v9); + Pokemon_CalcAbility(mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_2); + Heap_Free(mon); break; } - return v8; + return battleDTO; } -static BOOL ov104_0223B4A4(BattleHall *param0, u8 param1) +static BOOL ov104_0223B4A4(BattleHall *battleHall, u8 param1) { - if (param0->unk_290[param1].personality > ((24 + 1) * 10001)) { - param0->unk_290[param1].personality -= ((24 + 1) * 10001); + if (battleHall->unk_290[param1].personality > ((24 + 1) * 10001)) { + battleHall->unk_290[param1].personality -= ((24 + 1) * 10001); } else { - param0->unk_290[param1].personality += ((24 + 1) * 10001); + battleHall->unk_290[param1].personality += ((24 + 1) * 10001); } - return Pokemon_IsPersonalityShiny(param0->unk_290[param1].otID, param0->unk_290[param1].personality); + return Pokemon_IsPersonalityShiny(battleHall->unk_290[param1].otID, battleHall->unk_290[param1].personality); } -static u32 ov104_0223B4D4(u8 param0) +static u32 BattleHall_GetBattleType(u8 challengeType) { - switch (param0) { - case 0: - return (0x0 | 0x1) | 0x80; - case 1: - return (0x2 | 0x1) | 0x80; - case 2: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; - case 3: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + return BATTLE_TYPE_FRONTIER_SINGLES; + case FRONTIER_CHALLENGE_DOUBLE: + return BATTLE_TYPE_FRONTIER_DOUBLES; + case FRONTIER_CHALLENGE_MULTI: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; + case FRONTIER_CHALLENGE_MULTI_WFC: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; } - return (0x0 | 0x1) | 0x80; + return BATTLE_TYPE_FRONTIER_SINGLES; } -u8 BattleHall_GetPartySize(u8 challengeType) +u8 BattleHall_GetPlayerPartySize(u8 challengeType) { switch (challengeType) { case FRONTIER_CHALLENGE_DOUBLE: @@ -1695,10 +1697,10 @@ u8 BattleHall_GetPartySize(u8 challengeType) return 1; } -u8 ov104_0223B50C(u8 param0) +u8 BattleHall_GetOpponentPartySize(u8 challengeType) { - switch (param0) { - case 1: + switch (challengeType) { + case FRONTIER_CHALLENGE_DOUBLE: return 2; } @@ -1712,9 +1714,9 @@ static void ov104_0223B518(FrontierPokemonDataDTO *param0, u8 param1, u16 param2 u8 v2; u32 v3; - if (param2 == 307) { + if (param2 == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_SILVER) { v3 = 31; - } else if (param2 == 308) { + } else if (param2 == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_GOLD) { v3 = 31; } else { v3 = ov104_0223B5F0(param1); @@ -1727,20 +1729,21 @@ static void ov104_0223B518(FrontierPokemonDataDTO *param0, u8 param1, u16 param2 return; } -static u32 ov104_0223B57C(BattleHall *param0, u8 param1) +static u32 BattleHall_GetOpponentLevel(BattleHall *battleHall, u8 param1) { u8 v0; - u32 v1; + u32 level; - v0 = (param0->unk_05 * 2); + v0 = (battleHall->unk_05 * 2); - if ((param0->unk_18[v0] == 307) || (param0->unk_18[v0] == 308)) { - v1 = BattleHall_GetHighestLevelInParty(param0); + if (battleHall->trainerIDs[v0] == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_SILVER + || battleHall->trainerIDs[v0] == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_GOLD) { + level = BattleHall_GetHighestLevelInParty(battleHall); } else { - v1 = param0->unk_07; + level = battleHall->unk_07; } - return v1; + return level; } static const u8 sBattleHallAppGridOrder[20] = { @@ -1776,12 +1779,12 @@ BOOL BattleHall_IsMultiPlayerChallenge(u8 challengeType) return challengeType == FRONTIER_CHALLENGE_MULTI || challengeType == FRONTIER_CHALLENGE_MULTI_WFC; } -u8 ov104_0223B5C0(BattleHall *param0) +u8 ov104_0223B5C0(BattleHall *battleHall) { u32 v0; int v1; - Party *v2 = SaveData_GetParty(param0->saveData); - Pokemon *v3 = Party_GetPokemonBySlotIndex(v2, param0->unk_260[0]); + Party *v2 = SaveData_GetParty(battleHall->saveData); + Pokemon *v3 = Party_GetPokemonBySlotIndex(v2, battleHall->partySlots[0]); v1 = Pokemon_GetValue(v3, MON_DATA_LEVEL, NULL); return v1 / 10; @@ -1792,32 +1795,33 @@ static u8 ov104_0223B5F0(u8 param0) return Unk_ov104_0224033C[ov104_0223B644(param0)].unk_01; } -static u16 ov104_0223B604(BattleHall *param0, u8 param1, u8 param2) +static u16 BattleHall_GetAIMask(BattleHall *battleHall, u8 param1, u8 rank) { u8 v0; - u16 v1; + u16 aiMask; - if ((param2 + 1) >= 8) { - v1 = (0x1 | 0x2 | 0x4); - } else if ((param2 + 1) >= 4) { - v1 = 0x1; + if (rank + 1 >= 8) { + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; + } else if (rank + 1 >= 4) { + aiMask = AI_FLAG_BASIC; } else { - v1 = 0; + aiMask = 0; } - if (param0->challengeType == 0) { - v0 = (param1 * 2); + if (battleHall->challengeType == FRONTIER_CHALLENGE_SINGLE) { + v0 = param1 * 2; - if ((param0->unk_18[v0] == 307) || (param0->unk_18[v0] == 308)) { - v1 = (0x1 | 0x2 | 0x4); + if (battleHall->trainerIDs[v0] == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_SILVER + || battleHall->trainerIDs[v0] == FRONTIER_TRAINER_HALL_MATRON_ARGENTA_GOLD) { + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } } - if (param0->challengeType == 2) { - v1 = (0x1 | 0x2 | 0x4); + if (battleHall->challengeType == FRONTIER_CHALLENGE_MULTI) { + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } - return v1; + return aiMask; } static u16 ov104_0223B644(u8 param0) @@ -1831,15 +1835,14 @@ static u16 ov104_0223B644(u8 param0) return v0; } -u16 BattleHall_GetHighestLevelInParty(BattleHall *param0) +u16 BattleHall_GetHighestLevelInParty(BattleHall *battleHall) { - - Party *party = SaveData_GetParty(param0->saveData); - Pokemon *mon = Party_GetPokemonBySlotIndex(party, param0->unk_260[0]); + Party *party = SaveData_GetParty(battleHall->saveData); + Pokemon *mon = Party_GetPokemonBySlotIndex(party, battleHall->partySlots[0]); u16 firstMonsLevel = Pokemon_GetValue(mon, MON_DATA_LEVEL, NULL); - if (BattleHall_GetPartySize(param0->challengeType) == 2) { - mon = Party_GetPokemonBySlotIndex(party, param0->unk_260[1]); + if (BattleHall_GetPlayerPartySize(battleHall->challengeType) == 2) { + mon = Party_GetPokemonBySlotIndex(party, battleHall->partySlots[1]); u16 secondMonsLevel = Pokemon_GetValue(mon, MON_DATA_LEVEL, NULL); if (firstMonsLevel > secondMonsLevel) { @@ -1848,11 +1851,11 @@ u16 BattleHall_GetHighestLevelInParty(BattleHall *param0) return secondMonsLevel; } } else { - if (BattleHall_IsMultiPlayerChallenge(param0->challengeType) == TRUE) { - if (firstMonsLevel > param0->unk_D84[0]) { + if (BattleHall_IsMultiPlayerChallenge(battleHall->challengeType) == TRUE) { + if (firstMonsLevel > battleHall->unk_D84[0]) { return firstMonsLevel; } else { - return param0->unk_D84[0]; + return battleHall->unk_D84[0]; } } } diff --git a/src/overlay104/ov104_0223B6F4.c b/src/overlay104/ov104_0223B6F4.c index 2b6d4de537..d68a0d693a 100644 --- a/src/overlay104/ov104_0223B6F4.c +++ b/src/overlay104/ov104_0223B6F4.c @@ -4,6 +4,8 @@ #include #include "constants/battle_frontier.h" +#include "generated/ai_flags.h" +#include "generated/frontier_trainers.h" #include "struct_defs/battle_frontier.h" @@ -28,19 +30,19 @@ static int ov104_0223B6F4(u8 param0, int param1, int param2); void ov104_0223B760(u8 param0, int param1, u16 param2[], u8 param3); -u8 ov104_0223B7DC(u8 param0, BOOL param1); -FieldBattleDTO *ov104_0223B810(BattleCastle *param0, UnkStruct_ov104_02230BE4 *param1); -static u32 ov104_0223B9E4(u8 param0); -u8 ov104_0223BA10(BattleCastle *param0); +u8 BattleCastle_GetOpponentPartySize(u8 challengeType, BOOL param1); +FieldBattleDTO *FieldBattleDTO_NewBattleCastle(BattleCastle *battleCastle, UnkStruct_ov104_02230BE4 *param1); +static u32 BattleCastle_GetBattleType(u8 challengeType); +u8 BattleCastle_GetOpponentLevel(BattleCastle *battleCastle); void ov104_0223BA24(Party *param0); -void ov104_0223BAB8(BattleCastle *param0); -void ov104_0223BA7C(BattleCastle *param0, Pokemon *param1); -void ov104_0223BAA0(BattleCastle *param0, Party *param1, Pokemon *param2); -static u16 ov104_0223BB10(BattleCastle *param0); -u16 ov104_0223BB60(BattleCastle *param0); +void ov104_0223BAB8(BattleCastle *battleCastle); +void ov104_0223BA7C(BattleCastle *battleCastle, Pokemon *param1); +void ov104_0223BAA0(BattleCastle *battleCastle, Party *param1, Pokemon *param2); +static u16 BattleCastle_GetAIMask(BattleCastle *battleCastle); +u16 ov104_0223BB60(BattleCastle *battleCastle); u16 ov104_0223BC24(u16 param0); void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *param0); -void ov104_0223BB84(BgConfig *param0, BattleCastle *param1, u32 param2); +void ov104_0223BB84(BgConfig *param0, BattleCastle *battleCastle, u32 param2); static void ov104_0223BBC4(u16 *param0, u16 param1); static const struct { @@ -67,9 +69,9 @@ static int ov104_0223B6F4(u8 param0, int param1, int param2) v3 = (param1 * 7) + (param2 + 1); if (v3 == 21) { - return 313; + return FRONTIER_TRAINER_CASTLE_VALET_DARACH_SILVER; } else if (v3 == 49) { - return 314; + return FRONTIER_TRAINER_CASTLE_VALET_DARACH_GOLD; } } @@ -113,7 +115,7 @@ void ov104_0223B760(u8 param0, int param1, u16 param2[], u8 param3) } while (v0 < param3); } -u8 BattleCastle_GetPartySize(u8 challengeType, BOOL includePartnersMons) +u8 BattleCastle_GetPlayerPartySize(u8 challengeType, BOOL includePartnersMons) { switch (challengeType) { case FRONTIER_CHALLENGE_SINGLE: @@ -132,18 +134,18 @@ u8 BattleCastle_GetPartySize(u8 challengeType, BOOL includePartnersMons) return 3; } -u8 ov104_0223B7DC(u8 param0, BOOL param1) +u8 BattleCastle_GetOpponentPartySize(u8 challengeType, BOOL param1) { - switch (param0) { - case 0: - case 1: + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + case FRONTIER_CHALLENGE_DOUBLE: return 3; - case 2: - case 3: + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: if (param1 == 0) { return 2; } else { - return 2 * 2; + return 4; } } @@ -151,103 +153,102 @@ u8 ov104_0223B7DC(u8 param0, BOOL param1) return 3; } -FieldBattleDTO *ov104_0223B810(BattleCastle *param0, UnkStruct_ov104_02230BE4 *param1) +FieldBattleDTO *FieldBattleDTO_NewBattleCastle(BattleCastle *battleCastle, UnkStruct_ov104_02230BE4 *param1) { - int v0; - u32 v1; - u8 v4; - Pokemon *v6; - FrontierTrainerDataDTO v7; + int i; + u8 baseSlotID; + Pokemon *mon; + FrontierTrainerDataDTO trDataDTO; - u8 v2 = BattleCastle_GetPartySize(param0->challengeType, 0); - u8 v3 = ov104_0223B7DC(param0->challengeType, 0); + u8 playerPartySize = BattleCastle_GetPlayerPartySize(battleCastle->challengeType, 0); + u8 opponentPartySize = BattleCastle_GetOpponentPartySize(battleCastle->challengeType, 0); - Party_HealAllMembers(param0->unk_2C); - FieldBattleDTO *v5 = FieldBattleDTO_New(HEAP_ID_FIELD2, ov104_0223B9E4(param0->challengeType)); - FieldBattleDTO_InitFromGameState(v5, NULL, param1->saveData, param1->unk_1C, param1->journalEntry, param1->bagCursor, param1->unk_20); + Party_HealAllMembers(battleCastle->opponentsParty); + FieldBattleDTO *battleDTO = FieldBattleDTO_New(HEAP_ID_FIELD2, BattleCastle_GetBattleType(battleCastle->challengeType)); + FieldBattleDTO_InitFromGameState(battleDTO, NULL, param1->saveData, param1->mapHeaderID, param1->journalEntry, param1->bagCursor, param1->subscreenCursorOn); - v5->background = BACKGROUND_BATTLE_CASTLE; - v5->terrain = TERRAIN_BATTLE_CASTLE; + battleDTO->background = BACKGROUND_BATTLE_CASTLE; + battleDTO->terrain = TERRAIN_BATTLE_CASTLE; - Party_InitWithCapacity(v5->parties[0], v2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_PLAYER_1], playerPartySize); if (CommSys_CurNetId() == 0) { - v4 = 0; + baseSlotID = 0; } else { - v4 = 2; + baseSlotID = 2; } - v6 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v2; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_28, v4 + v0), v6); + for (i = 0; i < playerPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleCastle->playersParty, baseSlotID + i), mon); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 0); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_PLAYER_1); } - Heap_Free(v6); - FieldBattleDTO_CopyPlayerInfoToTrainerData(v5); + Heap_Free(mon); + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - Heap_Free(BattleTower_GetTrainerData(&v7, param0->unk_30[param0->unk_11], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v5, &v7, v3, 1, 11); - Party_InitWithCapacity(v5->parties[1], ov104_0223B7DC(param0->challengeType, 0)); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleCastle->trainerIDs[battleCastle->unk_11], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_1, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_1], BattleCastle_GetOpponentPartySize(battleCastle->challengeType, 0)); - for (v0 = 0; v0 < 4; v0++) { - v5->trainer[v0].header.aiMask = ov104_0223BB10(param0); + for (i = 0; i < MAX_BATTLERS; i++) { + battleDTO->trainer[i].header.aiMask = BattleCastle_GetAIMask(battleCastle); } - v6 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_2C, v0), v6); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 1); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleCastle->opponentsParty, i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_1); } - Heap_Free(v6); + Heap_Free(mon); - switch (param0->challengeType) { - case 2: - case 3: - FieldBattleDTO_CopyPlayerInfoToTrainerData(v5); + switch (battleCastle->challengeType) { + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), v5->trainerInfo[2]); + TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), battleDTO->trainerInfo[BATTLER_PLAYER_2]); - Heap_Free(BattleTower_GetTrainerData(&v7, param0->unk_30[param0->unk_11 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); + Heap_Free(BattleFrontier_GetTrainerData(&trDataDTO, battleCastle->trainerIDs[battleCastle->unk_11 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR)); - ov104_0222E284(v5, &v7, v3, 3, 11); - Party_InitWithCapacity(v5->parties[3], ov104_0223B7DC(param0->challengeType, 0)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_2, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_2], BattleCastle_GetOpponentPartySize(battleCastle->challengeType, 0)); - v6 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(param0->unk_2C, v3 + v0), v6); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 3); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(battleCastle->opponentsParty, opponentPartySize + i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_2); } - Heap_Free(v6); + Heap_Free(mon); break; } - return v5; + return battleDTO; } -static u32 ov104_0223B9E4(u8 param0) +static u32 BattleCastle_GetBattleType(u8 challengeType) { - switch (param0) { - case 0: - return (0x0 | 0x1) | 0x80; - case 1: - return (0x2 | 0x1) | 0x80; - case 2: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; - case 3: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + return BATTLE_TYPE_FRONTIER_SINGLES; + case FRONTIER_CHALLENGE_DOUBLE: + return BATTLE_TYPE_FRONTIER_DOUBLES; + case FRONTIER_CHALLENGE_MULTI: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; + case FRONTIER_CHALLENGE_MULTI_WFC: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; } - return (0x0 | 0x1) | 0x80; + return BATTLE_TYPE_FRONTIER_SINGLES; } -u8 ov104_0223BA10(BattleCastle *param0) +u8 BattleCastle_GetOpponentLevel(BattleCastle *battleCastle) { return 50; } @@ -284,33 +285,33 @@ void ov104_0223BA24(Party *param0) return; } -void ov104_0223BA7C(BattleCastle *param0, Pokemon *param1) +void ov104_0223BA7C(BattleCastle *battleCastle, Pokemon *param1) { - Pokemon_UpdateAfterCatch(param1, SaveData_GetTrainerInfo(param0->saveData), 4, 0, 0, 11); + Pokemon_UpdateAfterCatch(param1, SaveData_GetTrainerInfo(battleCastle->saveData), 4, 0, 0, 11); return; } -void ov104_0223BAA0(BattleCastle *param0, Party *param1, Pokemon *param2) +void ov104_0223BAA0(BattleCastle *battleCastle, Party *param1, Pokemon *param2) { - ov104_0223BA7C(param0, param2); + ov104_0223BA7C(battleCastle, param2); Party_AddPokemon(param1, param2); return; } -void ov104_0223BAB8(BattleCastle *param0) +void ov104_0223BAB8(BattleCastle *battleCastle) { int v0, v1; u8 v2; Pokemon *v3; - Party_Init(param0->unk_2C); + Party_Init(battleCastle->opponentsParty); - v2 = ov104_0223B7DC(param0->challengeType, 1); + v2 = BattleCastle_GetOpponentPartySize(battleCastle->challengeType, 1); v3 = Pokemon_New(HEAP_ID_FIELD2); for (v0 = 0; v0 < v2; v0++) { - ov104_0222DF40(¶m0->unk_288[v0], v3, ov104_0223BA10(param0)); - ov104_0223BAA0(param0, param0->unk_2C, v3); + FrontierPokemonDataDTO_InitPokemon(&battleCastle->unk_288[v0], v3, BattleCastle_GetOpponentLevel(battleCastle)); + ov104_0223BAA0(battleCastle, battleCastle->opponentsParty, v3); } Heap_Free(v3); @@ -318,52 +319,53 @@ void ov104_0223BAB8(BattleCastle *param0) return; } -static u16 ov104_0223BB10(BattleCastle *param0) +static u16 BattleCastle_GetAIMask(BattleCastle *battleCastle) { - u16 v0, v1; + u16 aiMask, v1; - if (param0->challengeType == 0) { - if ((param0->unk_30[param0->unk_11] == 313) || (param0->unk_30[param0->unk_11] == 314)) { - return 0x1 | 0x2 | 0x4; + if (battleCastle->challengeType == FRONTIER_CHALLENGE_SINGLE) { + if (battleCastle->trainerIDs[battleCastle->unk_11] == FRONTIER_TRAINER_CASTLE_VALET_DARACH_SILVER + || battleCastle->trainerIDs[battleCastle->unk_11] == FRONTIER_TRAINER_CASTLE_VALET_DARACH_GOLD) { + return AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } } - v1 = ov104_0223BB60(param0); - v0 = (0x1 | 0x2 | 0x4); + v1 = ov104_0223BB60(battleCastle); + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; switch (v1 + 1) { case 1: case 2: - v0 = 0; + aiMask = AI_FLAG_NONE; break; case 3: case 4: - v0 = 0x1; + aiMask = AI_FLAG_BASIC; break; } - return v0; + return aiMask; } -u16 ov104_0223BB60(BattleCastle *param0) +u16 ov104_0223BB60(BattleCastle *battleCastle) { - u16 v0 = param0->unk_16; + u16 v0 = battleCastle->unk_16; - if (BattleCastle_IsMultiPlayerChallenge(param0->challengeType) == 1) { - if (param0->unk_A12 > param0->unk_16) { - v0 = param0->unk_A12; + if (BattleCastle_IsMultiPlayerChallenge(battleCastle->challengeType) == 1) { + if (battleCastle->unk_A12 > battleCastle->unk_16) { + v0 = battleCastle->unk_A12; } } return v0; } -void ov104_0223BB84(BgConfig *param0, BattleCastle *param1, u32 param2) +void ov104_0223BB84(BgConfig *param0, BattleCastle *battleCastle, u32 param2) { int v0; u16 v1[30]; - ov104_0223BBC4(v1, ov104_0223BB60(param1)); + ov104_0223BBC4(v1, ov104_0223BB60(battleCastle)); Bg_LoadToTilemapRect(param0, param2, v1, 11, 6, 10, 3); Bg_ScheduleTilemapTransfer(param0, param2); diff --git a/src/overlay104/ov104_0223BCBC.c b/src/overlay104/ov104_0223BCBC.c index bb408b338d..2ea523d3d1 100644 --- a/src/overlay104/ov104_0223BCBC.c +++ b/src/overlay104/ov104_0223BCBC.c @@ -4,6 +4,8 @@ #include #include "constants/battle_frontier.h" +#include "generated/ai_flags.h" +#include "generated/frontier_trainers.h" #include "struct_defs/battle_frontier_trainer_data.h" @@ -24,15 +26,15 @@ #include "string_gf.h" #include "trainer_info.h" -FieldBattleDTO *ov104_0223BDD8(BattleArcade *param0, UnkStruct_ov104_02230BE4 *param1); -static u32 ov104_0223BFD0(u8 param0); -u8 ov104_0223BFFC(BattleArcade *param0); -void ov104_0223C04C(BattleArcade *param0); -void ov104_0223C010(BattleArcade *param0, Pokemon *param1); -void ov104_0223C034(BattleArcade *param0, Party *param1, Pokemon *param2); -u16 ov104_0223C0BC(BattleArcade *param0, u8 param1); -static u16 ov104_0223C0D0(BattleArcade *param0); -u16 ov104_0223C124(BattleArcade *param0); +FieldBattleDTO *FieldBattleDTO_NewBattleArcade(BattleArcade *battleArcade, UnkStruct_ov104_02230BE4 *param1); +static u32 BattleArcade_GetBattleType(u8 challengeType); +u8 BattleArcade_GetPokemonLevel(BattleArcade *battleArcade); +void ov104_0223C04C(BattleArcade *battleArcade); +void ov104_0223C010(BattleArcade *battleArcade, Pokemon *param1); +void ov104_0223C034(BattleArcade *battleArcade, Party *param1, Pokemon *param2); +u16 ov104_0223C0BC(BattleArcade *battleArcade, u8 param1); +static u16 BattleArcade_GetAIMask(BattleArcade *battleArcade); +u16 ov104_0223C124(BattleArcade *battleArcade); void FieldBattleDTO_CopyPlayerInfoToTrainerData(FieldBattleDTO *param0); static int ov104_0223BCBC(u8 param0, int param1, int param2); void ov104_0223BD28(u8 param0, int param1, u16 param2[], u8 param3); @@ -73,9 +75,9 @@ static int ov104_0223BCBC(u8 param0, int param1, int param2) v3 = (param1 * 7) + (param2 + 1); if (v3 == 21) { - return 311; + return FRONTIER_TRAINER_ARCADE_STAR_DAHLIA_SILVER; } else if (v3 == 49) { - return 312; + return FRONTIER_TRAINER_ARCADE_STAR_DAHLIA_GOLD; } } @@ -117,7 +119,7 @@ void ov104_0223BD28(u8 param0, int param1, u16 param2[], u8 param3) } while (v0 < param3); } -u8 BattleArcade_GetPartySize(u8 challengeType, BOOL includePartnerMons) +u8 BattleArcade_GetPlayerPartySize(u8 challengeType, BOOL includePartnerMons) { switch (challengeType) { case FRONTIER_CHALLENGE_SINGLE: @@ -155,117 +157,114 @@ u8 BattleArcade_GetOpponentPartySize(u8 challengeType, BOOL includeBothOpponents return ARCADE_PARTY_SIZE_SOLO; } -FieldBattleDTO *ov104_0223BDD8(BattleArcade *param0, UnkStruct_ov104_02230BE4 *param1) +FieldBattleDTO *FieldBattleDTO_NewBattleArcade(BattleArcade *battleArcade, UnkStruct_ov104_02230BE4 *param1) { - int v0; - u8 v2, v3, v4; - Pokemon *v6; - FrontierTrainerDataDTO v7; - Party *v12; - Party *v13; + int i; + u8 baseSlotID; + FrontierTrainerDataDTO trDataDTO; - v2 = BattleArcade_GetPartySize(param0->challengeType, 0); - v3 = BattleArcade_GetOpponentPartySize(param0->challengeType, 0); - FieldBattleDTO *v5 = FieldBattleDTO_New(HEAP_ID_FIELD2, ov104_0223BFD0(param0->challengeType)); + u8 playerPartySize = BattleArcade_GetPlayerPartySize(battleArcade->challengeType, 0); + u8 opponentPartySize = BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 0); + FieldBattleDTO *battleDTO = FieldBattleDTO_New(HEAP_ID_FIELD2, BattleArcade_GetBattleType(battleArcade->challengeType)); - FieldBattleDTO_InitFromGameState(v5, NULL, param1->saveData, param1->unk_1C, param1->journalEntry, param1->bagCursor, param1->unk_20); + FieldBattleDTO_InitFromGameState(battleDTO, NULL, param1->saveData, param1->mapHeaderID, param1->journalEntry, param1->bagCursor, param1->subscreenCursorOn); - v5->background = BACKGROUND_BATTLE_ARCADE; - v5->terrain = TERRAIN_BATTLE_ARCADE; - v5->fieldWeather = param0->unk_14; + battleDTO->background = BACKGROUND_BATTLE_ARCADE; + battleDTO->terrain = TERRAIN_BATTLE_ARCADE; + battleDTO->fieldWeather = battleArcade->weather; - v12 = param0->unk_70; - v13 = param0->unk_74; + Party *playersParty = battleArcade->playersParty; + Party *opponentsParty = battleArcade->opponentsParty; - if (param0->activeEffect == 27) { - v12 = param0->unk_74; - v13 = param0->unk_70; + if (battleArcade->activeEffect == ARCADE_EFFECT_SWAP_MONS) { + playersParty = battleArcade->opponentsParty; + opponentsParty = battleArcade->playersParty; } - Party_InitWithCapacity(v5->parties[0], v2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_PLAYER_1], playerPartySize); if (CommSys_CurNetId() == 0) { - v4 = 0; + baseSlotID = 0; } else { - v4 = 2; + baseSlotID = 2; } - v6 = Pokemon_New(HEAP_ID_FIELD2); + Pokemon *mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v2; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(v12, v4 + v0), v6); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 0); + for (i = 0; i < playerPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(playersParty, baseSlotID + i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_PLAYER_1); } - Heap_Free(v6); - FieldBattleDTO_CopyPlayerInfoToTrainerData(v5); + Heap_Free(mon); + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - BattleFrontierTrainerData *v8 = BattleTower_GetTrainerData(&v7, param0->unk_78[param0->unk_11], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); + BattleFrontierTrainerData *trData = BattleFrontier_GetTrainerData(&trDataDTO, battleArcade->trainerIDs[battleArcade->unk_11], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); - Heap_Free(v8); - ov104_0222E284(v5, &v7, v3, 1, 11); - Party_InitWithCapacity(v5->parties[1], BattleArcade_GetOpponentPartySize(param0->challengeType, 0)); + Heap_Free(trData); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_1, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_1], BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 0)); - for (v0 = 0; v0 < 4; v0++) { - v5->trainer[v0].header.aiMask = ov104_0223C0D0(param0); + for (i = 0; i < MAX_BATTLERS; i++) { + battleDTO->trainer[i].header.aiMask = BattleArcade_GetAIMask(battleArcade); } - v6 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(v13, v0), v6); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 1); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(opponentsParty, i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_1); } - Heap_Free(v6); + Heap_Free(mon); - switch (param0->challengeType) { - case 2: - case 3: - FieldBattleDTO_CopyPlayerInfoToTrainerData(v5); + switch (battleArcade->challengeType) { + case FRONTIER_CHALLENGE_MULTI: + case FRONTIER_CHALLENGE_MULTI_WFC: + FieldBattleDTO_CopyPlayerInfoToTrainerData(battleDTO); - TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), v5->trainerInfo[2]); + TrainerInfo_Copy(CommInfo_TrainerInfo(1 - CommSys_CurNetId()), battleDTO->trainerInfo[BATTLER_PLAYER_2]); - v8 = BattleTower_GetTrainerData(&v7, param0->unk_78[param0->unk_11 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); - Heap_Free(v8); + trData = BattleFrontier_GetTrainerData(&trDataDTO, battleArcade->trainerIDs[battleArcade->unk_11 + 7], HEAP_ID_FIELD2, NARC_INDEX_BATTLE__B_PL_TOWER__PL_BTDTR); + Heap_Free(trData); - ov104_0222E284(v5, &v7, v3, 3, 11); - Party_InitWithCapacity(v5->parties[3], BattleArcade_GetOpponentPartySize(param0->challengeType, 0)); + FieldBattleDTO_InitFrontierTrainer(battleDTO, &trDataDTO, opponentPartySize, BATTLER_ENEMY_2, HEAP_ID_FIELD2); + Party_InitWithCapacity(battleDTO->parties[BATTLER_ENEMY_2], BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 0)); - v6 = Pokemon_New(HEAP_ID_FIELD2); + mon = Pokemon_New(HEAP_ID_FIELD2); - for (v0 = 0; v0 < v3; v0++) { - Pokemon_Copy(Party_GetPokemonBySlotIndex(v13, v3 + v0), v6); - FieldBattleDTO_AddPokemonToBattler(v5, v6, 3); + for (i = 0; i < opponentPartySize; i++) { + Pokemon_Copy(Party_GetPokemonBySlotIndex(opponentsParty, opponentPartySize + i), mon); + FieldBattleDTO_AddPokemonToBattler(battleDTO, mon, BATTLER_ENEMY_2); } - Heap_Free(v6); + Heap_Free(mon); break; } - Party_HealAllMembers(param0->unk_70); - Party_HealAllMembers(param0->unk_74); + Party_HealAllMembers(battleArcade->playersParty); + Party_HealAllMembers(battleArcade->opponentsParty); - return v5; + return battleDTO; } -static u32 ov104_0223BFD0(u8 param0) +static u32 BattleArcade_GetBattleType(u8 challengeType) { - switch (param0) { - case 0: - return (0x0 | 0x1) | 0x80; - case 1: - return (0x2 | 0x1) | 0x80; - case 2: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; - case 3: - return (((0x4 | 0x1) | 0x2) | 0x8) | 0x80; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + return BATTLE_TYPE_FRONTIER_SINGLES; + case FRONTIER_CHALLENGE_DOUBLE: + return BATTLE_TYPE_FRONTIER_DOUBLES; + case FRONTIER_CHALLENGE_MULTI: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; + case FRONTIER_CHALLENGE_MULTI_WFC: + return BATTLE_TYPE_FRONTIER_LINK | BATTLE_TYPE_TRAINER_DOUBLES | BATTLE_TYPE_2vs2; } - return (0x0 | 0x1) | 0x80; + return BATTLE_TYPE_FRONTIER_SINGLES; } -u8 ov104_0223BFFC(BattleArcade *param0) +u8 BattleArcade_GetPokemonLevel(BattleArcade *battleArcade) { return 50; } @@ -275,38 +274,37 @@ BOOL BattleArcade_IsMultiPlayerChallenge(u8 challengeType) return challengeType == FRONTIER_CHALLENGE_MULTI || challengeType == FRONTIER_CHALLENGE_MULTI_WFC; } -void ov104_0223C010(BattleArcade *param0, Pokemon *param1) +void ov104_0223C010(BattleArcade *battleArcade, Pokemon *param1) { - Pokemon_UpdateAfterCatch(param1, SaveData_GetTrainerInfo(param0->saveData), 4, 0, 0, 11); + Pokemon_UpdateAfterCatch(param1, SaveData_GetTrainerInfo(battleArcade->saveData), 4, 0, 0, 11); return; } -void ov104_0223C034(BattleArcade *param0, Party *param1, Pokemon *param2) +void ov104_0223C034(BattleArcade *battleArcade, Party *param1, Pokemon *param2) { - ov104_0223C010(param0, param2); + ov104_0223C010(battleArcade, param2); Party_AddPokemon(param1, param2); return; } -void ov104_0223C04C(BattleArcade *param0) +void ov104_0223C04C(BattleArcade *battleArcade) { u32 v0; int v1, v2; u8 v3; - Party *v4; Pokemon *v5; Pokemon *v6; - Party_Init(param0->unk_74); + Party_Init(battleArcade->opponentsParty); - v3 = BattleArcade_GetOpponentPartySize(param0->challengeType, 1); + v3 = BattleArcade_GetOpponentPartySize(battleArcade->challengeType, 1); v5 = Pokemon_New(HEAP_ID_FIELD2); for (v1 = 0; v1 < v3; v1++) { - ov104_0222DF40(¶m0->unk_330[v1], v5, ov104_0223BFFC(param0)); - ov104_0223C034(param0, param0->unk_74, v5); + FrontierPokemonDataDTO_InitPokemon(&battleArcade->unk_330[v1], v5, BattleArcade_GetPokemonLevel(battleArcade)); + ov104_0223C034(battleArcade, battleArcade->opponentsParty, v5); - v6 = Party_GetPokemonBySlotIndex(param0->unk_74, v1); + v6 = Party_GetPokemonBySlotIndex(battleArcade->opponentsParty, v1); v0 = 0; Pokemon_SetValue(v6, MON_DATA_HELD_ITEM, &v0); @@ -316,11 +314,11 @@ void ov104_0223C04C(BattleArcade *param0) return; } -u16 ov104_0223C0BC(BattleArcade *param0, u8 param1) +u16 ov104_0223C0BC(BattleArcade *battleArcade, u8 param1) { u16 v0, v1; - v1 = ov104_0223C124(param0); + v1 = ov104_0223C124(battleArcade); if (param1 == 28) { if (v1 < 3) { @@ -343,40 +341,41 @@ u16 ov104_0223C0BC(BattleArcade *param0, u8 param1) return v0; } -static u16 ov104_0223C0D0(BattleArcade *param0) +static u16 BattleArcade_GetAIMask(BattleArcade *battleArcade) { - u16 v0, v1; + u16 aiMask, v1; - if (param0->challengeType == 0) { - if ((param0->unk_78[param0->unk_11] == 311) || (param0->unk_78[param0->unk_11] == 312)) { - return 0x1 | 0x2 | 0x4; + if (battleArcade->challengeType == FRONTIER_CHALLENGE_SINGLE) { + if (battleArcade->trainerIDs[battleArcade->unk_11] == FRONTIER_TRAINER_ARCADE_STAR_DAHLIA_SILVER + || battleArcade->trainerIDs[battleArcade->unk_11] == FRONTIER_TRAINER_ARCADE_STAR_DAHLIA_GOLD) { + return AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; } } - v1 = ov104_0223C124(param0); - v0 = (0x1 | 0x2 | 0x4); + v1 = ov104_0223C124(battleArcade); + aiMask = AI_FLAG_BASIC | AI_FLAG_EVAL_ATTACK | AI_FLAG_EXPERT; switch (v1 + 1) { case 1: case 2: - v0 = 0; + aiMask = AI_FLAG_NONE; break; case 3: case 4: - v0 = 0x1; + aiMask = AI_FLAG_BASIC; break; } - return v0; + return aiMask; } -u16 ov104_0223C124(BattleArcade *param0) +u16 ov104_0223C124(BattleArcade *battleArcade) { - u16 v0 = param0->unk_1A; + u16 v0 = battleArcade->unk_1A; - if (BattleArcade_IsMultiPlayerChallenge(param0->challengeType) == 1) { - if (param0->unk_A76 > param0->unk_1A) { - v0 = param0->unk_A76; + if (BattleArcade_IsMultiPlayerChallenge(battleArcade->challengeType) == 1) { + if (battleArcade->unk_A76 > battleArcade->unk_1A) { + v0 = battleArcade->unk_A76; } } diff --git a/src/persisted_map_features_init.c b/src/persisted_map_features_init.c index ddb3ddd677..27b34ebc7e 100644 --- a/src/persisted_map_features_init.c +++ b/src/persisted_map_features_init.c @@ -6,13 +6,11 @@ #include "constants/field/dynamic_map_features.h" #include "constants/great_marsh_tram.h" -#include "struct_defs/struct_02071BF8.h" - #include "field/field_system.h" #include "field/field_system_sub2_t.h" #include "overlay005/villa_furniture.h" #include "overlay006/great_marsh_tram.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "overlay009/ov9_02249960.h" #include "field_system.h" @@ -117,8 +115,8 @@ void PersistedMapFeatures_InitForVeilstoneGym(FieldSystem *fieldSystem) PersistedMapFeatures *persistedMapFeatures = MiscSaveBlock_GetPersistedMapFeatures(FieldSystem_GetSaveData(fieldSystem)); PersistedMapFeatures_InitWithID(persistedMapFeatures, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM); - UnkStruct_02071BF8 *data = PersistedMapFeatures_GetBuffer(persistedMapFeatures, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM); - data->unk_00 = 0; + VeilstoneGymPersistedFeature *data = PersistedMapFeatures_GetBuffer(persistedMapFeatures, DYNAMIC_MAP_FEATURES_VEILSTONE_GYM); + data->initialized = FALSE; } void PersistedMapFeatures_InitForHearthomeGym(FieldSystem *fieldSystem) diff --git a/src/player_avatar.c b/src/player_avatar.c index 8672b0eb44..0671145467 100644 --- a/src/player_avatar.c +++ b/src/player_avatar.c @@ -5,6 +5,8 @@ #include "constants/field/dynamic_map_features.h" #include "constants/scrcmd.h" +#include "generated/movement_types.h" +#include "generated/object_events_gfx.h" #include "struct_decls/map_object.h" #include "struct_decls/map_object_manager.h" @@ -20,52 +22,60 @@ #include "overworld_anim_manager.h" static PlayerAvatar *PlayerAvatar_Alloc(void); -static void sub_0205E91C(PlayerAvatar *playerAvatar, int param1, int param2, PlayerData *param3); +static void PlayerAvatar_Init(PlayerAvatar *playerAvatar, int param1, int param2, PlayerData *param3); static void PlayerAvatar_AddMapObject(PlayerAvatar *playerAvatar, const MapObjectManager *param1, int param2, int param3, int param4, int param5); -static MapObject *sub_0205EA64(const MapObjectManager *mapObjMan); -static void PlayerAvatar_SetFlagUnk_00(PlayerAvatar *playerAvatar, u32 param1); -static void PlayerAvatar_ClearFlagUnk_00(PlayerAvatar *playerAvatar, u32 param1); -static u32 PlayerAvatar_GetFlagUnk_00(PlayerAvatar *playerAvatar, u32 param1); +static MapObject *MapObjectMan_GetPlayerMapObjectCheckNull(const MapObjectManager *mapObjMan); +static void PlayerAvatar_TurnOnMovementFlagBits(PlayerAvatar *playerAvatar, u32 param1); +static void PlayerAvatar_ClearMovementFlag(PlayerAvatar *playerAvatar, u32 param1); +static u32 PlayerAvatar_GetMovementFlag(PlayerAvatar *playerAvatar, u32 param1); static void PlayerAvatar_SetPlayerData(PlayerAvatar *playerAvatar, PlayerData *param1); -static u32 GetPlayerForm(PlayerData *player); -static void SetPlayerForm(PlayerData *player, u32 form); -static void SetAvatarForm(PlayerAvatar *playerAvatar, u32 form); +static u32 PlayerData_GetAvatarState(PlayerData *player); +static void PlayerData_SetAvatarState(PlayerData *player, u32 state); +static void PlayerAvatar_PlayerData_SetAvatarState(PlayerAvatar *playerAvatar, u32 state); -PlayerAvatar *PlayerAvatar_Init(const MapObjectManager *mapObjMan, int x, int z, int dir, int param4, int param5, int param6, PlayerData *param7) +/** + * Creates and initializes a new Player Avatar map object + */ +PlayerAvatar *PlayerAvatar_New(const MapObjectManager *mapObjMan, int x, int z, int dir, int playerState, int gender, int dpSprite, PlayerData *playerData) { PlayerAvatar *playerAvatar = PlayerAvatar_Alloc(); - sub_0205E91C(playerAvatar, param4, param5, param7); + PlayerAvatar_Init(playerAvatar, playerState, gender, playerData); - int v1; + int sprite; - if (param6 == 0) { - v1 = Player_MoveStateFromGender(param4, param5); + if (dpSprite == 0) { + sprite = Player_GetSpriteFromStateAndGender(playerState, gender); } else { - if (param5 == 0) { - v1 = 0xfc; + if (gender == 0) { + sprite = OBJ_EVENT_GFX_DP_PLAYER_M; } else { - v1 = 0xfd; + sprite = OBJ_EVENT_GFX_DP_PLAYER_F; } } - PlayerAvatar_AddMapObject(playerAvatar, mapObjMan, v1, dir, x, z); + PlayerAvatar_AddMapObject(playerAvatar, mapObjMan, sprite, dir, x, z); return playerAvatar; } -PlayerAvatar *sub_0205E820(const MapObjectManager *mapObjMan, PlayerData *param1, int gender) +/** + * Creates a new Player Avatar and loads its corresponding map object from an already existing map object + * + * @return playerAvatar + */ +PlayerAvatar *PlayerAvatar_NewLoad(const MapObjectManager *mapObjMan, PlayerData *playerData, int gender) { - int v0; + int playerState; PlayerAvatar *playerAvatar; MapObject *mapObj; playerAvatar = PlayerAvatar_Alloc(); - v0 = GetPlayerForm(param1); + playerState = PlayerData_GetAvatarState(playerData); - sub_0205E91C(playerAvatar, v0, gender, param1); - mapObj = sub_0205EA64(mapObjMan); + PlayerAvatar_Init(playerAvatar, playerState, gender, playerData); + mapObj = MapObjectMan_GetPlayerMapObjectCheckNull(mapObjMan); - MapObject_SetGraphicsID(mapObj, Player_MoveStateFromGender(v0, gender)); + MapObject_SetGraphicsID(mapObj, Player_GetSpriteFromStateAndGender(playerState, gender)); MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_PERSISTENT | MAP_OBJ_STATUS_13); MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); MapObject_SetDynamicHeightCalculationEnabled(mapObj, TRUE); @@ -74,39 +84,53 @@ PlayerAvatar *sub_0205E820(const MapObjectManager *mapObjMan, PlayerData *param1 return playerAvatar; } -void PlayerAvatar_InitDraw(PlayerAvatar *playerAvatar, int dynamicMapFeaturesID) +/** + * Initializes a PlayerAvatar with dynamic map features, like starting on a surf mount + */ +void PlayerAvatar_InitMapFeatures(PlayerAvatar *playerAvatar, int dynamicMapFeaturesID) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); GF_ASSERT(mapObj != NULL); MapObject_MapObjectManager(mapObj); ov5_021F6218(playerAvatar); - if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_AVATAR_SURFING) { if (dynamicMapFeaturesID != DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) { - int x = Player_GetXPos(playerAvatar); - int z = Player_GetZPos(playerAvatar); - int dir = PlayerAvatar_GetDir(playerAvatar); - OverworldAnimManager *v7 = SurfMountRenderer_HandleSurfBegin(mapObj, x, z, dir, TRUE); + int x = PlayerAvatar_GetXPos(playerAvatar); + int z = PlayerAvatar_GetZPos(playerAvatar); + int dir = PlayerAvatar_GetFacingDir(playerAvatar); + OverworldAnimManager *animManager = SurfMountRenderer_HandleSurfBegin(mapObj, x, z, dir, TRUE); - PlayerAvatar_SetSurfMountAnimManager(playerAvatar, v7); + PlayerAvatar_SetSurfMountAnimManager(playerAvatar, animManager); } } } -void Player_Delete(PlayerAvatar *playerAvatar) +/** + * Frees the player avatar + */ +void PlayerAvatar_Free(PlayerAvatar *playerAvatar) { Heap_Free(playerAvatar); } -void Player_DeleteAll(PlayerAvatar *playerAvatar) +/** + * Deletes the player avatar and its associated map object + */ +void PlayerAvatar_Delete(PlayerAvatar *playerAvatar) { - MapObject *mapObject = Player_MapObject(playerAvatar); + MapObject *mapObject = PlayerAvatar_GetMapObject(playerAvatar); MapObject_Delete(mapObject); - Player_Delete(playerAvatar); + PlayerAvatar_Free(playerAvatar); } +/** + * Allocates memory for a player avatar and zero initializes it + * + * @return playerAvatar + */ static PlayerAvatar *PlayerAvatar_Alloc(void) { PlayerAvatar *playerAvatar = Heap_Alloc(HEAP_ID_FIELD2, sizeof(PlayerAvatar)); @@ -116,27 +140,33 @@ static PlayerAvatar *PlayerAvatar_Alloc(void) return playerAvatar; } -static void sub_0205E91C(PlayerAvatar *playerAvatar, int param1, int gender, PlayerData *player) +/** + * Initializes an existing player avatar + */ +static void PlayerAvatar_Init(PlayerAvatar *playerAvatar, int playerState, int gender, PlayerData *player) { PlayerAvatar_SetPlayerData(playerAvatar, player); - sub_0205EB08(playerAvatar, 0); - sub_0205EB10(playerAvatar, 0); - PlayerAvatar_SetPlayerState(playerAvatar, param1); + PlayerAvatar_SetMoveState(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); + PlayerAvatar_SetPlayerState(playerAvatar, playerState); PlayerAvatar_SetGender(playerAvatar, gender); PlayerAvatar_SetRequestStateFlag(playerAvatar, 0); PlayerAvatar_ClearSpeed(playerAvatar); PlayerAvatar_SetFaceLeftOrRight(playerAvatar, -1); PlayerAvatar_SetFaceUpOrDown(playerAvatar, -1); - sub_0205EC20(playerAvatar, 0xff, 0); + PlayerAvatar_SetMovementActionAndSpeed(playerAvatar, 0xff, 0); - sub_0205EF6C(playerAvatar, 1); + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 1); PlayerAvatar_SetEscapedFromDeepMud(playerAvatar, TRUE); } -static void PlayerAvatar_AddMapObject(PlayerAvatar *playerAvatar, const MapObjectManager *mapObjMan, int param2, int dir, int x, int z) +/** + * Creates and adds a map object for the Player Avatar + */ +static void PlayerAvatar_AddMapObject(PlayerAvatar *playerAvatar, const MapObjectManager *mapObjMan, int sprite, int dir, int x, int z) { - MapObject *mapObj = MapObjectMan_AddMapObject(mapObjMan, x, z, dir, param2, 0x1, 1); + MapObject *mapObj = MapObjectMan_AddMapObject(mapObjMan, x, z, dir, sprite, 0x1, 1); GF_ASSERT(mapObj != NULL); MapObject_SetLocalID(mapObj, LOCALID_PLAYER); @@ -155,13 +185,18 @@ static void PlayerAvatar_AddMapObject(PlayerAvatar *playerAvatar, const MapObjec PlayerAvatar_SetMapObject(playerAvatar, mapObj); } -MapObject *sub_0205EA24(const MapObjectManager *mapObjMan) +/** + * Gets the first map object with MOVEMENT_TYPE_PLAYER, which is the map object associated with the Player Avatar + * + * @return The MapObject * associated with the PlayerAvatar + */ +MapObject *MapObjectMan_GetPlayerMapObject(const MapObjectManager *mapObjMan) { - int v0 = 0; + int index = 0; MapObject *mapObj = NULL; - while (MapObjectMan_FindObjectWithStatus(mapObjMan, &mapObj, &v0, 1 << 0)) { - if (MapObject_GetMovementType(mapObj) == 0x1) { + while (MapObjectMan_FindObjectWithStatus(mapObjMan, &mapObj, &index, MAP_OBJ_STATUS_0)) { + if (MapObject_GetMovementType(mapObj) == MOVEMENT_TYPE_PLAYER) { break; } } @@ -169,91 +204,161 @@ MapObject *sub_0205EA24(const MapObjectManager *mapObjMan) return mapObj; } -static MapObject *sub_0205EA64(const MapObjectManager *mapObjMan) +/** + * Gets the map object associated with the PlayerAvatar, throws an error when NULL + * + * @return The MapObject * associated with the PlayerAvatar + */ +static MapObject *MapObjectMan_GetPlayerMapObjectCheckNull(const MapObjectManager *mapObjMan) { - MapObject *mapObj = sub_0205EA24(mapObjMan); + MapObject *mapObj = MapObjectMan_GetPlayerMapObject(mapObjMan); GF_ASSERT(mapObj != NULL); return mapObj; } -int PlayerAvatar_GetDir(PlayerAvatar *const playerAvatar) +/** + * Gets the facing direction of the player avatar's map object + * + * @return facing direction + */ +int PlayerAvatar_GetFacingDir(PlayerAvatar *const playerAvatar) { - return MapObject_GetFacingDir(Player_MapObject(playerAvatar)); + return MapObject_GetFacingDir(PlayerAvatar_GetMapObject(playerAvatar)); } -void Player_SetDir(PlayerAvatar *playerAvatar, int dir) +/** + * Sets the facing direction of the player avatar's map object if the change direction lock is off + */ +void PlayerAvatar_TryFace(PlayerAvatar *playerAvatar, int dir) { - MapObject_TryFace(Player_MapObject(playerAvatar), dir); + MapObject_TryFace(PlayerAvatar_GetMapObject(playerAvatar), dir); } -int PlayerAvatar_GetMoveDir(PlayerAvatar *const playerAvatar) +/** + * Gets the moving direction of the player avatar's map object + * + * @return moving direction + */ +int PlayerAvatar_GetMovingDir(PlayerAvatar *const playerAvatar) { - return MapObject_GetMovingDir(Player_MapObject(playerAvatar)); + return MapObject_GetMovingDir(PlayerAvatar_GetMapObject(playerAvatar)); } +/** + * Gets the distortion world direction of the player avatar's map object + * + * @return facing direction when on the floor, moving direction otherwise + */ int PlayerAvatar_GetDistortionDir(PlayerAvatar *const playerAvatar) { if (PlayerAvatar_DistortionStateOnFloor(playerAvatar) == TRUE) { - return PlayerAvatar_GetDir(playerAvatar); + return PlayerAvatar_GetFacingDir(playerAvatar); } - return PlayerAvatar_GetMoveDir(playerAvatar); + return PlayerAvatar_GetMovingDir(playerAvatar); } -int Player_GetXPos(PlayerAvatar *const playerAvatar) +/** + * Gets the X position of the player avatar's map object + * + * @return xPos + */ +int PlayerAvatar_GetXPos(PlayerAvatar *const playerAvatar) { - return MapObject_GetX(Player_MapObject(playerAvatar)); + return MapObject_GetX(PlayerAvatar_GetMapObject(playerAvatar)); } -int Player_GetZPos(PlayerAvatar *const playerAvatar) +/** + * Gets the Z position of the player avatar's map object + * + * @return zPos + */ +int PlayerAvatar_GetZPos(PlayerAvatar *const playerAvatar) { - return MapObject_GetZ(Player_MapObject(playerAvatar)); + return MapObject_GetZ(PlayerAvatar_GetMapObject(playerAvatar)); } +/** + * Gets the previous X position of the player avatar's map object + * + * @return xPosPrev + */ int PlayerAvatar_XPosPrev(PlayerAvatar *const playerAvatar) { - return MapObject_GetXPrev(Player_MapObject(playerAvatar)); + return MapObject_GetXPrev(PlayerAvatar_GetMapObject(playerAvatar)); } +/** + * Gets the previous Z position of the player avatar's map object + * + * @return zPosPrev + */ int PlayerAvatar_ZPosPrev(PlayerAvatar *const playerAvatar) { - return MapObject_GetZPrev(Player_MapObject(playerAvatar)); + return MapObject_GetZPrev(PlayerAvatar_GetMapObject(playerAvatar)); } -void PlayerAvatar_PosVectorOut(PlayerAvatar *const playerAvatar, VecFx32 *pos) +/** + * Gets the position vector of the player avatar's map object and stores it in pos + */ +void PlayerAvatar_GetPosPtr(PlayerAvatar *const playerAvatar, VecFx32 *pos) { - MapObject_GetPosPtr(Player_MapObject(playerAvatar), pos); + MapObject_GetPosPtr(PlayerAvatar_GetMapObject(playerAvatar), pos); } -const VecFx32 *PlayerAvatar_PosVector(PlayerAvatar *const playerAvatar) +/** + * Gets the position vector of the player avatar's map object + * + * @return VecFx32 *pos + */ +const VecFx32 *PlayerAvatar_GetPos(PlayerAvatar *const playerAvatar) { - return MapObject_GetPos(PlayerAvatar_ConstMapObject(playerAvatar)); + return MapObject_GetPos(PlayerAvatar_GetConstMapObject(playerAvatar)); } -void sub_0205EB08(PlayerAvatar *playerAvatar, int param1) +/** + * Sets the Player Avatar's move state, specified by enum AvatarMoveState + */ +void PlayerAvatar_SetMoveState(PlayerAvatar *playerAvatar, int state) { - playerAvatar->unk_14 = param1; + playerAvatar->moveState = state; } -int PlayerAvatar_MoveState(const PlayerAvatar *playerAvatar) +/** + * Gets the Player Avatar's move state, specified by enum AvatarMoveState + * + * @return playerAvatar->moveState + */ +int PlayerAvatar_GetMoveState(const PlayerAvatar *playerAvatar) { - return playerAvatar->unk_14; + return playerAvatar->moveState; } -void sub_0205EB10(PlayerAvatar *playerAvatar, int param1) +/** + * Sets the player avatar's player move state, specified by PlayerMoveState + */ +void PlayerAvatar_SetPlayerMoveState(PlayerAvatar *playerAvatar, int moveState) { - playerAvatar->unk_18 = param1; + playerAvatar->playerMoveState = moveState; } -int Player_MoveState(const PlayerAvatar *playerAvatar) +/** + * Gets the player avatar's move state, specified by PlayerMoveState + * + * @return playerAvatar->playerMoveState + */ +int PlayerAvatar_GetPlayerMoveState(const PlayerAvatar *playerAvatar) { - return playerAvatar->unk_18; + return playerAvatar->playerMoveState; } +/** + * Shows or hides the Player Avatar based on the specification of visible + */ void PlayerAvatar_SetVisible(PlayerAvatar *playerAvatar, BOOL visible) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (visible == TRUE) { MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_HIDE); @@ -262,12 +367,20 @@ void PlayerAvatar_SetVisible(PlayerAvatar *playerAvatar, BOOL visible) } } +/** + * Directly sets the Player Avatar's mapObject + */ void PlayerAvatar_SetMapObject(PlayerAvatar *playerAvatar, MapObject *mapObject) { playerAvatar->mapObject = mapObject; } -MapObject *Player_MapObject(PlayerAvatar *playerAvatar) +/** + * Gets the Player Avatar's map object + * + * @return playerAvatar->mapObject + */ +MapObject *PlayerAvatar_GetMapObject(PlayerAvatar *playerAvatar) { GF_ASSERT(playerAvatar != NULL); GF_ASSERT(playerAvatar->mapObject != NULL); @@ -275,81 +388,140 @@ MapObject *Player_MapObject(PlayerAvatar *playerAvatar) return playerAvatar->mapObject; } -const MapObject *PlayerAvatar_ConstMapObject(const PlayerAvatar *playerAvatar) +/** + * Gets a constant Player Avatar's map object + * + * @return playerAvatar->mapObject + */ +const MapObject *PlayerAvatar_GetConstMapObject(const PlayerAvatar *playerAvatar) { return playerAvatar->mapObject; } -void PlayerAvatar_SetPlayerState(PlayerAvatar *playerAvatar, int form) +/** + * Sets the player avatar's state, specified by enum PlayerAvatarState + */ +void PlayerAvatar_SetPlayerState(PlayerAvatar *playerAvatar, int playerState) { - GF_ASSERT(form < 0x6); - playerAvatar->unk_1C = form; + GF_ASSERT(playerState < 0x6); + playerAvatar->playerAvatarState = playerState; - SetAvatarForm(playerAvatar, form); + PlayerAvatar_PlayerData_SetAvatarState(playerAvatar, playerState); } +/** + * Gets the player's avatar state, specified by enum PlayerAvatarState + * + * @return playerAvatar->playerAvatarState + */ int PlayerAvatar_GetPlayerState(PlayerAvatar *playerAvatar) { GF_ASSERT(playerAvatar != NULL); - return playerAvatar->unk_1C; + return playerAvatar->playerAvatarState; } -void PlayerAvatar_TurnOnRequestStateBit(PlayerAvatar *playerAvatar, u32 param1) +/** + * Sets the request state flag's bits without overwriting the existing requests + */ +void PlayerAvatar_TurnOnRequestStateBit(PlayerAvatar *playerAvatar, u32 requestState) { - playerAvatar->unk_04 |= param1; + playerAvatar->requestStateFlag |= requestState; } -void PlayerAvatar_SetRequestStateFlag(PlayerAvatar *playerAvatar, u32 param1) +/** + * Sets the request state flag while overwriting the existing requests + */ +void PlayerAvatar_SetRequestStateFlag(PlayerAvatar *playerAvatar, u32 requestState) { - playerAvatar->unk_04 = param1; + playerAvatar->requestStateFlag = requestState; } -u32 PlayerAvatar_RequestStateFlag(PlayerAvatar *playerAvatar) +/** + * Gets the request state flag + * + * @return playerAvatar->requestStateFlag + */ +u32 PlayerAvatar_GetRequestStateFlag(PlayerAvatar *playerAvatar) { - return playerAvatar->unk_04; + return playerAvatar->requestStateFlag; } +/** + * Sets the player avatar's gender + */ void PlayerAvatar_SetGender(PlayerAvatar *playerAvatar, int gender) { playerAvatar->gender = gender; } -int PlayerAvatar_Gender(PlayerAvatar *playerAvatar) +/** + * Gets the player avatar's gender + * + * @return gender + */ +int PlayerAvatar_GetGender(PlayerAvatar *playerAvatar) { return playerAvatar->gender; } -static void PlayerAvatar_SetFlagUnk_00(PlayerAvatar *playerAvatar, u32 flag) +/** + * Sets the player avatar's movement flag without overwriting the existing flag + */ +static void PlayerAvatar_TurnOnMovementFlagBits(PlayerAvatar *playerAvatar, u32 flag) { - playerAvatar->unk_00 |= flag; + playerAvatar->movementFlag |= flag; } -static void PlayerAvatar_ClearFlagUnk_00(PlayerAvatar *playerAvatar, u32 flag) +/** + * Clears the given bits of the movement flag + */ +static void PlayerAvatar_ClearMovementFlag(PlayerAvatar *playerAvatar, u32 flag) { - playerAvatar->unk_00 &= ~flag; + playerAvatar->movementFlag &= ~flag; } -static u32 PlayerAvatar_GetFlagUnk_00(PlayerAvatar *playerAvatar, u32 flag) +/** + * Gets the bitmap of the player avatar's movement flag and the given flag + * + * @return playerAvatar->movementFlag & flag + */ +static u32 PlayerAvatar_GetMovementFlag(PlayerAvatar *playerAvatar, u32 flag) { - return playerAvatar->unk_00 & flag; + return playerAvatar->movementFlag & flag; } -int PlayerAvatar_Speed(PlayerAvatar *playerAvatar) +/** + * Gets the movement speed of the player avatar + * + * @return playerAvatar->speed + */ +int PlayerAvatar_GetSpeed(PlayerAvatar *playerAvatar) { return playerAvatar->speed; } +/** + * Sets the movement speed of the player avatar + */ void PlayerAvatar_SetSpeed(PlayerAvatar *playerAvatar, int speed) { playerAvatar->speed = speed; } +/** + * Sets the movement speed of the player avatar to 0 + */ void PlayerAvatar_ClearSpeed(PlayerAvatar *playerAvatar) { playerAvatar->speed = 0; - sub_0205EF98(playerAvatar, 0); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); } +/** + * Adds dSpeed to the movement speed of the player avatar, capped out at maxSpeed + * + * @return playerAvatar->speed + */ int PlayerAvatar_AddMoveSpeed(PlayerAvatar *playerAvatar, int dSpeed, int maxSpeed) { playerAvatar->speed += dSpeed; @@ -361,85 +533,148 @@ int PlayerAvatar_AddMoveSpeed(PlayerAvatar *playerAvatar, int dSpeed, int maxSpe return playerAvatar->speed; } +/** + * Sets the horizontal facing direction of the player avatar + */ void PlayerAvatar_SetFaceLeftOrRight(PlayerAvatar *playerAvatar, enum FaceDirection leftOrRight) { playerAvatar->faceLeftOrRight = leftOrRight; } +/** + * Gets the horizontal facing direction of the player avatar + * + * @return playerAvatar->faceLeftOrRight + */ enum FaceDirection PlayerAvatar_GetFaceLeftOrRight(PlayerAvatar *playerAvatar) { return playerAvatar->faceLeftOrRight; } +/** + * Sets the vertical facing direction of the player avatar + * + */ void PlayerAvatar_SetFaceUpOrDown(PlayerAvatar *playerAvatar, enum FaceDirection faceUpOrDown) { playerAvatar->faceUpOrDown = faceUpOrDown; } +/** + * Gets the vertical facing direction of the player avatar + * + * @return playerAvatar->faceUpOrDown + */ enum FaceDirection PlayerAvatar_GetFaceUpOrDown(PlayerAvatar *playerAvatar) { return playerAvatar->faceUpOrDown; } +/** + * Sets the horizontal and vertical facing directions of the player avatar + */ void PlayerAvatar_SetFaceDirection(PlayerAvatar *playerAvatar, enum FaceDirection faceLeftOrRight, enum FaceDirection faceUpOrDown) { PlayerAvatar_SetFaceLeftOrRight(playerAvatar, faceLeftOrRight); PlayerAvatar_SetFaceUpOrDown(playerAvatar, faceUpOrDown); } +/** + * Sets the surf mount animation manager for the player avatar + */ void PlayerAvatar_SetSurfMountAnimManager(PlayerAvatar *playerAvatar, OverworldAnimManager *surfMountAnimMan) { playerAvatar->surfMountAnimMan = surfMountAnimMan; } +/** + * Gets the surf mount animation manager for the player avatar + * + * @return playerAvatar->surfMountAnimMan + */ OverworldAnimManager *PlayerAvatar_GetSurfMountAnimManager(PlayerAvatar *playerAvatar) { return playerAvatar->surfMountAnimMan; } +/** + * Sets the player data for the player avatar + */ static void PlayerAvatar_SetPlayerData(PlayerAvatar *playerAvatar, PlayerData *player) { playerAvatar->player = player; } +/** + * Gets the player data for the player avatar + * + * @return playerAvatar->player + */ PlayerData *PlayerAvatar_PlayerData(PlayerAvatar *playerAvatar) { return playerAvatar->player; } -void sub_0205EC10(PlayerAvatar *playerAvatar, u32 param1) +/** + * Sets the movement action for the player avatar, specified by enum MovementAction + */ +void PlayerAvatar_SetMovementAction(PlayerAvatar *playerAvatar, u32 movementAction) { - playerAvatar->unk_08 = param1; + playerAvatar->movementAction = movementAction; } -u32 sub_0205EC14(PlayerAvatar *playerAvatar) +/** + * Gets the movement action for the player avatar, specified by enum MovementAction + * + * @return playerAvatar->movementAction + */ +u32 PlayerAvatar_GetMovementAction(PlayerAvatar *playerAvatar) { - return playerAvatar->unk_08; + return playerAvatar->movementAction; } -void sub_0205EC18(PlayerAvatar *playerAvatar, int param1) +/** + * Sets player avatar's movement action speed as specified by enum PlayerMovementActionSpeed + */ +void PlayerAvatar_SetMovementActionSpeed(PlayerAvatar *playerAvatar, int movementActionSpeed) { - playerAvatar->unk_0C = param1; + playerAvatar->movementActionSpeed = movementActionSpeed; } -int sub_0205EC1C(PlayerAvatar *playerAvatar) +/** + * Sets player avatar's movement action speed as specified by enum PlayerMovementActionSpeed + * + * @return playerAvatar->movementActionSpeed + */ +int PlayerAvatar_GetMovementActionSpeed(PlayerAvatar *playerAvatar) { - return playerAvatar->unk_0C; + return playerAvatar->movementActionSpeed; } -void sub_0205EC20(PlayerAvatar *playerAvatar, u32 param1, int param2) +/** + * Sets the player avatar's movement action, specified by enum MovementAction, and movement action speed, specified by enum PlayerMovementActionSpeed + */ +void PlayerAvatar_SetMovementActionAndSpeed(PlayerAvatar *playerAvatar, u32 movementAction, int movementActionSpeed) { - sub_0205EC10(playerAvatar, param1); - sub_0205EC18(playerAvatar, param2); + PlayerAvatar_SetMovementAction(playerAvatar, movementAction); + PlayerAvatar_SetMovementActionSpeed(playerAvatar, movementActionSpeed); } +/** + * Zero-initializes playerData + */ void PlayerData_Init(PlayerData *playerData) { playerData->cyclingGear = 0; playerData->runningShoes = FALSE; - playerData->form = 0x0; + playerData->playerState = 0x0; } +/** + * Checks if the player has the running shoes flag + * + * @return playerData->runningShoes == TRUE + */ int PlayerData_HasRunningShoes(PlayerData *playerData) { if (playerData != NULL) { @@ -451,6 +686,9 @@ int PlayerData_HasRunningShoes(PlayerData *playerData) return FALSE; } +/** + * Sets the player's running shoes flag + */ void PlayerData_SetRunningShoes(PlayerData *playerData, BOOL flag) { if (flag == TRUE) { @@ -460,7 +698,12 @@ void PlayerData_SetRunningShoes(PlayerData *playerData, BOOL flag) } } -int PlayerData_CyclingGear(PlayerData *playerData) +/** + * Gets the gear that the bike is currently in + * + * @return playerData->cyclingGear + */ +int PlayerData_GetCyclingGear(PlayerData *playerData) { if (playerData == NULL) { return 0; @@ -469,6 +712,9 @@ int PlayerData_CyclingGear(PlayerData *playerData) return playerData->cyclingGear; } +/** + * Sets the gear the bike is currently in + */ void PlayerData_SetCyclingGear(PlayerData *playerData, int gear) { if (playerData != NULL) { @@ -476,61 +722,89 @@ void PlayerData_SetCyclingGear(PlayerData *playerData, int gear) } } +/** + * Sets the gear the bike is currently in + */ void PlayerAvatar_SetCyclingGear(PlayerAvatar *playerAvatar, int gear) { PlayerData *player = PlayerAvatar_PlayerData(playerAvatar); PlayerData_SetCyclingGear(player, gear); } -int PlayerAvatar_CyclingGear(PlayerAvatar *playerAvatar) +/** + * Gets the gear that the bike is currently in + * + * @return playerAvatar->playerData->cyclingGear + */ +int PlayerAvatar_GetCyclingGear(PlayerAvatar *playerAvatar) { PlayerData *player = PlayerAvatar_PlayerData(playerAvatar); - return PlayerData_CyclingGear(player); + return PlayerData_GetCyclingGear(player); } -u32 GetPlayerForm(PlayerData *player) +/** + * Gets the player's current state, as specified by enum PlayerAvatarState + * + * @return playerData->playerState + */ +u32 PlayerData_GetAvatarState(PlayerData *player) { if (player != NULL) { - return player->form; + return player->playerState; } - return 0x0; + return PLAYER_AVATAR_WALKING; } -void SetPlayerForm(PlayerData *player, u32 form) +/** + * Sets the player's avatar state, as specified by enum PlayerAvatarState + */ +void PlayerData_SetAvatarState(PlayerData *player, u32 playerState) { if (player != NULL) { - player->form = form; + player->playerState = playerState; } } -void SetAvatarForm(PlayerAvatar *playerAvatar, u32 form) +/** + * Sets the avatar state, as specified by enum PlayerAvatarState, of the internal playerData + */ +void PlayerAvatar_PlayerData_SetAvatarState(PlayerAvatar *playerAvatar, u32 playerState) { PlayerData *player = PlayerAvatar_PlayerData(playerAvatar); - SetPlayerForm(player, form); + PlayerData_SetAvatarState(player, playerState); } -void sub_0205ECB8(PlayerAvatar *playerAvatar, const VecFx32 *param1, int param2) +/** + * Sets the player avatar's map object's position and direction + */ +void PlayerAvatar_SetPosDirFromVec(PlayerAvatar *playerAvatar, const VecFx32 *pos, int dir) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); - MapObject_SetPosDirFromVec(mapObj, param1, param2); - sub_0205EB08(playerAvatar, 0); - sub_0205EB10(playerAvatar, 0); + MapObject_SetPosDirFromVec(mapObj, pos, dir); + PlayerAvatar_SetMoveState(playerAvatar, PLAYER_AVATAR_WALKING); + PlayerAvatar_SetPlayerMoveState(playerAvatar, PLAYER_MOVE_STATE_NONE); } -void sub_0205ECE0(PlayerAvatar *playerAvatar, int x, int z, int dir) +/** + * Sets the player avatar's map object's position and direction + */ +void PlayerAvatar_SetPosDirFromCoords(PlayerAvatar *playerAvatar, int x, int z, int dir) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); MapObject_SetPosDirFromCoords(mapObj, x, 0, z, dir); - sub_0205EB08(playerAvatar, 0); - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, PLAYER_AVATAR_WALKING); + PlayerAvatar_SetPlayerMoveState(playerAvatar, PLAYER_MOVE_STATE_NONE); } +/** + * Sets the player avatar's map object's height (y position) + */ void Player_SetYPos(PlayerAvatar *playerAvatar, fx32 y) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); VecFx32 pos; MapObject_GetPosPtr(mapObj, &pos); @@ -539,9 +813,12 @@ void Player_SetYPos(PlayerAvatar *playerAvatar, fx32 y) MapObject_SetPos(mapObj, &pos); } +/** + * Enables or disables the height calculation of the player avatar's map object + */ void PlayerAvatar_SetHeightCalculationEnabled(PlayerAvatar *playerAvatar, BOOL heightCalculationEnabled) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (heightCalculationEnabled == TRUE) { MapObject_SetHeightCalculationDisabled(mapObj, FALSE); @@ -550,9 +827,12 @@ void PlayerAvatar_SetHeightCalculationEnabled(PlayerAvatar *playerAvatar, BOOL h } } +/** + * Enables or disables the height calculation of the player avatar's map object. Recalculates the height if enabled. + */ void PlayerAvatar_SetHeightCalculationEnabledAndUpdate(PlayerAvatar *playerAvatar, BOOL heightCalculationEnabled) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (heightCalculationEnabled == TRUE) { MapObject_SetHeightCalculationDisabled(mapObj, FALSE); @@ -562,110 +842,121 @@ void PlayerAvatar_SetHeightCalculationEnabledAndUpdate(PlayerAvatar *playerAvata } } -int Player_MoveStateFromGender(int param0, int gender) +/** + * Gets the OBJ_EVENT_GFX_ constant associated with the given player state and gender + * + * @return OBJ_EVENT_GFX_ constant (default OBJ_EVENT_GFX_PLAYER_M) + */ +int Player_GetSpriteFromStateAndGender(int playerState, int gender) { + // TODO: Some OBJ_EVENT_GFX_ constants are being worked on by a different contributor, will need to add the missing constants once those get expanded if (gender == 0) { - switch (param0) { - case 0x0: - return 0x0; - case 0x1: - return 0x15; - case 0x2: - return 0xb2; - case 0x10: - return 0xb0; - case 0x11: - return 0xb4; - case 0x12: - return 0xba; - case 0x13: - return 0xbc; - case 0x14: - return 0xc4; - case 0x15: - return 0xc6; - case 0x16: - return 0xc8; - case 0x17: - return 0x100; - case 0x18: - return 0xd4; - case 0x19: - return 0x102; - case 0x1a: + switch (playerState) { + case PLAYER_AVATAR_WALKING: + return OBJ_EVENT_GFX_PLAYER_M; + case PLAYER_AVATAR_CYCLING: + return OBJ_EVENT_GFX_PLAYER_M_BIKE; + case PLAYER_AVATAR_SURFING: + return OBJ_EVENT_GFX_PLAYER_M_SURF; + case PLAYER_AVATAR_USE_FIELD_MOVE: + return OBJ_EVENT_GFX_PLAYER_M_HOLDING_POKE_BALL; + case PLAYER_AVATAR_SPRAYDUCK: + return OBJ_EVENT_GFX_PLAYER_M_SPRAYDUCK; + case PLAYER_AVATAR_CONTEST: + return OBJ_EVENT_GFX_PLAYER_M_CONTEST; + case PLAYER_AVATAR_FISHING: + return OBJ_EVENT_GFX_PLAYER_M_FISHING; + case PLAYER_AVATAR_POKETCH: + return OBJ_EVENT_GFX_PLAYER_M_POKETCH; + case PLAYER_AVATAR_SAVE: + return OBJ_EVENT_GFX_PLAYER_M_SAVE; + case PLAYER_AVATAR_HEAL: + return OBJ_EVENT_GFX_UNK_200; + case PLAYER_AVATAR_VS_SEEKER: + return OBJ_EVENT_GFX_PLAYER_M_VS_SEEKER; + case PLAYER_AVATAR_DISTORTION_WORLD: + return OBJ_EVENT_GFX_DIST_WORLD_PLAYER_M; + case PLAYER_AVATAR_DISTORTION_WORLD_SURF: + return OBJ_EVENT_GFX_DIST_WORLD_PLAYER_M_SURF; + case PLAYER_AVATAR_26: return 0x10c; - case 0x1b: + case PLAYER_AVATAR_27: return 0x10e; - case 0x1c: - return 0xd2; - case 0x1d: + case PLAYER_AVATAR_HEARTHOME_GYM: + return OBJ_EVENT_GFX_PLAYER_M_HEARTHOME_GYM; + case PLAYER_AVATAR_29: return 0x110; - case 0x1e: + case PLAYER_AVATAR_30: return 0x112; } } else { - switch (param0) { - case 0x0: - return 0x61; - case 0x1: - return 0x62; - case 0x2: - return 0xb3; - case 0x10: - return 0xb1; - case 0x11: - return 0xb5; - case 0x12: - return 0xbb; - case 0x13: - return 0xbd; - case 0x14: - return 0xc5; - case 0x15: - return 0xc7; - case 0x16: - return 0xc9; - case 0x17: - return 0x101; - case 0x18: - return 0x107; - case 0x19: - return 0x103; - case 0x1a: + switch (playerState) { + case PLAYER_AVATAR_WALKING: + return OBJ_EVENT_GFX_PLAYER_F; + case PLAYER_AVATAR_CYCLING: + return OBJ_EVENT_GFX_PLAYER_F_BIKE; + case PLAYER_AVATAR_SURFING: + return OBJ_EVENT_GFX_PLAYER_F_SURF; + case PLAYER_AVATAR_USE_FIELD_MOVE: + return OBJ_EVENT_GFX_PLAYER_F_HOLDING_POKE_BALL; + case PLAYER_AVATAR_SPRAYDUCK: + return OBJ_EVENT_GFX_PLAYER_F_SPRAYDUCK; + case PLAYER_AVATAR_CONTEST: + return OBJ_EVENT_GFX_PLAYER_F_CONTEST; + case PLAYER_AVATAR_FISHING: + return OBJ_EVENT_GFX_PLAYER_F_FISHING; + case PLAYER_AVATAR_POKETCH: + return OBJ_EVENT_GFX_PLAYER_F_POKETCH; + case PLAYER_AVATAR_SAVE: + return OBJ_EVENT_GFX_PLAYER_F_SAVE; + case PLAYER_AVATAR_HEAL: + return OBJ_EVENT_GFX_UNK_201; + case PLAYER_AVATAR_VS_SEEKER: + return OBJ_EVENT_GFX_PLAYER_F_VS_SEEKER; + case PLAYER_AVATAR_DISTORTION_WORLD: + return OBJ_EVENT_GFX_DIST_WORLD_PLAYER_F; + case PLAYER_AVATAR_DISTORTION_WORLD_SURF: + return OBJ_EVENT_GFX_DIST_WORLD_PLAYER_F_SURF; + case PLAYER_AVATAR_26: return 0x10d; - case 0x1b: + case PLAYER_AVATAR_27: return 0x10f; - case 0x1c: - return 0xd3; - case 0x1d: + case PLAYER_AVATAR_HEARTHOME_GYM: + return OBJ_EVENT_GFX_PLAYER_F_HEARTHOME_GYM; + case PLAYER_AVATAR_29: return 0x111; - case 0x1e: + case PLAYER_AVATAR_30: return 0x113; } } GF_ASSERT(FALSE); - return 0x0; + return OBJ_EVENT_GFX_PLAYER_M; } -u32 Player_ConvertStateToTransition(int param0) +/** + * Gets an enum PlayerTransitions associated with the enum PlayerAvatarState + * + * @return enum PlayerTransitions + */ +u32 Player_ConvertStateToTransition(int playerState) { - switch (param0) { - case PLAYER_STATE_WALKING: + switch (playerState) { + case PLAYER_AVATAR_WALKING: return PLAYER_TRANSITION_WALKING; - case PLAYER_STATE_CYCLING: + case PLAYER_AVATAR_CYCLING: return PLAYER_TRANSITION_CYCLING; - case PLAYER_STATE_SURFING: + case PLAYER_AVATAR_SURFING: return PLAYER_TRANSITION_SURFING; - case 0x11: + case PLAYER_AVATAR_SPRAYDUCK: return PLAYER_TRANSITION_WATER_BERRIES; - case 0x13: + case PLAYER_AVATAR_FISHING: return PLAYER_TRANSITION_FISHING; - case 0x14: + case PLAYER_AVATAR_POKETCH: return PLAYER_TRANSITION_POKETCH; - case 0x15: + case PLAYER_AVATAR_SAVE: return PLAYER_TRANSITION_SAVE; - case 0x16: + case PLAYER_AVATAR_HEAL: return PLAYER_TRANSITION_HEALING; } @@ -673,198 +964,276 @@ u32 Player_ConvertStateToTransition(int param0) return PLAYER_TRANSITION_WALKING; } +/** + * Gets the field system's playerAvatar, which is always the main player + * + * @return fieldSystem->playerAvatar + */ PlayerAvatar *FieldSystem_GetPlayerAvatar(FieldSystem *fieldSystem) { return fieldSystem->playerAvatar; } -void sub_0205EF40(PlayerAvatar *playerAvatar, int param1) +/** + * Sets the movement flag that forces a player's movement, taking away control + */ +void PlayerAvatar_SetForceMovement(PlayerAvatar *playerAvatar, int flag) { - if (param1 == TRUE) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_0); + if (flag == TRUE) { + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_FORCED); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_0); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_FORCED); } } -BOOL sub_0205EF58(PlayerAvatar *playerAvatar) +/** + * Checks if the player avatar is currently being forced to move without player input + * + * @return TRUE if the AVATAR_MOVE_FORCED flag is on + */ +BOOL PlayerAvatar_CheckForcedMovement(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_0)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_FORCED)) { return TRUE; } return FALSE; } -void sub_0205EF6C(PlayerAvatar *playerAvatar, int param1) +/** + * Sets the movement flag that causes a player to ignore tile behavior (such as slipping on ice), usually while their movement is forced + */ +void PlayerAvatar_SetIgnoreTileBehavior(PlayerAvatar *playerAvatar, int flag) { - if (param1 == 1) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_1); + if (flag == 1) { + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_IGNORE_TILE_BEHAVIOR); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_1); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_IGNORE_TILE_BEHAVIOR); } } -BOOL sub_0205EF84(PlayerAvatar *playerAvatar) +/** + * Checks the movement flag that causes a player to ignore tile behavior (such as slipping on ice), usually while their movement is forced + * + * @return TRUE if the AVATAR_MOVE_IGNORE_TILE_BEHAVIOR flag is on + */ +BOOL PlayerAvatar_CheckIgnoreTileBehavior(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_1)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_IGNORE_TILE_BEHAVIOR)) { return TRUE; } return FALSE; } -void sub_0205EF98(PlayerAvatar *playerAvatar, int param1) +/** + * Sets the movement flag that causes a player to start their bike breaks, slowing their movement to a stop + */ +void PlayerAvatar_SetBikeBrake(PlayerAvatar *playerAvatar, int flag) { - if (param1 == 1) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_2); + if (flag == 1) { + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_BIKE_BRAKE); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_2); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_BIKE_BRAKE); } } -BOOL sub_0205EFB0(PlayerAvatar *playerAvatar) +/** + * Checks if the player is currently breaking on their bike + * + * @return TRUE if the AVATAR_MOVE_BIKE_BRAKE flag is on + */ +BOOL PlayerAvatar_CheckBikeBrake(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_2)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_BIKE_BRAKE)) { return TRUE; } return FALSE; } +/** + * Sets the movement flag that forces a player downward while on cycling road + */ void PlayerAvatar_SetOnCyclingRoad(PlayerAvatar *playerAvatar, BOOL flag) { if (flag == TRUE) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_ON_CYCLING_ROAD); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_ON_CYCLING_ROAD); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_ON_CYCLING_ROAD); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_ON_CYCLING_ROAD); } } +/** + * Checks the movement flag that forces a player downward while on cycling road + * + * @return TRUE if the AVATAR_MOVE_ON_CYCLING_ROAD flag is on + */ BOOL PlayerAvatar_IsOnCyclingRoad(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_ON_CYCLING_ROAD)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_ON_CYCLING_ROAD)) { return TRUE; } return FALSE; } +/** + * Sets the movement flag that causes a player to escape out of deep mud + */ void PlayerAvatar_SetEscapedFromDeepMud(PlayerAvatar *playerAvatar, BOOL flag) { if (flag == TRUE) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_ESCAPED_FROM_DEEP_MUD); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_ESCAPED_FROM_DEEP_MUD); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_ESCAPED_FROM_DEEP_MUD); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_ESCAPED_FROM_DEEP_MUD); } } +/** + * Checks if the player has escaped from deep mud + * + * @return TRUE if the AVATAR_MOVE_ESCAPED_FROM_DEEP_MUD flag is on + */ BOOL PlayerAvatar_CheckEscapedFromDeepMud(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_ESCAPED_FROM_DEEP_MUD)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_ESCAPED_FROM_DEEP_MUD)) { return TRUE; } return FALSE; } -void sub_0205F01C(PlayerAvatar *playerAvatar, BOOL flag) +/** + * Sets the movement flag that indicates a player is moving through mud + */ +void PlayerAvatar_SetMoveThroughMudFlag(PlayerAvatar *playerAvatar, BOOL flag) { if (flag == TRUE) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_5); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_MOVE_THROUGH_MUD); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_5); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_MOVE_THROUGH_MUD); } } -BOOL sub_0205F034(PlayerAvatar *playerAvatar) +/** + * Checks the movement flag that indicates a player is moving through mud + * + * @return TRUE if the AVATAR_MOVE_MOVE_THROUGH_MUD flag is on + */ +BOOL PlayerAvatar_CheckMoveThroughMudFlag(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_5)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_MOVE_THROUGH_MUD)) { return TRUE; } return FALSE; } -void sub_0205F048(PlayerAvatar *playerAvatar) +/** + * Sets the movement flag that indicates the player is currently taking a single step + */ +void PlayerAvatar_StartStep(PlayerAvatar *playerAvatar) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_6); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_STEP); } -void sub_0205F054(PlayerAvatar *playerAvatar) +/** + * Sets the movement flag that indicates the player has finished taking a single step + */ +void PlayerAvatar_EndStep(PlayerAvatar *playerAvatar) { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_6); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_STEP); } -BOOL sub_0205F060(PlayerAvatar *playerAvatar) +/** + * Checks if the player is currently taking a step + * + * @return TRUE if the AVATAR_MOVE_STEP is on + */ +BOOL PlayerAvatar_CheckStep(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_6)) { + if (PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_STEP)) { return TRUE; } return FALSE; } -void sub_0205F074(PlayerAvatar *playerAvatar, BOOL flag) +/** + * Sets the movement flag that forces a player's movement while retaining their current speed, taking away control + */ +void PlayerAvatar_SetForceMovementRetainSpeed(PlayerAvatar *playerAvatar, BOOL flag) { if (flag == TRUE) { - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_7); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_FORCED_RETAIN_SPEED); } else { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_7); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_FORCED_RETAIN_SPEED); } } -int sub_0205F08C(PlayerAvatar *playerAvatar) +/** + * Checks if the player avatar is currently being forced to move while retaining their initial speed without player input + * + * @return TRUE if the AVATAR_MOVE_FORCED flag is on + */ +int PlayerAvatar_CheckForcedMovementRetainSpeed(PlayerAvatar *playerAvatar) { - return PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_7); + return PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_FORCED_RETAIN_SPEED); } +/** + * Sets the player avatar's distortion movement flags based on the given enum AvatarDistortionState + */ void PlayerAvatar_SetDistortionState(PlayerAvatar *playerAvatar, enum AvatarDistortionState state) { - PlayerAvatar_ClearFlagUnk_00(playerAvatar, UNK_00_8 | UNK_00_9 | UNK_00_10 | UNK_00_11 | UNK_00_12); + PlayerAvatar_ClearMovementFlag(playerAvatar, AVATAR_MOVE_DISTORTION_ACTIVE | AVATAR_MOVE_DISTORTION_FLOOR | AVATAR_MOVE_DISTORTION_WEST_WALL | AVATAR_MOVE_DISTORTION_EAST_WALL | AVATAR_MOVE_DISTORTION_CEILING); switch (state) { case AVATAR_DISTORTION_STATE_NONE: return; case AVATAR_DISTORTION_STATE_ACTIVE: - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_8); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_DISTORTION_ACTIVE); return; case AVATAR_DISTORTION_STATE_FLOOR: - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_9); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_DISTORTION_FLOOR); return; case AVATAR_DISTORTION_STATE_WEST_WALL: - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_10); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_DISTORTION_WEST_WALL); return; case AVATAR_DISTORTION_STATE_EAST_WALL: - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_11); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_DISTORTION_EAST_WALL); return; case AVATAR_DISTORTION_STATE_CEILING: - PlayerAvatar_SetFlagUnk_00(playerAvatar, UNK_00_12); + PlayerAvatar_TurnOnMovementFlagBits(playerAvatar, AVATAR_MOVE_DISTORTION_CEILING); return; } GF_ASSERT(FALSE); } +/** + * Gets the player avatar's enum AvatarDistortionState based on the set distortion state movement flags + */ enum AvatarDistortionState PlayerAvatar_MapDistortionState(PlayerAvatar *const playerAvatar) { enum AvatarDistortionState state = AVATAR_DISTORTION_STATE_NONE; - u32 v1 = PlayerAvatar_GetFlagUnk_00(playerAvatar, UNK_00_8 | UNK_00_9 | UNK_00_10 | UNK_00_11 | UNK_00_12); + u32 movementFlag = PlayerAvatar_GetMovementFlag(playerAvatar, AVATAR_MOVE_DISTORTION_ACTIVE | AVATAR_MOVE_DISTORTION_FLOOR | AVATAR_MOVE_DISTORTION_WEST_WALL | AVATAR_MOVE_DISTORTION_EAST_WALL | AVATAR_MOVE_DISTORTION_CEILING); - switch (v1) { - case UNK_00_8: + switch (movementFlag) { + case AVATAR_MOVE_DISTORTION_ACTIVE: state = AVATAR_DISTORTION_STATE_ACTIVE; break; - case UNK_00_9: + case AVATAR_MOVE_DISTORTION_FLOOR: state = AVATAR_DISTORTION_STATE_FLOOR; break; - case UNK_00_10: + case AVATAR_MOVE_DISTORTION_WEST_WALL: state = AVATAR_DISTORTION_STATE_WEST_WALL; break; - case UNK_00_11: + case AVATAR_MOVE_DISTORTION_EAST_WALL: state = AVATAR_DISTORTION_STATE_EAST_WALL; break; - case UNK_00_12: + case AVATAR_MOVE_DISTORTION_CEILING: state = AVATAR_DISTORTION_STATE_CEILING; break; } @@ -872,7 +1241,11 @@ enum AvatarDistortionState PlayerAvatar_MapDistortionState(PlayerAvatar *const p return state; } -// this function can be simplified, but preserving matching reduces clarity +/** + * Checks if the current gravity in the distortion world has changed to require a differnt movement script than normal field movement functions would allow for + * + * @return TRUE if the current distortion state is anything except AVATAR_DISTORTION_STATE_NONE or AVATAR_DISTORTION_STATE_ACTIVE + */ BOOL PlayerAvatar_DistortionGravityChanged(PlayerAvatar *const playerAvatar) { enum AvatarDistortionState state = PlayerAvatar_MapDistortionState(playerAvatar); @@ -884,6 +1257,11 @@ BOOL PlayerAvatar_DistortionGravityChanged(PlayerAvatar *const playerAvatar) return TRUE; } +/** + * Checks if the current gravity in the distortion world is on the floor + * + * @return TRUE if the current distortion state is AVATAR_DISTORTION_STATE_NONE, AVATAR_DISTORTION_STATE_ACTIVE, or AVATAR_DISTORTION_STATE_FLOOR + */ BOOL PlayerAvatar_DistortionStateOnFloor(PlayerAvatar *const playerAvatar) { enum AvatarDistortionState state = PlayerAvatar_MapDistortionState(playerAvatar); diff --git a/src/pokeradar.c b/src/pokeradar.c index aaee0397fc..3f23eb7656 100644 --- a/src/pokeradar.c +++ b/src/pokeradar.c @@ -102,7 +102,7 @@ BOOL RadarSpawnPatches(FieldSystem *fieldSystem, const int param1, const int par 8 }; - const VecFx32 *v8 = PlayerAvatar_PosVector(fieldSystem->playerAvatar); + const VecFx32 *v8 = PlayerAvatar_GetPos(fieldSystem->playerAvatar); v7 = 0; for (u8 patchRing = 0; patchRing < NUM_GRASS_PATCHES; patchRing++) { @@ -430,8 +430,8 @@ BOOL RefreshRadarChain(FieldTask *taskMan) *v1 = 4; } else { *v2 = 0; - int v3 = Player_GetXPos(fieldSystem->playerAvatar); - int v4 = Player_GetZPos(fieldSystem->playerAvatar); + int v3 = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int v4 = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); RadarSpawnPatches(fieldSystem, v3, v4, fieldSystem->chain); if (fieldSystem->chain->active) { SetupGrassPatches(fieldSystem, 0x1, fieldSystem->chain); diff --git a/src/unk_0202F180.c b/src/save_catchrecords.c similarity index 90% rename from src/unk_0202F180.c rename to src/save_catchrecords.c index 4a9a61e2cd..aad62b0321 100644 --- a/src/unk_0202F180.c +++ b/src/save_catchrecords.c @@ -1,7 +1,4 @@ -#include "unk_0202F180.h" - -#include -#include +#include "save_catchrecords.h" #include "game_records.h" #include "pokedex.h" diff --git a/src/savedata/save_table.c b/src/savedata/save_table.c index e7d957d11d..5c753736ac 100644 --- a/src/savedata/save_table.c +++ b/src/savedata/save_table.c @@ -9,6 +9,7 @@ #include "battle_regulation.h" #include "chatot_cry.h" #include "daycare_save.h" +#include "easy_chat_words.h" #include "field_overworld_state.h" #include "game_records.h" #include "global_trade.h" @@ -33,7 +34,6 @@ #include "system_data.h" #include "trainer_case_save_data.h" #include "underground.h" -#include "unk_02014D38.h" #include "unk_020298BC.h" #include "unk_0202C9F4.h" #include "unk_0202D778.h" @@ -80,7 +80,7 @@ const SaveTableEntry gSaveTable[] = { { SAVE_TABLE_ENTRY_MYSTERY_GIFT, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)MysteryGift_SaveSize, (SaveEntryInitFunc)MysteryGift_Init }, { SAVE_TABLE_ENTRY_PAL_PARK_TRANSFER, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)MigratedPokemon_SaveSize, (SaveEntryInitFunc)PalParkTransfer_Init }, { SAVE_TABLE_ENTRY_LINK_CONTEST_RECORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)LinkContestRecords_SaveSize, (SaveEntryInitFunc)LinkContestRecords_Init }, - { SAVE_TABLE_ENTRY_SENTENCE, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Sentence_SaveSize, (SaveEntryInitFunc)SentenceSaveData_Init }, + { SAVE_TABLE_ENTRY_UNLOCKED_EASY_CHAT_WORDS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)UnlockedEasyChatWords_SaveSize, (SaveEntryInitFunc)UnlockedEasyChatWords_Init }, { SAVE_TABLE_ENTRY_EMAIL, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)Email_SaveSize, (SaveEntryInitFunc)Email_Init }, { SAVE_TABLE_ENTRY_WIFI_QUESTIONS, SAVE_BLOCK_ID_NORMAL, (SaveEntrySizeFunc)WiFiQuestion_SaveSize, (SaveEntryInitFunc)WiFiQuestion_Init }, { SAVE_TABLE_ENTRY_PC_BOXES, SAVE_BLOCK_ID_BOXES, (SaveEntrySizeFunc)PCBoxes_SaveSize, (SaveEntryInitFunc)PCBoxes_Init }, diff --git a/src/savedata_misc.c b/src/savedata_misc.c index 66b98dc195..841bba5b9f 100644 --- a/src/savedata_misc.c +++ b/src/savedata_misc.c @@ -4,13 +4,15 @@ #include #include "constants/charcode.h" - -#include "struct_defs/sentence.h" +#include "generated/text_banks.h" #include "berry_patches.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "persisted_map_features.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" + +#include "res/text/bank/greetings.h" +#include "res/text/bank/union_room_sentences.h" int MiscSaveBlock_SaveSize(void) { @@ -27,11 +29,11 @@ void MiscSaveBlock_Init(MiscSaveBlock *miscSave) MI_CpuFill16(miscSave->rivalName, CHAR_EOS, TRAINER_NAME_LEN + 1); MI_CpuFill16(miscSave->tabletName, CHAR_EOS, TABLET_NAME_LEN + 1); - Sentence_InitWithType(&miscSave->introMsg, 4); + EasyChatSentence_InitWithType(&miscSave->introMsg, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); - miscSave->introMsg.id = 0; - miscSave->introMsg.words[0] = sub_02014DFC(441, 99); - miscSave->introMsg.words[1] = 0xffff; + miscSave->introMsg.id = UnionRoomSentences_Text_BlankHello; + miscSave->introMsg.words[0] = EasyChatWord_FromBankAndEntry(TEXT_BANK_GREETINGS, Greetings_Text_Regards); + miscSave->introMsg.words[1] = WORD_NONE; for (int i = 0; i < EXTRA_SAVE_TABLE_ENTRY_MAX - 1; i++) { miscSave->extraKey.keys[i] = EXTRA_SAVE_TABLE_ENTRY_NONE; @@ -105,12 +107,12 @@ void MiscSaveBlock_GetFavoriteMon(const MiscSaveBlock *miscSave, int *species, i *isEgg = miscSave->favoriteMonIsEgg; } -void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, Sentence *message) +void MiscSaveBlock_IntroMsg(const MiscSaveBlock *miscSave, EasyChatSentence *message) { *message = miscSave->introMsg; } -void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const Sentence *message) +void MiscSaveBlock_SetIntroMsg(MiscSaveBlock *miscSave, const EasyChatSentence *message) { miscSave->introMsg = *message; } diff --git a/src/scrcmd.c b/src/scrcmd.c index f37b358116..8862eaa7a7 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -27,7 +27,6 @@ #include "struct_decls/map_object.h" #include "struct_decls/map_object_manager.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205C22C_decl.h" #include "struct_decls/tv_broadcast.h" #include "struct_defs/battle_tower.h" @@ -80,10 +79,10 @@ #include "overlay006/pc_animation.h" #include "overlay006/swarm.h" #include "overlay006/trophy_garden_daily_encounters.h" +#include "overlay007/battle_regulation_menu.h" #include "overlay007/communication_club.h" -#include "overlay007/ov7_0224B4E8.h" #include "overlay007/shop_menu.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "overlay009/ov9_02249960.h" #include "overlay090/struct_ov90_021D0D80.h" #include "overlay098/struct_ov98_02247168.h" @@ -102,6 +101,7 @@ #include "comm_player_manager.h" #include "communication_system.h" #include "daycare_save.h" +#include "easy_chat_words.h" #include "encounter.h" #include "field_bgm.h" #include "field_comm_manager.h" @@ -189,7 +189,6 @@ #include "trainer_info.h" #include "tv_segment.h" #include "underground.h" -#include "unk_02014D38.h" #include "unk_020298BC.h" #include "unk_0202C9F4.h" #include "unk_02033200.h" @@ -223,6 +222,7 @@ #include "constdata/const_020F8BE0.h" #include "res/text/bank/mystery_gift_phrase.h" +#include "res/text/bank/tough_words.h" typedef struct { SysTask *unk_00; @@ -368,7 +368,7 @@ static BOOL ScrCmd_GetCurNetID(ScriptContext *ctx); static BOOL ScrCmd_DrawPokemonPreview(ScriptContext *ctx); static void FieldSystem_WriteSpeciesSeen(FieldSystem *fieldSystem, u16 param1); static BOOL ScrCmd_RemovePokemonPreview(ScriptContext *ctx); -static BOOL ScrCmd_20A(ScriptContext *ctx); +static BOOL ScrCmd_StartVsSeeker(ScriptContext *ctx); static BOOL ScrCmd_SetMoveCodeForFacingDirection(ScriptContext *ctx); static BOOL ScrCmd_0A5(ScriptContext *ctx); static BOOL ScrCmd_30E(ScriptContext *ctx); @@ -408,8 +408,8 @@ static BOOL ScrCmd_UseWaterfall(ScriptContext *ctx); static BOOL ScrCmd_UseFly(ScriptContext *ctx); static BOOL ScrCmd_0C3(ScriptContext *ctx); static BOOL ScrCmd_0C4(ScriptContext *ctx); -static BOOL ScrCmd_0C5(ScriptContext *ctx); -static BOOL sub_02042C80(ScriptContext *ctx); +static BOOL ScrCmd_PlayHMCutIn(ScriptContext *ctx); +static BOOL ScriptContext_WaitForHMCutInFinished(ScriptContext *ctx); static BOOL ScrCmd_ChangeIntoContestAttire(ScriptContext *ctx); static BOOL ScrCmd_CheckPlayerOnBike(ScriptContext *ctx); static BOOL ScrCmd_SetPlayerBike(ScriptContext *ctx); @@ -582,7 +582,7 @@ static BOOL ScrCmd_Dummy1F9(ScriptContext *ctx); static BOOL ScrCmd_GetPreviousMapID(ScriptContext *ctx); static BOOL ScrCmd_GetCurrentMapID(ScriptContext *ctx); static BOOL ScrCmd_StartEndSafariGame(ScriptContext *ctx); -static BOOL ScrCmd_203(ScriptContext *ctx); +static BOOL ScrCmd_WarpToColosseum(ScriptContext *ctx); static BOOL ScrCmd_204(ScriptContext *ctx); static BOOL ScrCmd_205(ScriptContext *ctx); static BOOL ScrCmd_StartLibraryTV(ScriptContext *ctx); @@ -610,7 +610,7 @@ static BOOL ScrCmd_TurnOnPokedexFormDetection(ScriptContext *ctx); static BOOL ScrCmd_GetSetNationalDexEnabled(ScriptContext *ctx); static BOOL ScrCmd_GetPartyMonEVTotal(ScriptContext *ctx); static BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx); -static BOOL ScrCmd_239(ScriptContext *ctx); +static BOOL ScrCmd_OpenBattleRegulationMenu(ScriptContext *ctx); static BOOL ScrCmd_GetPartyMonFootprintType(ScriptContext *ctx); static BOOL ScrCmd_PlayPokecenterHealingAnimation(ScriptContext *ctx); static BOOL ScrCmd_PlayElevatorAnimation(ScriptContext *ctx); @@ -653,9 +653,9 @@ static BOOL ScrCmd_GetDailyRandomLevel(ScriptContext *ctx); static BOOL ScrCmd_RemoveAccessory(ScriptContext *ctx); static BOOL ScrCmd_UseVistaLighthouseBinoculars(ScriptContext *ctx); static BOOL ScrCmd_InitDailyRandomLevel(ScriptContext *ctx); -static BOOL ScrCmd_27D(ScriptContext *ctx); +static BOOL ScrCmd_TryBufferAndUnlockRandomToughWord(ScriptContext *ctx); static BOOL ScrCmd_CheckIsDepartmentStoreRegular(ScriptContext *ctx); -static BOOL ScrCmd_27F(ScriptContext *ctx); +static BOOL ScrCmd_CheckAllToughWordsUnlocked(ScriptContext *ctx); static BOOL ScrCmd_CheckIsTodayPlayerBirthday(ScriptContext *ctx); static BOOL ScrCmd_GetUnownFormsSeenCount(ScriptContext *ctx); static BOOL ScrCmd_InitTurnbackCave(ScriptContext *ctx); @@ -674,13 +674,13 @@ static BOOL ScrCmd_GetLeagueVictories(ScriptContext *ctx); static BOOL ScrCmd_CheckShouldShowGhost(ScriptContext *ctx); static BOOL ScrCmd_OpenPartyMenuForDaycare(ScriptContext *ctx); static BOOL ScrCmd_GetDayCarePartyMenuResult(ScriptContext *ctx); -static BOOL ScrCmd_29E(ScriptContext *ctx); +static BOOL ScrCmd_StartDestroyObstacleAnimation(ScriptContext *ctx); static BOOL ScrCmd_GetUndergroundTalkCounter(ScriptContext *ctx); static BOOL ScrCmd_29F(ScriptContext *ctx); static BOOL ScrCmd_Unused_2A1(ScriptContext *ctx); static BOOL ScrCmd_TrySetUnusedCollectedOrbFlag(ScriptContext *ctx); -static BOOL ScrCmd_2A3(ScriptContext *ctx); -static BOOL ScrCmd_2A4(ScriptContext *ctx); +static BOOL ScrCmd_CheckHasWiFiListValidLogin(ScriptContext *ctx); +static BOOL ScrCmd_GetWiFListValidFriendsCount(ScriptContext *ctx); static BOOL ScrCmd_CheckItemIsPlate(ScriptContext *ctx); static BOOL ScrCmd_CheckIsMysteryGiftPhrase(ScriptContext *ctx); static BOOL ScrCmd_CountUniqueSealsInSealCase(ScriptContext *ctx); @@ -733,7 +733,7 @@ static BOOL ScrCmd_SetSpeciesSeen(ScriptContext *ctx); static BOOL ScrCmd_DoDWWarp(ScriptContext *ctx); static BOOL ScrCmd_StartDistortionWorldGiratinaShadowEvent(ScriptContext *ctx); static BOOL ScrCmd_FinishDistortionWorldGiratinaShadowEvent(ScriptContext *ctx); -static BOOL ScrCmd_323(ScriptContext *ctx); +static BOOL ScrCmd_CheckNoWiFiPlazaCooldown(ScriptContext *ctx); static BOOL ScrCmd_SetPartyGiratinaForm(ScriptContext *ctx); static BOOL ScrCmd_CheckPartyHasFatefulEncounterRegigigas(ScriptContext *ctx); static BOOL ScriptContext_WaitForMovement(ScriptContext *ctx); @@ -1254,14 +1254,14 @@ static BOOL ScrCmd_PrintBattleTowerIntroMessage(ScriptContext *ctx) return FALSE; } - u16 *v0 = battleTower->opponentsDataDTO[opponentID].trDataDTO.unk_18; + u16 *introMsg = battleTower->opponentsDataDTO[opponentID].trDataDTO.introMsg; - if (v0[0] == 0xFFFF) { + if (introMsg[0] == 0xFFFF) { MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0613, HEAP_ID_FIELD3); - ScriptMessage_Show(ctx, msgLoader, v0[1], TRUE, NULL); + ScriptMessage_Show(ctx, msgLoader, introMsg[1], TRUE, NULL); MessageLoader_Free(msgLoader); } else { - ScriptMessage_ShowSentence(ctx, v0[0], v0[1], v0[2], v0[3], 1); + ScriptMessage_ShowSentence(ctx, introMsg[0], introMsg[1], introMsg[2], introMsg[3], 1); } ScriptContext_Pause(ctx, ScriptContext_WaitForFinishedPrinting); @@ -1428,13 +1428,13 @@ static BOOL ScriptContext_CheckABXPadPress(ScriptContext *ctx) } if (gSystem.pressedKeys & PAD_KEY_UP) { - Player_SetDir(ctx->fieldSystem->playerAvatar, DIR_NORTH); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, DIR_NORTH); } else if (gSystem.pressedKeys & PAD_KEY_DOWN) { - Player_SetDir(ctx->fieldSystem->playerAvatar, DIR_SOUTH); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, DIR_SOUTH); } else if (gSystem.pressedKeys & PAD_KEY_LEFT) { - Player_SetDir(ctx->fieldSystem->playerAvatar, DIR_WEST); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, DIR_WEST); } else if (gSystem.pressedKeys & PAD_KEY_RIGHT) { - Player_SetDir(ctx->fieldSystem->playerAvatar, DIR_EAST); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, DIR_EAST); } else if (gSystem.pressedKeys & PAD_BUTTON_X) { FieldSystem_ShowStartMenu(ctx->fieldSystem); } else { @@ -1680,7 +1680,7 @@ static BOOL WaitScrollingSignpostInput(ScriptContext *ctx) if (dir != 0xffff) { Text_RemovePrinter(*printerID); - Player_SetDir(ctx->fieldSystem->playerAvatar, dir); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, dir); *destVar = 0; return TRUE; } @@ -1726,7 +1726,7 @@ static BOOL HandleSignpostInput(ScriptContext *ctx) } if (dir != 0xffff) { - Player_SetDir(ctx->fieldSystem->playerAvatar, dir); + PlayerAvatar_TryFace(ctx->fieldSystem->playerAvatar, dir); *destVar = 0; return TRUE; } @@ -2223,7 +2223,7 @@ static BOOL sub_02041004(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; MapObject **v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); - MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (inline_020410F4_1(1 << 0) && (LocalMapObj_CheckAnimationFinished(v2) == 1)) { MapObject_SetPauseMovementOn(v2); @@ -2277,7 +2277,7 @@ static BOOL ScrCmd_LockLastTalked(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; MapObject **v1 = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); - MapObject *player = Player_MapObject(fieldSystem->playerAvatar); + MapObject *player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject *v3 = MapObjMan_GetLocalMapObjByMovementType(fieldSystem->mapObjMan, MOVEMENT_TYPE_FOLLOW_PLAYER); MapObject *v4 = sub_02069EB8(*v1); MapObjectManager *mapObjMan = fieldSystem->mapObjMan; @@ -2434,7 +2434,7 @@ static BOOL ScrCmd_FacePlayer(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; PlayerAvatar *playerAvatar = fieldSystem->playerAvatar; - int dir = Direction_GetOpposite(PlayerAvatar_GetDir(playerAvatar)); + int dir = Direction_GetOpposite(PlayerAvatar_GetFacingDir(playerAvatar)); MapObject **object = FieldSystem_GetScriptMemberPtr(fieldSystem, SCRIPT_MANAGER_TARGET_OBJECT); if (*object == NULL) { @@ -2453,8 +2453,8 @@ static BOOL ScrCmd_GetPlayerMapPos(ScriptContext *ctx) u16 *destVarX = ScriptContext_GetVarPointer(ctx); u16 *destVarZ = ScriptContext_GetVarPointer(ctx); - *destVarX = Player_GetXPos(fieldSystem->playerAvatar); - *destVarZ = Player_GetZPos(fieldSystem->playerAvatar); + *destVarX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + *destVarZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); return FALSE; } @@ -2475,7 +2475,7 @@ static BOOL ScrCmd_Unused_06A(ScriptContext *ctx) static BOOL ScrCmd_GetPlayerDir(ScriptContext *ctx) { u16 *destVar = ScriptContext_GetVarPointer(ctx); - *destVar = PlayerAvatar_GetDir(ctx->fieldSystem->playerAvatar); + *destVar = PlayerAvatar_GetFacingDir(ctx->fieldSystem->playerAvatar); return FALSE; } @@ -2493,7 +2493,7 @@ static BOOL ScrCmd_MoveCamera(ScriptContext *ctx) pos.y = FX32_CONST(y); pos.z = FX32_CONST(z); - MapObject_SetSpritePosOffset(Player_MapObject(ctx->fieldSystem->playerAvatar), &pos); + MapObject_SetSpritePosOffset(PlayerAvatar_GetMapObject(ctx->fieldSystem->playerAvatar), &pos); Camera_Move(&pos, ctx->fieldSystem->camera); return FALSE; @@ -3069,12 +3069,12 @@ static BOOL ScriptContext_WaitForPreviewAnimFinished(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_20A(ScriptContext *ctx) +static BOOL ScrCmd_StartVsSeeker(ScriptContext *ctx) { - u16 v0 = ScriptContext_ReadHalfWord(ctx); - StringTemplate **v1 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); + u16 destVar = ScriptContext_ReadHalfWord(ctx); + StringTemplate **strTemplate = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); - VsSeeker_Start(ctx->task, *v1, FieldSystem_GetVarPointer(ctx->fieldSystem, v0)); + VsSeeker_Start(ctx->task, *strTemplate, FieldSystem_GetVarPointer(ctx->fieldSystem, destVar)); return TRUE; } @@ -3535,7 +3535,7 @@ static BOOL ScrCmd_BufferCustomMessageWord(ScriptContext *ctx) u16 idx = ScriptContext_GetVar(ctx); u16 customMessageWord = ScriptContext_GetVar(ctx); - StringTemplate_SetCustomMessageWord(*strTemplate, idx, customMessageWord); + StringTemplate_SetEasyChatWord(*strTemplate, idx, customMessageWord); return FALSE; } @@ -3577,18 +3577,18 @@ static BOOL ScrCmd_Warp(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_203(ScriptContext *ctx) +static BOOL ScrCmd_WarpToColosseum(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 v0 = ScriptContext_ReadHalfWord(ctx); - s16 v4 = ScriptContext_ReadHalfWord(ctx); - u16 v1 = ScriptContext_GetVar(ctx); - u16 v2 = ScriptContext_GetVar(ctx); - u16 v3 = ScriptContext_ReadHalfWord(ctx); - v4 = -1; + u16 mapID = ScriptContext_ReadHalfWord(ctx); + s16 warpID = ScriptContext_ReadHalfWord(ctx); + u16 x = ScriptContext_GetVar(ctx); + u16 z = ScriptContext_GetVar(ctx); + u16 dir = ScriptContext_ReadHalfWord(ctx); + warpID = -1; - FieldTask_StartChangeMapColosseum(ctx->fieldSystem->task, v0, v4, v1, v2, v3); + FieldTask_StartChangeMapColosseum(ctx->fieldSystem->task, mapID, warpID, x, z, dir); return TRUE; } @@ -3619,7 +3619,7 @@ static BOOL ScrCmd_GetCurrentMapID(ScriptContext *ctx) static BOOL ScrCmd_UseRockClimb(ScriptContext *ctx) { - FieldTask_StartUseRockClimb(ctx->task, PlayerAvatar_GetDir(ctx->fieldSystem->playerAvatar), ScriptContext_GetVar(ctx)); + FieldTask_StartUseRockClimb(ctx->task, PlayerAvatar_GetFacingDir(ctx->fieldSystem->playerAvatar), ScriptContext_GetVar(ctx)); return TRUE; } @@ -3630,9 +3630,9 @@ static BOOL ScrCmd_UseSurf(ScriptContext *ctx) RadarChain_Clear(ctx->fieldSystem->chain); if (PlayerAvatar_DistortionStateOnFloor(ctx->fieldSystem->playerAvatar) == TRUE) { - direction = PlayerAvatar_GetDir(ctx->fieldSystem->playerAvatar); + direction = PlayerAvatar_GetFacingDir(ctx->fieldSystem->playerAvatar); } else { - direction = PlayerAvatar_GetMoveDir(ctx->fieldSystem->playerAvatar); + direction = PlayerAvatar_GetMovingDir(ctx->fieldSystem->playerAvatar); } FieldTask_StartUseSurf(ctx->task, direction, ScriptContext_GetVar(ctx)); @@ -3642,7 +3642,7 @@ static BOOL ScrCmd_UseSurf(ScriptContext *ctx) static BOOL ScrCmd_UseWaterfall(ScriptContext *ctx) { - FieldTask_StartUseWaterfall(ctx->task, PlayerAvatar_GetDir(ctx->fieldSystem->playerAvatar), ScriptContext_GetVar(ctx)); + FieldTask_StartUseWaterfall(ctx->task, PlayerAvatar_GetFacingDir(ctx->fieldSystem->playerAvatar), ScriptContext_GetVar(ctx)); return TRUE; } @@ -3676,24 +3676,24 @@ static BOOL ScrCmd_0C4(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_0C5(ScriptContext *ctx) +static BOOL ScrCmd_PlayHMCutIn(ScriptContext *ctx) { - void **v1 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_DATA_PTR); - u16 v2 = ScriptContext_GetVar(ctx); + void **dataPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_DATA_PTR); + u16 slot = ScriptContext_GetVar(ctx); - Pokemon *v0 = Party_GetPokemonBySlotIndex(SaveData_GetParty(ctx->fieldSystem->saveData), v2); - *v1 = HMCutIn_StartTask(ctx->fieldSystem, 0, v0, PlayerAvatar_Gender(ctx->fieldSystem->playerAvatar)); + Pokemon *mon = Party_GetPokemonBySlotIndex(SaveData_GetParty(ctx->fieldSystem->saveData), slot); + *dataPtr = HMCutIn_StartTask(ctx->fieldSystem, FALSE, mon, PlayerAvatar_GetGender(ctx->fieldSystem->playerAvatar)); - ScriptContext_Pause(ctx, sub_02042C80); + ScriptContext_Pause(ctx, ScriptContext_WaitForHMCutInFinished); return TRUE; } -static BOOL sub_02042C80(ScriptContext *ctx) +static BOOL ScriptContext_WaitForHMCutInFinished(ScriptContext *ctx) { - void **v0 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_DATA_PTR); + void **dataPtr = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_DATA_PTR); - if (HMCutIn_IsFinished(*v0) == TRUE) { - HMCutIn_EndTask(*v0); + if (HMCutIn_IsFinished(*dataPtr) == TRUE) { + HMCutIn_EndTask(*dataPtr); return TRUE; } @@ -3709,7 +3709,7 @@ static BOOL ScrCmd_ChangeIntoContestAttire(ScriptContext *ctx) static BOOL ScrCmd_CheckPlayerOnBike(ScriptContext *ctx) { u16 *destVar = ScriptContext_GetVarPointer(ctx); - *destVar = PlayerAvatar_GetPlayerState(ctx->fieldSystem->playerAvatar) == PLAYER_STATE_CYCLING; + *destVar = PlayerAvatar_GetPlayerState(ctx->fieldSystem->playerAvatar) == PLAYER_AVATAR_CYCLING; return FALSE; } @@ -4242,7 +4242,7 @@ static BOOL ScrCmd_DoUnionRoomGreeting(ScriptContext *ctx) StringTemplate **strTemplate = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); u16 v2 = ScriptContext_ReadHalfWord(ctx); TrainerInfo *trainerInfo = SaveData_GetTrainerInfo(FieldSystem_GetSaveData(ctx->fieldSystem)); - UnkStruct_02014EC4 *v4 = sub_02014EC4(FieldSystem_GetSaveData(ctx->fieldSystem)); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(FieldSystem_GetSaveData(ctx->fieldSystem)); u16 v5; if (v2 == 0) { @@ -4251,7 +4251,7 @@ static BOOL ScrCmd_DoUnionRoomGreeting(ScriptContext *ctx) v5 = 0; } - UnionRoom_DoGreeting(*strTemplate, v2, v5, trainerInfo, v4); + UnionRoom_DoGreeting(*strTemplate, v2, v5, trainerInfo, unlockedWords); return FALSE; } @@ -4793,7 +4793,7 @@ static BOOL ScrCmd_GetPlayer3DPos(ScriptContext *ctx) u16 *destVarY = ScriptContext_GetVarPointer(ctx); u16 *destVarZ = ScriptContext_GetVarPointer(ctx); - MapObject *player = Player_MapObject(fieldSystem->playerAvatar); + MapObject *player = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); *destVarX = MapObject_GetX(player); *destVarY = MapObject_GetY(player) / 2; @@ -5514,11 +5514,11 @@ static BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_239(ScriptContext *ctx) +static BOOL ScrCmd_OpenBattleRegulationMenu(ScriptContext *ctx) { - u16 v0 = ScriptContext_ReadHalfWord(ctx); + u16 destVar = ScriptContext_ReadHalfWord(ctx); - ov7_0224BE7C(ctx->task, FieldSystem_GetVarPointer(ctx->fieldSystem, v0)); + OpenBattleRegulationMenu(ctx->task, FieldSystem_GetVarPointer(ctx->fieldSystem, destVar)); return TRUE; } @@ -6011,40 +6011,38 @@ static BOOL ScrCmd_InitDailyRandomLevel(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_27D(ScriptContext *ctx) +static BOOL ScrCmd_TryBufferAndUnlockRandomToughWord(ScriptContext *ctx) { - u16 *v2 = ScriptContext_GetVarPointer(ctx); - u16 v3 = ScriptContext_GetVar(ctx); - StringTemplate **v4 = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); + u16 *destVar = ScriptContext_GetVarPointer(ctx); + u16 index = ScriptContext_GetVar(ctx); + StringTemplate **template = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); - UnkStruct_02014EC4 *v0 = sub_02014EC4(ctx->fieldSystem->saveData); - u32 v1 = sub_02014EE4(v0); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(ctx->fieldSystem->saveData); + u32 bankEntry = EasyChatWords_TryUnlockRandomToughWord(unlockedWords); - if (v1 == 32) { - *v2 = 0xffff; + if (bankEntry == TEXT_BANK_TOUGH_WORDS_ENTRY_COUNT) { + *destVar = -1; return FALSE; } else { - *v2 = v1; + *destVar = bankEntry; } - { - u16 v5 = sub_02014F64(v1); - StringTemplate_SetCustomMessageWord(*v4, v3, v5); - } + u16 word = EasyChatWords_GetToughWordFromBankEntry(bankEntry); + StringTemplate_SetEasyChatWord(*template, index, word); return FALSE; } -static BOOL ScrCmd_27F(ScriptContext *ctx) +static BOOL ScrCmd_CheckAllToughWordsUnlocked(ScriptContext *ctx) { - u16 *v1 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - UnkStruct_02014EC4 *v0 = sub_02014EC4(ctx->fieldSystem->saveData); + UnlockedEasyChatWords *unlockedWords = SaveData_GetUnlockedEasyChatWords(ctx->fieldSystem->saveData); - if (sub_02014F48(v0) == TRUE) { - *v1 = 1; + if (EasyChatWords_AreAllToughWordsUnlocked(unlockedWords) == TRUE) { + *destVar = TRUE; } else { - *v1 = 0; + *destVar = FALSE; } return FALSE; @@ -6345,21 +6343,21 @@ static BOOL ScrCmd_CheckShouldShowGhost(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_29E(ScriptContext *ctx) +static BOOL ScrCmd_StartDestroyObstacleAnimation(ScriptContext *ctx) { - u16 v0 = ScriptContext_GetVar(ctx); - u16 *v1 = ScriptContext_GetVarPointer(ctx); + u16 obstacle = ScriptContext_GetVar(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); FieldSystem *fieldSystem = ctx->fieldSystem; - switch (v0) { + switch (obstacle) { case 0: - ov6_0224899C(fieldSystem, v1, 0, HEAP_ID_FIELD3); + ov6_0224899C(fieldSystem, destVar, 0, HEAP_ID_FIELD3); break; case 1: - ov6_0224899C(fieldSystem, v1, 1, HEAP_ID_FIELD3); + ov6_0224899C(fieldSystem, destVar, 1, HEAP_ID_FIELD3); break; case 2: - ov6_0224899C(fieldSystem, v1, 2, HEAP_ID_FIELD3); + ov6_0224899C(fieldSystem, destVar, 2, HEAP_ID_FIELD3); break; default: GF_ASSERT(FALSE); @@ -6390,19 +6388,19 @@ static BOOL ScrCmd_29F(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_2A3(ScriptContext *ctx) +static BOOL ScrCmd_CheckHasWiFiListValidLogin(ScriptContext *ctx) { - u16 *v0 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - *v0 = WiFiList_HasValidLogin(ctx->fieldSystem->saveData); + *destVar = WiFiList_HasValidLogin(ctx->fieldSystem->saveData); return FALSE; } -static BOOL ScrCmd_2A4(ScriptContext *ctx) +static BOOL ScrCmd_GetWiFListValidFriendsCount(ScriptContext *ctx) { - u16 *v0 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - *v0 = sub_0202AF94(SaveData_GetWiFiList(ctx->fieldSystem->saveData)); + *destVar = WiFiList_GetValidFriendsCount(SaveData_GetWiFiList(ctx->fieldSystem->saveData)); return FALSE; } @@ -6443,10 +6441,10 @@ static BOOL ScrCmd_CheckIsMysteryGiftPhrase(ScriptContext *ctx) StringTemplate *strTemplate = StringTemplate_Default(HEAP_ID_FIELD3); MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_MYSTERY_GIFT_PHRASE, HEAP_ID_FIELD3); - StringTemplate_SetCustomMessageWord(strTemplate, 0, customMessageWord1); - StringTemplate_SetCustomMessageWord(strTemplate, 1, customMessageWord2); - StringTemplate_SetCustomMessageWord(strTemplate, 2, customMessageWord3); - StringTemplate_SetCustomMessageWord(strTemplate, 3, customMessageWord4); + StringTemplate_SetEasyChatWord(strTemplate, 0, customMessageWord1); + StringTemplate_SetEasyChatWord(strTemplate, 1, customMessageWord2); + StringTemplate_SetEasyChatWord(strTemplate, 2, customMessageWord3); + StringTemplate_SetEasyChatWord(strTemplate, 3, customMessageWord4); String *stringCustomMessageWords = MessageUtil_ExpandedString(strTemplate, msgLoader, MysteryGiftPhrase_CustomMessageWords, HEAP_ID_FIELD3); String *stringEveryoneHappyWiFiConnection = MessageLoader_GetNewString(msgLoader, MysteryGiftPhrase_EveryoneHappyWiFiConnection); @@ -6589,10 +6587,10 @@ static BOOL ScrCmd_2C4(ScriptContext *ctx) v2->options = SaveData_GetOptions(ctx->fieldSystem->saveData); v2->sceneID = v1; v2->saveData = ctx->fieldSystem->saveData; - v2->unk_1C = ctx->fieldSystem->location->mapId; + v2->mapHeaderID = ctx->fieldSystem->location->mapId; v2->journalEntry = ctx->fieldSystem->journalEntry; v2->bagCursor = ctx->fieldSystem->bagCursor; - v2->unk_20 = ctx->fieldSystem->battleSubscreenCursorOn; + v2->subscreenCursorOn = ctx->fieldSystem->battleSubscreenCursorOn; FieldTask_RunApplication(ctx->task, &Unk_020F8BE0, v2); ScriptContext_Pause(ctx, sub_02041CC8); @@ -7079,18 +7077,18 @@ static BOOL ScrCmd_FinishDistortionWorldGiratinaShadowEvent(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_323(ScriptContext *ctx) +static BOOL ScrCmd_CheckNoWiFiPlazaCooldown(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *v1 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - s64 v2 = GetTimestamp(); - s64 v3 = v2 - fieldSystem->unk_C4.unk_00; + s64 timestamp = GetTimestamp(); + s64 v3 = timestamp - fieldSystem->unk_C4.unk_00; if (v3 >= 120) { - *v1 = 1; + *destVar = TRUE; } else { - *v1 = 0; + *destVar = FALSE; } return FALSE; diff --git a/src/scrcmd_battle_hall.c b/src/scrcmd_battle_hall.c index 703355e391..a3e53961c7 100644 --- a/src/scrcmd_battle_hall.c +++ b/src/scrcmd_battle_hall.c @@ -7,9 +7,6 @@ #include "constants/communication/comm_command.h" #include "generated/game_records.h" -#include "struct_decls/struct_02030114_decl.h" -#include "struct_decls/struct_0203026C_decl.h" - #include "applications/party_menu/defs.h" #include "applications/party_menu/main.h" #include "applications/pokemon_summary_screen/main.h" @@ -17,6 +14,7 @@ #include "bag.h" #include "battle_frontier_stats.h" +#include "battle_hall_save.h" #include "battle_hall_win_records.h" #include "comm_command_field.h" #include "communication_system.h" @@ -36,7 +34,6 @@ #include "string_template.h" #include "unk_0202D05C.h" #include "unk_0202D778.h" -#include "unk_02030108.h" #include "unk_0204FA34.h" #include "unk_0205DFC4.h" @@ -78,8 +75,8 @@ BOOL ScrCmd_2CC(ScriptContext *ctx) u16 arg = ScriptContext_GetVar(ctx); u16 *result = FieldSystem_GetVarPointer(ctx->fieldSystem, ScriptContext_ReadHalfWord(ctx)); - UnkStruct_02030114 *v10 = sub_02030114(ctx->fieldSystem->saveData); - UnkStruct_0203026C *v11 = sub_0203026C(ctx->fieldSystem->saveData); + BattleHallSave *v10 = BattleHallSave_Get(ctx->fieldSystem->saveData); + BattleHallStreakFlags *v11 = BattleHallStreakFlags_Get(ctx->fieldSystem->saveData); void **partySelect = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_PARTY_MANAGEMENT_DATA); switch (action) { @@ -92,7 +89,7 @@ BOOL ScrCmd_2CC(ScriptContext *ctx) 106, BattleFrontierStats_GetHostFriendIdx(106)); } else { - *result = sub_020302B4(v11, 5, arg, 0, NULL); + *result = BattleHallStreakFlags_GetFlag(v11, 5, arg, 0, NULL); } break; case 2: @@ -187,7 +184,7 @@ static BOOL CheckPartyIsBattleHallEligible(u16 numPokemonNeeded, SaveData *saveD BOOL ScrCmd_2D1(ScriptContext *ctx) { u16 challengeType = ScriptContext_GetVar(ctx); - UnkStruct_0203026C *v0 = sub_0203026C(ctx->fieldSystem->saveData); + BattleHallStreakFlags *v0 = BattleHallStreakFlags_Get(ctx->fieldSystem->saveData); sub_0204FA50(ctx->fieldSystem->saveData, v0, challengeType); return FALSE; diff --git a/src/scrcmd_catching_show.c b/src/scrcmd_catching_show.c index 7c5d911e77..0e18e34dad 100644 --- a/src/scrcmd_catching_show.c +++ b/src/scrcmd_catching_show.c @@ -14,10 +14,10 @@ #include "pc_boxes.h" #include "pokedex.h" #include "pokemon.h" +#include "save_catchrecords.h" #include "save_player.h" #include "system_flags.h" #include "trainer_info.h" -#include "unk_0202F180.h" #include "unk_02092494.h" #include "vars_flags.h" diff --git a/src/scrcmd_mystery_gift.c b/src/scrcmd_mystery_gift.c index 2f1ad5f0a7..e8327a5037 100644 --- a/src/scrcmd_mystery_gift.c +++ b/src/scrcmd_mystery_gift.c @@ -22,6 +22,7 @@ #include "pokemon.h" #include "poketch.h" #include "ribbon.h" +#include "save_catchrecords.h" #include "save_player.h" #include "script_manager.h" #include "string_gf.h" @@ -33,7 +34,6 @@ #include "unk_020298BC.h" #include "unk_0202C9F4.h" #include "unk_0202D778.h" -#include "unk_0202F180.h" #include "unk_02054884.h" #include "unk_02092494.h" #include "vars_flags.h" diff --git a/src/scrcmd_system_flags.c b/src/scrcmd_system_flags.c index ebc368a805..ca70c51346 100644 --- a/src/scrcmd_system_flags.c +++ b/src/scrcmd_system_flags.c @@ -1,5 +1,6 @@ #include "scrcmd_system_flags.h" +#include "constants/scrcmd.h" #include "generated/badges.h" #include "struct_defs/player_data.h" @@ -157,21 +158,21 @@ BOOL ScrCmd_SetGameCompleted(ScriptContext *ctx) return FALSE; } -BOOL ScrCmd_Strength(ScriptContext *ctx) +BOOL ScrCmd_DoStrengthFunc(ScriptContext *ctx) { u16 *destVar; VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData); switch (ScriptContext_ReadByte(ctx)) { - case 1: + case FIELD_MOVE_FUNC_SET_ACTIVE: SystemFlag_HandleStrengthActive(varsFlags, HANDLE_FLAG_SET); break; - case 0: + case FIELD_MOVE_FUNC_CLEAR_ACTIVE: SystemFlag_HandleStrengthActive(varsFlags, HANDLE_FLAG_CLEAR); break; - case 2: + case FIELD_MOVE_FUNC_CHECK_ACTIVE: destVar = ScriptContext_GetVarPointer(ctx); *destVar = SystemFlag_HandleStrengthActive(varsFlags, HANDLE_FLAG_CHECK); break; @@ -183,21 +184,21 @@ BOOL ScrCmd_Strength(ScriptContext *ctx) return FALSE; } -BOOL ScrCmd_Flash(ScriptContext *ctx) +BOOL ScrCmd_DoFlashFunc(ScriptContext *ctx) { u16 *destVar; VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData); switch (ScriptContext_ReadByte(ctx)) { - case 1: + case FIELD_MOVE_FUNC_SET_ACTIVE: SystemFlag_SetFlashActive(varsFlags); break; - case 0: + case FIELD_MOVE_FUNC_CLEAR_ACTIVE: SystemFlag_ClearFlashActive(varsFlags); break; - case 2: + case FIELD_MOVE_FUNC_CHECK_ACTIVE: destVar = ScriptContext_GetVarPointer(ctx); *destVar = SystemFlag_CheckFlashActive(varsFlags); break; @@ -209,21 +210,21 @@ BOOL ScrCmd_Flash(ScriptContext *ctx) return FALSE; } -BOOL ScrCmd_Defog(ScriptContext *ctx) +BOOL ScrCmd_DoDefogFunc(ScriptContext *ctx) { u16 *destVar; VarsFlags *varsFlags = SaveData_GetVarsFlags(ctx->fieldSystem->saveData); switch (ScriptContext_ReadByte(ctx)) { - case 1: + case FIELD_MOVE_FUNC_SET_ACTIVE: SystemFlag_SetDefogActive(varsFlags); break; - case 0: + case FIELD_MOVE_FUNC_CLEAR_ACTIVE: SystemFlag_ClearDefogActive(varsFlags); break; - case 2: + case FIELD_MOVE_FUNC_CHECK_ACTIVE: destVar = ScriptContext_GetVarPointer(ctx); *destVar = SystemFlag_CheckDefogActive(varsFlags); break; diff --git a/src/scrcmd_tv_broadcast.c b/src/scrcmd_tv_broadcast.c index ac1781cf83..6174852243 100644 --- a/src/scrcmd_tv_broadcast.c +++ b/src/scrcmd_tv_broadcast.c @@ -40,6 +40,8 @@ #include "unk_0202E2CC.h" #include "unk_02054884.h" +#include "res/text/bank/tv_reporter_interviews.h" + typedef void (*TVInterview_SaveResponseFunction)(FieldSystem *, u16); typedef void (*TVInterview_LoadMessageFunction)(FieldSystem *, StringTemplate *); typedef BOOL (*TVInterview_IsEligibleFunction)(FieldSystem *); @@ -144,34 +146,28 @@ static const TVInterview sInterviews[TV_PROGRAM_TYPE_INTERVIEWS_NUM_SEGMENTS]; BOOL ScrCmd_CallTVInterview(ScriptContext *ctx) { - StringTemplate **template; - - template = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); + StringTemplate **template = FieldSystem_GetScriptMemberPtr(ctx->fieldSystem, SCRIPT_MANAGER_STR_TEMPLATE); switch (ScriptContext_ReadHalfWord(ctx)) { case TV_INTERVIEW_CALL_LOAD_MESSAGE: { - int segmentID; - u16 *bankIDVar; - u16 *messageIDVar; - - segmentID = ScriptContext_GetVar(ctx); - bankIDVar = ScriptContext_GetVarPointer(ctx); - messageIDVar = ScriptContext_GetVarPointer(ctx); + int segmentID = ScriptContext_GetVar(ctx); + u16 *bankIDVar = ScriptContext_GetVarPointer(ctx); + u16 *messageIDVar = ScriptContext_GetVarPointer(ctx); *bankIDVar = TEXT_BANK_TV_REPORTER_INTERVIEWS; *messageIDVar = TVInterview_LoadMessage(segmentID, ctx->fieldSystem, *template); - } break; + break; + } case TV_INTERVIEW_CALL_SAVE_RESPONSE: { - u16 segmentID; - u16 customMessageWord, unused; GameRecords *records = SaveData_GetGameRecords(ctx->fieldSystem->saveData); - segmentID = ScriptContext_GetVar(ctx); - customMessageWord = ScriptContext_GetVar(ctx); - unused = ScriptContext_GetVar(ctx); + u16 segmentID = ScriptContext_GetVar(ctx); + u16 customMessageWord = ScriptContext_GetVar(ctx); + u16 unused = ScriptContext_GetVar(ctx); TVInterview_SaveResponse(ctx->fieldSystem, segmentID, customMessageWord, unused); GameRecords_IncrementTrainerScore(records, TRAINER_SCORE_EVENT_TV_INTERVIEW_GIVEN); - } break; + break; + } } return FALSE; @@ -213,9 +209,7 @@ BOOL ScrCmd_27C(ScriptContext *param0) static void TVInterview_SaveResponse(FieldSystem *fieldSystem, int segmentID, u16 customMessageWord, u16 unused) { - TVInterview_SaveResponseFunction saveResponseFn; - - saveResponseFn = sInterviews[segmentID - 1].saveResponseFn; + TVInterview_SaveResponseFunction saveResponseFn = sInterviews[segmentID - 1].saveResponseFn; if (saveResponseFn != NULL) { saveResponseFn(fieldSystem, customMessageWord); @@ -224,9 +218,7 @@ static void TVInterview_SaveResponse(FieldSystem *fieldSystem, int segmentID, u1 static int TVInterview_LoadMessage(int segmentID, FieldSystem *fieldSystem, StringTemplate *template) { - TVInterview_LoadMessageFunction loadMessageFn; - - loadMessageFn = sInterviews[segmentID - 1].loadMessageFn; + TVInterview_LoadMessageFunction loadMessageFn = sInterviews[segmentID - 1].loadMessageFn; if (loadMessageFn != NULL) { loadMessageFn(fieldSystem, template); @@ -358,25 +350,120 @@ static BOOL sub_020493B8(FieldSystem *fieldSystem) } static const TVInterview sInterviews[TV_PROGRAM_TYPE_INTERVIEWS_NUM_SEGMENTS] = { - { NULL, NULL, NULL, 0x3 }, - { FieldSystem_SaveTVSegment_BattleTowerCorner, NULL, sub_02049348, 0x4 }, - { NULL, NULL, NULL, 0x5 }, - { FieldSystem_SaveTVSegment_YourPokemonCorner, sub_02049268, NULL, 0x6 }, - { NULL, NULL, NULL, 0x7 }, - { FieldSystem_SaveTVSegment_ThePoketchWatch, sub_02049288, sub_02049358, 0x8 }, - { FieldSystem_SaveTVSegment_ContestHall, NULL, sub_02049368, 0x9 }, - { NULL, NULL, NULL, 0xA }, - { FieldSystem_SaveTVSegment_RightOnPhotoCorner, NULL, sub_02049378, 0xB }, - { FieldSystem_SaveTVSegment_StreetCornerPersonalityCheckup, NULL, NULL, 0xC }, - { FieldSystem_SaveTVSegment_ThreeCheersForPoffinCorner, NULL, sub_02049388, 0xD }, - { NULL, NULL, NULL, 0xE }, - { FieldSystem_SaveTVSegment_AmitySquareWatch, sub_020492A0, sub_02049398, 0xF }, - { FieldSystem_SaveTVSegment_BattleFrontierFrontlineNews_Single, sub_020492D4, sub_020493A8, 0x10 }, - { FieldSystem_SaveTVSegment_InYourFaceInterview_Question1, NULL, NULL, 0x11 }, - { FieldSystem_SaveTVSegment_InYourFaceInterview_Question2, NULL, NULL, 0x12 }, - { FieldSystem_SaveTVSegment_InYourFaceInterview_Question3, NULL, NULL, 0x13 }, - { FieldSystem_SaveTVSegment_InYourFaceInterview_Question4, NULL, NULL, 0x14 }, - { FieldSystem_SaveTVSegment_BattleFrontierFrontlineNews_Multi, sub_02049308, sub_020493B8, 0x15 } + [TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_01 - 1] = { + .saveResponseFn = NULL, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_Dummy3, + }, + [TV_PROGRAM_SEGMENT_BATTLE_TOWER_CORNER - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_BattleTowerCorner, + .loadMessageFn = NULL, + .isEligibleFn = sub_02049348, + .messageID = TVReporterInterviews_Text_BattleTowerCorner, + }, + [TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_03 - 1] = { + .saveResponseFn = NULL, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_Dummy5, + }, + [TV_PROGRAM_SEGMENT_YOUR_POKEMON_CORNER - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_YourPokemonCorner, + .loadMessageFn = sub_02049268, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_YourPokemonCorner, + }, + [TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_05 - 1] = { + .saveResponseFn = NULL, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_Dummy7, + }, + [TV_PROGRAM_SEGMENT_THE_POKETCH_WATCH - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_ThePoketchWatch, + .loadMessageFn = sub_02049288, + .isEligibleFn = sub_02049358, + .messageID = TVReporterInterviews_Text_ThePoketchWatch, + }, + [TV_PROGRAM_SEGMENT_CONTEST_HALL - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_ContestHall, + .loadMessageFn = NULL, + .isEligibleFn = sub_02049368, + .messageID = TVReporterInterviews_Text_ContestHall, + }, + [TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_08 - 1] = { + .saveResponseFn = NULL, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_Dummy10, + }, + [TV_PROGRAM_SEGMENT_RIGHT_ON_PHOTO_CORNER - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_RightOnPhotoCorner, + .loadMessageFn = NULL, + .isEligibleFn = sub_02049378, + .messageID = TVReporterInterviews_Text_RightOnPhotoCorner, + }, + [TV_PROGRAM_SEGMENT_STREET_CORNER_PERSONALITY_CHECKUP - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_StreetCornerPersonalityCheckup, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_StreetCornerPersonalityCheckup, + }, + [TV_PROGRAM_SEGMENT_THREE_CHEERS_FOR_POFFIN_CORNER - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_ThreeCheersForPoffinCorner, + .loadMessageFn = NULL, + .isEligibleFn = sub_02049388, + .messageID = TVReporterInterviews_Text_ThreeCheersForPoffinCorner, + }, + [TV_PROGRAM_SEGMENT_INTERVIEW_UNUSED_12 - 1] = { + .saveResponseFn = NULL, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_Dummy14, + }, + [TV_PROGRAM_SEGMENT_AMITY_SQUARE_WATCH - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_AmitySquareWatch, + .loadMessageFn = sub_020492A0, + .isEligibleFn = sub_02049398, + .messageID = TVReporterInterviews_Text_AmitySquareWatch, + }, + [TV_PROGRAM_SEGMENT_BATTLE_FRONTIER_FRONTLINE_NEWS_SINGLE - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_BattleFrontierFrontlineNews_Single, + .loadMessageFn = sub_020492D4, + .isEligibleFn = sub_020493A8, + .messageID = TVReporterInterviews_Text_BattleFrontierFrontlineNews_Single, + }, + [TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_1 - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_InYourFaceInterview_Question1, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_InYourFaceInterview_Question1, + }, + [TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_2 - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_InYourFaceInterview_Question2, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_InYourFaceInterview_Question2, + }, + [TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_3 - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_InYourFaceInterview_Question3, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_InYourFaceInterview_Question3, + }, + [TV_PROGRAM_SEGMENT_IN_YOUR_FACE_INTERVIEW_QUESTION_4 - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_InYourFaceInterview_Question4, + .loadMessageFn = NULL, + .isEligibleFn = NULL, + .messageID = TVReporterInterviews_Text_InYourFaceInterview_Question4, + }, + [TV_PROGRAM_SEGMENT_BATTLE_FRONTIER_FRONTLINE_NEWS_MULTI - 1] = { + .saveResponseFn = FieldSystem_SaveTVSegment_BattleFrontierFrontlineNews_Multi, + .loadMessageFn = sub_02049308, + .isEligibleFn = sub_020493B8, + .messageID = TVReporterInterviews_Text_BattleFrontierFrontlineNews_Multi, + }, }; BOOL ScrCmd_GetCurrentSafariGameCaughtNum(ScriptContext *ctx) diff --git a/src/script_manager.c b/src/script_manager.c index ddf3c4e9d5..6a5334f744 100644 --- a/src/script_manager.c +++ b/src/script_manager.c @@ -46,9 +46,9 @@ Entry(SCRIPT_ID_OFFSET_DAY_CARE_COMMON, scripts_day_care_common, TEXT_BANK_DAY_CARE_COMMON) \ Entry(SCRIPT_ID_OFFSET_POFFIN_COMMON, scripts_poffin_common, TEXT_BANK_POFFIN_COMMON) \ Entry(SCRIPT_ID_OFFSET_GROUP_CONNECTION, scripts_group_connection, TEXT_BANK_GROUP_CONNECTION) \ - Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_ATTENDANTS, scripts_pokemon_center_b1f_attendants, TEXT_BANK_POKEMON_CENTER_B1F_ATTENDANTS) \ + Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_COMMON, scripts_pokemon_center_b1f_common, TEXT_BANK_POKEMON_CENTER_B1F_COMMON) \ Entry(SCRIPT_ID_OFFSET_COMMUNICATION_CLUB, scripts_communication_club, TEXT_BANK_COMMUNICATION_CLUB) \ - Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_ATTENDANTS, scripts_pokemon_center_2f_attendants, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS) \ + Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_COMMON, scripts_pokemon_center_2f_common, TEXT_BANK_POKEMON_CENTER_2F_COMMON) \ Entry(SCRIPT_ID_OFFSET_POKE_RADAR, scripts_poke_radar, TEXT_BANK_BAG) \ Entry(SCRIPT_ID_OFFSET_VS_SEEKER, scripts_vs_seeker, TEXT_BANK_VS_SEEKER) \ Entry(SCRIPT_ID_OFFSET_RECORD_CHATOT_CRY, scripts_record_chatot_cry, TEXT_BANK_RECORD_CHATOT_CRY) \ @@ -189,7 +189,7 @@ static void ScriptManager_Init(FieldSystem *fieldSystem, ScriptManager *scriptMa { u16 *targetID = ScriptManager_GetMemberPtr(scriptManager, SCRIPT_DATA_TARGET_OBJECT_ID); - scriptManager->playerDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + scriptManager->playerDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); scriptManager->targetObject = object; scriptManager->scriptID = scriptID; scriptManager->saveType = saveType; @@ -653,8 +653,8 @@ HiddenItemTilePosition *FieldSystem_GetNearbyHiddenItems(FieldSystem *fieldSyste return hiddenItems; } - playerX = Player_GetXPos(fieldSystem->playerAvatar); - playerZ = Player_GetZPos(fieldSystem->playerAvatar); + playerX = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + playerZ = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); playerMinX = playerX - 7; playerMaxX = playerX + 7; playerMinZ = playerZ - 7; diff --git a/src/start_menu.c b/src/start_menu.c index ec5a0f6939..8bb5669c06 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -12,8 +12,6 @@ #include "generated/species.h" #include "generated/text_banks.h" -#include "struct_defs/sentence.h" - #include "applications/bag/application.h" #include "applications/mail.h" #include "applications/party_menu/defs.h" @@ -35,6 +33,7 @@ #include "comm_manager.h" #include "dexmode_checker.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "evolution.h" #include "field_bgm.h" #include "field_move_tasks.h" @@ -76,7 +75,6 @@ #include "text.h" #include "trainer_case.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0202D778.h" #include "unk_02033200.h" #include "unk_0203D1B8.h" @@ -292,7 +290,7 @@ void StartMenu_Open(FieldSystem *fieldSystem) menu->inUnionRoom = FALSE; if (sub_0205F588(fieldSystem->playerAvatar) == 1) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } FieldSystem_CreateTask(fieldSystem, StartMenu_Main, menu); @@ -306,7 +304,7 @@ void StartMenu_OpenUnionRoom(FieldSystem *fieldSystem) menu->inUnionRoom = TRUE; if (sub_0205F588(fieldSystem->playerAvatar) == 1) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } FieldSystem_CreateTask(fieldSystem, StartMenu_Main, menu); @@ -320,7 +318,7 @@ void StartMenu_OpenColosseum(FieldSystem *fieldSystem) menu->inUnionRoom = FALSE; if (sub_0205F588(fieldSystem->playerAvatar) == 1) { - sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + sub_0205F5E4(fieldSystem->playerAvatar, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); } FieldSystem_CreateTask(fieldSystem, StartMenu_Main, menu); @@ -1406,8 +1404,8 @@ static BOOL StartMenu_Chat(FieldTask *fieldTask) menu->taskData = EasyChatArgs_New(EASY_CHAT_TYPE_SENTENCE, EasyChat_Text_ChooseWordOrPhrase, fieldSystem->saveData, HEAP_ID_FIELD2); - Sentence sentence; - Sentence_InitWithType(&sentence, 4); + EasyChatSentence sentence; + EasyChatSentence_InitWithType(&sentence, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); EasyChatArgs_SetSentence(menu->taskData, &sentence); FieldSystem_OpenEasyChat(fieldSystem, (EasyChatArgs *)menu->taskData); @@ -1422,7 +1420,7 @@ static BOOL StartMenu_ExitChat(FieldTask *fieldTask) StartMenu *menu = FieldTask_GetEnv(fieldTask); if (!EasyChatArgs_IsUnmodified(menu->taskData)) { - Sentence sentence; + EasyChatSentence sentence; EasyChatArgs_CopySentenceTo(menu->taskData, &sentence); if (CommServerClient_IsInitialized()) { diff --git a/src/string_template.c b/src/string_template.c index 4cbd13c621..efcb23b2c4 100644 --- a/src/string_template.c +++ b/src/string_template.c @@ -16,6 +16,7 @@ #include "global/utility.h" #include "charcode.h" +#include "easy_chat_words.h" #include "enums.h" #include "heap.h" #include "message.h" @@ -27,7 +28,6 @@ #include "savedata_misc.h" #include "string_gf.h" #include "trainer_info.h" -#include "unk_02014D38.h" #include "unk_02017038.h" #include "unk_020996D0.h" @@ -451,9 +451,9 @@ void StringTemplate_SetCityName(StringTemplate *template, u32 idx, u32 country, } } -void StringTemplate_SetCustomMessageWord(StringTemplate *template, u32 idx, u16 customMessageWord) +void StringTemplate_SetEasyChatWord(StringTemplate *template, u32 idx, u16 word) { - sub_02014DB8(customMessageWord, template->templateBuf); + EasyChatWord_ToString(word, template->templateBuf); SetStringTemplateArg(template, idx, template->templateBuf, NULL); } diff --git a/src/terrain_collision_manager.c b/src/terrain_collision_manager.c index ec3ef62142..253717d5e7 100644 --- a/src/terrain_collision_manager.c +++ b/src/terrain_collision_manager.c @@ -297,7 +297,7 @@ BOOL TerrainCollisionManager_WillMapObjectCollide(const FieldSystem *fieldSystem if (!isColliding && newObjectHeightSource == CALCULATED_HEIGHT_SOURCE_DYNAMIC) { u8 tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, tileX, tileZ); - if (TileBehavior_IsPastoriaGymWater(tileBehavior)) { + if (TileBehavior_HasDynamicHeightCollision(tileBehavior)) { return TRUE; } } @@ -327,7 +327,7 @@ BOOL TerrainCollisionManager_WillPlayerCollide(FieldSystem *fieldSystem, const V if (!isColliding && newObjectHeightSource == CALCULATED_HEIGHT_SOURCE_DYNAMIC) { u8 tileBehavior = TerrainCollisionManager_GetTileBehavior(fieldSystem, tileX, tileZ); - if (TileBehavior_IsPastoriaGymWater(tileBehavior)) { + if (TileBehavior_HasDynamicHeightCollision(tileBehavior)) { return TRUE; } } diff --git a/src/trainer_encounter.c b/src/trainer_encounter.c index fba3f95549..c8c3bcacf4 100644 --- a/src/trainer_encounter.c +++ b/src/trainer_encounter.c @@ -15,7 +15,7 @@ #include "field/field_system.h" #include "overlay005/ov5_021ECC20.h" #include "overlay005/ov5_021F5A10.h" -#include "overlay008/ov8_02249960.h" +#include "overlay008/gym_features.h" #include "heap.h" #include "map_object.h" @@ -185,8 +185,8 @@ static int GetTrainerDistToPlayer(const MapObject *trainerMapObj, PlayerAvatar * int trainerType = GetTrainerType(trainerMapObj); if (trainerType == TRAINER_TYPE_NORMAL) { - playerX = Player_GetXPos(playerAvatar); - playerZ = Player_GetZPos(playerAvatar); + playerX = PlayerAvatar_GetXPos(playerAvatar); + playerZ = PlayerAvatar_GetZPos(playerAvatar); trainerFaceDir = MapObject_GetFacingDir(trainerMapObj); trainerSightRange = MapObject_GetDataAt(trainerMapObj, 0); distance = GetDistanceToPlayerFromDir(trainerMapObj, trainerFaceDir, trainerSightRange, playerX, playerZ, 0); @@ -202,8 +202,8 @@ static int GetTrainerDistToPlayer(const MapObject *trainerMapObj, PlayerAvatar * } if (trainerType == TRAINER_TYPE_VIEW_ALL_DIRECTIONS) { - playerX = Player_GetXPos(playerAvatar); - playerZ = Player_GetZPos(playerAvatar); + playerX = PlayerAvatar_GetXPos(playerAvatar); + playerZ = PlayerAvatar_GetZPos(playerAvatar); trainerSightRange = MapObject_GetDataAt(trainerMapObj, 0); trainerFaceDir = 0; @@ -228,8 +228,8 @@ static int GetTrainerDistToPlayer(const MapObject *trainerMapObj, PlayerAvatar * int MapObject_GetDistanceToPlayer(const MapObject *mapObj, PlayerAvatar *playerAvatar, int direction, int range) { - int playerX = Player_GetXPos(playerAvatar); - int playerZ = Player_GetZPos(playerAvatar); + int playerX = PlayerAvatar_GetXPos(playerAvatar); + int playerZ = PlayerAvatar_GetZPos(playerAvatar); int distance = GetDistanceToPlayerFromDir(mapObj, direction, range, playerX, playerZ, 0); if (distance != DISTANCE_INVALID) { @@ -405,10 +405,10 @@ void TrainerEncounter_FreeApproachingTrainerTask(SysTask *task) static SysTask *StartApproachingTrainerTask(FieldSystem *fieldSystem, MapObject *mapObj, PlayerAvatar *playerAvatar, int direction, int sightRange, int unused, int approachType, int approachNum) { SysTask *task; - ApproachingTrainerData *data = Heap_AllocAtEnd(HEAP_ID_FIELD1, (sizeof(ApproachingTrainerData))); + ApproachingTrainerData *data = Heap_AllocAtEnd(HEAP_ID_FIELD1, sizeof(ApproachingTrainerData)); GF_ASSERT(data != NULL); - memset(data, 0, (sizeof(ApproachingTrainerData))); + memset(data, 0, sizeof(ApproachingTrainerData)); data->direction = direction; data->sightRange = sightRange; @@ -497,7 +497,7 @@ static int ApproachingTrainerTask_TryFaceDirection(ApproachingTrainerData *data) static int ApproachingTrainerTask_CheckRevealOrFaceDirection(ApproachingTrainerData *data) { - MapObject *mapObj = Player_MapObject(data->playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(data->playerAvatar); if (LocalMapObj_CheckAnimationFinished(mapObj) == FALSE) { return 0; @@ -644,10 +644,10 @@ static int ApproachingTrainerTask_DelayNextToPlayer(ApproachingTrainerData *data static int ApproachingTrainerTask_TryPlayerFaceTrainer(ApproachingTrainerData *data) { - MapObject *mapObj = Player_MapObject(data->playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(data->playerAvatar); int movementAction, dir = GetDirectionBetweenPoints(MapObject_GetX(mapObj), MapObject_GetZ(mapObj), MapObject_GetX(data->mapObj), MapObject_GetZ(data->mapObj)); - if (PlayerAvatar_GetDir(data->playerAvatar) != dir && (data->approachNum == 0 || data->approachType == APPROACH_TYPE_VS2)) { + if (PlayerAvatar_GetFacingDir(data->playerAvatar) != dir && (data->approachNum == 0 || data->approachType == APPROACH_TYPE_VS2)) { if (LocalMapObj_IsAnimationSet(mapObj) == TRUE) { MapObject_SetStatusFlagOff(mapObj, MAP_OBJ_STATUS_LOCK_DIR); movementAction = MovementAction_TurnActionTowardsDir(dir, MOVEMENT_ACTION_FACE_NORTH); @@ -663,7 +663,7 @@ static int ApproachingTrainerTask_TryPlayerFaceTrainer(ApproachingTrainerData *d static int ApproachingTrainerTask_WaitPlayerFaceTrainer(ApproachingTrainerData *data) { - MapObject *mapObj = Player_MapObject(data->playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(data->playerAvatar); if (LocalMapObj_CheckAnimationFinished(mapObj) == FALSE) { return 0; diff --git a/src/tv_segment.c b/src/tv_segment.c index d43749bc2b..ee2d2c6bb4 100644 --- a/src/tv_segment.c +++ b/src/tv_segment.c @@ -1634,7 +1634,7 @@ static int TVSegment_LoadMessage_BattleTowerCorner(FieldSystem *fieldSystem, Str StringTemplate_SetNumber(template, 0, battleTowerCorner->outcome.winStreak, 4, PADDING_MODE_NONE, CHARSET_MODE_EN); TVSegment_SetTemplateTrainerName(template, 1, episode); - StringTemplate_SetCustomMessageWord(template, 2, battleTowerCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, battleTowerCorner->customMessageWord); if (battleTowerCorner->outcome.win == TRUE) { return TVProgramInterviews_Text_BattleTowerCorner_Win; @@ -1669,13 +1669,13 @@ static int TVSegment_LoadMessage_YourPokemonCorner(FieldSystem *fieldSystem, Str TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, yourPokemonCorner->species, yourPokemonCorner->gender, yourPokemonCorner->language, yourPokemonCorner->metGame); sub_0206CD94(template, 2, yourPokemonCorner->nickname, yourPokemonCorner->gender, yourPokemonCorner->language, 1); - StringTemplate_SetCustomMessageWord(template, 3, yourPokemonCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 3, yourPokemonCorner->customMessageWord); return TVProgramInterviews_Text_YourPokemonCorner_Nickname; } else { TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, yourPokemonCorner->species, yourPokemonCorner->gender, yourPokemonCorner->language, yourPokemonCorner->metGame); - StringTemplate_SetCustomMessageWord(template, 3, yourPokemonCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 3, yourPokemonCorner->customMessageWord); return TVProgramInterviews_Text_YourPokemonCorner_NoNickname; } } @@ -1704,7 +1704,7 @@ static int TVSegment_LoadMessage_ThePoketchWatch(FieldSystem *fieldSystem, Strin TVSegment_SetTemplateTrainerName(template, 0, episode); StringTemplate_SetPoketchAppName(template, 1, thePoketchWatch->appID); - StringTemplate_SetCustomMessageWord(template, 2, thePoketchWatch->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, thePoketchWatch->customMessageWord); return TVProgramInterviews_Text_ThePoketchWatch; } @@ -1732,7 +1732,7 @@ static int TVSegment_LoadMessage_ContestHall(FieldSystem *fieldSystem, StringTem StringTemplate_SetContestRankName(template, 2, Contest_GetRankMessageID(contestHall->showcasedPokemon.contestRank)); StringTemplate_SetNumber(template, 3, contestHall->showcasedPokemon.contestPlacement, 1, PADDING_MODE_NONE, CHARSET_MODE_EN); TVSegment_SetTemplateTrainerName(template, 4, episode); - StringTemplate_SetCustomMessageWord(template, 5, contestHall->customMessageWord); + StringTemplate_SetEasyChatWord(template, 5, contestHall->customMessageWord); if (contestHall->showcasedPokemon.contestPlacement == 1) { return TVProgramInterviews_Text_ContestHall_Win; @@ -1768,7 +1768,7 @@ static int TVSegment_LoadMessage_RightOnPhotoCorner(FieldSystem *fieldSystem, St TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplateOwnPokemonSpecies(template, 1, rightOnPhotoCorner->species); - StringTemplate_SetCustomMessageWord(template, 2, rightOnPhotoCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, rightOnPhotoCorner->customMessageWord); return TVProgramInterviews_Text_RightOnPhotoCorner; } @@ -1817,7 +1817,7 @@ static int TVSegment_LoadMessage_ThreeCheersForPoffinCorner(FieldSystem *fieldSy TVSegment_SetTemplateTrainerName(template, 0, episode); StringTemplate_SetPoffinName(template, 1, poffin); - StringTemplate_SetCustomMessageWord(template, 2, threeCheersForPoffinCorner->customMessageWord); + StringTemplate_SetEasyChatWord(template, 2, threeCheersForPoffinCorner->customMessageWord); switch (poffin) { case POFFIN_TYPE_RICH: @@ -1854,7 +1854,7 @@ static int TVSegment_LoadMessage_AmitySquareWatch(FieldSystem *fieldSystem, Stri TVSegment_SetTemplateTrainerName(template, 0, episode); TVSegment_SetTemplatePokemonSpecies(template, 1, amitySquareWatch->unk_00.unk_02, amitySquareWatch->unk_00.unk_04, amitySquareWatch->unk_00.language, amitySquareWatch->unk_00.unk_06); StringTemplate_SetNatureName(template, 2, amitySquareWatch->unk_00.unk_1E); - StringTemplate_SetCustomMessageWord(template, 5, amitySquareWatch->customWordMessage); + StringTemplate_SetEasyChatWord(template, 5, amitySquareWatch->customWordMessage); switch (amitySquareWatch->unk_00.unk_1F) { case 0: @@ -1897,7 +1897,7 @@ static int TVSegment_LoadMessage_BattleFrontierFrontlineNews_Single(FieldSystem TVSegment_SetTemplatePokemonSpecies(template, 2, battleFrontierFrontlineNewsSingle->unk_00.unk_02, battleFrontierFrontlineNewsSingle->unk_00.unk_04, battleFrontierFrontlineNewsSingle->unk_00.language, battleFrontierFrontlineNewsSingle->unk_00.unk_06); } - StringTemplate_SetCustomMessageWord(template, 3, battleFrontierFrontlineNewsSingle->customWordMessage); + StringTemplate_SetEasyChatWord(template, 3, battleFrontierFrontlineNewsSingle->customWordMessage); return TVProgramInterviews_Text_BattleFrontierFrontlineNews_Single; } @@ -1920,7 +1920,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question1(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question1; } @@ -1939,7 +1939,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question2(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question2; } @@ -1958,7 +1958,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question3(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question3; } @@ -1977,7 +1977,7 @@ static int TVSegment_LoadMessage_InYourFaceInterview_Question4(FieldSystem *fiel TVSegment_InYourFaceInterview_Question *inYourFaceInterviewQuestion = TVEpisode_GetSegment(episode); TVSegment_SetTemplateTrainerName(template, 0, episode); - StringTemplate_SetCustomMessageWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); + StringTemplate_SetEasyChatWord(template, 1, inYourFaceInterviewQuestion->customWordMessage); return TVProgramInterviews_Text_InYourFaceInterview_Question4; } @@ -2006,7 +2006,7 @@ static int TVSegment_LoadMessage_BattleFrontierFrontlineNews_Multi(FieldSystem * String_CopyChars(v2, battleFrontierFrontlineNewsMulti->unk_00.unk_06); StringTemplate_SetString(template, 1, v2, battleFrontierFrontlineNewsMulti->unk_00.unk_02, 0, battleFrontierFrontlineNewsMulti->unk_00.language); String_Free(v2); - StringTemplate_SetCustomMessageWord(template, 2, battleFrontierFrontlineNewsMulti->customWordMessage); + StringTemplate_SetEasyChatWord(template, 2, battleFrontierFrontlineNewsMulti->customWordMessage); switch (battleFrontierFrontlineNewsMulti->unk_00.unk_01) { case 1: @@ -2191,7 +2191,7 @@ static int TVSegment_LoadMessage_YourTownsBestThree(FieldSystem *fieldSystem, St return TVProgramSinnohNow_Text_YourTownsBestThree_CelesticTown; } - if (mapID == MAP_HEADER_JUBILIFE_CITY || (mapID >= MAP_HEADER_POKETCH_CO_1F && mapID <= MAP_HEADER_JUBILIFE_CITY_UNKNOWN_HOUSE_4)) { + if (mapID == MAP_HEADER_JUBILIFE_CITY || (mapID >= MAP_HEADER_POKETCH_CO_1F && mapID <= MAP_HEADER_UNUSED_JUBILIFE_CITY_HOUSE_4)) { return TVProgramSinnohNow_Text_YourTownsBestThree_JubilifeCity; } @@ -2203,7 +2203,7 @@ static int TVSegment_LoadMessage_YourTownsBestThree(FieldSystem *fieldSystem, St return TVProgramSinnohNow_Text_YourTownsBestThree_OreburghCity; } - if (mapID == MAP_HEADER_ETERNA_CITY || (mapID >= MAP_HEADER_CYCLE_SHOP && mapID <= MAP_HEADER_ETERNA_CITY_UNKNOWN_HOUSE)) { + if (mapID == MAP_HEADER_ETERNA_CITY || (mapID >= MAP_HEADER_CYCLE_SHOP && mapID <= MAP_HEADER_UNUSED_ETERNA_CITY_HOUSE)) { return TVProgramSinnohNow_Text_YourTownsBestThree_EternaCity; } @@ -2615,7 +2615,7 @@ static int TVSegment_LoadMessage_PokemonPhotoRating(FieldSystem *fieldSystem, St String_Free(trainerName); word = DressUpPhoto_GetTitleWord(photo); - StringTemplate_SetCustomMessageWord(template, 1, word); + StringTemplate_SetEasyChatWord(template, 1, word); return TVProgramSinnohNow_Text_PokemonPhotoRating; } diff --git a/src/underground/menus.c b/src/underground/menus.c index a7f7cb28a7..259e1de91e 100644 --- a/src/underground/menus.c +++ b/src/underground/menus.c @@ -1339,7 +1339,7 @@ static void UndergroundMenu_GoUpCallback(UndergroundMenu *menu) { UndergroundMenu_EraseCurrentMenu(menu); - if (UndergroundMan_AreCoordinatesInSecretBase(Player_GetXPos(menu->fieldSystem->playerAvatar), Player_GetZPos(menu->fieldSystem->playerAvatar))) { + if (UndergroundMan_AreCoordinatesInSecretBase(PlayerAvatar_GetXPos(menu->fieldSystem->playerAvatar), PlayerAvatar_GetZPos(menu->fieldSystem->playerAvatar))) { UndergroundTextPrinter_PrintText(UndergroundMan_GetCommonTextPrinter(), UndergroundCommon_Text_CantReturnFromSecretBase, FALSE, NULL); menu->state = UNDERGROUND_MENU_STATE_CLOSE_AFTER_TEXT; } else { diff --git a/src/underground/pc.c b/src/underground/pc.c index 10bc29c367..11d735c2f9 100644 --- a/src/underground/pc.c +++ b/src/underground/pc.c @@ -600,8 +600,8 @@ static void UndergroundPC_MoveCamera(BOOL isDecorating, FieldSystem *fieldSystem VecFx32 delta; delta.y = 0; - delta.x = 15 * MAP_OBJECT_TILE_SIZE - Player_GetXPos(fieldSystem->playerAvatar) * MAP_OBJECT_TILE_SIZE; - delta.z = 17 * MAP_OBJECT_TILE_SIZE - Player_GetZPos(fieldSystem->playerAvatar) * MAP_OBJECT_TILE_SIZE; + delta.x = 15 * MAP_OBJECT_TILE_SIZE - PlayerAvatar_GetXPos(fieldSystem->playerAvatar) * MAP_OBJECT_TILE_SIZE; + delta.z = 17 * MAP_OBJECT_TILE_SIZE - PlayerAvatar_GetZPos(fieldSystem->playerAvatar) * MAP_OBJECT_TILE_SIZE; if (!isDecorating) { delta.x = -delta.x; diff --git a/src/underground/player.c b/src/underground/player.c index 4366f745f4..7484f7f7b0 100644 --- a/src/underground/player.c +++ b/src/underground/player.c @@ -747,7 +747,7 @@ void UndergroundPlayer_MoveToFromSecretBaseClient(int netID, int x, int z, int d playerLocation->dir = dir; if (commPlayerMan->playerAvatar[netID]) { - sub_0205ECE0(commPlayerMan->playerAvatar[netID], x, z, dir); + PlayerAvatar_SetPosDirFromCoords(commPlayerMan->playerAvatar[netID], x, z, dir); } if (!commPlayerMan->isDisabled) { @@ -835,19 +835,19 @@ void UndergroundPlayer_HandleEmoteDisplay(int netID) switch (commPlayerMan->emote[netID]) { case EMOTE_OK: if (commPlayerMan->animManager[netID] == NULL) { - commPlayerMan->animManager[netID] = ov5_021F5488(Player_MapObject(commPlayerMan->playerAvatar[netID])); + commPlayerMan->animManager[netID] = ov5_021F5488(PlayerAvatar_GetMapObject(commPlayerMan->playerAvatar[netID])); } commPlayerMan->emote[netID] = EMOTE_NONE; break; case EMOTE_EXCLAMATION: if (commPlayerMan->animManager[netID] == NULL) { - commPlayerMan->animManager[netID] = ov5_021F52E4(Player_MapObject(commPlayerMan->playerAvatar[netID])); + commPlayerMan->animManager[netID] = ov5_021F52E4(PlayerAvatar_GetMapObject(commPlayerMan->playerAvatar[netID])); } break; case EMOTE_FLAG: if (commPlayerMan->animManager[netID] == NULL) { - commPlayerMan->animManager[netID] = ov5_021F511C(Player_MapObject(commPlayerMan->playerAvatar[netID])); + commPlayerMan->animManager[netID] = ov5_021F511C(PlayerAvatar_GetMapObject(commPlayerMan->playerAvatar[netID])); } break; case EMOTE_NONE: diff --git a/src/underground/secret_bases.c b/src/underground/secret_bases.c index 1f7a96677e..0cefb05b32 100644 --- a/src/underground/secret_bases.c +++ b/src/underground/secret_bases.c @@ -1515,8 +1515,8 @@ static void SecretBases_DrawBaseEntrancesTask(SysTask *unused, void *unused1) return; } - int playerX = Player_GetXPos(secretBasesEnv->fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(secretBasesEnv->fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(secretBasesEnv->fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(secretBasesEnv->fieldSystem->playerAvatar); if (UndergroundMan_AreCoordinatesInSecretBase(playerX, playerZ)) { return; @@ -1803,7 +1803,7 @@ static void SecretBases_DiggerDrillTask(SysTask *sysTask, void *data) UndergroundTextPrinter_SetUndergroundTrapName(UndergroundMan_GetCommonTextPrinter(), TRAP_DIGGER_DRILL); Sound_PlayEffect(SEQ_SE_DP_DORIRU); - ov5_021F58FC(Player_MapObject(fieldSystem->playerAvatar), 0, 0, 0); + ov5_021F58FC(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar), 0, 0, 0); UndergroundTextPrinter_PrintText(UndergroundMan_GetCommonTextPrinter(), UndergroundCommon_Text_ItemWasUsed, FALSE, NULL); ctx->state = DRILL_STATE_WAIT; @@ -1821,7 +1821,7 @@ static void SecretBases_DiggerDrillTask(SysTask *sysTask, void *data) case DRILL_STATE_CREATE_ENTRANCE: { int x = CommPlayer_GetXInFrontOfPlayer(CommSys_CurNetId()); int z = CommPlayer_GetZInFrontOfPlayer(CommSys_CurNetId()); - int dir = CommPlayer_GetOppositeDir(PlayerAvatar_GetDir(fieldSystem->playerAvatar)); + int dir = CommPlayer_GetOppositeDir(PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)); UndergroundTextPrinter_PrintText(UndergroundMan_GetCommonTextPrinter(), UndergroundCommon_Text_DiscoveredCavern, FALSE, NULL); SecretBases_SetBaseEntrancePropLocation(x, z, dir, NETID_CURRENT_PLAYER_BASE); diff --git a/src/underground/top_screen.c b/src/underground/top_screen.c index 8189ca2047..8653304423 100644 --- a/src/underground/top_screen.c +++ b/src/underground/top_screen.c @@ -269,8 +269,8 @@ static void UndergroundMap_FetchPlayerPositions(PlayerAvatar *const playerAvatar if (CommSys_IsInitialized()) { if (!CommSys_IsPlayerConnected(CommSys_CurNetId())) { - playerCoords[0].x = Player_GetXPos(playerAvatar); - playerCoords[0].z = Player_GetZPos(playerAvatar); + playerCoords[0].x = PlayerAvatar_GetXPos(playerAvatar); + playerCoords[0].z = PlayerAvatar_GetZPos(playerAvatar); } else { int xTemp = playerCoords[0].x; int zTemp = playerCoords[0].z; diff --git a/src/underground/traps.c b/src/underground/traps.c index 475bf8ef6a..25dcd1df20 100644 --- a/src/underground/traps.c +++ b/src/underground/traps.c @@ -1947,7 +1947,7 @@ static void Traps_StepBackFromTool(int dir) { int oppositeDir = CommPlayer_GetOppositeDir(dir); - Player_SetDir(trapsEnv->fieldSystem->playerAvatar, oppositeDir); + PlayerAvatar_TryFace(trapsEnv->fieldSystem->playerAvatar, oppositeDir); int x = trapsEnv->triggeredTraps[CommSys_CurNetId()].trap.x; int z = trapsEnv->triggeredTraps[CommSys_CurNetId()].trap.z; @@ -1959,8 +1959,8 @@ static void Traps_StepBackFromTool(int dir) static BOOL Traps_CheckPlayerPosRelativeToTrap(int dir, enum TrapRelativePosition position) { - int playerX = Player_GetXPos(trapsEnv->fieldSystem->playerAvatar); - int playerZ = Player_GetZPos(trapsEnv->fieldSystem->playerAvatar); + int playerX = PlayerAvatar_GetXPos(trapsEnv->fieldSystem->playerAvatar); + int playerZ = PlayerAvatar_GetZPos(trapsEnv->fieldSystem->playerAvatar); int oppositeDir = CommPlayer_GetOppositeDir(dir); int trapX = trapsEnv->triggeredTraps[CommSys_CurNetId()].trap.x; int trapZ = trapsEnv->triggeredTraps[CommSys_CurNetId()].trap.z; @@ -2140,8 +2140,8 @@ static void Traps_HurlTrapRightEffectClient(int netID, BOOL isTool, int toolInit static int Traps_NotifyTrapTriggered(void) { - int x = Player_GetXPos(trapsEnv->fieldSystem->playerAvatar); - int z = Player_GetZPos(trapsEnv->fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(trapsEnv->fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(trapsEnv->fieldSystem->playerAvatar); ov5_021F5634(trapsEnv->fieldSystem, x, 0, z); UndergroundTextPrinter_SetUndergroundTrapNameWithIndex(UndergroundMan_GetCommonTextPrinter(), 0, trapsEnv->triggeredTrapIDClient); @@ -3046,8 +3046,8 @@ static void Traps_HoleTrapClientTask(SysTask *sysTask, void *data) UndergroundTextPrinter_EraseMessageBoxWindow(UndergroundMan_GetCommonTextPrinter()); ctx->state = HOLE_TRAP_STATE_MAIN; - int x = Player_GetXPos(trapsEnv->fieldSystem->playerAvatar); - int z = Player_GetZPos(trapsEnv->fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(trapsEnv->fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(trapsEnv->fieldSystem->playerAvatar); if (!ctx->isPitTrap) { ctx->holeTextureManager = ov5_DrawFloorTexture(trapsEnv->fieldSystem, x, z, 2, FLOOR_TEXTURE_BLACK_CIRCLE); @@ -3059,7 +3059,7 @@ static void Traps_HoleTrapClientTask(SysTask *sysTask, void *data) } break; case HOLE_TRAP_STATE_MAIN: - int dir = PlayerAvatar_GetDir(trapsEnv->fieldSystem->playerAvatar); + int dir = PlayerAvatar_GetFacingDir(trapsEnv->fieldSystem->playerAvatar); if (ctx->lastDir != dir) { Sound_PlayEffect(SEQ_SE_DP_BOX02); @@ -3127,7 +3127,7 @@ static void Traps_StartHoleTrapClientTask(BOOL isPitTrap, BOOL isTool, int toolI ctx->isPitTrap = isPitTrap; ctx->jumpOutOfHoleProgress = 0; ctx->isTool = isTool; - ctx->lastDir = PlayerAvatar_GetDir(trapsEnv->fieldSystem->playerAvatar); + ctx->lastDir = PlayerAvatar_GetFacingDir(trapsEnv->fieldSystem->playerAvatar); ctx->toolInitialDir = toolInitialDir; trapsEnv->currentTrapContext = ctx; @@ -4045,8 +4045,8 @@ static BOOL Traps_ProcessBoulder(BgConfig *unused, RockTrapContext *ctx) switch (ctx->subState) { case ROCK_TRAP_SUBSTATE_DRAW_SHADOW: ctx->timer = 0; - int x = Player_GetXPos(trapsEnv->fieldSystem->playerAvatar); - int z = Player_GetZPos(trapsEnv->fieldSystem->playerAvatar); + int x = PlayerAvatar_GetXPos(trapsEnv->fieldSystem->playerAvatar); + int z = PlayerAvatar_GetZPos(trapsEnv->fieldSystem->playerAvatar); ctx->shadowManager = ov5_DrawGrowingFloorTexture(trapsEnv->fieldSystem, x, z, 5, FLOOR_TEXTURE_BLACK_CIRCLE); ctx->subState = ROCK_TRAP_SUBSTATE_INIT_BOULDER_FALL; Sound_PlayEffect(SEQ_SE_DP_FW466); diff --git a/src/underground_map_transition.c b/src/underground_map_transition.c index 64916415bf..28cc6bd717 100644 --- a/src/underground_map_transition.c +++ b/src/underground_map_transition.c @@ -203,7 +203,7 @@ static void UndergroundMapTransition_EnterStartTask(SysTask *sysTask, void *data switch (ctx->state) { case ENTER_START_STATE_INIT: - MapObject_SetPauseMovementOff(Player_MapObject(ctx->fieldSystem->playerAvatar)); + MapObject_SetPauseMovementOff(PlayerAvatar_GetMapObject(ctx->fieldSystem->playerAvatar)); PlayerAvatar_SetVisible(ctx->fieldSystem->playerAvatar, FALSE); ctx->state++; break; diff --git a/src/unk_02014A84.c b/src/unk_02014A84.c deleted file mode 100644 index 7ed32451e2..0000000000 --- a/src/unk_02014A84.c +++ /dev/null @@ -1,224 +0,0 @@ -#include "unk_02014A84.h" - -#include -#include - -#include "constants/charcode.h" - -#include "struct_defs/sentence.h" - -#include "applications/easy_chat/defs.h" - -#include "charcode.h" -#include "message.h" -#include "message_util.h" -#include "string_gf.h" -#include "string_template.h" -#include "unk_02014D38.h" - -static u32 Sentence_CountSelectableWords(u32 type, u32 id); - -static const u16 Unk_020E5498[] = { - 0x1C0, - 0x1C2, - 0x1BE, - 0x1BF, - 0x1C1 -}; - -void Sentence_Init(Sentence *sentence) -{ - sentence->type = 0xffff; - - for (int i = 0; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} - -void Sentence_InitWithType(Sentence *sentence, u32 type) -{ - sentence->type = type; - sentence->id = 0; - - for (int i = 0; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} - -void sub_02014AB4(Sentence *sentence) -{ - Sentence_InitWithType(sentence, 4); - sentence->id = 5; -} - -void sub_02014AC4(Sentence *sentence, int param1) -{ - static const struct { - u8 unk_00; - u8 unk_01; - s16 unk_02; - u16 unk_04; - s16 unk_06; - u16 unk_08; - } v0[] = { - { 0x0, 0x0, 0x1B7, 0x7, -1, 0x0 }, - { 0x1, 0x0, 0x1B7, 0x21, -1, 0x0 }, - { 0x2, 0x0, 0x1BB, 0xA, -1, 0x0 }, - { 0x1, 0x4, 0x1B7, 0x1, -1, 0x0 } - }; - - GF_ASSERT(param1 < NELEMS(v0)); - - if (param1 < NELEMS(v0)) { - Sentence_InitWithType(sentence, v0[param1].unk_00); - sentence->id = v0[param1].unk_01; - - if (v0[param1].unk_02 != -1) { - sentence->words[0] = sub_02014DFC( - v0[param1].unk_02, v0[param1].unk_04); - } - - if (v0[param1].unk_06 != -1) { - sentence->words[1] = sub_02014DFC( - v0[param1].unk_06, v0[param1].unk_08); - } - } -} - -String *Sentence_AsString(const Sentence *sentence, enum HeapID heapID) -{ - StringTemplate *template = StringTemplate_Default(heapID); - - for (int i = 0; i < 2; i++) { - if (sentence->words[i] != WORD_NONE) { - StringTemplate_SetCustomMessageWord(template, i, sentence->words[i]); - } else { - break; - } - } - - MessageLoader *loader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[sentence->type], heapID); - String *string = MessageUtil_ExpandedString(template, loader, sentence->id, heapID); - - MessageLoader_Free(loader); - StringTemplate_Free(template); - - return string; -} - -String *Sentence_GetTemplateString(const Sentence *sentence, u32 heapID) -{ - return MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[sentence->type], sentence->id, heapID); -} - -BOOL Sentence_IsValid(const Sentence *sentence) -{ - return sentence->type != 0xffff; -} - -BOOL Sentence_IsComplete(const Sentence *sentence) -{ - u32 count = Sentence_CountSelectableWords(sentence->type, sentence->id); - - for (u32 i = 0; i < count; i++) { - if (sentence->words[i] == WORD_NONE) { - return FALSE; - } - } - - return TRUE; -} - -static u32 Sentence_CountSelectableWords(u32 type, u32 id) -{ - GF_ASSERT(type < 5); - GF_ASSERT(id < sub_02014CD4(type)); - - String *string = MessageBank_GetNewStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, Unk_020E5498[type], id, HEAP_ID_SYSTEM); - const charcode_t *iter = String_GetData(string); - u32 count = 0; - - while (*iter != CHAR_EOS) { - if (*iter == CHAR_FORMAT_ARG) { - if (CharCode_IsFormatArg(iter)) { - count++; - } - - iter = CharCode_SkipFormatArg(iter); - } else { - iter++; - } - } - - String_Free(string); - return count; -} - -u16 Sentence_GetWord(const Sentence *sentence, int slot) -{ - return sentence->words[slot]; -} - -u32 Sentence_GetType(const Sentence *sentence) -{ - return sentence->type; -} - -u32 Sentence_GetID(const Sentence *sentence) -{ - return sentence->id; -} - -BOOL sub_02014C88(const Sentence *param0, const Sentence *param1) -{ - int v0; - - if ((param0->type != param1->type) || (param0->id != param1->id)) { - return 0; - } - - for (v0 = 0; v0 < 2; v0++) { - if (param0->words[v0] != param1->words[v0]) { - return 0; - } - } - - return 1; -} - -void Sentence_Copy(Sentence *dest, const Sentence *src) -{ - *dest = *src; -} - -u32 sub_02014CD4(u32 param0) -{ - if (param0 < NELEMS(Unk_020E5498)) { - return 20; - } - - return 0; -} - -void sub_02014CE0(Sentence *sentence, u32 param1, u32 param2) -{ - GF_ASSERT(param1 < 5); - - sentence->type = param1; - sentence->id = param2; -} - -void Sentence_SetWord(Sentence *sentence, u32 index, u16 word) -{ - GF_ASSERT(index < 2); - sentence->words[index] = word; -} - -void Sentence_ClearUnusedWords(Sentence *sentence) -{ - u32 count = Sentence_CountSelectableWords(sentence->type, sentence->id); - - for (u32 i = count; i < 2; i++) { - sentence->words[i] = WORD_NONE; - } -} diff --git a/src/unk_02014D38.c b/src/unk_02014D38.c deleted file mode 100644 index 8bf6e7fde6..0000000000 --- a/src/unk_02014D38.c +++ /dev/null @@ -1,395 +0,0 @@ -#include "unk_02014D38.h" - -#include -#include - -#include "constants/versions.h" - -#include "graphics.h" -#include "heap.h" -#include "math_util.h" -#include "message.h" -#include "savedata.h" -#include "string_gf.h" - -static const u16 Unk_020E5522[] = { - 0x1F0, - 0x1D4, - 0x12, - 0x7C, - 0x26, - 0x26, - 0x6B, - 0x68, - 0x2F, - 0x20, - 0x17 -}; - -static const u16 Unk_020E550C[] = { - 0x19C, - 0x288, - 0x270, - 0x263, - 0x1B7, - 0x1B8, - 0x1B9, - 0x1BA, - 0x1BB, - 0x1BC, - 0x1BD -}; - -static const u16 Unk_020E54D8[] = { - 0x441, - 0x599 -}; - -static const u16 Unk_020E54CC[] = { - 0x4C0, - 0x4F0 -}; - -static const u16 Unk_020E54F4[] = { - 0x4A7, - 0x4E1 -}; - -static const u16 Unk_020E54F8[] = { - 0x479, - 0x498, - 0x49B, - 0x49C -}; - -static const u16 Unk_020E54EC[] = { - 0x48F, - 0x497 -}; - -static const u16 Unk_020E54E8[] = { - 0x4FC, - 0x596 -}; - -static const u16 Unk_020E54D4[] = { - 0x4BB, - 0x500 -}; - -static const u16 Unk_020E54D0[] = { - 0x24E, - 0x3D2 -}; - -static const u16 Unk_020E54DC[] = { - 0x42C, - 0x59D -}; - -static const u16 Unk_020E54F0[] = { - 0x4B0, - 0x4FF -}; - -static const u16 Unk_020E54E4[] = { - 0x4B6, - 0x505 -}; - -static const u16 Unk_020E54E0[] = { - 0x47A, - 0x48D -}; - -static const struct { - const u16 *unk_00; - int unk_04; -} Unk_020E5538[] = { - { Unk_020E54D8, 0x2 }, - { Unk_020E54CC, 0x2 }, - { Unk_020E54F4, 0x2 }, - { Unk_020E54F8, 0x4 }, - { Unk_020E54EC, 0x2 }, - { Unk_020E54E8, 0x2 }, - { Unk_020E54D4, 0x2 }, - { Unk_020E54D0, 0x2 }, - { Unk_020E54DC, 0x2 }, - { Unk_020E54F0, 0x2 }, - { Unk_020E54E4, 0x2 }, - { Unk_020E54E0, 0x2 } -}; - -typedef struct UnkStruct_02014D38_t { - enum HeapID heapID; - MessageLoader *unk_04[11]; -} UnkStruct_02014D38; - -typedef struct UnkStruct_02014EC4_t { - u32 unk_00; - u32 unk_04; -} UnkStruct_02014EC4; - -typedef struct UnkStruct_02014FB0_t { - u32 unk_00; - u32 *unk_04; -} UnkStruct_02014FB0; - -void include_unk_020E5538(void); -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2); - -void include_unk_020E5538(void) -{ - Unk_020E5538[0]; -} - -UnkStruct_02014D38 *sub_02014D38(enum HeapID heapID) -{ - int v0; - UnkStruct_02014D38 *v1 = Heap_Alloc(heapID, sizeof(UnkStruct_02014D38)); - - for (v0 = 0; v0 < 11; v0++) { - v1->heapID = heapID; - v1->unk_04[v0] = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, Unk_020E550C[v0], heapID); - } - - return v1; -} - -void sub_02014D70(UnkStruct_02014D38 *param0) -{ - int v0; - - for (v0 = 0; v0 < 11; v0++) { - MessageLoader_Free(param0->unk_04[v0]); - } - - Heap_Free(param0); -} - -void sub_02014D90(UnkStruct_02014D38 *param0, u16 param1, String *param2) -{ - u32 v0, v1; - - sub_02014E4C(param1, &v0, &v1); - MessageLoader_GetString(param0->unk_04[v0], v1, param2); -} - -void sub_02014DB8(u16 param0, String *param1) -{ - if (param0 != 0xffff) { - u32 v0, v1; - - sub_02014E4C(param0, &v0, &v1); - v0 = Unk_020E550C[v0]; - MessageBank_GetStringFromNARC(NARC_INDEX_MSGDATA__PL_MSG, v0, v1, 0, param1); - } else { - String_Clear(param1); - } -} - -u16 sub_02014DFC(u32 param0, u32 param1) -{ - u32 v0; - - for (v0 = 0; v0 < NELEMS(Unk_020E550C); v0++) { - if (Unk_020E550C[v0] == param0) { - u16 v1, v2; - - for (v2 = 0, v1 = 0; v2 < v0; v2++) { - v1 += Unk_020E5522[v2]; - } - - return v1 + param1; - } - } - - return 0xffff; -} - -BOOL sub_02014E4C(u16 param0, u32 *param1, u32 *param2) -{ - u32 v0, v1, v2; - - v2 = param0 & 0xfff; - v1 = 0; - - for (v0 = 0; v0 < 11; v0++) { - v1 += Unk_020E5522[v0]; - - if (v2 < v1) { - *param1 = v0; - *param2 = (v2 - (v1 - Unk_020E5522[v0])); - return 1; - } - } - - return 0; -} - -u32 Sentence_SaveSize(void) -{ - return sizeof(UnkStruct_02014EC4); -} - -void SentenceSaveData_Init(void *param0) -{ - static const struct { - u8 language; - u8 unk_01; - } v0[] = { - { LANGUAGE_JAPANESE, 0x0 }, - { LANGUAGE_ENGLISH, 0x1 }, - { LANGUAGE_FRENCH, 0x2 }, - { LANGUAGE_ITALIAN, 0x3 }, - { LANGUAGE_GERMAN, 0x4 }, - { LANGUAGE_SPANISH, 0x5 } - }; - UnkStruct_02014EC4 *v1 = param0; - int i; - - v1->unk_00 = 0; - v1->unk_04 = 0; - - for (i = 0; i < NELEMS(v0); i++) { - if (GAME_LANGUAGE == v0[i].language) { - sub_02014F98(v1, v0[i].unk_01); - break; - } - } - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); -} - -UnkStruct_02014EC4 *sub_02014EC4(SaveData *saveData) -{ - SaveData_Checksum(SAVE_TABLE_ENTRY_SENTENCE); - return SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_SENTENCE); -} - -BOOL sub_02014ED8(const UnkStruct_02014EC4 *param0, u32 param1) -{ - return (param0->unk_04 >> param1) & 1; -} - -u32 sub_02014EE4(UnkStruct_02014EC4 *param0) -{ - u32 v0, v1; - - for (v0 = 0, v1 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - v1++; - } - } - - if (v1) { - int v2 = LCRNG_Next() % v1; - - for (v0 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - if (v2 == 0) { - param0->unk_04 |= (1 << v0); - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); - - return v0; - } else { - v2--; - } - } - } - } - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); - - return 32; -} - -BOOL sub_02014F48(UnkStruct_02014EC4 *param0) -{ - u32 v0; - - for (v0 = 0; v0 < 32; v0++) { - if (((param0->unk_04 >> v0) & 1) == 0) { - return 0; - } - } - - return 1; -} - -u16 sub_02014F64(u32 param0) -{ - int v0; - u16 v1 = 0; - - for (v0 = 0; v0 < 9; v0++) { - v1 += Unk_020E5522[v0]; - } - - return v1 + param0; -} - -BOOL sub_02014F8C(const UnkStruct_02014EC4 *param0, int param1) -{ - return (param0->unk_00 >> param1) & 1; -} - -void sub_02014F98(UnkStruct_02014EC4 *param0, int param1) -{ - param0->unk_00 |= (1 << param1); - - SaveData_SetChecksum(SAVE_TABLE_ENTRY_SENTENCE); -} - -UnkStruct_02014FB0 *sub_02014FB0(enum HeapID heapID) -{ - UnkStruct_02014FB0 *v0; - u32 fileSize; - - v0 = Heap_Alloc(heapID, sizeof(UnkStruct_02014FB0)); - memset(v0, 0, sizeof(UnkStruct_02014FB0)); - - v0->unk_04 = LoadMemberFromNARC_OutFileSize(NARC_INDEX_RESOURCE__ENG__PMS_AIKOTOBA__PMS_AIKOTOBA, 0, 0, heapID, 0, &fileSize); - v0->unk_00 = fileSize / sizeof(u32); - - return v0; -} - -void sub_02014FF0(UnkStruct_02014FB0 *param0) -{ - Heap_Free(param0->unk_04); - - Heap_Free(param0); -} - -u32 sub_02015004(const UnkStruct_02014FB0 *param0) -{ - return param0->unk_00; -} - -u16 sub_02015008(const UnkStruct_02014FB0 *param0, u32 param1) -{ - GF_ASSERT(param0); - - if (param0->unk_00 <= param1) { - return 0xffff; - } - - return param0->unk_04[param1]; -} - -s16 sub_02015030(const UnkStruct_02014FB0 *param0, u16 param1) -{ - int v0; - - GF_ASSERT(param0); - - for (v0 = 0; v0 < param0->unk_00; v0++) { - if (param0->unk_04[v0] == param1) { - return v0; - } - } - - return -1; -} diff --git a/src/unk_020298BC.c b/src/unk_020298BC.c index d5aee56f3f..a59c40068c 100644 --- a/src/unk_020298BC.c +++ b/src/unk_020298BC.c @@ -9,7 +9,6 @@ #include "generated/pokemon_contest_types.h" #include "struct_defs/image_clips.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_020298D8.h" #include "overlay022/ov22_02259098.h" @@ -17,13 +16,13 @@ #include "overlay061/struct_ov61_0222AE80.h" #include "overlay061/struct_ov61_0222AE80_sub2.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "inlines.h" #include "pokemon.h" #include "savedata.h" #include "software_sprite.h" #include "string_gf.h" -#include "unk_02014A84.h" #define PHOTO_EMPTY_MAGIC (0x1234) // Photo is initialized but without proper data. #define PHOTO_FULL_MAGIC (0x2345) // Photo has data written to it @@ -542,8 +541,8 @@ void DressUpPhoto_SetTitle(DressUpPhoto *photo, u16 word) { GF_ASSERT(DressUpPhoto_IsValid(photo)); - Sentence_Init(&photo->title); - Sentence_SetWord(&photo->title, 0, word); + EasyChatSentence_Init(&photo->title); + EasyChatSentence_SetWord(&photo->title, 0, word); } void DressUpPhoto_Copy(DressUpPhoto *dest, const DressUpPhoto *src) @@ -607,7 +606,7 @@ u8 sub_0202A1DC(const DressUpPhoto *photo) u16 DressUpPhoto_GetTitleWord(const DressUpPhoto *photo) { - return Sentence_GetWord(&photo->title, 0); + return EasyChatSentence_GetWord(&photo->title, 0); } u8 DressUpPhoto_GetLanguage(const DressUpPhoto *photo) @@ -978,7 +977,7 @@ void sub_0202A824(const UnkStruct_ov61_0222AE80 *param0, DressUpPhoto *photo) photo->photoMon.form = param0->unk_04.form; photo->unk_3C = param0->unk_24; - photo->title = *((Sentence *)(¶m0->title)); + photo->title = *((EasyChatSentence *)(¶m0->title)); for (i = 0; i < (11 - 1); i++) { photo->accessories[i] = *((PhotoAccessory *)(¶m0->unk_30[i])); diff --git a/src/unk_0202D05C.c b/src/unk_0202D05C.c index 03b3c3aa5d..33a59f67e8 100644 --- a/src/unk_0202D05C.c +++ b/src/unk_0202D05C.c @@ -6,7 +6,6 @@ #include "constants/battle_tower.h" #include "struct_defs/battle_frontier.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0202D060.h" #include "struct_defs/struct_0202D080.h" #include "struct_defs/struct_0202D314.h" @@ -20,11 +19,11 @@ #include "overlay096/struct_ov96_0223B450_sub1.h" #include "overlay096/struct_ov96_0223B450_sub2.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "inlines.h" #include "message.h" #include "savedata.h" -#include "unk_02014A84.h" int sub_0202D05C(void) { @@ -44,10 +43,10 @@ void sub_0202D06C(UnkStruct_0202D750 *param0) void sub_0202D080(UnkStruct_0202D080 *param0) { - sub_02014AC4(¶m0->unk_00[0], 0); - sub_02014AC4(¶m0->unk_00[1], 1); - sub_02014AC4(¶m0->unk_00[2], 2); - sub_02014AC4(¶m0->unk_00[3], 3); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[0], EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[1], EASY_CHAT_SENTENCE_TYPE_WIN); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[2], EASY_CHAT_SENTENCE_TYPE_LOSS); + EasyChatSentence_SetDefaultFrontierFields(¶m0->unk_00[3], FRONTIER_EASY_CHAT_SENTENCE_TYPE_NO_1); } void sub_0202D0AC(UnkStruct_0202D764 *param0) @@ -371,13 +370,13 @@ u32 sub_0202D474(UnkStruct_0202D750 *param0) return param0->unk_04; } -void sub_0202D478(SaveData *saveData, int param1, Sentence *param2) +void sub_0202D478(SaveData *saveData, int param1, EasyChatSentence *param2) { BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); - Sentence_Copy(&(frontier->unk_950.unk_168.unk_00[param1]), param2); + EasyChatSentence_Copy(&(frontier->unk_950.unk_168.unk_00[param1]), param2); } -Sentence *sub_0202D498(SaveData *saveData, int param1) +EasyChatSentence *sub_0202D498(SaveData *saveData, int param1) { BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); @@ -487,28 +486,28 @@ void sub_0202D628(UnkStruct_0202D764 *param0, UnkStruct_02049A68 *param1) param1->unk_04 = param0->unk_100; } -void sub_0202D63C(UnkStruct_0202D764 *param0, FrontierDataDTO *param1, const u8 param2) +void sub_0202D63C(UnkStruct_0202D764 *param0, FrontierDataDTO *dto, const u8 opponentNum) { - FrontierTrainerDataDTO *v0 = &(param1->trDataDTO); - FrontierPokemonDataDTO *v1 = param1->monDataDTO; - UnkStruct_0202D63C *v2 = &(param0->unk_104[param2]); + FrontierTrainerDataDTO *trDataDTO = &(dto->trDataDTO); + FrontierPokemonDataDTO *monDataDTO = dto->monDataDTO; + UnkStruct_0202D63C *v2 = &(param0->unk_104[opponentNum]); - v0->trainerID = 10000; - v0->trainerType = v2->unk_C9; + trDataDTO->trainerID = 10000; + trDataDTO->trainerType = v2->trainerType; if (v2->unk_C8_val1_unk_00_0) { - MessageLoader *v3 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0022, HEAP_ID_FIELD2); + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0022, HEAP_ID_FIELD2); - MessageLoader_Get(v3, 22 + v2->unk_C8_val1_unk_00_1, v0->trainerName); - MessageLoader_Free(v3); + MessageLoader_Get(msgLoader, 22 + v2->unk_C8_val1_unk_00_1, trDataDTO->trainerName); + MessageLoader_Free(msgLoader); } else { - MI_CpuCopy8(v2->unk_A8, v0->trainerName, 16); + MI_CpuCopy8(v2->trainerName, trDataDTO->trainerName, 16); } - MI_CpuCopy8(v2->unk_CA, v0->unk_18, 8); - MI_CpuCopy8(v2->unk_D2, v0->unk_20, 8); - MI_CpuCopy8(v2->unk_DA, v0->unk_28, 8); - MI_CpuCopy8(v2->unk_00, v1, sizeof(FrontierPokemonDataDTO) * 3); + MI_CpuCopy8(v2->introMsg, trDataDTO->introMsg, 8); + MI_CpuCopy8(v2->winMsg, trDataDTO->winMsg, 8); + MI_CpuCopy8(v2->loseMsg, trDataDTO->loseMsg, 8); + MI_CpuCopy8(v2->monDataDTO, monDataDTO, sizeof(FrontierPokemonDataDTO) * 3); } void sub_0202D6DC(UnkStruct_0202D764 *param0, UnkStruct_ov96_0223B450_sub2 *param1, u8 param2, u8 param3) diff --git a/src/unk_02030108.c b/src/unk_02030108.c deleted file mode 100644 index 133554cbc0..0000000000 --- a/src/unk_02030108.c +++ /dev/null @@ -1,183 +0,0 @@ -#include "unk_02030108.h" - -#include -#include - -#include "struct_defs/battle_frontier.h" -#include "struct_defs/struct_02030114.h" -#include "struct_defs/struct_0203026C.h" - -#include "savedata.h" - -void sub_02030108(UnkStruct_02030114 *param0); -BOOL sub_02030124(UnkStruct_02030114 *param0); -void sub_0203012C(UnkStruct_02030114 *param0, BOOL param1); -void sub_02030140(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, const void *param4); -u32 sub_02030198(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, void *param4); -void sub_02030204(u8 param0, u8 *param1, u8 param2); -void sub_02030244(u8 *param0); -void sub_02030260(UnkStruct_0203026C *param0); -void sub_02030280(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, const void *param4); -u32 sub_020302B4(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, void *param4); - -void sub_02030108(UnkStruct_02030114 *param0) -{ - MI_CpuClear8(param0, sizeof(UnkStruct_02030114)); - return; -} - -UnkStruct_02030114 *sub_02030114(SaveData *saveData) -{ - BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); - return &frontier->unk_8E0_val3; -} - -BOOL sub_02030124(UnkStruct_02030114 *param0) -{ - return param0->unk_00_3; -} - -void sub_0203012C(UnkStruct_02030114 *param0, BOOL param1) -{ - param0->unk_00_3 = param1; - return; -} - -void sub_02030140(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, const void *param4) -{ - u32 *v0 = (u32 *)param4; - u16 *v1 = (u16 *)param4; - u8 *v2 = (u8 *)param4; - - switch (param1) { - case 0: - param0->unk_00_0 = v2[0]; - break; - case 1: - param0->unk_01 = v2[0]; - break; - case 2: - param0->unk_04[param2] = v1[0]; - break; - case 3: - param0->unk_02[param2] = v2[0]; - break; - case 4: - param0->unk_2C[param2] = v1[0]; - break; - default: - GF_ASSERT(FALSE); - break; - } - - return; -} - -u32 sub_02030198(UnkStruct_02030114 *param0, u8 param1, u8 param2, u8 param3, void *param4) -{ - switch (param1) { - case 0: - return (u32)param0->unk_00_0; - case 1: - return (u32)param0->unk_01; - case 2: - return (u32)param0->unk_04[param2]; - case 3: - return param0->unk_02[param2]; - case 4: - return param0->unk_2C[param2]; - default: - GF_ASSERT(FALSE); - break; - } - - return 0; -} - -u8 BattleHall_GetRankOfType(u8 idx, u8 *typeRanks) -{ - u8 byte = idx / 2; - u8 nybble = idx % 2; - u8 rank = (typeRanks[byte] >> (4 * nybble)) & 0xf; - - return rank; -} - -void sub_02030204(u8 param0, u8 *param1, u8 param2) -{ - u8 v0; - u8 v1; - u8 v2; - - v0 = (param0 / 2); - v1 = (param0 % 2); - - if (v1 == 0) { - param1[v0] = param1[v0] & 0xf0; - } else { - param1[v0] = param1[v0] & 0xf; - } - - v2 = (param2 << (4 * v1)); - param1[v0] |= v2; - - return; -} - -void sub_02030244(u8 *param0) -{ - int v0; - - for (v0 = 0; v0 < 18; v0++) { - sub_02030204(v0, param0, 0); - } - - return; -} - -void sub_02030260(UnkStruct_0203026C *param0) -{ - MI_CpuClear8(param0, sizeof(UnkStruct_0203026C)); - return; -} - -UnkStruct_0203026C *sub_0203026C(SaveData *saveData) -{ - BattleFrontier *frontier = SaveData_SaveTable(saveData, SAVE_TABLE_ENTRY_FRONTIER); - return &frontier->unk_1618.unk_00; -} - -void sub_02030280(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, const void *param4) -{ - u32 *v0 = (u32 *)param4; - u16 *v1 = (u16 *)param4; - u8 *v2 = (u8 *)param4; - - switch (param1) { - case 5: - if (v2[0] >= 1) { - param0->unk_00 |= (1 << param2); - } else { - param0->unk_00 &= (0xff ^ (1 << param2)); - } - break; - default: - GF_ASSERT(FALSE); - break; - } - - return; -} - -u32 sub_020302B4(UnkStruct_0203026C *param0, u8 param1, u8 param2, u8 param3, void *param4) -{ - switch (param1) { - case 5: - return (u32)((param0->unk_00 >> param2) & 0x1); - default: - GF_ASSERT(FALSE); - break; - } - - return 0; -} diff --git a/src/unk_02030A80.c b/src/unk_02030A80.c index ad24832a9c..a24edd4de1 100644 --- a/src/unk_02030A80.c +++ b/src/unk_02030A80.c @@ -3,13 +3,16 @@ #include #include -#include "struct_defs/sentence.h" +#include "generated/text_banks.h" + #include "struct_defs/struct_0202F298_sub1.h" #include "struct_defs/struct_02030A80.h" #include "struct_defs/wi_fi_history.h" #include "appearance.h" #include "charcode_util.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "heap.h" #include "pokemon.h" #include "save_player.h" @@ -19,12 +22,12 @@ #include "string_gf.h" #include "system_data.h" #include "trainer_info.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "unk_020996D0.h" #include "wifi_history_save_data.h" #include "res/text/bank/country_names.h" +#include "res/text/bank/greetings.h" +#include "res/text/bank/union_room_sentences.h" UnkStruct_02030A80 *sub_02030A80(enum HeapID heapID) { @@ -143,7 +146,7 @@ int sub_02030C08(const UnkStruct_02030A80 *param0) return param0->region; } -String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum HeapID heapID) +String *sub_02030C28(const UnkStruct_02030A80 *param0, EasyChatSentence *param1, enum HeapID heapID) { int v0 = 0; @@ -157,16 +160,16 @@ String *sub_02030C28(const UnkStruct_02030A80 *param0, Sentence *param1, enum He } else { u32 v1, v2; - if (((param1->words[0] != 0xffff) && (sub_02014E4C(param1->words[0], &v1, &v2) == 0)) || ((param1->words[1] != 0xffff) && (sub_02014E4C(param1->words[1], &v1, &v2) == 0))) { + if (((param1->words[0] != WORD_NONE) && (EasyChatWord_GetLoaderIndexAndEntry(param1->words[0], &v1, &v2) == 0)) || ((param1->words[1] != WORD_NONE) && (EasyChatWord_GetLoaderIndexAndEntry(param1->words[1], &v1, &v2) == 0))) { v0++; } } if (v0 > 0) { - Sentence_InitWithType(param1, 4); - param1->id = 0; - param1->words[0] = sub_02014DFC(441, 99); - param1->words[1] = 0xffff; + EasyChatSentence_InitWithType(param1, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); + param1->id = UnionRoomSentences_Text_BlankHello; + param1->words[0] = EasyChatWord_FromBankAndEntry(TEXT_BANK_GREETINGS, Greetings_Text_Regards); + param1->words[1] = WORD_NONE; } return NULL; diff --git a/src/unk_02033200.c b/src/unk_02033200.c index 7f7b2856e6..7d6defcf97 100644 --- a/src/unk_02033200.c +++ b/src/unk_02033200.c @@ -5,7 +5,6 @@ #include "constants/heap.h" #include "constants/net.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_02034168.h" @@ -13,10 +12,10 @@ #include "comm_manager.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" #include "heap.h" #include "system.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0203266C.h" #include "wireless_manager.h" @@ -27,7 +26,7 @@ typedef struct { u8 unk_1498[8][6]; u16 unk_14C8[16]; void *unk_14E8; - Sentence unk_14EC; + EasyChatSentence unk_14EC; int unk_14F4; u8 unk_14F8; u8 unk_14F9; @@ -88,7 +87,7 @@ void CommServerClient_Init(TrainerInfo *trainerInfo, BOOL param1) sCommServerClient->unk_1504 = 0x333; sCommServerClient->personalTrainerInfo = trainerInfo; - Sentence_Init((Sentence *)&sCommServerClient->unk_14EC); + EasyChatSentence_Init((EasyChatSentence *)&sCommServerClient->unk_14EC); sub_020334DC(param1); } @@ -591,7 +590,7 @@ static void sub_02033AA8(void) v2->unk_04 = CommManager_GetCommType(); v2->unk_05 = CommManager_GetContestRegulation(); - MI_CpuCopy8(&sCommServerClient->unk_14EC, &v2->unk_08, sizeof(Sentence)); + MI_CpuCopy8(&sCommServerClient->unk_14EC, &v2->unk_08, sizeof(EasyChatSentence)); v2->unk_54 = WirelessManager_GetPauseConnection(); } else { @@ -903,9 +902,9 @@ void sub_0203408C(void) } } -void sub_020340A8(Sentence *param0) +void sub_020340A8(EasyChatSentence *param0) { - MI_CpuCopy8(param0, &sCommServerClient->unk_14EC, sizeof(Sentence)); + MI_CpuCopy8(param0, &sCommServerClient->unk_14EC, sizeof(EasyChatSentence)); } void sub_020340C4(void *param0) diff --git a/src/unk_02038FFC.c b/src/unk_02038FFC.c index 3b2502b102..7c9dc4ba43 100644 --- a/src/unk_02038FFC.c +++ b/src/unk_02038FFC.c @@ -51,9 +51,5 @@ BOOL WiFiList_HasValidLogin(SaveData *saveData) WiFiList *wiFiList = SaveData_GetWiFiList(saveData); DWCUserData *userData = WiFiList_GetUserData(wiFiList); - if (DWC_CheckHasProfile(userData) && DWC_CheckValidConsole(userData)) { - return TRUE; - } - - return FALSE; + return DWC_CheckHasProfile(userData) && DWC_CheckValidConsole(userData); } diff --git a/src/unk_0203C954.c b/src/unk_0203C954.c index dd4046f07a..658520e7d6 100644 --- a/src/unk_0203C954.c +++ b/src/unk_0203C954.c @@ -22,10 +22,10 @@ static u8 BgEvent_IsHiddenItemAvailable(FieldSystem *fieldSystem, const BgEvent static int BgEvent_GetPlayerFacingPosition(FieldSystem *fieldSystem, int *x, int *z) { - int facingDir = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int facingDir = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); - *x = Player_GetXPos(fieldSystem->playerAvatar); - *z = Player_GetZPos(fieldSystem->playerAvatar); + *x = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + *z = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); switch (facingDir) { case DIR_NORTH: @@ -47,7 +47,7 @@ static int BgEvent_GetPlayerFacingPosition(FieldSystem *fieldSystem, int *x, int static u8 sub_0203C9B0(PlayerAvatar *playerAvatar, MapObject *param1) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); if (sub_020630DC(v0) == sub_020630DC(param1)) { return 1; @@ -142,7 +142,7 @@ static u8 BgEvent_CheckPlayerFacingDirection(FieldSystem *fieldSystem, const BgE return TRUE; } - switch (PlayerAvatar_GetDir(fieldSystem->playerAvatar)) { + switch (PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar)) { case DIR_NORTH: if ((bgEvent->playerFacingDir == BG_EVENT_DIR_NORTH) || (bgEvent->playerFacingDir == BG_EVENT_DIR_NORTH_SOUTH)) { return TRUE; @@ -173,7 +173,7 @@ u16 FieldEvent_GetInteractedWallSignScript(FieldSystem *fieldSystem, const BgEve int facingX, facingZ; int eventIndex; - if (PlayerAvatar_GetDir(fieldSystem->playerAvatar) != DIR_NORTH) { + if (PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar) != DIR_NORTH) { return 0xffff; } @@ -191,7 +191,7 @@ u16 FieldEvent_GetInteractedWallSignScript(FieldSystem *fieldSystem, const BgEve u8 sub_0203CBE0(FieldSystem *fieldSystem, MapObject **param1) { - if (PlayerAvatar_GetDir(fieldSystem->playerAvatar) != DIR_NORTH) { + if (PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar) != DIR_NORTH) { return 0; } @@ -211,8 +211,8 @@ u16 sub_0203CC14(FieldSystem *fieldSystem, void *param1, int param2) int v3; const CoordEvent *v0 = param1; - int v1 = Player_GetXPos(fieldSystem->playerAvatar); - int v2 = Player_GetZPos(fieldSystem->playerAvatar); + int v1 = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + int v2 = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); for (v3 = 0; v3 < param2; v3++) { if ((v1 >= v0[v3].x) && (v1 < (v0[v3].x + v0[v3].width)) && (v2 >= v0[v3].z) && (v2 < (v0[v3].z + v0[v3].length)) && (FieldSystem_TryGetVar(fieldSystem, v0[v3].var) == v0[v3].value)) { diff --git a/src/unk_0203D1B8.c b/src/unk_0203D1B8.c index fd97577088..886fd44dbb 100644 --- a/src/unk_0203D1B8.c +++ b/src/unk_0203D1B8.c @@ -279,7 +279,7 @@ BagContext *FieldSystem_OpenBag(FieldSystem *fieldSystem, ItemUseContext *itemUs BagContext_Init(bagCtx, fieldSystem->saveData, 0, fieldSystem->bagCursor); BagContext_SetMapLoadType(bagCtx, fieldSystem->mapLoadType); - if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) == PLAYER_STATE_CYCLING) { + if (PlayerAvatar_GetPlayerState(fieldSystem->playerAvatar) == PLAYER_AVATAR_CYCLING) { BagContext_SetIsCycling(bagCtx); } diff --git a/src/unk_02049D08.c b/src/unk_02049D08.c index 05e03ad4fc..4f035c0cb3 100644 --- a/src/unk_02049D08.c +++ b/src/unk_02049D08.c @@ -229,7 +229,7 @@ void BattleTower_SetCommunicationClubAccessible(FieldSystem *fieldSystem) { Location *v0 = FieldOverworldState_GetSpecialLocation(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - Location_Set(v0, fieldSystem->location->mapId, -1, Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), 0); + Location_Set(v0, fieldSystem->location->mapId, -1, PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), 0); SystemFlag_SetCommunicationClubAccessible(SaveData_GetVarsFlags(fieldSystem->saveData)); return; diff --git a/src/unk_0204AEE8.c b/src/unk_0204AEE8.c index eb68eb4af4..ab829a0fbd 100644 --- a/src/unk_0204AEE8.c +++ b/src/unk_0204AEE8.c @@ -4,6 +4,7 @@ #include #include "constants/battle_tower.h" +#include "constants/string.h" #include "generated/battle_tower_modes.h" #include "generated/frontier_trainers.h" #include "generated/object_events_gfx.h" @@ -29,7 +30,6 @@ #include "save_player.h" #include "savedata.h" #include "string_gf.h" -#include "string_padding_mode.h" #include "string_template.h" #include "trainer_info.h" #include "unk_0202D05C.h" @@ -287,8 +287,8 @@ static BattleFrontierTrainerData *sub_0204B184(FrontierDataDTO *param0, u16 para BattleFrontierTrainerData *v0 = sub_0204B630(param1, heapID); param0->trDataDTO.trainerID = param1; - param0->trDataDTO.unk_18[0] = 0xFFFF; - param0->trDataDTO.unk_18[1] = param1 * 3; + param0->trDataDTO.introMsg[0] = 0xFFFF; + param0->trDataDTO.introMsg[1] = param1 * 3; param0->trDataDTO.trainerType = v0->trainerType; String *v2 = MessageLoader_GetNewString(v1, param1); diff --git a/src/unk_0204FA34.c b/src/unk_0204FA34.c index 7745904a5f..d018fb79ea 100644 --- a/src/unk_0204FA34.c +++ b/src/unk_0204FA34.c @@ -4,12 +4,12 @@ #include "constants/battle_frontier.h" -#include "struct_decls/struct_0203026C_decl.h" +#include "struct_defs/battle_frontier.h" #include "battle_frontier_stats.h" +#include "battle_hall_save.h" #include "communication_system.h" #include "savedata.h" -#include "unk_02030108.h" #include "unk_0205DFC4.h" void CommCmd_BattleHallSelectedSpeciesMsg(int netID, int unused, void *data, void *context) @@ -27,12 +27,12 @@ void CommCmd_BattleHallSelectedSpeciesMsg(int netID, int unused, void *data, voi return; } -void sub_0204FA50(SaveData *saveData, UnkStruct_0203026C *param1, u8 challengeType) +void sub_0204FA50(SaveData *saveData, BattleHallStreakFlags *param1, u8 challengeType) { u8 v1[4]; v1[0] = 0; - sub_02030280(param1, 5, challengeType, 0, v1); + BattleHallStreakFlags_SetFlag(param1, 5, challengeType, 0, v1); if (challengeType == FRONTIER_CHALLENGE_MULTI_WFC) { BattleFrontierStats_SetStat(SaveData_GetBattleFrontier(saveData), STAT_HALL_WFC_STREAK_ACTIVE, BattleFrontierStats_GetHostFriendIdx(STAT_HALL_WFC_STREAK_ACTIVE), 0); diff --git a/src/unk_02054884.c b/src/unk_02054884.c index 0f1312ffc7..344ecd250c 100644 --- a/src/unk_02054884.c +++ b/src/unk_02054884.c @@ -13,11 +13,11 @@ #include "heap.h" #include "party.h" #include "pokemon.h" +#include "save_catchrecords.h" #include "save_player.h" #include "savedata.h" #include "trainer_info.h" #include "unk_02017038.h" -#include "unk_0202F180.h" BOOL Pokemon_CanBattle(Pokemon *mon) { diff --git a/src/unk_02056B30.c b/src/unk_02056B30.c index cae570ccc5..9d38f75f76 100644 --- a/src/unk_02056B30.c +++ b/src/unk_02056B30.c @@ -284,7 +284,7 @@ static BOOL sub_02056E20(FieldTask *taskMan) case 0: v1->unk_1C = ov5_021D431C(); v2 = (UnkStruct_ov5_021D432C *)v1->unk_1C; - ov5_021D4334(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), v2); + ov5_021D4334(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), v2); (v1->unk_04)++; break; case 1: @@ -316,13 +316,13 @@ static BOOL sub_02056EA4(FieldTask *taskMan) case 0: v1->unk_1C = ov5_021D431C(); v2 = (UnkStruct_ov5_021D432C *)v1->unk_1C; - ov5_021D4334(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), v2); + ov5_021D4334(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), v2); (v1->unk_04)++; break; case 1: v2 = (UnkStruct_ov5_021D432C *)v1->unk_1C; - if (ov5_021D4A24(fieldSystem, v2, PlayerAvatar_GetDir(fieldSystem->playerAvatar))) { + if (ov5_021D4A24(fieldSystem, v2, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar))) { ov5_021D432C(v1->unk_1C); (v1->unk_04)++; } @@ -342,9 +342,9 @@ static BOOL sub_02056F1C(FieldTask *taskMan) switch (v1->unk_04) { case 0: { - int v3 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + int v3 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); - v2 = Player_MapObject(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (v3 == 2) { LocalMapObj_SetAnimationCode(v2, MOVEMENT_ACTION_WALK_SLOW_WEST); @@ -357,7 +357,7 @@ static BOOL sub_02056F1C(FieldTask *taskMan) (v1->unk_04)++; break; case 1: - v2 = Player_MapObject(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v2) == 1) { sub_020656AC(v2); @@ -383,7 +383,7 @@ static BOOL sub_02056FC0(FieldTask *taskMan) { FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan); - MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); switch (v1->unk_04) { case 0: { @@ -404,7 +404,7 @@ static BOOL sub_02057008(FieldTask *taskMan) { FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan); - MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); switch (v1->unk_04) { case 0: { @@ -431,9 +431,9 @@ static BOOL sub_02057050(FieldTask *taskMan) switch (v2->unk_04) { case 0: { u8 v4; - MapObject *v5 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v5 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); - v4 = TerrainCollisionManager_GetTileBehavior(fieldSystem, Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar)); + v4 = TerrainCollisionManager_GetTileBehavior(fieldSystem, PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar)); if (TileBehavior_IsDoor(v4)) { MapObject_SetHidden(v5, 1); @@ -449,7 +449,7 @@ static BOOL sub_02057050(FieldTask *taskMan) case 1: v2->unk_1C = (UnkStruct_ov5_021D432C *)ov5_021D431C(); v3 = (UnkStruct_ov5_021D432C *)v2->unk_1C; - ov5_021D4334(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), v3); + ov5_021D4334(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), v3); (v2->unk_04)++; break; case 2: @@ -458,7 +458,7 @@ static BOOL sub_02057050(FieldTask *taskMan) if (ov5_021D453C(fieldSystem, v3)) { ov5_021D432C(v3); { - MapObject *v7 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v7 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); MapObject_SetHidden(v7, 0); } @@ -482,9 +482,9 @@ static BOOL sub_0205711C(FieldTask *taskMan) switch (v2->unk_04) { case 0: { u8 v4; - MapObject *v5 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v5 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); - v4 = TerrainCollisionManager_GetTileBehavior(fieldSystem, Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar)); + v4 = TerrainCollisionManager_GetTileBehavior(fieldSystem, PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar)); if (TileBehavior_IsDoor(v4)) { MapObject_SetHidden(v5, 1); @@ -515,13 +515,13 @@ static BOOL sub_020571A0(FieldTask *taskMan) case 0: v1->unk_1C = ov5_021D431C(); v2 = (UnkStruct_ov5_021D432C *)v1->unk_1C; - ov5_021D4334(Player_GetXPos(fieldSystem->playerAvatar), Player_GetZPos(fieldSystem->playerAvatar), v2); + ov5_021D4334(PlayerAvatar_GetXPos(fieldSystem->playerAvatar), PlayerAvatar_GetZPos(fieldSystem->playerAvatar), v2); (v1->unk_04)++; break; case 1: v2 = (UnkStruct_ov5_021D432C *)v1->unk_1C; - if (ov5_021D4858(fieldSystem, v2, PlayerAvatar_GetDir(fieldSystem->playerAvatar))) { + if (ov5_021D4858(fieldSystem, v2, PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar))) { ov5_021D432C(v1->unk_1C); (v1->unk_04)++; } @@ -543,12 +543,12 @@ static BOOL sub_02057218(FieldTask *taskMan) case 0: FieldMap_FadeScreen(FADE_TYPE_BRIGHTNESS_IN); - v2 = Player_MapObject(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (1) { int v3; - v3 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + v3 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); if (v3 == 2) { LocalMapObj_SetAnimationCode(v2, MOVEMENT_ACTION_WALK_SLOW_WEST); @@ -564,7 +564,7 @@ static BOOL sub_02057218(FieldTask *taskMan) (v1->unk_04)++; break; case 1: - v2 = Player_MapObject(fieldSystem->playerAvatar); + v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); if (LocalMapObj_CheckAnimationFinished(v2) == 1) { sub_020656AC(v2); @@ -587,7 +587,7 @@ static BOOL sub_020572B8(FieldTask *taskMan) { FieldSystem *fieldSystem = FieldTask_GetFieldSystem(taskMan); UnkStruct_02056BDC *v1 = FieldTask_GetEnv(taskMan); - MapObject *v2 = Player_MapObject(fieldSystem->playerAvatar); + MapObject *v2 = PlayerAvatar_GetMapObject(fieldSystem->playerAvatar); switch (v1->unk_04) { case 0: { @@ -609,8 +609,8 @@ static void sub_02057300(FieldSystem *fieldSystem) int v0; VecFx32 v1; - v0 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &v1); + v0 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &v1); if (v0 == 3) { v1.x -= (FX32_ONE * 16); @@ -620,9 +620,9 @@ static void sub_02057300(FieldSystem *fieldSystem) v1.y = TerrainCollisionManager_GetHeight(fieldSystem, v1.y, v1.x, v1.z, NULL); - sub_0205ECB8(fieldSystem->playerAvatar, &v1, v0); - Camera_SetTargetAndUpdatePosition(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem->camera); - Camera_TrackTarget(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem->camera); + PlayerAvatar_SetPosDirFromVec(fieldSystem->playerAvatar, &v1, v0); + Camera_SetTargetAndUpdatePosition(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem->camera); + Camera_TrackTarget(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem->camera); } static void sub_02057368(FieldSystem *fieldSystem) @@ -631,11 +631,11 @@ static void sub_02057368(FieldSystem *fieldSystem) VecFx32 v3; u8 v4; - v2 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); - PlayerAvatar_PosVectorOut(fieldSystem->playerAvatar, &v3); + v2 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); + PlayerAvatar_GetPosPtr(fieldSystem->playerAvatar, &v3); - v0 = Player_GetXPos(fieldSystem->playerAvatar); - v1 = Player_GetZPos(fieldSystem->playerAvatar); + v0 = PlayerAvatar_GetXPos(fieldSystem->playerAvatar); + v1 = PlayerAvatar_GetZPos(fieldSystem->playerAvatar); v4 = TerrainCollisionManager_GetTileBehavior(fieldSystem, v0, v1); if (TileBehavior_IsWarpStairsEast(v4)) { @@ -650,7 +650,7 @@ static void sub_02057368(FieldSystem *fieldSystem) v3.y = TerrainCollisionManager_GetHeight(fieldSystem, v3.y, v3.x, v3.z, NULL); - sub_0205ECB8(fieldSystem->playerAvatar, &v3, v2); - Camera_SetTargetAndUpdatePosition(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem->camera); - Camera_TrackTarget(PlayerAvatar_PosVector(fieldSystem->playerAvatar), fieldSystem->camera); + PlayerAvatar_SetPosDirFromVec(fieldSystem->playerAvatar, &v3, v2); + Camera_SetTargetAndUpdatePosition(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem->camera); + Camera_TrackTarget(PlayerAvatar_GetPos(fieldSystem->playerAvatar), fieldSystem->camera); } diff --git a/src/unk_0205A0D8.c b/src/unk_0205A0D8.c index 5a8548e6d5..d656158900 100644 --- a/src/unk_0205A0D8.c +++ b/src/unk_0205A0D8.c @@ -325,7 +325,7 @@ static BOOL sub_0205A324(FieldTask *param0) if (v0->unk_44 != 0) { v0->unk_44--; } else { - if (LocalMapObj_CheckAnimationFinished(Player_MapObject(fieldSystem->playerAvatar))) { + if (LocalMapObj_CheckAnimationFinished(PlayerAvatar_GetMapObject(fieldSystem->playerAvatar))) { v0->unk_34 = 11; } } diff --git a/src/unk_0205B33C.c b/src/unk_0205B33C.c index 7bf353a080..7871d7a4dc 100644 --- a/src/unk_0205B33C.c +++ b/src/unk_0205B33C.c @@ -6,9 +6,7 @@ #include "constants/union_room_message_types.h" #include "constants/versions.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_0205B43C_decl.h" -#include "struct_defs/sentence.h" #include "struct_defs/struct_0203330C.h" #include "struct_defs/struct_0205B4F8.h" @@ -20,6 +18,8 @@ #include "comm_manager.h" #include "communication_information.h" #include "communication_system.h" +#include "easy_chat_sentence.h" +#include "easy_chat_words.h" #include "field_system.h" #include "field_task.h" #include "heap.h" @@ -34,12 +34,11 @@ #include "sys_task_manager.h" #include "trainer_case.h" #include "trainer_info.h" -#include "unk_02014A84.h" -#include "unk_02014D38.h" #include "unk_02033200.h" #include "constdata/const_020ED570.h" #include "res/text/bank/country_names.h" +#include "res/text/bank/greetings.h" #include "res/text/bank/union_room.h" typedef void (*UnkFuncPtr_0205B43C)(UnkStruct_0205B43C *); @@ -82,7 +81,7 @@ struct UnkStruct_0205B43C_t { int unk_170; u16 unk_174; u8 unk_176[2]; - Sentence unk_178; + EasyChatSentence unk_178; BOOL unk_180; TrainerCase *unk_184; TrainerCase *unk_188[2]; @@ -175,10 +174,10 @@ static UnkStruct_0205B43C *sub_0205B3A0(FieldSystem *fieldSystem) static void sub_0205B408(UnkStruct_0205B43C *param0) { - Sentence v0; + EasyChatSentence v0; if (CommServerClient_IsInitialized()) { - sub_02014AB4(&v0); + EasyChatSentence_InitWithEnteredUnionRoom(&v0); sub_0205C12C(&v0); sub_0205C010(param0, &v0); sub_0205B5B4(param0, sub_0205B43C, 40); @@ -1200,11 +1199,11 @@ int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTem return UnionRoom_Text_HereComesSomeoneNow; } - if (!Sentence_IsValid(¶m0->unk_178)) { + if (!EasyChatSentence_IsValid(¶m0->unk_178)) { return UnionRoom_Text_BoringIfNoOneComes; } - if (Sentence_GetType(¶m0->unk_178) != 4) { + if (EasyChatSentence_GetType(¶m0->unk_178) != 4) { int appearance = TrainerInfo_Appearance(param0->unk_08); int gender = TrainerInfo_Gender(param0->unk_08); @@ -1213,14 +1212,14 @@ int UnionRoom_GetTealaMessage(UnkStruct_0205B43C *param0, StringTemplate *strTem return UnionRoom_Text_MistakenForTrainerClass; } - int id = Sentence_GetID(¶m0->unk_178); + int id = EasyChatSentence_GetID(¶m0->unk_178); if (id >= 20) { id = 0; } - if ((v3 = Sentence_GetWord(¶m0->unk_178, 0)) != 0xffff) { - StringTemplate_SetCustomMessageWord(strTemplate, 0, v3); + if ((v3 = EasyChatSentence_GetWord(¶m0->unk_178, 0)) != WORD_NONE) { + StringTemplate_SetEasyChatWord(strTemplate, 0, v3); } return sTealaMessages[id]; @@ -1240,13 +1239,13 @@ static void sub_0205BFF0(UnkStruct_0205B4F8 *param0) } } -void sub_0205C010(UnkStruct_0205B43C *param0, Sentence *param1) +void sub_0205C010(UnkStruct_0205B43C *param0, EasyChatSentence *param1) { - Sentence_Copy(¶m0->unk_178, param1); + EasyChatSentence_Copy(¶m0->unk_178, param1); param0->unk_180 = 1; } -Sentence *sub_0205C028(UnkStruct_0205B43C *param0) +EasyChatSentence *sub_0205C028(UnkStruct_0205B43C *param0) { if (param0->unk_180 == 0) { return NULL; @@ -1256,7 +1255,7 @@ Sentence *sub_0205C028(UnkStruct_0205B43C *param0) return ¶m0->unk_178; } -void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnkStruct_02014EC4 *param4) +void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, TrainerInfo *playerTrainerInfo, UnlockedEasyChatWords *unlockedWords) { TrainerInfo *commTrainerInfo; MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNION_ROOM, HEAP_ID_FIELD1); @@ -1281,19 +1280,19 @@ void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, T int language = TrainerInfo_Language(commTrainerInfo); if (language >= LANGUAGE_JAPANESE && language <= LANGUAGE_SPANISH) { - static const int v5[] = { - 0, - 1, - 2, - 3, - 4, - -1, - 5, + static const int greetingBankEntries[] = { + [LANGUAGE_JAPANESE - 1] = Greetings_Text_Konnichiwa, + [LANGUAGE_ENGLISH - 1] = Greetings_Text_Hello, + [LANGUAGE_FRENCH - 1] = Greetings_Text_Bonjour, + [LANGUAGE_ITALIAN - 1] = Greetings_Text_Ciao, + [LANGUAGE_GERMAN - 1] = Greetings_Text_Hallo, + [LANGUAGE_UNUSED_6 - 1] = -1, + [LANGUAGE_SPANISH - 1] = Greetings_Text_Hola, }; - u16 v6 = language - 1; + u16 index = language - 1; - if (v6 < NELEMS(v5) && v5[v6] >= 0) { - sub_02014F98(param4, v5[v6]); + if (index < NELEMS(greetingBankEntries) && greetingBankEntries[index] >= 0) { + EasyChatWords_UnlockGreeting(unlockedWords, greetingBankEntries[index]); } } @@ -1327,7 +1326,7 @@ void UnionRoom_DoGreeting(StringTemplate *strTemplate, int param1, int param2, T MessageLoader_Free(msgLoader); } -void sub_0205C12C(Sentence *param0) +void sub_0205C12C(EasyChatSentence *param0) { UnkStruct_0205B4F8 v0; diff --git a/src/unk_0205C22C.c b/src/unk_0205C22C.c index 07039ab89c..9dc2036132 100644 --- a/src/unk_0205C22C.c +++ b/src/unk_0205C22C.c @@ -21,6 +21,7 @@ #include "overlay005/ov5_021F600C.h" #include "comm_manager.h" +#include "easy_chat_sentence.h" #include "field_task.h" #include "heap.h" #include "map_object.h" @@ -33,7 +34,6 @@ #include "sys_task.h" #include "sys_task_manager.h" #include "trainer_info.h" -#include "unk_02014A84.h" #include "unk_0205B33C.h" #include "unk_020655F4.h" @@ -249,8 +249,8 @@ static void sub_0205C51C(UnkStruct_0205C22C *param0, MapObjectManager *param1) GF_ASSERT(param0->playerAvatar != NULL); - v2 = Player_GetXPos(param0->playerAvatar); - v3 = Player_GetZPos(param0->playerAvatar); + v2 = PlayerAvatar_GetXPos(param0->playerAvatar); + v3 = PlayerAvatar_GetZPos(param0->playerAvatar); for (v1 = 0; v1 < 50; v1++) { v0 = MapObjMan_LocalMapObjByIndex(param1, v1 + 1); @@ -321,7 +321,7 @@ static void sub_0205C51C(UnkStruct_0205C22C *param0, MapObjectManager *param1) } } - sub_0205C7BC(¶m0->unk_0C[50], Player_MapObject(param0->playerAvatar)); + sub_0205C7BC(¶m0->unk_0C[50], PlayerAvatar_GetMapObject(param0->playerAvatar)); sub_0205C6BC(¶m0->unk_0C[50]); } @@ -492,7 +492,7 @@ static void sub_0205C8DC(UnkStruct_0205C924 *param0) param0->unk_04 = NULL; param0->unk_08 = NULL; - Sentence_InitWithType(¶m0->unk_14, 0); + EasyChatSentence_InitWithType(¶m0->unk_14, EASY_CHAT_SENTENCE_TYPE_PRE_BATTLE); param0->unk_10 = 0; param0->unk_0C = 0; diff --git a/src/unk_0205DFC4.c b/src/unk_0205DFC4.c index d19627e537..35e147b5f6 100644 --- a/src/unk_0205DFC4.c +++ b/src/unk_0205DFC4.c @@ -434,27 +434,27 @@ enum BattleFrontierStatsIndex BattleFrontierStats_GetFactoryRecordTradeCountInde return index + (isOpenLevel * 4); } -enum BattleFrontierStatsIndex sub_0205E4E0(u8 param0, u8 param1) +enum BattleFrontierStatsIndex BattleFrontierStats_GetHallCurrentTypeRanksIndex(u8 challengeType, u8 pokemonType) { - int v0; + enum BattleFrontierStatsIndex index; - switch (param0) { - case 0: - v0 = 37; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + index = STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_SINGLE; break; - case 1: - v0 = 49; + case FRONTIER_CHALLENGE_DOUBLE: + index = STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_DOUBLE; break; - case 2: - v0 = 61; + case FRONTIER_CHALLENGE_MULTI: + index = STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_MULTI; break; - case 3: - v0 = 125; + case FRONTIER_CHALLENGE_MULTI_WFC: + index = STAT_HALL_CURRENT_RANKS_NORMAL_FIGHTING_MULTI_WFC; break; } - v0 += (param1 / 2); - return v0; + index += pokemonType / 2; + return index; } enum BattleFrontierStatsIndex BattleFrontierStats_GetHallLatestStreakIndex(u8 challengeType) @@ -479,26 +479,26 @@ enum BattleFrontierStatsIndex BattleFrontierStats_GetHallLatestStreakIndex(u8 ch return index; } -enum BattleFrontierStatsIndex sub_0205E534(u8 param0) +enum BattleFrontierStatsIndex BattleFrontierStats_GetHallCurrentStreakIndex(u8 challengeType) { - int v0; + enum BattleFrontierStatsIndex index; - switch (param0) { - case 0: - v0 = 34; + switch (challengeType) { + case FRONTIER_CHALLENGE_SINGLE: + index = STAT_HALL_CURRENT_STREAK_SINGLE; break; - case 1: - v0 = 46; + case FRONTIER_CHALLENGE_DOUBLE: + index = STAT_HALL_CURRENT_STREAK_DOUBLE; break; - case 2: - v0 = 58; + case FRONTIER_CHALLENGE_MULTI: + index = STAT_HALL_CURRENT_STREAK_MULTI; break; - case 3: - v0 = 122; + case FRONTIER_CHALLENGE_MULTI_WFC: + index = STAT_HALL_CURRENT_STREAK_MULTI_WFC; break; } - return v0; + return index; } enum BattleFrontierStatsIndex BattleFrontierStats_GetHallLatestSpeciesIndex(u8 challengeType) diff --git a/src/unk_0205F180.c b/src/unk_0205F180.c index 9cc5bee074..57a46c69a2 100644 --- a/src/unk_0205F180.c +++ b/src/unk_0205F180.c @@ -159,7 +159,7 @@ void PlayerAvatar_MoveControl(PlayerAvatar *playerAvatar, const LandDataManager return; } - if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_WALKING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_AVATAR_WALKING) { int v0 = sub_0205FC48(playerAvatar, dir); if (v0 != 0) { @@ -183,7 +183,7 @@ int PlayerAvatar_CheckStartMove(PlayerAvatar *playerAvatar, int dir) static int PlayerAvatar_CheckStartMoveInternal(PlayerAvatar *playerAvatar, int dir) { int v0; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (LocalMapObj_IsAnimationSet(mapObj) == 1) { return 1; @@ -215,10 +215,10 @@ static int PlayerAvatar_CheckStartMoveInternal(PlayerAvatar *playerAvatar, int d sub_02061674(playerAvatar, dir, &xOut, &yOut, &zOut); if (DistWorld_IsValidTileOnCurrentFloatingPlatform(fieldSystem, xOut, yOut, zOut) == 0) { - if (ov9_02250FD8(fieldSystem, xOut, yOut, zOut) == 1) { - ov9_02251000(fieldSystem, xOut, yOut, zOut); + if (DistWorld_AreCoordsValidOnCurrentFloatingPlatformKind(fieldSystem, xOut, yOut, zOut) == 1) { + DistWorld_FindAndPrepareNewCurrentFloatingPlatform(fieldSystem, xOut, yOut, zOut); v2 = sub_020611FC(playerAvatar, mapObj, dir); - ov9_02251000(fieldSystem, x, y, z); + DistWorld_FindAndPrepareNewCurrentFloatingPlatform(fieldSystem, x, y, z); } } } @@ -243,25 +243,25 @@ static int PlayerAvatar_CheckStartMoveInternal(PlayerAvatar *playerAvatar, int d static void PlayerAvatar_StartMoveInit(PlayerAvatar *playerAvatar, int param1, u16 keyPad, u16 keyPress) { PlayerAvatar_SetFaceDirection(playerAvatar, Movement_FaceLeftRightFromInput(keyPress), Movement_FaceUpDownFromInput(keyPress)); - sub_0205F054(playerAvatar); + PlayerAvatar_EndStep(playerAvatar); } static void sub_0205F378(PlayerAvatar *playerAvatar) { - if (sub_0205F060(playerAvatar) == 1 && PlayerAvatar_MoveState(playerAvatar) == AVATAR_MOVE_STATE_MOVING) { - sub_0205EF6C(playerAvatar, 0); + if (PlayerAvatar_CheckStep(playerAvatar) == 1 && PlayerAvatar_GetMoveState(playerAvatar) == AVATAR_MOVE_STATE_MOVING) { + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 0); if (PlayerAvatar_CheckEscapedFromDeepMud(playerAvatar) == TRUE) { PlayerAvatar_SetEscapedFromDeepMud(playerAvatar, FALSE); - MapObject_SetFlagDoNotSinkIntoTerrain(Player_MapObject(playerAvatar), FALSE); + MapObject_SetFlagDoNotSinkIntoTerrain(PlayerAvatar_GetMapObject(playerAvatar), FALSE); } } } static void PlayerAvatar_PlayWalkSE(PlayerAvatar *playerAvatar) { - if (PlayerAvatar_MoveState(playerAvatar) == 1) { - MapObject *mapObj = Player_MapObject(playerAvatar); + if (PlayerAvatar_GetMoveState(playerAvatar) == 1) { + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); u8 v1, v2 = MapObject_GetCurrTileBehavior(mapObj); { @@ -309,24 +309,24 @@ void sub_0205F490(PlayerAvatar *playerAvatar) int v0, v1, v2; const MapObject *mapObj; - v0 = PlayerAvatar_MoveState(playerAvatar); - v1 = Player_MoveState(playerAvatar); - mapObj = Player_MapObject(playerAvatar); + v0 = PlayerAvatar_GetMoveState(playerAvatar); + v1 = PlayerAvatar_GetPlayerMoveState(playerAvatar); + mapObj = PlayerAvatar_GetMapObject(playerAvatar); - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); u32 v4 = sub_0205F644(playerAvatar, -1); if ((v4 != 0) && (v4 != 5)) { - sub_0205EB10(playerAvatar, 2); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 2); return; } if (LocalMapObj_IsAnimationSet(mapObj) == 0) { switch (v0) { - case PLAYER_STATE_WALKING: + case PLAYER_AVATAR_WALKING: break; - case PLAYER_STATE_CYCLING: + case PLAYER_AVATAR_CYCLING: v2 = MapObject_GetMovementAction(mapObj); if (IsMovementWalkOnSpotSlow(v2) == 1) { @@ -334,13 +334,13 @@ void sub_0205F490(PlayerAvatar *playerAvatar) } if ((v1 == 0) || (v1 == 3)) { - sub_0205EB10(playerAvatar, 1); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 1); } else { - sub_0205EB10(playerAvatar, 2); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 2); } break; - case PLAYER_STATE_SURFING: - sub_0205EB10(playerAvatar, 2); + case PLAYER_AVATAR_SURFING: + PlayerAvatar_SetPlayerMoveState(playerAvatar, 2); break; } @@ -356,10 +356,10 @@ void sub_0205F490(PlayerAvatar *playerAvatar) case 0: break; case 3: - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); break; default: - sub_0205EB10(playerAvatar, 3); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 3); } break; case 2: @@ -367,10 +367,10 @@ void sub_0205F490(PlayerAvatar *playerAvatar) case 0: break; case 3: - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); break; default: - sub_0205EB10(playerAvatar, 3); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 3); } break; } @@ -381,8 +381,8 @@ void sub_0205F490(PlayerAvatar *playerAvatar) void sub_0205F56C(PlayerAvatar *playerAvatar) { - sub_0205EB08(playerAvatar, 0); - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); PlayerAvatar_ClearSpeed(playerAvatar); } @@ -391,8 +391,8 @@ int sub_0205F588(PlayerAvatar *playerAvatar) int v0, v1, v2; const MapObject *mapObj; - v0 = PlayerAvatar_MoveState(playerAvatar); - v1 = Player_MoveState(playerAvatar); + v0 = PlayerAvatar_GetMoveState(playerAvatar); + v1 = PlayerAvatar_GetPlayerMoveState(playerAvatar); if (v0 == 0) { return 1; @@ -407,7 +407,7 @@ int sub_0205F588(PlayerAvatar *playerAvatar) return 1; } - mapObj = Player_MapObject(playerAvatar); + mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (LocalMapObj_IsAnimationSet(mapObj) == 1) { return 1; @@ -427,10 +427,10 @@ void sub_0205F5E4(PlayerAvatar *playerAvatar, int dir) { MapObject *mapObj; - sub_0205EB08(playerAvatar, 0); - sub_0205EB10(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); + PlayerAvatar_SetPlayerMoveState(playerAvatar, 0); - mapObj = Player_MapObject(playerAvatar); + mapObj = PlayerAvatar_GetMapObject(playerAvatar); MapObject_TryFace(mapObj, dir); sub_02062A0C(mapObj, 0x0); @@ -450,13 +450,13 @@ static int sub_0205F62C(PlayerAvatar *playerAvatar, int param1) static u32 sub_0205F644(PlayerAvatar *playerAvatar, int param1) { int v0 = 0; - u32 tileBehavior = MapObject_GetCurrTileBehavior(Player_MapObject(playerAvatar)); + u32 tileBehavior = MapObject_GetCurrTileBehavior(PlayerAvatar_GetMapObject(playerAvatar)); if (sub_02061630(playerAvatar, tileBehavior, param1) == 1) { return 5; } - if (sub_0205EF84(playerAvatar) == 1) { + if (PlayerAvatar_CheckIgnoreTileBehavior(playerAvatar) == 1) { return 0; } @@ -496,19 +496,19 @@ static int sub_0205F6C4(PlayerAvatar *playerAvatar, int param1) static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); int v1 = MapObject_GetMovingDir(mapObj); int v2 = sub_0205FAB0(playerAvatar, v1); u32 v3 = sub_02060B7C(playerAvatar, mapObj, v1); - sub_0205EF40(playerAvatar, TRUE); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); if (v3 != 0) { sub_0205FA6C(playerAvatar); if (v2 != 1) { - sub_0205EF6C(playerAvatar, 1); - sub_0205EB08(playerAvatar, 0); + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 0); return 0; } @@ -520,11 +520,11 @@ static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) } MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v1, MOVEMENT_ACTION_WALK_SLOW_NORTH), 3); - sub_0205EF6C(playerAvatar, 1); - sub_0205EF40(playerAvatar, TRUE); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v1, MOVEMENT_ACTION_WALK_SLOW_NORTH), PLAYER_ACTION_SPEED_SLOW); + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 1); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); PlayerAvatar_SetFaceDirection(playerAvatar, -1, -1); - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } @@ -540,32 +540,32 @@ static int sub_0205F6D0(PlayerAvatar *playerAvatar, int param1) } MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v1, MOVEMENT_ACTION_WALK_SLOW_NORTH), 3); - sub_0205EF6C(playerAvatar, 1); - sub_0205EF40(playerAvatar, TRUE); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v1, MOVEMENT_ACTION_WALK_SLOW_NORTH), PLAYER_ACTION_SPEED_SLOW); + PlayerAvatar_SetIgnoreTileBehavior(playerAvatar, 1); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); PlayerAvatar_SetFaceDirection(playerAvatar, -1, -1); } else { MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); sub_0205FB40(playerAvatar, v1); } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) { u32 v0; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); int v2 = MapObject_GetMovingDir(mapObj); Sound_PlayEffect(SEQ_SE_DP_SUNA); if (v2 == 0) { - if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_CYCLING && PlayerAvatar_Speed(playerAvatar) >= 3) { + if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_AVATAR_CYCLING && PlayerAvatar_GetSpeed(playerAvatar) >= 3) { if (param1 == 0) { - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_FASTER_SOUTH), 6); - sub_0205EB08(playerAvatar, 1); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_FASTER_SOUTH), PLAYER_ACTION_SPEED_FASTER); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } } @@ -578,19 +578,19 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) } MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_SLOW_NORTH), 3); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_SLOW_NORTH), PLAYER_ACTION_SPEED_SLOW); PlayerAvatar_ClearSpeed(playerAvatar); - sub_0205EF40(playerAvatar, TRUE); - sub_0205EB08(playerAvatar, 1); - sub_0205F01C(playerAvatar, 1); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); + PlayerAvatar_SetMoveState(playerAvatar, 1); + PlayerAvatar_SetMoveThroughMudFlag(playerAvatar, 1); PlayerAvatar_SetFaceDirection(playerAvatar, -1, -1); return 1; } else if (v2 == 1) { - if (sub_0205F034(playerAvatar) == 0) { - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_FASTER_SOUTH), 6); - sub_0205EB08(playerAvatar, 1); + if (PlayerAvatar_CheckMoveThroughMudFlag(playerAvatar) == 0) { + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_FASTER_SOUTH), PLAYER_ACTION_SPEED_FASTER); + PlayerAvatar_SetMoveState(playerAvatar, 1); - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { PlayerAvatar_SetSpeed(playerAvatar, 3); } @@ -598,10 +598,10 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) return 1; } else { MapObject_SetStatusFlagOn(mapObj, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_SLOW_NORTH), 3); - sub_0205EF40(playerAvatar, TRUE); - sub_0205EB08(playerAvatar, 1); - sub_0205F01C(playerAvatar, 1); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_SLOW_NORTH), PLAYER_ACTION_SPEED_SLOW); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); + PlayerAvatar_SetMoveState(playerAvatar, AVATAR_MOVE_STATE_MOVING); + PlayerAvatar_SetMoveThroughMudFlag(playerAvatar, 1); PlayerAvatar_SetFaceDirection(playerAvatar, -1, -1); return 1; } @@ -612,36 +612,36 @@ static int sub_0205F808(PlayerAvatar *playerAvatar, int param1) static int sub_0205F95C(PlayerAvatar *playerAvatar, int param1) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); int v1 = MapObject_GetMovingDir(mapObj); - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { Sound_PlayEffect(SEQ_SE_DP_DANSA4); - sub_02060B64(playerAvatar, mapObj, 0x5f, 2); + sub_02060B64(playerAvatar, mapObj, 0x5f, PLAYER_ACTION_SPEED_SLOWER); } else { - sub_02060B64(playerAvatar, mapObj, 0x5d, 3); + sub_02060B64(playerAvatar, mapObj, 0x5d, PLAYER_ACTION_SPEED_SLOW); } - sub_0205EF40(playerAvatar, TRUE); - sub_0205F074(playerAvatar, 1); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); + PlayerAvatar_SetForceMovementRetainSpeed(playerAvatar, 1); return 1; } static int sub_0205F9AC(PlayerAvatar *playerAvatar, int param1) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); int v1 = MapObject_GetMovingDir(mapObj); - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { Sound_PlayEffect(SEQ_SE_DP_DANSA4); - sub_02060B64(playerAvatar, mapObj, 0x5e, 2); + sub_02060B64(playerAvatar, mapObj, 0x5e, PLAYER_ACTION_SPEED_SLOWER); } else { - sub_02060B64(playerAvatar, mapObj, 0x5c, 2); + sub_02060B64(playerAvatar, mapObj, 0x5c, PLAYER_ACTION_SPEED_SLOWER); } - sub_0205EF40(playerAvatar, TRUE); - sub_0205F074(playerAvatar, 1); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); + PlayerAvatar_SetForceMovementRetainSpeed(playerAvatar, 1); return 1; } @@ -649,20 +649,20 @@ static int sub_0205F9AC(PlayerAvatar *playerAvatar, int param1) static int sub_0205F9FC(PlayerAvatar *playerAvatar, int param1) { int v0 = 1; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); u32 v2 = sub_02060B7C(playerAvatar, mapObj, v0); if (v2 == 0) { - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v0, MOVEMENT_ACTION_WALK_FASTER_NORTH), 6); - sub_0205EB08(playerAvatar, 1); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v0, MOVEMENT_ACTION_WALK_FASTER_NORTH), PLAYER_ACTION_SPEED_FASTER); + PlayerAvatar_SetMoveState(playerAvatar, 1); PlayerAvatar_SetSpeed(playerAvatar, 3); return 1; } else { - sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v0, MOVEMENT_ACTION_FACE_SOUTH), 1); + sub_02060B64(playerAvatar, mapObj, MovementAction_TurnActionTowardsDir(v0, MOVEMENT_ACTION_FACE_SOUTH), PLAYER_ACTION_SPEED_NOT_MOVING); PlayerAvatar_ClearSpeed(playerAvatar); - sub_0205EB08(playerAvatar, 0); - sub_0205EF98(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); } return 1; @@ -679,18 +679,18 @@ static int (*const Unk_020EDAEC[6])(PlayerAvatar *, int) = { static void sub_0205FA6C(PlayerAvatar *playerAvatar) { - if (sub_0205EF58(playerAvatar) == 1) { - MapObject *v0 = Player_MapObject(playerAvatar); + if (PlayerAvatar_CheckForcedMovement(playerAvatar) == 1) { + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); MapObject_SetStatusFlagOff(v0, MAP_OBJ_STATUS_LOCK_DIR | MAP_OBJ_STATUS_PAUSE_ANIMATION); - if (sub_0205F08C(playerAvatar) == 0) { + if (PlayerAvatar_CheckForcedMovementRetainSpeed(playerAvatar) == 0) { PlayerAvatar_ClearSpeed(playerAvatar); } - sub_0205EF40(playerAvatar, FALSE); - sub_0205F074(playerAvatar, 0); - sub_0205F01C(playerAvatar, 0); + PlayerAvatar_SetForceMovement(playerAvatar, FALSE); + PlayerAvatar_SetForceMovementRetainSpeed(playerAvatar, 0); + PlayerAvatar_SetMoveThroughMudFlag(playerAvatar, 0); } } @@ -698,7 +698,7 @@ static int sub_0205FAB0(PlayerAvatar *playerAvatar, int param1) { int v0; VecFx32 v1, v2; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); MapObject_GetPosPtr(mapObj, &v1); @@ -720,7 +720,7 @@ static int sub_0205FAB0(PlayerAvatar *playerAvatar, int param1) static int sub_0205FB10(PlayerAvatar *playerAvatar, int param1) { - int v0 = PlayerAvatar_Speed(playerAvatar); + int v0 = PlayerAvatar_GetSpeed(playerAvatar); if (param1 == 1) { v0--; @@ -742,23 +742,23 @@ static int sub_0205FB10(PlayerAvatar *playerAvatar, int param1) static void sub_0205FB40(PlayerAvatar *playerAvatar, int param1) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); int v1 = 0x10; - int v2 = PlayerAvatar_Speed(playerAvatar); - int v3 = 5; + int v2 = PlayerAvatar_GetSpeed(playerAvatar); + int v3 = PLAYER_ACTION_SPEED_FAST; switch (v2) { case 1: v1 = 0x50; - v3 = 5; + v3 = PLAYER_ACTION_SPEED_FAST; break; case 2: v1 = 0x14; - v3 = 6; + v3 = PLAYER_ACTION_SPEED_FASTER; break; case 3: v1 = 0x14; - v3 = 6; + v3 = PLAYER_ACTION_SPEED_FASTER; break; } @@ -769,14 +769,14 @@ static void sub_0205FB40(PlayerAvatar *playerAvatar, int param1) static void inline_0205F180(PlayerAvatar *playerAvatar, const LandDataManager *param1, int param2, u16 param3, u16 param4) { int v0 = PlayerAvatar_GetPlayerState(playerAvatar); - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); switch (v0) { - case PLAYER_STATE_WALKING: - case PLAYER_STATE_SURFING: + case PLAYER_AVATAR_WALKING: + case PLAYER_AVATAR_SURFING: inline_0205F180_sub(playerAvatar, mapObj, param1, param2, param3, param4); break; - case PLAYER_STATE_CYCLING: + case PLAYER_AVATAR_CYCLING: sub_020602DC(playerAvatar, mapObj, param1, param2, param3, param4); break; default: @@ -807,7 +807,7 @@ static int sub_0205FC48(PlayerAvatar *playerAvatar, int param1) int v0 = sub_0205FCC0(playerAvatar, param1); int v1 = sub_0205FC64(v0); - sub_0205EB08(playerAvatar, v1); + PlayerAvatar_SetMoveState(playerAvatar, v1); return v0; } @@ -853,33 +853,33 @@ static int sub_0205FCC0(PlayerAvatar *playerAvatar, int param1) int v0; if (param1 == -1) { - sub_0205EB08(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); return 0; } - v0 = PlayerAvatar_GetDir(playerAvatar); + v0 = PlayerAvatar_GetFacingDir(playerAvatar); enum AvatarDistortionState distortionState = PlayerAvatar_MapDistortionState(playerAvatar); if (distortionState != AVATAR_DISTORTION_STATE_NONE && distortionState != AVATAR_DISTORTION_STATE_ACTIVE && distortionState != AVATAR_DISTORTION_STATE_FLOOR) { - v0 = PlayerAvatar_GetMoveDir(playerAvatar); + v0 = PlayerAvatar_GetMovingDir(playerAvatar); } - if ((v0 != param1) && (PlayerAvatar_MoveState(playerAvatar) != 1)) { - sub_0205EB08(playerAvatar, 2); + if ((v0 != param1) && (PlayerAvatar_GetMoveState(playerAvatar) != 1)) { + PlayerAvatar_SetMoveState(playerAvatar, 2); return 2; } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } static void sub_0205FD20(PlayerAvatar *playerAvatar, MapObject *param1, int param2, u16 param3, u16 param4) { int v0 = MovementAction_TurnActionTowardsDir(MapObject_GetFacingDir(param1), MOVEMENT_ACTION_FACE_NORTH); - sub_02060B64(playerAvatar, param1, v0, 1); + sub_02060B64(playerAvatar, param1, v0, PLAYER_ACTION_SPEED_NOT_MOVING); } static void sub_0205FD40(PlayerAvatar *playerAvatar, MapObject *param1, int param2, u16 param3, u16 param4) @@ -912,16 +912,16 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para v0 = sub_02060B7C(playerAvatar, param1, param2); - if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_SURFING) { if (v0 & (1 << 2)) { v1 = 0x38; - v2 = 3; + v2 = PLAYER_ACTION_SPEED_SLOW; } else if (v0 & (1 << 7)) { v1 = 0x75; - v2 = 2; + v2 = PLAYER_ACTION_SPEED_SLOWER; } else if (v0 != 0) { v1 = 0x1c; - v2 = 1; + v2 = PLAYER_ACTION_SPEED_NOT_MOVING; if ((v0 & (1 << 3)) == 0) { Sound_PlayEffect(SEQ_SE_DP_WALL_HIT); @@ -930,7 +930,7 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para MapObject_Turn(param1, param2); } else { v1 = 0xc; - v2 = 4; + v2 = PLAYER_ACTION_SPEED_NORMAL; { PlayerData *v3 = PlayerAvatar_PlayerData(playerAvatar); @@ -938,7 +938,7 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para if (PlayerData_HasRunningShoes(v3) == 1) { if (sub_020613FC(playerAvatar, param4) == 1) { v1 = 0x58; - v2 = 5; + v2 = PLAYER_ACTION_SPEED_FAST; } } } @@ -946,19 +946,19 @@ static void sub_0205FDC8(PlayerAvatar *playerAvatar, MapObject *param1, int para v1 = sub_0205FC88(param1, MapObject_GetCurrTileBehavior(param1), v1); sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } } else { if ((v0 == 0) || (v0 == (1 << 5))) { - v2 = 5; + v2 = PLAYER_ACTION_SPEED_FAST; v1 = 0x10; v1 = sub_0205FCBC(param1, MapObject_GetCurrTileBehavior(param1), v1); sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else { v1 = 0x1c; - v2 = 1; + v2 = PLAYER_ACTION_SPEED_NOT_MOVING; if ((v0 & (1 << 3)) == 0) { Sound_PlayEffect(SEQ_SE_DP_WALL_HIT); @@ -990,48 +990,48 @@ static void sub_0205FECC(PlayerAvatar *playerAvatar, MapObject *param1, int para sub_02061674(playerAvatar, param2, &x, &y, &z); if (DistWorld_IsValidTileOnCurrentFloatingPlatform(fieldSystem, x, y, z) == 0) { - if (ov9_02250FD8(fieldSystem, x, y, z) == 1) { - ov9_02251000(fieldSystem, x, y, z); + if (DistWorld_AreCoordsValidOnCurrentFloatingPlatformKind(fieldSystem, x, y, z) == 1) { + DistWorld_FindAndPrepareNewCurrentFloatingPlatform(fieldSystem, x, y, z); v0 = sub_020611FC(playerAvatar, param1, param2); } } } - if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_SURFING) { if (v0 & (1 << 7)) { v1 = 0x75; - v2 = 2; + v2 = PLAYER_ACTION_SPEED_SLOWER; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else if (v0 != 0) { v1 = 0x1c; - v2 = 1; + v2 = PLAYER_ACTION_SPEED_NOT_MOVING; Sound_PlayEffect(SEQ_SE_DP_WALL_HIT); MapObject_Turn(param1, param2); } else { PlayerData *player; v1 = 0xc; - v2 = 4; + v2 = PLAYER_ACTION_SPEED_NORMAL; player = PlayerAvatar_PlayerData(playerAvatar); if (PlayerData_HasRunningShoes(player) == TRUE && sub_020613FC(playerAvatar, param4) == 1) { v1 = 0x58; - v2 = 5; + v2 = PLAYER_ACTION_SPEED_FAST; } sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } } else { if ((v0 == 0) || (v0 == (1 << 5))) { - v2 = 5; + v2 = PLAYER_ACTION_SPEED_FAST; v1 = 0x10; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else { v1 = 0x1c; - v2 = 1; + v2 = PLAYER_ACTION_SPEED_NOT_MOVING; Sound_PlayEffect(SEQ_SE_DP_WALL_HIT); MapObject_Turn(param1, param2); } @@ -1049,7 +1049,7 @@ static void sub_0206000C(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v0 = sub_020611FC(playerAvatar, mapObj, param2); - if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_STATE_SURFING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_SURFING) { if (v0 != 0) { v1 = param8[param2]; v2 = 1; @@ -1075,7 +1075,7 @@ static void sub_0206000C(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v1 = param7[param2]; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else { v1 = param8[param2]; v2 = 1; @@ -1153,7 +1153,7 @@ static void sub_020602DC(PlayerAvatar *playerAvatar, MapObject *mapObj, const La { int v0; - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { sub_0206078C(playerAvatar, mapObj, param2, param3, param4, param5); } else { sub_02060420(playerAvatar, mapObj, param2, param3, param4, param5); @@ -1162,12 +1162,12 @@ static void sub_020602DC(PlayerAvatar *playerAvatar, MapObject *mapObj, const La static void PlayerAvatar_TryCyclingGearChange(PlayerAvatar *playerAvatar, u16 pad) { - if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_STATE_CYCLING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_CYCLING) { return; } if (pad & PAD_BUTTON_B) { - u32 v0 = MapObject_GetCurrTileBehavior(Player_MapObject(playerAvatar)); + u32 v0 = MapObject_GetCurrTileBehavior(PlayerAvatar_GetMapObject(playerAvatar)); if (TileBehavior_IsBikeRampEastward(v0) || TileBehavior_IsBikeRampWestward(v0)) { return; @@ -1176,7 +1176,7 @@ static void PlayerAvatar_TryCyclingGearChange(PlayerAvatar *playerAvatar, u16 pa { int gear = 1; - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { gear = 0; } @@ -1195,7 +1195,7 @@ int sub_02060390(PlayerAvatar *playerAvatar, int param1) { int v0 = 0x4c; - switch (PlayerAvatar_Speed(playerAvatar)) { + switch (PlayerAvatar_GetSpeed(playerAvatar)) { case 1: v0 = 0x10; break; @@ -1215,9 +1215,9 @@ static int sub_020603BC(PlayerAvatar *playerAvatar) { int v0 = PlayerAvatar_AddMoveSpeed(playerAvatar, 1, 3); - if (sub_0205EFB0(playerAvatar) == 0) { + if (PlayerAvatar_CheckBikeBrake(playerAvatar) == 0) { if (v0 >= 2) { - sub_0205EF98(playerAvatar, 1); + PlayerAvatar_SetBikeBrake(playerAvatar, 1); } } @@ -1231,7 +1231,7 @@ static int sub_020603BC(PlayerAvatar *playerAvatar) static int sub_020603EC(PlayerAvatar *playerAvatar) { int v0 = 1; - int v1 = PlayerAvatar_Speed(playerAvatar); + int v1 = PlayerAvatar_GetSpeed(playerAvatar); v1--; @@ -1242,9 +1242,9 @@ static int sub_020603EC(PlayerAvatar *playerAvatar) PlayerAvatar_SetSpeed(playerAvatar, v1); - if (sub_0205EFB0(playerAvatar) == 1) { + if (PlayerAvatar_CheckBikeBrake(playerAvatar) == 1) { if (v1 == 0) { - sub_0205EF98(playerAvatar, 0); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); } } @@ -1276,7 +1276,7 @@ static int sub_02060494(PlayerAvatar *playerAvatar, int param1) int v0 = sub_020604E4(playerAvatar, param1); int v1 = sub_020604B0(v0); - sub_0205EB08(playerAvatar, v1); + PlayerAvatar_SetMoveState(playerAvatar, v1); return v0; } @@ -1302,24 +1302,24 @@ static int sub_020604E4(PlayerAvatar *playerAvatar, int param1) int dir; if (param1 == -1) { - if (sub_0205EFB0(playerAvatar) == 1) { - sub_0205EB08(playerAvatar, 1); + if (PlayerAvatar_CheckBikeBrake(playerAvatar) == 1) { + PlayerAvatar_SetMoveState(playerAvatar, 1); return 3; } - sub_0205EB08(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); return 0; } - dir = PlayerAvatar_GetDir(playerAvatar); - sub_0205EF98(playerAvatar, 0); + dir = PlayerAvatar_GetFacingDir(playerAvatar); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); - if ((dir != param1) && (PlayerAvatar_MoveState(playerAvatar) != 1)) { - sub_0205EB08(playerAvatar, 2); + if ((dir != param1) && (PlayerAvatar_GetMoveState(playerAvatar) != 1)) { + PlayerAvatar_SetMoveState(playerAvatar, 2); return 2; } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } @@ -1343,18 +1343,18 @@ static void sub_02060570(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v1 = 0x38; v2 = 3; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else if (v0 & (1 << 7)) { v1 = 0x75; v2 = 2; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else if (v0 & (1 << 4)) { v1 = 0x50; v2 = 5; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); - sub_0205EF40(playerAvatar, TRUE); + PlayerAvatar_StartStep(playerAvatar); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); } else if (v0 & (1 << 6)) { v1 = 0x0; v2 = 1; @@ -1385,7 +1385,7 @@ static void sub_02060570(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v1 = 0x50; v2 = 5; sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); PlayerAvatar_SetSpeed(playerAvatar, 2); } @@ -1412,7 +1412,7 @@ static void sub_020606C8(PlayerAvatar *playerAvatar, MapObject *mapObj, int dir, int v1; int v2, v3 = sub_020603EC(playerAvatar); - dir = PlayerAvatar_GetMoveDir(playerAvatar); + dir = PlayerAvatar_GetMovingDir(playerAvatar); v0 = sub_02060B7C(playerAvatar, mapObj, dir); if (v0 & (1 << 2)) { @@ -1442,7 +1442,7 @@ static void sub_020606C8(PlayerAvatar *playerAvatar, MapObject *mapObj, int dir, } if (v3 == 0) { - sub_0205EF98(playerAvatar, 0); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); } sub_02060B64(playerAvatar, mapObj, v2, v1); @@ -1473,7 +1473,7 @@ static int sub_02060800(PlayerAvatar *playerAvatar, int param1) int v0 = sub_02060850(playerAvatar, param1); int v1 = sub_0206081C(v0); - sub_0205EB08(playerAvatar, v1); + PlayerAvatar_SetMoveState(playerAvatar, v1); return v0; } @@ -1498,31 +1498,31 @@ static int sub_02060850(PlayerAvatar *playerAvatar, int param1) { int v0, v1; - v1 = PlayerAvatar_Speed(playerAvatar); + v1 = PlayerAvatar_GetSpeed(playerAvatar); if (param1 == -1) { if (v1 < 2) { - sub_0205EB08(playerAvatar, 0); + PlayerAvatar_SetMoveState(playerAvatar, 0); return 0; } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 3; } - v0 = PlayerAvatar_GetDir(playerAvatar); + v0 = PlayerAvatar_GetFacingDir(playerAvatar); - if ((v0 != param1) && (PlayerAvatar_MoveState(playerAvatar) != 1)) { + if ((v0 != param1) && (PlayerAvatar_GetMoveState(playerAvatar) != 1)) { if (v1 < 2) { - sub_0205EB08(playerAvatar, 2); + PlayerAvatar_SetMoveState(playerAvatar, 2); return 2; } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 3; } - sub_0205EB08(playerAvatar, 1); + PlayerAvatar_SetMoveState(playerAvatar, 1); return 1; } @@ -1547,19 +1547,19 @@ static void sub_020608E4(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v2 = 3; sub_020603BC(playerAvatar); sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else if (v0 & (1 << 7)) { v1 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_JUMP_DISTORTION_WORLD_NORTH); v2 = 2; sub_020603BC(playerAvatar); sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } else if (v0 & (1 << 4)) { - if (PlayerAvatar_Speed(playerAvatar) >= 3) { + if (PlayerAvatar_GetSpeed(playerAvatar) >= 3) { v1 = sub_02060390(playerAvatar, param2); v2 = 5; - sub_0205F048(playerAvatar); - sub_0205EF40(playerAvatar, TRUE); + PlayerAvatar_StartStep(playerAvatar); + PlayerAvatar_SetForceMovement(playerAvatar, TRUE); } else { v1 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); v2 = 1; @@ -1602,7 +1602,7 @@ static void sub_020608E4(PlayerAvatar *playerAvatar, MapObject *mapObj, int para v1 = sub_02060390(playerAvatar, param2); sub_020603BC(playerAvatar); sub_020615C8(playerAvatar); - sub_0205F048(playerAvatar); + PlayerAvatar_StartStep(playerAvatar); } sub_02060B64(playerAvatar, mapObj, v1, v2); @@ -1629,22 +1629,22 @@ static void sub_02060AA0(PlayerAvatar *playerAvatar, MapObject *mapObj, int para int v1; int v2, v3 = sub_020603EC(playerAvatar); - param2 = PlayerAvatar_GetMoveDir(playerAvatar); + param2 = PlayerAvatar_GetMovingDir(playerAvatar); v0 = sub_02060B7C(playerAvatar, mapObj, param2); if (v0 & (1 << 2)) { v2 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_JUMP_FAR_NORTH); - v1 = 3; + v1 = PLAYER_ACTION_SPEED_SLOW; } else if (v0 & (1 << 7)) { v2 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_JUMP_DISTORTION_WORLD_NORTH); - v1 = 2; + v1 = PLAYER_ACTION_SPEED_SLOWER; } else if (v0 & (1 << 6)) { v2 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_FACE_NORTH); - v1 = 1; + v1 = PLAYER_ACTION_SPEED_NOT_MOVING; PlayerAvatar_ClearSpeed(playerAvatar); } else if (v0 != 0) { v3 = 0; - v1 = 1; + v1 = PLAYER_ACTION_SPEED_NOT_MOVING; v2 = MovementAction_TurnActionTowardsDir(param2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); if ((v0 & (1 << 3)) == 0) { @@ -1655,11 +1655,11 @@ static void sub_02060AA0(PlayerAvatar *playerAvatar, MapObject *mapObj, int para PlayerAvatar_ClearSpeed(playerAvatar); } else { v2 = sub_02060390(playerAvatar, param2); - v1 = 5; + v1 = PLAYER_ACTION_SPEED_FAST; } if (v3 == 0) { - sub_0205EF98(playerAvatar, 0); + PlayerAvatar_SetBikeBrake(playerAvatar, 0); } sub_02060B64(playerAvatar, mapObj, v2, v1); @@ -1667,7 +1667,7 @@ static void sub_02060AA0(PlayerAvatar *playerAvatar, MapObject *mapObj, int para static void sub_02060B64(PlayerAvatar *playerAvatar, MapObject *mapObj, enum MovementAction movementAction, int param3) { - sub_0205EC20(playerAvatar, movementAction, param3); + PlayerAvatar_SetMovementActionAndSpeed(playerAvatar, movementAction, param3); LocalMapObj_SetAnimationCode(mapObj, movementAction); } @@ -1824,7 +1824,7 @@ static int sub_02060D98(PlayerAvatar *playerAvatar, MapObject *mapObj, int param if (v0 == 1) { if (PersistedMapFeatures_IsCurrentDynamicMap(fieldSystem, DYNAMIC_MAP_FEATURES_DISTORTION_WORLD) == 1) { - if (ov9_022511A0(fieldSystem, v2, v3, param2) == 1) { + if (DistWorld_IsBlockedByCynthia(fieldSystem, v2, v3, param2) == 1) { v0 = 0; } } @@ -1921,7 +1921,7 @@ static int sub_02060FA8(PlayerAvatar *playerAvatar, MapObject *mapObj, int param int v2 = MapObject_GetZ(mapObj) + MapObject_GetDzFromDir(param2); u8 v3 = TerrainCollisionManager_GetTileBehavior(fieldSystem, v1, v2); - if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_CYCLING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_AVATAR_CYCLING) { if (MapObject_IsOnBikeBridgeNorthSouth(mapObj, v3) == 1) { if ((param2 == 0) || (param2 == 1)) { return 0; @@ -1949,7 +1949,7 @@ static int sub_02060FA8(PlayerAvatar *playerAvatar, MapObject *mapObj, int param static int sub_02061058(PlayerAvatar *playerAvatar, MapObject *mapObj, int param2) { - if ((param2 != -1) && PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_STATE_CYCLING) { + if ((param2 != -1) && PlayerAvatar_GetPlayerState(playerAvatar) == PLAYER_AVATAR_CYCLING) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); int v1 = MapObject_GetX(mapObj) + MapObject_GetDxFromDir(param2); int v2 = MapObject_GetZ(mapObj) + MapObject_GetDzFromDir(param2); @@ -2136,7 +2136,7 @@ static enum FaceDirection PlayerAvatar_CalcFaceDirectionInternal(PlayerAvatar *p } { - int dir = PlayerAvatar_GetMoveDir(playerAvatar); + int dir = PlayerAvatar_GetMovingDir(playerAvatar); enum FaceDirection avatarFaceLeftOrRight = PlayerAvatar_GetFaceLeftOrRight(playerAvatar); enum FaceDirection avatarFaceUpOrDown = PlayerAvatar_GetFaceUpOrDown(playerAvatar); @@ -2160,7 +2160,7 @@ static enum FaceDirection PlayerAvatar_CalcFaceDirectionInternal(PlayerAvatar *p BOOL PlayerAvatar_IsAnimationSetOrWalkOnSpotSlow(PlayerAvatar *playerAvatar) { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (LocalMapObj_IsAnimationSet(mapObj) == TRUE) { return TRUE; @@ -2199,7 +2199,7 @@ int sub_020613FC(PlayerAvatar *playerAvatar, u16 pad) int sub_0206140C(PlayerAvatar *playerAvatar) { - u32 v0 = sub_0205EC14(playerAvatar); + u32 v0 = PlayerAvatar_GetMovementAction(playerAvatar); switch (v0) { case 0x58: @@ -2217,13 +2217,13 @@ int sub_02061434(PlayerAvatar *playerAvatar, int param1) int v0, v1, state = PlayerAvatar_GetPlayerState(playerAvatar); switch (state) { - case PLAYER_STATE_WALKING: - case PLAYER_STATE_SURFING: + case PLAYER_AVATAR_WALKING: + case PLAYER_AVATAR_SURFING: v0 = sub_0205FCC0(playerAvatar, param1); v1 = sub_0205FC64(v0); break; - case PLAYER_STATE_CYCLING: - if (PlayerAvatar_CyclingGear(playerAvatar) == 1) { + case PLAYER_AVATAR_CYCLING: + if (PlayerAvatar_GetCyclingGear(playerAvatar) == 1) { v0 = sub_02060850(playerAvatar, param1); v1 = sub_0206081C(v0); } else { @@ -2246,10 +2246,10 @@ u32 sub_0206147C(PlayerAvatar *playerAvatar, u16 param1, u16 param2, int param3, int v1 = PlayerAvatar_CalcFaceDirectionInternal(playerAvatar, param1, param2); int v2 = sub_02061434(playerAvatar, v1); - sub_0205EB08(playerAvatar, v2); + PlayerAvatar_SetMoveState(playerAvatar, v2); if (v2 == 0) { - v1 = PlayerAvatar_GetDir(playerAvatar); + v1 = PlayerAvatar_GetFacingDir(playerAvatar); v0 = MovementAction_TurnActionTowardsDir(v1, MOVEMENT_ACTION_FACE_NORTH); return v0; } @@ -2260,7 +2260,7 @@ u32 sub_0206147C(PlayerAvatar *playerAvatar, u16 param1, u16 param2, int param3, } { - MapObject *v3 = Player_MapObject(playerAvatar); + MapObject *v3 = PlayerAvatar_GetMapObject(playerAvatar); u32 v4 = param5; if (v4 & (1 << 2)) { @@ -2311,37 +2311,37 @@ u32 sub_0206147C(PlayerAvatar *playerAvatar, u16 param1, u16 param2, int param3, int sub_02061544(PlayerAvatar *playerAvatar) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); return LocalMapObj_IsAnimationSet(v0); } void PlayerAvatar_SetAnimationCode(PlayerAvatar *playerAvatar, enum MovementAction movementAction, int param2) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); sub_02060B64(playerAvatar, v0, movementAction, param2); } u32 sub_0206156C(PlayerAvatar *playerAvatar, int param1) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); return MapObject_GetTileBehaviorFromDir(v0, param1); } void PlayerAvatar_MoveCoordsInDirection(PlayerAvatar *playerAvatar, int facingDirection, int *x, int *z) { - *x = Player_GetXPos(playerAvatar) + MapObject_GetDxFromDir(facingDirection); - *z = Player_GetZPos(playerAvatar) + MapObject_GetDzFromDir(facingDirection); + *x = PlayerAvatar_GetXPos(playerAvatar) + MapObject_GetDxFromDir(facingDirection); + *z = PlayerAvatar_GetZPos(playerAvatar) + MapObject_GetDzFromDir(facingDirection); } void PlayerAvatar_GetFacingTileCoords(PlayerAvatar *playerAvatar, int *x, int *z) { - int facingDirection = PlayerAvatar_GetDir(playerAvatar); + int facingDirection = PlayerAvatar_GetFacingDir(playerAvatar); PlayerAvatar_MoveCoordsInDirection(playerAvatar, facingDirection, x, z); } static void sub_020615C8(PlayerAvatar *playerAvatar) { - MapObject *v0 = Player_MapObject(playerAvatar); + MapObject *v0 = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(v0); GameRecords *v2 = SaveData_GetGameRecords(fieldSystem->saveData); @@ -2379,7 +2379,7 @@ static int sub_02061630(PlayerAvatar *playerAvatar, u32 tileBehavior, int param2 return FALSE; } - if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_STATE_CYCLING) { + if (PlayerAvatar_GetPlayerState(playerAvatar) != PLAYER_AVATAR_CYCLING) { return FALSE; } @@ -2387,7 +2387,7 @@ static int sub_02061630(PlayerAvatar *playerAvatar, u32 tileBehavior, int param2 return FALSE; } - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); if (MapObject_IsOnElevatedBridge(mapObj, tileBehavior) == TRUE) { return TRUE; @@ -2432,7 +2432,7 @@ u32 PlayerAvatar_GetDistortionFacingTileBehaviour(PlayerAvatar *playerAvatar, in if (PlayerAvatar_DistortionGravityChanged(playerAvatar) == FALSE) { v0 = sub_0206156C(playerAvatar, distortionDir); } else { - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); int x = MapObject_GetX(mapObj); int y = MapObject_GetY(mapObj) / 2; @@ -2448,7 +2448,7 @@ u32 PlayerAvatar_GetDistortionFacingTileBehaviour(PlayerAvatar *playerAvatar, in u32 PlayerAvatar_GetDistortionCurrTileBehaviour(PlayerAvatar *playerAvatar) { u32 v0; - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); int x = MapObject_GetX(mapObj); int y = MapObject_GetY(mapObj) / 2; @@ -2466,7 +2466,7 @@ u32 PlayerAvatar_GetDistortionCurrTileBehaviour(PlayerAvatar *playerAvatar) void sub_020617BC(PlayerAvatar *const playerAvatar, int *xOut, int *yOut, int *zOut) { int v0 = PlayerAvatar_GetDistortionDir(playerAvatar); - MapObject *mapObj = Player_MapObject(playerAvatar); + MapObject *mapObj = PlayerAvatar_GetMapObject(playerAvatar); *xOut = MapObject_GetX(mapObj); *yOut = MapObject_GetY(mapObj) / 2; diff --git a/src/unk_0206450C.c b/src/unk_0206450C.c index 130060bf8f..243a6e73e2 100644 --- a/src/unk_0206450C.c +++ b/src/unk_0206450C.c @@ -1303,7 +1303,7 @@ static int sub_0206537C(MapObject *mapObj) } { - const MapObject *v5 = Player_MapObject(playerAvatar); + const MapObject *v5 = PlayerAvatar_GetMapObject(playerAvatar); int v6 = sub_020630DC(v5); int v7 = sub_020630DC(mapObj); @@ -1313,8 +1313,8 @@ static int sub_0206537C(MapObject *mapObj) } { - int v8 = Player_GetXPos(playerAvatar); - int v9 = Player_GetZPos(playerAvatar); + int v8 = PlayerAvatar_GetXPos(playerAvatar); + int v9 = PlayerAvatar_GetZPos(playerAvatar); int v10 = MapObject_GetDataAt(mapObj, 0); int v11 = MapObject_GetX(mapObj); int v12 = MapObject_GetZ(mapObj); @@ -1369,8 +1369,8 @@ static int sub_02065448(MapObject *mapObj, int param1, int param2) int v7 = MapObject_GetZ(mapObj); FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); - int v10 = Player_GetXPos(playerAvatar); - int v11 = Player_GetZPos(playerAvatar); + int v10 = PlayerAvatar_GetXPos(playerAvatar); + int v11 = PlayerAvatar_GetZPos(playerAvatar); if (v6 > v10) { v4 = 2; diff --git a/src/unk_02069BE0.c b/src/unk_02069BE0.c index 2ec521199f..ba7b2b8b0c 100644 --- a/src/unk_02069BE0.c +++ b/src/unk_02069BE0.c @@ -80,7 +80,7 @@ void sub_02069BE0(MapObject *mapObj) UnkStruct_02069CA8 *v0 = sub_02062A54(mapObj, (sizeof(UnkStruct_02069CA8))); sub_02069CA8(mapObj, v0); - sub_02062A0C(mapObj, 0x0); + sub_02062A0C(mapObj, 0); sub_02062D10(mapObj); sub_02062D80(mapObj, 0); } @@ -116,11 +116,11 @@ static int sub_02069C48(MapObject *mapObj, UnkStruct_02069CA8 *param1) if (sub_02069D8C(mapObj) == 1) { sub_02062D04(mapObj); param1->unk_00++; - return 1; + return TRUE; } } - return 0; + return FALSE; } static int sub_02069C8C(MapObject *mapObj, UnkStruct_02069CA8 *param1) @@ -141,7 +141,7 @@ static int (*const Unk_020EF8D4[])(MapObject *, UnkStruct_02069CA8 *) = { static int sub_02069CA8(MapObject *mapObj, UnkStruct_02069CA8 *param1) { const MapObjectManager *v0 = MapObject_MapObjectManager(mapObj); - MapObject *v1 = sub_0205EA24(v0); + MapObject *v1 = MapObjectMan_GetPlayerMapObject(v0); if (v1 == NULL) { param1->unk_01 = 0; @@ -161,8 +161,8 @@ static void sub_02069CD4(MapObject *mapObj, UnkStruct_02069CA8 *param1) PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); param1->unk_01 = 1; - param1->unk_02 = Player_GetXPos(playerAvatar); - param1->unk_04 = Player_GetZPos(playerAvatar); + param1->unk_02 = PlayerAvatar_GetXPos(playerAvatar); + param1->unk_04 = PlayerAvatar_GetZPos(playerAvatar); param1->unk_06 = 0xff; } @@ -172,8 +172,8 @@ static int sub_02069CFC(MapObject *mapObj, UnkStruct_02069CA8 *param1) PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); if (playerAvatar != NULL) { - int v2 = Player_GetXPos(playerAvatar); - int v3 = Player_GetZPos(playerAvatar); + int v2 = PlayerAvatar_GetXPos(playerAvatar); + int v3 = PlayerAvatar_GetZPos(playerAvatar); if ((v2 != param1->unk_02) || (v3 != param1->unk_04)) { return 1; @@ -188,8 +188,8 @@ static void sub_02069D30(MapObject *mapObj, UnkStruct_02069CA8 *param1) FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); - param1->unk_02 = Player_GetXPos(playerAvatar); - param1->unk_04 = Player_GetZPos(playerAvatar); + param1->unk_02 = PlayerAvatar_GetXPos(playerAvatar); + param1->unk_04 = PlayerAvatar_GetZPos(playerAvatar); } static u32 sub_02069D50(MapObject *mapObj) @@ -198,7 +198,7 @@ static u32 sub_02069D50(MapObject *mapObj) FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); - v0 = sub_0205EC14(playerAvatar); + v0 = PlayerAvatar_GetMovementAction(playerAvatar); switch (v0) { case 0x58: @@ -222,16 +222,16 @@ static int sub_02069D8C(MapObject *mapObj) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); PlayerAvatar *playerAvatar = FieldSystem_GetPlayerAvatar(fieldSystem); - int v2 = MapObject_GetX(mapObj); - int v3 = MapObject_GetZ(mapObj); - int v4 = PlayerAvatar_XPosPrev(playerAvatar); - int v5 = PlayerAvatar_ZPosPrev(playerAvatar); + int xCur = MapObject_GetX(mapObj); + int zCur = MapObject_GetZ(mapObj); + int xPrev = PlayerAvatar_XPosPrev(playerAvatar); + int zPrev = PlayerAvatar_ZPosPrev(playerAvatar); - if ((v2 != v4) || (v3 != v5)) { + if (xCur != xPrev || zCur != zPrev) { u32 v6 = sub_02069D50(mapObj); - int v7 = GetDirectionBetweenPoints(v2, v3, v4, v5); + int dir = GetDirectionBetweenPoints(xCur, zCur, xPrev, zPrev); - v6 = MovementAction_TurnActionTowardsDir(v7, v6); + v6 = MovementAction_TurnActionTowardsDir(dir, v6); sub_02065668(mapObj, v6); return 1; @@ -629,7 +629,7 @@ static int sub_0206A324(MapObject *mapObj, UnkStruct_0206A23C *param1) if (param1->unk_01 == -1) { FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - param1->unk_01 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); + param1->unk_01 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); } sub_02062D10(mapObj); @@ -675,29 +675,29 @@ static int sub_0206A3BC(MapObject *mapObj, UnkStruct_0206A23C *param1) { int v0; FieldSystem *fieldSystem = MapObject_FieldSystem(mapObj); - int v2 = PlayerAvatar_GetDir(fieldSystem->playerAvatar); - u32 v3 = sub_0205EC1C(fieldSystem->playerAvatar); + int v2 = PlayerAvatar_GetFacingDir(fieldSystem->playerAvatar); + u32 v3 = PlayerAvatar_GetMovementActionSpeed(fieldSystem->playerAvatar); switch (v3) { - case 0: - case 1: + case PLAYER_ACTION_SPEED_NONE: + case PLAYER_ACTION_SPEED_NOT_MOVING: v0 = MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_FACE_NORTH); sub_02065668(mapObj, v0); break; - case 2: - sub_0206A37C(mapObj, v2, 0x4, param1->unk_02); + case PLAYER_ACTION_SPEED_SLOWER: + sub_0206A37C(mapObj, v2, MOVEMENT_ACTION_WALK_SLOWER_NORTH, param1->unk_02); break; - case 3: - sub_0206A37C(mapObj, v2, 0x8, param1->unk_02); + case PLAYER_ACTION_SPEED_SLOW: + sub_0206A37C(mapObj, v2, MOVEMENT_ACTION_WALK_SLOW_NORTH, param1->unk_02); break; - case 4: - sub_0206A37C(mapObj, v2, 0xc, param1->unk_02); + case PLAYER_ACTION_SPEED_NORMAL: + sub_0206A37C(mapObj, v2, MOVEMENT_ACTION_WALK_NORMAL_NORTH, param1->unk_02); break; - case 5: - sub_0206A37C(mapObj, v2, 0x10, param1->unk_02); + case PLAYER_ACTION_SPEED_FAST: + sub_0206A37C(mapObj, v2, MOVEMENT_ACTION_WALK_FAST_NORTH, param1->unk_02); break; - case 6: - sub_0206A37C(mapObj, v2, 0x14, param1->unk_02); + case PLAYER_ACTION_SPEED_FASTER: + sub_0206A37C(mapObj, v2, MOVEMENT_ACTION_WALK_FASTER_NORTH, param1->unk_02); break; } @@ -915,40 +915,40 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param { u32 v0; int v1 = param1->unk_08; - int v2 = MapObject_GetFacingDir(mapObj); + int dir = MapObject_GetFacingDir(mapObj); - v0 = sub_0206A60C(mapObj, &v2, v1); + v0 = sub_0206A60C(mapObj, &dir, v1); - if (v2 == -1) { - v2 = MapObject_GetFacingDir(mapObj); - param2 = MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); + if (dir == -1) { + dir = MapObject_GetFacingDir(mapObj); + param2 = MovementAction_TurnActionTowardsDir(dir, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); sub_02065668(mapObj, param2); return 0; } if (v0 == 0) { - param2 = MovementAction_TurnActionTowardsDir(v2, param2); + param2 = MovementAction_TurnActionTowardsDir(dir, param2); sub_02062D04(mapObj); sub_02065668(mapObj, param2); return 1; } if ((v0 & (1 << 0)) && (param1->unk_04 == 2)) { - v2 = Direction_GetOpposite(MapObject_GetFacingDir(mapObj)); + dir = Direction_GetOpposite(MapObject_GetFacingDir(mapObj)); v1 = Unk_020EF8E4[v1]; param1->unk_08 = v1; - v0 = sub_0206A60C(mapObj, &v2, v1); + v0 = sub_0206A60C(mapObj, &dir, v1); - if (v2 == -1) { - v2 = MapObject_GetFacingDir(mapObj); - param2 = MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); + if (dir == -1) { + dir = MapObject_GetFacingDir(mapObj); + param2 = MovementAction_TurnActionTowardsDir(dir, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); sub_02065668(mapObj, param2); return 0; } if (v0 == 0) { - param2 = MovementAction_TurnActionTowardsDir(v2, param2); + param2 = MovementAction_TurnActionTowardsDir(dir, param2); sub_02062D04(mapObj); sub_02065668(mapObj, param2); return 1; @@ -956,26 +956,26 @@ static int sub_0206A630(MapObject *mapObj, UnkStruct_0206A47C *param1, int param } if (v0 & (1 << 1)) { - v2 = Unk_020EF9CC[v2][v1]; - v0 = sub_0206A60C(mapObj, &v2, v1); + dir = Unk_020EF9CC[dir][v1]; + v0 = sub_0206A60C(mapObj, &dir, v1); - if (v2 == -1) { - v2 = MapObject_GetFacingDir(mapObj); - param2 = MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); + if (dir == -1) { + dir = MapObject_GetFacingDir(mapObj); + param2 = MovementAction_TurnActionTowardsDir(dir, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); sub_02065668(mapObj, param2); return 0; } if (v0 == 0) { - param2 = MovementAction_TurnActionTowardsDir(v2, param2); + param2 = MovementAction_TurnActionTowardsDir(dir, param2); sub_02062D04(mapObj); sub_02065668(mapObj, param2); return 1; } } - v2 = MapObject_GetFacingDir(mapObj); - param2 = MovementAction_TurnActionTowardsDir(v2, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); + dir = MapObject_GetFacingDir(mapObj); + param2 = MovementAction_TurnActionTowardsDir(dir, MOVEMENT_ACTION_WALK_ON_SPOT_SLOW_NORTH); sub_02065668(mapObj, param2); return 0; diff --git a/src/unk_02070428.c b/src/unk_02070428.c index 4b7e353a47..e6286520f8 100644 --- a/src/unk_02070428.c +++ b/src/unk_02070428.c @@ -89,10 +89,10 @@ void FieldSystem_InitFlagsWarp(FieldSystem *fieldSystem) { PlayerData *v2 = FieldOverworldState_GetPlayerData(SaveData_GetFieldOverworldState(fieldSystem->saveData)); - if ((v2->form == PLAYER_AVATAR_BIKING) && (MapHeader_IsBikeAllowed(fieldSystem->location->mapId) == 0)) { - v2->form = PLAYER_AVATAR_WALKING; - } else if (v2->form == PLAYER_AVATAR_SURFING) { - v2->form = PLAYER_AVATAR_WALKING; + if ((v2->playerState == PLAYER_AVATAR_CYCLING) && (MapHeader_IsBikeAllowed(fieldSystem->location->mapId) == 0)) { + v2->playerState = PLAYER_AVATAR_WALKING; + } else if (v2->playerState == PLAYER_AVATAR_SURFING) { + v2->playerState = PLAYER_AVATAR_WALKING; } } diff --git a/src/unk_020998EC.c b/src/unk_020998EC.c index 18960975c6..fc772de1e4 100644 --- a/src/unk_020998EC.c +++ b/src/unk_020998EC.c @@ -3,16 +3,14 @@ #include #include -#include "struct_decls/struct_02014D38_decl.h" -#include "struct_decls/struct_02014EC4_decl.h" #include "struct_decls/struct_020998EC_decl.h" #include "easy_chat_args.h" +#include "easy_chat_words.h" #include "heap.h" #include "inlines.h" #include "pokedex.h" #include "string_gf.h" -#include "unk_02014D38.h" static const u16 Unk_020F8420[] = { 0x1CC, @@ -3135,7 +3133,7 @@ static const u16 *const Unk_020F74D8[] = { struct UnkStruct_020998EC_t { const EasyChatArgs *unk_00; - UnkStruct_02014D38 *unk_04; + EasyChatWordLoader *unk_04; u32 unk_08[12]; u32 unk_38[12]; u16 unk_68[1495]; @@ -3165,7 +3163,7 @@ UnkStruct_020998EC *sub_020998EC(u32 heapID, const EasyChatArgs *param1) v0 = Heap_Alloc(heapID, sizeof(UnkStruct_020998EC)); v0->unk_00 = param1; - v0->unk_04 = sub_02014D38(heapID); + v0->unk_04 = EasyChatWordLoader_New(heapID); for (v1 = 0; v1 < ((1495 >> 3) + 1); v1++) { v0->unk_189E[v1] = 0; @@ -3180,7 +3178,7 @@ UnkStruct_020998EC *sub_020998EC(u32 heapID, const EasyChatArgs *param1) void sub_0209992C(UnkStruct_020998EC *param0) { if (param0) { - sub_02014D70(param0->unk_04); + EasyChatWordLoader_Free(param0->unk_04); Heap_Free(param0); } } @@ -3260,12 +3258,12 @@ static u32 sub_020999E0(UnkStruct_020998EC *param0, const u16 *param1, u32 param static u32 sub_02099A30(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const UnkStruct_02014EC4 *v0 = sub_02097560(param0->unk_00); + const UnlockedEasyChatWords *v0 = EasyChatArgs_GetUnlockedWords(param0->unk_00); u32 v1, v2; - u16 v3 = sub_02014DFC(444, 0); + u16 v3 = EasyChatWord_FromBankAndEntry(444, 0); for (v1 = 0, v2 = 0; v1 < param2; v1++) { - if (sub_02014ED8(v0, param1[v1] - v3)) { + if (EasyChatWords_IsToughWordUnlocked(v0, param1[v1] - v3)) { inline_02099980(param0, param1[v1]); *param3++ = param1[v1]; v2++; @@ -3277,11 +3275,11 @@ static u32 sub_02099A30(UnkStruct_020998EC *param0, const u16 *param1, u32 param static u32 sub_02099AA0(UnkStruct_020998EC *param0, const u16 *param1, u32 param2, u16 *param3) { - const UnkStruct_02014EC4 *v0 = sub_02097560(param0->unk_00); + const UnlockedEasyChatWords *v0 = EasyChatArgs_GetUnlockedWords(param0->unk_00); u16 v1, v2; u32 v3, v4; - v1 = sub_02014DFC(441, 0); + v1 = EasyChatWord_FromBankAndEntry(441, 0); v2 = v1 + 6 - 1; v4 = 0; @@ -3289,7 +3287,7 @@ static u32 sub_02099AA0(UnkStruct_020998EC *param0, const u16 *param1, u32 param if ((param1[v3] >= v1) && (param1[v3] <= v2)) { u32 v5 = param1[v3] - v1; - if (sub_02014F8C(v0, v5) == 0) { + if (EasyChatWords_IsGreetingUnlocked(v0, v5) == 0) { continue; } } @@ -3380,7 +3378,7 @@ u32 sub_02099CA0(const UnkStruct_020998EC *param0, u32 param1) void sub_02099CA8(const UnkStruct_020998EC *param0, u32 param1, u32 param2, String *param3) { u32 v0 = param0->unk_38[param1]; - sub_02014D90(param0->unk_04, param0->unk_68[v0 + param2], param3); + EasyChatWordLoader_GetString(param0->unk_04, param0->unk_68[v0 + param2], param3); } u16 sub_02099CC8(const UnkStruct_020998EC *param0, u32 param1, u32 param2) @@ -3398,7 +3396,7 @@ void sub_02099CEC(const UnkStruct_020998EC *param0, u32 param1, u32 param2, Stri { if (param0->unk_C18[param1]) { u16 v0 = sub_02099D14(param0, param1, param2); - sub_02014D90(param0->unk_04, v0, param3); + EasyChatWordLoader_GetString(param0->unk_04, v0, param3); } } diff --git a/src/unk_0209ACF4.c b/src/unk_0209ACF4.c index 413040f29e..cd48745664 100644 --- a/src/unk_0209ACF4.c +++ b/src/unk_0209ACF4.c @@ -3,14 +3,13 @@ #include #include -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "overlay005/fieldmap.h" #include "bg_window.h" #include "colored_arrow.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "field_message.h" #include "field_task.h" #include "heap.h" @@ -23,7 +22,6 @@ #include "string_template.h" #include "system.h" #include "text.h" -#include "unk_02014A84.h" #include "unk_0202D05C.h" #include "unk_0203D1B8.h" @@ -39,7 +37,7 @@ typedef struct { Window unk_18; Window unk_28; Window unk_38; - Sentence unk_48; + EasyChatSentence unk_48; EasyChatArgs *unk_50; int unk_54; int unk_58; @@ -137,19 +135,19 @@ static BOOL sub_0209AE14(FieldTask *param0) switch (v0->unk_64) { case 0: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 0)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 0)); v0->unk_54 = 3; break; case 1: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 1)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 1)); v0->unk_54 = 3; break; case 2: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 2)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 2)); v0->unk_54 = 3; break; case 3: - Sentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 3)); + EasyChatSentence_Copy(&(v0->unk_48), sub_0202D498(v0->fieldSystem->saveData, 3)); v0->unk_54 = 3; break; case 4: @@ -219,11 +217,11 @@ static BOOL sub_0209AE14(FieldTask *param0) break; case 1: default: { - u16 v1 = Sentence_GetWord(&v0->unk_48, 0); + u16 v1 = EasyChatSentence_GetWord(&v0->unk_48, 0); sub_0209B27C(v0); - if (v1 != 0xffff) { - StringTemplate_SetCustomMessageWord(v0->unk_0C, 0, v1); + if (v1 != WORD_NONE) { + StringTemplate_SetEasyChatWord(v0->unk_0C, 0, v1); sub_0209B084(v0, 8, 1); } else { sub_0209B084(v0, 7, 0); diff --git a/src/unk_0209B344.c b/src/unk_0209B344.c index c237a036ad..71e79b4553 100644 --- a/src/unk_0209B344.c +++ b/src/unk_0209B344.c @@ -3,18 +3,16 @@ #include #include -#include "struct_defs/sentence.h" - #include "field/field_system.h" #include "overlay005/fieldmap.h" #include "easy_chat_args.h" +#include "easy_chat_sentence.h" #include "field_task.h" #include "heap.h" #include "savedata_misc.h" #include "screen_fade.h" #include "string_template.h" -#include "unk_02014A84.h" #include "unk_0203D1B8.h" #include "res/text/bank/easy_chat.h" @@ -22,7 +20,7 @@ typedef struct { FieldSystem *fieldSystem; StringTemplate *unk_04; - Sentence unk_08; + EasyChatSentence unk_08; EasyChatArgs *unk_10; MiscSaveBlock *unk_14; int unk_18; @@ -44,7 +42,7 @@ void sub_0209B344(FieldTask *param0, u16 *param1) v1->unk_14 = SaveData_MiscSaveBlock(fieldSystem->saveData); v1->unk_20 = param1; - Sentence_InitWithType(&v1->unk_08, 4); + EasyChatSentence_InitWithType(&v1->unk_08, EASY_CHAT_SENTENCE_TYPE_UNION_ROOM); MiscSaveBlock_IntroMsg(v1->unk_14, &v1->unk_08); sub_02097520(v1->unk_10); diff --git a/src/unk_0209BA18.c b/src/unk_0209BA18.c index ff115c371c..7b7d6c5125 100644 --- a/src/unk_0209BA18.c +++ b/src/unk_0209BA18.c @@ -25,10 +25,10 @@ UnkStruct_ov104_02230BE4 *sub_0209BA18(FieldSystem *fieldSystem, void *param1) v0->saveData = fieldSystem->saveData; v0->journalEntry = fieldSystem->journalEntry; v0->bagCursor = fieldSystem->bagCursor; - v0->unk_20 = fieldSystem->battleSubscreenCursorOn; + v0->subscreenCursorOn = fieldSystem->battleSubscreenCursorOn; v0->unk_14 = 0; v0->unk_18 = 0; - v0->unk_1C = fieldSystem->location->mapId; + v0->mapHeaderID = fieldSystem->location->mapId; v0->sceneID = 14; v0->fieldSystem = fieldSystem; diff --git a/src/wifi_list.c b/src/wifi_list.c index 70bcbc8e97..b8c34db7c1 100644 --- a/src/wifi_list.c +++ b/src/wifi_list.c @@ -156,23 +156,23 @@ void sub_0202AF50(WiFiList *wiFiList, int param1, String *param2) String_ToChars(param2, wiFiList->unk_1C0[param1].unk_00, sizeof(wiFiList->unk_1C0[param1].unk_00)); } -BOOL sub_0202AF78(WiFiList *wiFiList, int param1) +BOOL WiFiList_IsValidFriendData(WiFiList *wiFiList, int param1) { GF_ASSERT(param1 < 32); return DWC_IsValidFriendData(&wiFiList->friendData[param1]); } -int sub_0202AF94(WiFiList *wiFiList) +int WiFiList_GetValidFriendsCount(WiFiList *wiFiList) { - int v0, v1 = 0; + int i, validFriendsCount = 0; - for (v0 = 0; v0 < 32; v0++) { - if (sub_0202AF78(wiFiList, v0)) { - v1++; + for (i = 0; i < 32; i++) { + if (WiFiList_IsValidFriendData(wiFiList, i)) { + validFriendsCount++; } } - return v1; + return validFriendsCount; } int sub_0202AFB4(WiFiList *wiFiList) @@ -180,7 +180,7 @@ int sub_0202AFB4(WiFiList *wiFiList) int v0, v1 = 0; for (v0 = 0; v0 < 32; v0++) { - if (sub_0202AF78(wiFiList, v0)) { + if (WiFiList_IsValidFriendData(wiFiList, v0)) { v1 = v0 + 1; } } @@ -226,7 +226,7 @@ void sub_0202B0F8(WiFiList *wiFiList) int i, v1 = -1; for (i = 0; i < 32; i++) { - if (sub_0202AF78(wiFiList, i)) { + if (WiFiList_IsValidFriendData(wiFiList, i)) { if (v1 != -1) { sub_0202B088(wiFiList, v1, i); diff --git a/tools/dataproc/src/common.c b/tools/dataproc/src/common.c index 165e490eae..5812f19b03 100644 --- a/tools/dataproc/src/common.c +++ b/tools/dataproc/src/common.c @@ -662,6 +662,12 @@ void bank_pushraw(datanode_t *root, const char *id, const char *content) { dp_obj_putstring(&entry, "en_US", content); } +void bank_pushgarbage(datanode_t *root, const char *id, uint64_t size) { + datanode_t entry = dp_arr_appobject(root); + dp_obj_putstring(&entry, "id", id); + dp_obj_putint(&entry, "garbage", size); +} + void bank_pushlines(datanode_t *root, const char *id, ...) { va_list content; va_start(content, id); diff --git a/tools/dataproc/src/common.h b/tools/dataproc/src/common.h index 6ba2892068..92136dba0c 100644 --- a/tools/dataproc/src/common.h +++ b/tools/dataproc/src/common.h @@ -188,13 +188,17 @@ nitroarc_packer_t init_narc(u16 num_files, bool named, bool stripped); void bank_pushnode(datanode_t *root, const char *id, datanode_t content); void bank_pushraw(datanode_t *root, const char *id, const char *content); +void bank_pushgarbage(datanode_t *root, const char *id, uint64_t size); void bank_pushlines(datanode_t *root, const char *id, ...); #define bank_push(bank, id, content) \ _Generic((content), \ char *: bank_pushraw, \ const char *: bank_pushraw, \ - datanode_t: bank_pushnode \ + datanode_t: bank_pushnode, \ + int: bank_pushgarbage, \ + int64_t: bank_pushgarbage, \ + uint64_t: bank_pushgarbage \ )(&textbanks[bank].root, id, content) #define bank_pushm(bank, id, ...) bank_pushlines(&textbanks[bank].root, id, __VA_ARGS__, NULL) diff --git a/tools/dataproc/src/dexproc.c b/tools/dataproc/src/dexproc.c index 093782ba1b..5fec8a01de 100644 --- a/tools/dataproc/src/dexproc.c +++ b/tools/dataproc/src/dexproc.c @@ -11,6 +11,11 @@ #include "constants/species.h" +static enum_template_t enums[] = { + include_enum("generated/species.h", "enum Species"), + { .from_file = NULL }, +}; + static header_template_t headers[] = { { .out_filename = "regional_pokedex_size.h" }, { .out_filename = NULL }, @@ -33,7 +38,7 @@ static int addl_done(void); int main(int argc, char *argv[]) { parse_args(&argc, &argv); - common_init(DATAPROC_F_JSON, NULL, NULL, headers, NULL, __FILE__, depfile_fpath, output_dir, pre_init, NULL); + common_init(DATAPROC_F_JSON, enums, NULL, headers, NULL, __FILE__, depfile_fpath, output_dir, pre_init, NULL); datafile_t df = { 0 }; unsigned errc = EXIT_SUCCESS; @@ -47,8 +52,6 @@ int main(int argc, char *argv[]) { static void pre_init(void) { assert(NATIONAL_DEX_COUNT < UINT16_MAX); - dp_regmetang(Species); - national_count = NATIONAL_DEX_COUNT + 1; // include SPECIES_NONE national = calloc(national_count, sizeof(*national)); } @@ -66,7 +69,7 @@ static void proc_regional(datafile_t *df) { regional = calloc(regional_count, sizeof(*regional)); for (u16 i = 0; i < regional_count; i++) { datanode_t curr = dp_arrelem(array, i); - datanode_t mapped = dp_lookup(curr, "Species"); + datanode_t mapped = dp_lookup(curr, "enum Species"); if (mapped.type != DATAPROC_T_MAPPED) continue; const u16 species = dp_u16(mapped); diff --git a/tools/dataproc/src/frontierproc.c b/tools/dataproc/src/frontierproc.c index 725d1ee6c3..e78641fc5b 100644 --- a/tools/dataproc/src/frontierproc.c +++ b/tools/dataproc/src/frontierproc.c @@ -10,14 +10,19 @@ #include "nitroarc.h" #include "constants/moves.h" -#include "generated/natures.h" -#include "generated/items.h" -#include "generated/species.h" -#include "generated/trainer_classes.h" -#include "generated/trainer_message_types.h" #include "struct_defs/battle_frontier_pokemon_data.h" +static enum_template_t enums[] = { + include_enum("generated/items.h", "enum Item"), + include_enum("generated/moves.h", "enum Move"), + include_enum("generated/natures.h", "enum Nature"), + include_enum("generated/species.h", "enum Species"), + include_enum("generated/trainer_classes.h", "enum TrainerClass"), + include_enum("generated/trainer_message_types.h", "enum TrainerMessageType"), + { .from_file = NULL }, +}; + enum { A_FRONTIER_TRAINERS, A_FRONTIER_POKEMON, @@ -50,7 +55,6 @@ static char **pk_registry = NULL; static size_t len_pk_registry = 0; static void parse_args(int *pargc, char ***pargv); -static void pre_init(void); static int sort_strcmp(const void *lhs, const void *rhs); static void pack_pokemon_set(datafile_t *df); @@ -73,7 +77,7 @@ int main(int argc, char *argv[]) { archives[A_FRONTIER_TRAINERS].num_files = (u16)len_tr_registry; archives[A_FRONTIER_POKEMON].num_files = (u16)len_pk_registry; - common_init(DATAPROC_F_JSON, NULL, archives, NULL, textbanks, __FILE__, depfile_fpath, output_dir, pre_init, NULL); + common_init(DATAPROC_F_JSON, enums, archives, NULL, textbanks, __FILE__, depfile_fpath, output_dir, NULL, NULL); char buf[BUFSIZE]; datafile_t df = { 0 }; @@ -126,9 +130,9 @@ static const char *ev_flags[] = { static void pack_pokemon_set(datafile_t *df) { BattleFrontierPokemonData result = { - .species = enum_u16(".species", Species), - .nature = enum_u8(".nature", Nature), - .item = enum_u16(".item", Item), + .species = enum_u16(".species", enum Species), + .nature = enum_u8(".nature", enum Nature), + .item = enum_u16(".item", enum Item), .form = u16(".form"), }; @@ -140,7 +144,7 @@ static void pack_pokemon_set(datafile_t *df) { } size_t i = 0; - for (; i < num_moves; i++) result.moves[i] = dp_u16(dp_lookup(dp_arrelem(moves, i), "Move")); + for (; i < num_moves; i++) result.moves[i] = dp_u16(dp_lookup(dp_arrelem(moves, i), "enum Move")); for (; i < LEARNED_MOVES_MAX; i++) result.moves[i] = MOVE_NONE; for (i = 0; i < countof(ev_flags); i++) { @@ -160,7 +164,7 @@ static void pack_trainer(datafile_t *df) { const size_t size = 2 + n_sets; u16 *trainer = calloc(size, sizeof(*trainer)); - trainer[0] = dp_u16(dp_lookup(dp_get(df, ".class"), "TrainerClass")); + trainer[0] = dp_u16(dp_lookup(dp_get(df, ".class"), "enum TrainerClass")); trainer[1] = 0; for (size_t i = 0; i < n_sets; i++) { @@ -177,10 +181,7 @@ static void pack_trainer(datafile_t *df) { static void emit_trainer_name(datafile_t *df, const char *stem) { char buf[BUFSIZE] = { 0 }; - const char *name = dp_string(dp_get(df, ".name")); - datanode_t entry = dp_arr_appobject(&textbanks[T_TRAINER_NAMES].root); - dp_obj_putstring(&entry, "id", strfmt("FrontierTrainerNames_Text_%s", stem)); - dp_obj_putstring(&entry, "en_US", name); + bank_push(T_TRAINER_NAMES, strfmt("FrontierTrainerNames_Text_%s", stem), string(".name")); } static void emit_trainer_messages(datafile_t *df, const char *stem) { @@ -191,33 +192,15 @@ static void emit_trainer_messages(datafile_t *df, const char *stem) { for (size_t i = 0; i < n_messages; i++) { datanode_t message = dp_arrelem(messages, i); datanode_t type_node = dp_objmemb(message, "type"); - datanode_t lookup = dp_lookup(type_node, "TrainerMessageType"); + datanode_t lookup = dp_lookup(type_node, "enum TrainerMessageType"); if (lookup.type != DATAPROC_T_MAPPED) continue; const char *type = dp_string(type_node); - datanode_t entry = dp_arr_appobject(&textbanks[T_TRAINER_MESSAGES].root); - dp_obj_putstring(&entry, "id", strfmt("FrontierTrainerMessages_Text_%s_%s", stem, type)); - if (dp_hasmemb(message, "en_US")) { - datanode_t content = dp_objmemb(message, "en_US"); - if (content.type == DATAPROC_T_STRING) { - dp_obj_putstring(&entry, "en_US", dp_string(content)); - } - else if (content.type == DATAPROC_T_ARRAY) { - datanode_t lines = dp_obj_putarray(&entry, "en_US"); - const size_t n_lines = dp_arrlen(content); - for (size_t j = 0; j < n_lines; j++) { - dp_arr_appstring(&lines, dp_string(dp_arrelem(content, j))); - } - } - else { - dp_error(&content, "expected message content to be a string or an array"); - } - } - else if (dp_hasmemb(message, "garbage")) { - dp_obj_putint(&entry, "garbage", dp_u64(dp_objmemb(message, "garbage"))); - } + const char *id = strfmt("FrontierTrainerMessages_Text_%s_%s", stem, type); + if (dp_hasmemb(message, "en_US")) bank_push(T_TRAINER_MESSAGES, id, dp_objmemb(message, "en_US")); + else if (dp_hasmemb(message, "garbage")) bank_push(T_TRAINER_MESSAGES, id, dp_u64(dp_objmemb(message, "garbage"))); else { - dp_error(&message, "expected exactly one of either 'en_US' or 'garbage'"); + dp_warn(&message, "expected exactly one of either 'en_US' or 'garbage'; preferring 'en_US'"); } } } @@ -233,15 +216,6 @@ static int sort_strcmp(const void *lhs, const void *rhs) { return strcmp(l->def, r->def); } -static void pre_init(void) { - dp_regmetang(Item); - dp_regmetang(Move); - dp_regmetang(Nature); - dp_regmetang(Species); - dp_regmetang(TrainerClass); - dp_regmetang(TrainerMessageType); -} - static void usage(const char *fmt, ...); static void parse_args(int *pargc, char ***pargv) { diff --git a/tools/dataproc/src/itemproc.c b/tools/dataproc/src/itemproc.c index 6b2467f1a6..5823842cba 100644 --- a/tools/dataproc/src/itemproc.c +++ b/tools/dataproc/src/itemproc.c @@ -317,46 +317,27 @@ static int pack_berries(void) { } static void proc_text(const char *stem, const char *name, const char *plural, datanode_t *article, datanode_t *desc) { - datanode_t entry; - char buf[BUFSIZE] = { 0 }; +#define strfmt2(fmt, ...) (snprintf(buf2, BUFSIZE, fmt, __VA_ARGS__), buf2) + char buf[BUFSIZE] = { 0 }; + char buf2[BUFSIZE] = { 0 }; - entry = dp_arr_appobject(&textbanks[T_ITEM_NAMES].root); - dp_obj_putstring(&entry, "id", strfmt("ItemNames_Text_%s", stem)); - dp_obj_putstring(&entry, "en_US", name); + bank_push(T_ITEM_NAMES, strfmt("ItemNames_Text_%s", stem), name); + bank_push(T_ITEM_NAMES_PLURAL, strfmt("ItemNamesPlural_Text_%s", stem), plural); - entry = dp_arr_appobject(&textbanks[T_ITEM_NAMES_PLURAL].root); - dp_obj_putstring(&entry, "id", strfmt("ItemNamesPlural_Text_%s", stem)); - dp_obj_putstring(&entry, "en_US", plural); - - entry = dp_arr_appobject(&textbanks[T_ITEM_NAMES_WITH_ARTICLE].root); - dp_obj_putstring(&entry, "id", strfmt("ItemNamesWithArticles_Text_%s", stem)); - if (strcmp(plural, "???") == 0) dp_obj_putstring(&entry, "en_US", plural); + char *article_id = strfmt2("ItemNamesWithArticles_Text_%s", stem); + if (strcmp(plural, "???") == 0) { + bank_push(T_ITEM_NAMES_WITH_ARTICLE, article_id, plural); + } else if (article->type == DATAPROC_T_NULL) { - dp_obj_putstring(&entry, "en_US", strfmt("{COLOR 255}%s{COLOR 0}", name)); + bank_push(T_ITEM_NAMES_WITH_ARTICLE, article_id, strfmt("{COLOR 255}%s{COLOR 0}", name)); } else { - dp_obj_putstring(&entry, "en_US", strfmt("%s {COLOR 255}%s{COLOR 0}", dp_string(*article), name)); + bank_push(T_ITEM_NAMES_WITH_ARTICLE, article_id, strfmt("%s {COLOR 255}%s{COLOR 0}", dp_string(*article), name)); } - entry = dp_arr_appobject(&textbanks[T_ITEM_DESCRIPTIONS].root); - dp_obj_putstring(&entry, "id", strfmt("ItemDescriptions_Text_%s", stem)); - if (desc) { - datanode_t desc_node = *desc; - if (desc_node.type == DATAPROC_T_STRING) { - dp_obj_putstring(&entry, "en_US", dp_string(desc_node)); - } - else if (desc_node.type == DATAPROC_T_ARRAY) { - datanode_t lines = dp_obj_putarray(&entry, "en_US"); - const size_t n_lines = dp_arrlen(desc_node); - for (size_t j = 0; j < n_lines; j++) { - dp_arr_appstring(&lines, dp_string(dp_arrelem(desc_node, j))); - } - } - else { - dp_error(desc, "expected content to be a string or an array"); - } - } - else dp_obj_putint(&entry, "garbage", 0); + if (desc) bank_push(T_ITEM_DESCRIPTIONS, strfmt("ItemDescriptions_Text_%s", stem), *desc); + else bank_push(T_ITEM_DESCRIPTIONS, strfmt("ItemDescriptions_Text_%s", stem), 0); +#undef strfmt2 } static void add_idmap(datafile_t *df, size_t i, size_t data_id) { diff --git a/tools/dataproc/src/npctradeproc.c b/tools/dataproc/src/npctradeproc.c index 7339d009c2..98e6215017 100644 --- a/tools/dataproc/src/npctradeproc.c +++ b/tools/dataproc/src/npctradeproc.c @@ -149,10 +149,7 @@ static void proc_text(datafile_t *df, size_t i) { check_name(&pk_name, pk_name_val, pk_name_len, MON_NAME_LEN, "traded Pokemon"); check_name(&tr_name, tr_name_val, tr_name_len, TRAINER_NAME_LEN, "trading Trainer"); - datanode_t entry = dp_arr_appobject(&textbanks[0].root); - dp_obj_putstring(&entry, "id", strfmt("NPCTradeNames_Text_Mon%zu", i)); - dp_obj_putstring(&entry, "en_US", pk_name_val); - + bank_push(0, strfmt("NPCTradeNames_Text_Mon%zu", i), pk_name_val); memcpy(s_trainernames[i], tr_name_val, tr_name_len); // store for later } @@ -160,9 +157,7 @@ static void pack_trainernames(size_t count) { char buf[BUFSIZE] = { 0 }; for (size_t i = 0; i < count; i++) { - datanode_t entry = dp_arr_appobject(&textbanks[0].root); - dp_obj_putstring(&entry, "id", strfmt("NPCTradeNames_Text_Trainer%zu", i)); - dp_obj_putstring(&entry, "en_US", s_trainernames[i]); + bank_push(0, strfmt("NPCTradeNames_Text_Trainer%zu", i), s_trainernames[i]); } free(s_trainernames[0]); diff --git a/tools/dataproc/src/speciesproc.c b/tools/dataproc/src/speciesproc.c index 8cb572c132..300467287a 100644 --- a/tools/dataproc/src/speciesproc.c +++ b/tools/dataproc/src/speciesproc.c @@ -13,24 +13,12 @@ #include "dataproc.h" #include "nitroarc.h" -// IWYU pragma: begin_keep #include "constants/items.h" -#include "generated/abilities.h" -#include "generated/egg_groups.h" -#include "generated/exp_rates.h" #include "generated/evolution_methods.h" -#include "generated/footprint_sizes.h" #include "generated/gender_ratios.h" -#include "generated/moves.h" -#include "generated/pal_park_land_area.h" -#include "generated/pal_park_water_area.h" #include "generated/pokemon_body_shapes.h" -#include "generated/pokemon_colors.h" #include "generated/pokemon_types.h" -#include "generated/shadow_sizes.h" #include "generated/species.h" -#include "generated/tutor_locations.h" -// IWYU pragma: end_keep #include "struct_defs/species.h" #include "struct_defs/species_sprite_data.h" @@ -121,18 +109,43 @@ static char **registry = NULL; static size_t len_registry = 0; static enum_template_t enums[] = { - { .from_file = "constants/footstep_house.h", .with_prefix = "FOOTPRINT_TYPE", .for_type = "FOOTPRINT_TYPE", .from_defs = true }, + include_defs("constants/footstep_house.h", "FOOTPRINT_TYPE"), + include_enum("generated/abilities.h", "enum Ability"), + include_enum("generated/egg_groups.h", "enum EggGroup"), + include_enum("generated/exp_rates.h", "enum ExpRate"), + include_enum("generated/evolution_methods.h", "enum EvolutionMethod"), + include_enum("generated/footprint_sizes.h", "enum FootprintSize"), + include_enum("generated/gender_ratios.h", "enum GenderRatio"), + include_enum("generated/items.h", "enum Item"), + include_enum("generated/moves.h", "enum Move"), + include_enum("generated/pal_park_land_area.h", "enum PalParkLandArea"), + include_enum("generated/pal_park_water_area.h", "enum PalParkWaterArea"), + include_enum("generated/pokemon_body_shapes.h", "enum PokemonBodyShape"), + include_enum("generated/pokemon_colors.h", "enum PokemonColor"), + include_enum("generated/pokemon_types.h", "enum PokemonType"), + include_enum("generated/shadow_sizes.h", "enum ShadowSize"), + include_enum("generated/species.h", "enum Species"), + include_enum("generated/tutor_locations.h", "enum TutorLocation"), { .from_file = NULL }, }; +enum { + A_PERSONAL, + A_EVOLUTIONS, + A_LEVEL_LEARNSETS, + A_SPRITE_OFFSETS, + A_POKEDEX_INDICES_GIRA_ALTERED, + A_POKEDEX_INDICES_GIRA_ORIGIN, +}; + static archive_template_t archives[] = { - { .out_filename = "pl_personal.narc" }, - { .out_filename = "evo.narc" }, - { .out_filename = "wotbl.narc" }, - { .out_filename = "height.narc" }, - { .out_filename = "zukan_data_gira.narc" }, - { .out_filename = "zukan_data.narc" }, - { .out_filename = NULL }, + [A_PERSONAL] = { .out_filename = "pl_personal.narc" }, + [A_EVOLUTIONS] = { .out_filename = "evo.narc" }, + [A_LEVEL_LEARNSETS] = { .out_filename = "wotbl.narc" }, + [A_SPRITE_OFFSETS] = { .out_filename = "height.narc" }, + [A_POKEDEX_INDICES_GIRA_ALTERED] = { .out_filename = "zukan_data_gira.narc" }, + [A_POKEDEX_INDICES_GIRA_ORIGIN] = { .out_filename = "zukan_data.narc" }, + { .out_filename = NULL }, }; enum { @@ -226,20 +239,20 @@ static const char *alt_forms_with_data[] = { // NOTE: also implicitly defines th "rotom/forms/mow", }; -#define NATIONAL_DEX_MAX SPECIES_EGG - -#define SOURCE_NAME "tools/dataproc/src/speciesproc.c" +#define NATIONAL_DEX_MAX SPECIES_EGG // NOTE: This is distinct from NATIONAL_DEX_COUNT int main(int argc, char **argv) { parse_args(&argc, &argv); splitenv("SPECIES", ®istry, &len_registry, alt_forms_with_data, countof(alt_forms_with_data)); - archives[0].num_files = (u16)len_registry; - archives[1].num_files = (u16)len_registry; - archives[2].num_files = (u16)len_registry; - archives[3].num_files = (u16)(4 * NATIONAL_DEX_MAX); - archives[4].num_files = (u16)(27 + (NUM_POKEMON_TYPES - 1) + NUM_BODY_SHAPES); // NOTE: The Mystery type is not packed - archives[5].num_files = (u16)(27 + (NUM_POKEMON_TYPES - 1) + NUM_BODY_SHAPES); + archives[A_PERSONAL].num_files = (u16)len_registry; + archives[A_EVOLUTIONS].num_files = (u16)len_registry; + archives[A_LEVEL_LEARNSETS].num_files = (u16)len_registry; + archives[A_SPRITE_OFFSETS].num_files = (u16)(4 * NATIONAL_DEX_MAX); + + // NOTE: The Mystery type is not packed into these + archives[A_POKEDEX_INDICES_GIRA_ALTERED].num_files = (u16)(27 + (NUM_POKEMON_TYPES - 1) + NUM_BODY_SHAPES); + archives[A_POKEDEX_INDICES_GIRA_ORIGIN].num_files = (u16)(27 + (NUM_POKEMON_TYPES - 1) + NUM_BODY_SHAPES); common_init(DATAPROC_F_JSON, enums, archives, headers, textbanks, __FILE__, depfile_fpath, output_dir, pre_init, post_init); @@ -331,23 +344,6 @@ static u16 giratina_origin_shape_count = 0; static SpeciesDexIndex *sortables = NULL; // for sorting by name, height, weight static void pre_init(void) { - dp_regmetang(Ability); - dp_regmetang(EggGroup); - dp_regmetang(ExpRate); - dp_regmetang(EvolutionMethod); - dp_regmetang(FootprintSize); - dp_regmetang(GenderRatio); - dp_regmetang(Item); - dp_regmetang(Move); - dp_regmetang(PalParkLandArea); - dp_regmetang(PalParkWaterArea); - dp_regmetang(PokemonBodyShape); - dp_regmetang(PokemonColor); - dp_regmetang(PokemonType); - dp_regmetang(ShadowSize); - dp_regmetang(Species); - dp_regmetang(TutorLocation); - palpark = calloc(NATIONAL_DEX_MAX - 1, sizeof(SpeciesPalPark)); // NOTE: SPECIES_NONE does not have an entry offspring = calloc(len_registry, sizeof(*offspring)); sprite_data = calloc(NATIONAL_DEX_MAX, sizeof(SpeciesSpriteData)); @@ -421,7 +417,7 @@ static void post_init(void) { for (size_t i = 0; i < len_tutorable_moves; i++) { datanode_t elem = dp_arrelem(array, i); datanode_t move = dp_objmemb(elem, "move"); - if (dp_lookup(move, "Move").type == DATAPROC_T_ERR) continue; + if (dp_lookup(move, "enum Move").type == DATAPROC_T_ERR) continue; tutorable_moves[i] = dp_string(move); fprintf(*f_tutorables, " { %s, %u, %u, %u, %u, %s },\n", @@ -430,7 +426,7 @@ static void post_init(void) { dp_u8(dp_objmemb(elem, "blueCost")), dp_u8(dp_objmemb(elem, "yellowCost")), dp_u8(dp_objmemb(elem, "greenCost")), - dp_string(dp_lookup_s(dp_objmemb(elem, "location"), "TutorLocation"))); + dp_string(dp_lookup_s(dp_objmemb(elem, "location"), "enum TutorLocation"))); } tutorset_size = (len_tutorable_moves + 7) / 8; @@ -443,7 +439,7 @@ static void post_init(void) { sinnohdex = calloc(sinnohdex_size, sizeof(*sinnohdex)); for (size_t i = 0; i < sinnohdex_size; i++) { - u16 memb = dp_u16(dp_lookup(dp_arrelem(array, i), "Species")); + u16 memb = dp_u16(dp_lookup(dp_arrelem(array, i), "enum Species")); switch (memb) { case SPECIES_NONE: case SPECIES_ARCEUS: @@ -478,13 +474,13 @@ static SpeciesData proc_personal(datafile_t *df) { }, .types = { - enum_u8(".types[0]", PokemonType), - enum_u8(".types[1]", PokemonType), + enum_u8(".types[0]", enum PokemonType), + enum_u8(".types[1]", enum PokemonType), }, .abilities = { - enum_u8(".abilities[0]", Ability), - enum_u8(".abilities[1]", Ability), + enum_u8(".abilities[0]", enum Ability), + enum_u8(".abilities[1]", enum Ability), }, .evYields = { @@ -497,22 +493,22 @@ static SpeciesData proc_personal(datafile_t *df) { }, .wildHeldItems = { - .common = enum_u16(".held_items.common", Item), - .rare = enum_u16(".held_items.rare", Item), + .common = enum_u16(".held_items.common", enum Item), + .rare = enum_u16(".held_items.rare", enum Item), }, .eggGroups = { - enum_u8(".egg_groups[0]", EggGroup), - enum_u8(".egg_groups[1]", EggGroup), + enum_u8(".egg_groups[0]", enum EggGroup), + enum_u8(".egg_groups[1]", enum EggGroup), }, .baseExpReward = u8(".base_exp_reward"), .baseFriendship = u8(".base_friendship"), - .bodyColor = (u8)(enum_u8(".body_color", PokemonColor) & maxbit(7)), + .bodyColor = (u8)(enum_u8(".body_color", enum PokemonColor) & maxbit(7)), .catchRate = u8(".catch_rate"), - .expRate = enum_u8(".exp_rate", ExpRate), + .expRate = enum_u8(".exp_rate", enum ExpRate), .flipSprite = boolean(".flip_sprite"), - .genderRatio = enum_u8(".gender_ratio", GenderRatio), + .genderRatio = enum_u8(".gender_ratio", enum GenderRatio), .hatchCycles = u8(".hatch_cycles"), .safariFleeRate = u8(".safari_flee_rate"), @@ -567,7 +563,7 @@ static SpeciesEvolutionList proc_evolutions(datafile_t *df) { for (size_t i = 0; i < len_evos; i++) { datanode_t entry = dp_arrelem(evolutions, i); - datanode_t method = dp_lookup(dp_arrelem(entry, 0), "EvolutionMethod"); + datanode_t method = dp_lookup(dp_arrelem(entry, 0), "enum EvolutionMethod"); if (method.type == DATAPROC_T_ERR) continue; // Don't bother if the evolution method is invalid datanode_t param = { .type = DATAPROC_T_MAPPED, .mapped = 0 }; @@ -581,7 +577,7 @@ static SpeciesEvolutionList proc_evolutions(datafile_t *df) { case EVO_LEVEL_MAGNETIC_FIELD: case EVO_LEVEL_MOSS_ROCK: case EVO_LEVEL_ICE_ROCK: - species = dp_lookup(dp_arrelem(entry, 1), "Species"); + species = dp_lookup(dp_arrelem(entry, 1), "enum Species"); break; case EVO_LEVEL: @@ -596,7 +592,7 @@ static SpeciesEvolutionList proc_evolutions(datafile_t *df) { case EVO_LEVEL_MALE: case EVO_LEVEL_FEMALE: param = dp_arrelem(entry, 1); - species = dp_lookup(dp_arrelem(entry, 2), "Species"); + species = dp_lookup(dp_arrelem(entry, 2), "enum Species"); break; case EVO_TRADE_WITH_HELD_ITEM: @@ -605,18 +601,18 @@ static SpeciesEvolutionList proc_evolutions(datafile_t *df) { case EVO_USE_ITEM_FEMALE: case EVO_LEVEL_WITH_HELD_ITEM_DAY: case EVO_LEVEL_WITH_HELD_ITEM_NIGHT: - param = dp_lookup(dp_arrelem(entry, 1), "Item"); - species = dp_lookup(dp_arrelem(entry, 2), "Species"); + param = dp_lookup(dp_arrelem(entry, 1), "enum Item"); + species = dp_lookup(dp_arrelem(entry, 2), "enum Species"); break; case EVO_LEVEL_KNOW_MOVE: - param = dp_lookup(dp_arrelem(entry, 1), "Move"); - species = dp_lookup(dp_arrelem(entry, 2), "Species"); + param = dp_lookup(dp_arrelem(entry, 1), "enum Move"); + species = dp_lookup(dp_arrelem(entry, 2), "enum Species"); break; case EVO_LEVEL_SPECIES_IN_PARTY: - param = dp_lookup(dp_arrelem(entry, 1), "Species"); - species = dp_lookup(dp_arrelem(entry, 2), "Species"); + param = dp_lookup(dp_arrelem(entry, 1), "enum Species"); + species = dp_lookup(dp_arrelem(entry, 2), "enum Species"); break; default: @@ -654,7 +650,7 @@ static SpeciesLearnsetSized proc_lvlearnset(datafile_t *df) { datanode_t level = dp_arrelem(entry, 0); datanode_t move = dp_arrelem(entry, 1); - result.data.entries[result.size].move = (u16)(dp_u16(dp_lookup(move, "Move")) & maxbit(9)); + result.data.entries[result.size].move = (u16)(dp_u16(dp_lookup(move, "enum Move")) & maxbit(9)); result.data.entries[result.size].level = (u16)(dp_u8(level) & maxbit(7)); result.size++; } @@ -673,8 +669,8 @@ static SpeciesPalPark proc_palpark(datafile_t *df, size_t i) { if (i == SPECIES_NONE || i >= NATIONAL_DEX_MAX) return result; datanode_t catching_show = dp_get(df, ".catching_show"); - datanode_t land_area = dp_lookup(dp_objmemb(catching_show, "pal_park_land_area"), "PalParkLandArea"); - datanode_t water_area = dp_lookup(dp_objmemb(catching_show, "pal_park_water_area"), "PalParkWaterArea"); + datanode_t land_area = dp_lookup(dp_objmemb(catching_show, "pal_park_land_area"), "enum PalParkLandArea"); + datanode_t water_area = dp_lookup(dp_objmemb(catching_show, "pal_park_water_area"), "enum PalParkWaterArea"); datanode_t catching_points = dp_objmemb(catching_show, "catching_points"); datanode_t rarity = dp_objmemb(catching_show, "rarity"); datanode_t unused_u16 = dp_objmemb(catching_show, "unused"); @@ -690,7 +686,7 @@ static SpeciesPalPark proc_palpark(datafile_t *df, size_t i) { static enum Species proc_offspring(datafile_t *df, size_t i) { return i <= SPECIES_BAD_EGG - ? (enum Species)enum_u16(".offspring", Species) + ? (enum Species)enum_u16(".offspring", enum Species) : (enum Species)i; } @@ -772,8 +768,8 @@ static SpeciesDexData proc_dexdata(datafile_t *df, size_t i, const char *base_di // Don't bother emitting errors here; they'll get reported later u8 type0 = 0, type1 = 0; if (dp_load(&origin_df, origin_fpath) == 0) { - type0 = dp_u8(dp_lookup(dp_get(&origin_df, ".types[0]"), "PokemonType")); - type1 = dp_u8(dp_lookup(dp_get(&origin_df, ".types[1]"), "PokemonType")); + type0 = dp_u8(dp_lookup(dp_get(&origin_df, ".types[0]"), "enum PokemonType")); + type1 = dp_u8(dp_lookup(dp_get(&origin_df, ".types[1]"), "enum PokemonType")); } datanode_t origin = dp_objmemb(dexdata, "origin_forme"); @@ -785,7 +781,7 @@ static SpeciesDexData proc_dexdata(datafile_t *df, size_t i, const char *base_di .weight = get_weight_hectograms(origin, (enum Species)i), }, - .body_shape = dp_u8(dp_lookup(dp_objmemb(origin, "body_shape"), "PokemonBodyShape")), + .body_shape = dp_u8(dp_lookup(dp_objmemb(origin, "body_shape"), "enum PokemonBodyShape")), .type0 = type0, .type1 = type1, .tr_scale_f = dp_u16(dp_objmemb(origin, "trainer_scale_f")), @@ -812,9 +808,9 @@ static SpeciesDexData proc_dexdata(datafile_t *df, size_t i, const char *base_di .weight = get_weight_hectograms(dexdata, (enum Species)i), }, - .body_shape = dp_u8(dp_lookup(dp_objmemb(dexdata, "body_shape"), "PokemonBodyShape")), - .type0 = dp_u8(dp_lookup(dp_get(df, ".types[0]"), "PokemonType")), - .type1 = dp_u8(dp_lookup(dp_get(df, ".types[1]"), "PokemonType")), + .body_shape = dp_u8(dp_lookup(dp_objmemb(dexdata, "body_shape"), "enum PokemonBodyShape")), + .type0 = dp_u8(dp_lookup(dp_get(df, ".types[0]"), "enum PokemonType")), + .type1 = dp_u8(dp_lookup(dp_get(df, ".types[1]"), "enum PokemonType")), .tr_scale_f = dp_u16(dp_objmemb(dexdata, "trainer_scale_f")), .pk_scale_f = dp_u16(dp_objmemb(dexdata, "pokemon_scale_f")), .tr_scale_m = dp_u16(dp_objmemb(dexdata, "trainer_scale_m")), @@ -874,7 +870,7 @@ static SpeciesSpriteData proc_spritedata(datafile_t *df) { return (SpeciesSpriteData){ .yOffset = s8(".front.addl_y_offset"), .xOffsetShadow = s8(".shadow.x_offset"), - .shadowSize = enum_u8(".shadow.size", ShadowSize), + .shadowSize = enum_u8(".shadow.size", enum ShadowSize), .faceAnims = { [0] = proc_spriteanim(dp_get(df, ".front")), [1] = proc_spriteanim(dp_get(df, ".back")), @@ -900,7 +896,7 @@ static void emit_tutorables(datafile_t *df, size_t i) { for (size_t i = 0; i < dp_arrlen(dn); i++) { datanode_t move = dp_arrelem(dn, i); const char *move_s = dp_string(move); - if (dp_lookup(move, "Move").type == DATAPROC_T_ERR) continue; + if (dp_lookup(move, "enum Move").type == DATAPROC_T_ERR) continue; const char *found = NULL; size_t idx = 0; @@ -924,7 +920,7 @@ static void emit_eggmoves(datafile_t *df, const char *species_upper) { for (size_t i = 0; i < dp_arrlen(dn); i++) { datanode_t move = dp_arrelem(dn, i); const char *move_s = dp_string(move); - dp_lookup(move, "Move"); // only to verify that this is a move name + dp_lookup(move, "enum Move"); // only to verify that this is a move name fprintf(*f_egg_moves, " %s,\n", move_s); } @@ -938,7 +934,7 @@ static void emit_footprints(datafile_t *df, size_t i, const char *species_upper) datanode_t root = dp_get(df, ".footprint"); const bool has = dp_bool(dp_objmemb(root, "has")); - const char *size = dp_string(dp_lookup_s(dp_objmemb(root, "size"), "FootprintSize")); + const char *size = dp_string(dp_lookup_s(dp_objmemb(root, "size"), "enum FootprintSize")); const char *type = dp_string(dp_lookup_s(dp_objmemb(root, "type"), "FOOTPRINT_TYPE")); fprintf(*f_footprint_sizes, " { %s, %s },\n", @@ -1205,15 +1201,15 @@ static void emit_textbanks(datafile_t *df, size_t i, const char *species, Specie } static void pack(Container *species, size_t i) { - nitroarc_ppack(&archives[0].packer, &species->personal, sizeof(SpeciesData), NULL); - nitroarc_ppack(&archives[1].packer, &species->evolutions, sizeof(SpeciesEvolutionList), NULL); - nitroarc_ppack(&archives[2].packer, &species->levelup_learnset.data, (u32)species->levelup_learnset.size, NULL); + nitroarc_ppack(&archives[A_PERSONAL].packer, &species->personal, sizeof(SpeciesData), NULL); + nitroarc_ppack(&archives[A_EVOLUTIONS].packer, &species->evolutions, sizeof(SpeciesEvolutionList), NULL); + nitroarc_ppack(&archives[A_LEVEL_LEARNSETS].packer, &species->levelup_learnset.data, (u32)species->levelup_learnset.size, NULL); if (i < NATIONAL_DEX_MAX) { - nitroarc_ppack(&archives[3].packer, &species->heights.back_female, species->heights.has_female ? 1 : 0, NULL); - nitroarc_ppack(&archives[3].packer, &species->heights.back_male, species->heights.has_male ? 1 : 0, NULL); - nitroarc_ppack(&archives[3].packer, &species->heights.front_female, species->heights.has_female ? 1 : 0, NULL); - nitroarc_ppack(&archives[3].packer, &species->heights.front_male, species->heights.has_male ? 1 : 0, NULL); + nitroarc_ppack(&archives[A_SPRITE_OFFSETS].packer, &species->heights.back_female, species->heights.has_female ? 1 : 0, NULL); + nitroarc_ppack(&archives[A_SPRITE_OFFSETS].packer, &species->heights.back_male, species->heights.has_male ? 1 : 0, NULL); + nitroarc_ppack(&archives[A_SPRITE_OFFSETS].packer, &species->heights.front_female, species->heights.has_female ? 1 : 0, NULL); + nitroarc_ppack(&archives[A_SPRITE_OFFSETS].packer, &species->heights.front_male, species->heights.has_male ? 1 : 0, NULL); size_t offset = sizeof(SpeciesSpriteData) * i; memcpy(sprite_data + offset, &species->spritedata, sizeof(SpeciesSpriteData)); @@ -1444,7 +1440,7 @@ static int pack_dexdata(nitroarc_packer_t *p) { } static int pack_dexdata_giratina_altered(void) { - return pack_dexdata(&archives[4].packer); + return pack_dexdata(&archives[A_POKEDEX_INDICES_GIRA_ALTERED].packer); } #define swap(x, y) do { x ^= y; y ^= x; x ^= y; } while (0) @@ -1484,7 +1480,7 @@ static void swap_giratina(void) { static int pack_dexdata_giratina_origin(void) { swap_giratina(); // swap-in - int result = pack_dexdata(&archives[5].packer); + int result = pack_dexdata(&archives[A_POKEDEX_INDICES_GIRA_ORIGIN].packer); swap_giratina(); // swap-out return result; } diff --git a/tools/dataproc/src/trainerproc.c b/tools/dataproc/src/trainerproc.c index d10bfdb0db..f5ba630fa3 100644 --- a/tools/dataproc/src/trainerproc.c +++ b/tools/dataproc/src/trainerproc.c @@ -7,29 +7,27 @@ #include "common.h" #include "dataproc.h" +#include "libenum.h" #include "nitroarc.h" -// We want to ignore these messages in the generated constants (really just the AI flags) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" -#pragma GCC diagnostic ignored "-Wshift-count-overflow" - -// IWYU pragma: begin_keep #include "constants/battle.h" #include "constants/moves.h" #include "constants/pokemon.h" -#include "generated/ai_flags.h" -#include "generated/items.h" -#include "generated/species.h" #include "generated/trainers.h" #include "generated/trainer_classes.h" -#include "generated/trainer_message_types.h" -// IWYU pragma: end_keep - -#pragma GCC diagnostic pop #include "struct_defs/trainer_data.h" +static enum_template_t enums[] = { + include_enum("generated/ai_flags.h", "enum AIFlag"), + include_enum("generated/items.h", "enum Item"), + include_enum("generated/moves.h", "enum Move"), + include_enum("generated/species.h", "enum Species"), + include_enum("generated/trainer_classes.h", "enum TrainerClass"), + include_enum("generated/trainer_message_types.h", "enum TrainerMessageType"), + { .from_file = NULL }, +}; + enum { A_TRAINER_HEADERS, A_TRAINER_PARTIES, @@ -57,12 +55,11 @@ static textbank_template_t textbanks[] = { { .out_filename = NULL }, }; -static char *program_name = NULL; -static char *base_dir = NULL; -static char *depfile_fpath = "trainer_data.d"; -static char *output_dir = "."; -static char **registry = NULL; -static size_t len_registry = 0; +static char *program_name = NULL; +static char *filename = NULL; +static char *base_dir = NULL; +static char *depfile_path = "trainer_data.d"; +static char *output_dir = "."; typedef struct TrainerParty { TrainerMonWithMovesAndItem party[MAX_PARTY_SIZE]; @@ -75,53 +72,62 @@ typedef struct Container { } Container; static void parse_args(int *pargc, char ***pargv); -static void pre_init(void); static Container proc_trainer(datafile_t *df, enum TrainerID trainer); static void emit_name(datafile_t *df, enum TrainerID trainer, const TrainerHeader *trainer_header, const char *stem); static void proc_messages(datafile_t *df, enum TrainerID trainer); static void pack(Container *trainer); -static int postproc_messages(void); static void emit_trainer_scripts(size_t trainer_count); +static int emit_trainer_messages(enum_seq_t *trainers); +static void prep_trainer_messages(size_t trainer_count); int main(int argc, char *argv[]) { - parse_args(&argc, &argv); - - splitenv("TRAINERS", ®istry, &len_registry, NULL, 0); - archives[A_TRAINER_HEADERS].num_files = (u16)len_registry; - archives[A_TRAINER_PARTIES].num_files = (u16)len_registry; - - common_init(DATAPROC_F_JSON, NULL, archives, headers, textbanks, __FILE__, depfile_fpath, output_dir, pre_init, NULL); - - char buf[256]; + char buf[BUFSIZE]; datafile_t df = { 0 }; unsigned errc = EXIT_SUCCESS; + parse_args(&argc, &argv); + enum_seq_t trainers = common_initenum( + filename, "TrainerID", + .sourcefile = __FILE__, + .depfile = depfile_path, + .outdir = output_dir, + .format = DATAPROC_F_JSON, + .enums = enums, + .archives = archives, + .headers = headers, + .textbanks = textbanks, + ); + // The primary processing loop here handles all trainer headers and parties, and also // emits the name of each trainer to a text-bank. It does not actually emit any of the - // message data, which is handled by postproc_messages. - for (size_t i = 0; i < len_registry; i++) { - snprintf(buf, 256, "%s.json", registry[i]); - char *path = pathjoin(base_dir, NULL, buf); + // message data, which is handled by emit_trainer_messages. + prep_trainer_messages(trainers.size); + for (size_t i = 0; i < trainers.size; i++) { + const char *stem = trainers.members[i].name + lengthof("TRAINER_"); - if (dp_load(&df, path) == 0) { + char *basename = strlower(stem); + char *filepath = pathjoin(base_dir, NULL, strfmt("%s.json", basename)); + declare_dep(filepath); + + if (dp_load(&df, filepath) == 0) { enum TrainerID id = (enum TrainerID)i; Container trainer = proc_trainer(&df, id); - emit_name(&df, id, &trainer.header, registry[i]); + emit_name(&df, id, &trainer.header, basename); proc_messages(&df, id); // For post-processing pack(&trainer); } if (dp_report(&df) == DIAG_ERROR) errc = EXIT_FAILURE; - free(path); + free(filepath); dp_free(&df); } - emit_trainer_scripts(len_registry); - - return common_done(errc, postproc_messages); + emit_trainer_scripts(trainers.size); + if (emit_trainer_messages(&trainers)) errc = EXIT_FAILURE; + return common_done(errc, NULL); } Container proc_trainer(datafile_t *df, enum TrainerID trainer) { @@ -135,7 +141,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { TrainerHeader header = { .monDataType = 0, // initiailized below - .trainerType = enum_u8(".class", TrainerClass), + .trainerType = enum_u8(".class", enum TrainerClass), .sprite = 0, .partySize = (u8)party_size, .items = { 0 }, // initialized below @@ -146,7 +152,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { datanode_t ai_flags = dp_get(df, ".ai_flags"); size_t ai_flags_size = dp_arrlen(ai_flags); for (size_t i = 0; i < ai_flags_size; i++) { - header.aiMask = header.aiMask | dp_u32(dp_lookup(dp_arrelem(ai_flags, i), "AIFlag")); + header.aiMask = header.aiMask | dp_u32(dp_lookup(dp_arrelem(ai_flags, i), "enum AIFlag")); } datanode_t items = dp_get(df, ".items"); @@ -156,7 +162,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { items_size = MAX_TRAINER_ITEMS; } for (size_t i = 0; i < items_size; i++) { - header.items[i] = dp_u16(dp_lookup(dp_arrelem(items, i), "Item")); + header.items[i] = dp_u16(dp_lookup(dp_arrelem(items, i), "enum Item")); } TrainerParty trparty = { .size = (unsigned)party_size }; @@ -175,7 +181,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { party_member = dp_arrelem(party, i); // We always store the maximum possible data, then trim it when packing - u16 species = dp_u16(dp_lookup(dp_objmemb(party_member, "species"), "Species")); + u16 species = dp_u16(dp_lookup(dp_objmemb(party_member, "species"), "enum Species")); u16 form = dp_u8(dp_objmemb(party_member, "form")); trparty.party[i] = (TrainerMonWithMovesAndItem){ .ivScale = dp_u16(dp_objmemb(party_member, "iv_scale")), @@ -184,7 +190,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { .cbSeal = dp_u16(dp_objmemb(party_member, "ball_seal")), }; - if (party_has_items) trparty.party[i].item = dp_u16(dp_lookup(dp_objmemb(party_member, "item"), "Item")); + if (party_has_items) trparty.party[i].item = dp_u16(dp_lookup(dp_objmemb(party_member, "item"), "enum Item")); if (party_has_moves) { datanode_t moves = dp_objmemb(party_member, "moves"); size_t moves_size = dp_arrlen(moves); @@ -194,7 +200,7 @@ Container proc_trainer(datafile_t *df, enum TrainerID trainer) { } for (size_t j = 0; j < moves_size; j++) { - trparty.party[i].moves[j] = dp_u16(dp_lookup(dp_arrelem(moves, j), "Move")); + trparty.party[i].moves[j] = dp_u16(dp_lookup(dp_arrelem(moves, j), "enum Move")); } for (size_t j = moves_size; j < LEARNED_MOVES_MAX; j++) { trparty.party[i].moves[j] = MOVE_NONE; @@ -207,6 +213,7 @@ early_exit: } static void emit_name(datafile_t *df, enum TrainerID trainer, const TrainerHeader *trainer_header, const char *stem) { +#define strfmt2(fmt, ...) (snprintf(buf2, BUFSIZE, fmt, __VA_ARGS__), buf2) static const enum TrainerClass uncompressed_classes[] = { TRAINER_CLASS_RIVAL, TRAINER_CLASS_TOWER_TYCOON, @@ -224,7 +231,8 @@ static void emit_name(datafile_t *df, enum TrainerID trainer, const TrainerHeade TRAINER_CHERYL_BATTLEGROUND, }; - char buf[256] = { 0 }; + char buf[BUFSIZE] = { 0 }; + char buf2[BUFSIZE] = { 0 }; const char *name = string(".name"); enum TrainerClass class = trainer_header->trainerType; @@ -237,9 +245,9 @@ static void emit_name(datafile_t *df, enum TrainerID trainer, const TrainerHeade if (uncompressed_trainers[i] == trainer) compressed = false; } - datanode_t entry = dp_arr_appobject(&textbanks[T_TRAINER_NAMES].root); - dp_obj_putstring(&entry, "id", strfmt("NPCTrainerNames_Text_%s", stem)); - dp_obj_putstring(&entry, "en_US", strfmt(compressed ? "{TRNAME}%s" : "%s", name)); + bank_push(T_TRAINER_NAMES, strfmt("NPCTrainerNames_Text_%s", stem), + strfmt2(compressed ? "{TRNAME}%s" : "%s", name)); +#undef strfmt2 } typedef struct TrainerMessagesEntry { @@ -284,7 +292,7 @@ static void proc_messages(datafile_t *df, enum TrainerID trainer) { for (size_t i = 0; i < p_messages->count; i++) { datanode_t entry = dp_arrelem(messages, i); - p_messages->types[i] = dp_u16(dp_lookup(dp_objmemb(entry, "type"), "TrainerMessageType")); + p_messages->types[i] = dp_u16(dp_lookup(dp_objmemb(entry, "type"), "enum TrainerMessageType")); for (size_t j = 0; j < i; j++) { if (p_messages->types[j] == p_messages->types[i]) { @@ -344,15 +352,15 @@ static TrainerMessage *trtbl = NULL; static u16 *trtblofs = NULL; static TrainerMessage *p_trtbl = NULL; -static int postproc_messages(void) { - qsort(trainer_messages, len_registry, sizeof(*trainer_messages), sort_byindex); +static int emit_trainer_messages(enum_seq_t *trainers) { + qsort(trainer_messages, trainers->size, sizeof(*trainer_messages), sort_byindex); - trtbl = calloc(count_trtbl, sizeof(*trtbl)); - trtblofs = calloc(len_registry, sizeof(*trtblofs)); + trtbl = calloc(count_trtbl, sizeof(*trtbl)); + trtblofs = calloc(trainers->size, sizeof(*trtblofs)); p_trtbl = trtbl; char buf[BUFSIZE] = { 0 }; - for (size_t i = 0; i < len_registry; i++) { + for (size_t i = 0; i < trainers->size; i++) { TrainerMessagesEntry *entry = &trainer_messages[i]; if (entry->count == 0) continue; @@ -362,8 +370,10 @@ static int postproc_messages(void) { p_trtbl->messageType = entry->types[message_id]; p_trtbl++; + // Insert the messages here more mechanically due to the structure. datanode_t bank_entry = dp_arr_appobject(&textbanks[T_TRAINER_MESSAGES].root); - dp_obj_putstring(&bank_entry, "id", strfmt("NPCTrainerMessages_Text_%s_%zu", registry[i], message_id)); + dp_obj_putstring(&bank_entry, "id", + strfmt("NPCTrainerMessages_Text_%s_%zu", trainers->members[i].name, message_id)); if (entry->garbage[message_id]) { dp_obj_putint(&bank_entry, "garbage", entry->garbage[message_id]); } @@ -379,8 +389,8 @@ static int postproc_messages(void) { } } - return fdump_blobnarc(trtbl, (u32)(count_trtbl * sizeof(*trtbl)), "trtbl.narc") - || fdump_blobnarc(trtblofs, (u32)(len_registry * sizeof(*trtblofs)), "trtblofs.narc") + return fdump_blobnarc(trtbl, (u32)(count_trtbl * sizeof(*trtbl)), "trtbl.narc") + || fdump_blobnarc(trtblofs, (u32)(trainers->size * sizeof(*trtblofs)), "trtblofs.narc") || EXIT_SUCCESS; } @@ -432,15 +442,8 @@ static void pack(Container *trainer) { NULL); } -static void pre_init(void) { - dp_regmetang(AIFlag); - dp_regmetang(Item); - dp_regmetang(Move); - dp_regmetang(Species); - dp_regmetang(TrainerClass); - dp_regmetang(TrainerMessageType); - - trainer_messages = calloc(len_registry, sizeof(*trainer_messages)); +static void prep_trainer_messages(size_t count) { + trainer_messages = calloc(count, sizeof(*trainer_messages)); } static void emit_trainer_scripts(size_t trainer_count) { @@ -461,8 +464,8 @@ static void parse_args(int *pargc, char ***pargv) { int c = 0; while ((c = getopt(*pargc, *pargv, ":o:t:s:M:h")) != -1) { switch (c) { - case 'o': output_dir = optarg; break; - case 'M': depfile_fpath = optarg; break; + case 'o': output_dir = optarg; break; + case 'M': depfile_path = optarg; break; case 'h': usage(NULL); break; case ':': usage("missing argument for '-%c'", optopt); break; @@ -472,9 +475,11 @@ static void parse_args(int *pargc, char ***pargv) { *pargc -= optind; *pargv += optind; - if (*pargc < 1) usage("missing required argument BASEDIR"); + if (*pargc < 1) usage("missing required argument ENUMFILE"); + if (*pargc < 2) usage("missing required argument BASEDIR"); - base_dir = (*pargv)[0]; + filename = (*pargv)[0]; + base_dir = (*pargv)[1]; } static void usage(const char *fmt, ...) { diff --git a/tools/msgenc/Json.cpp b/tools/msgenc/Json.cpp index 5220dc0f04..876166b992 100644 --- a/tools/msgenc/Json.cpp +++ b/tools/msgenc/Json.cpp @@ -85,6 +85,8 @@ void Json::WriteHeader(const string &_filename) { hstrm << "#define " << id_strings[i] << " " << i << "\n"; } + hstrm << "#define " << guard.substr(4, guard.size() - 6) << "_ENTRY_COUNT" << " " << id_strings.size() << "\n"; + hstrm << "\n"; hstrm << "#endif // MSGENC_" << guard << "\n"; hstrm.flush();