From 5f48654c207f7d8c7961cf7b6ba260a14a8d8a2c Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Sun, 3 Nov 2024 14:37:41 -0500 Subject: [PATCH 1/2] Sync some dungeon vars names with Sky --- asm/code_2.s | 6 +- asm/code_8040094.s | 2 +- asm/code_8045A00.s | 24 +-- asm/code_8046CE4.s | 8 +- asm/code_804FD30.s | 6 +- asm/code_805D8C8.s | 16 +- asm/code_805D8C8_1.s | 8 +- asm/code_8066D04.s | 26 +-- asm/code_8069E0C.s | 12 +- asm/code_80718D8.s | 4 +- asm/code_8072CF4.s | 10 +- asm/code_807CD9C.s | 22 +-- asm/code_807E5AC.s | 18 +- asm/code_807FCD4.s | 4 +- asm/code_808417C.s | 10 +- asm/ground_lives.s | 2 +- asm/ground_script.s | 2 +- asm/pokemon_3.s | 2 +- include/code_8045A00.h | 2 +- include/code_8077274_1.h | 2 +- include/constants/targeting.h | 6 +- include/dungeon_ai_attack.h | 2 +- include/dungeon_ai_movement.h | 2 +- include/dungeon_message.h | 2 +- include/dungeon_util_1.h | 4 +- include/pokemon.h | 4 +- include/status_checks.h | 2 +- include/structs/dungeon_entity.h | 52 ++++- include/structs/str_dungeon.h | 4 +- src/code_803E724.c | 2 +- src/code_8040094.c | 2 +- src/code_8041AD0.c | 2 +- src/code_804267C.c | 4 +- src/code_8042B34.c | 4 +- src/code_8045A00.c | 8 +- src/code_8048480.c | 34 ++-- src/code_805D8C8.c | 2 +- src/code_805D8C8_1.c | 22 +-- src/code_8066D04.c | 56 +++--- src/code_8069E0C.c | 10 +- src/code_806CD90.c | 34 ++-- src/code_806E8B0.c | 2 +- src/code_806FDF4.c | 16 +- src/code_80718D8.c | 10 +- src/code_8073CF0.c | 40 ++-- src/code_8075708.c | 2 +- src/code_8077274_1.c | 150 +++++++------- src/code_807CD9C.c | 10 +- src/code_807E1A0.c | 12 +- src/code_8083288.c | 10 +- src/debug_menu1.c | 2 +- src/dungeon_action.c | 24 +-- src/dungeon_ai.c | 46 ++--- src/dungeon_ai_attack.c | 28 +-- src/dungeon_ai_items.c | 6 +- src/dungeon_ai_leader.c | 14 +- src/dungeon_ai_movement.c | 24 +-- src/dungeon_ai_targeting.c | 28 +-- src/dungeon_capabilities.c | 2 +- src/dungeon_cutscenes.c | 326 +++++++++++++++---------------- src/dungeon_engine.c | 4 +- src/dungeon_items.c | 2 +- src/dungeon_message.c | 6 +- src/dungeon_move.c | 74 +++---- src/dungeon_pokemon_attributes.c | 8 +- src/dungeon_util.c | 4 +- src/dungeon_util_1.c | 92 ++++----- src/move_actions.c | 26 +-- src/move_checks.c | 2 +- src/move_effects_target.c | 44 ++--- src/personality_test1.c | 2 +- src/pokemon.c | 12 +- src/pokemon_mid.c | 4 +- src/status.c | 100 +++++----- src/status_actions.c | 22 +-- src/status_checks.c | 36 ++-- src/status_checks_1.c | 6 +- src/tile_types.c | 14 +- src/trap.c | 14 +- src/trap_1.c | 12 +- 80 files changed, 856 insertions(+), 824 deletions(-) diff --git a/asm/code_2.s b/asm/code_2.s index 499f7d72c..96cb0c1b1 100644 --- a/asm/code_2.s +++ b/asm/code_2.s @@ -3,7 +3,7 @@ .syntax unified - .text + .text thumb_func_start LoadTitleScreen LoadTitleScreen: @@ -1262,7 +1262,7 @@ sub_8001064: movs r0, 0x4 ldrsh r1, [r5, r0] adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer mov r0, sp adds r1, r4, 0 bl CopyStringtoBuffer @@ -1293,7 +1293,7 @@ _080010AE: movs r0, 0x6 ldrsh r1, [r5, r0] adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer mov r0, sp adds r1, r4, 0 bl CopyStringtoBuffer diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 50633499f..8a8f947bc 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -1728,7 +1728,7 @@ _08040E6E: ldr r0, _08040ECC ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r1, 0xD2 lsls r1, 1 adds r0, r6, 0 diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 74b7efc43..5f79ba4d4 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -65,7 +65,7 @@ _08045E1E: ldr r0, _08045E38 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08045E3C b _08046048 .align 2, 0 @@ -278,7 +278,7 @@ _08045FAC: _08045FD0: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08045FF2 .align 2, 0 _08045FDC: .4byte 0x00ff0008 @@ -288,7 +288,7 @@ _08045FE8: ldr r0, _08045FFC ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08045FF2: ldrb r0, [r5, 0x2] bl TryDisplayItemPickupTutorialMessage @@ -331,12 +331,12 @@ _0804602E: ldr r0, _08046058 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0804605C _08046048: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080460E0 .align 2, 0 _08046054: .4byte gFormatBuffer_Items @@ -374,12 +374,12 @@ _08046094: ldr r0, _080460B8 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080460BC _080460AC: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080460DA .align 2, 0 _080460B8: .4byte gFormatBuffer_Monsters @@ -394,7 +394,7 @@ _080460C0: ldr r0, _080460F4 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080460DA: ldrb r0, [r5, 0x2] bl TryDisplayItemPickupTutorialMessage @@ -996,7 +996,7 @@ sub_804652C: ldr r0, _080465A4 ldr r1, [r0] mov r0, r10 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser mov r0, r9 ldrb r1, [r0] movs r0, 0x1 @@ -1721,7 +1721,7 @@ _08046B0A: ldr r4, _08046B38 add r4, sp ldr r0, [r4] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08046C7C .align 2, 0 _08046B2C: .4byte 0x0000052c @@ -1734,7 +1734,7 @@ _08046B3C: ldr r5, _08046B50 add r5, sp ldr r0, [r5] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08046C7C .align 2, 0 _08046B4C: .4byte gItemLost @@ -1748,7 +1748,7 @@ _08046B54: ldr r2, _08046C94 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08046B68: movs r3, 0 mov r9, r3 diff --git a/asm/code_8046CE4.s b/asm/code_8046CE4.s index 270377982..daa8afec3 100644 --- a/asm/code_8046CE4.s +++ b/asm/code_8046CE4.s @@ -410,7 +410,7 @@ _08047462: ldr r0, _080474C4 adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080474C8 ldr r1, [sp, 0x214] bl sub_8045C08 @@ -463,7 +463,7 @@ _080474E2: ldr r0, _0804750C adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08047510 ldr r1, [sp, 0x214] bl sub_8045BF8 @@ -552,7 +552,7 @@ _08047596: ldr r0, _080475C0 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080475A8: movs r3, 0x90 lsls r3, 2 @@ -913,7 +913,7 @@ _0804786E: ldr r0, _080478D4 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags lsls r0, r6, 24 cmp r0, 0 beq _080478DC diff --git a/asm/code_804FD30.s b/asm/code_804FD30.s index e8517f86b..19dec61b2 100644 --- a/asm/code_804FD30.s +++ b/asm/code_804FD30.s @@ -4118,7 +4118,7 @@ sub_8051E7C: ldr r0, _08051EB4 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080520F6 .align 2, 0 _08051EB4: .4byte gUnknown_80FDDF0 @@ -4378,7 +4378,7 @@ _0805207A: ldr r0, _080520E8 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x14 movs r1, 0x3C bl sub_803E708 @@ -4399,7 +4399,7 @@ _080520EC: ldr r0, _08052108 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080520F6: add sp, 0x14 pop {r3-r5} diff --git a/asm/code_805D8C8.s b/asm/code_805D8C8.s index a4d028c38..da22012a1 100644 --- a/asm/code_805D8C8.s +++ b/asm/code_805D8C8.s @@ -2171,7 +2171,7 @@ sub_8062B74: ldr r0, _08062BD0 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08062BD4 ldr r2, [r0] movs r0, 0 @@ -2322,7 +2322,7 @@ sub_8062CA8: ldr r0, _08062CF8 adds r1, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08062CFC ldr r2, [r0] movs r0, 0 @@ -3429,7 +3429,7 @@ sub_8063578: ldr r0, _080635FC ldr r1, [sp, 0x14] movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags lsls r4, 3 adds r4, 0xA ldr r0, _08063600 @@ -4122,7 +4122,7 @@ _08063AEC: ldr r0, _08063B2C ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08063B3A .align 2, 0 _08063B1C: .4byte gDungeon @@ -4134,7 +4134,7 @@ _08063B30: ldr r0, _08063B50 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08063B3A: movs r0, 0x78 movs r1, 0x1F @@ -4442,7 +4442,7 @@ _08063D70: ldr r0, _08063DAC ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08063DBA .align 2, 0 _08063D98: .4byte gDungeon @@ -4455,7 +4455,7 @@ _08063DB0: ldr r0, _08063DD0 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08063DBA: movs r0, 0x78 movs r1, 0x1F @@ -5474,7 +5474,7 @@ sub_806455C: ldr r1, [r4, 0x14] add r0, sp, 0x4 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags str r5, [sp] movs r0, 0x8 movs r1, 0x12 diff --git a/asm/code_805D8C8_1.s b/asm/code_805D8C8_1.s index c8b821026..f06cb8e2d 100644 --- a/asm/code_805D8C8_1.s +++ b/asm/code_805D8C8_1.s @@ -1010,7 +1010,7 @@ _080690A2: adds r0, r2 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _08069484 .align 2, 0 _080690E4: .4byte gDungeon @@ -1283,7 +1283,7 @@ _0806930A: adds r0, r2 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _08069352 .align 2, 0 _0806932C: .4byte gUnknown_202EE70 @@ -1301,7 +1301,7 @@ _08069338: adds r0, r3 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags _08069352: bl GetLeader cmp r0, 0 @@ -1515,7 +1515,7 @@ _080694FC: _0806950A: adds r0, r4, 0 adds r1, r4, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _08069512: movs r0, 0x4 ldrsh r2, [r4, r0] diff --git a/asm/code_8066D04.s b/asm/code_8066D04.s index 1bce6405c..4535c860c 100644 --- a/asm/code_8066D04.s +++ b/asm/code_8066D04.s @@ -135,7 +135,7 @@ _08066ECC: _08066F1E: ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08066F7E .align 2, 0 _08066F28: .4byte 0xffffff00 @@ -167,7 +167,7 @@ _08066F46: ldr r0, _08066F98 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, _08066F9C ldr r0, [r0] ldr r2, _08066FA0 @@ -314,7 +314,7 @@ _08067040: _0806709E: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080670EE .align 2, 0 _080670A8: .4byte gFormatBuffer_Items + 0x50 @@ -339,7 +339,7 @@ _080670CA: ldr r0, _08067104 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, _08067108 ldr r0, [r0] ldr r1, _0806710C @@ -390,7 +390,7 @@ sub_8067110: bl sub_80464AC adds r1, r0, 0 adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser ldr r0, [r6] str r0, [sp, 0x8] adds r0, r5, 0 @@ -498,7 +498,7 @@ _08067220: _08067230: ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x14 movs r1, 0x4C bl sub_803E708 @@ -677,7 +677,7 @@ _08067384: ldr r0, _080673B8 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _080673C6 .align 2, 0 _080673B0: .4byte gFormatBuffer_Items @@ -687,7 +687,7 @@ _080673BC: ldr r0, _080673F8 ldr r1, [r0] adds r0, r6, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _080673C6: add r0, sp, 0x4 ldrb r0, [r0, 0x2] @@ -1198,7 +1198,7 @@ _080677B4: ldr r0, _080677F0 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _080677F4 ldr r5, [r0] ldr r0, _080677F8 @@ -1380,7 +1380,7 @@ sub_8067904: ldr r0, _08067944 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08067948 b _08067962 .align 2, 0 @@ -1396,12 +1396,12 @@ _0806794C: ldr r0, _0806796C adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08067970 _08067962: ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08067A56 .align 2, 0 _0806796C: .4byte gFormatBuffer_Monsters @@ -1477,7 +1477,7 @@ _080679DE: ldr r0, _08067A70 ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08067A04: ldrb r0, [r6, 0x7] cmp r0, 0 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index fc6d11927..0f955d488 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -306,7 +306,7 @@ _0806A5CE: bne _0806A608 adds r0, r6, 0 adds r1, r6, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _0806A608: movs r1, 0x2 ldrsh r0, [r4, r1] @@ -399,7 +399,7 @@ _0806A6C4: beq _0806A6D2 adds r0, r6, 0 mov r1, r8 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0806A6D2: add sp, 0x4 pop {r3} @@ -663,7 +663,7 @@ sub_806A898: b _0806A8C8 _0806A8C2: adds r0, r4, 0 - bl MoveIfPossible + bl AIMovement _0806A8C8: movs r0, 0xB6 lsls r0, 1 @@ -817,7 +817,7 @@ _0806A9E0: _0806A9E6: ldr r1, [r0] adds r0, r4, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0806AA02 .align 2, 0 _0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage @@ -827,7 +827,7 @@ _0806A9F4: ldr r0, _0806AA08 ldr r1, [r0] adds r0, r4, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0806AA02: pop {r4,r5} pop {r0} @@ -1162,7 +1162,7 @@ _0806AC72: bne _0806AC92 adds r0, r6, 0 adds r1, r4, 0 - bl SendImmobilizeEndMessage + bl EndFrozenClassStatus _0806AC92: adds r0, r4, 0 movs r1, 0x45 diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 7563ca795..d709a307d 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -359,7 +359,7 @@ _08072A0C: ldr r0, _08072A44 mov r1, r9 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08072A48 add r1, sp, 0x40 bl strcpy @@ -417,7 +417,7 @@ _08072A92: ldr r0, _08072AC0 mov r1, r9 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08072AC4 ldr r1, [r0] mov r0, r9 diff --git a/asm/code_8072CF4.s b/asm/code_8072CF4.s index b1f3b13b7..d2ebe183e 100644 --- a/asm/code_8072CF4.s +++ b/asm/code_8072CF4.s @@ -4,7 +4,7 @@ .syntax unified .text - + thumb_func_start sub_80732F0 sub_80732F0: push {r4-r7,lr} @@ -148,11 +148,11 @@ _080733FC: ldr r0, _08073438 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807343C ldr r1, [r0] mov r0, r8 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x7 mov r1, r9 ands r1, r0 @@ -360,11 +360,11 @@ _0807359C: ldr r0, _08073600 adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _08073604 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x7 mov r1, r8 ands r1, r0 diff --git a/asm/code_807CD9C.s b/asm/code_807CD9C.s index bc96db041..358e4db4c 100644 --- a/asm/code_807CD9C.s +++ b/asm/code_807CD9C.s @@ -165,7 +165,7 @@ _0807D634: ldr r2, _0807D650 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807D9F4 .align 2, 0 _0807D650: .4byte 0x00000d08 @@ -585,7 +585,7 @@ _0807D996: ldr r2, _0807D9C4 add r2, sp ldr r0, [r2] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807D9EE .align 2, 0 _0807D9B4: .4byte gUnknown_80F4468 @@ -605,7 +605,7 @@ _0807D9E0: ldr r3, _0807DA0C add r3, sp ldr r0, [r3] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807D9EE: movs r0, 0x1 bl sub_807EC28 @@ -647,7 +647,7 @@ sub_807DA14: ldr r0, _0807DA48 adds r1, r6, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807DA4C b _0807DA5C .align 2, 0 @@ -818,7 +818,7 @@ _0807DB94: _0807DBA0: ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DC54 .align 2, 0 _0807DBAC: .4byte gUnknown_80FD08C @@ -878,7 +878,7 @@ _0807DBF4: ldr r0, _0807DC2C ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DC3A .align 2, 0 _0807DC24: .4byte 0x0000fffc @@ -888,7 +888,7 @@ _0807DC30: ldr r0, _0807DC60 ldr r1, [r0] adds r0, r7, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807DC3A: ldr r0, _0807DC64 ldr r0, [r0] @@ -953,7 +953,7 @@ _0807DCAC: _0807DCB8: ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807DF0E .align 2, 0 _0807DCC4: .4byte gUnknown_80FD3D0 @@ -1192,7 +1192,7 @@ _0807DE74: ldr r0, _0807DF30 ldr r1, [r0] mov r0, r9 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r0, 0x28 movs r1, 0x2B bl sub_803E708 @@ -1316,7 +1316,7 @@ _0807DF8E: ldr r0, _0807DFB0 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags b _0807DFC2 .align 2, 0 _0807DFA8: .4byte gDungeon @@ -1346,7 +1346,7 @@ _0807DFD4: ldr r0, _0807E184 mov r1, r10 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807E188 ldr r2, [r0] ldr r0, [sp, 0x8] diff --git a/asm/code_807E5AC.s b/asm/code_807E5AC.s index be82e0ed6..f48f277b1 100644 --- a/asm/code_807E5AC.s +++ b/asm/code_807E5AC.s @@ -228,7 +228,7 @@ _0807E816: ldr r0, _0807E884 ldr r1, [r0] adds r0, r5, 0 - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807E844: movs r5, 0 _0807E846: @@ -494,7 +494,7 @@ MudWaterSportEffect: bl GetLeader ldr r1, _0807EA68 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _0807EA8C .align 2, 0 _0807EA5C: .4byte gUnknown_80F4EAC @@ -514,7 +514,7 @@ _0807EA6C: bl GetLeader ldr r1, _0807EA9C ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EA8C: pop {r0} bx r0 @@ -677,7 +677,7 @@ _0807EBA6: bl GetLeader ldr r1, _0807EC1C ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EBD4: ldr r4, _0807EC14 ldr r0, [r4] @@ -697,7 +697,7 @@ _0807EBD4: bl GetLeader ldr r1, _0807EC24 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _0807EC00: ldr r0, [sp, 0x8] add sp, 0xC @@ -1621,7 +1621,7 @@ sub_807F33C: bl GetLeader ldr r1, _0807F428 ldr r1, [r1] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser movs r6, 0 _0807F360: movs r5, 0 @@ -1748,7 +1748,7 @@ sub_807F43C: ldr r0, _0807F468 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F46C b _0807F694 .align 2, 0 @@ -1761,7 +1761,7 @@ _0807F470: ldr r0, _0807F488 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F48C ldr r2, [r0] mov r0, r8 @@ -2046,7 +2046,7 @@ _0807F6A8: ldr r0, _0807F860 mov r1, r8 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags ldr r0, _0807F864 ldr r2, [r0] ldr r0, [sp, 0xEC] diff --git a/asm/code_807FCD4.s b/asm/code_807FCD4.s index e871f643d..b7100db21 100644 --- a/asm/code_807FCD4.s +++ b/asm/code_807FCD4.s @@ -206,7 +206,7 @@ _08080A26: _08080A2E: ldr r1, [r0] ldr r0, [sp, 0x14] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser b _08080A46 .align 2, 0 _08080A38: .4byte gUnknown_80FDACC @@ -214,7 +214,7 @@ _08080A3C: ldr r0, _08080A58 ldr r1, [r0] ldr r0, [sp, 0x14] - bl TryDisplayDungeonLoggableMessage + bl LogMessageByIdWithPopupCheckUser _08080A46: add sp, 0x30 pop {r3-r5} diff --git a/asm/code_808417C.s b/asm/code_808417C.s index f105d3a3f..e23e6dcab 100644 --- a/asm/code_808417C.s +++ b/asm/code_808417C.s @@ -322,12 +322,12 @@ sub_8084448: adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r4, 0x50 adds r0, r4, 0 adds r1, r5, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r5, 0 bl sub_8070BC0 lsls r0, 24 @@ -516,12 +516,12 @@ sub_80845E0: adds r1, r0, 0 adds r0, r4, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r4, 0x50 adds r0, r4, 0 adds r1, r6, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r6, 0 bl sub_8070BC0 lsls r0, 24 @@ -585,7 +585,7 @@ _08084680: ldr r0, _0808469C adds r1, r7, 0 movs r2, 0 - bl SetMessageArgument + bl SubstitutePlaceholderStringTags adds r0, r7, 0 bl sub_8070BC0 lsls r0, 24 diff --git a/asm/ground_lives.s b/asm/ground_lives.s index 3a313dec8..6bde62e41 100644 --- a/asm/ground_lives.s +++ b/asm/ground_lives.s @@ -3103,7 +3103,7 @@ _080A8F30: ldrsh r1, [r0, r2] _080A8F34: adds r0, r4, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer b _080A8F44 _080A8F3C: ldr r1, _080A8F4C diff --git a/asm/ground_script.s b/asm/ground_script.s index 23f75bf91..b4ed75cbd 100644 --- a/asm/ground_script.s +++ b/asm/ground_script.s @@ -355,7 +355,7 @@ _080A184C: bl sub_80A8BFC lsls r0, 16 asrs r0, 16 - bl CanMove + bl GetCanMoveFlag b _080A171E _080A185E: lsls r0, r5, 16 diff --git a/asm/pokemon_3.s b/asm/pokemon_3.s index efd9f6d7e..5a3b14ddf 100644 --- a/asm/pokemon_3.s +++ b/asm/pokemon_3.s @@ -753,7 +753,7 @@ _0808FDB0: movs r3, 0 ldrsh r1, [r2, r3] adds r0, r6, 0 - bl CopyMonsterNametoBuffer + bl CopyMonsterNameToBuffer ldr r1, _0808FEF4 mov r2, r10 movs r3, 0 diff --git a/include/code_8045A00.h b/include/code_8045A00.h index df17445c2..15dc82383 100644 --- a/include/code_8045A00.h +++ b/include/code_8045A00.h @@ -3,6 +3,6 @@ #include "structs/dungeon_entity.h" -void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3); +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3); #endif // GUARD_CODE_8045A00_H diff --git a/include/code_8077274_1.h b/include/code_8077274_1.h index f1466b173..cc9712be4 100644 --- a/include/code_8077274_1.h +++ b/include/code_8077274_1.h @@ -37,7 +37,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4); void sub_807A0CC(Entity * pokemon, Entity * target); void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); -void SendImmobilizeEndMessage(Entity * pokemon, Entity *target); +void EndFrozenClassStatus(Entity * pokemon, Entity *target); void SendVolatileEndMessage(Entity * pokemon, Entity *target); void SendProtectionEndMessage(Entity * pokemon, Entity *target); void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); diff --git a/include/constants/targeting.h b/include/constants/targeting.h index 956e30584..cce44ee4e 100644 --- a/include/constants/targeting.h +++ b/include/constants/targeting.h @@ -1,9 +1,9 @@ #ifndef GUARD_CONSTANTS_TARGETING_H #define GUARD_CONSTANTS_TARGETING_H -#define TARGETING_DECOY_NONE 0 -#define TARGETING_DECOY_TEAM 1 -#define TARGETING_DECOY_WILD 2 +#define DECOY_AI_NONE 0 +#define DECOY_AI_TEAM 1 +#define DECOY_AI_WILD 2 #define TREATMENT_TREAT_AS_ALLY 0 #define TREATMENT_TREAT_AS_ENEMY 1 diff --git a/include/dungeon_ai_attack.h b/include/dungeon_ai_attack.h index 95a5f84ab..8f5b31c83 100644 --- a/include/dungeon_ai_attack.h +++ b/include/dungeon_ai_attack.h @@ -13,7 +13,7 @@ struct AIPossibleMove s32 weight; }; -void DecideAttack(Entity *pokemon); +void ChooseAIMove(Entity *pokemon); s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move); bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range); s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker); diff --git a/include/dungeon_ai_movement.h b/include/dungeon_ai_movement.h index 5324a3f3c..1b7df916f 100644 --- a/include/dungeon_ai_movement.h +++ b/include/dungeon_ai_movement.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect); +void AIMovement(Entity *pokemon, bool8 showRunAwayEffect); bool8 CanTakeItem(Entity *pokemon); bool8 ChooseTargetPosition(Entity *pokemon); void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect); diff --git a/include/dungeon_message.h b/include/dungeon_message.h index 0a8ceb0cd..693673b27 100644 --- a/include/dungeon_message.h +++ b/include/dungeon_message.h @@ -24,7 +24,7 @@ void sub_80521D0(void); void sub_8052210(bool8 a0); // These functions display the string if certain conditions are met. The conditions differ depending on the function. The string is then saved to the message log. -void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str); +void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str); void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); diff --git a/include/dungeon_util_1.h b/include/dungeon_util_1.h index 3196747eb..943647813 100644 --- a/include/dungeon_util_1.h +++ b/include/dungeon_util_1.h @@ -16,7 +16,7 @@ Entity *GetPartnerEntity(void); void sub_80854D4(void); void sub_80855E4(DungeonCallback func); void sub_808563C(DungeonCallback func); -Entity *GetEntityFromClientType(u8 entityType); +Entity *GetEntityFromMonsterBehavior(u8 entityType); void sub_80856C8(Entity * pokemon, s32 x, s32 y); void sub_80856E0(Entity * pokemon, s32 direction); void sub_8085764(void); @@ -26,7 +26,7 @@ void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps); void SetFacingDirection(Entity *pokemon, s32 direction); void sub_8085930(s32 direction); void sub_80859F0(s32 direction); -bool8 IsMovingClient(Entity *entity); +bool8 ShouldRunMonsterAI(Entity *entity); void sub_8085B0C(Entity *pokemon); void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3); void sub_80857B8(void); diff --git a/include/pokemon.h b/include/pokemon.h index 0d10e72a7..3f1eb0981 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -39,7 +39,7 @@ void InitializeRecruitedPokemon(void); //u8 GetBodySize(s16 index); -void CopyMonsterNametoBuffer(u8 * buffer, s16 index); +void CopyMonsterNameToBuffer(u8 * buffer, s16 index); void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void sub_808D930(u8 *buffer, s32 index); @@ -56,7 +56,7 @@ char * GetMonSpecies(s16 index); s32 GetMovementSpeed(s16 index); u8 GetMovementType(s16 index); u8 GetRegenSpeed(s16 index); -bool8 CanMove(s16 index); +bool8 GetCanMoveFlag(s16 index); u8 GetChanceAsleep(s16 index); u32 GetWeight(s16 index); u32 GetSize(s16 index); diff --git a/include/status_checks.h b/include/status_checks.h index 3bf06b6ef..22bd90d4a 100644 --- a/include/status_checks.h +++ b/include/status_checks.h @@ -5,6 +5,6 @@ extern const s16 gConfusedAttackChance; -bool8 HasStatusAffectingActions(Entity *pokemon); +bool8 HasStatusThatPreventsActing(Entity *pokemon); #endif diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 0575a7d55..24bdda795 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -113,7 +113,7 @@ typedef struct Protection typedef struct Waiting { /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 enemyDecoy; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). + /* 0xC9 */ bool8 decoyApplierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). u8 unkCA; /* 0xCB */ u8 waitingStatusTurns; /* 0xCC */ u8 curseDamageCountdown; @@ -231,7 +231,7 @@ typedef struct EntityInfo /* 0x98 */ u32 unk98; /* 0x9C */ u32 unk9C; /* 0xA0 */ s32 unkA0; - /* 0xA4 */ u8 clientType; + /* 0xA4 */ u8 monsterBehavior; u8 fillA5[0xA8 - 0xA5]; // Statuses are split into groups based on which ones can't overlap. // See status.h for which statuses are in each group. @@ -266,7 +266,7 @@ typedef struct EntityInfo /* 0xFD */ u8 perishSongTurns; // When this reaches 0, the Pokémon faints from Perish Song. Doubles as a bool for whether the Pokémon is afflicted by Perish Song. u8 unkFE; u8 unkFF; - /* 0x100 */ u8 targetingDecoy; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. + /* 0x100 */ u8 decoyAITracker; // If the Pokémon is targeting a decoy, this indicates whether the decoy target is a team or wild Pokémon. /* 0x104 */ s32 speedStage; // The turn counter for movement speed up/down is split into five timers each. Multiple timers are used if the Pokémon is affected by multiple // speed-up/slow effects at once, like using Agility twice. @@ -280,7 +280,7 @@ typedef struct EntityInfo /* 0x118 */ Moves moves; /* 0x13C */ FixedPoint belly; /* 0x140 */ FixedPoint maxBelly; - /* 0x144 */ bool8 aiNextToTarget; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. + /* 0x144 */ bool8 aiAllySkip; // True if an AI Pokémon is following another Pokémon and is already adjacent to them. /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved. /* 0x146 */ u8 unk146; /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. @@ -407,13 +407,45 @@ enum AIObjective AI_TAKE_ITEM }; -enum ClientType +enum MonsterBehavior { - CLIENT_TYPE_NONE, - CLIENT_TYPE_CLIENT, // Used for mission clients that need rescuing. - CLIENT_TYPE_PARTNER, - // 3 - CLIENT_TYPE_DONT_MOVE = 4 // Used for Diglett in the Skarmory boss fight. + BEHAVIOR_FIXED_ENEMY, + BEHAVIOR_RESCUE_TARGET, // Used for mission clients that need rescuing. + BEHAVIOR_ALLY, + BEHAVIOR_SKARMORY, + BEHAVIOR_DIGLETT, // Used for Diglett in the Skarmory boss fight. + BEHAVIOR_5, // 5 and 6 are probably Gengar and Ekans, but not sure which is which. + BEHAVIOR_6, + BEHAVIOR_MEDICHAM, + BEHAVIOR_ZAPDOS, + BEHAVIOR_MOLTRES, + BEHAVIOR_ALAKAZAM_1, + BEHAVIOR_GROUDON_1, + BEHAVIOR_ALAKAZAM_2, + BEHAVIOR_ARTICUNO, + BEHAVIOR_GROUDON_2, + BEHAVIOR_RAYQUAZA, + BEHAVIOR_16, + BEHAVIOR_MEWTWO, + BEHAVIOR_ENTEI, + BEHAVIOR_RAIKOU, + BEHAVIOR_SUICUNE, + BEHAVIOR_HO_OH, + BEHAVIOR_LATIOS, + BEHAVIOR_REGIROCK, + BEHAVIOR_REGICE, + BEHAVIOR_REGISTEEL, + BEHAVIOR_JIRACHI, + BEHAVIOR_LUGIA, + BEHAVIOR_KYOGRE, + BEHAVIOR_29, + BEHAVIOR_CELEBI, + BEHAVIOR_SMEARGLE, + BEHAVIOR_32, + BEHAVIOR_33, + BEHAVIOR_34, + BEHAVIOR_35, + BEHAVIOR_36, }; enum VisualFlag diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index c7daddb1b..c663aebc2 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -327,7 +327,7 @@ typedef struct Dungeon /* 0x37F4 */ s32 unk37F4; /* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37FA */ bool8 minusIsActive[2]; // Index 0: Enemy , Index 1: Team - /* 0x37FC */ bool8 decoyActive; + /* 0x37FC */ bool8 decoyIsActive; /* 0x37FD */ u8 unk37FD; /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave /* 0x37FE */ u8 unk37FF; @@ -383,7 +383,7 @@ typedef struct Dungeon u8 fill1357A[0x1357C - 0x1357A]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; - /* 0x135CC */ Entity *allPokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon + /* 0x135CC */ Entity *activeMonsterPtrs[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; diff --git a/src/code_803E724.c b/src/code_803E724.c index 0a5f9dfab..4845e54c4 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -1066,7 +1066,7 @@ void sub_803F580(u8 a0) if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { sub_80402AC(mon->pos.x, mon->pos.y); } diff --git a/src/code_8040094.c b/src/code_8040094.c index e54661ade..d36e51d46 100644 --- a/src/code_8040094.c +++ b/src/code_8040094.c @@ -44,7 +44,7 @@ void HandleLuminousOrbAction(Entity *pokemon) sub_803F580(0); sub_8049ED4(); sub_8040A84(); - TryDisplayDungeonLoggableMessage(pokemon, gUnknown_80FD040); + LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD040); } void sub_8040094(u8 r0) diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index ad6964532..38142228b 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -155,7 +155,7 @@ void sub_8041888(u8 param_1) EntityInfo *entityInfo; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { entityInfo = GetEntInfo(entity); diff --git a/src/code_804267C.c b/src/code_804267C.c index 9983217bb..845a20266 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -104,14 +104,14 @@ void sub_80427AC(void) s32 i; for (i = 0; i < 20; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) { enInfo = GetEntInfo(entity); if (enInfo->unkF3) { enInfo->unkF3 = FALSE; sub_80429A0(entity); if (!enInfo->isNotTeamMember) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); } } diff --git a/src/code_8042B34.c b/src/code_8042B34.c index b5bcc97f2..d55d8096a 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -561,7 +561,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8) if (!r6) { s32 rnd; - gDungeon->decoyActive = FALSE; + gDungeon->decoyIsActive = FALSE; rnd = DungeonRandInt(4); gDungeon->unk37FD = 0; gDungeon->deoxysDefeat = FALSE; @@ -1022,7 +1022,7 @@ void sub_8043D60(void) unk = FALSE; if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt)) unk = FALSE; - if (monInfo->clientType == CLIENT_TYPE_CLIENT) + if (monInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) unk = FALSE; if (unk) { diff --git a/src/code_8045A00.c b/src/code_8045A00.c index 5afb1a738..943820e42 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -32,7 +32,7 @@ void sub_8045ACC(void) { entity = gDungeon->teamPokemon[index]; if (EntityExists(entity)) { - gDungeon->allPokemon[pokeCount] = entity; + gDungeon->activeMonsterPtrs[pokeCount] = entity; pokeCount++; } } @@ -41,12 +41,12 @@ void sub_8045ACC(void) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { - gDungeon->allPokemon[pokeCount] = entity; + gDungeon->activeMonsterPtrs[pokeCount] = entity; pokeCount++; } } for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { - gDungeon->allPokemon[pokeCount] = NULL; + gDungeon->activeMonsterPtrs[pokeCount] = NULL; } } @@ -64,7 +64,7 @@ s32 GetTeamMemberEntityIndex(Entity *pokemon) return -1; } -void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3) +void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3) { switch(GetEntityType(entity)) { diff --git a/src/code_8048480.c b/src/code_8048480.c index 18379e717..2759d2cde 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -163,7 +163,7 @@ bool8 sub_8047930(Entity *pokemon, Entity *target) bool8 flag; if (((GetEntInfo(target)->shopkeeper == TRUE) || - (GetEntInfo(target)->clientType == CLIENT_TYPE_DONT_MOVE)) || (GetEntInfo(target)->clientType == CLIENT_TYPE_CLIENT)) { + (GetEntInfo(target)->monsterBehavior == BEHAVIOR_DIGLETT)) || (GetEntInfo(target)->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { return FALSE; } else { @@ -220,7 +220,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity } PlaySoundEffect(0x14d); sub_8045BF8(gFormatBuffer_Items[0],item); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBB8); // $m0 caught the $i0 info->heldItem = *item; sub_806A6E8(target); @@ -596,7 +596,7 @@ void RawstBerryItemAction(Entity *pokemon, Entity *target) SendNonVolatileEndMessage(pokemon, target); else { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FB580); } @@ -610,7 +610,7 @@ void HungerSeedItemAction(Entity *pokemon, Entity * target) else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (IQSkillIsEnabled(target, IQ_SELF_CURER)) TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage); else @@ -695,7 +695,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) uVar1 = gUnknown_80F4FA4; } if (entityInfo_1->immobilize.immobilizeStatus == STATUS_FROZEN) { - SendImmobilizeEndMessage(pokemon, target); + EndFrozenClassStatus(pokemon, target); } sub_806F370(pokemon, target, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); } @@ -718,7 +718,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) uVar1 = gUnknown_80F4FA6; } if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { - SendImmobilizeEndMessage(pokemon, entity); + EndFrozenClassStatus(pokemon, entity); } sub_806F370(pokemon, entity, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); } @@ -832,7 +832,7 @@ bool8 sub_8048950(Entity *param_1,Item *item) if (CheckVariousStatuses2(entity, FALSE)) { flag = FALSE; } - if (entityInfo->clientType == CLIENT_TYPE_CLIENT) { + if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) { @@ -894,7 +894,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item) if (CheckVariousStatuses2(entity, FALSE)) { flag = FALSE; } - if (pEVar6->clientType == CLIENT_TYPE_CLIENT) { + if (pEVar6->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } if (IsClientOrTeamBase(pEVar6->joinedAt.joinedAt)) { @@ -956,7 +956,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2) { flag = FALSE; } - if(entity1Info->clientType == CLIENT_TYPE_CLIENT) + if(entity1Info->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { flag = FALSE; } @@ -1034,14 +1034,14 @@ bool8 sub_8048D50(Entity * pokemon, Item *item) if ((item->flags & ITEM_FLAG_STICKY) != 0) { sub_8045BF8(gFormatBuffer_Items[0], item); - TryDisplayDungeonLoggableMessage(pokemon,*gItemStickyDoesntWorkText); + LogMessageByIdWithPopupCheckUser(pokemon,*gItemStickyDoesntWorkText); return FALSE; } else { if ((entityInfo->muzzled.muzzled == TRUE) && (IsEdibleItem(item->id))) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FDCA4); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FDCA4); return FALSE; } } @@ -1083,27 +1083,27 @@ void GrimyFoodItemAction(Entity *pokemon, Entity * target) void IcePartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrIcePartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrIcePartCrumbledMessage); } void RockPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrRockPartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrRockPartCrumbledMessage); } void SteelPartItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrSteelPartCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrSteelPartCrumbledMessage); } void WishStoneItemAction(Entity *pokemon, Entity *target, u8 r2) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWishStoneCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWishStoneCrumbledMessage); } void MusicBoxItemAction(Entity *pokemon, Entity *target, u8 r2) { sub_80421C0(pokemon, 0xD6); - TryDisplayDungeonLoggableMessage(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); sub_803E708(0x3C, 0x46); } diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index f1fe58cc7..771fc0e69 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -20,7 +20,7 @@ void sub_8068768(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (entity != NULL && EntityExists(entity)) LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 8d0a9ccc9..0c6b6cb95 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -264,7 +264,7 @@ void DungeonHandlePlayerInput(void) } } else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80FD4B0); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80FD4B0); sub_8044C50(1); gDungeon->unk673 = 1; break; @@ -279,7 +279,7 @@ void DungeonHandlePlayerInput(void) } } if (i == MAX_MON_MOVES) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A28); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A28); break; } @@ -305,7 +305,7 @@ void DungeonHandlePlayerInput(void) } } if (!canUseMove) { - TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A4C); + LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A4C); } else { SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER); @@ -529,7 +529,7 @@ void DungeonHandlePlayerInput(void) if (!(canMoveFlags & 2)) { if (canMoveFlags & 1) { if (immobilizedMsg != NULL) { - TryDisplayDungeonLoggableMessage(leader, immobilizedMsg); + LogMessageByIdWithPopupCheckUser(leader, immobilizedMsg); } sub_8044C50(1); gDungeon->unk673 = 1; @@ -1545,7 +1545,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) if (tileMonsterInfo->isNotTeamMember && (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2) && !IsClientOrTeamBase(tileMonsterInfo->joinedAt.joinedAt) - && tileMonsterInfo->clientType != CLIENT_TYPE_CLIENT) { + && tileMonsterInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { return FALSE; } @@ -1668,7 +1668,7 @@ bool8 sub_805EF60(Entity *a0, EntityInfo *a1) return FALSE; if (!sub_8070BC0(a0)) return FALSE; - if (GetEntInfo(r4)->isNotTeamMember && GetEntInfo(r4)->clientType != CLIENT_TYPE_CLIENT && GetEntInfo(r4)->shopkeeper != 1) + if (GetEntInfo(r4)->isNotTeamMember && GetEntInfo(r4)->monsterBehavior != BEHAVIOR_RESCUE_TARGET && GetEntInfo(r4)->shopkeeper != 1) return FALSE; SetMonsterActionFields(&a1->action, ACTION_TALK_FIELD); @@ -1753,8 +1753,8 @@ void sub_805F02C(void) sub_803F508(r7); sub_8041AD0(leader); sub_8041AE0(GetLeader()); - SetMessageArgument(gFormatBuffer_Monsters[0], r7, 0); - TryDisplayDungeonLoggableMessage(r7, gUnknown_80F9BB0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], r7, 0); + LogMessageByIdWithPopupCheckUser(r7, gUnknown_80F9BB0); sub_807EC28(FALSE); r8->unk64 = 0; leaderInfo->unk64 = 0; @@ -2116,7 +2116,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1) break; } else { - SetMessageArgument(gFormatBuffer_Monsters[0], GetLeader(), 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); DisplayDungeonMessage(0, gUnknown_80FDE18, 1); } } @@ -2252,7 +2252,7 @@ void DrawFieldMenu(u8 a0) Entity *teamMon = gDungeon->teamPokemon[i]; if (EntityExists(teamMon)) { EntityInfo *monInfo = GetEntInfo(teamMon); - SetMessageArgument(gFormatBuffer_Monsters[0], teamMon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], teamMon, 0); gFormatArgs[0] = monInfo->HP; gFormatArgs[1] = monInfo->maxHPStat; PrintFormattedStringOnWindow(4, yLoop, gUnknown_80F91E0, 2, 0); @@ -3652,7 +3652,7 @@ void ShowTacticsMenu(ActionContainer *a0) monInfo->aiTarget.unkC = 0; monInfo->aiTarget.aiTargetSpawnGenID = 0; if (!monInfo->isTeamLeader) { - MoveIfPossible(teamMon, TRUE); + AIMovement(teamMon, TRUE); } } else { diff --git a/src/code_8066D04.c b/src/code_8066D04.c index a618531a9..916169ae5 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -54,7 +54,7 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) if (((itemPtr->flags & ITEM_FLAG_EXISTS)) && ((itemPtr->flags & ITEM_FLAG_SET))) { if ((itemPtr->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[0],itemPtr); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotEquip); return; } itemPtr->flags &= ~(ITEM_FLAG_SET); @@ -64,22 +64,22 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2) PlaySoundEffect(0x133); if (param_2 != 0) { if ((item->flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D04); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D04); } else { if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE4); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE4); } else { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE8); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE8); } } } item->flags |= ITEM_FLAG_SET; if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } @@ -95,14 +95,14 @@ void HandleUnsetItemAction(Entity *entity,bool8 enableMessage) if (((item->flags & ITEM_FLAG_EXISTS)) && ((item->flags & ITEM_FLAG_SET))) { if ((item->flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(entity,*gItemStickyCannotEquip); + LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotEquip); return; } item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],item); PlaySoundEffect(0x133); if (enableMessage) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8D20); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8D20); } } } @@ -132,15 +132,15 @@ void HandleGiveItemAction(Entity *param_1) if ((!bVar3) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { sub_8045BF8(gFormatBuffer_Items[1],item); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove2); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove2); } else { - SetMessageArgument(gFormatBuffer_Monsters[1],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],entity,0); if (((info2->heldItem).flags & ITEM_FLAG_EXISTS)) { if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) { sub_8045BF8(gFormatBuffer_Items[1],&info2->heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove1); + LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove1); return; } item1 = (info2->heldItem); @@ -158,9 +158,9 @@ void HandleGiveItemAction(Entity *param_1) sub_8045BF8(gFormatBuffer_Items[0],&item2); sub_8045BF8(gFormatBuffer_Items[1],&item1); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gMonTookAndReturnedItem); + LogMessageByIdWithPopupCheckUser(param_1,*gMonTookAndReturnedItem); if ((item2.flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } else { @@ -170,9 +170,9 @@ void HandleGiveItemAction(Entity *param_1) info2->heldItem = item3; sub_8045BF8(gFormatBuffer_Items[0],&item3); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D44); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D44); if ((item3.flags & ITEM_FLAG_STICKY)) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } } sub_806A6E8(entity); @@ -198,24 +198,24 @@ void HandleTakeItemAction(Entity *param_1) info = GetEntInfo(entity); heldItem = &info->heldItem; if (ItemExists(&gTeamInventoryRef->teamItems[ITEM_POWER_BAND])) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D60); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D60); } else { if (ItemSticky(heldItem)) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else { item = *heldItem; item.flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],&item); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); ZeroOutItem(heldItem); AddItemToInventory(&item); PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D7C); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D7C); sub_806A6E8(entity); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); @@ -243,11 +243,11 @@ void sub_8066BD4(Entity *param_1) if (heldItem->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatBuffer_Items[0],heldItem); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else if ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) { sub_8045BF8(gFormatBuffer_Items[0],item); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0); } else { @@ -255,12 +255,12 @@ void sub_8066BD4(Entity *param_1) item->flags &= ~(ITEM_FLAG_SET); sub_8045BF8(gFormatBuffer_Items[0],heldItem); sub_8045BF8(gFormatBuffer_Items[1],item); - SetMessageArgument(gFormatBuffer_Monsters[1],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],entity,0); temp = info->heldItem; info->heldItem = *item; *item = temp; PlaySoundEffect(0x14d); - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8DB4); + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8DB4); if (sub_80706A4(entity,&entity->pos) != 0) { sub_807D148(param_1,entity,0,0); } @@ -296,13 +296,13 @@ void HandlePlaceItemAction(Entity *param_1) item = sub_8044D90(entity,0,4); sub_8045BF8(gFormatBuffer_Items[0],item); if (info->action.unk4[0].actionUseIndex == 0x80) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8DE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8DE0); } else if ((info->action.unk4[0].actionUseIndex < 0x15) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); } else if ((info->action.unk4[0].actionUseIndex == 0x81) && ((item->flags & ITEM_FLAG_STICKY))) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0); } else { tile = GetTile(entity->pos.x, entity->pos.y); @@ -314,7 +314,7 @@ void HandlePlaceItemAction(Entity *param_1) sub_8045BF8(gFormatBuffer_Items[0],item); if (sub_80460F8(&entity->pos,item,1) == 0) { _message: - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E04); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04); } else { @@ -323,8 +323,8 @@ void HandlePlaceItemAction(Entity *param_1) item->flags = 0; FillInventoryGaps(); PlaySoundEffect(0x14d); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E28); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E28); sub_807AB38(entity,gDungeon->unk3A08); } } diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 20741ab54..7abdbc1dd 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -74,7 +74,7 @@ void TriggerWeatherAbilities(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { if (HasAbility(entity, ABILITY_DRIZZLE)) { gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; @@ -172,7 +172,7 @@ void sub_8069F9C(Entity *pokemon,Entity * target,Move *move) } iVar6->abilities[abilityIndex] = local_20[randomIndex]; gDungeon->unkC = 1; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC7C); sub_8042900(target); sub_806ABAC(pokemon,target); @@ -190,7 +190,7 @@ _0806A068: iVar6->types[0] = type; iVar6->types[1] = TYPE_NONE; iVar6->isColorChanged = TRUE; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); __src = GetUnformattedTypeString(iVar6->types[0]); strcpy(gFormatBuffer_Items[0],__src); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCAC); @@ -215,7 +215,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) entityInfo->types[0] = uVar2_u32; entityInfo->types[1] = 0; sub_8041BBC(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); typeString = GetUnformattedTypeString(uVar2_u32); strcpy(gFormatBuffer_Items[0],typeString); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8); @@ -301,7 +301,7 @@ void sub_806A338(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { gDungeon->snatchPokemon = entity; diff --git a/src/code_806CD90.c b/src/code_806CD90.c index bfa7ca71b..965c30a08 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -49,7 +49,7 @@ void sub_806CC10(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -69,7 +69,7 @@ void sub_806CC70(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -116,7 +116,7 @@ void sub_806CD90(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -227,7 +227,7 @@ void sub_806CF60(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->allPokemon[i]; + entity = gDungeon->activeMonsterPtrs[i]; if (EntityExists(entity)) sub_806CF98(entity); @@ -473,7 +473,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * if (r9) { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->allPokemon[targetInfo->linked.unkD8]; + Entity *destBondTarget = gDungeon->activeMonsterPtrs[targetInfo->linked.unkD8]; if (destBondTarget == NULL) { targetInfo->linked.linkedStatus = 0; } @@ -520,14 +520,14 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } if (arg4 != 0x20E && HasAbility(target, ABILITY_STURDY) && dmgStruct->dmg == 9999) { - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90); sub_8042238(attacker, target); dmgStruct->tookNoDamage = TRUE; return FALSE; } if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); dmgStruct->tookNoDamage = TRUE; @@ -568,8 +568,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (dmgStruct->dmg == 0) { if (sub_8045888(attacker) && sub_8045888(target)) { if (targetData->unk152 == 0) { @@ -715,8 +715,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc r8 = 0; targetData->unk14C = 0; - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { if (targetData->isNotTeamMember) { TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); @@ -727,7 +727,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } else if (targetData->isNotTeamMember) { - if (targetData->clientType == CLIENT_TYPE_CLIENT) { + if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else { @@ -742,7 +742,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); } - else if (targetData->clientType == CLIENT_TYPE_CLIENT) { + else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); } else if (sub_806A58C(recruitedMon->unkA)) { @@ -791,7 +791,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; @@ -848,8 +848,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], teamMember, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); sub_806F63C(target); return FALSE; @@ -902,7 +902,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc sub_806A390(target); sub_806CCB4(target, sub_806CEBC(target)); EntityUpdateStatusSprites(target); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); sub_806F63C(target); return FALSE; diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index 275e963f6..c045dc576 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -322,7 +322,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 s32 flashFireStatus = GetFlashFireStatus(target); if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { targetInfo->unk152 = 1; - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! } diff --git a/src/code_806FDF4.c b/src/code_806FDF4.c index 2e45d797e..2ac2f5684 100644 --- a/src/code_806FDF4.c +++ b/src/code_806FDF4.c @@ -229,7 +229,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) (targetInfo->id != MONSTER_JIRACHI) && (targetInfo->id != MONSTER_RAYQUAZA) && (targetInfo->id != MONSTER_DEOXYS_NORMAL) && - (targetInfo->id != 0MONSTER_REGIROCK && + (targetInfo->id != MONSTER_REGIROCK && (targetInfo->id != MONSTER_REGICE) && (targetInfo->id != MONSTER_REGISTEEL)) || (HasRecruitedMon(targetInfo->id) == 0)) && (sub_806F9BC(targetInfo->id) != 0)) { @@ -243,7 +243,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target) iVar5 = -iVar5; } if (((iVar5 < 2) && (targetInfo->joinedAt.joinedAt != 0x4A)) && - (targetInfo->clientType != 1 && (CanSeeTarget(target,pokemon)) + (targetInfo->monsterBehavior != 1 && (CanSeeTarget(target,pokemon)) )) { sub_806F910(); iVar4 = DungeonRandInt(1000); @@ -746,7 +746,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa if (DisplayDungeonYesNoMessage(0,*gUnknown_80F9FE8,1) == 0) { if (param_3->id != MONSTER_JIRACHI) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA004); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA004); } return 0; } @@ -759,7 +759,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } if (pokeIndex == MAX_TEAM_MEMBERS) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA030); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA030); return FALSE; } else { @@ -800,7 +800,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa sub_8097848(); if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA058); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA058); pokeStruct2->unk0 = 0; } else { @@ -812,10 +812,10 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa } } sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0); - TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA0F0); + LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA0F0); if (flag) { leader = xxx_call_GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); DisplayDungeonMessage(0,*gUnknown_80FA120,1); @@ -1074,7 +1074,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr) } if (flag) { leader = xxx_call_GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0); sub_8092558(gFormatBuffer_FriendArea,friendArea); PlaySound(0xce); DisplayDungeonMessage(0,*gUnknown_80FA120,1); diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 264fefc83..c30e65242 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -99,7 +99,7 @@ void sub_8071B48(void) if (dungeon->unk662 > 900) { entity2 = dungeon->unk17B34; if ((EntityExists(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { - SetMessageArgument(gFormatBuffer_Monsters[0],entity2,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0); entityPtr = entity2; } } @@ -449,7 +449,7 @@ void sub_8071DA4(Entity *entity) " ldr r0, _08071FF8\n" " mov r1, r8\n" " movs r2, 0\n" -" bl SetMessageArgument\n" +" bl SubstitutePlaceholderStringTags\n" " lsls r1, r4, 24\n" " lsrs r1, 24\n" " ldr r0, _08071FFC\n" @@ -544,7 +544,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++) { if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF730); } @@ -553,7 +553,7 @@ void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 para info->expGainedInTurn = 0; info->unk149 = 0; if ((flag == 0) && (param_4 != 0)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74); } } @@ -668,7 +668,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) if(!flag) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94); } } diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 3986ec9fb..2ca957fd4 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -138,14 +138,14 @@ void sub_8073D14(Entity *entity) return; if (sub_8044B28()) return; - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); if (entityInfo->isTeamLeader) return; if (entityInfo->shopkeeper == 1) return; if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) return; - if (entityInfo->clientType == CLIENT_TYPE_CLIENT) + if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) return; _entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason. @@ -155,7 +155,7 @@ void sub_8073D14(Entity *entity) if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { sub_8045BF8(gFormatBuffer_Items[0], groundItem); - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); } else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { @@ -265,7 +265,7 @@ void sub_8073D14(Entity *entity) DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); } else if (AddItemToInventory(groundItem)) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); } else { @@ -383,7 +383,7 @@ void sub_8074094(Entity *entity) if (str != NULL) { if (sound) PlaySoundEffect(0x153); - TryDisplayDungeonLoggableMessage(entity, str); + LogMessageByIdWithPopupCheckUser(entity, str); sub_803E708(0x1E, 0x32); } } @@ -529,7 +529,7 @@ void sub_8074094(Entity *entity) if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { s32 hp = gUnknown_80F4FB4; - Entity *target = gDungeon->allPokemon[entityInfo->linked.unkD8]; + Entity *target = gDungeon->activeMonsterPtrs[entityInfo->linked.unkD8]; entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; if (target == NULL) { @@ -571,11 +571,11 @@ void sub_8074094(Entity *entity) UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - SetMessageArgument(gFormatBuffer_Monsters[1], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FEB30); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30); TrySendImmobilizeSleepEndMsg(entity, entity); if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { - TryDisplayDungeonLoggableMessage(entity, gPtrProtectSavedItMessage); + LogMessageByIdWithPopupCheckUser(entity, gPtrProtectSavedItMessage); } else { DealDamageToEntity(entity, 0x270F, 0xB, 0x20E); @@ -611,8 +611,8 @@ void sub_8074094(Entity *entity) if (entityInfo->charging.chargingStatusTurns == 0) { entityInfo->charging.chargingStatus = 0; entityInfo->unk14A = 0; - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FABD8); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FABD8); } } @@ -686,7 +686,7 @@ void TickStatusHeal(Entity *entity) if (entityInfo->immobilize.immobilizeStatus != 0) { sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns); if (entityInfo->immobilize.immobilizeStatusTurns == 0) { - SendImmobilizeEndMessage(entity, entity); + EndFrozenClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) @@ -767,8 +767,8 @@ void TickStatusHeal(Entity *entity) if (entityInfo->terrifiedTurns != 0) { sub_80838EC(&entityInfo->terrifiedTurns); if (entityInfo->terrifiedTurns == 0) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gPtrStenchWavedOffMessage); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gPtrStenchWavedOffMessage); } } @@ -791,8 +791,8 @@ void TickStatusHeal(Entity *entity) s32 newSpdStage = CalcSpeedStage(entity); if (oldSpdStage != newSpdStage) { - SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); - TryDisplayDungeonLoggableMessage(entity, gUnknown_80FA124[newSpdStage]); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); + LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FA124[newSpdStage]); } } } @@ -893,7 +893,7 @@ bool8 UseAttack(Entity *a0) gUnknown_202F378 = 1; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); if (monInfo->numMoveTiles == 0) { @@ -935,7 +935,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { sub_803E46C(7); for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; @@ -963,7 +963,7 @@ bool8 UseAttack(Entity *a0) } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->allPokemon[i]; + Entity *mon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); monInfo->numMoveTiles = 0; @@ -979,7 +979,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { Position monPosBefore; EntityInfo *monInfo; - Entity *mon = gDungeon->allPokemon[loop]; + Entity *mon = gDungeon->activeMonsterPtrs[loop]; if (!EntityExists(mon)) continue; diff --git a/src/code_8075708.c b/src/code_8075708.c index c4afc842b..b1aa63c29 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -30,7 +30,7 @@ void sub_8075680(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) { targetPos = &(info->targetPos); diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 85b2235c4..16538c997 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -216,7 +216,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->muzzled.muzzled != TRUE) { entityInfo->muzzled.muzzled = TRUE; entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; @@ -250,7 +250,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); else { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); iVar5 = sub_803D870(auStack544, 0); if (iVar5 == 0) @@ -299,7 +299,7 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) { entityInfo->transformStatus.transformStatus = STATUS_MOBILE; entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; @@ -328,7 +328,7 @@ void ExposeStatusTarget(Entity * pokemon, Entity * target, s16 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->hitChanceStages[1] > 10) { entityInfo->hitChanceStages[1] = 10; flag = TRUE; @@ -384,7 +384,7 @@ void BlindTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; @@ -411,7 +411,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) if(!HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { sub_8041E1C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); @@ -437,7 +437,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; @@ -505,7 +505,7 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->atk[0]; @@ -535,7 +535,7 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->atk[1]; @@ -565,7 +565,7 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->def[0]; @@ -595,7 +595,7 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment) EntityInfo *entityInfo; if (EntityExists(target)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); entityInfo = GetEntInfo(target); oldStat = entityInfo->def[1]; @@ -622,7 +622,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; sub_8041EA4(target); @@ -639,7 +639,7 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { entityInfo->itemStatus.itemStatus = STATUS_PIERCE; sub_8041EB4(target); @@ -663,7 +663,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); } @@ -738,7 +738,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus == newStatus) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); } @@ -760,7 +760,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; @@ -780,7 +780,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIST) { entityInfo->protection.protectionStatus = STATUS_MIST; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; @@ -800,7 +800,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_WISH) { entityInfo->protection.protectionStatus = STATUS_WISH; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; @@ -820,7 +820,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; @@ -840,7 +840,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; @@ -860,7 +860,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { entityInfo->protection.protectionStatus = STATUS_REFLECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; @@ -884,11 +884,11 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->protection.protectionStatus != STATUS_PROTECT) { entityInfo->protection.protectionStatus = STATUS_PROTECT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8); } EntityUpdateStatusSprites(target); @@ -901,7 +901,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; @@ -921,7 +921,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { entityInfo->protection.protectionStatus = STATUS_ENDURING; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; @@ -941,7 +941,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; @@ -966,7 +966,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) { entityInfo->protection.protectionStatus = STATUS_CONVERSION2; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; @@ -987,7 +987,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; @@ -1040,7 +1040,7 @@ void sub_8079E34(Entity * pokemon, Entity * target, bool8 param_3) else if (param_3 != 0) { sub_80420C8(target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (statChanged) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18); } @@ -1071,7 +1071,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) return; } SendNonVolatileEndMessage(pokemon,target); - SendImmobilizeEndMessage(pokemon,target); + EndFrozenClassStatus(pokemon,target); SendVolatileEndMessage(pokemon,target); SendWaitingEndMessage(pokemon,target,0); SendLinkedEndMessage(pokemon,target); @@ -1157,7 +1157,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->sleep.sleep) { case STATUS_NONE: case 6: @@ -1207,7 +1207,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->nonVolatile.nonVolatileStatus) { case STATUS_NONE: case 5: @@ -1228,7 +1228,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) EntityUpdateStatusSprites(target); } -void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) +void EndFrozenClassStatus(Entity * pokemon, Entity *target) { bool8 isFrozen; EntityInfo *entityInfo; @@ -1238,7 +1238,7 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->immobilize.immobilizeStatus) { case STATUS_NONE: case 8: @@ -1278,7 +1278,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->volatileStatus.volatileStatus) { case STATUS_NONE: case 8: @@ -1318,50 +1318,50 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->protection.protectionStatus) { case STATUS_NONE: case 0xF: break; case STATUS_REFLECT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA638); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA638); break; case STATUS_SAFEGUARD: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA69C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA69C); break; case STATUS_LIGHT_SCREEN: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA658); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA658); break; case STATUS_COUNTER: case STATUS_MINI_COUNTER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA67C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA67C); break; case STATUS_MAGIC_COAT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6BC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6BC); break; case STATUS_WISH: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6D4); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6D4); break; case STATUS_PROTECT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9C0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9C0); break; case STATUS_MIRROR_COAT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA68); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA68); break; case STATUS_ENDURING: - TryDisplayDungeonLoggableMessage(target, *gPtrMonStoppedEnduringMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonStoppedEnduringMessage); break; case STATUS_MIRROR_MOVE: - TryDisplayDungeonLoggableMessage(target,*gPtrMonMirrorMoveFadedMessage); + LogMessageByIdWithPopupCheckUser(target,*gPtrMonMirrorMoveFadedMessage); break; case STATUS_CONVERSION2: - TryDisplayDungeonLoggableMessage(target, *gPtrMonConversion2FailedMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonConversion2FailedMessage); break; case STATUS_VITAL_THROW: - TryDisplayDungeonLoggableMessage(target, *gPtrMonGaveUpVitalThrowMessage); + LogMessageByIdWithPopupCheckUser(target, *gPtrMonGaveUpVitalThrowMessage); break; case STATUS_MIST: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB40); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40); break; } entityInfo->protection.protectionStatus = STATUS_NONE; @@ -1375,19 +1375,19 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->waitingStruct.waitingStatus) { case STATUS_NONE: case 4: break; case STATUS_CURSED: if (waitingStatus != STATUS_CURSED) { - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7BC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC); } break; case STATUS_SNATCH: if (waitingStatus != STATUS_SNATCH) { - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7DC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC); } gDungeon->snatchPokemon = NULL; gDungeon->unk17B3C = 0; @@ -1396,10 +1396,10 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) entityInfo->waitingStruct.waitingStatus = STATUS_NONE; uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); - gDungeon->decoyActive = FALSE; + gDungeon->decoyIsActive = FALSE; if (waitingStatus != STATUS_DECOY) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9A0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0); } break; } @@ -1414,16 +1414,16 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->linked.linkedStatus) { case STATUS_NONE: break; case STATUS_LEECH_SEED: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA79C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA79C); break; case STATUS_DESTINY_BOND: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA8C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C); break; } entityInfo->linked.linkedStatus = STATUS_NONE; @@ -1440,22 +1440,22 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->moveStatus.moveStatus) { case STATUS_NONE: case 5: break; case STATUS_SURE_SHOT: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA8E0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA8E0); break; case STATUS_WHIFFER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA90C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA90C); break; case STATUS_SET_DAMAGE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA934); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA934); break; case STATUS_FOCUS_ENERGY: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA95C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C); break; } entityInfo->moveStatus.moveStatus = STATUS_NONE; @@ -1473,24 +1473,24 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->transformStatus.transformStatus) { case STATUS_NONE: case 4: break; case STATUS_INVISIBLE: isInvisible = TRUE; - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9F4); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9F4); break; case STATUS_MOBILE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABBC); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABBC); break; case STATUS_TRANSFORMED: entityInfo->apparentID = sub_8069F54(target, entityInfo->id); target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB6C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C); break; } entityInfo->transformStatus.transformStatus = STATUS_NONE; @@ -1508,19 +1508,19 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->eyesightStatus.eyesightStatus) { case STATUS_NONE: case 4: break; case STATUS_BLINKER: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA0C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA0C); break; case STATUS_CROSS_EYED: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA2C); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA2C); break; case STATUS_EYEDROPS: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA48); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48); break; } entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; @@ -1540,13 +1540,13 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target) return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); switch(entityInfo->muzzled.muzzled) { case FALSE: case 2: break; case TRUE: - TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABC0); + LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABC0); break; } entityInfo->muzzled.muzzled = FALSE; @@ -1559,7 +1559,7 @@ bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) bool32 msg = FALSE; if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { - SendImmobilizeEndMessage(pokemon, target); + EndFrozenClassStatus(pokemon, target); msg = TRUE; } if (entityInfo->sleep.sleep == STATUS_SLEEP && entityInfo->sleep.sleepTurns == 0x7f) { @@ -1590,7 +1590,7 @@ void SendThawedMessage(Entity *pokemon, Entity *target) entityInfo->immobilize.immobilizeStatus = STATUS_NONE; entityInfo->immobilize.immobilizeStatusTurns = 0; entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! EntityUpdateStatusSprites(target); } diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 99f295bbd..4fc5f9988 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -70,11 +70,11 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction) else { if (pokemon == target) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying! return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! return; @@ -226,7 +226,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos) info = GetEntInfo(target); flag = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasAbility(target,ABILITY_SUCTION_CUPS)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); return; @@ -358,12 +358,12 @@ void sub_807D3CC(Entity *param_1) } } if (flag) { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD2F8); // All traps were exposed sub_8040A84(); sub_8049ED4(); } else { - TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. + LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD320); // There appears to be no hidden traps. } } diff --git a/src/code_807E1A0.c b/src/code_807E1A0.c index a1d17e4a3..2e3f69b73 100644 --- a/src/code_807E1A0.c +++ b/src/code_807E1A0.c @@ -74,12 +74,12 @@ void sub_807E254(Entity *pokemon,Entity *target) if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else if(HasAbility(target, ABILITY_SUCTION_CUPS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places } else @@ -135,7 +135,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C4C); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C4C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); gDungeon->unk67A = 1; } @@ -147,7 +147,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C70); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C70); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); gDungeon->unk67A = 2; } @@ -159,7 +159,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C8C); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C8C); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); gDungeon->unk67A = 3; } @@ -170,7 +170,7 @@ void sub_807E378(void) sub_806A2BC(leader,1); UseAttack(leader); if (sub_8044B28() == 0) { - TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9CBC); + LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9CBC); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); gDungeon->unk67A = 4; sub_8068FE0(leader,0x21e,leader); diff --git a/src/code_8083288.c b/src/code_8083288.c index 39d64988c..25277b261 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -26,10 +26,10 @@ void sub_8082B40(void) Entity *entity; int index; Position pos; - + for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { info = GetEntInfo(entity); entity->axObj.spriteFile = GetSpriteData(info->apparentID); @@ -202,7 +202,7 @@ void sub_8082DE8(unkStruct_8094924 *param_1, Protection *protect) void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting) { sub_8082FE0(param_1, &waiting->waitingStatus, 1); - waiting->enemyDecoy = sub_80831DC(param_1); + waiting->decoyApplierNonTeamMemberFlag = sub_80831DC(param_1); waiting->unkCA = sub_80831DC(param_1); waiting->waitingStatusTurns = sub_8083188(param_1); waiting->curseDamageCountdown = sub_8083188(param_1); @@ -301,7 +301,7 @@ void sub_8082FA8(unkStruct_8094924 *param_1, u8 *param_2, s32 size) param_2++; size--; param_1->unk8++; - } + } } void sub_8082FD4(unkStruct_8094924 *param_1, u8 *r1, u32 r2) @@ -319,7 +319,7 @@ void sub_8082FE0(unkStruct_8094924 *param_1, u8 *param_2, s32 size) param_2++; size--; param_1->unk8++; - } + } } void nullsub_98(unkStruct_8094924 *param_1) diff --git a/src/debug_menu1.c b/src/debug_menu1.c index 04de91a30..d4977eff6 100644 --- a/src/debug_menu1.c +++ b/src/debug_menu1.c @@ -157,7 +157,7 @@ static void sub_803A3BC(void) speciesIndex = index * 0x10000 >> 0x10; // TODO: dumb way to force s16. Temp var may fix the regswap memset(moves, 0, sizeof(moves)); moves[0] = MOVE_DOUBLESLAP; - CopyMonsterNametoBuffer(buffer, speciesIndex); + CopyMonsterNameToBuffer(buffer, speciesIndex); CopyStringtoBuffer(buffer, buffer); buffer[0] = 0x40; sub_808CFD0(&pokemon, speciesIndex, buffer, ITEM_CHERI_BERRY, (DungeonLocation *)&loc, moves); diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 436c0fd25..7a4a7d439 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -48,7 +48,7 @@ void sub_8044820(void) Entity * entity; Entity * entity2; s32 index; - + for (index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { @@ -62,7 +62,7 @@ void sub_8044820(void) } else { - entityInfo->aiNextToTarget = FALSE; + entityInfo->aiAllySkip = FALSE; movSpeed = CalcSpeedStage(entity); if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] != 0) { if (!entityInfo->attacking) { @@ -88,12 +88,12 @@ void sub_8044820(void) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity2 = gDungeon->wildPokemon[index]; - if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiNextToTarget)) + if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiAllySkip)) { sub_8074094(entity2); if (EntityExists(entity2)) { sub_8071DA4(entity2); - entityInfo2->aiNextToTarget = FALSE; + entityInfo2->aiAllySkip = FALSE; } } } @@ -106,7 +106,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) Entity *entity; u32 isNotEnemy; s32 index; - + if (gSpeedTurns[1][gDungeon->fractionalTurn] != 0) { sub_8071B48(); gDungeon->plusIsActive[0] = FALSE; @@ -118,7 +118,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); entityInfo->attacking = FALSE; @@ -137,7 +137,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) } if (HasAbility(entity, ABILITY_MINUS)) { gDungeon->minusIsActive[isNotEnemy] = TRUE; - } + } if (HasAbility(entity, ABILITY_PLUS)) { gDungeon->plusIsActive[isNotEnemy] = TRUE; } @@ -150,10 +150,10 @@ void TrySpawnMonsterAndActivatePlusMinus(void) void sub_8044AB4(void) { s32 index; - + if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (EntityExists(gDungeon->allPokemon[index])) { + if (EntityExists(gDungeon->activeMonsterPtrs[index])) { UseAttack(0); break; } @@ -182,7 +182,7 @@ bool8 sub_8044B28(void) } return TRUE; } - + bool8 sub_8044B84(void) { if(gDungeon->unk10 != 0) @@ -198,7 +198,7 @@ u8 *sub_8044BA8(u16 param_1, u8 id) { u32 uVar3; u32 uVar4; - + if ((param_1 == 0x26) && (sub_8043D10() == 2)) { return *gUnknown_80F91EC; } @@ -260,7 +260,7 @@ void SetMonsterActionFields(ActionContainer *actionPointer, u16 action) void SetActionPassTurnOrWalk(ActionContainer *actionPointer, s16 species) { - if (CanMove(species)) + if (GetCanMoveFlag(species)) { actionPointer->action = ACTION_WALK; } diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 298cfc4bc..80684cf92 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -56,7 +56,7 @@ void sub_8075900(Entity *pokemon, u8 r1) if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) { // It's a monster house! - TryDisplayDungeonLoggableMessage(GetLeader(), gPtrItsaMonsterHouseMessage); + LogMessageByIdWithPopupCheckUser(GetLeader(), gPtrItsaMonsterHouseMessage); gDungeon->monsterHouseTriggeredEvent = TRUE; sub_807AB38(pokemon, r1); sub_8041888(0); @@ -76,21 +76,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { - SendImmobilizeEndMessage(pokemon, pokemon); + EndFrozenClassStatus(pokemon, pokemon); } } else { - pokemonInfo->targetingDecoy = TARGETING_DECOY_NONE; - if (pokemonInfo->clientType == CLIENT_TYPE_NONE || IsMovingClient(pokemon)) + pokemonInfo->decoyAITracker = DECOY_AI_NONE; + if (pokemonInfo->monsterBehavior == BEHAVIOR_FIXED_ENEMY || ShouldRunMonsterAI(pokemon)) { - if (pokemonInfo->clientType != CLIENT_TYPE_CLIENT && pokemonInfo->useHeldItem) + if (pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && pokemonInfo->useHeldItem) { if (CheckVariousConditions(pokemon)) { pokemonInfo->useHeldItem = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, gPtrCouldntBeUsedMessage); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, gPtrCouldntBeUsedMessage); return; } AIDecideUseItem(pokemon); @@ -99,32 +99,32 @@ void RunMonsterAI(Entity *pokemon, u32 unused) return; } } - if (!HasStatusAffectingActions(pokemon)) + if (!HasStatusThatPreventsActing(pokemon)) { - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { s32 i; Entity *target; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - target = gDungeon->allPokemon[i]; + target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY && CanSeeTarget(pokemon, target)) { - bool8 enemyDecoy = GetEntInfo(target)->waitingStruct.enemyDecoy; - u8 targetingDecoy = TARGETING_DECOY_TEAM; - if (enemyDecoy) + bool8 decoyApplierNonTeamMemberFlag = GetEntInfo(target)->waitingStruct.decoyApplierNonTeamMemberFlag; + u8 decoyAITracker = DECOY_AI_TEAM; + if (decoyApplierNonTeamMemberFlag) { - targetingDecoy = TARGETING_DECOY_WILD; + decoyAITracker = DECOY_AI_WILD; } - pokemonInfo->targetingDecoy = targetingDecoy; + pokemonInfo->decoyAITracker = decoyAITracker; break; } } } ClearMonsterActionFields(&pokemonInfo->action); - if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) + if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -138,7 +138,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { if (!IQSkillIsEnabled(pokemon, IQ_DEDICATED_TRAVELER)) { - DecideAttack(pokemon); + ChooseAIMove(pokemon); if (pokemonInfo->action.action != ACTION_NOTHING) { return; @@ -149,11 +149,11 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (!CanMove(pokemonInfo->id)) + if (!GetCanMoveFlag(pokemonInfo->id)) { return; } - MoveIfPossible(pokemon, TRUE); + AIMovement(pokemon, TRUE); } } else @@ -164,21 +164,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (CanMove(pokemonInfo->id)) + if (GetCanMoveFlag(pokemonInfo->id)) { - MoveIfPossible(pokemon, TRUE); + AIMovement(pokemon, TRUE); } if (pokemonInfo->action.action > ACTION_PASS_TURN) { return; } - DecideAttack(pokemon); + ChooseAIMove(pokemon); if (pokemonInfo->action.action <= ACTION_PASS_TURN) { return; } pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; - pokemonInfo->aiNextToTarget = FALSE; + pokemonInfo->aiAllySkip = FALSE; pokemonInfo->waiting = FALSE; } } diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 3b9d68433..5fc15e1f1 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -65,7 +65,7 @@ extern void sub_804AC20(struct Position *); extern void sub_807EC28(bool8); extern void sub_806A5B8(struct Entity *entity); -void DecideAttack(Entity *pokemon) +void ChooseAIMove(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 i; @@ -422,7 +422,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && CanSeeTarget(pokemon, target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -467,7 +467,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target) && pokemon != target) { s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos); @@ -491,7 +491,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->allPokemon[i]; + Entity *target = gDungeon->activeMonsterPtrs[i]; if (EntityExists(target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -674,8 +674,8 @@ bool8 IsAITargetEligible(s32 targetingFlags, Entity *user, Entity *target, Move checkThirdParty: hasTarget = TRUE; if (targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - targetData->clientType == CLIENT_TYPE_DONT_MOVE || - targetData->clientType == CLIENT_TYPE_CLIENT) + targetData->monsterBehavior == BEHAVIOR_DIGLETT || + targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { returnFalse: return FALSE; @@ -988,14 +988,14 @@ void HandleUseOrbAction(Entity *pokemon) if (item->flags & ITEM_FLAG_STICKY) { sub_8045BF8(gFormatBuffer_Items[0], item); - TryDisplayDungeonLoggableMessage(pokemon, *gItemStickyDoesntWorkText); + LogMessageByIdWithPopupCheckUser(pokemon, *gItemStickyDoesntWorkText); return; } act = entityInfo->action; if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrMysteriousPowerPreventedUseMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMysteriousPowerPreventedUseMessage); r4 = TRUE; } else { @@ -1014,21 +1014,21 @@ void HandleUseOrbAction(Entity *pokemon) } if (entityInfo->volatileStatus.volatileStatus == 1) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC714); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC714); r4 = FALSE; r8 = FALSE; } else if (entityInfo->volatileStatus.volatileStatus == 7) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC718); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC718); r4 = FALSE; r8 = FALSE; } else if (entityInfo->nonVolatile.nonVolatileStatus == 4) { - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC6A8); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC6A8); r4 = FALSE; r8 = FALSE; } diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index bec094616..974d90f1a 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -49,7 +49,7 @@ void sub_807360C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { if(GetEntInfo(entity)->unk152 != 0) @@ -281,7 +281,7 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item * } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->allPokemon[i]; + Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon) { s32 targetingFlags; @@ -318,7 +318,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential gAIThrowItemActionChoiceCount = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->allPokemon[i]; + Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon && CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) { diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 57dd17a06..15d34b63c 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -224,7 +224,7 @@ bool8 sub_8072CF4(Entity *entity) break; case ACTION_STAIRS: if ((gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FA5B4); // It's impossible to go down the stairs now! } else { @@ -282,8 +282,8 @@ bool8 sub_8072CF4(Entity *entity) sub_80671A0(entity); break; } - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE6D4); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE6D4); break; case ACTION_TALK_FIELD: HandleTalkFieldAction(entity); @@ -310,8 +310,8 @@ bool8 sub_8072CF4(Entity *entity) HandleThrowItemAIAction(entity); break; case ACTION_SECOND_THOUGHTS: - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE478); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE478); break; default: info->action.action = ACTION_PASS_TURN; @@ -339,7 +339,7 @@ bool8 sub_8072CF4(Entity *entity) } } if (bVar4) { - TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FD2CC); + LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FD2CC); } } sub_807360C(); @@ -358,7 +358,7 @@ bool8 sub_8072CF4(Entity *entity) sub_8046D20(); } sub_8041888(0); - if (((EntityExists(entity)) && (!info->aiNextToTarget)) && (!bVar14)) { + if (((EntityExists(entity)) && (!info->aiAllySkip)) && (!bVar14)) { if (sub_80706A4(entity,&entity->pos) != '\0') { sub_807D148(entity,entity,0,0); } diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index 1fd34a972..c4d14e44b 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -43,7 +43,7 @@ struct CanMoveInDirectionInfo const s32 gFaceDirectionIncrements[] = {0, 1, -1, 2, -2, 3, -3, 4, 0, -1, 1, -2, 2, -3, 3, 4}; -void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect) +void AIMovement(Entity *pokemon, bool8 showRunAwayEffect) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; @@ -67,7 +67,7 @@ void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect) { pokemonInfo->action.action = ACTION_NOTHING; } - else if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) + else if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -148,9 +148,9 @@ bool8 ChooseTargetPosition(Entity *pokemon) bool8 canCrossWalls; s32 targetDistance; s32 i; - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->allPokemon; + possibleTargets = gDungeon->activeMonsterPtrs; maxPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -169,9 +169,9 @@ bool8 ChooseTargetPosition(Entity *pokemon) for (i = 0; i < maxPossibleTargets; i++) { Entity *target = possibleTargets[i]; - if (EntityExists(target) && GetEntInfo(target)->clientType == CLIENT_TYPE_NONE) + if (EntityExists(target) && GetEntInfo(target)->monsterBehavior == BEHAVIOR_FIXED_ENEMY) { - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { if (GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) { @@ -405,7 +405,7 @@ void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect) if (!pokemonInfo->isNotTeamMember && !pokemonInfo->recalculateFollow) { pokemonInfo->aiTarget.aiNotNextToTarget = TRUE; - pokemonInfo->aiNextToTarget = TRUE; + pokemonInfo->aiAllySkip = TRUE; SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); pokemonInfo->waiting = TRUE; return; @@ -492,11 +492,11 @@ void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect) if (pokemonInfo->isTeamLeader) { pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; - pokemonInfo->aiNextToTarget = FALSE; + pokemonInfo->aiAllySkip = FALSE; } else if (pokemonInfo->aiTarget.aiNotNextToTarget) { - pokemonInfo->aiNextToTarget = TRUE; + pokemonInfo->aiAllySkip = TRUE; } } @@ -511,9 +511,9 @@ bool8 AvoidEnemies(Entity *pokemon) Entity **possibleTargets; s32 numPossibleTargets; s32 i; - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->allPokemon; + possibleTargets = gDungeon->activeMonsterPtrs; numPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -534,7 +534,7 @@ bool8 AvoidEnemies(Entity *pokemon) if (EntityExists(target) && CanSeeTarget(pokemon, target)) { s32 distance; - if (gDungeon->decoyActive && GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) + if (gDungeon->decoyIsActive && GetTreatmentBetweenMonsters(pokemon, target, FALSE, TRUE) != TREATMENT_TREAT_AS_ENEMY) { continue; } diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index b29de7390..0b2372c0c 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -462,7 +462,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign { EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *targetData = GetEntInfo(targetPokemon); - u8 targetingDecoy; + u8 decoyAITracker; u8 pokemonTargetingDecoy; bool8 pokemonIsEnemy; bool8 targetIsEnemy; @@ -473,23 +473,23 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign } if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || - pokemonInfo->clientType == CLIENT_TYPE_DONT_MOVE || - targetData->clientType == CLIENT_TYPE_DONT_MOVE || - pokemonInfo->clientType == CLIENT_TYPE_CLIENT || - targetData->clientType == CLIENT_TYPE_CLIENT || + pokemonInfo->monsterBehavior == BEHAVIOR_DIGLETT || + targetData->monsterBehavior == BEHAVIOR_DIGLETT || + pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || + targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) || (!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) { return TREATMENT_IGNORE; } - pokemonTargetingDecoy = pokemonInfo->targetingDecoy; - targetingDecoy = TARGETING_DECOY_NONE; - if (pokemonTargetingDecoy != TARGETING_DECOY_NONE) + pokemonTargetingDecoy = pokemonInfo->decoyAITracker; + decoyAITracker = DECOY_AI_NONE; + if (pokemonTargetingDecoy != DECOY_AI_NONE) { - targetingDecoy = TARGETING_DECOY_WILD; - if (pokemonTargetingDecoy == TARGETING_DECOY_TEAM) + decoyAITracker = DECOY_AI_WILD; + if (pokemonTargetingDecoy == DECOY_AI_TEAM) { - targetingDecoy = TARGETING_DECOY_TEAM; + decoyAITracker = DECOY_AI_TEAM; } } if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL) @@ -521,7 +521,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign { targetIsDecoy = TRUE; } - return gTreatmentData[targetingDecoy][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; + return gTreatmentData[decoyAITracker][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; } u8 sub_807167C(Entity * pokemon, Entity * target) @@ -532,9 +532,9 @@ u8 sub_807167C(Entity * pokemon, Entity * target) pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - if (pokemonEntityData->clientType != CLIENT_TYPE_CLIENT) { + if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt); - if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->clientType != CLIENT_TYPE_CLIENT)) { + if (!cannotUseItems && (pokemonEntityData->shopkeeper == SHOPKEEPER_MODE_NORMAL) && (targetEntityInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)) { cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.joinedAt); if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { error: diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index f7b9c2ba3..8e4a6873c 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -80,7 +80,7 @@ bool8 CheckVariousConditions(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT + if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt) || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) || CheckVariousStatuses2(pokemon, FALSE) diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 84e3eb41a..262cb432c 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -514,8 +514,8 @@ void sub_8086B14(void) Entity * skarmoryEntity; leaderEntity = xxx_call_GetLeader(); - diglettEntity = GetEntityFromClientType(4); - skarmoryEntity = GetEntityFromClientType(3); + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -524,8 +524,8 @@ void sub_8086B14(void) sub_8086A3C(skarmoryEntity); GetEntInfo(diglettEntity)->unk15C = 1; sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 2); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_DIGLETT); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_SKARMORY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_DIGLETT); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_SKARMORY); } void sub_8086B94(void) @@ -535,8 +535,8 @@ void sub_8086B94(void) Entity * skarmoryEntity; leaderEntity = xxx_call_GetLeader(); - diglettEntity = GetEntityFromClientType(4); - skarmoryEntity = GetEntityFromClientType(3); + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); sub_8068FE0(skarmoryEntity,0x21c,0); sub_8068FE0(diglettEntity,0x21c,0); @@ -566,8 +566,8 @@ void SkarmoryPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); // Player partnerEntity = GetPartnerEntity(); // Partner - diglettEntity = GetEntityFromClientType(4); // Diglett - skarmoryEntity = GetEntityFromClientType(3); // Skarmory + diglettEntity = GetEntityFromMonsterBehavior(BEHAVIOR_DIGLETT); // Diglett + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); // Skarmory pos1.x = diglettEntity->pixelPos.x; pos1.y = diglettEntity->pixelPos.y + 0x3000; @@ -621,7 +621,7 @@ void SkarmoryReFightDialogue(void) Position32 pos; leaderEntity = xxx_call_GetLeader(); - skarmoryEntity = GetEntityFromClientType(3); + skarmoryEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SKARMORY); pos.x = skarmoryEntity->pixelPos.x; pos.y = skarmoryEntity->pixelPos.y + 0x2000; sub_8086448(); @@ -668,9 +668,9 @@ void sub_8086E9C(void) sub_80855E4(sub_8086A3C); sub_808563C(sub_8086A3C); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); } void sub_8086F00(void) @@ -682,9 +682,9 @@ void sub_8086F00(void) sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_METAPOD); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GENGAR); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[4], MONSTER_CATERPIE); } // From @jiangzhengwenjz: @@ -704,7 +704,7 @@ void sub_8086F54(u8 param_1, u8 param_2) for(index = 0; index < 0x10; index++) { entity = gDungeon->wildPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType != param_1)) { + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior != param_1)) { return; } } @@ -791,9 +791,9 @@ void sub_8087144(void) Entity *pEStack_58[3]; struct_8085B80 auStack_4c[3]; - iVar2 = GetEntityFromClientType(5); - iVar3 = GetEntityFromClientType(6); - iVar4 = GetEntityFromClientType(7); + iVar2 = GetEntityFromMonsterBehavior(BEHAVIOR_5); + iVar3 = GetEntityFromMonsterBehavior(BEHAVIOR_6); + iVar4 = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); memcpy(auStack_10c,gUnknown_810739C, 0x38); memcpy(puStack_60, gUnknown_81073D4, 0x38); memcpy(puStack_5c, gUnknown_810740C, 0x38); @@ -826,7 +826,7 @@ void sub_8087230(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(0x8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -835,8 +835,8 @@ void sub_8087230(void) SetFacingDirection(zapdosEntity, DIRECTION_SOUTH); sub_8086A3C(zapdosEntity); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); } void sub_808729C(void) @@ -845,7 +845,7 @@ void sub_808729C(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_80854D4(); sub_8085930(4); sub_80855E4(sub_8086A3C); @@ -858,8 +858,8 @@ void sub_808729C(void) sub_8086A3C(zapdosEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SHIFTRY); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ZAPDOS); } void sub_8087334(u8 param_1, u8 param_2) @@ -886,7 +886,7 @@ void ZapdosPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); sub_803E708(10,0x46); SpriteLookAroundEffect(partnerEntity); @@ -959,7 +959,7 @@ void ZapdosReFightDialogue(void) Entity *zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); sub_803E708(10,0x46); DisplayDungeonDialogue(&gZapdosReFightDialogue_1); @@ -984,7 +984,7 @@ void ZapdosPostStoryPreFightDialogue(void) Entity * zapdosEntity; leaderEntity = xxx_call_GetLeader(); - zapdosEntity = GetEntityFromClientType(8); + zapdosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ZAPDOS); sub_8086448(); if (sub_8086AE4(MONSTER_ZAPDOS)) { sub_80866C4(&gZapdosPostStoryPreFightDialogue_6); @@ -1057,7 +1057,7 @@ void sub_80877E8(void) Entity * moltresEntity; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_8085374(); sub_80854D4(); @@ -1066,7 +1066,7 @@ void sub_80877E8(void) SetFacingDirection(moltresEntity, DIRECTION_SOUTH); sub_8086A3C(moltresEntity); sub_8085860(leaderEntity->pos.x + -3,leaderEntity->pos.y + -2); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MOLTRES); } void sub_8087848(void) @@ -1078,7 +1078,7 @@ void sub_8087848(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); DungeonStartNewBGM(MUS_THE_MOUNTAIN_OF_FIRE); sub_80854D4(); sub_8085930(DIRECTION_WEST); @@ -1095,7 +1095,7 @@ void sub_8087848(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos, YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MOLTRES); } void sub_80878F4(u8 param_1, u8 param_2) @@ -1114,7 +1114,7 @@ void MoltresPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(0xc,5); sub_8086500(); sub_803E708(10,0x46); @@ -1184,7 +1184,7 @@ void MoltresReFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(10,5); sub_8086500(); sub_803E708(10,0x46); @@ -1224,7 +1224,7 @@ void MoltresPostStoryPreFightDialogue(void) Entity * moltresEntity; leaderEntity = xxx_call_GetLeader(); - moltresEntity = GetEntityFromClientType(9); + moltresEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MOLTRES); MoltresScreenFlash1(0xc,5); sub_808654C(); if (sub_8086AE4(MONSTER_MOLTRES)) { @@ -1466,7 +1466,7 @@ void sub_8087F54(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); @@ -1475,21 +1475,21 @@ void sub_8087F54(void) SetFacingDirection(articunoEntity, DIRECTION_SOUTH); sub_8086A3C(articunoEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8087FB4(void) { Entity *articunoEntity; - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(articunoEntity, DIRECTION_SOUTH); sub_806CDD4(articunoEntity, 0xF, DIRECTION_SOUTH); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8087FF8(void) @@ -1498,7 +1498,7 @@ void sub_8087FF8(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8085374(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -1512,7 +1512,7 @@ void sub_8087FF8(void) sub_8086A3C(articunoEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ARTICUNO); } void sub_8088088(u8 param_1, u8 param_2) @@ -1531,7 +1531,7 @@ void ArticunoPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8086448(); SpriteLookAroundEffect(partnerEntity); DisplayDungeonDialogue(&gArticunoPreFightDialogue_1); @@ -1607,7 +1607,7 @@ void ArticunoReFightDialogue(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); gDungeon->weather.unkE265 = WEATHER_SNOW; sub_807EAA0(0,1); sub_803E708(10,0x46); @@ -1629,7 +1629,7 @@ void ArticunoPostStoryPreFightDialogue(void) Entity *articunoEntity; leaderEntity = xxx_call_GetLeader(); - articunoEntity = GetEntityFromClientType(0xd); + articunoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ARTICUNO); sub_8086448(); if (sub_8086AE4(MONSTER_ARTICUNO)) { sub_80866C4(&gUnknown_8102A9C); @@ -1755,8 +1755,8 @@ void sub_808862C(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80867F4(); sub_8085374(); @@ -1768,8 +1768,8 @@ void sub_808862C(void) SetFacingDirection(groudonEntity, DIRECTION_SOUTH); sub_8086A3C(groudonEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_80886C4(void) @@ -1782,8 +1782,8 @@ void sub_80886C4(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); PlaySoundEffect(0x3e5); sub_80867F4(); sub_8085374(); @@ -1796,8 +1796,8 @@ void sub_80886C4(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_808875C(void) @@ -1807,8 +1807,8 @@ void sub_808875C(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_80867F4(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -1823,8 +1823,8 @@ void sub_808875C(void) sub_80861D4(groudonEntity,0xf,DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088818(u8 param_1, u8 param_2) @@ -1849,8 +1849,8 @@ void GroudonPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - alakazamEntity = GetEntityFromClientType(10); - groudonEntity = GetEntityFromClientType(0xe); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_1); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086448(); DisplayDungeonDialogue(&GroudonPreFightDialogue_1); sub_803E708(10,0x46); @@ -1928,7 +1928,7 @@ void GroudonReFightDialogue(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xe); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086838(1,1,1); sub_808680C(); sub_803E708(0x3c,0x46); @@ -1960,7 +1960,7 @@ void GroudonPostStoryPreFightDialogue(void) Entity * groudonEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xe); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_2); sub_8086448(); if (sub_8086AE4(MONSTER_GROUDON)) { sub_80866C4(&gUnknown_8103488); @@ -2072,8 +2072,8 @@ void sub_8088DC0(void) Entity * alakazamEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_80867F4(); sub_8086838(0,1,0); sub_8085374(); @@ -2085,8 +2085,8 @@ void sub_8088DC0(void) sub_8086A3C(alakazamEntity); sub_806CDD4(alakazamEntity,0xe,DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088E5C(void) @@ -2096,8 +2096,8 @@ void sub_8088E5C(void) Entity * alakazamEntity; leaderEntity = xxx_call_GetLeader(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_80867F4(); sub_8086838(0,1,0); sub_80854D4(); @@ -2106,8 +2106,8 @@ void sub_8088E5C(void) sub_8068FE0(groudonEntity,0x21c,0); sub_8068FE0(alakazamEntity,0x21c,0); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_ALAKAZAM); } void sub_8088EE8(void) @@ -2127,8 +2127,8 @@ void MagmaCavernMidDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - groudonEntity = GetEntityFromClientType(0xb); - alakazamEntity = GetEntityFromClientType(0xc); + groudonEntity = GetEntityFromMonsterBehavior(BEHAVIOR_GROUDON_1); + alakazamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ALAKAZAM_2); sub_8052D44(IDStack,leaderEntity,partnerEntity); sub_8086448(); SpriteLookAroundEffect(partnerEntity); @@ -2342,7 +2342,7 @@ void sub_80892C8(void) Entity * RayquazaEntity; leaderEntity = xxx_call_GetLeader(); - RayquazaEntity = GetEntityFromClientType(0xf); + RayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_8085374(); sub_80854D4(); @@ -2351,7 +2351,7 @@ void sub_80892C8(void) SetFacingDirection(RayquazaEntity, DIRECTION_SOUTH); sub_8086A3C(RayquazaEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); } void sub_8089328(void) @@ -2360,7 +2360,7 @@ void sub_8089328(void) Entity * rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); DungeonStartNewBGM(MUS_RAYQUAZAS_DOMAIN); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2373,7 +2373,7 @@ void sub_8089328(void) sub_8086A3C(rayquazaEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_RAYQUAZA); } void sub_80893B4(u8 param_1, u8 param_2) @@ -2392,7 +2392,7 @@ void RayquazaPreFightDialogue(void) leaderEntity = xxx_call_GetLeader(); partnerEntity = GetPartnerEntity(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); DisplayDungeonDialogue(&gRayquazaPreFightDialogue_1); RayquazaScreenFlash(); @@ -2431,7 +2431,7 @@ void RayquazaReFightDialogue(void) Entity *rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); RayquazaScreenFlash(); PlaySoundEffect(0x1da); // Rayquaza Cry @@ -2455,7 +2455,7 @@ void RayquazaPostStoryPreFightDialogue(void) Entity *rayquazaEntity; leaderEntity = xxx_call_GetLeader(); - rayquazaEntity = GetEntityFromClientType(0xf); + rayquazaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAYQUAZA); sub_8086448(); if (sub_8086AE4(MONSTER_RAYQUAZA)) { sub_80866C4(&gRayquazaPostStoryPreFightDialogue_6); @@ -2562,7 +2562,7 @@ void sub_8089788(Entity *entity, u8 param_2, u8 param_3) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { monEntity = gDungeon->wildPokemon[index]; - if ((EntityExists(monEntity)) && (monEntity != entity) && (GetEntInfo(monEntity)->clientType == param_2)) { + if ((EntityExists(monEntity)) && (monEntity != entity) && (GetEntInfo(monEntity)->monsterBehavior == param_2)) { return; } } @@ -2651,7 +2651,7 @@ void sub_8089914(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); DungeonStopBGM(); gDungeon->unk7 = 1; sub_80854D4(); @@ -2660,7 +2660,7 @@ void sub_8089914(void) SetFacingDirection(MewtwoEntity, DIRECTION_SOUTH); sub_8086A3C(MewtwoEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); } void sub_8089978(void) @@ -2669,7 +2669,7 @@ void sub_8089978(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2684,7 +2684,7 @@ void sub_8089978(void) sub_8086A3C(MewtwoEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_MEWTWO); } void sub_8089A00(u8 param_1, u8 param_2) @@ -2701,7 +2701,7 @@ void MewtwoPreFightDialogue(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); sub_8086448(); DisplayDungeonDialogue(&gMewtwoPreFightDialogue_1); sub_803E708(10,0x46); @@ -2728,7 +2728,7 @@ void MewtwoReFightDialogue(void) Entity *MewtwoEntity; leaderEntity = xxx_call_GetLeader(); - MewtwoEntity = GetEntityFromClientType(0x11); + MewtwoEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEWTWO); sub_8086448(); if(HasRecruitedMon(MONSTER_MEWTWO)) { sub_80866C4(&gMewtwoReFightDialogue_5); @@ -2803,13 +2803,13 @@ void sub_8089C44(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); } @@ -2819,7 +2819,7 @@ void sub_8089C90(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2830,7 +2830,7 @@ void sub_8089C90(void) SetFacingDirection(EnteiEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_ENTEI); } void sub_8089CFC(u8 param_1, u8 param_2) @@ -2847,7 +2847,7 @@ void EnteiPreFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiPreFightDialogue_1); EnteiScreenFlash(); @@ -2865,7 +2865,7 @@ void EnteiReFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); EnteiScreenFlash(); DisplayDungeonDialogue(&gEnteiReFightDialogue_1); EnteiScreenFlash(); @@ -2883,7 +2883,7 @@ void EnteiPostStoryPreFightDialogue(void) Entity * EnteiEntity; leaderEntity = xxx_call_GetLeader(); - EnteiEntity = GetEntityFromClientType(0x12); + EnteiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_ENTEI); if (HasRecruitedMon(MONSTER_ENTEI)) { sub_80866C4(&gEnteiPostStoryPreFightDialogue_4); } @@ -2932,13 +2932,13 @@ void sub_8089EFC(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } @@ -2948,13 +2948,13 @@ void sub_8089F44(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } @@ -2964,7 +2964,7 @@ void sub_8089F8C(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -2975,7 +2975,7 @@ void sub_8089F8C(void) SetFacingDirection(RaikouEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_RAIKOU); } void sub_8089FF0(u8 param_1, u8 param_2) @@ -2992,7 +2992,7 @@ void RaikouPreFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); DisplayDungeonDialogue(&gRaikouPreFightDialogue_1); RaikouScreenFlash(); DisplayDungeonDialogue(&gRaikouPreFightDialogue_2); @@ -3017,7 +3017,7 @@ void RaikouReFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); gDungeon->weather.unkE265 = WEATHER_RAIN; sub_807EAA0(0,1); RaikouScreenFlash(); @@ -3037,7 +3037,7 @@ void RaikouPostStoryPreFightDialogue(void) Entity * RaikouEntity; leaderEntity = xxx_call_GetLeader(); - RaikouEntity = GetEntityFromClientType(0x13); + RaikouEntity = GetEntityFromMonsterBehavior(BEHAVIOR_RAIKOU); if (HasRecruitedMon(MONSTER_RAIKOU)) { sub_80866C4(&gRaikouPostStoryPreFightDialogue_4); } @@ -3087,7 +3087,7 @@ void sub_808A264(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3095,7 +3095,7 @@ void sub_808A264(void) SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); sub_8086A3C(SuicuneEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A2C0(void) @@ -3104,13 +3104,13 @@ void sub_808A2C0(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A308(void) @@ -3119,7 +3119,7 @@ void sub_808A308(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3130,7 +3130,7 @@ void sub_808A308(void) SetFacingDirection(SuicuneEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SUICUNE); } void sub_808A36C(u8 param_1, u8 param_2) @@ -3147,7 +3147,7 @@ void SuicunePreFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); sub_8086448(); DisplayDungeonDialogue(&gSuicunePreFightDialogue_1); sub_803E708(10,70); @@ -3175,7 +3175,7 @@ void SuicuneReFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); DisplayDungeonDialogue(&gSuicuneReFightDialogue_1); SuicuneScreenFlash(); DisplayDungeonDialogue(&gSuicuneReFightDialogue_2); @@ -3192,7 +3192,7 @@ void SuicunePostStoryPreFightDialogue(void) Entity * SuicuneEntity; leaderEntity = xxx_call_GetLeader(); - SuicuneEntity = GetEntityFromClientType(0x14); + SuicuneEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SUICUNE); if (HasRecruitedMon(MONSTER_SUICUNE)) { sub_80866C4(&gSuicunePostStoryPreFightDialogue_4); } @@ -3262,7 +3262,7 @@ void sub_808A608(void) Entity * HoOhEntity; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); sub_8086838(0,0,0); @@ -3271,7 +3271,7 @@ void sub_808A608(void) SetFacingDirection(HoOhEntity, DIRECTION_SOUTH); sub_8086A3C(HoOhEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y + -6); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); } void sub_808A668(void) @@ -3280,7 +3280,7 @@ void sub_808A668(void) Entity * HoOhEntity; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); DungeonStartNewBGM(MUS_FRIEND_AREA_RAINBOW_PEAK); sub_80867F4(); sub_8086838(0,0,0); @@ -3294,7 +3294,7 @@ void sub_808A668(void) sub_8086A3C(HoOhEntity); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 6); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_HO_OH); } void sub_808A6E8(u8 param_1, u8 param_2) @@ -3317,7 +3317,7 @@ void HoOhPreFightDialogue(void) Position32 local_14; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); local_14.x = leaderEntity->pixelPos.x; local_14.y = leaderEntity->pixelPos.y + -0x1000; ShiftCameraToPosition(&local_14,0x88); @@ -3356,7 +3356,7 @@ void HoOhReFightDialogue(void) Position32 local_14; leaderEntity = xxx_call_GetLeader(); - HoOhEntity = GetEntityFromClientType(0x15); + HoOhEntity = GetEntityFromMonsterBehavior(BEHAVIOR_HO_OH); local_14.x = leaderEntity->pixelPos.x; local_14.y = leaderEntity->pixelPos.y + -0x1000; @@ -3440,14 +3440,14 @@ void sub_808A9E4(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 4); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AA3C(void) @@ -3456,14 +3456,14 @@ void sub_808AA3C(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(LatiosEntity, DIRECTION_NORTH); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AA94(void) @@ -3472,14 +3472,14 @@ void sub_808AA94(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8068FE0(LatiosEntity,0x21c,0); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LATIOS); } void sub_808AAF0(u8 param_1, u8 param_2) @@ -3498,7 +3498,7 @@ void LatiosPreFightDialogue(void) Position local_19; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); local_18.x = LatiosEntity->pixelPos.x; local_18.y = LatiosEntity->pixelPos.y + (0x80 << 6); @@ -3529,7 +3529,7 @@ void LatiosReFightDialogue(void) Entity * LatiosEntity; leaderEntity = xxx_call_GetLeader(); - LatiosEntity = GetEntityFromClientType(0x16); + LatiosEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LATIOS); sub_8086448(); sub_808692C(); DisplayDungeonDialogue(&gLatiosReFightDialogue_1); @@ -3575,7 +3575,7 @@ void sub_808ACC0(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGIROCK)) { - entity = GetEntityFromClientType(0x17); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGIROCK); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3593,7 +3593,7 @@ void sub_808ACC0(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGIROCK); } } @@ -3602,7 +3602,7 @@ void sub_808AD48(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGICE)) { - entity = GetEntityFromClientType(0x18); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGICE); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3620,7 +3620,7 @@ void sub_808AD48(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGICE); } } @@ -3630,7 +3630,7 @@ void sub_808ADCC(void) Entity * entity; if (HasRecruitedMon(MONSTER_REGISTEEL)) { - entity = GetEntityFromClientType(0x19); + entity = GetEntityFromMonsterBehavior(BEHAVIOR_REGISTEEL); sub_8068FE0(entity,0x21c,0); sub_8097FA8(0x22); sub_8097FA8(0x1d); @@ -3648,7 +3648,7 @@ void sub_808ADCC(void) sub_8098044(0x22); sub_8098044(0x1d); sub_80855E4(SetupRegiFacingDirection); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_REGISTEEL); } } @@ -3728,7 +3728,7 @@ void sub_808AFB0(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x2E) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ROCK_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0],GetLeader(),0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); // {POKEMON_0} obtained the Rock Part that Regirock was guarding DisplayDungeonDialogue(&gRegirockPostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3746,7 +3746,7 @@ void sub_808B030(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x2F) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_ICE_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0],GetLeader(),0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],GetLeader(),0); // {POKEMON_0} obtained the Ice Part that Regice was guarding DisplayDungeonDialogue(&gRegicePostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3764,7 +3764,7 @@ void sub_808B0B0(u8 param_1) sub_8052D44(IDStack,leaderEntity,0); if (!sub_8098100(0x22) && (param_1 == 0x30) && (!sub_8098100(0x1d)) && (sub_80860A8(ITEM_STEEL_PART) != 0)) { sub_8097FD0(0x1d); - SetMessageArgument(gFormatBuffer_Monsters[0], GetLeader(), 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0); // {POKEMON_0} obtained the Steel Part that Registeel was guarding DisplayDungeonDialogue(&gRegisteelPostFightDialogue_2); sub_80421C0(0,0xd4); @@ -3870,7 +3870,7 @@ void sub_808B2F4(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); CreateJirachiWishWarpTile(); sub_8049ED4(); @@ -3880,7 +3880,7 @@ void sub_808B2F4(void) SetFacingDirection(jirachiEntity, DIRECTION_SOUTH); sub_8086A3C(jirachiEntity); sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); } void sub_808B35C(void) @@ -3889,7 +3889,7 @@ void sub_808B35C(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); DungeonStartNewBGM(MUS_FRIEND_AREA_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -3905,7 +3905,7 @@ void sub_808B35C(void) } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); } void sub_808B3E4(u8 param_1, u8 param_2, u8 param_3) @@ -3939,7 +3939,7 @@ void JirachiPreFightDialogue(void) Entity * jirachiEntity; leaderEntity = xxx_call_GetLeader(); - jirachiEntity = GetEntityFromClientType(0x1a); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); sub_8086448(); sub_803E708(0x40,70); DisplayDungeonDialogue(&gJirachiPreFightDialogue_1); @@ -3964,8 +3964,8 @@ void sub_808B50C(void) { Entity * jirachiEntity; - jirachiEntity = GetEntityFromClientType(0x1a); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); sub_808BBA8(jirachiEntity); sub_8041888(0); @@ -4005,8 +4005,8 @@ void JirachiWish(void) Position pos2; Position pos3; - jirachiEntity = GetEntityFromClientType(0x1a); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); + jirachiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_JIRACHI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_JIRACHI); sub_80855E4(sub_808BBA8); sub_808BBA8(jirachiEntity); sub_8041888(0); @@ -4117,7 +4117,7 @@ void JirachiWish(void) UnlockFriendArea(friendArea); PlaySoundEffect(0xd4); leaderEntity = GetLeader(); - SetMessageArgument(gFormatBuffer_Monsters[0],leaderEntity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leaderEntity,0); WriteFriendAreaName(gFormatBuffer_Items[0],friendArea,FALSE); // Obtained the friend area! DisplayDungeonDialogue(&gUnknown_8105B68); @@ -4370,7 +4370,7 @@ void sub_808BDEC(void) Entity * lugiaEntity; leaderEntity = xxx_call_GetLeader(); - lugiaEntity = GetEntityFromClientType(0x1b); + lugiaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LUGIA); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4384,7 +4384,7 @@ void sub_808BDEC(void) SetFacingDirection(lugiaEntity, DIRECTION_SOUTH); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_LUGIA); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_LUGIA); } void sub_808BE70(u8 param_1,u8 param_2,u8 param_3) @@ -4401,7 +4401,7 @@ void LugiaPreFightDialogue(void) Entity * lugiaEntity; leaderEntity = xxx_call_GetLeader(); - lugiaEntity = GetEntityFromClientType(0x1b); + lugiaEntity = GetEntityFromMonsterBehavior(BEHAVIOR_LUGIA); if (HasRecruitedMon(MONSTER_LUGIA)) { sub_8086448(); sub_80866C4(&gLugiaPreFightDialogue_8); @@ -4510,7 +4510,7 @@ void sub_808C10C(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - kyogreEntity = GetEntityFromClientType(0x1c); + kyogreEntity = GetEntityFromMonsterBehavior(BEHAVIOR_KYOGRE); DungeonStopBGM(); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4525,8 +4525,8 @@ void sub_808C10C(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos + -0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2],MONSTER_KYOGRE); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[3], MONSTER_GROUDON); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2],MONSTER_KYOGRE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[3], MONSTER_GROUDON); } void sub_808C1A4(u8 param_1,u8 param_2,u8 param_3) @@ -4543,7 +4543,7 @@ void KyogrePreFightDialogue(void) Entity *KyogreEntity; leaderEntity = xxx_call_GetLeader(); - KyogreEntity = GetEntityFromClientType(0x1c); + KyogreEntity = GetEntityFromMonsterBehavior(BEHAVIOR_KYOGRE); DungeonStopBGM(); if (HasRecruitedMon(MONSTER_KYOGRE)) { DungeonFadeInNewBGM(MUS_FRIEND_AREA_CRYPTIC_CAVE,0x3c); @@ -4639,7 +4639,7 @@ void sub_808C3A0(void) sub_808563C(SetupDeoxysFacingDirection); } sub_8085860(leaderEntity->pos.x,leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_DEOXYS_NORMAL); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_DEOXYS_NORMAL); } void sub_808C414(u8 param_1,u8 param_2,u8 param_3) @@ -4733,7 +4733,7 @@ void sub_808C5C0(void) s32 YPos; leaderEntity = xxx_call_GetLeader(); - celebiEntity = GetEntityFromClientType(0x1e); + celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI); DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); sub_80854D4(); sub_8085930(DIRECTION_NORTH); @@ -4742,7 +4742,7 @@ void sub_808C5C0(void) XPos = GetCameraXPos(); YPos = GetCameraYPos(); sub_803F878(XPos,YPos - 0x1000); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_CELEBI); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_CELEBI); } void nullsub_100(u8 r0, u8 r1, u8 r3) @@ -4757,7 +4757,7 @@ void CelebiJoinDialogue(void) Entity *celebiEntity; leaderEntity = xxx_call_GetLeader(); - celebiEntity = GetEntityFromClientType(0x1e); + celebiEntity = GetEntityFromMonsterBehavior(BEHAVIOR_CELEBI); if ((HasRecruitedMon(MONSTER_CELEBI)) || (!sub_806FD18(celebiEntity))) { sub_8068FE0(celebiEntity,0x21c,0); @@ -4937,14 +4937,14 @@ void sub_808C9C4(void) Entity *medichamEntity; leaderEntity = xxx_call_GetLeader(); - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(medichamEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); } void MedichamRescueDialogue(void) @@ -4952,7 +4952,7 @@ void MedichamRescueDialogue(void) Entity *medichamEntity; s32 counter; - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); SpriteLookAroundEffect(medichamEntity); sub_803E708(0xA, 0x46); // Oh my I can't seem to find a way out... @@ -5005,13 +5005,13 @@ void sub_808CB5C(void) Entity *medichamEntity; leaderEntity = xxx_call_GetLeader(); - medichamEntity = GetEntityFromClientType(7); + medichamEntity = GetEntityFromMonsterBehavior(BEHAVIOR_MEDICHAM); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_8068FE0(medichamEntity, 0x21C, 0); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_MEDICHAM); } void DummyFightDialogue(void) @@ -5024,14 +5024,14 @@ void sub_808CBB0(void) Entity *smeargleEntity; leaderEntity = xxx_call_GetLeader(); - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); SetFacingDirection(smeargleEntity, DIRECTION_SOUTH); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); } void SmeargleRescueDialogue(void) @@ -5039,7 +5039,7 @@ void SmeargleRescueDialogue(void) Entity *smeargleEntity; s32 counter; - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); SpriteLookAroundEffect(smeargleEntity); sub_803E708(0xA, 0x46); // Ohhh... @@ -5095,14 +5095,14 @@ void sub_808CD44(void) Entity *smeargleEntity; leaderEntity = xxx_call_GetLeader(); - smeargleEntity = GetEntityFromClientType(0x1F); + smeargleEntity = GetEntityFromMonsterBehavior(BEHAVIOR_SMEARGLE); DungeonStartNewBGM(MUS_IN_THE_DEPTHS_OF_THE_PIT); sub_80854D4(); sub_8085930(DIRECTION_NORTH); sub_80855E4(sub_8086A3C); sub_8068FE0(smeargleEntity, 540, 0); sub_8085860(leaderEntity->pos.x, leaderEntity->pos.y - 3); - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[2], MONSTER_SMEARGLE); } void sub_808CD9C(void) diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 572789b5d..75c8a423b 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -182,7 +182,7 @@ static void sub_8044454(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; TickStatusHeal(entity); @@ -210,7 +210,7 @@ void sub_80444F4(Entity *pokemon) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; RunMonsterAI(entity, 0); diff --git a/src/dungeon_items.c b/src/dungeon_items.c index 35f307da5..6ea1ed6c1 100644 --- a/src/dungeon_items.c +++ b/src/dungeon_items.c @@ -149,7 +149,7 @@ void MusicBoxCreation(void) sub_80416E0(&entity->pixelPos,0x10c,FALSE); sub_80421C0(entity,0xd7); sub_803E708(0x3c,0x41); - SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0); DisplayDungeonMessage(0,*gUnknown_81053A8,1); sub_803E708(10,0x41); PlaySoundEffect(0xd4); diff --git a/src/dungeon_message.c b/src/dungeon_message.c index 3d331311b..6d3672937 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -120,7 +120,7 @@ void sub_805229C(void) return sub_80526D0(0x50); } -void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) +void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str) { if (sub_8045888(pokemon)){ DisplayMessageAddToLog(pokemon, str, TRUE); @@ -624,7 +624,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) { if (EntityExists(leader)) { - SetMessageArgument(gFormatBuffer_Monsters[0], leader, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], leader, 0); ids[0] = GetEntInfo(leader)->apparentID; } else { @@ -633,7 +633,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) } if (EntityExists(partner)) { - SetMessageArgument(gFormatBuffer_Monsters[1], partner, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], partner, 0); ids[1] = GetEntInfo(partner)->apparentID; } else { diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 5a828de6b..8b4a89317 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -552,7 +552,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); s32 targetFlagsAnd = targetFlags & 0xF; if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { - SetMessageArgument(gFormatBuffer_Monsters[1], currTarget, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], currTarget, 0); TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC574); // protected itself! moveHits = FALSE; } @@ -565,7 +565,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move if (moveHits) { if (HasAbility(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { - SetMessageArgument(gFormatBuffer_Monsters[1], currTarget, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], currTarget, 0); TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_8100524); // Soundproof suppressed the sound move! moveHits = FALSE; } @@ -1805,18 +1805,18 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 attackerInfo->abilityEffectFlags = 0; attackerInfo->unk159 = 0; if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC714); // is cringing! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! return FALSE; } else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC718); // is infatuated! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! return FALSE; } else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A8); // is paralyzed! + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! return FALSE; } @@ -1870,7 +1870,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 else { if (!statusMoveMatch) { sub_80928C0(gFormatBuffer_Items[0], currMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80F93C8); // The move can't be used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80F93C8); // The move can't be used! moveUsable = FALSE; } } @@ -1885,7 +1885,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 assistMove.id = sub_8057144(attacker); sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove); } else { @@ -1903,10 +1903,10 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 if (unkBefore == gUnknown_202F208) { if (itemId == 0) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC690); // The currMove failed! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC690); // The currMove failed! } else { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A4); // The Orb failed! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A4); // The Orb failed! } } } @@ -1935,7 +1935,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 assistMove.id = sub_8057144(attacker); movePtr = &assistMove; sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FD2DC); // Assist: + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FD2DC); // Assist: } TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr); } @@ -1966,48 +1966,48 @@ static void TriggerTargetAbilityEffect(Entity *attacker) EntityInfo *entInfo = GetEntInfo(attacker); if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEA4); // Arena Trap prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEC8); // Shadow Tag prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEEEC); // Magnet Pull prevents movement! ImmobilizedStatusTarget(attacker, attacker); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF0C); // Static caused paralysis! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis! ParalyzeStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF30); // Effect Spore scattered spores + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF30); // Effect Spore scattered spores ParalyzeStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF4C); // Poison Point struck! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF4C); // Poison Point struck! PoisonedStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF50); // Effect Spore scattered spores! PoisonedStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF54); // Effect Spore scattered spores! sub_8075C58(attacker, attacker, CalculateStatusTurns(attacker, gUnknown_80F4E74, TRUE), TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF74); // Flame Body caused a burn! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF74); // Flame Body caused a burn! BurnedStatusTarget(attacker, attacker, TRUE, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF98); // Cute Charm caused infatuation InfatuateStatusTarget(attacker, attacker, TRUE); } if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEFD0); // A horrid stench billowed out + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEFD0); // A horrid stench billowed out sub_80428A0(attacker); entInfo->terrifiedTurns = gUnknown_80F5004; } @@ -2096,25 +2096,25 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, } if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) { - SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); - TryDisplayDungeonLoggableMessage(attacker, msg); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC710); // is muzzled! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC710); // is muzzled! return FALSE; } else if (!moveUsable) { SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); if (itemId == 0) { sub_80928C0(gFormatBuffer_Items[0], move, NULL); - TryDisplayDungeonLoggableMessage(attacker, msg); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6D0); // But the move couldn't be used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6D0); // But the move couldn't be used! } else { BufferItemName(gFormatBuffer_Items[0], itemId, NULL); - TryDisplayDungeonLoggableMessage(attacker, msg); + LogMessageByIdWithPopupCheckUser(attacker, msg); sub_803E708(0xA, 0x3F); - TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! + LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6FC); // But Orbs are prevented from being used! } return FALSE; } @@ -2197,7 +2197,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, if (gUnknown_202F21A != 0) { - SendImmobilizeEndMessage(attacker, attacker); + EndFrozenClassStatus(attacker, attacker); SendLinkedEndMessage(attacker, attacker); } @@ -2842,7 +2842,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x30) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { if (dungeonMon == attacker) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); @@ -2880,7 +2880,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x60) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon)) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); } @@ -2908,7 +2908,7 @@ static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_ return targetArrId; if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) return targetArrId; - if (targetInfo->clientType == CLIENT_TYPE_DONT_MOVE || targetInfo->clientType == CLIENT_TYPE_CLIENT) + if (targetInfo->monsterBehavior == BEHAVIOR_DIGLETT || targetInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) return targetArrId; if (canHitAnyone) { @@ -3081,7 +3081,7 @@ u32 sub_8057144(Entity * pokemon) nMoves = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->allPokemon[i]; + Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; if (EntityExists(dungeonMon)) { Move *moves = GetEntInfo(dungeonMon)->moves.moves; for (j = 0; j < MAX_MON_MOVES; j++) diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 0c8b51edb..814c08b5b 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -28,7 +28,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage { if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); } return TRUE; @@ -40,7 +40,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) { if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); } return TRUE; @@ -48,7 +48,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) else { if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); } return TRUE; @@ -252,7 +252,7 @@ bool8 sub_8071A8C(Entity *pokemon) if(EntityExists(pokemon)) { pokemonInfo = GetEntInfo(pokemon); - if(pokemonInfo->clientType != CLIENT_TYPE_CLIENT) + if(pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) { if(!sub_8071A8C_sub(pokemonInfo)) return TRUE; diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 56885cb0b..2999379a1 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -103,7 +103,7 @@ void sub_804513C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - gDungeon->allPokemon[index] = NULL; + gDungeon->activeMonsterPtrs[index] = NULL; } for (index = 0; index < DUNGEON_MAX_ITEMS; index++) @@ -132,7 +132,7 @@ void sub_804522C(void) { { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if(EntityExists(entity)) { if(entity == gDungeon->unk181e8.cameraTarget) diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 423c50056..5398c2c34 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -42,7 +42,7 @@ Entity *GetPartnerEntity(void) return entity; } } - return GetEntityFromClientType(CLIENT_TYPE_PARTNER); + return GetEntityFromMonsterBehavior(BEHAVIOR_ALLY); } void sub_80854D4(void) @@ -150,15 +150,15 @@ void sub_808563C(DungeonCallback func) } } -Entity *GetEntityFromClientType(u8 entityType) +Entity *GetEntityFromMonsterBehavior(u8 entityType) { Entity * entity; s32 index; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == entityType)) return entity; + entity = gDungeon->activeMonsterPtrs[index]; + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == entityType)) return entity; } return NULL; } @@ -204,7 +204,7 @@ void sub_8085764(void) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) { entity = gDungeon->wildPokemon[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER)) { + if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY)) { sub_8068FE0(entity,0x207,&stackEntity); } } @@ -219,7 +219,7 @@ void sub_80857B8(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) { @@ -303,7 +303,7 @@ void sub_8085930(s32 direction) entity = gDungeon->wildPokemon[index]; if(EntityExists(entity)) { - if(GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER) + if(GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY) { if(direction >= NUM_DIRECTIONS) { @@ -341,49 +341,49 @@ void sub_80859F0(s32 direction) } } -bool8 IsMovingClient(Entity *pokemon) +bool8 ShouldRunMonsterAI(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - switch (pokemonInfo->clientType) + switch (pokemonInfo->monsterBehavior) { - case CLIENT_TYPE_CLIENT: - case 0x3: - case 0x5: - case 0x6: - case 0x7: - case 0x8: - case 0x9: - case 0xD: - case 0xE: - case 0xF: - case 0x10: - case 0x11: - case 0x12: - case 0x13: - case 0x14: - case 0x15: - case 0x16: - case 0x17: - case 0x18: - case 0x19: - case 0x1A: - case 0x1B: - case 0x1C: - case 0x1D: - case 0x1E: - case 0x1F: - case 0x20: - case 0x21: - case 0x22: - case 0x23: - case 0x24: + case BEHAVIOR_RESCUE_TARGET: + case BEHAVIOR_SKARMORY: + case BEHAVIOR_5: + case BEHAVIOR_6: + case BEHAVIOR_MEDICHAM: + case BEHAVIOR_ZAPDOS: + case BEHAVIOR_MOLTRES: + case BEHAVIOR_ARTICUNO: + case BEHAVIOR_GROUDON_2: + case BEHAVIOR_RAYQUAZA: + case BEHAVIOR_16: + case BEHAVIOR_MEWTWO: + case BEHAVIOR_ENTEI: + case BEHAVIOR_RAIKOU: + case BEHAVIOR_SUICUNE: + case BEHAVIOR_HO_OH: + case BEHAVIOR_LATIOS: + case BEHAVIOR_REGIROCK: + case BEHAVIOR_REGICE: + case BEHAVIOR_REGISTEEL: + case BEHAVIOR_JIRACHI: + case BEHAVIOR_LUGIA: + case BEHAVIOR_KYOGRE: + case BEHAVIOR_29: + case BEHAVIOR_CELEBI: + case BEHAVIOR_SMEARGLE: + case BEHAVIOR_32: + case BEHAVIOR_33: + case BEHAVIOR_34: + case BEHAVIOR_35: + case BEHAVIOR_36: return TRUE; - case CLIENT_TYPE_NONE: - case CLIENT_TYPE_PARTNER: - case CLIENT_TYPE_DONT_MOVE: - case 0xA: - case 0xB: - case 0xC: + case BEHAVIOR_FIXED_ENEMY: + case BEHAVIOR_ALLY: + case BEHAVIOR_DIGLETT: + case BEHAVIOR_ALAKAZAM_1: + case BEHAVIOR_GROUDON_1: + case BEHAVIOR_ALAKAZAM_2: default: return FALSE; } diff --git a/src/move_actions.c b/src/move_actions.c index f245bb2a0..6d0994dc4 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -451,8 +451,8 @@ bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 para if (targetInfo->HP > targetInfo->maxHPStat) { targetInfo->HP = targetInfo->maxHPStat; } - SetMessageArgument(gFormatBuffer_Monsters[0],attacker,0); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],attacker,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); SetExpMultplier(attackerInfo); // $m0 and $m1 shared their HP @@ -624,7 +624,7 @@ bool8 sub_8057D9C(Entity * pokemon, Entity * target, Move *move, s32 param_4) } } - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (flag) { TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); } @@ -728,7 +728,7 @@ bool8 sub_8057FF4(Entity *pokemon, Entity *target, Move *move, s32 param_4) if (flashFireStatus != FLASH_FIRE_STATUS_NONE) { if (GetEntInfo(target)->unk152 == 0) { GetEntInfo(target)->unk152 = 1; - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger } @@ -780,7 +780,7 @@ bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4 hasGrudge = FALSE; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (entityInfo->grudge) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4); } @@ -1409,7 +1409,7 @@ bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 para iVar4->offensiveMultipliers[index] = iVar3->offensiveMultipliers[index]; iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[index]; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD58); // It psyched itself up! SetExpMultplier(iVar4); return TRUE; @@ -2278,8 +2278,8 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4) r8 = GetEntInfo(target); sp = r8; - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); return FALSE; @@ -2596,8 +2596,8 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ entityInfo = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); @@ -2646,7 +2646,7 @@ void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, Position *pos) SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100, (target->pos.y * 0x18 + 4) * 0x100); stackEntity.spawnGenID = 0; - SetMessageArgument(gFormatBuffer_Items[0],&stackEntity,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Items[0],&stackEntity,0); sub_804652C(pokemon,&stackEntity,item,1,0); } @@ -2774,7 +2774,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para flag = TRUE; } else { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC); } return flag; @@ -2887,7 +2887,7 @@ bool32 sub_805AD54(Entity * pokemon, Entity * target, Move *move, u32 param_4) && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY) { EntityInfo *targetInfo = GetEntInfo(targetEntity); - if (targetInfo->clientType != CLIENT_TYPE_CLIENT && !IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) { + if (targetInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET && !IsClientOrTeamBase(targetInfo->joinedAt.joinedAt)) { sub_807D148(pokemon,targetEntity,2,&target->pos); flag = TRUE; SetExpMultplier(info); diff --git a/src/move_checks.c b/src/move_checks.c index 3089166a5..b6138a831 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -395,7 +395,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) case MOVE_DECOY_MAKER: case MOVE_FOLLOW_ME: case MOVE_SUBSTITUTE: - if (gDungeon->decoyActive) + if (gDungeon->decoyIsActive) { return FALSE; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index 49857bd97..34a43fb88 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -226,7 +226,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage) { if ((!EntityExists(target)) || - ((SetMessageArgument(gFormatBuffer_Monsters[0],target,0), param_3 != 0 && + ((SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0), param_3 != 0 && (HasSafeguardStatus(pokemon,target,displayMessage))))) { return TRUE; } @@ -375,7 +375,7 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) { isAsleep = TRUE; } - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { @@ -440,7 +440,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa entityInfo = GetEntInfo(target); if (!HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasAbility(target,ABILITY_OBLIVIOUS)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); } @@ -731,7 +731,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) return; } - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); entityInfo = GetEntInfo(target); if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { @@ -782,10 +782,10 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 sub_8076CB4(entityInfo->unk9C); } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; @@ -812,10 +812,10 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) sub_8076CB4(entityInfo->unk9C); } else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; @@ -840,7 +840,7 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) { entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; @@ -887,7 +887,7 @@ void WrapTarget(Entity * pokemon, Entity * target) targetEntityInfo->unk9C = *piVar3; *piVar3 +=1; nullsub_69(pokemon, target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8); sub_806CE94(target,8); goto _08076C98; @@ -895,19 +895,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } _08076C98: @@ -922,7 +922,7 @@ void sub_8076CB4(s32 param_1) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if (entityInfo->unk9C == param_1) { @@ -949,7 +949,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) { sub_8076CB4(targetEntityInfo->unk9C); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) { targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED; if (targetEntityInfo->isTeamLeader) { @@ -1003,19 +1003,19 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de return; } if (HasHeldItem(target, ITEM_TWIST_BAND)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); } else { if ((!HasAbility(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } } else { _08076EE4: entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F28(target,index); if (decrement == 1) { strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); @@ -1055,7 +1055,7 @@ void LowerDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 d } if (!param_5 || !sub_8071728(pokemon,target,displayMessage)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F4C(target,index); if (decrement == 1) { strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); @@ -1088,7 +1088,7 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F70(target,index); if (index != STAT_STAGE_ATK) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); @@ -1128,7 +1128,7 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8041F94(target,index); if (index != STAT_STAGE_DEF) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); diff --git a/src/personality_test1.c b/src/personality_test1.c index 499895066..8726a6d4a 100644 --- a/src/personality_test1.c +++ b/src/personality_test1.c @@ -376,7 +376,7 @@ static void PromptNewQuestion(void) static void PrintPersonalityTypeDescription(void) { - CopyMonsterNametoBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); + CopyMonsterNameToBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); } diff --git a/src/pokemon.c b/src/pokemon.c index b807570cd..868926230 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -33,7 +33,7 @@ unkStruct_203B45C *GetRecruitedPokemon(void) void InitializeRecruitedPokemon(void) { s32 index; - + for(index = 0; index < NUM_MONSTERS; index++) { gRecruitedPokemonRef->pokemon[index].unk0 = 0; @@ -51,7 +51,7 @@ void InitializeRecruitedPokemon(void) } } -// https://decomp.me/scratch/wQbZB +// https://decomp.me/scratch/wQbZB NAKED void sub_808CE74(s16 species, bool8 isLeader, u8 *name) @@ -140,7 +140,7 @@ void sub_808CE74(s16 species, bool8 isLeader, u8 *name) "\tadd r4, sp, 0x58\n" "\tadds r0, r4, 0\n" "\tadds r1, r7, 0\n" - "\tbl CopyMonsterNametoBuffer\n" + "\tbl CopyMonsterNameToBuffer\n" "\tadd r0, sp, 0x4C\n" "\tadds r1, r4, 0\n" "\tmovs r2, 0xA\n" @@ -228,7 +228,7 @@ void sub_808CE74(s16 species, bool8 isLeader, u8 *name) "_0808CFCC: .4byte gRecruitedPokemonRef"); } -void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID) +void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, DungeonLocation *location, u16 *moveID) { u8 name_buffer[20]; s32 i; @@ -276,7 +276,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D if (name == NULL) { // HACK register u8 *buffer asm("r0") = name_buffer; - CopyMonsterNametoBuffer(buffer, species); + CopyMonsterNameToBuffer(buffer, species); BoundedCopyStringtoBuffer(pokemon->name, name_buffer, POKEMON_NAME_LENGTH); } else { @@ -353,6 +353,6 @@ void sub_808D144(PokemonStruct1 *pokemon, struct unkStruct_808D144 *r1) for(i = 0; i < POKEMON_NAME_LENGTH; i++) { pokemon->name[i] = r1->name[i]; - } + } } diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index 003357e91..ff52568b0 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -269,7 +269,7 @@ bool8 ComparePokemonNames(s16 a1, s16 a2) return FALSE; } -void CopyMonsterNametoBuffer(u8 * buffer, s16 index) +void CopyMonsterNameToBuffer(u8 * buffer, s16 index) { strncpy(buffer, gMonsterParameters[index].species, 0x14); } @@ -397,7 +397,7 @@ u8 GetRegenSpeed(s16 index) return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24; } -bool8 CanMove(s16 index) +bool8 GetCanMoveFlag(s16 index) { return gMonsterParameters[index].canMove; } diff --git a/src/status.c b/src/status.c index 781895657..920d89ec7 100644 --- a/src/status.c +++ b/src/status.c @@ -213,7 +213,7 @@ void UpdateFlashFireBoost(Entity * pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); if (entityInfo->flashFireBoost != flashFireBoost) { entityInfo->flashFireBoost = flashFireBoost; @@ -243,21 +243,21 @@ void ChangeAttackMultiplierTarget(Entity *pokemon, Entity *target, u32 statStage } if ((HasHeldItem(target,ITEM_TWIST_BAND)) && (param_4 < 0x100)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); return; } if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) { if (displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); } return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->offensiveMultipliers[statStage]; if (param_4 < 0x100) { @@ -308,7 +308,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); oldMulti = entityInfo->defensiveMultipliers[statStage]; if (param_4 < 0x100) { @@ -345,7 +345,7 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8042040(target,statStage); if (statStage != STAT_STAGE_ACCURACY) { strcpy(gFormatBuffer_Items[0],*gUnknown_80FC090); @@ -379,13 +379,13 @@ void LowerAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage, if (HasAbility(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){ if(displayMessage) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64); } } else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); sub_8042060(target,statStage); if (entityInfo->hitChanceStages[statStage] != 0) { entityInfo->hitChanceStages[statStage]--; @@ -407,13 +407,13 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) if (EntityExists(target)) { if (!HasSafeguardStatus(pokemon, target, displayMessage)) { if (HasAbility(target, ABILITY_INNER_FOCUS)){ - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if(displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); } else { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) { entityInfo->volatileStatus.volatileStatus = STATUS_CRINGE; @@ -442,7 +442,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { if (HasAbility(target, ABILITY_LIMBER)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); } @@ -451,7 +451,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag { bVar6 = TRUE; entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; @@ -503,7 +503,7 @@ void RaiseMovementSpeedTarget(Entity * pokemon, Entity * target, s32 turns, bool turns = CalculateStatusTurns(target,gUnknown_80F4E40,FALSE) + 1; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == MAX_SPEED_STAGE) { if (displayMessage) @@ -548,7 +548,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo return; } entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); movSpeed = CalcSpeedStage(target); if (movSpeed == 0) { if (displayMessage) @@ -591,7 +591,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (HasHeldItem(target,ITEM_PERSIM_BAND)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500); @@ -625,7 +625,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; @@ -682,7 +682,7 @@ void HealTargetHP(Entity *pokemon, Entity *target, s32 param_3, s32 param_4, boo EntityUpdateStatusSprites(target); gFormatArgs[0] = HP; gFormatArgs[1] = maxHPStat; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if ((HP == 0) && (maxHPStat == 0)) { if (displayMessage_u8) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged @@ -729,7 +729,7 @@ void HandleScannerOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->scanning = TRUE; nullsub_75(target); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident sub_803F580(0); sub_8040A84(); @@ -754,7 +754,7 @@ void HandleStairsOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->stairSpotter = TRUE; nullsub_76(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); sub_803F580(0); sub_8040A84(); @@ -774,7 +774,7 @@ void HandleRadarOrb(Entity* pokemon, Entity* target) { GetEntInfo(target)->powerEars = TRUE; nullsub_77(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); sub_803F580(0); sub_8040A84(); @@ -800,7 +800,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) if (HasSafeguardStatus(pokemon,target,displayMessage)) { return; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (MonsterIsType(target, TYPE_GRASS)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage); @@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (pokemon == gDungeon->allPokemon[index]) { + if (pokemon == gDungeon->activeMonsterPtrs[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(pokemon); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -847,7 +847,7 @@ void sub_8078084(Entity * pokemon) entityInfo = GetEntInfo(pokemon); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - target = gDungeon->allPokemon[index]; + target = gDungeon->activeMonsterPtrs[index]; if (EntityExists(target)) { entityInfo2 = GetEntInfo(target); if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) @@ -873,7 +873,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && (GetEntityType(target) == ENTITY_MONSTER)) { entityInfo = GetEntInfo(pokemon); - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); linkedStatus = &entityInfo->linked.linkedStatus; if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) { @@ -893,7 +893,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (target == gDungeon->allPokemon[index]) { + if (target == gDungeon->activeMonsterPtrs[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(target); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -910,7 +910,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; entityInfo->moveStatus.moveStatusTurns = turns + 1; @@ -930,7 +930,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; entityInfo->moveStatus.moveStatusTurns = turns + 1; @@ -950,7 +950,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; @@ -970,7 +970,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; @@ -995,14 +995,14 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { targetEntityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((((EntityExists(entity)) && (target != entity)) && (u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) { SendWaitingEndMessage(pokemon,entity,STATUS_NONE); @@ -1010,22 +1010,22 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) } } sub_8041D38(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) { SendWaitingEndMessage(pokemon,target, STATUS_DECOY); } targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY; - targetEntityInfo->waitingStruct.enemyDecoy = GetEntInfo(pokemon)->isNotTeamMember; + targetEntityInfo->waitingStruct.decoyApplierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; targetEntityInfo->waitingStruct.unkCA = param_3; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); - gDungeon->decoyActive = TRUE; + gDungeon->decoyIsActive = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity2 = gDungeon->allPokemon[index]; + entity2 = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity2)) { entityInfo = GetEntInfo(entity2); entityInfo->aiTarget.aiObjective = AI_STAND_STILL; @@ -1033,7 +1033,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) entityInfo->aiTarget.aiTargetSpawnGenID = 0; if (!entityInfo->isTeamLeader) { action = entityInfo->action; - MoveIfPossible(entity2, TRUE); + AIMovement(entity2, TRUE); entityInfo->action = action; } } @@ -1070,7 +1070,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; targetEntityInfo->waitingStruct.curseDamageCountdown = 0; } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); } else { @@ -1094,7 +1094,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { SendWaitingEndMessage(pokemon, entity, STATUS_NONE); } @@ -1110,7 +1110,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) gDungeon->snatchPokemon = target; gDungeon->unk17B3C = targetEntityInfo->unk98; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C); EntityUpdateStatusSprites(target); } @@ -1122,7 +1122,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; @@ -1142,7 +1142,7 @@ void HandleStockpile(Entity * pokemon, Entity * target) if ((EntityExists(target))) { entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) { entityInfo->stockpileStage++; sub_804178C(1); @@ -1166,7 +1166,7 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) { targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE; targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; @@ -1187,7 +1187,7 @@ void PerishSongTarget(Entity * pokemon, Entity * target) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { nullsub_82(target); entityInfo = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->perishSongTurns == 0) { entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB04); @@ -1213,11 +1213,11 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) if ((EntityInfo->moves.moves[index].moveFlags & MOVE_FLAG_EXISTS) && (movePtr->moveFlags & MOVE_FLAG_LAST_USED)) break; } if ((index == MAX_MON_MOVES) && ((EntityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBD4); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) { EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; @@ -1247,7 +1247,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) bellyBefore = targetInfo->maxBelly; targetInfo->maxBelly = FixedPoint_Subtract(bellyBefore, sp0); targetInfo->belly = FixedPoint_Min(targetInfo->belly, targetInfo->maxBelly); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->maxBelly)) { sub_8041D9C(target); @@ -1261,7 +1261,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4) bellyBefore = targetInfo->belly; targetInfo->belly = FixedPoint_Subtract(bellyBefore, sp8); - SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) { nullsub_84(target); @@ -1323,12 +1323,12 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full! } if (FixedPointToInt(sp_0x20) == FixedPointToInt(targetInfo->maxBelly)) { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDF0); // $m0's belly won't get any bigger! } else { sub_8041DB0(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDC4); // m0's max belly size increased! } } @@ -1345,7 +1345,7 @@ void sub_8078B5C(Entity *pokemon, Entity *target, u32 bellyIncrement, s32 maxBel *bellyPtr = *puVar8; } nullsub_85(target); - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change! } diff --git a/src/status_actions.c b/src/status_actions.c index 03f4418f8..b43d8805f 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -226,7 +226,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target) entityInfo->types[0] = newType; entityInfo->types[1] = TYPE_NONE; entityInfo->isColorChanged = TRUE; - SetMessageArgument(gFormatBuffer_Monsters[1],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); typeString = GetUnformattedTypeString(newType); strcpy(gFormatBuffer_Items[0], typeString); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB08); @@ -439,7 +439,7 @@ bool8 MimicMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4 } } } - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (moveCounter != 0) { SetExpMultplier(entityInfo); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4); @@ -697,8 +697,8 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4) iVar3 = GetEntInfo(pokemon); iVar5 = GetEntInfo(target); iVar6 = GetEntInfo(target); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); - SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); if (HasAbility(target, ABILITY_STICKY_HOLD)) { return TRUE; } @@ -858,8 +858,8 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ entityInfo = GetEntInfo(target); targetID = entityInfo->id; oldID = entityInfo->id; - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->clientType != CLIENT_TYPE_NONE) { + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); + if (entityInfo->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); return FALSE; } @@ -883,7 +883,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_ } } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); } return didTransfer; @@ -921,7 +921,7 @@ bool8 sub_805BEC8(Entity * pokemon, Entity * target, Move *move, s32 param_4) bool8 EscapeOrbAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { - SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); if (gDungeon->unk66E != 0) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! } @@ -952,7 +952,7 @@ bool8 TrapbustOrbAction(Entity * pokemon,Entity * target, Move *move, s32 param_ bool8 foundTrap = FALSE; tile = GetTileAtEntitySafe(target); if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD1EC); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD1EC); return FALSE; } else @@ -1105,7 +1105,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4) filledInTile = FALSE; targetInfo = GetEntInfo(target); if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD0B8); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD0B8); return FALSE; } else @@ -1156,7 +1156,7 @@ bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4) Item stack; Position posStruct = target->pos; - if(GetEntInfo(target)->clientType != CLIENT_TYPE_NONE) + if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY) { TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); return FALSE; diff --git a/src/status_checks.c b/src/status_checks.c index e7643e2f6..43b6893b7 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -24,10 +24,10 @@ extern const char *gPtrInfatuatedMessage[]; extern u8 *gUnknown_80F95EC[]; extern char *gPtrMoveInterruptedMessage[]; -bool8 HasStatusAffectingActions(Entity *pokemon) +bool8 HasStatusThatPreventsActing(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); switch (pokemonInfo->sleep.sleep) { @@ -39,13 +39,13 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrFrozenMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedAroundMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedByMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -53,15 +53,15 @@ bool8 HasStatusAffectingActions(Entity *pokemon) switch (pokemonInfo->volatileStatus.volatileStatus) { case STATUS_PAUSED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrPausedMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - TryDisplayDungeonLoggableMessage(pokemon, *gPtrInfatuatedMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrInfatuatedMessage); return TRUE; } if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - TryDisplayDungeonLoggableMessage(pokemon, *gPtrBideMessage); + LogMessageByIdWithPopupCheckUser(pokemon, *gPtrBideMessage); return TRUE; } if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) @@ -93,7 +93,7 @@ bool8 HasStatusAffectingActions(Entity *pokemon) SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); return TRUE; } - DecideAttack(pokemon); + ChooseAIMove(pokemon); return TRUE; } if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) @@ -117,27 +117,27 @@ bool8 sub_80701A4(Entity *pokemon) pokemonInfo = GetEntInfo(pokemon); flag = FALSE; - SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); switch(pokemonInfo->sleep.sleep) { case STATUS_SLEEP: case STATUS_NIGHTMARE: case STATUS_NAPPING: - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F95EC); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F95EC); return TRUE; } switch(pokemonInfo->immobilize.immobilizeStatus) { case STATUS_FROZEN: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrFrozenMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrFrozenMessage); return TRUE; case STATUS_WRAP: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedAroundMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedAroundMessage); return TRUE; case STATUS_WRAPPED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedByMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedByMessage); return TRUE; case STATUS_PETRIFIED: return TRUE; @@ -148,10 +148,10 @@ bool8 sub_80701A4(Entity *pokemon) flag = TRUE; goto _0807026C; case STATUS_PAUSED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrPausedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrPausedMessage); return TRUE; case STATUS_INFATUATED: - TryDisplayDungeonLoggableMessage(pokemon,*gPtrInfatuatedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrInfatuatedMessage); return TRUE; default: case STATUS_NONE: @@ -159,12 +159,12 @@ bool8 sub_80701A4(Entity *pokemon) case 8: _0807026C: if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { - TryDisplayDungeonLoggableMessage(pokemon,*gPtrBideMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrBideMessage); return TRUE; } else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { if (flag) { - TryDisplayDungeonLoggableMessage(pokemon,*gPtrMoveInterruptedMessage); + LogMessageByIdWithPopupCheckUser(pokemon,*gPtrMoveInterruptedMessage); } else { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { diff --git a/src/status_checks_1.c b/src/status_checks_1.c index 7cfe3022a..89efecdce 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -44,7 +44,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage) } if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { sub_80429B4(pokemon); - TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FEE80); + LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FEE80); } if (flag) { return 2; @@ -72,7 +72,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) else { if (param_2->isNotTeamMember) { - if ((param_2->joinedAt.joinedAt == 0x4A) || (param_2->clientType == CLIENT_TYPE_CLIENT)) { + if ((param_2->joinedAt.joinedAt == 0x4A) || (param_2->monsterBehavior == BEHAVIOR_RESCUE_TARGET)) { CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID); } else @@ -116,7 +116,7 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) else { if (entityInfo->isNotTeamMember) { - CopyMonsterNametoBuffer(buffer, entityInfo->apparentID); + CopyMonsterNameToBuffer(buffer, entityInfo->apparentID); } else { diff --git a/src/tile_types.c b/src/tile_types.c index a0277f8fd..a4ff0bd23 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -94,7 +94,7 @@ bool8 PosHasItem(Position *pos) { struct Tile *tile; Entity *entity; - + tile = GetTile(pos->x,pos->y); entity = tile->object; if ((entity != NULL) && (GetEntityType(entity) == ENTITY_ITEM)) { @@ -107,7 +107,7 @@ Entity *GetMonsterAtPos(Position *pos) { struct Tile *tile; Entity *entity; - + tile = GetTile(pos->x,pos->y); entity = tile->monster; if ((entity != NULL) && (entity->type == ENTITY_MONSTER)) { @@ -124,7 +124,7 @@ bool8 sub_804AD34(Position *pos) s32 y; bool8 iVar8; s32 index; - + iVar8 = 0; tile = GetTileSafe(pos->x,pos->y); if (!(tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY))) @@ -145,7 +145,7 @@ bool8 sub_804AD34(Position *pos) if (iVar8 != 0) { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { sub_806CF98(entity); } @@ -162,7 +162,7 @@ bool8 sub_804AE08(Position *pos) s32 x; s32 y; bool8 uVar6; - + uVar6 = FALSE; tile = GetTileSafe(pos->x,pos->y); @@ -190,7 +190,7 @@ void sub_804AE84(Position *pos) Entity * entity; s32 index; s32 y; - + tile = GetTileSafe(pos->x,pos->y); if ((tile->unk4 & 0x10) != 0) { tile->unk4 = tile->unk4 & 0xffef; @@ -206,7 +206,7 @@ void sub_804AE84(Position *pos) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->allPokemon[index]; + entity = gDungeon->activeMonsterPtrs[index]; if (EntityExists(entity)) { sub_806CF98(entity); } diff --git a/src/trap.c b/src/trap.c index 54f96b19e..897b9714d 100644 --- a/src/trap.c +++ b/src/trap.c @@ -280,10 +280,10 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4) sub_8049ED4(); sub_804225C(pokemon,pos,trapData->id); if (gDungeon->unk181e8.blinded) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD7F4); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD7F4); } else { - TryDisplayDungeonLoggableMessage(pokemon,(gUnknown_80FD7F8)[trapData->id]); + LogMessageByIdWithPopupCheckUser(pokemon,(gUnknown_80FD7F8)[trapData->id]); } } if (target != NULL) { @@ -539,7 +539,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) flag = FALSE; if (target != NULL) { if (IsBossFight()) { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED0C); // But nothing happened... + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED0C); // But nothing happened... } else { @@ -559,11 +559,11 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile) gDungeon->unk2 = 2; return; } - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F9728); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F9728); } else { - SetMessageArgument(gFormatBuffer_Monsters[0],target,0); + SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (info->isNotTeamMember) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! } @@ -620,11 +620,11 @@ void HandleSummonTrap(Entity *pokemon,Position *pos) sub_80421EC(pos,0x194); if (pokemonSummonCount == 0) { _ret: - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED04); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED04); } else { - TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED00); + LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED00); } } } diff --git a/src/trap_1.c b/src/trap_1.c index 4f0357931..1d0fb49d4 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -238,7 +238,7 @@ void sub_8080CF0(unkStruct_8094924 *param_1) sub_80830B4(param_1,gDungeon->plusIsActive[1]); sub_80830B4(param_1,gDungeon->minusIsActive[0]); sub_80830B4(param_1,gDungeon->minusIsActive[1]); - sub_80830B4(param_1,gDungeon->decoyActive); + sub_80830B4(param_1,gDungeon->decoyIsActive); sub_80830B4(param_1,gDungeon->unk37FD); sub_80830B4(param_1,gDungeon->deoxysDefeat); sub_80830B4(param_1,gDungeon->unk37FF); @@ -391,7 +391,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) puStack_2c = &info->perishSongTurns; puStack_28 = &info->unkFE; puStack_24 = &info->unkFF; - puStack_90 = &info->clientType; + puStack_90 = &info->monsterBehavior; pos = info->prevPos; for(counter = 0; counter < NUM_PREV_POS; counter++) @@ -435,7 +435,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083060(param_1,*puStack_2c); sub_8083060(param_1,*puStack_28); sub_808183C(param_1,*puStack_24); - sub_8081854(param_1,info->targetingDecoy); + sub_8081854(param_1,info->decoyAITracker); SaveSpeedStage(param_1,info->speedStage); SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); SaveSpeedCounters(param_1,info->speedDownCounters,NUM_SPEED_COUNTERS); @@ -445,7 +445,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) SaveEntityMoves(param_1,&info->moves); sub_8081B34(param_1,(s16 *)&info->belly); sub_8081B34(param_1,(s16 *)&info->maxBelly); - sub_80830B4(param_1,info->aiNextToTarget); + sub_80830B4(param_1,info->aiAllySkip); sub_80830B4(param_1,info->recalculateFollow); sub_80830B4(param_1,info->waiting); sub_80830B4(param_1,info->unk146); @@ -690,7 +690,7 @@ void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2) void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2) { sub_8082FA8(param_1, ¶m_2->waitingStatus, 1); - sub_80830B4(param_1, param_2->enemyDecoy); + sub_80830B4(param_1, param_2->decoyApplierNonTeamMemberFlag); sub_80830B4(param_1, param_2->unkCA); sub_8083060(param_1, param_2->waitingStatusTurns); sub_8083060(param_1, param_2->curseDamageCountdown); @@ -984,7 +984,7 @@ void sub_808217C(unkStruct_8094924 *param_1) gDungeon->plusIsActive[1] = sub_80831DC(param_1); gDungeon->minusIsActive[0] = sub_80831DC(param_1); gDungeon->minusIsActive[1] = sub_80831DC(param_1); - gDungeon->decoyActive = sub_80831DC(param_1); + gDungeon->decoyIsActive = sub_80831DC(param_1); gDungeon->unk37FD = sub_80831DC(param_1); gDungeon->deoxysDefeat = sub_80831DC(param_1); gDungeon->unk37FF = sub_80831DC(param_1); From 583b4df5449de92411383df9db3392a8aec7bb73 Mon Sep 17 00:00:00 2001 From: AnonymousRandomPerson Date: Fri, 15 Nov 2024 21:36:36 -0500 Subject: [PATCH 2/2] Rename statuses and activePokemon --- asm/code_8040094.s | 2 +- asm/code_8069E0C.s | 16 +-- data/data_80F59C8.s | 48 +++---- include/charge_move.h | 2 +- include/code_8077274_1.h | 12 +- include/constants/status.h | 24 ++-- include/move_effects_target.h | 2 +- include/structs/dungeon_entity.h | 140 +++++++++---------- include/structs/str_dungeon.h | 2 +- src/code_803E724.c | 6 +- src/code_8041AD0.c | 52 +++---- src/code_804267C.c | 2 +- src/code_8045A00.c | 6 +- src/code_8048480.c | 16 +-- src/code_805D8C8.c | 2 +- src/code_805D8C8_1.c | 52 +++---- src/code_8069E0C.c | 8 +- src/code_806CD90.c | 80 +++++------ src/code_806E8B0.c | 8 +- src/code_8073CF0.c | 172 +++++++++++------------ src/code_8075708.c | 4 +- src/code_8077274_1.c | 232 +++++++++++++++---------------- src/code_8083288.c | 92 ++++++------ src/dungeon_action.c | 4 +- src/dungeon_ai.c | 14 +- src/dungeon_ai_attack.c | 34 ++--- src/dungeon_ai_item_weight.c | 24 ++-- src/dungeon_ai_items.c | 8 +- src/dungeon_ai_leader.c | 14 +- src/dungeon_ai_movement.c | 6 +- src/dungeon_ai_targeting.c | 20 +-- src/dungeon_capabilities.c | 70 +++++----- src/dungeon_engine.c | 4 +- src/dungeon_move.c | 90 ++++++------ src/dungeon_movement.c | 12 +- src/dungeon_pokemon_attributes.c | 8 +- src/dungeon_util.c | 4 +- src/dungeon_util_1.c | 4 +- src/dungeon_visibility.c | 12 +- src/move_actions.c | 40 +++--- src/move_checks.c | 86 ++++++------ src/move_effects_target.c | 202 +++++++++++++-------------- src/status.c | 154 ++++++++++---------- src/status_actions.c | 4 +- src/status_checks.c | 28 ++-- src/status_checks_1.c | 40 +++--- src/tile_types.c | 4 +- src/trap_1.c | 180 ++++++++++++------------ src/type_effectiveness.c | 4 +- 49 files changed, 1025 insertions(+), 1025 deletions(-) diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 8a8f947bc..daab66dfd 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -2501,7 +2501,7 @@ _080414A0: _080414A4: adds r0, r4, 0 adds r1, r5, 0 - bl MoveMatchesChargingStatus + bl MoveMatchesBideClassStatus adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 diff --git a/asm/code_8069E0C.s b/asm/code_8069E0C.s index 0f955d488..7aa4695da 100644 --- a/asm/code_8069E0C.s +++ b/asm/code_8069E0C.s @@ -346,7 +346,7 @@ _0806A650: bne _0806A6D2 adds r0, r6, 0 adds r1, r6, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus b _0806A6D2 _0806A664: cmp r1, 0 @@ -1072,7 +1072,7 @@ sub_806ABAC: bne _0806ABD4 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806ABD4: adds r0, r4, 0 movs r1, 0x40 @@ -1087,7 +1087,7 @@ _0806ABD4: bne _0806ABF4 adds r0, r6, 0 adds r1, r4, 0 - bl SendVolatileEndMessage + bl EndCringeClassStatus _0806ABF4: adds r0, r4, 0 movs r1, 0x42 @@ -1102,7 +1102,7 @@ _0806ABF4: bne _0806AC14 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806AC14: adds r0, r4, 0 movs r1, 0x29 @@ -1117,7 +1117,7 @@ _0806AC14: bne _0806AC34 adds r0, r6, 0 adds r1, r4, 0 - bl SendVolatileEndMessage + bl EndCringeClassStatus _0806AC34: adds r0, r4, 0 movs r1, 0x36 @@ -1147,7 +1147,7 @@ _0806AC66: adds r1, r4, 0 movs r2, 0 movs r3, 0x1 - bl SendSleepEndMessage + bl EndSleepClassStatus _0806AC72: adds r0, r4, 0 movs r1, 0x41 @@ -1180,7 +1180,7 @@ _0806AC92: bhi _0806ACB8 adds r0, r6, 0 adds r1, r4, 0 - bl SendNonVolatileEndMessage + bl EndBurnClassStatus _0806ACB8: adds r0, r4, 0 movs r1, 0x25 @@ -1199,7 +1199,7 @@ _0806ACB8: bne _0806ACE0 adds r0, r6, 0 adds r1, r4, 0 - bl SendProtectionEndMessage + bl EndReflectClassStatus _0806ACE0: pop {r4-r6} pop {r0} diff --git a/data/data_80F59C8.s b/data/data_80F59C8.s index 99c6433b4..3d35898d4 100644 --- a/data/data_80F59C8.s +++ b/data/data_80F59C8.s @@ -308,8 +308,8 @@ gUnknown_80F6624: @ 80F6624 .byte 0xb9, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xba, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 .byte 0xbb, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00 -.global gStatusSpriteMasks_SleepStatus -gStatusSpriteMasks_SleepStatus: @ 80F669C +.global gStatusSpriteMasks_SleepClassStatus +gStatusSpriteMasks_SleepClassStatus: @ 80F669C .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SLEEP @ STATUS_SLEEP .4byte STATUS_SPRITE_SLEEPLESS @ STATUS_SLEEPLESS @@ -317,16 +317,16 @@ gStatusSpriteMasks_SleepStatus: @ 80F669C .4byte 0 @ STATUS_YAWNING .4byte STATUS_SPRITE_SLEEP @ STATUS_NAPPING -.global gStatusSpriteMasks_NonVolatileStatus -gStatusSpriteMasks_NonVolatileStatus: @ 80F66B4 +.global gStatusSpriteMasks_BurnClassStatus +gStatusSpriteMasks_BurnClassStatus: @ 80F66B4 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_BURNED @ STATUS_BURN .4byte STATUS_SPRITE_POISONED @ STATUS_POISONED .4byte STATUS_SPRITE_BADLY_POISONED @ STATUS_BADLY_POISONED .4byte 0 @ STATUS_PARALYSIS -.global gStatusSpriteMasks_ImmobilizeStatus -gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8 +.global gStatusSpriteMasks_FrozenClassStatus +gStatusSpriteMasks_FrozenClassStatus: @ 80F66C8 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_FROZEN @ STATUS_FROZEN .4byte 0 @ STATUS_SHADOW_HOLD @@ -336,8 +336,8 @@ gStatusSpriteMasks_ImmobilizeStatus: @ 80F66C8 .4byte 0 @ STATUS_PETRIFIED .4byte 0 @ STATUS_CONSTRICTION -.global gStatusSpriteMasks_VolatileStatus -gStatusSpriteMasks_VolatileStatus: @ 80F66E8 +.global gStatusSpriteMasks_CringeClassStatus +gStatusSpriteMasks_CringeClassStatus: @ 80F66E8 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_CRINGE .4byte STATUS_SPRITE_CONFUSED @ STATUS_CONFUSED @@ -347,8 +347,8 @@ gStatusSpriteMasks_VolatileStatus: @ 80F66E8 .4byte STATUS_SPRITE_ENCORE @ STATUS_ENCORE .4byte 0 @ STATUS_INFATUATED -.global gStatusSpriteMasks_ChargingStatus -gStatusSpriteMasks_ChargingStatus: @ 80F6708 +.global gStatusSpriteMasks_BideClassStatus +gStatusSpriteMasks_BideClassStatus: @ 80F6708 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_BIDE .4byte 0 @ STATUS_SOLARBEAM @@ -363,8 +363,8 @@ gStatusSpriteMasks_ChargingStatus: @ 80F6708 .4byte 0 @ STATUS_CHARGING .4byte 0 @ STATUS_ENRAGED -.global gStatusSpriteMasks_ProtectionStatus -gStatusSpriteMasks_ProtectionStatus: @ 80F673C +.global gStatusSpriteMasks_ReflectClassStatus +gStatusSpriteMasks_ReflectClassStatus: @ 80F673C .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_REFLECT .4byte STATUS_SPRITE_SHIELD_RED @ STATUS_SAFEGUARD @@ -381,42 +381,42 @@ gStatusSpriteMasks_ProtectionStatus: @ 80F673C .4byte STATUS_SPRITE_SHIELD_GREEN @ STATUS_VITAL_THROW .4byte STATUS_SPRITE_SHIELD_BLUE @ STATUS_MIST -.global gStatusSpriteMasks_WaitingStatus -gStatusSpriteMasks_WaitingStatus: @ 80F6778 +.global gStatusSpriteMasks_CurseClassStatus +gStatusSpriteMasks_CurseClassStatus: @ 80F6778 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_CURSED @ STATUS_CURSED .4byte 0 @ STATUS_DECOY .4byte STATUS_SPRITE_SNATCH @ STATUS_SNATCH -.global gStatusSpriteMasks_LinkedStatus -gStatusSpriteMasks_LinkedStatus: @ 80F6788 +.global gStatusSpriteMasks_LeechSeedClassStatus +gStatusSpriteMasks_LeechSeedClassStatus: @ 80F6788 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_LEECH_SEED .4byte 0 @ STATUS_DESTINY_BOND -.global gStatusSpriteMasks_MoveStatus -gStatusSpriteMasks_MoveStatus: @ 80F6794 +.global gStatusSpriteMasks_SureShotClassStatus +gStatusSpriteMasks_SureShotClassStatus: @ 80F6794 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_SURE_SHOT @ STATUS_SURE_SHOT .4byte STATUS_SPRITE_WHIFFER @ STATUS_WHIFFER .4byte STATUS_SPRITE_SET_DAMAGE @ STATUS_SET_DAMAGE .4byte STATUS_SPRITE_FOCUS_ENERGY @ STATUS_FOCUS_ENERGY -.global gStatusSpriteMasks_ItemStatus -gStatusSpriteMasks_ItemStatus: @ 80F67A8 +.global gStatusSpriteMasks_LongTossClassStatus +gStatusSpriteMasks_LongTossClassStatus: @ 80F67A8 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_LONG_TOSS .4byte 0 @ STATUS_PIERCE -.global gStatusSpriteMasks_TransformStatus -gStatusSpriteMasks_TransformStatus: @ 80F67B4 +.global gStatusSpriteMasks_InvisibleClassStatus +gStatusSpriteMasks_InvisibleClassStatus: @ 80F67B4 .4byte 0 @ STATUS_NONE .4byte 0 @ STATUS_INVISIBLE .4byte 0 @ STATUS_TRANSFORMED .4byte 0 @ STATUS_MOBILE -.global gStatusSpriteMasks_EyesightStatus -gStatusSpriteMasks_EyesightStatus: @ 80F67C4 +.global gStatusSpriteMasks_BlinkerClassStatus +gStatusSpriteMasks_BlinkerClassStatus: @ 80F67C4 .4byte 0 @ STATUS_NONE .4byte STATUS_SPRITE_BLINKER @ STATUS_BLINKER .4byte STATUS_SPRITE_CROSS_EYED @ STATUS_CROSS_EYED diff --git a/include/charge_move.h b/include/charge_move.h index 0fd75d5db..56c9bb8e0 100644 --- a/include/charge_move.h +++ b/include/charge_move.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move); +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move); // checkCharge = Check for the move named Charge. bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge); diff --git a/include/code_8077274_1.h b/include/code_8077274_1.h index cc9712be4..92c1882ac 100644 --- a/include/code_8077274_1.h +++ b/include/code_8077274_1.h @@ -35,13 +35,13 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target); void VitalThrowStatusTarget(Entity * pokemon, Entity * target); void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4); void sub_807A0CC(Entity * pokemon, Entity * target); -void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); -void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); +void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); +void EndBurnClassStatus(Entity * pokemon, Entity * target); void EndFrozenClassStatus(Entity * pokemon, Entity *target); -void SendVolatileEndMessage(Entity * pokemon, Entity *target); -void SendProtectionEndMessage(Entity * pokemon, Entity *target); -void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); -void SendLinkedEndMessage(Entity * pokemon, Entity * target); +void EndCringeClassStatus(Entity * pokemon, Entity *target); +void EndReflectClassStatus(Entity * pokemon, Entity *target); +void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus); +void EndLeechSeedClassStatus(Entity * pokemon, Entity * target); void SendMoveEndMessage(Entity * pokemon, Entity * target); void SendTransformEndMessage(Entity * pokemon, Entity *target); void SendEyesightEndMessage(Entity * pokemon,Entity * target); diff --git a/include/constants/status.h b/include/constants/status.h index 8fb8b3b7a..32ab62db7 100644 --- a/include/constants/status.h +++ b/include/constants/status.h @@ -1,7 +1,7 @@ #ifndef GUARD_CONSTANTS_STATUS_H #define GUARD_CONSTANTS_STATUS_H -// Sleep statuses +// Sleep class statuses #define STATUS_NONE 0 #define STATUS_SLEEP 1 #define STATUS_SLEEPLESS 2 @@ -9,13 +9,13 @@ #define STATUS_YAWNING 4 #define STATUS_NAPPING 5 -// Non-volatile statuses +// Burn class statuses #define STATUS_BURN 1 #define STATUS_POISONED 2 #define STATUS_BADLY_POISONED 3 #define STATUS_PARALYSIS 4 -// Immobilize statuses +// Frozen class statuses #define STATUS_FROZEN 1 #define STATUS_SHADOW_HOLD 2 #define STATUS_WRAP 3 @@ -24,7 +24,7 @@ #define STATUS_PETRIFIED 6 #define STATUS_CONSTRICTION 7 -// Volatile statuses +// Cringe class statuses #define STATUS_CRINGE 1 #define STATUS_CONFUSED 2 #define STATUS_PAUSED 3 @@ -33,7 +33,7 @@ #define STATUS_ENCORE 6 #define STATUS_INFATUATED 7 -// Charging statuses +// Bide class statuses #define STATUS_BIDE 1 #define STATUS_SOLARBEAM 2 #define STATUS_SKY_ATTACK 3 @@ -47,7 +47,7 @@ #define STATUS_CHARGING 11 #define STATUS_ENRAGED 12 -// Protection statuses +// ReflectClassStatus statuses #define STATUS_REFLECT 1 #define STATUS_SAFEGUARD 2 #define STATUS_LIGHT_SCREEN 3 @@ -63,31 +63,31 @@ #define STATUS_VITAL_THROW 13 #define STATUS_MIST 14 -// Waiting statuses +// Curse class statuses #define STATUS_CURSED 1 #define STATUS_DECOY 2 #define STATUS_SNATCH 3 -// Linked statuses +// Leech Seed class statuses #define STATUS_LEECH_SEED 1 #define STATUS_DESTINY_BOND 2 -// Move statuses +// Sure Shot class statuses #define STATUS_SURE_SHOT 1 #define STATUS_WHIFFER 2 #define STATUS_SET_DAMAGE 3 #define STATUS_FOCUS_ENERGY 4 -// Item statuses +// Long Toss class statuses #define STATUS_LONG_TOSS 1 #define STATUS_PIERCE 2 -// Transform statuses +// Invisible class statuses #define STATUS_INVISIBLE 1 #define STATUS_TRANSFORMED 2 #define STATUS_MOBILE 3 -// Eyesight statuses +// Blinker class statuses #define STATUS_BLINKER 1 #define STATUS_CROSS_EYED 2 #define STATUS_EYEDROPS 3 diff --git a/include/move_effects_target.h b/include/move_effects_target.h index 76e7b646d..6c12cbf88 100644 --- a/include/move_effects_target.h +++ b/include/move_effects_target.h @@ -3,7 +3,7 @@ #include "structs/dungeon_entity.h" -u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns); +u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns); void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, bool8 displayMessage); bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage); void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns); diff --git a/include/structs/dungeon_entity.h b/include/structs/dungeon_entity.h index 24bdda795..5a5dcb0c5 100644 --- a/include/structs/dungeon_entity.h +++ b/include/structs/dungeon_entity.h @@ -69,93 +69,93 @@ typedef struct AITarget } AITarget; -typedef struct Sleep +typedef struct SleepClassStatus { - /* 0x0 */ u8 sleep; - /* 0x1 */ u8 sleepTurns; -} Sleep; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} SleepClassStatus; -typedef struct NonVolatile +typedef struct BurnClassStatus { - /* 0x0 */ u8 nonVolatileStatus; - /* 0x1 */ u8 nonVolatileStatusTurns; - /* 0x2 */ u8 nonVolatileStatusDamageCountdown; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; + /* 0x2 */ u8 damageCountdown; /* 0x3 */ u8 unk4; -} NonVolatile; +} BurnClassStatus; -typedef struct Immobilize +typedef struct FrozenClassStatus { - /* 0x0 */ u8 immobilizeStatus; + /* 0x0 */ u8 status; /* 0x4 */ s32 unk4; - /* 0x8 */ u8 immobilizeStatusTurns; - /* 0x9 */ u8 immobilizeStatusDamageCountdown; -} Immobilize; + /* 0x8 */ u8 turns; + /* 0x9 */ u8 damageCountdown; +} FrozenClassStatus; -typedef struct Volatile +typedef struct CringeClassStatus { - /* 0x0 */ u8 volatileStatus; - /* 0x1 */ u8 volatileStatusTurns; -} Volatile; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} CringeClassStatus; -typedef struct Charging +typedef struct BideClassStatus { - /* 0x0 */ u8 chargingStatus; - /* 0x1 */ u8 chargingStatusTurns; - /* 0x2 */ u8 chargingStatusMoveIndex; // The position of the move in the Pokémon's moveset that triggered the status. -} Charging; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; + /* 0x2 */ u8 moveSlot; // The position of the move in the Pokémon's moveset that triggered the status. +} BideClassStatus; -typedef struct Protection +typedef struct ReflectClassStatus { - /* 0x0 */ u8 protectionStatus; - /* 0x1 */ u8 protectionStatusTurns; -} Protection; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} ReflectClassStatus; -typedef struct Waiting +typedef struct CurseClassStatus { - /* 0xC8 */ u8 waitingStatus; - /* 0xC9 */ bool8 decoyApplierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). - u8 unkCA; - /* 0xCB */ u8 waitingStatusTurns; - /* 0xCC */ u8 curseDamageCountdown; -} Waiting; + /* 0x0 */ u8 status; + /* 0x1 */ bool8 applierNonTeamMemberFlag; // True if the Pokémon is a decoy and a wild Pokémon (i.e., not an allied Pokémon). + u8 unk2; + /* 0x3 */ u8 turns; + /* 0x4 */ u8 damageCountdown; +} CurseClassStatus; -typedef struct Linked +typedef struct LeechSeedClassStatus { - /* 0xD0 */ u8 linkedStatus; - /* 0xD4 */ u32 unkD4; - /* 0xD8 */ u8 unkD8; - /* 0xD9 */ u8 linkedStatusTurns; - /* 0xDA */ u8 linkedStatusDamageCountdown; -} Linked; + /* 0x0 */ u8 status; + /* 0x4 */ u32 unkD4; + /* 0x8 */ u8 unkD8; + /* 0x9 */ u8 turns; + /* 0xA */ u8 damageCountdown; +} LeechSeedClassStatus; -typedef struct MoveStatus +typedef struct SureShotClassStatus { - /* 0xDC */ u8 moveStatus; - /* 0xDD */ u8 moveStatusTurns; -} MoveStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} SureShotClassStatus; -typedef struct ItemStatus +typedef struct LongTossClassStatus { - /* 0xE0 */ u8 itemStatus; -} ItemStatus; + /* 0x0 */ u8 status; +} LongTossClassStatus; -typedef struct TransformStatus +typedef struct InvisibleClassStatus { - /* 0xE4 */ u8 transformStatus; - /* 0xE5 */ u8 transformStatusTurns; -} TransformStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} InvisibleClassStatus; -typedef struct EyesightStatus +typedef struct BlinkerClassStatus { - /* 0xE8 */ u8 eyesightStatus; - /* 0xE9 */ u8 eyesightStatusTurns; -} EyesightStatus; + /* 0x0 */ u8 status; + /* 0x1 */ u8 turns; +} BlinkerClassStatus; typedef struct Muzzled { - /* 0xEC */ bool8 muzzled; - /* 0xED */ u8 muzzledTurns; + /* 0x0 */ bool8 muzzled; + /* 0x1 */ u8 turns; } Muzzled; typedef struct Unk_Entity_x184 @@ -235,18 +235,18 @@ typedef struct EntityInfo u8 fillA5[0xA8 - 0xA5]; // Statuses are split into groups based on which ones can't overlap. // See status.h for which statuses are in each group. - /* 0xA8 */ Sleep sleep; - /* 0xAC */ NonVolatile nonVolatile; - /* 0xB0 */ Immobilize immobilize; - /* 0xBC */ Volatile volatileStatus; - /* 0xC0 */ Charging charging; - /* 0xC4 */ Protection protection; - /* 0xC8 */ Waiting waitingStruct; - /* 0xD0 */ Linked linked; - /* 0xDC */ MoveStatus moveStatus; - /* 0xE0 */ ItemStatus itemStatus; - /* 0xE4 */ TransformStatus transformStatus; - /* 0xE8 */ EyesightStatus eyesightStatus; + /* 0xA8 */ SleepClassStatus sleepClassStatus; + /* 0xAC */ BurnClassStatus burnClassStatus; + /* 0xB0 */ FrozenClassStatus frozenClassStatus; + /* 0xBC */ CringeClassStatus cringeClassStatus; + /* 0xC0 */ BideClassStatus bideClassStatus; + /* 0xC4 */ ReflectClassStatus reflectClassStatus; + /* 0xC8 */ CurseClassStatus curseClassStatus; + /* 0xD0 */ LeechSeedClassStatus linked; + /* 0xDC */ SureShotClassStatus sureShotClassStatus; + /* 0xE0 */ LongTossClassStatus longTossClassStatus; + /* 0xE4 */ InvisibleClassStatus invisibleClassStatus; + /* 0xE8 */ BlinkerClassStatus blinkerClassStatus; /* 0xEC */ Muzzled muzzled; /* 0xF0 */ bool8 powerEars; /* 0xF1 */ bool8 scanning; diff --git a/include/structs/str_dungeon.h b/include/structs/str_dungeon.h index c663aebc2..0551dddee 100644 --- a/include/structs/str_dungeon.h +++ b/include/structs/str_dungeon.h @@ -383,7 +383,7 @@ typedef struct Dungeon u8 fill1357A[0x1357C - 0x1357A]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; - /* 0x135CC */ Entity *activeMonsterPtrs[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon + /* 0x135CC */ Entity *activePokemon[DUNGEON_MAX_POKEMON]; // Contains both team and wild Pokémon /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; diff --git a/src/code_803E724.c b/src/code_803E724.c index 4845e54c4..af89005c5 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -993,7 +993,7 @@ void sub_803F580(u8 a0) unk18214 = strPtr->unk18214; if (unk18214 == 0) { u32 unkVar; - if (info->eyesightStatus.eyesightStatus == STATUS_BLINKER) { + if (info->blinkerClassStatus.status == STATUS_BLINKER) { strPtr->blinded = 1; unkVar = 0xE; } @@ -1016,7 +1016,7 @@ void sub_803F580(u8 a0) } before = strPtr->hallucinating; - if (info->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) { + if (info->blinkerClassStatus.status == STATUS_CROSS_EYED) { strPtr->hallucinating = 1; } else { @@ -1066,7 +1066,7 @@ void sub_803F580(u8 a0) if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { sub_80402AC(mon->pos.x, mon->pos.y); } diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 38142228b..b11ef6530 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -15,18 +15,18 @@ #include "structs/dungeon_entity.h" #include "structs/str_dungeon.h" -extern u32 gStatusSpriteMasks_SleepStatus[]; -extern u32 gStatusSpriteMasks_NonVolatileStatus[]; -extern u32 gStatusSpriteMasks_ImmobilizeStatus[]; -extern u32 gStatusSpriteMasks_VolatileStatus[]; -extern u32 gStatusSpriteMasks_ChargingStatus[]; -extern u32 gStatusSpriteMasks_ProtectionStatus[]; -extern u32 gStatusSpriteMasks_WaitingStatus[]; -extern u32 gStatusSpriteMasks_LinkedStatus[]; -extern u32 gStatusSpriteMasks_MoveStatus[]; -extern u32 gStatusSpriteMasks_ItemStatus[]; -extern u32 gStatusSpriteMasks_TransformStatus[]; -extern u32 gStatusSpriteMasks_EyesightStatus[]; +extern u32 gStatusSpriteMasks_SleepClassStatus[]; +extern u32 gStatusSpriteMasks_BurnClassStatus[]; +extern u32 gStatusSpriteMasks_FrozenClassStatus[]; +extern u32 gStatusSpriteMasks_CringeClassStatus[]; +extern u32 gStatusSpriteMasks_BideClassStatus[]; +extern u32 gStatusSpriteMasks_ReflectClassStatus[]; +extern u32 gStatusSpriteMasks_CurseClassStatus[]; +extern u32 gStatusSpriteMasks_LeechSeedClassStatus[]; +extern u32 gStatusSpriteMasks_SureShotClassStatus[]; +extern u32 gStatusSpriteMasks_LongTossClassStatus[]; +extern u32 gStatusSpriteMasks_InvisibleClassStatus[]; +extern u32 gStatusSpriteMasks_BlinkerClassStatus[]; extern u32 gStatusSpriteMasks_MuzzledStatus[]; @@ -155,7 +155,7 @@ void sub_8041888(u8 param_1) EntityInfo *entityInfo; for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -183,26 +183,26 @@ void EntityUpdateStatusSprites(Entity *entity) if (entityInfo->id == 0xb9) { // NOTE: clean this up sometime - temp = entityInfo->sleep.sleepTurns; + temp = entityInfo->sleepClassStatus.turns; flag = 0x7f; temp ^= flag; flag = (temp) != 0; } if (flag) { - spriteStatus = gStatusSpriteMasks_SleepStatus[entityInfo->sleep.sleep]; + spriteStatus = gStatusSpriteMasks_SleepClassStatus[entityInfo->sleepClassStatus.status]; } spriteStatus = spriteStatus | - gStatusSpriteMasks_NonVolatileStatus[entityInfo->nonVolatile.nonVolatileStatus] | - gStatusSpriteMasks_ImmobilizeStatus[entityInfo->immobilize.immobilizeStatus] | - gStatusSpriteMasks_VolatileStatus[entityInfo->volatileStatus.volatileStatus] | - gStatusSpriteMasks_ChargingStatus[entityInfo->charging.chargingStatus] | - gStatusSpriteMasks_ProtectionStatus[entityInfo->protection.protectionStatus] | - gStatusSpriteMasks_WaitingStatus[entityInfo->waitingStruct.waitingStatus] | - gStatusSpriteMasks_LinkedStatus[entityInfo->linked.linkedStatus] | - gStatusSpriteMasks_MoveStatus[entityInfo->moveStatus.moveStatus] | - gStatusSpriteMasks_ItemStatus[entityInfo->itemStatus.itemStatus] | - gStatusSpriteMasks_TransformStatus[entityInfo->transformStatus.transformStatus] | - gStatusSpriteMasks_EyesightStatus[entityInfo->eyesightStatus.eyesightStatus] | + gStatusSpriteMasks_BurnClassStatus[entityInfo->burnClassStatus.status] | + gStatusSpriteMasks_FrozenClassStatus[entityInfo->frozenClassStatus.status] | + gStatusSpriteMasks_CringeClassStatus[entityInfo->cringeClassStatus.status] | + gStatusSpriteMasks_BideClassStatus[entityInfo->bideClassStatus.status] | + gStatusSpriteMasks_ReflectClassStatus[entityInfo->reflectClassStatus.status] | + gStatusSpriteMasks_CurseClassStatus[entityInfo->curseClassStatus.status] | + gStatusSpriteMasks_LeechSeedClassStatus[entityInfo->linked.status] | + gStatusSpriteMasks_SureShotClassStatus[entityInfo->sureShotClassStatus.status] | + gStatusSpriteMasks_LongTossClassStatus[entityInfo->longTossClassStatus.status] | + gStatusSpriteMasks_InvisibleClassStatus[entityInfo->invisibleClassStatus.status] | + gStatusSpriteMasks_BlinkerClassStatus[entityInfo->blinkerClassStatus.status] | gStatusSpriteMasks_MuzzledStatus[entityInfo->muzzled.muzzled]; if (entityInfo->grudge) { diff --git a/src/code_804267C.c b/src/code_804267C.c index 845a20266..b37cc31dd 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -104,7 +104,7 @@ void sub_80427AC(void) s32 i; for (i = 0; i < 20; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) { enInfo = GetEntInfo(entity); if (enInfo->unkF3) { diff --git a/src/code_8045A00.c b/src/code_8045A00.c index 943820e42..d6ef76284 100644 --- a/src/code_8045A00.c +++ b/src/code_8045A00.c @@ -32,7 +32,7 @@ void sub_8045ACC(void) { entity = gDungeon->teamPokemon[index]; if (EntityExists(entity)) { - gDungeon->activeMonsterPtrs[pokeCount] = entity; + gDungeon->activePokemon[pokeCount] = entity; pokeCount++; } } @@ -41,12 +41,12 @@ void sub_8045ACC(void) { entity = gDungeon->wildPokemon[index]; if (EntityExists(entity)) { - gDungeon->activeMonsterPtrs[pokeCount] = entity; + gDungeon->activePokemon[pokeCount] = entity; pokeCount++; } } for (; pokeCount < DUNGEON_MAX_POKEMON; pokeCount++) { - gDungeon->activeMonsterPtrs[pokeCount] = NULL; + gDungeon->activePokemon[pokeCount] = NULL; } } diff --git a/src/code_8048480.c b/src/code_8048480.c index 2759d2cde..38a0191c9 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -537,8 +537,8 @@ void EyedropSeedItemAction(Entity *pokemon, Entity *target) void CheriBerryItemAction(Entity *pokemon, Entity *target) { - if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) - SendNonVolatileEndMessage(pokemon, target); + if(GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) + EndBurnClassStatus(pokemon, target); else // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); @@ -547,8 +547,8 @@ void CheriBerryItemAction(Entity *pokemon, Entity *target) void PechaBerryItemAction(Entity *pokemon, Entity *target) { EntityInfo *entInfo = GetEntInfo(target); - if(entInfo->nonVolatile.nonVolatileStatus == STATUS_POISONED || entInfo->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) - SendNonVolatileEndMessage(pokemon, target); + if(entInfo->burnClassStatus.status == STATUS_POISONED || entInfo->burnClassStatus.status == STATUS_BADLY_POISONED) + EndBurnClassStatus(pokemon, target); else // Pointer to "But nothing happened!" TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F89F4); @@ -592,8 +592,8 @@ void DoomSeedItemAction(Entity *pokemon, Entity *target) void RawstBerryItemAction(Entity *pokemon, Entity *target) { - if(GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_BURN) - SendNonVolatileEndMessage(pokemon, target); + if(GetEntInfo(target)->burnClassStatus.status == STATUS_BURN) + EndBurnClassStatus(pokemon, target); else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); @@ -694,7 +694,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) else { uVar1 = gUnknown_80F4FA4; } - if (entityInfo_1->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (entityInfo_1->frozenClassStatus.status == STATUS_FROZEN) { EndFrozenClassStatus(pokemon, target); } sub_806F370(pokemon, target, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); @@ -717,7 +717,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3) else { uVar1 = gUnknown_80F4FA6; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { EndFrozenClassStatus(pokemon, entity); } sub_806F370(pokemon, entity, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); diff --git a/src/code_805D8C8.c b/src/code_805D8C8.c index 771fc0e69..de3122197 100644 --- a/src/code_805D8C8.c +++ b/src/code_805D8C8.c @@ -20,7 +20,7 @@ void sub_8068768(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (entity != NULL && EntityExists(entity)) LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE); diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 0c6b6cb95..07224cc2b 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -503,19 +503,19 @@ void DungeonHandlePlayerInput(void) if (sub_805EC4C(leader, 1)) break; - if (leaderInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) { + if (leaderInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) { immobilizedMsg = gUnknown_80F8A84, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) { + else if (leaderInfo->frozenClassStatus.status == STATUS_CONSTRICTION) { immobilizedMsg = gUnknown_80F8A6C, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (leaderInfo->frozenClassStatus.status == STATUS_INGRAIN) { immobilizedMsg = gUnknown_80F8AB0, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_WRAP) { + else if (leaderInfo->frozenClassStatus.status == STATUS_WRAP) { immobilizedMsg = gUnknown_80F8ADC, canMoveFlags |= 1; } - else if (leaderInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + else if (leaderInfo->frozenClassStatus.status == STATUS_WRAPPED) { immobilizedMsg = gUnknown_80F8B0C, canMoveFlags |= 1; } @@ -537,7 +537,7 @@ void DungeonHandlePlayerInput(void) else { sub_8044C50(2); if ((gRealInputs.held & B_BUTTON || bPress) && FixedPointToInt(leaderInfo->belly) != 0) { - if (GetEntInfo(leader)->volatileStatus.volatileStatus != STATUS_CONFUSED) { + if (GetEntInfo(leader)->cringeClassStatus.status != STATUS_CONFUSED) { gDungeon->unk66C = 1; } leaderInfo->action.unk4[0].actionUseIndex = 0; @@ -1350,7 +1350,7 @@ void sub_805E738(Entity *a0) Tile *tile; s32 i, j; EntityInfo *entityInfo = GetEntInfo(a0); - if (entityInfo->eyesightStatus.eyesightStatus != 1 && entityInfo->eyesightStatus.eyesightStatus != 2) { + if (entityInfo->blinkerClassStatus.status != 1 && entityInfo->blinkerClassStatus.status != 2) { // What??? for (i = 0; i < 1; i++) { bool8 r9 = FALSE; @@ -1549,25 +1549,25 @@ bool8 sub_805EC4C(Entity *a0, u8 a1) return FALSE; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_CONSTRICTION) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; + if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_FROZEN) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_WRAP) return FALSE; - if (tileMonsterInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_SHADOW_HOLD) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_CONSTRICTION) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_INGRAIN) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; + if (tileMonsterInfo->frozenClassStatus.status == STATUS_WRAPPED) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) return FALSE; - if (tileMonsterInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; + if (tileMonsterInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; - if (tileMonsterInfo->sleep.sleep != STATUS_NONE && tileMonsterInfo->sleep.sleep != STATUS_SLEEPLESS && tileMonsterInfo->sleep.sleep != STATUS_YAWNING) return FALSE; - if (entityInfo->sleep.sleep != STATUS_NONE && entityInfo->sleep.sleep != STATUS_SLEEPLESS && entityInfo->sleep.sleep != STATUS_YAWNING) return FALSE; + if (tileMonsterInfo->sleepClassStatus.status != STATUS_NONE && tileMonsterInfo->sleepClassStatus.status != STATUS_SLEEPLESS && tileMonsterInfo->sleepClassStatus.status != STATUS_YAWNING) return FALSE; + if (entityInfo->sleepClassStatus.status != STATUS_NONE && entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS && entityInfo->sleepClassStatus.status != STATUS_YAWNING) return FALSE; if (IsChargingAnyTwoTurnMove(tileMonster, FALSE)) return FALSE; if (!sub_8070F80(a0, entityInfo->action.direction)) return FALSE; @@ -1604,7 +1604,7 @@ void sub_805EE30(void) return; tile = GetTileAtEntitySafe(leader); - if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && GetEntInfo(leader)->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF)) + if (IQSkillIsEnabled(leader, IQ_SUPER_MOBILE) && GetEntInfo(leader)->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(leader, ITEM_MOBILE_SCARF)) sub_804AE84(&leader->pos); if (tile->terrainType & TERRAIN_TYPE_STAIRS) gDungeon->unk1 = 1; @@ -1679,11 +1679,11 @@ void sub_805EFB4(Entity *a0, bool8 a1) { s32 i; EntityInfo *leaderInfo = GetLeaderInfo(); - if (a1 && leaderInfo->volatileStatus.volatileStatus == STATUS_COWERING) { + if (a1 && leaderInfo->cringeClassStatus.status == STATUS_COWERING) { leaderInfo->action.direction += 4; leaderInfo->action.direction &= 7; } - else if (leaderInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) { + else if (leaderInfo->cringeClassStatus.status == STATUS_CONFUSED) { s32 rnd = DungeonRandInt(8); for (i = 0; i < 8; i++) { if (a1 || CanMoveInDirection(a0, rnd)) { diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 7abdbc1dd..55c0721a0 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -74,7 +74,7 @@ void TriggerWeatherAbilities(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { if (HasAbility(entity, ABILITY_DRIZZLE)) { gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; @@ -208,7 +208,7 @@ void sub_806A120(Entity * pokemon, Entity * target, Move* move) EntityInfo *entityInfo; if ((((EntityExists(pokemon)) && (EntityExists(target))) && (pokemon != target)) - && (entityInfo = GetEntInfo(target), entityInfo->protection.protectionStatus == STATUS_CONVERSION2)) { + && (entityInfo = GetEntInfo(target), entityInfo->reflectClassStatus.status == STATUS_CONVERSION2)) { moveType = GetMoveTypeForMonster(pokemon, move); uVar2_u32 = sub_8092364(moveType); if (uVar2_u32 != TYPE_NONE) { @@ -301,8 +301,8 @@ void sub_806A338(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; - if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) + entity = gDungeon->activePokemon[index]; + if (EntityExists(entity) && (GetEntInfo(entity)->curseClassStatus.status == STATUS_SNATCH)) { gDungeon->snatchPokemon = entity; ASM_MATCH_TRICK(entity); diff --git a/src/code_806CD90.c b/src/code_806CD90.c index 965c30a08..5d645ef0f 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -49,7 +49,7 @@ void sub_806CC10(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); @@ -69,7 +69,7 @@ void sub_806CC70(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -95,7 +95,7 @@ void sub_806CCB4(Entity *entity, u8 a1) entity->axObj.unk47 = 0; sVar1 = entity->axObj.unk40_maybeAnimTimer; - if (info->waitingStruct.waitingStatus != STATUS_DECOY && !flag) + if (info->curseClassStatus.status != STATUS_DECOY && !flag) AxResInitFile(&entity->axObj.axdata, entity->axObj.spriteFile, entity->axObj.unk42_animId1, entity->axObj.unk44_direction1, sVar1, @@ -116,7 +116,7 @@ void sub_806CD90(void) Entity *entity; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CCB4(entity, sub_806CEBC(entity)); @@ -176,19 +176,19 @@ void sub_806CE94(Entity *entity, u32 newDir) u8 sub_806CEBC(Entity *entity) { - u8 sleep; + u8 sleepClassStatus; EntityInfo *entityInfo; entityInfo = GetEntInfo(entity); - sleep = entityInfo->sleep.sleep; + sleepClassStatus = entityInfo->sleepClassStatus.status; - if (sleep == STATUS_SLEEP || sleep == STATUS_NAPPING || sleep == STATUS_NIGHTMARE) { - if (entityInfo->apparentID != MONSTER_SUDOWOODO || entityInfo->sleep.sleepTurns != 0x7F) + if (sleepClassStatus == STATUS_SLEEP || sleepClassStatus == STATUS_NAPPING || sleepClassStatus == STATUS_NIGHTMARE) { + if (entityInfo->apparentID != MONSTER_SUDOWOODO || entityInfo->sleepClassStatus.turns != 0x7F) return 5; else return 7; } - if (entityInfo->charging.chargingStatus == STATUS_BIDE) + if (entityInfo->bideClassStatus.status == STATUS_BIDE) return 11; return 7; } @@ -227,7 +227,7 @@ void sub_806CF60(void) s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - entity = gDungeon->activeMonsterPtrs[i]; + entity = gDungeon->activePokemon[i]; if (EntityExists(entity)) sub_806CF98(entity); @@ -342,19 +342,19 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * return; r9 = arg8; - if (CheckVariousStatuses(target) || GetEntInfo(target)->charging.chargingStatus != 0) + if (CheckVariousStatuses(target) || GetEntInfo(target)->bideClassStatus.status != 0) r9 = FALSE; if (r9 && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1 && attacker != target && IsTypePhysical(dmgStruct->type) - && GetEntInfo(target)->protection.protectionStatus == STATUS_VITAL_THROW) + && GetEntInfo(target)->reflectClassStatus.status == STATUS_VITAL_THROW) { sub_8042730(target, attacker); sub_807F43C(target, attacker); } - if (GetEntInfo(target)->charging.chargingStatus == STATUS_ENRAGED) { + if (GetEntInfo(target)->bideClassStatus.status == STATUS_ENRAGED) { RaiseAttackStageTarget(attacker, target, gUnknown_8106A4C, 1); } @@ -366,15 +366,15 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * && abs(attacker->pos.x - target->pos.x) <= 1 && abs(attacker->pos.y - target->pos.y) <= 1) { bool32 isPhysical = IsTypePhysical(dmgStruct->type); - if (GetEntInfo(target)->protection.protectionStatus == STATUS_COUNTER && isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 4; } - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MINI_COUNTER && isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MINI_COUNTER && isPhysical) { sub_8041B18(target); returnDmg += 1; } - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIRROR_COAT && !isPhysical) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIRROR_COAT && !isPhysical) { sub_8041B90(target); returnDmg += 4; } @@ -472,13 +472,13 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct * // Destiny Bond if (r9) { EntityInfo *targetInfo = GetEntInfo(target); - if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { - Entity *destBondTarget = gDungeon->activeMonsterPtrs[targetInfo->linked.unkD8]; + if (targetInfo->linked.status == STATUS_DESTINY_BOND) { + Entity *destBondTarget = gDungeon->activePokemon[targetInfo->linked.unkD8]; if (destBondTarget == NULL) { - targetInfo->linked.linkedStatus = 0; + targetInfo->linked.status = 0; } else if (GetEntInfo(destBondTarget)->unk98 != targetInfo->linked.unkD4) { - targetInfo->linked.linkedStatus = 0; + targetInfo->linked.status = 0; } else { sub_8041D00(destBondTarget, target); @@ -513,7 +513,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc TrySendImmobilizeSleepEndMsg(attacker, target); SetShopkeeperAggression(attacker, target); if (GetEntityType(attacker) == ENTITY_MONSTER - && GetEntInfo(attacker)->moveStatus.moveStatus == STATUS_SET_DAMAGE + && GetEntInfo(attacker)->sureShotClassStatus.status == STATUS_SET_DAMAGE && dmgStruct->unkE == 0) { dmgStruct->dmg = gUnknown_80F4F8C; @@ -526,7 +526,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc dmgStruct->tookNoDamage = TRUE; return FALSE; } - if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { + if (targetData->frozenClassStatus.status == STATUS_FROZEN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); sub_8042238(attacker, target); @@ -534,8 +534,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc return FALSE; } - if ((targetData->sleep.sleep == STATUS_SLEEP || targetData->sleep.sleep == STATUS_NAPPING || targetData->sleep.sleep == STATUS_NIGHTMARE) - && targetData->sleep.sleepTurns == 0x7F) + if ((targetData->sleepClassStatus.status == STATUS_SLEEP || targetData->sleepClassStatus.status == STATUS_NAPPING || targetData->sleepClassStatus.status == STATUS_NIGHTMARE) + && targetData->sleepClassStatus.turns == 0x7F) { WakeUpPokemon(target); } @@ -639,7 +639,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else { unkBool = FALSE; } - if (targetData->eyesightStatus.eyesightStatus == STATUS_BLINKER || targetData->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (targetData->blinkerClassStatus.status == STATUS_BLINKER || targetData->blinkerClassStatus.status == STATUS_CROSS_EYED) unkBool = FALSE; if (unkBool) { EntityInfo *info = GetEntInfo(target); @@ -659,7 +659,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc else targetData->HP = 0; - if (targetData->protection.protectionStatus == STATUS_ENDURING) { + if (targetData->reflectClassStatus.status == STATUS_ENDURING) { if (targetData->HP == 0) { targetData->HP = 1; TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_8100548); @@ -694,7 +694,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } // 0 HP - if (targetData->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (targetData->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(attacker, target); } @@ -758,7 +758,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc } } - if (targetData->immobilize.immobilizeStatus == STATUS_WRAP || targetData->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (targetData->frozenClassStatus.status == STATUS_WRAP || targetData->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(targetData->unk9C); } @@ -779,11 +779,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->itemHoldersIdentified = 0; } ZeroOutItem(&targetData->heldItem); - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); @@ -836,11 +836,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->itemHoldersIdentified = 0; } ZeroOutItem(heldItem); - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); @@ -890,11 +890,11 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc gDungeon->unk679 = 0; gDungeon->itemHoldersIdentified = 0; } - if (targetData->waitingStruct.waitingStatus == STATUS_SNATCH) { - SendWaitingEndMessage(attacker, target, STATUS_SNATCH); + if (targetData->curseClassStatus.status == STATUS_SNATCH) { + EndCurseClassStatus(attacker, target, STATUS_SNATCH); } - else if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) { - SendWaitingEndMessage(attacker, target, STATUS_DECOY); + else if (targetData->curseClassStatus.status == STATUS_DECOY) { + EndCurseClassStatus(attacker, target, STATUS_DECOY); } sub_8078084(target); sub_806BFC0(targetData, 0); diff --git a/src/code_806E8B0.c b/src/code_806E8B0.c index c045dc576..06217bd81 100644 --- a/src/code_806E8B0.c +++ b/src/code_806E8B0.c @@ -214,7 +214,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 atkStat = statCalc / 256; defStatStage = targetInfo->defensiveStages[splitIndex]; - if (splitIndex == 0 && targetInfo->charging.chargingStatus == STATUS_SKULL_BASH) { + if (splitIndex == 0 && targetInfo->bideClassStatus.status == STATUS_SKULL_BASH) { gDungeon->unk134.unk17A = 1; defStatStage++; } @@ -332,12 +332,12 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 } } if (arg_10) { - if (splitIndex == 0 && targetInfo->protection.protectionStatus == STATUS_REFLECT) { + if (splitIndex == 0 && targetInfo->reflectClassStatus.status == STATUS_REFLECT) { sub_8041B74(target); F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk166 = 1; } - if (splitIndex == 1 && targetInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) { + if (splitIndex == 1 && targetInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { sub_8041B5C(target); F48_16_SMul(&unkSp9, &unkSp9, &gUnknown_8106F1C); gDungeon->unk134.unk167 = 1; @@ -355,7 +355,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3 critOdds = critChance; } - if (attackerInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) { + if (attackerInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { critOdds = 999; gDungeon->unk134.unk168 = 1; } diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 2ca957fd4..784f15a6d 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -422,19 +422,19 @@ void sub_8074094(Entity *entity) } // Statuses - if (entityInfo->sleep.sleep == STATUS_YAWNING) { + if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; sub_80420B8(entity); } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_BURN) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { + if (entityInfo->burnClassStatus.status == STATUS_BURN) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F32; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F32; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F70, 1, 0x208); } @@ -442,24 +442,24 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_POISONED) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { + if (entityInfo->burnClassStatus.status == STATUS_POISONED) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F34; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F34; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F72, 3, 0x20A); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) { - if (entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0 || --entityInfo->nonVolatile.nonVolatileStatusDamageCountdown == 0) { - s32 turns = entityInfo->nonVolatile.unk4; - if (entityInfo->nonVolatile.unk4 < 29) - entityInfo->nonVolatile.unk4++; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = gUnknown_80F4F36; + else if (entityInfo->burnClassStatus.status == STATUS_BADLY_POISONED) { + if (entityInfo->burnClassStatus.damageCountdown == 0 || --entityInfo->burnClassStatus.damageCountdown == 0) { + s32 turns = entityInfo->burnClassStatus.unk4; + if (entityInfo->burnClassStatus.unk4 < 29) + entityInfo->burnClassStatus.unk4++; + entityInfo->burnClassStatus.damageCountdown = gUnknown_80F4F36; if (turns >= 29) turns = 29; @@ -474,47 +474,47 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->immobilize.immobilizeStatus == STATUS_CONSTRICTION) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + if (entityInfo->frozenClassStatus.status == STATUS_CONSTRICTION) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F38; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F38; TrySendImmobilizeSleepEndMsg(entity, entity); - sub_8041C4C(entity, entityInfo->immobilize.unk4); + sub_8041C4C(entity, entityInfo->frozenClassStatus.unk4); DealDamageToEntity(entity, gUnknown_80F4F74, 2, 0x209); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + else if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F3A; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F3A; TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, gUnknown_80F4F76, 5, 0x20B); } if (!EntityExists(entity) || sub_8044B28()) return; } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { - if (entityInfo->immobilize.immobilizeStatusDamageCountdown == 0 || --entityInfo->immobilize.immobilizeStatusDamageCountdown == 0) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { + if (entityInfo->frozenClassStatus.damageCountdown == 0 || --entityInfo->frozenClassStatus.damageCountdown == 0) { UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; - entityInfo->immobilize.immobilizeStatusDamageCountdown = gUnknown_80F4F3C; + entityInfo->frozenClassStatus.damageCountdown = gUnknown_80F4F3C; HealTargetHP(entity, entity, gUnknown_80F4FB2, 0, TRUE); } } - if (entityInfo->waitingStruct.waitingStatus == STATUS_CURSED) { - if (entityInfo->waitingStruct.curseDamageCountdown == 0 || --entityInfo->waitingStruct.curseDamageCountdown == 0) { + if (entityInfo->curseClassStatus.status == STATUS_CURSED) { + if (entityInfo->curseClassStatus.damageCountdown == 0 || --entityInfo->curseClassStatus.damageCountdown == 0) { s32 dmg = entityInfo->maxHPStat / 4; if (dmg == 0) dmg = 1; - entityInfo->waitingStruct.curseDamageCountdown = gUnknown_80F4F3E; + entityInfo->curseClassStatus.damageCountdown = gUnknown_80F4F3E; UseAttack(NULL); if (!EntityExists(entity) || sub_8044B28()) return; @@ -526,19 +526,19 @@ void sub_8074094(Entity *entity) return; } - if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { - if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { + if (entityInfo->linked.status == STATUS_LEECH_SEED) { + if (entityInfo->linked.damageCountdown == 0 || --entityInfo->linked.damageCountdown == 0) { s32 hp = gUnknown_80F4FB4; - Entity *target = gDungeon->activeMonsterPtrs[entityInfo->linked.unkD8]; + Entity *target = gDungeon->activePokemon[entityInfo->linked.unkD8]; - entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; + entityInfo->linked.damageCountdown = gUnknown_80F4F40; if (target == NULL) { - entityInfo->linked.linkedStatus = 0; + entityInfo->linked.status = 0; } else { EntityInfo *targetInfo = GetEntInfo(target); if (targetInfo->unk98 != entityInfo->linked.unkD4) { - entityInfo->linked.linkedStatus = 0; + entityInfo->linked.status = 0; } else { bool8 dmgUser = HasAbility(entity, ABILITY_LIQUID_OOZE); @@ -547,7 +547,7 @@ void sub_8074094(Entity *entity) if (!EntityExists(entity) || !EntityExists(target) || sub_8044B28()) return; - if (entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) { + if (entityInfo->frozenClassStatus.status != STATUS_FROZEN) { TrySendImmobilizeSleepEndMsg(entity, entity); DealDamageToEntity(entity, hp, 9, 0x20D); if (dmgUser) { @@ -574,7 +574,7 @@ void sub_8074094(Entity *entity) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30); TrySendImmobilizeSleepEndMsg(entity, entity); - if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { + if (entityInfo->reflectClassStatus.status == STATUS_PROTECT) { LogMessageByIdWithPopupCheckUser(entity, gPtrProtectSavedItMessage); } else { @@ -585,10 +585,10 @@ void sub_8074094(Entity *entity) } } - if (entityInfo->charging.chargingStatus == STATUS_BIDE) { - sub_80838EC(&entityInfo->charging.chargingStatusTurns); - if (entityInfo->charging.chargingStatusTurns == 0) { - entityInfo->charging.chargingStatus = 0; + if (entityInfo->bideClassStatus.status == STATUS_BIDE) { + sub_80838EC(&entityInfo->bideClassStatus.turns); + if (entityInfo->bideClassStatus.turns == 0) { + entityInfo->bideClassStatus.status = 0; if (!CheckVariousStatuses2(entity, FALSE) && !CannotAttack(entity, FALSE) && !CheckVariousStatuses(entity)) { Move bideMove; @@ -606,10 +606,10 @@ void sub_8074094(Entity *entity) if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->charging.chargingStatus == STATUS_ENRAGED) { - sub_80838EC(&entityInfo->charging.chargingStatusTurns); - if (entityInfo->charging.chargingStatusTurns == 0) { - entityInfo->charging.chargingStatus = 0; + if (entityInfo->bideClassStatus.status == STATUS_ENRAGED) { + sub_80838EC(&entityInfo->bideClassStatus.turns); + if (entityInfo->bideClassStatus.turns == 0) { + entityInfo->bideClassStatus.status = 0; entityInfo->unk14A = 0; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FABD8); @@ -635,7 +635,7 @@ void TickStatusHeal(Entity *entity) entityInfo = GetEntInfo(entity); // HP heal - if (entityInfo->unk146 == 0 && entityInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED && entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) { + if (entityInfo->unk146 == 0 && entityInfo->burnClassStatus.status != STATUS_POISONED && entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { s32 r4 = 0; if (!entityInfo->isNotTeamMember) @@ -644,7 +644,7 @@ void TickStatusHeal(Entity *entity) if (r4 != 0) { if (HasHeldItem(entity, ITEM_HEAL_RIBBON)) r4 += gUnknown_80F4FC4; - if (entityInfo->protection.protectionStatus == STATUS_WISH) + if (entityInfo->reflectClassStatus.status == STATUS_WISH) r4 += gUnknown_80F4FC0; if (HasAbility(entity, ABILITY_RAIN_DISH) && GetApparentWeather(entity) == WEATHER_RAIN) r4 += gUnknown_80F4FC2; @@ -665,90 +665,90 @@ void TickStatusHeal(Entity *entity) } } - if (entityInfo->sleep.sleep != 0) { - sub_80838EC(&entityInfo->sleep.sleepTurns); - if (entityInfo->sleep.sleepTurns == 0) { - SendSleepEndMessage(entity, entity, TRUE, TRUE); + if (entityInfo->sleepClassStatus.status != 0) { + sub_80838EC(&entityInfo->sleepClassStatus.turns); + if (entityInfo->sleepClassStatus.turns == 0) { + EndSleepClassStatus(entity, entity, TRUE, TRUE); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->nonVolatile.nonVolatileStatus != 0) { - sub_80838EC(&entityInfo->nonVolatile.nonVolatileStatusTurns); - if (entityInfo->nonVolatile.nonVolatileStatusTurns == 0) { - SendNonVolatileEndMessage(entity, entity); + if (entityInfo->burnClassStatus.status != 0) { + sub_80838EC(&entityInfo->burnClassStatus.turns); + if (entityInfo->burnClassStatus.turns == 0) { + EndBurnClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->immobilize.immobilizeStatus != 0) { - sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns); - if (entityInfo->immobilize.immobilizeStatusTurns == 0) { + if (entityInfo->frozenClassStatus.status != 0) { + sub_80838EC(&entityInfo->frozenClassStatus.turns); + if (entityInfo->frozenClassStatus.turns == 0) { EndFrozenClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->volatileStatus.volatileStatus != 0) { - sub_80838EC(&entityInfo->volatileStatus.volatileStatusTurns); - if (entityInfo->volatileStatus.volatileStatusTurns == 0) { - SendVolatileEndMessage(entity, entity); + if (entityInfo->cringeClassStatus.status != 0) { + sub_80838EC(&entityInfo->cringeClassStatus.turns); + if (entityInfo->cringeClassStatus.turns == 0) { + EndCringeClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->protection.protectionStatus != 0) { - sub_80838EC(&entityInfo->protection.protectionStatusTurns); - if (entityInfo->protection.protectionStatusTurns == 0) { - SendProtectionEndMessage(entity, entity); + if (entityInfo->reflectClassStatus.status != 0) { + sub_80838EC(&entityInfo->reflectClassStatus.turns); + if (entityInfo->reflectClassStatus.turns == 0) { + EndReflectClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->waitingStruct.waitingStatus != 0) { - sub_80838EC(&entityInfo->waitingStruct.waitingStatusTurns); - if (entityInfo->waitingStruct.waitingStatusTurns == 0) { - SendWaitingEndMessage(entity, entity, 0); + if (entityInfo->curseClassStatus.status != 0) { + sub_80838EC(&entityInfo->curseClassStatus.turns); + if (entityInfo->curseClassStatus.turns == 0) { + EndCurseClassStatus(entity, entity, 0); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->linked.linkedStatus != 0) { - sub_80838EC(&entityInfo->linked.linkedStatusTurns); - if (entityInfo->linked.linkedStatusTurns == 0) { - SendLinkedEndMessage(entity, entity); + if (entityInfo->linked.status != 0) { + sub_80838EC(&entityInfo->linked.turns); + if (entityInfo->linked.turns == 0) { + EndLeechSeedClassStatus(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->moveStatus.moveStatus != 0) { - sub_80838EC(&entityInfo->moveStatus.moveStatusTurns); - if (entityInfo->moveStatus.moveStatusTurns == 0) { + if (entityInfo->sureShotClassStatus.status != 0) { + sub_80838EC(&entityInfo->sureShotClassStatus.turns); + if (entityInfo->sureShotClassStatus.turns == 0) { SendMoveEndMessage(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->transformStatus.transformStatus != 0) { - sub_80838EC(&entityInfo->transformStatus.transformStatusTurns); - if (entityInfo->transformStatus.transformStatusTurns == 0) { + if (entityInfo->invisibleClassStatus.status != 0) { + sub_80838EC(&entityInfo->invisibleClassStatus.turns); + if (entityInfo->invisibleClassStatus.turns == 0) { SendTransformEndMessage(entity, entity); } } if (!EntityExists(entity) || sub_8044B28()) return; - if (entityInfo->eyesightStatus.eyesightStatus != 0) { - sub_80838EC(&entityInfo->eyesightStatus.eyesightStatusTurns); - if (entityInfo->eyesightStatus.eyesightStatusTurns == 0) { + if (entityInfo->blinkerClassStatus.status != 0) { + sub_80838EC(&entityInfo->blinkerClassStatus.turns); + if (entityInfo->blinkerClassStatus.turns == 0) { SendEyesightEndMessage(entity, entity); } } @@ -756,8 +756,8 @@ void TickStatusHeal(Entity *entity) return; if (entityInfo->muzzled.muzzled != 0) { - sub_80838EC(&entityInfo->muzzled.muzzledTurns); - if (entityInfo->muzzled.muzzledTurns == 0) { + sub_80838EC(&entityInfo->muzzled.turns); + if (entityInfo->muzzled.turns == 0) { SendMuzzledEndMessage(entity, entity); } } @@ -893,7 +893,7 @@ bool8 UseAttack(Entity *a0) gUnknown_202F378 = 1; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); if (monInfo->numMoveTiles == 0) { @@ -935,7 +935,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { sub_803E46C(7); for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; @@ -963,7 +963,7 @@ bool8 UseAttack(Entity *a0) } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *mon = gDungeon->activeMonsterPtrs[i]; + Entity *mon = gDungeon->activePokemon[i]; if (EntityExists(mon)) { EntityInfo *monInfo = GetEntInfo(mon); monInfo->numMoveTiles = 0; @@ -979,7 +979,7 @@ bool8 UseAttack(Entity *a0) for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { Position monPosBefore; EntityInfo *monInfo; - Entity *mon = gDungeon->activeMonsterPtrs[loop]; + Entity *mon = gDungeon->activePokemon[loop]; if (!EntityExists(mon)) continue; diff --git a/src/code_8075708.c b/src/code_8075708.c index b1aa63c29..1ac3a42d5 100644 --- a/src/code_8075708.c +++ b/src/code_8075708.c @@ -30,7 +30,7 @@ void sub_8075680(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) { targetPos = &(info->targetPos); @@ -67,7 +67,7 @@ void sub_8075708(Entity *entity) return; } tile = GetTileAtEntitySafe(entity); - if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->transformStatus.transformStatus != STATUS_MOBILE)) && + if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && (!HasHeldItem(entity, ITEM_MOBILE_SCARF))) { sub_804AE84(&entity->pos); } diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 16538c997..4533c5b5f 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -219,7 +219,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); if (entityInfo->muzzled.muzzled != TRUE) { entityInfo->muzzled.muzzled = TRUE; - entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; + entityInfo->muzzled.turns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; nullsub_86(target); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF68); } @@ -247,7 +247,7 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); - if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); @@ -275,8 +275,8 @@ void TransformStatusTarget(Entity * pokemon, Entity * target) else { entityInfo->apparentID = apparentID; target->axObj.spriteFile = sprite; - entityInfo->transformStatus.transformStatus = STATUS_TRANSFORMED; - entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EFC, TRUE) + 1; + entityInfo->invisibleClassStatus.status = STATUS_TRANSFORMED; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EFC, TRUE) + 1; sub_806CF98(target); nullsub_87(target); sub_806CCB4(target, sub_806CEBC(target)); @@ -296,13 +296,13 @@ void MobileStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (entityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) { - entityInfo->transformStatus.transformStatus = STATUS_MOBILE; - entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; + if (entityInfo->invisibleClassStatus.status != STATUS_MOBILE) { + entityInfo->invisibleClassStatus.status = STATUS_MOBILE; + entityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; nullsub_88(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBF28); } @@ -385,9 +385,9 @@ void BlindTarget(Entity *pokemon, Entity *target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { - entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; + if (entityInfo->blinkerClassStatus.status != STATUS_BLINKER) { + entityInfo->blinkerClassStatus.status = STATUS_BLINKER; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; sub_8041E0C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7F4); sub_803E46C(0x31); @@ -412,11 +412,11 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { + if (entityInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { sub_8041E1C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); - entityInfo->eyesightStatus.eyesightStatus = STATUS_CROSS_EYED; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F0C, TRUE) + 1; + entityInfo->blinkerClassStatus.status = STATUS_CROSS_EYED; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F0C, TRUE) + 1; sub_803F580(0x1); sub_8049ED4(); sub_8040A84(); @@ -438,9 +438,9 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { - entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; - entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; + if (entityInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { + entityInfo->blinkerClassStatus.status = STATUS_EYEDROPS; + entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; sub_8041E3C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB880); sub_803E46C(0x31); @@ -623,8 +623,8 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { - entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; + if (entityInfo->longTossClassStatus.status != STATUS_LONG_TOSS) { + entityInfo->longTossClassStatus.status = STATUS_LONG_TOSS; sub_8041EA4(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD20C); } @@ -640,8 +640,8 @@ void PierceStatusTarget(Entity * pokemon, Entity * target) entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0); - if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { - entityInfo->itemStatus.itemStatus = STATUS_PIERCE; + if (entityInfo->longTossClassStatus.status != STATUS_PIERCE) { + entityInfo->longTossClassStatus.status = STATUS_PIERCE; sub_8041EB4(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD254); } @@ -664,18 +664,18 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { + if ((entityInfo->bideClassStatus.status == newStatus) && (newStatus == STATUS_ENRAGED)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); } else { - entityInfo->charging.chargingStatus = newStatus; + entityInfo->bideClassStatus.status = newStatus; for(index = 0; index < MAX_MON_MOVES; index++) { movePtr = &entityInfo->moves.moves[index]; if(movePtr == move) { - entityInfo->charging.chargingStatusMoveIndex = index; + entityInfo->bideClassStatus.moveSlot = index; break; } } @@ -690,11 +690,11 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * entityInfo->unkFF = 2; } if (newStatus == STATUS_BIDE) { - entityInfo->charging.chargingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E9C, FALSE) + 1; + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E9C, FALSE) + 1; entityInfo->unkA0 = 0; } if (newStatus == STATUS_ENRAGED) { - entityInfo->charging.chargingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA0, FALSE) + 1; + entityInfo->bideClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EA0, FALSE) + 1; } sub_8041BD0(target,uVar5); TryDisplayDungeonLoggableMessage3(pokemon,target,message); @@ -723,8 +723,8 @@ void sub_8079764(Entity * pokemon) if (EntityExists(pokemon)) { entityInfo = GetEntInfo(pokemon); - if ((entityInfo->charging.chargingStatus != STATUS_BIDE) && (entityInfo->charging.chargingStatus != STATUS_ENRAGED)) { - entityInfo->charging.chargingStatus = STATUS_NONE; + if ((entityInfo->bideClassStatus.status != STATUS_BIDE) && (entityInfo->bideClassStatus.status != STATUS_ENRAGED)) { + entityInfo->bideClassStatus.status = STATUS_NONE; entityInfo->unk14A = 0; entityInfo->unkFF = 0; } @@ -739,15 +739,15 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus == newStatus) { + if (entityInfo->reflectClassStatus.status == newStatus) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); } else { nullsub_57(target); - if ((entityInfo->protection.protectionStatus != STATUS_COUNTER) && (entityInfo->protection.protectionStatus != STATUS_MINI_COUNTER)) { - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E98, FALSE) + 1; + if ((entityInfo->reflectClassStatus.status != STATUS_COUNTER) && (entityInfo->reflectClassStatus.status != STATUS_MINI_COUNTER)) { + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E98, FALSE) + 1; } - entityInfo->protection.protectionStatus = newStatus; + entityInfo->reflectClassStatus.status = newStatus; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB0E0); EntityUpdateStatusSprites(target); } @@ -761,9 +761,9 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { - entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_SAFEGUARD) { + entityInfo->reflectClassStatus.status = STATUS_SAFEGUARD; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; nullsub_58(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB048); } @@ -781,9 +781,9 @@ void MistStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIST) { - entityInfo->protection.protectionStatus = STATUS_MIST; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIST) { + entityInfo->reflectClassStatus.status = STATUS_MIST; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; nullsub_59(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB09C); } @@ -801,9 +801,9 @@ void WishStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_WISH) { - entityInfo->protection.protectionStatus = STATUS_WISH; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_WISH) { + entityInfo->reflectClassStatus.status = STATUS_WISH; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; sub_8041B34(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE1C); } @@ -821,9 +821,9 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { - entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MAGIC_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MAGIC_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; nullsub_60(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAF5C); } @@ -841,9 +841,9 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { - entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_LIGHT_SCREEN) { + entityInfo->reflectClassStatus.status = STATUS_LIGHT_SCREEN; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; nullsub_61(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB130); } @@ -861,9 +861,9 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { - entityInfo->protection.protectionStatus = STATUS_REFLECT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_REFLECT) { + entityInfo->reflectClassStatus.status = STATUS_REFLECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; nullsub_62(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB17C); } @@ -881,9 +881,9 @@ void ProtectStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { nullsub_63(target); entityInfo = GetEntInfo(target); - if (entityInfo->protection.protectionStatus != STATUS_PROTECT) { - entityInfo->protection.protectionStatus = STATUS_PROTECT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_PROTECT) { + entityInfo->reflectClassStatus.status = STATUS_PROTECT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0); } @@ -902,9 +902,9 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { - entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_COAT) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_COAT; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; nullsub_64(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBAC0); } @@ -922,9 +922,9 @@ void EndureStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { - entityInfo->protection.protectionStatus = STATUS_ENDURING; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_ENDURING) { + entityInfo->reflectClassStatus.status = STATUS_ENDURING; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; nullsub_65(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBF0); } @@ -942,9 +942,9 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { - entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_MIRROR_MOVE) { + entityInfo->reflectClassStatus.status = STATUS_MIRROR_MOVE; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; nullsub_66(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC38); } @@ -967,9 +967,9 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target) else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) { - entityInfo->protection.protectionStatus = STATUS_CONVERSION2; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_CONVERSION2) { + entityInfo->reflectClassStatus.status = STATUS_CONVERSION2; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; nullsub_67(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBC7C); } @@ -988,9 +988,9 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { - entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; - entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; + if (entityInfo->reflectClassStatus.status != STATUS_VITAL_THROW) { + entityInfo->reflectClassStatus.status = STATUS_VITAL_THROW; + entityInfo->reflectClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; nullsub_68(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBCC8); } @@ -1066,15 +1066,15 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4) entityInfo = GetEntInfo(target); if (HasNegativeStatus(target)) { bVar8 = TRUE; - SendSleepEndMessage(pokemon,target,0,0); + EndSleepClassStatus(pokemon,target,0,0); if (!EntityExists(target)) { return; } - SendNonVolatileEndMessage(pokemon,target); + EndBurnClassStatus(pokemon,target); EndFrozenClassStatus(pokemon,target); - SendVolatileEndMessage(pokemon,target); - SendWaitingEndMessage(pokemon,target,0); - SendLinkedEndMessage(pokemon,target); + EndCringeClassStatus(pokemon,target); + EndCurseClassStatus(pokemon,target,0); + EndLeechSeedClassStatus(pokemon,target); SendMoveEndMessage(pokemon,target); SendEyesightEndMessage(pokemon,target); SendMuzzledEndMessage(pokemon,target); @@ -1147,7 +1147,7 @@ void sub_807A0CC(Entity * pokemon, Entity * target) }; } -void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) +void EndSleepClassStatus(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4) { EntityInfo *entityInfo; bool8 isAsleep; @@ -1158,7 +1158,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->sleep.sleep) { + switch(entityInfo->sleepClassStatus.status) { case STATUS_NONE: case 6: break; @@ -1180,26 +1180,26 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 isAsleep = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA710); HealTargetHP(pokemon,target,gUnknown_80F4F7A, 0, FALSE); - entityInfo->sleep.sleep = 0; + entityInfo->sleepClassStatus.status = 0; sub_8079F20(pokemon,target,1,1); break; case STATUS_YAWNING: if (param_3) { - entityInfo->sleep.sleep = STATUS_NONE; + entityInfo->sleepClassStatus.status = STATUS_NONE; sub_8075C58(pokemon,target,CalculateStatusTurns(target, gUnknown_80F4F2C, TRUE) + 1, TRUE); return; } TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA734); break; } - entityInfo->sleep.sleep = STATUS_NONE; + entityInfo->sleepClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isAsleep) { sub_806CE68(target,8); } } -void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) +void EndBurnClassStatus(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; @@ -1208,7 +1208,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->nonVolatile.nonVolatileStatus) { + switch(entityInfo->burnClassStatus.status) { case STATUS_NONE: case 5: break; @@ -1224,7 +1224,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target) break; } - entityInfo->nonVolatile.nonVolatileStatus = STATUS_NONE; + entityInfo->burnClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } @@ -1239,7 +1239,7 @@ void EndFrozenClassStatus(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->immobilize.immobilizeStatus) { + switch(entityInfo->frozenClassStatus.status) { case STATUS_NONE: case 8: break; @@ -1263,14 +1263,14 @@ void EndFrozenClassStatus(Entity * pokemon, Entity *target) TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerPetrifiedMessage); break; } - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; + entityInfo->frozenClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isFrozen) { sub_8042A74(target); } } -void SendVolatileEndMessage(Entity * pokemon, Entity *target) +void EndCringeClassStatus(Entity * pokemon, Entity *target) { EntityInfo *entityInfo; @@ -1279,7 +1279,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->volatileStatus.volatileStatus) { + switch(entityInfo->cringeClassStatus.status) { case STATUS_NONE: case 8: break; @@ -1305,12 +1305,12 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target) TryDisplayDungeonLoggableMessage3(pokemon,target, *gPtrMonNoLongerCringingMessage); break; } - entityInfo->volatileStatus.volatileStatus = STATUS_NONE; + entityInfo->cringeClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); CalcSpeedStage(target); } -void SendProtectionEndMessage(Entity * pokemon, Entity *target) +void EndReflectClassStatus(Entity * pokemon, Entity *target) { EntityInfo *entityInfo; @@ -1319,7 +1319,7 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->protection.protectionStatus) { + switch(entityInfo->reflectClassStatus.status) { case STATUS_NONE: case 0xF: break; @@ -1364,11 +1364,11 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40); break; } - entityInfo->protection.protectionStatus = STATUS_NONE; + entityInfo->reflectClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } -void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) +void EndCurseClassStatus(Entity * pokemon, Entity * target, u8 curseClassStatus) { u32 uVar3; EntityInfo *entityInfo; @@ -1376,46 +1376,46 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->waitingStruct.waitingStatus) { + switch(entityInfo->curseClassStatus.status) { case STATUS_NONE: case 4: break; case STATUS_CURSED: - if (waitingStatus != STATUS_CURSED) { + if (curseClassStatus != STATUS_CURSED) { LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC); } break; case STATUS_SNATCH: - if (waitingStatus != STATUS_SNATCH) { + if (curseClassStatus != STATUS_SNATCH) { LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC); } gDungeon->snatchPokemon = NULL; gDungeon->unk17B3C = 0; break; case STATUS_DECOY: - entityInfo->waitingStruct.waitingStatus = STATUS_NONE; + entityInfo->curseClassStatus.status = STATUS_NONE; uVar3 = sub_806CEBC(target); sub_806CCB4(target,uVar3); gDungeon->decoyIsActive = FALSE; - if (waitingStatus != STATUS_DECOY) { + if (curseClassStatus != STATUS_DECOY) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0); } break; } - entityInfo->waitingStruct.waitingStatus = STATUS_NONE; + entityInfo->curseClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } } -void SendLinkedEndMessage(Entity * pokemon, Entity * target) +void EndLeechSeedClassStatus(Entity * pokemon, Entity * target) { EntityInfo *entityInfo; if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->linked.linkedStatus) + switch(entityInfo->linked.status) { case STATUS_NONE: break; @@ -1426,7 +1426,7 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C); break; } - entityInfo->linked.linkedStatus = STATUS_NONE; + entityInfo->linked.status = STATUS_NONE; entityInfo->linked.unkD8 = 0xff; EntityUpdateStatusSprites(target); } @@ -1441,7 +1441,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->moveStatus.moveStatus) { + switch(entityInfo->sureShotClassStatus.status) { case STATUS_NONE: case 5: break; @@ -1458,7 +1458,7 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C); break; } - entityInfo->moveStatus.moveStatus = STATUS_NONE; + entityInfo->sureShotClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); } @@ -1474,7 +1474,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->transformStatus.transformStatus) { + switch(entityInfo->invisibleClassStatus.status) { case STATUS_NONE: case 4: break; @@ -1493,7 +1493,7 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C); break; } - entityInfo->transformStatus.transformStatus = STATUS_NONE; + entityInfo->invisibleClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (isInvisible) { sub_807EC28(TRUE); @@ -1509,7 +1509,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) } entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - switch(entityInfo->eyesightStatus.eyesightStatus) { + switch(entityInfo->blinkerClassStatus.status) { case STATUS_NONE: case 4: break; @@ -1523,7 +1523,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48); break; } - entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; + entityInfo->blinkerClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (entityInfo->isTeamLeader) { sub_803E46C(0x31); @@ -1558,12 +1558,12 @@ bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target) EntityInfo *entityInfo = GetEntInfo(target); bool32 msg = FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { + if (entityInfo->frozenClassStatus.status == STATUS_PETRIFIED) { EndFrozenClassStatus(pokemon, target); msg = TRUE; } - if (entityInfo->sleep.sleep == STATUS_SLEEP && entityInfo->sleep.sleepTurns == 0x7f) { - SendSleepEndMessage(pokemon,target, FALSE, TRUE); + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP && entityInfo->sleepClassStatus.turns == 0x7f) { + EndSleepClassStatus(pokemon,target, FALSE, TRUE); msg = TRUE; } return msg; @@ -1574,8 +1574,8 @@ void WakeUpPokemon(Entity * pokemon) EntityInfo *entityInfo; entityInfo = GetEntInfo(pokemon); - entityInfo->sleep.sleep = STATUS_NONE; - entityInfo->sleep.sleepTurns = 0; + entityInfo->sleepClassStatus.status = STATUS_NONE; + entityInfo->sleepClassStatus.turns = 0; sub_806A898(pokemon, 1, 1); EntityUpdateStatusSprites(pokemon); } @@ -1586,10 +1586,10 @@ void SendThawedMessage(Entity *pokemon, Entity *target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; - entityInfo->immobilize.immobilizeStatusTurns = 0; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status == STATUS_FROZEN) { + entityInfo->frozenClassStatus.status = STATUS_NONE; + entityInfo->frozenClassStatus.turns = 0; + entityInfo->frozenClassStatus.damageCountdown = 0; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out! EntityUpdateStatusSprites(target); @@ -1614,8 +1614,8 @@ void sub_807AA30(void) { wildEntity = gDungeon->wildPokemon[wildIndex]; if (EntityExists(wildEntity) && - (entityInfo = GetEntInfo(wildEntity), entityInfo->sleep.sleep == STATUS_SLEEP) && - (entityInfo->sleep.sleepTurns == 0x7F)) { + (entityInfo = GetEntInfo(wildEntity), entityInfo->sleepClassStatus.status == STATUS_SLEEP) && + (entityInfo->sleepClassStatus.turns == 0x7F)) { adjacentCheck = FALSE; forceWakeup = FALSE; room = GetEntityRoom(wildEntity); diff --git a/src/code_8083288.c b/src/code_8083288.c index 25277b261..5bfdfa0dd 100644 --- a/src/code_8083288.c +++ b/src/code_8083288.c @@ -29,7 +29,7 @@ void sub_8082B40(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { info = GetEntInfo(entity); entity->axObj.spriteFile = GetSpriteData(info->apparentID); @@ -158,69 +158,69 @@ void sub_8082D28(unkStruct_8094924 *param_1, u8 *param_2) sub_8082FE0(param_1, param_2, 3); } -void sub_8082D34(unkStruct_8094924 *param_1, Sleep *sleep) +void sub_8082D34(unkStruct_8094924 *param_1, SleepClassStatus *sleepClassStatus) { - sub_8082FE0(param_1, &sleep->sleep, 1); - sleep->sleepTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &sleepClassStatus->status, 1); + sleepClassStatus->turns = sub_8083188(param_1); } -void sub_8082D50(unkStruct_8094924 *param_1, NonVolatile *nonvoltaile) +void sub_8082D50(unkStruct_8094924 *param_1, BurnClassStatus *burnClassStatus) { - sub_8082FE0(param_1, &nonvoltaile->nonVolatileStatus, 1); - nonvoltaile->nonVolatileStatusTurns = sub_8083188(param_1); - nonvoltaile->nonVolatileStatusDamageCountdown = sub_8083188(param_1); - nonvoltaile->unk4 = sub_8083188(param_1); + sub_8082FE0(param_1, &burnClassStatus->status, 1); + burnClassStatus->turns = sub_8083188(param_1); + burnClassStatus->damageCountdown = sub_8083188(param_1); + burnClassStatus->unk4 = sub_8083188(param_1); } -void sub_8082D7C(unkStruct_8094924 *param_1, Immobilize *immobilze) +void sub_8082D7C(unkStruct_8094924 *param_1, FrozenClassStatus *frozenClassStatus) { - sub_8082FE0(param_1, &immobilze->immobilizeStatus, 1); - immobilze->immobilizeStatusTurns = sub_8083188(param_1); - immobilze->immobilizeStatusDamageCountdown = sub_8083188(param_1); - immobilze->unk4 = sub_80831A0(param_1); + sub_8082FE0(param_1, &frozenClassStatus->status, 1); + frozenClassStatus->turns = sub_8083188(param_1); + frozenClassStatus->damageCountdown = sub_8083188(param_1); + frozenClassStatus->unk4 = sub_80831A0(param_1); } -void sub_8082DA8(unkStruct_8094924 *param_1, Volatile *volatileStatus) +void sub_8082DA8(unkStruct_8094924 *param_1, CringeClassStatus *cringeClassStatus) { - sub_8082FE0(param_1, &volatileStatus->volatileStatus, 1); - volatileStatus->volatileStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &cringeClassStatus->status, 1); + cringeClassStatus->turns = sub_8083188(param_1); } -void sub_8082DC4(unkStruct_8094924 *param_1, Charging *charging) +void sub_8082DC4(unkStruct_8094924 *param_1, BideClassStatus *bideClassStatus) { - sub_8082FE0(param_1, &charging->chargingStatus, 1); - charging->chargingStatusTurns = sub_8083188(param_1); - charging->chargingStatusMoveIndex = sub_8083188(param_1); + sub_8082FE0(param_1, &bideClassStatus->status, 1); + bideClassStatus->turns = sub_8083188(param_1); + bideClassStatus->moveSlot = sub_8083188(param_1); } -void sub_8082DE8(unkStruct_8094924 *param_1, Protection *protect) +void sub_8082DE8(unkStruct_8094924 *param_1, ReflectClassStatus *reflectClassStatus) { - sub_8082FE0(param_1, &protect->protectionStatus, 1); - protect->protectionStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &reflectClassStatus->status, 1); + reflectClassStatus->turns = sub_8083188(param_1); } -void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting) +void sub_8082E04(unkStruct_8094924 *param_1, CurseClassStatus *curseClassStatus) { - sub_8082FE0(param_1, &waiting->waitingStatus, 1); - waiting->decoyApplierNonTeamMemberFlag = sub_80831DC(param_1); - waiting->unkCA = sub_80831DC(param_1); - waiting->waitingStatusTurns = sub_8083188(param_1); - waiting->curseDamageCountdown = sub_8083188(param_1); + sub_8082FE0(param_1, &curseClassStatus->status, 1); + curseClassStatus->applierNonTeamMemberFlag = sub_80831DC(param_1); + curseClassStatus->unk2 = sub_80831DC(param_1); + curseClassStatus->turns = sub_8083188(param_1); + curseClassStatus->damageCountdown = sub_8083188(param_1); } -void sub_8082E38(unkStruct_8094924 *param_1, Linked *linked) +void sub_8082E38(unkStruct_8094924 *param_1, LeechSeedClassStatus *leechSeedClassStatus) { - sub_8082FE0(param_1, &linked->linkedStatus, 1); - linked->unkD4 = sub_80831A0(param_1); - linked->unkD8 = sub_8083188(param_1); - linked->linkedStatusTurns = sub_8083188(param_1); - linked->linkedStatusDamageCountdown = sub_8083188(param_1); + sub_8082FE0(param_1, &leechSeedClassStatus->status, 1); + leechSeedClassStatus->unkD4 = sub_80831A0(param_1); + leechSeedClassStatus->unkD8 = sub_8083188(param_1); + leechSeedClassStatus->turns = sub_8083188(param_1); + leechSeedClassStatus->damageCountdown = sub_8083188(param_1); } -void sub_8082E6C(unkStruct_8094924 *param_1, MoveStatus *moveStatus) +void sub_8082E6C(unkStruct_8094924 *param_1, SureShotClassStatus *sureShotClassStatus) { - sub_8082FE0(param_1, &moveStatus->moveStatus, 1); - moveStatus->moveStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &sureShotClassStatus->status, 1); + sureShotClassStatus->turns = sub_8083188(param_1); } void sub_8082E88(unkStruct_8094924 *param_1, u8 *param_2, s32 size) @@ -228,22 +228,22 @@ void sub_8082E88(unkStruct_8094924 *param_1, u8 *param_2, s32 size) sub_8082FE0(param_1, param_2, 1); } -void sub_8082E94(unkStruct_8094924 *param_1, TransformStatus *transform) +void sub_8082E94(unkStruct_8094924 *param_1, InvisibleClassStatus *invisibleClassStatus) { - sub_8082FE0(param_1, &transform->transformStatus, 1); - transform->transformStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &invisibleClassStatus->status, 1); + invisibleClassStatus->turns = sub_8083188(param_1); } -void sub_8082EB0(unkStruct_8094924 *param_1, EyesightStatus *eyesight) +void sub_8082EB0(unkStruct_8094924 *param_1, BlinkerClassStatus *blinkerClassStatus) { - sub_8082FE0(param_1, &eyesight->eyesightStatus, 1); - eyesight->eyesightStatusTurns = sub_8083188(param_1); + sub_8082FE0(param_1, &blinkerClassStatus->status, 1); + blinkerClassStatus->turns = sub_8083188(param_1); } void sub_8082ECC(unkStruct_8094924 *param_1, Muzzled *muzzle) { sub_8082FE0(param_1, (u8 *)&muzzle->muzzled, 1); - muzzle->muzzledTurns = sub_8083188(param_1); + muzzle->turns = sub_8083188(param_1); } void RestoreDungeonPokemonMove(unkStruct_8094924 *param_1, Move *move) diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 7a4a7d439..1d5debc7a 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -118,7 +118,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); entityInfo->attacking = FALSE; @@ -153,7 +153,7 @@ void sub_8044AB4(void) if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (EntityExists(gDungeon->activeMonsterPtrs[index])) { + if (EntityExists(gDungeon->activePokemon[index])) { UseAttack(0); break; } diff --git a/src/dungeon_ai.c b/src/dungeon_ai.c index 80684cf92..aed414a2b 100644 --- a/src/dungeon_ai.c +++ b/src/dungeon_ai.c @@ -74,7 +74,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) EntityInfo *pokemonInfo = GetEntInfo(pokemon); if (pokemonInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY) { - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) { EndFrozenClassStatus(pokemon, pokemon); } @@ -107,14 +107,14 @@ void RunMonsterAI(Entity *pokemon, u32 unused) Entity *target; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - target = gDungeon->activeMonsterPtrs[i]; + target = gDungeon->activePokemon[i]; if (EntityExists(target) && - GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY && + GetEntInfo(target)->curseClassStatus.status == STATUS_DECOY && CanSeeTarget(pokemon, target)) { - bool8 decoyApplierNonTeamMemberFlag = GetEntInfo(target)->waitingStruct.decoyApplierNonTeamMemberFlag; + bool8 applierNonTeamMemberFlag = GetEntInfo(target)->curseClassStatus.applierNonTeamMemberFlag; u8 decoyAITracker = DECOY_AI_TEAM; - if (decoyApplierNonTeamMemberFlag) + if (applierNonTeamMemberFlag) { decoyAITracker = DECOY_AI_WILD; } @@ -143,7 +143,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) { return; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); } @@ -158,7 +158,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused) } else { - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); } diff --git a/src/dungeon_ai_attack.c b/src/dungeon_ai_attack.c index 5fc15e1f1..d56aeb209 100644 --- a/src/dungeon_ai_attack.c +++ b/src/dungeon_ai_attack.c @@ -84,17 +84,17 @@ void ChooseAIMove(Entity *pokemon) if (CannotAttack(pokemon, FALSE) || ShouldMonsterRunAwayAndShowEffect(pokemon, TRUE) || HasTactic(pokemon, TACTIC_KEEP_YOUR_DISTANCE) || - (pokemonInfo->volatileStatus.volatileStatus == STATUS_CONFUSED && DungeonRandOutcome(gConfusedAttackChance))) + (pokemonInfo->cringeClassStatus.status == STATUS_CONFUSED && DungeonRandOutcome(gConfusedAttackChance))) { return; } - if (pokemonInfo->charging.chargingStatus != STATUS_NONE) + if (pokemonInfo->bideClassStatus.status != STATUS_NONE) { for (i = 0; i < MAX_MON_MOVES; i++) { if (pokemonInfo->moves.moves[i].moveFlags & MOVE_FLAG_EXISTS && - MoveMatchesChargingStatus(pokemon, &pokemonInfo->moves.moves[i]) && - pokemonInfo->charging.chargingStatusMoveIndex == i) + MoveMatchesBideClassStatus(pokemon, &pokemonInfo->moves.moves[i]) && + pokemonInfo->bideClassStatus.moveSlot == i) { s32 chosenMoveIndex; SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_AI); @@ -206,7 +206,7 @@ void ChooseAIMove(Entity *pokemon) move->moveFlags & MOVE_FLAG_ENABLED_FOR_AI) { aiPossibleMove[i].canBeUsed = TRUE; - if (pokemonInfo->charging.chargingStatus == chargeStatus) + if (pokemonInfo->bideClassStatus.status == chargeStatus) { if (move->id == MOVE_CHARGE) { @@ -235,10 +235,10 @@ void ChooseAIMove(Entity *pokemon) } } aiPossibleMove[REGULAR_ATTACK_INDEX].weight = 0; - if (!IQSkillIsEnabled(pokemon, IQ_EXCLUSIVE_MOVE_USER) && pokemonInfo->charging.chargingStatus != chargeStatus) + if (!IQSkillIsEnabled(pokemon, IQ_EXCLUSIVE_MOVE_USER) && pokemonInfo->bideClassStatus.status != chargeStatus) { aiPossibleMove[REGULAR_ATTACK_INDEX].canBeUsed = TRUE; - if (pokemonInfo->charging.chargingStatus == chargeStatus) + if (pokemonInfo->bideClassStatus.status == chargeStatus) { // Never reached? Charge already skips the regular attack in the outer block. aiPossibleMove[REGULAR_ATTACK_INDEX].weight = 1; @@ -370,7 +370,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move targetingFlags = GetMoveTargetAndRangeForPokemon(pokemon, move, TRUE); hasStatusChecker = IQSkillIsEnabled(pokemon, IQ_STATUS_CHECKER); aiPossibleMove->canBeUsed = FALSE; - if ((pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) || + if ((pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) || (hasStatusChecker && !CanUseOnSelfWithStatusChecker(pokemon, move))) { return 1; @@ -380,7 +380,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move rangeTargetingFlags == TARGETING_FLAG_TARGET_FRONTAL_CONE || rangeTargetingFlags == TARGETING_FLAG_TARGET_AROUND) { - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER) { u8 direction = pokemonInfo->action.direction; i = direction; // Fixes a regswap. @@ -422,7 +422,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target) && CanSeeTarget(pokemon, target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -467,7 +467,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target) && pokemon != target) { s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos); @@ -491,7 +491,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *target = gDungeon->activeMonsterPtrs[i]; + Entity *target = gDungeon->activePokemon[i]; if (EntityExists(target)) { numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); @@ -805,7 +805,7 @@ bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified) EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 numPotentialTargets = 0; s32 direction = pokemonInfo->action.direction; - s32 faceTurnLimit = pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER ? 1 : 8; + s32 faceTurnLimit = pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER ? 1 : 8; s32 i; s32 potentialAttackTargetDirections[NUM_DIRECTIONS]; s32 potentialAttackTargetWeights[NUM_DIRECTIONS]; @@ -821,7 +821,7 @@ bool8 TargetRegularAttack(Entity *pokemon, u32 *targetDir, bool8 checkPetrified) GetEntityType(target) == ENTITY_MONSTER && CanAttackInDirection(pokemon, direction) && GetTreatmentBetweenMonsters(pokemon, target, FALSE, checkPetrified) == TREATMENT_TREAT_AS_ENEMY && - (!hasStatusChecker || GetEntInfo(target)->immobilize.immobilizeStatus != STATUS_FROZEN)) + (!hasStatusChecker || GetEntInfo(target)->frozenClassStatus.status != STATUS_FROZEN)) { potentialAttackTargetDirections[numPotentialTargets] = direction; potentialAttackTargetWeights[numPotentialTargets] = WeightMove(pokemon, TARGETING_FLAG_TARGET_OTHER, target, TYPE_NONE); @@ -1013,19 +1013,19 @@ void HandleUseOrbAction(Entity *pokemon) } } - if (entityInfo->volatileStatus.volatileStatus == 1) { + if (entityInfo->cringeClassStatus.status == 1) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC714); r4 = FALSE; r8 = FALSE; } - else if (entityInfo->volatileStatus.volatileStatus == 7) { + else if (entityInfo->cringeClassStatus.status == 7) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC718); r4 = FALSE; r8 = FALSE; } - else if (entityInfo->nonVolatile.nonVolatileStatus == 4) + else if (entityInfo->burnClassStatus.status == 4) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC6A8); diff --git a/src/dungeon_ai_item_weight.c b/src/dungeon_ai_item_weight.c index 7c2a404fe..5ee42ce9f 100644 --- a/src/dungeon_ai_item_weight.c +++ b/src/dungeon_ai_item_weight.c @@ -202,7 +202,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_ALLURE_SEED: - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) + if (pokemonInfo->blinkerClassStatus.status != STATUS_CROSS_EYED) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -219,7 +219,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_CHERI_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) + if (pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS) { return 0; } @@ -233,7 +233,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_TOTTER_SEED: - if (pokemonInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) + if (pokemonInfo->cringeClassStatus.status != STATUS_CONFUSED) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -250,8 +250,8 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_PECHA_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED && - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if (pokemonInfo->burnClassStatus.status != STATUS_POISONED && + pokemonInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { return 0; } @@ -265,7 +265,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_BLINKER_SEED: - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status != STATUS_BLINKER) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -316,9 +316,9 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla itemWeight = 40; break; case ITEM_SLEEP_SEED: - if (pokemonInfo->sleep.sleep != STATUS_SLEEP && - pokemonInfo->sleep.sleep != STATUS_NAPPING && - pokemonInfo->sleep.sleep != STATUS_NIGHTMARE) + if (pokemonInfo->sleepClassStatus.status != STATUS_SLEEP && + pokemonInfo->sleepClassStatus.status != STATUS_NAPPING && + pokemonInfo->sleepClassStatus.status != STATUS_NIGHTMARE) { if (IsAdjacentToEnemy(targetPokemon)) { @@ -335,7 +335,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_CHESTO_BERRY: - if (pokemonInfo->sleep.sleep != STATUS_SLEEPLESS) + if (pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { itemWeight = 5; } @@ -358,7 +358,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla itemWeight = 80; break; case ITEM_RAWST_BERRY: - if (pokemonInfo->nonVolatile.nonVolatileStatus == STATUS_BURN) + if (pokemonInfo->burnClassStatus.status == STATUS_BURN) { return 50; } @@ -388,7 +388,7 @@ u32 GetAIUseItemProbability(Entity *targetPokemon, Item *item, u32 itemTargetFla } break; case ITEM_STUN_SEED: - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) { return 0; } diff --git a/src/dungeon_ai_items.c b/src/dungeon_ai_items.c index 974d90f1a..948b357fc 100644 --- a/src/dungeon_ai_items.c +++ b/src/dungeon_ai_items.c @@ -49,7 +49,7 @@ void sub_807360C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { if(GetEntInfo(entity)->unk152 != 0) @@ -281,7 +281,7 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item * } for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; + Entity *targetPokemon = gDungeon->activePokemon[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon) { s32 targetingFlags; @@ -318,7 +318,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential gAIThrowItemActionChoiceCount = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *targetPokemon = gDungeon->activeMonsterPtrs[i]; + Entity *targetPokemon = gDungeon->activePokemon[i]; if (EntityExists(targetPokemon) && pokemon != targetPokemon && CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) { @@ -366,7 +366,7 @@ void TargetThrownItem(Entity *pokemon, Entity *targetPokemon, Item *item, s32 ta distanceX = distanceX < 0 ? -distanceX : distanceX; distanceY = pokemon->pos.y - targetPokemon->pos.y; distanceY = distanceY < 0 ? -distanceY : distanceY; - if (GetEntInfo(pokemon)->itemStatus.itemStatus == STATUS_NONE) + if (GetEntInfo(pokemon)->longTossClassStatus.status == STATUS_NONE) { s32 distance = distanceY < distanceX ? distanceX : distanceY; if (distance > RANGED_ATTACK_RANGE) diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index 15d34b63c..10024ad29 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -96,7 +96,7 @@ Entity* GetLeaderIfVisible(Entity *pokemon) { Entity *leader = GetLeader(); if (leader && - GetEntInfo(leader)->waitingStruct.waitingStatus != STATUS_DECOY && + GetEntInfo(leader)->curseClassStatus.status != STATUS_DECOY && GetTreatmentBetweenMonsters(pokemon, leader, FALSE, FALSE) == TREATMENT_TREAT_AS_ALLY && CanTargetEntity(pokemon, leader)) { @@ -169,23 +169,23 @@ bool8 sub_8072CF4(Entity *entity) gUnknown_202F222 = 0; switch(info->action.action) { case ACTION_WALK: - if(info->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) + if(info->frozenClassStatus.status == STATUS_SHADOW_HOLD) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_CONSTRICTION) + else if(info->frozenClassStatus.status == STATUS_CONSTRICTION) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_INGRAIN) + else if(info->frozenClassStatus.status == STATUS_INGRAIN) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_WRAP) + else if(info->frozenClassStatus.status == STATUS_WRAP) { goto _282; } - else if(info->immobilize.immobilizeStatus == STATUS_WRAPPED) + else if(info->frozenClassStatus.status == STATUS_WRAPPED) { _282: info->action.action = ACTION_NOTHING; @@ -210,7 +210,7 @@ bool8 sub_8072CF4(Entity *entity) pos.y = entity->pos.y; sub_80694C0(entity,pos1.x,pos1.y,0); sub_8074FB0(entity,(info->action).direction,&pos); - if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->transformStatus.transformStatus != STATUS_MOBILE)) && + if (((IQSkillIsEnabled(entity, IQ_SUPER_MOBILE)) && (info->invisibleClassStatus.status != STATUS_MOBILE)) && (!HasHeldItem(entity,ITEM_MOBILE_SCARF))) { sub_804AE08(&entity->pos); } diff --git a/src/dungeon_ai_movement.c b/src/dungeon_ai_movement.c index c4d14e44b..ea641c4e9 100644 --- a/src/dungeon_ai_movement.c +++ b/src/dungeon_ai_movement.c @@ -150,7 +150,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) s32 i; if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->activeMonsterPtrs; + possibleTargets = gDungeon->activePokemon; maxPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) @@ -178,7 +178,7 @@ bool8 ChooseTargetPosition(Entity *pokemon) continue; } } - else if (!pokemonInfo->isNotTeamMember && GetEntInfo(target)->immobilize.immobilizeStatus == STATUS_PETRIFIED) + else if (!pokemonInfo->isNotTeamMember && GetEntInfo(target)->frozenClassStatus.status == STATUS_PETRIFIED) { continue; } @@ -513,7 +513,7 @@ bool8 AvoidEnemies(Entity *pokemon) s32 i; if (gDungeon->decoyIsActive) { - possibleTargets = gDungeon->activeMonsterPtrs; + possibleTargets = gDungeon->activePokemon; numPossibleTargets = DUNGEON_MAX_POKEMON; } else if (pokemonInfo->isNotTeamMember) diff --git a/src/dungeon_ai_targeting.c b/src/dungeon_ai_targeting.c index 0b2372c0c..2139a487a 100644 --- a/src/dungeon_ai_targeting.c +++ b/src/dungeon_ai_targeting.c @@ -74,7 +74,7 @@ bool8 sub_8070F3C(Entity * pokemon, Position *pos, s32 direction) (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -137,7 +137,7 @@ bool8 sub_8070F80(Entity * pokemon, s32 direction) (((tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -183,7 +183,7 @@ bool8 sub_8071058(Entity * pokemon, s32 direction) (!GetEntInfo(tile->monster)->isNotTeamMember)))) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { terrain = CROSSABLE_TERRAIN_WALL; @@ -230,7 +230,7 @@ bool8 CanAttackInDirection(Entity *pokemon, s32 direction) { if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; @@ -282,7 +282,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon if (frontTile->object != NULL && IQSkillIsEnabled(pokemon, IQ_TRAP_AVOIDER) && GetEntityType(frontTile->object) == ENTITY_TRAP && - (frontTile->object->isVisible || GetEntInfo(pokemon)->eyesightStatus.eyesightStatus == STATUS_EYEDROPS)) + (frontTile->object->isVisible || GetEntInfo(pokemon)->blinkerClassStatus.status == STATUS_EYEDROPS)) { return FALSE; } @@ -294,7 +294,7 @@ bool8 CanAIMonsterMoveInDirection(Entity *pokemon, s32 direction, bool8 *pokemon } if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; @@ -337,7 +337,7 @@ bool8 IsAtJunction(Entity *pokemon) u32 crossableTerrain = GetCrossableTerrain(GetEntInfo(pokemon)->id); if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) { crossableTerrain = CROSSABLE_TERRAIN_WALL; } @@ -477,8 +477,8 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign targetData->monsterBehavior == BEHAVIOR_DIGLETT || pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET || targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET || - (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) || - (!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) + (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->frozenClassStatus.status == STATUS_PETRIFIED) || + (!ignoreInvisible && targetData->invisibleClassStatus.status == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) { return TREATMENT_IGNORE; } @@ -517,7 +517,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign targetIsEnemy = targetData->isNotTeamMember ? TRUE : FALSE; } targetIsDecoy = FALSE; - if (targetData->waitingStruct.waitingStatus == STATUS_DECOY) + if (targetData->curseClassStatus.status == STATUS_DECOY) { targetIsDecoy = TRUE; } diff --git a/src/dungeon_capabilities.c b/src/dungeon_capabilities.c index 8e4a6873c..94985585a 100644 --- a/src/dungeon_capabilities.c +++ b/src/dungeon_capabilities.c @@ -24,13 +24,13 @@ bool8 CheckVariousStatuses2(Entity *pokemon, bool8 checkBlinker) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if ((checkBlinker && pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER)) + if ((checkBlinker && pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER)) return TRUE; - if (pokemonInfo->sleep.sleep == STATUS_SLEEP || pokemonInfo->sleep.sleep == STATUS_NAPPING || pokemonInfo->sleep.sleep == STATUS_NIGHTMARE) + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || pokemonInfo->sleepClassStatus.status == STATUS_NAPPING || pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE) return TRUE; - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_PAUSED || pokemonInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) + if (pokemonInfo->cringeClassStatus.status == STATUS_PAUSED || pokemonInfo->cringeClassStatus.status == STATUS_INFATUATED) return TRUE; - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) return TRUE; if (pokemonInfo->terrifiedTurns != 0) return TRUE; @@ -43,34 +43,34 @@ bool8 sub_8070BC0(Entity* entity) EntityInfo *entityInfo = GetEntInfo(entity); if (IsChargingAnyTwoTurnMove(entity, FALSE) - || entityInfo->sleep.sleep == STATUS_YAWNING - || entityInfo->sleep.sleep == STATUS_NIGHTMARE + || entityInfo->sleepClassStatus.status == STATUS_YAWNING + || entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE || ShouldMonsterRunAway(entity) || entityInfo->muzzled.muzzled == TRUE - || entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED - || entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) + || entityInfo->frozenClassStatus.status == STATUS_PETRIFIED + || entityInfo->frozenClassStatus.status == STATUS_FROZEN) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) return FALSE; - if (entityInfo->sleep.sleep == STATUS_SLEEP) + if (entityInfo->sleepClassStatus.status == STATUS_SLEEP) return FALSE; - if (entityInfo->transformStatus.transformStatus == STATUS_INVISIBLE - || entityInfo->sleep.sleep == STATUS_NAPPING) + if (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE + || entityInfo->sleepClassStatus.status == STATUS_NAPPING) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_CRINGE) + if (entityInfo->cringeClassStatus.status == STATUS_CRINGE) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP) + if (entityInfo->frozenClassStatus.status == STATUS_WRAP) return FALSE; - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED - || entityInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (entityInfo->frozenClassStatus.status == STATUS_WRAPPED + || entityInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) return FALSE; - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) + if (entityInfo->curseClassStatus.status == STATUS_DECOY) return FALSE; - if (entityInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (entityInfo->blinkerClassStatus.status == STATUS_BLINKER) return FALSE; - if (entityInfo->volatileStatus.volatileStatus != STATUS_INFATUATED - && entityInfo->volatileStatus.volatileStatus != STATUS_PAUSED) + if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED + && entityInfo->cringeClassStatus.status != STATUS_PAUSED) return TRUE; return FALSE; @@ -97,11 +97,11 @@ bool8 CheckVariousStatuses(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if ((pokemonInfo->sleep.sleep != STATUS_SLEEPLESS && pokemonInfo->sleep.sleep != STATUS_NONE)) + if ((pokemonInfo->sleepClassStatus.status != STATUS_SLEEPLESS && pokemonInfo->sleepClassStatus.status != STATUS_NONE)) return TRUE; - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_FROZEN || pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) + if (pokemonInfo->frozenClassStatus.status == STATUS_FROZEN || pokemonInfo->frozenClassStatus.status == STATUS_PETRIFIED) return TRUE; - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) return TRUE; return FALSE; @@ -112,17 +112,17 @@ bool8 CannotAttack(Entity *pokemon, bool8 skipSleep) EntityInfo *pokemonInfo = GetEntInfo(pokemon); if ((skipSleep || - pokemonInfo->sleep.sleep == STATUS_SLEEPLESS || - pokemonInfo->sleep.sleep == STATUS_YAWNING || - pokemonInfo->sleep.sleep == STATUS_NONE) && - pokemonInfo->immobilize.immobilizeStatus != STATUS_FROZEN && - pokemonInfo->immobilize.immobilizeStatus != STATUS_WRAP && - pokemonInfo->immobilize.immobilizeStatus != STATUS_WRAPPED && - pokemonInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED && - pokemonInfo->volatileStatus.volatileStatus != STATUS_CRINGE && - pokemonInfo->volatileStatus.volatileStatus != STATUS_PAUSED && - pokemonInfo->volatileStatus.volatileStatus != STATUS_INFATUATED && - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS && + pokemonInfo->sleepClassStatus.status == STATUS_SLEEPLESS || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->sleepClassStatus.status == STATUS_NONE) && + pokemonInfo->frozenClassStatus.status != STATUS_FROZEN && + pokemonInfo->frozenClassStatus.status != STATUS_WRAP && + pokemonInfo->frozenClassStatus.status != STATUS_WRAPPED && + pokemonInfo->frozenClassStatus.status != STATUS_PETRIFIED && + pokemonInfo->cringeClassStatus.status != STATUS_CRINGE && + pokemonInfo->cringeClassStatus.status != STATUS_PAUSED && + pokemonInfo->cringeClassStatus.status != STATUS_INFATUATED && + pokemonInfo->burnClassStatus.status != STATUS_PARALYSIS && !ShouldMonsterRunAway(pokemon)) return FALSE; @@ -140,7 +140,7 @@ bool8 CanMoveInDirection(Entity *pokemon, u32 direction) if (!IsCurrentFixedRoomBossFight()) { - if (GetEntInfo(pokemon)->transformStatus.transformStatus == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) + if (GetEntInfo(pokemon)->invisibleClassStatus.status == STATUS_MOBILE || HasHeldItem(pokemon, ITEM_MOBILE_SCARF)) crossableTerrain = CROSSABLE_TERRAIN_WALL; else if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) crossableTerrain = CROSSABLE_TERRAIN_CREVICE; diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 75c8a423b..50d25d39c 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -182,7 +182,7 @@ static void sub_8044454(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; TickStatusHeal(entity); @@ -210,7 +210,7 @@ void sub_80444F4(Entity *pokemon) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) { if (sub_8044B28()) break; RunMonsterAI(entity, 0); diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 8b4a89317..1d21951bb 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -513,12 +513,12 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move sub_806A1E8(currTarget); TrySendImmobilizeSleepEndMsg(attacker, currTarget); r4 = FALSE; - if (!MoveMatchesChargingStatus(attacker, move)) { + if (!MoveMatchesBideClassStatus(attacker, move)) { r4 = (MoveRequiresCharging(attacker, move->id) != 0); } if (!lightRodRedirect) { - if (targetInfo->protection.protectionStatus == STATUS_MAGIC_COAT) { + if (targetInfo->reflectClassStatus.status == STATUS_MAGIC_COAT) { if (IsReflectedByMagicCoat(moveId) && sub_8055988(attacker, currTarget)) { TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC52C); // The target~27s Magic Coat bounced it back! sub_8041B48(currTarget); @@ -529,7 +529,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move moveRedirected = TRUE; } } - else if (targetInfo->protection.protectionStatus == STATUS_MIRROR_MOVE) { + else if (targetInfo->reflectClassStatus.status == STATUS_MIRROR_MOVE) { s32 target = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); if (moveId != MOVE_REGULAR_ATTACK && moveId != MOVE_PROJECTILE @@ -548,7 +548,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move } } if (!lightRodRedirect) { - if (targetInfo->protection.protectionStatus == STATUS_PROTECT) { + if (targetInfo->reflectClassStatus.status == STATUS_PROTECT) { s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); s32 targetFlagsAnd = targetFlags & 0xF; if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { @@ -1804,17 +1804,17 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 attackerInfo->abilityEffectFlags = 0; attackerInfo->unk159 = 0; - if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { + if (attackerInfo->cringeClassStatus.status == STATUS_CRINGE) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing! return FALSE; } - else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { + else if (attackerInfo->cringeClassStatus.status == STATUS_INFATUATED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated! return FALSE; } - else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + else if (attackerInfo->burnClassStatus.status == STATUS_PARALYSIS) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0); LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed! return FALSE; @@ -1860,7 +1860,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3 if (MoveFlagExists(currMove)) { bool32 moveUsable = TRUE; bool32 var_28 = FALSE; - bool32 statusMoveMatch = MoveMatchesChargingStatus(attacker, currMove); + bool32 statusMoveMatch = MoveMatchesBideClassStatus(attacker, currMove); if (currMove->PP != 0) { if (!statusMoveMatch) { @@ -2068,7 +2068,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, { var_28 = 1; if ((move->id != MOVE_SOLARBEAM || GetApparentWeather(attacker) != WEATHER_SUNNY) && DoesMoveCharge(move->id)) { - if (!MoveMatchesChargingStatus(attacker, move)) { + if (!MoveMatchesBideClassStatus(attacker, move)) { var_28 = 0; } } @@ -2076,7 +2076,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); sub_80928C0(gFormatBuffer_Items[0], move, NULL); - if (MoveMatchesChargingStatus(attacker, move)) { + if (MoveMatchesBideClassStatus(attacker, move)) { msg = gUnknown_80FC72C; // mon loosed move GetEntInfo(attacker)->unkFF = 0; moveUsable = sub_805744C(attacker, move, TRUE); @@ -2171,7 +2171,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, sub_806A1E8(gUnknown_203B438); } - if (GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_CONFUSED && GetEntInfo(attacker)->volatileStatus.volatileStatus != STATUS_COWERING) { + if (GetEntInfo(attacker)->cringeClassStatus.status != STATUS_CONFUSED && GetEntInfo(attacker)->cringeClassStatus.status != STATUS_COWERING) { EntityInfo *entInfo = GetEntInfo(attacker); entInfo->targetPos.x = 0; entInfo->targetPos.y = 0; @@ -2198,7 +2198,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30, if (gUnknown_202F21A != 0) { EndFrozenClassStatus(attacker, attacker); - SendLinkedEndMessage(attacker, attacker); + EndLeechSeedClassStatus(attacker, attacker); } if (gUnknown_202F219 != 0 && EntityExists(attacker)) { @@ -2592,7 +2592,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 break; } - if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesChargingStatus(attacker, move)) { + if (MoveRequiresCharging(attacker, move->id) && !MoveMatchesBideClassStatus(attacker, move)) { var_34 = -1; } else { @@ -2672,9 +2672,9 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 bool8 canHitAnyone = FALSE; s32 targetFlags; EntityInfo *attackerInfo = GetEntInfo(attacker); - if (attackerInfo->volatileStatus.volatileStatus == STATUS_CONFUSED - || attackerInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER - || attackerInfo->volatileStatus.volatileStatus == STATUS_COWERING) + if (attackerInfo->cringeClassStatus.status == STATUS_CONFUSED + || attackerInfo->blinkerClassStatus.status == STATUS_BLINKER + || attackerInfo->cringeClassStatus.status == STATUS_COWERING) { canHitAnyone = TRUE; } @@ -2714,9 +2714,9 @@ static bool8 AccuracyCalc(Entity *attacker, Entity *target, Move *move, s32 accu return TRUE; if (move->id == MOVE_REGULAR_ATTACK && IQSkillIsEnabled(attacker, IQ_SURE_HIT_ATTACKER)) return TRUE; - if (attackerInfo->moveStatus.moveStatus == STATUS_SURE_SHOT) + if (attackerInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) return TRUE; - if (attackerInfo->moveStatus.moveStatus == STATUS_WHIFFER) + if (attackerInfo->sureShotClassStatus.status == STATUS_WHIFFER) return FALSE; if (accuracy > 100) return TRUE; @@ -2786,10 +2786,10 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov s32 targetFlags; s32 targetFlagsAnd; s32 arrId = 0; - bool8 canHitPartner = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED - || GetEntInfo(attacker)->eyesightStatus.eyesightStatus == STATUS_BLINKER - || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); - bool8 canHitSelf = (GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_CONFUSED || GetEntInfo(attacker)->volatileStatus.volatileStatus == STATUS_COWERING); + bool8 canHitPartner = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED + || GetEntInfo(attacker)->blinkerClassStatus.status == STATUS_BLINKER + || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); + bool8 canHitSelf = (GetEntInfo(attacker)->cringeClassStatus.status == STATUS_CONFUSED || GetEntInfo(attacker)->cringeClassStatus.status == STATUS_COWERING); if (IQSkillIsEnabled(attacker, IQ_NONTRAITOR)) { canHitSelf = FALSE; @@ -2797,7 +2797,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov } targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); if ((targetFlags & 0xF) == 4) { - bool32 usable = MoveMatchesChargingStatus(attacker, move); + bool32 usable = MoveMatchesBideClassStatus(attacker, move); if (move->id == MOVE_SOLARBEAM && GetApparentWeather(attacker) == WEATHER_SUNNY) { usable = TRUE; } @@ -2842,7 +2842,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x30) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) { if (dungeonMon == attacker) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); @@ -2880,7 +2880,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov else if (targetFlagsAnd == 0x60) { s32 i; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon)) { arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); } @@ -2962,7 +2962,7 @@ static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_ struct MultiTurnChargeMove { u16 moveID; - u8 chargingStatus; + u8 status; }; const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { @@ -2978,7 +2978,7 @@ const struct MultiTurnChargeMove gMultiTurnChargeMoves[10] = { {MOVE_NOTHING, STATUS_NONE} }; -const u32 gMultiTurnChargingStatuses[10] = { +const u32 gMultiTurnBideClassStatuses[10] = { STATUS_SOLARBEAM, STATUS_SKY_ATTACK, STATUS_RAZOR_WIND, @@ -3010,7 +3010,7 @@ bool8 MoveCausesPaused(Move *move) return FALSE; } -bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) +bool8 MoveMatchesBideClassStatus(Entity *pokemon, Move *move) { if (!EntityExists(pokemon)) { @@ -3027,7 +3027,7 @@ bool8 MoveMatchesChargingStatus(Entity *pokemon, Move *move) return FALSE; } if (move->id == gMultiTurnChargeMoves[i].moveID && - pokemonInfo->charging.chargingStatus == gMultiTurnChargeMoves[i].chargingStatus) + pokemonInfo->bideClassStatus.status == gMultiTurnChargeMoves[i].status) { return TRUE; } @@ -3046,26 +3046,26 @@ bool8 IsChargingAnyTwoTurnMove(Entity *pokemon, bool8 checkCharge) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); int i = 0; - u8 *chargingStatusPointer = &pokemonInfo->charging.chargingStatus; - u8 *chargingStatusPointer2; + u8 *bideClassStatusPointer = &pokemonInfo->bideClassStatus.status; + u8 *bideClassStatusPointer2; u8 chargeStatus = STATUS_CHARGING; for (; i < 100; i++) { - u8 currentStatus = gMultiTurnChargingStatuses[i]; - u8 chargingStatus; + u8 currentStatus = gMultiTurnBideClassStatuses[i]; + u8 bideClassStatus; if (currentStatus == STATUS_NONE) { return FALSE; } - chargingStatus = *chargingStatusPointer; - chargingStatusPointer2 = &pokemonInfo->charging.chargingStatus; - if (chargingStatus == currentStatus) + bideClassStatus = *bideClassStatusPointer; + bideClassStatusPointer2 = &pokemonInfo->bideClassStatus.status; + if (bideClassStatus == currentStatus) { return TRUE; } } - // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnChargingStatuses array. - if (checkCharge && *chargingStatusPointer2 == chargeStatus) + // BUG: This condition is never reached because the for loop terminates by returning FALSE at the end of the gMultiTurnBideClassStatuses array. + if (checkCharge && *bideClassStatusPointer2 == chargeStatus) { return TRUE; } @@ -3081,7 +3081,7 @@ u32 sub_8057144(Entity * pokemon) nMoves = 0; for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { - Entity *dungeonMon = gDungeon->activeMonsterPtrs[i]; + Entity *dungeonMon = gDungeon->activePokemon[i]; if (EntityExists(dungeonMon)) { Move *moves = GetEntInfo(dungeonMon)->moves.moves; for (j = 0; j < MAX_MON_MOVES; j++) @@ -3120,10 +3120,10 @@ bool8 sub_80571F0(Entity * pokemon, Move *move) return TRUE; } else if (entityInfo->unkFF == 2) { - if (entityInfo->charging.chargingStatus == STATUS_DIVING) { + if (entityInfo->bideClassStatus.status == STATUS_DIVING) { if (move->id == MOVE_WHIRLPOOL || move->id == MOVE_SURF) return FALSE; } - else if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + else if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { moveID = move->id; if (moveID == MOVE_EARTHQUAKE || moveID == MOVE_MAGNITUDE) return FALSE; if (moveID == MOVE_NATURE_POWER) { @@ -3227,11 +3227,11 @@ bool8 CanMonsterUseMove(Entity *pokemon, Move *move, bool8 hasPPChecker) { return FALSE; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) + if (pokemonInfo->cringeClassStatus.status == STATUS_TAUNTED && !MoveIgnoresTaunted(move)) { return FALSE; } - if (pokemonInfo->volatileStatus.volatileStatus == STATUS_ENCORE) + if (pokemonInfo->cringeClassStatus.status == STATUS_ENCORE) { if (move->id == MOVE_STRUGGLE) { @@ -3259,8 +3259,8 @@ bool8 sub_805744C(Entity * pokemon, Move *move, bool8 param_3) return FALSE; } if (param_3 != 0) { - if ((entityInfo->volatileStatus.volatileStatus == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; - if (entityInfo->volatileStatus.volatileStatus == STATUS_ENCORE) { + if ((entityInfo->cringeClassStatus.status == STATUS_TAUNTED) && (!MoveIgnoresTaunted(move))) return FALSE; + if (entityInfo->cringeClassStatus.status == STATUS_ENCORE) { if (move->id == MOVE_STRUGGLE) { if((entityInfo->moves.struggleMoveFlags & MOVE_FLAG_LAST_USED) == 0) return FALSE; } diff --git a/src/dungeon_movement.c b/src/dungeon_movement.c index 9a199d3ad..4239a27a1 100644 --- a/src/dungeon_movement.c +++ b/src/dungeon_movement.c @@ -80,7 +80,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (tile->monster == NULL && ((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) { - if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->transformStatus.transformStatus != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { + if ((IsCurrentFixedRoomBossFight()) || ((entityInfo->invisibleClassStatus.status != STATUS_MOBILE && (!HasHeldItem(pokemon, ITEM_MOBILE_SCARF))))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -113,7 +113,7 @@ u8 sub_80703A0(Entity *pokemon, Position *pos) bool8 CanCrossWalls(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->transformStatus.transformStatus == STATUS_MOBILE) + if (pokemonInfo->invisibleClassStatus.status == STATUS_MOBILE) { return TRUE; } @@ -142,7 +142,7 @@ bool8 sub_807049C(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -230,7 +230,7 @@ bool8 sub_80705F0(Entity *pokemon, Position *pos) if (pos->x >= DUNGEON_MAX_SIZE_X || pos->y >= DUNGEON_MAX_SIZE_Y) return TRUE; if (((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0) && (tile->monster == NULL || (GetEntityType(tile->monster) == ENTITY_MONSTER))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -271,7 +271,7 @@ bool8 sub_80706A4(Entity *pokemon, Position *pos) return TRUE; if ((((tile->terrainType & TERRAIN_TYPE_IMPASSABLE_WALL) == 0)) && (tile->monster == NULL || ((GetEntityType(tile->monster) == ENTITY_MONSTER) && (GetEntInfo(tile->monster) == entityInfo)))) { - if (IsCurrentFixedRoomBossFight() || (entityInfo->transformStatus.transformStatus != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { + if (IsCurrentFixedRoomBossFight() || (entityInfo->invisibleClassStatus.status != STATUS_MOBILE && !HasHeldItem(pokemon, ITEM_MOBILE_SCARF))) { crossableTerrain = GetCrossableTerrain(entityInfo->id); tileFlags = tile->terrainType & (TERRAIN_TYPE_NORMAL | TERRAIN_TYPE_SECONDARY); if (IQSkillIsEnabled(pokemon, IQ_ALL_TERRAIN_HIKER)) { @@ -318,7 +318,7 @@ s32 CalcSpeedStage(Entity *pokemon) } } - if (entityInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + if (entityInfo->burnClassStatus.status == STATUS_PARALYSIS) { speed--; } diff --git a/src/dungeon_pokemon_attributes.c b/src/dungeon_pokemon_attributes.c index 814c08b5b..31ce41aa2 100644 --- a/src/dungeon_pokemon_attributes.c +++ b/src/dungeon_pokemon_attributes.c @@ -26,7 +26,7 @@ extern bool8 sub_805744C(Entity *, Move *, u32); bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage) { - if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_SAFEGUARD) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); @@ -38,7 +38,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage) { - if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) { + if (GetEntInfo(target)->reflectClassStatus.status == STATUS_MIST) { if (displayMessage) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); @@ -63,7 +63,7 @@ bool8 sub_80717A4(Entity *pokemon, u16 moveID) s32 index; entityInfo = GetEntInfo(pokemon); - if ((entityInfo->sleep.sleep != STATUS_SLEEP) && (entityInfo->sleep.sleep != STATUS_NAPPING) && (entityInfo->sleep.sleep != STATUS_NIGHTMARE)) { + if ((entityInfo->sleepClassStatus.status != STATUS_SLEEP) && (entityInfo->sleepClassStatus.status != STATUS_NAPPING) && (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE)) { return FALSE; } else @@ -126,7 +126,7 @@ bool8 MonsterIsType(Entity *pokemon, u8 type) bool8 CanSeeInvisibleMonsters(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); - if (pokemonInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) + if (pokemonInfo->blinkerClassStatus.status != STATUS_EYEDROPS) { if (!HasHeldItem(pokemon, ITEM_GOGGLE_SPECS)) return FALSE; diff --git a/src/dungeon_util.c b/src/dungeon_util.c index 2999379a1..350206f98 100644 --- a/src/dungeon_util.c +++ b/src/dungeon_util.c @@ -103,7 +103,7 @@ void sub_804513C(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - gDungeon->activeMonsterPtrs[index] = NULL; + gDungeon->activePokemon[index] = NULL; } for (index = 0; index < DUNGEON_MAX_ITEMS; index++) @@ -132,7 +132,7 @@ void sub_804522C(void) { { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if(EntityExists(entity)) { if(entity == gDungeon->unk181e8.cameraTarget) diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index 5398c2c34..eea943e5c 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -157,7 +157,7 @@ Entity *GetEntityFromMonsterBehavior(u8 entityType) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == entityType)) return entity; } return NULL; @@ -219,7 +219,7 @@ void sub_80857B8(void) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) { diff --git a/src/dungeon_visibility.c b/src/dungeon_visibility.c index 40fc29d26..f2c862684 100644 --- a/src/dungeon_visibility.c +++ b/src/dungeon_visibility.c @@ -16,16 +16,16 @@ bool8 CanSeeTarget(Entity *entity, Entity *targetEntity) { if (entity->type == ENTITY_MONSTER) { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } - if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) { return FALSE; } } - else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } @@ -43,16 +43,16 @@ bool8 CanTargetEntity(Entity *entity, Entity *targetEntity) { if (entity->type == ENTITY_MONSTER) { - if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + if (!CanSeeInvisibleMonsters(entity) && GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } - if (GetEntInfo(entity)->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (GetEntInfo(entity)->blinkerClassStatus.status == STATUS_BLINKER) { return FALSE; } } - else if (GetEntInfo(targetEntity)->transformStatus.transformStatus == STATUS_INVISIBLE) + else if (GetEntInfo(targetEntity)->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } diff --git a/src/move_actions.c b/src/move_actions.c index 6d0994dc4..3a77c3491 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -341,7 +341,7 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD14C); // It can only be used on land! } else { - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { HandleDamagingMove(pokemon,target,move,gUnknown_80F4F68,param_4); sub_8079764(pokemon); } @@ -505,8 +505,8 @@ bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 } if (isTormented) { - if(entityInfo->charging.chargingStatus == STATUS_BIDE) { - entityInfo->charging.chargingStatus = STATUS_NONE; + if(entityInfo->bideClassStatus.status == STATUS_BIDE) { + entityInfo->bideClassStatus.status = STATUS_NONE; } } else @@ -590,7 +590,7 @@ bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa u8 chargeStatus; flag = FALSE; - chargeStatus = GetEntInfo(target)->charging.chargingStatus; + chargeStatus = GetEntInfo(target)->bideClassStatus.status; uVar3 = 0x100; if (chargeStatus == STATUS_DIVING) { uVar3 = 0x200; @@ -852,7 +852,7 @@ bool8 sub_8058270(Entity *pokemon, Entity *target, Move *move, u32 param_4) r3 = 1; targetInfo = GetEntInfo(target); - if(targetInfo->charging.chargingStatus == STATUS_FLYING || targetInfo->charging.chargingStatus == STATUS_BOUNCING) + if(targetInfo->bideClassStatus.status == STATUS_FLYING || targetInfo->bideClassStatus.status == STATUS_BOUNCING) r3 = 2; flag = HandleDamagingMove(pokemon,target,move,r3 << 8,param_4) ? TRUE : FALSE; return flag; @@ -880,7 +880,7 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F50,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } @@ -985,7 +985,7 @@ bool8 sub_8058548(Entity *pokemon, Entity *target, Move *move, u32 param_4) u32 r5; r5 = 0x80 << 1; - if((GetEntInfo(pokemon)->nonVolatile.nonVolatileStatus) != STATUS_NONE) + if((GetEntInfo(pokemon)->burnClassStatus.status) != STATUS_NONE) r5 = gUnknown_80F4F6C; flag = HandleDamagingMove(pokemon,target,move,r5,param_4) ? TRUE : FALSE; return flag; @@ -1011,9 +1011,9 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para bool8 flag; flag = FALSE; - if ((GetEntInfo(target)->protection.protectionStatus == STATUS_REFLECT) || (GetEntInfo(target)->protection.protectionStatus == STATUS_LIGHT_SCREEN)) { + if ((GetEntInfo(target)->reflectClassStatus.status == STATUS_REFLECT) || (GetEntInfo(target)->reflectClassStatus.status == STATUS_LIGHT_SCREEN)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD104); // The barrier was shattered - SendProtectionEndMessage(pokemon,target); + EndReflectClassStatus(pokemon,target); flag = TRUE; } @@ -1040,7 +1040,7 @@ bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 p { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F54,param_4) ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1109,9 +1109,9 @@ bool8 sub_80587E8(Entity * pokemon, Entity * target, Move * move, u32 param_4) { bool8 flag; - if (GetEntInfo(target)->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { + if (GetEntInfo(target)->burnClassStatus.status == STATUS_PARALYSIS) { flag = HandleDamagingMove(pokemon,target,move,0x80 << 2,param_4) ? TRUE : FALSE; - SendNonVolatileEndMessage(pokemon, target); + EndBurnClassStatus(pokemon, target); } else { flag = HandleDamagingMove(pokemon,target,move,0x80 << 1,param_4) ? TRUE : FALSE; @@ -1237,7 +1237,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param { bool8 flag = FALSE; - if(MoveMatchesChargingStatus(pokemon, move)) + if(MoveMatchesBideClassStatus(pokemon, move)) { if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F4C, param_4) != 0) { flag = TRUE; @@ -1455,7 +1455,7 @@ bool32 sub_8058F04(Entity *pokemon, Entity *target, Move *move, s32 param_4) iVar3 = 1; gDungeon->unk181e8.unk18200 = 0xc; gDungeon->unk181e8.unk18204 = 0; - if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { iVar3 = 2; } flag = HandleDamagingMove(pokemon,target,move,iVar3 << 8,param_4); @@ -1799,7 +1799,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param s32 movePower; weather = GetApparentWeather(pokemon); - if ((weather == WEATHER_SUNNY) || (MoveMatchesChargingStatus(pokemon,move))) { + if ((weather == WEATHER_SUNNY) || (MoveMatchesBideClassStatus(pokemon,move))) { movePower = gSolarBeamMovePower; if (((weather == WEATHER_SANDSTORM) || (weather == WEATHER_RAIN)) || weather == WEATHER_HAIL) { @@ -1830,7 +1830,7 @@ bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) bool8 flag; flag = FALSE; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F5C,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1855,7 +1855,7 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4 if (IsTileGround(GetTileAtEntitySafe(pokemon))) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD128); } - else if (MoveMatchesChargingStatus(pokemon,move)) { + else if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F64,param_4) != 0 ? TRUE : FALSE; sub_8079764(pokemon); } @@ -1894,7 +1894,7 @@ bool8 sub_8059928(Entity * pokemon,Entity * target,Move * move,u32 param_4) iVar2 = 1; flag = FALSE; - if ((u8)(GetEntInfo(target)->charging.chargingStatus - 7) <= 1){ + if ((u8)(GetEntInfo(target)->bideClassStatus.status - 7) <= 1){ iVar2 = 2; } if (HandleDamagingMove(pokemon,target,move,iVar2 << 8,param_4) != 0) @@ -2188,7 +2188,7 @@ bool8 sub_8059F38(Entity * pokemon,Entity * target,Move * move,u32 param_4) bool8 flag; flag = FALSE; - if (MoveMatchesChargingStatus(pokemon, move)) { + if (MoveMatchesBideClassStatus(pokemon, move)) { if (HandleDamagingMove(pokemon, target, move, gUnknown_80F4F60, param_4) != 0) { flag = TRUE; if (sub_805727C(pokemon, target, gUnknown_80F4DCC) != 0) { @@ -2378,7 +2378,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) u32 uVar2; flag = FALSE; - if (GetEntInfo(target)->charging.chargingStatus == STATUS_DIVING) { + if (GetEntInfo(target)->bideClassStatus.status == STATUS_DIVING) { uVar2 = 0x200; } else diff --git a/src/move_checks.c b/src/move_checks.c index b6138a831..d4f5c6555 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -114,20 +114,20 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_RAGE: - if (pokemonInfo->charging.chargingStatus == STATUS_ENRAGED) + if (pokemonInfo->bideClassStatus.status == STATUS_ENRAGED) { return FALSE; } break; case MOVE_COUNTER: case MOVE_PURSUIT: - if (pokemonInfo->protection.protectionStatus == STATUS_COUNTER) + if (pokemonInfo->reflectClassStatus.status == STATUS_COUNTER) { return FALSE; } break; case MOVE_MIRROR_MOVE: - if (pokemonInfo->protection.protectionStatus == STATUS_MIRROR_MOVE) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIRROR_MOVE) { return FALSE; } @@ -159,7 +159,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) break; case MOVE_BIDE: case MOVE_REVENGE: - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { return FALSE; } @@ -181,7 +181,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } case MOVE_LOCK_ON: case MOVE_MIND_READER: - if (pokemonInfo->moveStatus.moveStatus == STATUS_SURE_SHOT) + if (pokemonInfo->sureShotClassStatus.status == STATUS_SURE_SHOT) { return FALSE; } @@ -193,25 +193,25 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_ENDURE: - if (pokemonInfo->protection.protectionStatus == STATUS_ENDURING) + if (pokemonInfo->reflectClassStatus.status == STATUS_ENDURING) { return FALSE; } break; case MOVE_CHARGE: - if (pokemonInfo->charging.chargingStatus == STATUS_CHARGING) + if (pokemonInfo->bideClassStatus.status == STATUS_CHARGING) { return FALSE; } break; case MOVE_MIST: - if (pokemonInfo->protection.protectionStatus == STATUS_MIST) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIST) { return FALSE; } break; case MOVE_LIGHT_SCREEN: - if (pokemonInfo->protection.protectionStatus == STATUS_LIGHT_SCREEN) + if (pokemonInfo->reflectClassStatus.status == STATUS_LIGHT_SCREEN) { return FALSE; } @@ -223,7 +223,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_INGRAIN: - if (pokemonInfo->immobilize.immobilizeStatus == STATUS_INGRAIN || pokemonInfo->maxHPStat / 2 < pokemonInfo->HP) + if (pokemonInfo->frozenClassStatus.status == STATUS_INGRAIN || pokemonInfo->maxHPStat / 2 < pokemonInfo->HP) { return FALSE; } @@ -242,7 +242,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) break; case MOVE_DOOM_DESIRE: case MOVE_FUTURE_SIGHT: - if (pokemonInfo->moveStatus.moveStatus == STATUS_SET_DAMAGE) + if (pokemonInfo->sureShotClassStatus.status == STATUS_SET_DAMAGE) { return FALSE; } @@ -266,19 +266,19 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_DESTINY_BOND: - if (pokemonInfo->linked.linkedStatus == STATUS_DESTINY_BOND) + if (pokemonInfo->linked.status == STATUS_DESTINY_BOND) { return FALSE; } break; case MOVE_MIRROR_COAT: - if (pokemonInfo->protection.protectionStatus == STATUS_MIRROR_COAT) + if (pokemonInfo->reflectClassStatus.status == STATUS_MIRROR_COAT) { return FALSE; } break; case MOVE_REFLECT: - if (pokemonInfo->protection.protectionStatus == STATUS_REFLECT) + if (pokemonInfo->reflectClassStatus.status == STATUS_REFLECT) { return FALSE; } @@ -290,14 +290,14 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_MAGIC_COAT: - if (pokemonInfo->protection.protectionStatus == STATUS_MAGIC_COAT) + if (pokemonInfo->reflectClassStatus.status == STATUS_MAGIC_COAT) { return FALSE; } break; case MOVE_DETECT: case MOVE_PROTECT: - if (pokemonInfo->protection.protectionStatus == STATUS_PROTECT) + if (pokemonInfo->reflectClassStatus.status == STATUS_PROTECT) { return FALSE; } @@ -321,19 +321,19 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_SAFEGUARD: - if (pokemonInfo->protection.protectionStatus == STATUS_SAFEGUARD) + if (pokemonInfo->reflectClassStatus.status == STATUS_SAFEGUARD) { return FALSE; } break; case MOVE_INVISIFY: - if (pokemonInfo->transformStatus.transformStatus == STATUS_INVISIBLE) + if (pokemonInfo->invisibleClassStatus.status == STATUS_INVISIBLE) { return FALSE; } break; case MOVE_FOCUS_ENERGY: - if (pokemonInfo->moveStatus.moveStatus == STATUS_FOCUS_ENERGY) + if (pokemonInfo->sureShotClassStatus.status == STATUS_FOCUS_ENERGY) { return FALSE; } @@ -432,13 +432,13 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_WISH: - if (pokemonInfo->isNotTeamMember || pokemonInfo->protection.protectionStatus == STATUS_WISH) + if (pokemonInfo->isNotTeamMember || pokemonInfo->reflectClassStatus.status == STATUS_WISH) { return FALSE; } break; case MOVE_TRANSFORM: - if (pokemonInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) + if (pokemonInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { return FALSE; } @@ -461,7 +461,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_SNATCH: - if (pokemonInfo->waitingStruct.waitingStatus == STATUS_SNATCH) + if (pokemonInfo->curseClassStatus.status == STATUS_SNATCH) { return FALSE; } @@ -483,7 +483,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move) } break; case MOVE_CONVERSION_2: - if (pokemonInfo->protection.protectionStatus == STATUS_CONVERSION2) + if (pokemonInfo->reflectClassStatus.status == STATUS_CONVERSION2) { return FALSE; } @@ -546,7 +546,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) EntityInfo *userData = GetEntInfo(user); EntityInfo *targetData = GetEntInfo(target); s32 i; - if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN && MoveCannotHitFrozen(move)) + if (targetData->frozenClassStatus.status == STATUS_FROZEN && MoveCannotHitFrozen(move)) { return FALSE; } @@ -564,7 +564,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_YAWN: - if (targetData->sleep.sleep == STATUS_YAWNING) + if (targetData->sleepClassStatus.status == STATUS_YAWNING) { return FALSE; } @@ -574,7 +574,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_NIGHTMARE: - if (targetData->sleep.sleep == STATUS_NIGHTMARE) + if (targetData->sleepClassStatus.status == STATUS_NIGHTMARE) { return FALSE; } @@ -592,7 +592,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_ENCORE: - if (targetData->volatileStatus.volatileStatus == STATUS_ENCORE) + if (targetData->cringeClassStatus.status == STATUS_ENCORE) { return FALSE; } @@ -646,7 +646,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_SMOKESCREEN: - if (targetData->moveStatus.moveStatus == STATUS_WHIFFER) + if (targetData->sureShotClassStatus.status == STATUS_WHIFFER) { return FALSE; } @@ -659,7 +659,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_WILL_O_WISP: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BURN) + if (targetData->burnClassStatus.status == STATUS_BURN) { return FALSE; } @@ -682,7 +682,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_GLARE: case MOVE_STUN_SPORE: case MOVE_THUNDER_WAVE: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) + if (targetData->burnClassStatus.status == STATUS_PARALYSIS) { return FALSE; } @@ -716,7 +716,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_BLOCK: case MOVE_MEAN_LOOK: case MOVE_SPIDER_WEB: - if (targetData->immobilize.immobilizeStatus == STATUS_SHADOW_HOLD) + if (targetData->frozenClassStatus.status == STATUS_SHADOW_HOLD) { return FALSE; } @@ -741,7 +741,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) break; } case MOVE_UPROAR: - if (targetData->sleep.sleep == STATUS_SLEEPLESS) + if (targetData->sleepClassStatus.status == STATUS_SLEEPLESS) { return FALSE; } @@ -774,7 +774,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_TAUNT: - if (targetData->volatileStatus.volatileStatus == STATUS_TAUNTED) + if (targetData->cringeClassStatus.status == STATUS_TAUNTED) { return FALSE; } @@ -809,7 +809,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_CURSE: if (MonsterIsType(user, TYPE_GHOST)) { - if (targetData->waitingStruct.waitingStatus == STATUS_CURSED) + if (targetData->curseClassStatus.status == STATUS_CURSED) { return FALSE; } @@ -825,7 +825,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) break; case MOVE_IMPRISON: case MOVE_OBSERVER: - if (targetData->volatileStatus.volatileStatus == STATUS_PAUSED) + if (targetData->cringeClassStatus.status == STATUS_PAUSED) { return FALSE; } @@ -837,7 +837,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_LEECH_SEED: - if (targetData->linked.linkedStatus == STATUS_LEECH_SEED) + if (targetData->linked.status == STATUS_LEECH_SEED) { return FALSE; } @@ -856,34 +856,34 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) } break; case MOVE_ATTRACT: - if (targetData->volatileStatus.volatileStatus == STATUS_INFATUATED) + if (targetData->cringeClassStatus.status == STATUS_INFATUATED) { return FALSE; } break; case MOVE_WRAP: - if (targetData->immobilize.immobilizeStatus == STATUS_WRAP) + if (targetData->frozenClassStatus.status == STATUS_WRAP) { return FALSE; } - if (targetData->immobilize.immobilizeStatus == STATUS_WRAPPED) + if (targetData->frozenClassStatus.status == STATUS_WRAPPED) { return FALSE; } break; case MOVE_TOXIC: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) + if (targetData->burnClassStatus.status == STATUS_BADLY_POISONED) { return FALSE; } break; case MOVE_POISON_GAS: case MOVE_POISONPOWDER: - if (targetData->nonVolatile.nonVolatileStatus == STATUS_POISONED) + if (targetData->burnClassStatus.status == STATUS_POISONED) { return FALSE; } - if (targetData->nonVolatile.nonVolatileStatus == STATUS_BADLY_POISONED) + if (targetData->burnClassStatus.status == STATUS_BADLY_POISONED) { return FALSE; } @@ -895,7 +895,7 @@ bool8 CanUseOnTargetWithStatusChecker(Entity *user, Entity *target, Move *move) case MOVE_SWEET_KISS: case MOVE_TEETER_DANCE: case MOVE_TOTTER: - if (targetData->volatileStatus.volatileStatus == STATUS_CONFUSED) + if (targetData->cringeClassStatus.status == STATUS_CONFUSED) { return FALSE; } diff --git a/src/move_effects_target.c b/src/move_effects_target.c index 34a43fb88..ec2624629 100644 --- a/src/move_effects_target.c +++ b/src/move_effects_target.c @@ -151,17 +151,17 @@ void sub_8075BA4(Entity *param_1, u8 param_2) { EntityInfo * entityInfo = GetEntInfo(param_1); - if ((param_2 != 0) && (entityInfo->volatileStatus.volatileStatus == STATUS_COWERING)) { + if ((param_2 != 0) && (entityInfo->cringeClassStatus.status == STATUS_COWERING)) { entityInfo->action.direction = (entityInfo->action.direction + 4) & DIRECTION_MASK; TargetTileInFront(param_1); } - else if (entityInfo->volatileStatus.volatileStatus == STATUS_CONFUSED) { + else if (entityInfo->cringeClassStatus.status == STATUS_CONFUSED) { entityInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); TargetTileInFront(param_1); } } -u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns) +u8 sub_8075BF4(Entity * pokemon, s32 sleepClassStatusTurns) { EntityInfo *entityInfo; u32 uVar4; @@ -174,18 +174,18 @@ u8 sub_8075BF4(Entity * pokemon, s32 sleepTurns) { entityInfo = GetEntInfo(pokemon); - if(entityInfo->sleep.sleep != STATUS_NIGHTMARE && entityInfo->sleep.sleep != STATUS_SLEEP) + if(entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE && entityInfo->sleepClassStatus.status != STATUS_SLEEP) { - entityInfo->sleep.sleep = STATUS_SLEEP; - if ((sleepTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) && - (sleepTurns = sleepTurns / 2, sleepTurns < 1)) { - sleepTurns = 1; + entityInfo->sleepClassStatus.status = STATUS_SLEEP; + if ((sleepClassStatusTurns != 0x7f) && HasAbility(pokemon, ABILITY_EARLY_BIRD) && + (sleepClassStatusTurns = sleepClassStatusTurns / 2, sleepClassStatusTurns < 1)) { + sleepClassStatusTurns = 1; } - entityInfo->sleep.sleepTurns = sleepTurns; + entityInfo->sleepClassStatus.turns = sleepClassStatusTurns; } - else if(entityInfo->sleep.sleep == STATUS_SLEEP) + else if(entityInfo->sleepClassStatus.status == STATUS_SLEEP) uVar4 = 1; - else if(entityInfo->sleep.sleep == STATUS_NIGHTMARE) + else if(entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE) uVar4 = 2; EntityUpdateStatusSprites(pokemon); } @@ -199,7 +199,7 @@ void sub_8075C58(Entity * pokemon, Entity * target, s32 turns, u8 displayMessage if (!CannotSleep(pokemon,target,1,displayMessage)) { - sleep = GetEntInfo(target)->sleep.sleep; + sleep = GetEntInfo(target)->sleepClassStatus.status; if (sleep == STATUS_SLEEPLESS) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB380); @@ -265,19 +265,19 @@ void NightmareStatusTarget(Entity * pokemon, Entity * target, s32 turns) hasNightmare = FALSE; if (!CannotSleep(pokemon, target, 1, TRUE)) { entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { sub_8041EC8(target); - if (entityInfo->sleep.sleep != STATUS_NIGHTMARE) { - entityInfo->sleep.sleepTurns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleep.sleepTurns >>= 1, entityInfo->sleep.sleepTurns == 0)) { - entityInfo->sleep.sleepTurns = 1; + if (entityInfo->sleepClassStatus.status != STATUS_NIGHTMARE) { + entityInfo->sleepClassStatus.turns = turns; + if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + entityInfo->sleepClassStatus.turns = 1; } } else { hasNightmare = TRUE; } - entityInfo->sleep.sleep = STATUS_NIGHTMARE; + entityInfo->sleepClassStatus.status = STATUS_NIGHTMARE; sub_806CE68(target,8); if (hasNightmare) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3CC); @@ -302,19 +302,19 @@ void NappingStatusTarget(Entity * pokemon, Entity * target, s32 turns) isSleeping = FALSE; if (!CannotSleep(pokemon, target, 0, TRUE)) { entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) { + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { sub_8041ED8(target); - if (entityInfo->sleep.sleep == STATUS_NONE || entityInfo->sleep.sleep == STATUS_YAWNING) { - entityInfo->sleep.sleepTurns = turns; - if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleep.sleepTurns >>= 1, entityInfo->sleep.sleepTurns == 0)) { - entityInfo->sleep.sleepTurns = 1; + if (entityInfo->sleepClassStatus.status == STATUS_NONE || entityInfo->sleepClassStatus.status == STATUS_YAWNING) { + entityInfo->sleepClassStatus.turns = turns; + if ((HasAbility(target, ABILITY_EARLY_BIRD)) && (entityInfo->sleepClassStatus.turns >>= 1, entityInfo->sleepClassStatus.turns == 0)) { + entityInfo->sleepClassStatus.turns = 1; } } else { isSleeping = TRUE; } - entityInfo->sleep.sleep = STATUS_NAPPING; + entityInfo->sleepClassStatus.status = STATUS_NAPPING; sub_806CE68(target, 8); if (isSleeping) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB360); @@ -339,21 +339,21 @@ void YawnedStatusTarget(Entity * pokemon, Entity * target, s32 turns) return; } entityInfo = GetEntInfo(target); - if (entityInfo->sleep.sleep == STATUS_NONE) { - entityInfo->sleep.sleep = STATUS_YAWNING; - entityInfo->sleep.sleepTurns = turns; + if (entityInfo->sleepClassStatus.status == STATUS_NONE) { + entityInfo->sleepClassStatus.status = STATUS_YAWNING; + entityInfo->sleepClassStatus.turns = turns; nullsub_91(target); sub_806CE68(target, 8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); } - else if (((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) || (entityInfo->sleep.sleep == STATUS_NAPPING)) { + else if (((entityInfo->sleepClassStatus.status == STATUS_SLEEP) || (entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE)) || (entityInfo->sleepClassStatus.status == STATUS_NAPPING)) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB418); } - else if (entityInfo->sleep.sleep == STATUS_SLEEPLESS) { + else if (entityInfo->sleepClassStatus.status == STATUS_SLEEPLESS) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3F8); } else { - if (entityInfo->sleep.sleep == STATUS_YAWNING) + if (entityInfo->sleepClassStatus.status == STATUS_YAWNING) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB414); else TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB3E0); @@ -372,15 +372,15 @@ void SleeplessStatusTarget(Entity * pokemon, Entity * target) } entityInfo = GetEntInfo(target); - if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) { + if ((entityInfo->sleepClassStatus.status == STATUS_SLEEP) || (entityInfo->sleepClassStatus.status == STATUS_NAPPING) || (entityInfo->sleepClassStatus.status == STATUS_NIGHTMARE)) { isAsleep = TRUE; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); - if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) + if (entityInfo->sleepClassStatus.status != STATUS_SLEEPLESS) { - entityInfo->sleep.sleep = STATUS_SLEEPLESS; - entityInfo->sleep.sleepTurns = CalculateStatusTurns(target, gUnknown_80F4E7C, FALSE) + 1; + entityInfo->sleepClassStatus.status = STATUS_SLEEPLESS; + entityInfo->sleepClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E7C, FALSE) + 1; entityInfo->unk165 = 0xFF; entityInfo->unk164 = 0xFF; sub_8041EE8(target); @@ -408,9 +408,9 @@ void PausedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, s32 turns return; } SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_PAUSED) { - entityInfo->volatileStatus.volatileStatus = STATUS_PAUSED; - entityInfo->volatileStatus.volatileStatusTurns = turns + 1; + if (entityInfo->cringeClassStatus.status != STATUS_PAUSED) { + entityInfo->cringeClassStatus.status = STATUS_PAUSED; + entityInfo->cringeClassStatus.turns = turns + 1; nullsub_72(target); if (turns == 1) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB480); @@ -448,9 +448,9 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa else { SetMessageArgument_2(gFormatBuffer_Monsters[0],entityInfo,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_INFATUATED) { - entityInfo->volatileStatus.volatileStatus = STATUS_INFATUATED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F00,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_INFATUATED) { + entityInfo->cringeClassStatus.status = STATUS_INFATUATED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4F00,TRUE) + 1; sub_8041EF8(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB50C); } @@ -501,11 +501,11 @@ void BurnedStatusTarget(Entity * pokemon, Entity * target, u8 param_3, bool8 dis else { isNotBurned = TRUE; - if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_BURN) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_BURN; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E30,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + if (entityInfo->burnClassStatus.status != STATUS_BURN) { + entityInfo->burnClassStatus.status = STATUS_BURN; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E30,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotBurned = FALSE; if (param_3 != 0) { sub_8041C34(target); @@ -587,14 +587,14 @@ void PoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag { isNotPoisoned = TRUE; - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_POISONED) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_POISONED; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E34,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + entityInfo->burnClassStatus.status = STATUS_POISONED; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E34,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotPoisoned = FALSE; sub_8041C6C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB598); @@ -676,12 +676,12 @@ void BadlyPoisonedStatusTarget(Entity * pokemon, Entity * target, bool8 displayM { isNotBadlyPoisoned = TRUE; - if(entityInfo->nonVolatile.nonVolatileStatus != STATUS_BADLY_POISONED) + if(entityInfo->burnClassStatus.status != STATUS_BADLY_POISONED) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_BADLY_POISONED; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E38,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + entityInfo->burnClassStatus.status = STATUS_BADLY_POISONED; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E38,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; isNotBadlyPoisoned = FALSE; sub_8041C7C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB5B4); @@ -734,7 +734,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0); entityInfo = GetEntInfo(target); - if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { + if ((entityInfo->frozenClassStatus.status != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasAbility(target, ABILITY_MAGMA_ARMOR)) { if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCDE0); @@ -755,13 +755,13 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) } else { - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } sub_8041F08(target); - entityInfo->immobilize.immobilizeStatus = STATUS_FROZEN; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E2C,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + entityInfo->frozenClassStatus.status = STATUS_FROZEN; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E2C,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB610); EntityUpdateStatusSprites(target); } @@ -778,19 +778,19 @@ void SqueezedStatusTarget(Entity * pokemon, Entity * target, s16 param_3, bool32 if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage_u8))) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { - entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; - entityInfo->immobilize.unk4 = param_3_s32; + if (entityInfo->frozenClassStatus.status != STATUS_CONSTRICTION) { + entityInfo->frozenClassStatus.status = STATUS_CONSTRICTION; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; + entityInfo->frozenClassStatus.unk4 = param_3_s32; nullsub_71(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB628); sub_806CE94(target,8); @@ -808,18 +808,18 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } - else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { + else if (entityInfo->frozenClassStatus.status == STATUS_INGRAIN) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { - entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status != STATUS_SHADOW_HOLD) { + entityInfo->frozenClassStatus.status = STATUS_SHADOW_HOLD; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_70(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB668); sub_806CE94(target,8); @@ -837,14 +837,14 @@ void IngrainedStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); - if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (entityInfo->frozenClassStatus.status == STATUS_WRAP || entityInfo->frozenClassStatus.status == STATUS_WRAPPED) { sub_8076CB4(entityInfo->unk9C); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) { - entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN; - entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; - entityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if (entityInfo->frozenClassStatus.status != STATUS_INGRAIN) { + entityInfo->frozenClassStatus.status = STATUS_INGRAIN; + entityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; + entityInfo->frozenClassStatus.damageCountdown = 0; nullsub_90(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6A4); } @@ -871,16 +871,16 @@ void WrapTarget(Entity * pokemon, Entity * target) } pokemonEntityData = GetEntInfo(pokemon); targetEntityInfo = GetEntInfo(target); - if ((u8)(pokemonEntityData->immobilize.immobilizeStatus - 3U) > 1) { - if ((targetEntityInfo->immobilize.immobilizeStatus != STATUS_WRAP)) + if ((u8)(pokemonEntityData->frozenClassStatus.status - 3U) > 1) { + if ((targetEntityInfo->frozenClassStatus.status != STATUS_WRAP)) { - if(targetEntityInfo->immobilize.immobilizeStatus != STATUS_WRAPPED) { - pokemonEntityData->immobilize.immobilizeStatus = STATUS_WRAP; - pokemonEntityData->immobilize.immobilizeStatusTurns = 0x7f; - pokemonEntityData->immobilize.immobilizeStatusDamageCountdown = 0; - targetEntityInfo->immobilize.immobilizeStatus = STATUS_WRAPPED; - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E5C, TRUE) + 1; - targetEntityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + if(targetEntityInfo->frozenClassStatus.status != STATUS_WRAPPED) { + pokemonEntityData->frozenClassStatus.status = STATUS_WRAP; + pokemonEntityData->frozenClassStatus.turns = 0x7f; + pokemonEntityData->frozenClassStatus.damageCountdown = 0; + targetEntityInfo->frozenClassStatus.status = STATUS_WRAPPED; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E5C, TRUE) + 1; + targetEntityInfo->frozenClassStatus.damageCountdown = 0; iVar5 = &pokemonEntityData->unk9C; piVar3 = &gDungeon->unk37F4; *iVar5 = *piVar3; @@ -894,19 +894,19 @@ void WrapTarget(Entity * pokemon, Entity * target) } } } - if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { + if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } - if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { + if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAP) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); } - if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (pokemonEntityData->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } - if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { + if (targetEntityInfo->frozenClassStatus.status == STATUS_WRAPPED) { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); } @@ -922,12 +922,12 @@ void sub_8076CB4(s32 param_1) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { entityInfo = GetEntInfo(entity); if (entityInfo->unk9C == param_1) { - if ((u8)(entityInfo->immobilize.immobilizeStatus - 3U) < 2) { - entityInfo->immobilize.immobilizeStatus = STATUS_NONE; + if ((u8)(entityInfo->frozenClassStatus.status - 3U) < 2) { + entityInfo->frozenClassStatus.status = STATUS_NONE; } entityInfo->unk9C = 0; } @@ -946,19 +946,19 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { sub_8041C08(target); targetEntityInfo = GetEntInfo(target); - if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) { + if ((u8)(targetEntityInfo->frozenClassStatus.status - 3U) < 2) { sub_8076CB4(targetEntityInfo->unk9C); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) { - targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED; + if (targetEntityInfo->frozenClassStatus.status != STATUS_PETRIFIED) { + targetEntityInfo->frozenClassStatus.status = STATUS_PETRIFIED; if (targetEntityInfo->isTeamLeader) { - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EBC,TRUE) + 1; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EBC,TRUE) + 1; } else { - targetEntityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EC0,TRUE) + 1; + targetEntityInfo->frozenClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EC0,TRUE) + 1; } - targetEntityInfo->immobilize.immobilizeStatusDamageCountdown = 0; + targetEntityInfo->frozenClassStatus.damageCountdown = 0; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7BC); } diff --git a/src/status.c b/src/status.c index 920d89ec7..e0c71b1b0 100644 --- a/src/status.c +++ b/src/status.c @@ -414,10 +414,10 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage) else { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) + if(entityInfo->cringeClassStatus.status != STATUS_CRINGE) { - entityInfo->volatileStatus.volatileStatus = STATUS_CRINGE; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E3C, TRUE) + 1; + entityInfo->cringeClassStatus.status = STATUS_CRINGE; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4E3C, TRUE) + 1; sub_80420A0(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2E0); } @@ -452,11 +452,11 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag bVar6 = TRUE; entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { - entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; - entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; - entityInfo->nonVolatile.nonVolatileStatusDamageCountdown = 0; - entityInfo->nonVolatile.unk4 = 0; + if (entityInfo->burnClassStatus.status != STATUS_PARALYSIS) { + entityInfo->burnClassStatus.status = STATUS_PARALYSIS; + entityInfo->burnClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; + entityInfo->burnClassStatus.damageCountdown = 0; + entityInfo->burnClassStatus.unk4 = 0; bVar6 = FALSE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB2AC); sub_8041C1C(target); @@ -606,9 +606,9 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage { sub_8041BE8(target); entityInfo = GetEntInfo(target); - if (entityInfo->volatileStatus.volatileStatus != STATUS_CONFUSED) { - entityInfo->volatileStatus.volatileStatus = STATUS_CONFUSED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_CONFUSED) { + entityInfo->cringeClassStatus.status = STATUS_CONFUSED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4E4C,TRUE) + 1; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB25C); } else { @@ -626,9 +626,9 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { - entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_COWERING) { + entityInfo->cringeClassStatus.status = STATUS_COWERING; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; sub_8041BF8(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB940); } @@ -807,14 +807,14 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } else { - switch(entityInfo->linked.linkedStatus) + switch(entityInfo->linked.status) { case STATUS_DESTINY_BOND: TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAA8C); default: - entityInfo->linked.linkedStatus = STATUS_LEECH_SEED; - entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; - entityInfo->linked.linkedStatusDamageCountdown = 0; + entityInfo->linked.status = STATUS_LEECH_SEED; + entityInfo->linked.turns = CalculateStatusTurns(target, gUnknown_80F4EB0, TRUE) + 1; + entityInfo->linked.damageCountdown = 0; nullsub_78(target); entityInfo->linked.unkD8 = 0xff; break; @@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (pokemon == gDungeon->activeMonsterPtrs[index]) { + if (pokemon == gDungeon->activePokemon[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(pokemon); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -847,14 +847,14 @@ void sub_8078084(Entity * pokemon) entityInfo = GetEntInfo(pokemon); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - target = gDungeon->activeMonsterPtrs[index]; + target = gDungeon->activePokemon[index]; if (EntityExists(target)) { entityInfo2 = GetEntInfo(target); - if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) + if((u8)(entityInfo2->linked.status - 1) <= 1) { if(entityInfo2->linked.unkD4 == entityInfo->unk98) { - entityInfo2->linked.linkedStatus = STATUS_NONE; + entityInfo2->linked.status = STATUS_NONE; EntityUpdateStatusSprites(target); } } @@ -867,22 +867,22 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) EntityInfo *entityInfo; EntityInfo *entityInfo2; s32 index; - u8 *linkedStatus; + u8 *status; s32 zero; if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && (GetEntityType(target) == ENTITY_MONSTER)) { entityInfo = GetEntInfo(pokemon); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0); - linkedStatus = &entityInfo->linked.linkedStatus; - if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) + status = &entityInfo->linked.status; + if (entityInfo->linked.status != STATUS_DESTINY_BOND) { - if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) + if (entityInfo->linked.status == STATUS_LEECH_SEED) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA79C); zero = 0; - *linkedStatus = STATUS_DESTINY_BOND; - entityInfo->linked.linkedStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; - entityInfo->linked.linkedStatusDamageCountdown = zero; + *status = STATUS_DESTINY_BOND; + entityInfo->linked.turns = CalculateStatusTurns(target,gUnknown_80F4EF0,TRUE) + 1; + entityInfo->linked.damageCountdown = zero; nullsub_74(target); entityInfo->linked.unkD8 = 0xff; } @@ -893,7 +893,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target) } for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - if (target == gDungeon->activeMonsterPtrs[index]) { + if (target == gDungeon->activePokemon[index]) { entityInfo->linked.unkD8 = index; entityInfo2 = GetEntInfo(target); entityInfo->linked.unkD4 = entityInfo2->unk98; @@ -911,9 +911,9 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { - entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; - entityInfo->moveStatus.moveStatusTurns = turns + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_SURE_SHOT) { + entityInfo->sureShotClassStatus.status = STATUS_SURE_SHOT; + entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CDC(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB73C); } @@ -931,9 +931,9 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns) if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { - entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; - entityInfo->moveStatus.moveStatusTurns = turns + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_WHIFFER) { + entityInfo->sureShotClassStatus.status = STATUS_WHIFFER; + entityInfo->sureShotClassStatus.turns = turns + 1; sub_8041CEC(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB780); } @@ -951,9 +951,9 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { - entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; - entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_SET_DAMAGE) { + entityInfo->sureShotClassStatus.status = STATUS_SET_DAMAGE; + entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; nullsub_79(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB8BC); } @@ -971,9 +971,9 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target) if (EntityExists(target)) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { - entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; - entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; + if (entityInfo->sureShotClassStatus.status != STATUS_FOCUS_ENERGY) { + entityInfo->sureShotClassStatus.status = STATUS_FOCUS_ENERGY; + entityInfo->sureShotClassStatus.turns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; nullsub_80(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB900); } @@ -996,36 +996,36 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { targetEntityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (targetEntityInfo->curseClassStatus.status == STATUS_DECOY) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); } else { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if ((((EntityExists(entity)) && (target != entity)) && - (u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) { - SendWaitingEndMessage(pokemon,entity,STATUS_NONE); + (u8)(GetEntInfo(entity)->curseClassStatus.status - 2U) < 2)) { + EndCurseClassStatus(pokemon,entity,STATUS_NONE); sub_803E46C(0x2a); } } sub_8041D38(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) { - SendWaitingEndMessage(pokemon,target, STATUS_DECOY); + if (targetEntityInfo->curseClassStatus.status != STATUS_NONE) { + EndCurseClassStatus(pokemon,target, STATUS_DECOY); } - targetEntityInfo->waitingStruct.waitingStatus = STATUS_DECOY; - targetEntityInfo->waitingStruct.decoyApplierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; - targetEntityInfo->waitingStruct.unkCA = param_3; - targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + targetEntityInfo->curseClassStatus.status = STATUS_DECOY; + targetEntityInfo->curseClassStatus.applierNonTeamMemberFlag = GetEntInfo(pokemon)->isNotTeamMember; + targetEntityInfo->curseClassStatus.unk2 = param_3; + targetEntityInfo->curseClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; sub_806CCB4(target,sub_806CEBC(target)); gDungeon->decoyIsActive = TRUE; TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity2 = gDungeon->activeMonsterPtrs[index]; + entity2 = gDungeon->activePokemon[index]; if (EntityExists(entity2)) { entityInfo = GetEntInfo(entity2); entityInfo->aiTarget.aiObjective = AI_STAND_STILL; @@ -1058,17 +1058,17 @@ void CurseStatusTarget(Entity *pokemon, Entity * target) if (HasSafeguardStatus(pokemon,target, TRUE)) { return; } - SendWaitingEndMessage(pokemon,target,STATUS_CURSED); + EndCurseClassStatus(pokemon,target,STATUS_CURSED); sub_8041D48(target); HP = pokemonEntityData->HP / 2; pokemonEntityData->HP = HP; if (HP == 0) { pokemonEntityData->HP = 1; } - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_CURSED) { - targetEntityInfo->waitingStruct.waitingStatus = STATUS_CURSED; - targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + if (targetEntityInfo->curseClassStatus.status != STATUS_CURSED) { + targetEntityInfo->curseClassStatus.status = STATUS_CURSED; + targetEntityInfo->curseClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); @@ -1090,22 +1090,22 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target) EntityInfo *targetEntityInfo; if (EntityExists(target)) { - SendWaitingEndMessage(pokemon,target,STATUS_SNATCH); + EndCurseClassStatus(pokemon,target,STATUS_SNATCH); for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; - if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) { - SendWaitingEndMessage(pokemon, entity, STATUS_NONE); + entity = gDungeon->activePokemon[index]; + if ((EntityExists(entity)) && (GetEntInfo(entity)->curseClassStatus.status == STATUS_SNATCH)) { + EndCurseClassStatus(pokemon, entity, STATUS_NONE); } } nullsub_81(target); targetEntityInfo = GetEntInfo(target); - if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_SNATCH) { - targetEntityInfo->waitingStruct.waitingStatus = STATUS_SNATCH; - targetEntityInfo->waitingStruct.waitingStatusTurns= CalculateStatusTurns(target,gUnknown_80F4EA8,FALSE) + 1; - targetEntityInfo->waitingStruct.curseDamageCountdown = 0; + if (targetEntityInfo->curseClassStatus.status != STATUS_SNATCH) { + targetEntityInfo->curseClassStatus.status = STATUS_SNATCH; + targetEntityInfo->curseClassStatus.turns= CalculateStatusTurns(target,gUnknown_80F4EA8,FALSE) + 1; + targetEntityInfo->curseClassStatus.damageCountdown = 0; } gDungeon->snatchPokemon = target; @@ -1123,9 +1123,9 @@ void TauntStatusTarget(Entity * pokemon, Entity * target) if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { entityInfo = GetEntInfo(target); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { - entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; - entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; + if (entityInfo->cringeClassStatus.status != STATUS_TAUNTED) { + entityInfo->cringeClassStatus.status = STATUS_TAUNTED; + entityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; nullsub_73(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9F0); } @@ -1163,13 +1163,13 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target) if (EntityExists(target)) { targetEntityInfo = GetEntInfo(target); - if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { + if (targetEntityInfo->invisibleClassStatus.status == STATUS_TRANSFORMED) { SendTransformEndMessage(pokemon,target); } SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) { - targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE; - targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; + if (targetEntityInfo->invisibleClassStatus.status != STATUS_INVISIBLE) { + targetEntityInfo->invisibleClassStatus.status = STATUS_INVISIBLE; + targetEntityInfo->invisibleClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; sub_8041D84(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBA80); } @@ -1218,9 +1218,9 @@ void EncoreStatusTarget(Entity *pokemon,Entity *target) } else { SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0); - if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) { - EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; - EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; + if (EntityInfo->cringeClassStatus.status != STATUS_ENCORE) { + EntityInfo->cringeClassStatus.status = STATUS_ENCORE; + EntityInfo->cringeClassStatus.turns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; nullsub_83(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB94); } diff --git a/src/status_actions.c b/src/status_actions.c index b43d8805f..62587f497 100644 --- a/src/status_actions.c +++ b/src/status_actions.c @@ -315,7 +315,7 @@ bool8 sub_805B264(Entity * pokemon, Entity * target, Move *move, s32 param_4) gDungeon->unk181e8.unk18200 = gUnknown_8106A8C[r3]; gDungeon->unk181e8.unk18204 = 0; iVar5 = gUnknown_80F4F94[r3]; - if (entityInfo->charging.chargingStatus == STATUS_DIGGING) { + if (entityInfo->bideClassStatus.status == STATUS_DIGGING) { iVar5 *= 2; } r6 = sub_8055864(pokemon,target,move,iVar5,param_4) ? TRUE : FALSE; @@ -602,7 +602,7 @@ bool8 SkullBashMoveAction(Entity * pokemon, Entity * target, Move * move, s32 pa { bool8 flag; - if (MoveMatchesChargingStatus(pokemon,move)) { + if (MoveMatchesBideClassStatus(pokemon,move)) { flag = HandleDamagingMove(pokemon,target,move,gUnknown_80F4F58,param_4) != 0 ? 1 : 0; sub_8079764(pokemon); } diff --git a/src/status_checks.c b/src/status_checks.c index 43b6893b7..f44553b64 100644 --- a/src/status_checks.c +++ b/src/status_checks.c @@ -29,14 +29,14 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) EntityInfo *pokemonInfo = GetEntInfo(pokemon); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); - switch (pokemonInfo->sleep.sleep) + switch (pokemonInfo->sleepClassStatus.status) { case STATUS_NIGHTMARE: case STATUS_SLEEP: case STATUS_NAPPING: return TRUE; } - switch (pokemonInfo->immobilize.immobilizeStatus) + switch (pokemonInfo->frozenClassStatus.status) { case STATUS_FROZEN: LogMessageByIdWithPopupCheckUser(pokemon, *gPtrFrozenMessage); @@ -50,7 +50,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) case STATUS_PETRIFIED: return TRUE; } - switch (pokemonInfo->volatileStatus.volatileStatus) + switch (pokemonInfo->cringeClassStatus.status) { case STATUS_PAUSED: LogMessageByIdWithPopupCheckUser(pokemon, *gPtrPausedMessage); @@ -59,12 +59,12 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) LogMessageByIdWithPopupCheckUser(pokemon, *gPtrInfatuatedMessage); return TRUE; } - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { LogMessageByIdWithPopupCheckUser(pokemon, *gPtrBideMessage); return TRUE; } - if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) + if (pokemonInfo->curseClassStatus.status == STATUS_DECOY) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -76,7 +76,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) { return TRUE; } - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER) + if (pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER) { if (!CanMoveInDirection(pokemon, pokemonInfo->action.direction)) { @@ -96,7 +96,7 @@ bool8 HasStatusThatPreventsActing(Entity *pokemon) ChooseAIMove(pokemon); return TRUE; } - if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) + if (pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED) { SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); @@ -119,7 +119,7 @@ bool8 sub_80701A4(Entity *pokemon) flag = FALSE; SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); - switch(pokemonInfo->sleep.sleep) + switch(pokemonInfo->sleepClassStatus.status) { case STATUS_SLEEP: case STATUS_NIGHTMARE: @@ -128,7 +128,7 @@ bool8 sub_80701A4(Entity *pokemon) return TRUE; } - switch(pokemonInfo->immobilize.immobilizeStatus) + switch(pokemonInfo->frozenClassStatus.status) { case STATUS_FROZEN: LogMessageByIdWithPopupCheckUser(pokemon,*gPtrFrozenMessage); @@ -143,7 +143,7 @@ bool8 sub_80701A4(Entity *pokemon) return TRUE; } - switch(pokemonInfo->volatileStatus.volatileStatus) { + switch(pokemonInfo->cringeClassStatus.status) { case STATUS_CONFUSED: flag = TRUE; goto _0807026C; @@ -158,19 +158,19 @@ bool8 sub_80701A4(Entity *pokemon) case STATUS_CRINGE: case 8: _0807026C: - if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { + if (pokemonInfo->bideClassStatus.status == STATUS_BIDE) { LogMessageByIdWithPopupCheckUser(pokemon,*gPtrBideMessage); return TRUE; } - else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { + else if (((pokemonInfo->bideClassStatus.status != STATUS_NONE) && (pokemonInfo->bideClassStatus.status != STATUS_CHARGING)) && (pokemonInfo->bideClassStatus.status != STATUS_ENRAGED)) { if (flag) { LogMessageByIdWithPopupCheckUser(pokemon,*gPtrMoveInterruptedMessage); } else { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { if ((move->moveFlags & MOVE_FLAG_EXISTS) && - (MoveMatchesChargingStatus(pokemon,move)) && - (pokemonInfo->charging.chargingStatusMoveIndex == index)) { + (MoveMatchesBideClassStatus(pokemon,move)) && + (pokemonInfo->bideClassStatus.moveSlot == index)) { SetMonsterActionFields(&pokemonInfo->action, ACTION_USE_MOVE_PLAYER); index_1 = index; r7 = &pokemonInfo->action.unk4[1].actionUseIndex; diff --git a/src/status_checks_1.c b/src/status_checks_1.c index 89efecdce..f958d1afc 100644 --- a/src/status_checks_1.c +++ b/src/status_checks_1.c @@ -59,14 +59,14 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) { if (((gDungeon->unk181e8.blinded || gDungeon->unk181e8.hallucinating) || - (param_2->transformStatus.transformStatus == STATUS_INVISIBLE)) && + (param_2->invisibleClassStatus.status == STATUS_INVISIBLE)) && (param_2->isNotTeamMember)) { strcpy(buffer, *gUnknown_80F8988); } else { - if (param_2->waitingStruct.waitingStatus == STATUS_DECOY) { + if (param_2->curseClassStatus.status == STATUS_DECOY) { strcpy(buffer, *gUnknown_80F8968); } else @@ -88,7 +88,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum) void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum) { - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { sprintfStatic(buffer, gUnknown_8106FA4, colorNum + 0x30, *gUnknown_80F8974); } else if (entityInfo->isNotTeamMember) { @@ -103,14 +103,14 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo) { if (((gDungeon->unk181e8.blinded || gDungeon->unk181e8.hallucinating) || - (entityInfo->transformStatus.transformStatus == STATUS_INVISIBLE)) && + (entityInfo->invisibleClassStatus.status == STATUS_INVISIBLE)) && (entityInfo->isNotTeamMember)) { strcpy(buffer, *gUnknown_80F8994); } else { - if (entityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { + if (entityInfo->curseClassStatus.status == STATUS_DECOY) { strcpy(buffer, *gUnknown_80F8974); } else @@ -130,18 +130,18 @@ bool8 HasNegativeStatus(Entity *pokemon) { EntityInfo *pokemonInfo = GetEntInfo(pokemon); s32 i; - if (pokemonInfo->sleep.sleep == STATUS_SLEEP || - pokemonInfo->sleep.sleep == STATUS_NIGHTMARE || - pokemonInfo->sleep.sleep == STATUS_YAWNING || - pokemonInfo->nonVolatile.nonVolatileStatus != STATUS_NONE || - (pokemonInfo->immobilize.immobilizeStatus != STATUS_INGRAIN && pokemonInfo->immobilize.immobilizeStatus != STATUS_NONE) || - pokemonInfo->volatileStatus.volatileStatus != STATUS_NONE || - pokemonInfo->waitingStruct.waitingStatus == STATUS_CURSED || - pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY || - pokemonInfo->linked.linkedStatus == STATUS_LEECH_SEED || - pokemonInfo->moveStatus.moveStatus == STATUS_WHIFFER || - pokemonInfo->eyesightStatus.eyesightStatus == STATUS_BLINKER || - pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED || + if (pokemonInfo->sleepClassStatus.status == STATUS_SLEEP || + pokemonInfo->sleepClassStatus.status == STATUS_NIGHTMARE || + pokemonInfo->sleepClassStatus.status == STATUS_YAWNING || + pokemonInfo->burnClassStatus.status != STATUS_NONE || + (pokemonInfo->frozenClassStatus.status != STATUS_INGRAIN && pokemonInfo->frozenClassStatus.status != STATUS_NONE) || + pokemonInfo->cringeClassStatus.status != STATUS_NONE || + pokemonInfo->curseClassStatus.status == STATUS_CURSED || + pokemonInfo->curseClassStatus.status == STATUS_DECOY || + pokemonInfo->linked.status == STATUS_LEECH_SEED || + pokemonInfo->sureShotClassStatus.status == STATUS_WHIFFER || + pokemonInfo->blinkerClassStatus.status == STATUS_BLINKER || + pokemonInfo->blinkerClassStatus.status == STATUS_CROSS_EYED || pokemonInfo->muzzled.muzzled == TRUE || pokemonInfo->exposed || pokemonInfo->perishSongTurns != 0) @@ -168,9 +168,9 @@ bool8 HasNegativeStatus(Entity *pokemon) bool8 IsSleeping(Entity *pokemon) { - if (GetEntInfo(pokemon)->sleep.sleep != STATUS_SLEEP && - GetEntInfo(pokemon)->sleep.sleep != STATUS_NAPPING && - GetEntInfo(pokemon)->sleep.sleep != STATUS_NIGHTMARE) + if (GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_SLEEP && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NAPPING && + GetEntInfo(pokemon)->sleepClassStatus.status != STATUS_NIGHTMARE) { return FALSE; } diff --git a/src/tile_types.c b/src/tile_types.c index a4ff0bd23..e2394e43b 100644 --- a/src/tile_types.c +++ b/src/tile_types.c @@ -145,7 +145,7 @@ bool8 sub_804AD34(Position *pos) if (iVar8 != 0) { for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { sub_806CF98(entity); } @@ -206,7 +206,7 @@ void sub_804AE84(Position *pos) for(index = 0; index < DUNGEON_MAX_POKEMON; index++) { - entity = gDungeon->activeMonsterPtrs[index]; + entity = gDungeon->activePokemon[index]; if (EntityExists(entity)) { sub_806CF98(entity); } diff --git a/src/trap_1.c b/src/trap_1.c index 1d0fb49d4..3802291c6 100644 --- a/src/trap_1.c +++ b/src/trap_1.c @@ -54,20 +54,20 @@ void SaveSpeedStage(unkStruct_8094924 *param_1, s32 param_2); void sub_8081854(unkStruct_8094924 *param_1, s32 param_2); void sub_808183C(unkStruct_8094924 *param_1, s32 param_2); void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2); -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2); -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2); -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2); -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2); -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2); -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2); -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2); -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2); -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2); +void SaveBlinkerClassStatus(unkStruct_8094924 *param_1, BlinkerClassStatus *param_2); +void SaveInvisibleClassStatus(unkStruct_8094924 *param_1, InvisibleClassStatus *param_2); +void SaveLongTossClassStatus(unkStruct_8094924 *param_1, LongTossClassStatus *param_2); +void SaveSureShotClassStatus(unkStruct_8094924 *param_1, SureShotClassStatus* param_2); +void SaveLeechSeedClassStatus(unkStruct_8094924 *param_1, LeechSeedClassStatus *param_2); +void SaveCringeClassStatus(unkStruct_8094924 *param_1, CringeClassStatus *param_2); +void SaveFrozenClassStatus(unkStruct_8094924 *param_1, FrozenClassStatus *param_2); +void SaveBurnClassStatus(unkStruct_8094924 *param_1, BurnClassStatus *param_2); +void SaveSleepClassStatus(unkStruct_8094924 *param_1, SleepClassStatus* param_2); void SaveTactic(unkStruct_8094924 *param_1, u8 param_2); void SaveDungeonHiddenPower(unkStruct_8094924 *param_1, HiddenPower *param_2); -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2); -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2); -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2); +void SaveBideClassStatus(unkStruct_8094924 *param_1, BideClassStatus *param_2); +void SaveReflectClassStatus(unkStruct_8094924 *param_1, ReflectClassStatus *param_2); +void SaveCurseClassStatus(unkStruct_8094924 *param_1, CurseClassStatus *param_2); void SaveSpeedCounters(unkStruct_8094924 *param_1, u8 *speedCounters, u32 numCounters); void SaveClientType(unkStruct_8094924 *param_1, u8 param_2); void sub_80421C0(Entity *, u16); @@ -270,18 +270,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) u32 *puStack_98; u32 *puStack_94; u8 *puStack_90; - Sleep *puStack_8c; - NonVolatile *puStack_88; - Immobilize *puStack_84; - Volatile *puStack_80; - Charging *puStack_7c; - Protection *puStack_78; - Waiting *puStack_74; - Linked *puStack_70; - MoveStatus *puStack_6c; - ItemStatus *puStack_68; - TransformStatus *puStack_64; - EyesightStatus *puStack_60; + SleepClassStatus *puStack_8c; + BurnClassStatus *puStack_88; + FrozenClassStatus *puStack_84; + CringeClassStatus *puStack_80; + BideClassStatus *puStack_7c; + ReflectClassStatus *puStack_78; + CurseClassStatus *puStack_74; + LeechSeedClassStatus *puStack_70; + SureShotClassStatus *puStack_6c; + LongTossClassStatus *puStack_68; + InvisibleClassStatus *puStack_64; + BlinkerClassStatus *puStack_60; Muzzled *pbStack_5c; bool8 *pbStack_58; bool8 *pbStack_54; @@ -364,18 +364,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) puStack_9c = &info->unk98; puStack_98 = &info->unk9C; puStack_94 = &info->unkA0; - puStack_8c = &info->sleep; - puStack_88 = &info->nonVolatile; - puStack_84 = &info->immobilize; - puStack_80 = &info->volatileStatus; - puStack_7c = &info->charging; - puStack_78 = &info->protection; - puStack_74 = &info->waitingStruct; + puStack_8c = &info->sleepClassStatus; + puStack_88 = &info->burnClassStatus; + puStack_84 = &info->frozenClassStatus; + puStack_80 = &info->cringeClassStatus; + puStack_7c = &info->bideClassStatus; + puStack_78 = &info->reflectClassStatus; + puStack_74 = &info->curseClassStatus; puStack_70 = &info->linked; - puStack_6c = &info->moveStatus; - puStack_68 = &info->itemStatus; - puStack_64 = &info->transformStatus; - puStack_60 = &info->eyesightStatus; + puStack_6c = &info->sureShotClassStatus; + puStack_68 = &info->longTossClassStatus; + puStack_64 = &info->invisibleClassStatus; + puStack_60 = &info->blinkerClassStatus; pbStack_5c = &info->muzzled; pbStack_58 = &info->powerEars; pbStack_54 = &info->scanning; @@ -408,18 +408,18 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2) sub_8083078(param_1,*puStack_9c); sub_8083078(param_1,*puStack_98); sub_8083078(param_1,*puStack_94); - SaveEntitySleep(param_1,puStack_8c); - SaveNonVolatileStatus(param_1,puStack_88); - SaveImmobilizeStatus(param_1,puStack_84); - SaveVolatileStatus(param_1,puStack_80); - SaveChargingStatus(param_1,puStack_7c); - SaveProtectionStatus(param_1,puStack_78); - SaveWaitingStatus(param_1,puStack_74); - SaveLinkedStatus(param_1,puStack_70); - SaveMoveStatus(param_1,puStack_6c); - SaveItemStatus(param_1,puStack_68); - SaveTransformStatus(param_1,puStack_64); - SaveEyesightStatus(param_1,puStack_60); + SaveSleepClassStatus(param_1,puStack_8c); + SaveBurnClassStatus(param_1,puStack_88); + SaveFrozenClassStatus(param_1,puStack_84); + SaveCringeClassStatus(param_1,puStack_80); + SaveBideClassStatus(param_1,puStack_7c); + SaveReflectClassStatus(param_1,puStack_78); + SaveCurseClassStatus(param_1,puStack_74); + SaveLeechSeedClassStatus(param_1,puStack_70); + SaveSureShotClassStatus(param_1,puStack_6c); + SaveLongTossClassStatus(param_1,puStack_68); + SaveInvisibleClassStatus(param_1,puStack_64); + SaveBlinkerClassStatus(param_1,puStack_60); SaveMuzzledStatus(param_1,pbStack_5c); sub_80830B4(param_1,*pbStack_58); sub_80830B4(param_1,*pbStack_54); @@ -646,92 +646,92 @@ void SaveAITargetStatus(unkStruct_8094924 *param_1, AITarget* param_2) SavePosition(param_1, ¶m_2->aiTargetPos); } -void SaveEntitySleep(unkStruct_8094924 *param_1, Sleep* param_2) +void SaveSleepClassStatus(unkStruct_8094924 *param_1, SleepClassStatus* param_2) { - sub_8082FA8(param_1, ¶m_2->sleep, 1); - sub_8083060(param_1, param_2->sleepTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveNonVolatileStatus(unkStruct_8094924 *param_1, NonVolatile *param_2) +void SaveBurnClassStatus(unkStruct_8094924 *param_1, BurnClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->nonVolatileStatus, 1); - sub_8083060(param_1, param_2->nonVolatileStatusTurns); - sub_8083060(param_1, param_2->nonVolatileStatusDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); sub_8083060(param_1, param_2->unk4); } -void SaveImmobilizeStatus(unkStruct_8094924 *param_1, Immobilize *param_2) +void SaveFrozenClassStatus(unkStruct_8094924 *param_1, FrozenClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->immobilizeStatus, 1); - sub_8083060(param_1, param_2->immobilizeStatusTurns); - sub_8083060(param_1, param_2->immobilizeStatusDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); sub_8083078(param_1, param_2->unk4); } -void SaveVolatileStatus(unkStruct_8094924 *param_1, Volatile *param_2) +void SaveCringeClassStatus(unkStruct_8094924 *param_1, CringeClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->volatileStatus, 1); - sub_8083060(param_1, param_2->volatileStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveChargingStatus(unkStruct_8094924 *param_1, Charging *param_2) +void SaveBideClassStatus(unkStruct_8094924 *param_1, BideClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->chargingStatus, 1); - sub_8083060(param_1, param_2->chargingStatusTurns); - sub_8083060(param_1, param_2->chargingStatusMoveIndex); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->moveSlot); } -void SaveProtectionStatus(unkStruct_8094924 *param_1, Protection *param_2) +void SaveReflectClassStatus(unkStruct_8094924 *param_1, ReflectClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->protectionStatus, 1); - sub_8083060(param_1, param_2->protectionStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2) +void SaveCurseClassStatus(unkStruct_8094924 *param_1, CurseClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->waitingStatus, 1); - sub_80830B4(param_1, param_2->decoyApplierNonTeamMemberFlag); - sub_80830B4(param_1, param_2->unkCA); - sub_8083060(param_1, param_2->waitingStatusTurns); - sub_8083060(param_1, param_2->curseDamageCountdown); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_80830B4(param_1, param_2->applierNonTeamMemberFlag); + sub_80830B4(param_1, param_2->unk2); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); } -void SaveLinkedStatus(unkStruct_8094924 *param_1, Linked *param_2) +void SaveLeechSeedClassStatus(unkStruct_8094924 *param_1, LeechSeedClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->linkedStatus, 1); + sub_8082FA8(param_1, ¶m_2->status, 1); sub_8083078(param_1, param_2->unkD4); sub_8083060(param_1, param_2->unkD8); - sub_8083060(param_1, param_2->linkedStatusTurns); - sub_8083060(param_1, param_2->linkedStatusDamageCountdown); + sub_8083060(param_1, param_2->turns); + sub_8083060(param_1, param_2->damageCountdown); } -void SaveMoveStatus(unkStruct_8094924 *param_1, MoveStatus* param_2) +void SaveSureShotClassStatus(unkStruct_8094924 *param_1, SureShotClassStatus* param_2) { - sub_8082FA8(param_1, ¶m_2->moveStatus, 1); - sub_8083060(param_1, param_2->moveStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveItemStatus(unkStruct_8094924 *param_1, ItemStatus *param_2) +void SaveLongTossClassStatus(unkStruct_8094924 *param_1, LongTossClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->itemStatus, 1); + sub_8082FA8(param_1, ¶m_2->status, 1); } -void SaveTransformStatus(unkStruct_8094924 *param_1, TransformStatus *param_2) +void SaveInvisibleClassStatus(unkStruct_8094924 *param_1, InvisibleClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->transformStatus, 1); - sub_8083060(param_1, param_2->transformStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } -void SaveEyesightStatus(unkStruct_8094924 *param_1, EyesightStatus *param_2) +void SaveBlinkerClassStatus(unkStruct_8094924 *param_1, BlinkerClassStatus *param_2) { - sub_8082FA8(param_1, ¶m_2->eyesightStatus, 1); - sub_8083060(param_1, param_2->eyesightStatusTurns); + sub_8082FA8(param_1, ¶m_2->status, 1); + sub_8083060(param_1, param_2->turns); } void SaveMuzzledStatus(unkStruct_8094924 *param_1, Muzzled *param_2) { sub_8082FA8(param_1, ¶m_2->muzzled, 1); - sub_8083060(param_1, param_2->muzzledTurns); + sub_8083060(param_1, param_2->turns); } void SaveEntityMove(unkStruct_8094924 *r0, Move *r1) diff --git a/src/type_effectiveness.c b/src/type_effectiveness.c index a22bef924..9f5f57f7b 100644 --- a/src/type_effectiveness.c +++ b/src/type_effectiveness.c @@ -237,7 +237,7 @@ bool8 sub_806E100(unkStruct_80943A8 *param_1, Entity *pokemon, Entity *target, u gDungeon->unk134.fill16E[8] = TRUE; F48_16_SMul(param_1,param_1, &gUnknown_8106F1C); } - if ((type == TYPE_ELECTRIC) && (pokemonInfo->charging.chargingStatus == STATUS_CHARGING)) { + if ((type == TYPE_ELECTRIC) && (pokemonInfo->bideClassStatus.status == STATUS_CHARGING)) { gDungeon->unk134.fill16E[9] = TRUE; F48_16_SMul(param_1,param_1, &gUnknown_8106F0C); } @@ -394,7 +394,7 @@ s32 WeightWeakTypePicker(Entity *user, Entity *target, u8 moveType) { return 2; } - if (moveType == TYPE_ELECTRIC && userData->charging.chargingStatus == STATUS_CHARGING) + if (moveType == TYPE_ELECTRIC && userData->bideClassStatus.status == STATUS_CHARGING) { weight *= 2; }