Sync some dungeon vars names with Sky

This commit is contained in:
AnonymousRandomPerson 2024-11-03 14:37:41 -05:00
parent 442877916d
commit 5f48654c20
80 changed files with 856 additions and 824 deletions

View File

@ -1262,7 +1262,7 @@ sub_8001064:
movs r0, 0x4 movs r0, 0x4
ldrsh r1, [r5, r0] ldrsh r1, [r5, r0]
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
mov r0, sp mov r0, sp
adds r1, r4, 0 adds r1, r4, 0
bl CopyStringtoBuffer bl CopyStringtoBuffer
@ -1293,7 +1293,7 @@ _080010AE:
movs r0, 0x6 movs r0, 0x6
ldrsh r1, [r5, r0] ldrsh r1, [r5, r0]
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
mov r0, sp mov r0, sp
adds r1, r4, 0 adds r1, r4, 0
bl CopyStringtoBuffer bl CopyStringtoBuffer

View File

@ -1728,7 +1728,7 @@ _08040E6E:
ldr r0, _08040ECC ldr r0, _08040ECC
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r1, 0xD2 movs r1, 0xD2
lsls r1, 1 lsls r1, 1
adds r0, r6, 0 adds r0, r6, 0

View File

@ -65,7 +65,7 @@ _08045E1E:
ldr r0, _08045E38 ldr r0, _08045E38
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08045E3C ldr r0, _08045E3C
b _08046048 b _08046048
.align 2, 0 .align 2, 0
@ -278,7 +278,7 @@ _08045FAC:
_08045FD0: _08045FD0:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08045FF2 b _08045FF2
.align 2, 0 .align 2, 0
_08045FDC: .4byte 0x00ff0008 _08045FDC: .4byte 0x00ff0008
@ -288,7 +288,7 @@ _08045FE8:
ldr r0, _08045FFC ldr r0, _08045FFC
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08045FF2: _08045FF2:
ldrb r0, [r5, 0x2] ldrb r0, [r5, 0x2]
bl TryDisplayItemPickupTutorialMessage bl TryDisplayItemPickupTutorialMessage
@ -331,12 +331,12 @@ _0804602E:
ldr r0, _08046058 ldr r0, _08046058
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0804605C ldr r0, _0804605C
_08046048: _08046048:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080460E0 b _080460E0
.align 2, 0 .align 2, 0
_08046054: .4byte gFormatBuffer_Items _08046054: .4byte gFormatBuffer_Items
@ -374,12 +374,12 @@ _08046094:
ldr r0, _080460B8 ldr r0, _080460B8
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080460BC ldr r0, _080460BC
_080460AC: _080460AC:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080460DA b _080460DA
.align 2, 0 .align 2, 0
_080460B8: .4byte gFormatBuffer_Monsters _080460B8: .4byte gFormatBuffer_Monsters
@ -394,7 +394,7 @@ _080460C0:
ldr r0, _080460F4 ldr r0, _080460F4
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080460DA: _080460DA:
ldrb r0, [r5, 0x2] ldrb r0, [r5, 0x2]
bl TryDisplayItemPickupTutorialMessage bl TryDisplayItemPickupTutorialMessage
@ -996,7 +996,7 @@ sub_804652C:
ldr r0, _080465A4 ldr r0, _080465A4
ldr r1, [r0] ldr r1, [r0]
mov r0, r10 mov r0, r10
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
mov r0, r9 mov r0, r9
ldrb r1, [r0] ldrb r1, [r0]
movs r0, 0x1 movs r0, 0x1
@ -1721,7 +1721,7 @@ _08046B0A:
ldr r4, _08046B38 ldr r4, _08046B38
add r4, sp add r4, sp
ldr r0, [r4] ldr r0, [r4]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08046C7C b _08046C7C
.align 2, 0 .align 2, 0
_08046B2C: .4byte 0x0000052c _08046B2C: .4byte 0x0000052c
@ -1734,7 +1734,7 @@ _08046B3C:
ldr r5, _08046B50 ldr r5, _08046B50
add r5, sp add r5, sp
ldr r0, [r5] ldr r0, [r5]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08046C7C b _08046C7C
.align 2, 0 .align 2, 0
_08046B4C: .4byte gItemLost _08046B4C: .4byte gItemLost
@ -1748,7 +1748,7 @@ _08046B54:
ldr r2, _08046C94 ldr r2, _08046C94
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08046B68: _08046B68:
movs r3, 0 movs r3, 0
mov r9, r3 mov r9, r3

View File

@ -410,7 +410,7 @@ _08047462:
ldr r0, _080474C4 ldr r0, _080474C4
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080474C8 ldr r0, _080474C8
ldr r1, [sp, 0x214] ldr r1, [sp, 0x214]
bl sub_8045C08 bl sub_8045C08
@ -463,7 +463,7 @@ _080474E2:
ldr r0, _0804750C ldr r0, _0804750C
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08047510 ldr r0, _08047510
ldr r1, [sp, 0x214] ldr r1, [sp, 0x214]
bl sub_8045BF8 bl sub_8045BF8
@ -552,7 +552,7 @@ _08047596:
ldr r0, _080475C0 ldr r0, _080475C0
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080475A8: _080475A8:
movs r3, 0x90 movs r3, 0x90
lsls r3, 2 lsls r3, 2
@ -913,7 +913,7 @@ _0804786E:
ldr r0, _080478D4 ldr r0, _080478D4
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
lsls r0, r6, 24 lsls r0, r6, 24
cmp r0, 0 cmp r0, 0
beq _080478DC beq _080478DC

View File

@ -4118,7 +4118,7 @@ sub_8051E7C:
ldr r0, _08051EB4 ldr r0, _08051EB4
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080520F6 b _080520F6
.align 2, 0 .align 2, 0
_08051EB4: .4byte gUnknown_80FDDF0 _08051EB4: .4byte gUnknown_80FDDF0
@ -4378,7 +4378,7 @@ _0805207A:
ldr r0, _080520E8 ldr r0, _080520E8
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x14 movs r0, 0x14
movs r1, 0x3C movs r1, 0x3C
bl sub_803E708 bl sub_803E708
@ -4399,7 +4399,7 @@ _080520EC:
ldr r0, _08052108 ldr r0, _08052108
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080520F6: _080520F6:
add sp, 0x14 add sp, 0x14
pop {r3-r5} pop {r3-r5}

View File

@ -2171,7 +2171,7 @@ sub_8062B74:
ldr r0, _08062BD0 ldr r0, _08062BD0
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08062BD4 ldr r0, _08062BD4
ldr r2, [r0] ldr r2, [r0]
movs r0, 0 movs r0, 0
@ -2322,7 +2322,7 @@ sub_8062CA8:
ldr r0, _08062CF8 ldr r0, _08062CF8
adds r1, r4, 0 adds r1, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08062CFC ldr r0, _08062CFC
ldr r2, [r0] ldr r2, [r0]
movs r0, 0 movs r0, 0
@ -3429,7 +3429,7 @@ sub_8063578:
ldr r0, _080635FC ldr r0, _080635FC
ldr r1, [sp, 0x14] ldr r1, [sp, 0x14]
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
lsls r4, 3 lsls r4, 3
adds r4, 0xA adds r4, 0xA
ldr r0, _08063600 ldr r0, _08063600
@ -4122,7 +4122,7 @@ _08063AEC:
ldr r0, _08063B2C ldr r0, _08063B2C
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08063B3A b _08063B3A
.align 2, 0 .align 2, 0
_08063B1C: .4byte gDungeon _08063B1C: .4byte gDungeon
@ -4134,7 +4134,7 @@ _08063B30:
ldr r0, _08063B50 ldr r0, _08063B50
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08063B3A: _08063B3A:
movs r0, 0x78 movs r0, 0x78
movs r1, 0x1F movs r1, 0x1F
@ -4442,7 +4442,7 @@ _08063D70:
ldr r0, _08063DAC ldr r0, _08063DAC
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08063DBA b _08063DBA
.align 2, 0 .align 2, 0
_08063D98: .4byte gDungeon _08063D98: .4byte gDungeon
@ -4455,7 +4455,7 @@ _08063DB0:
ldr r0, _08063DD0 ldr r0, _08063DD0
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08063DBA: _08063DBA:
movs r0, 0x78 movs r0, 0x78
movs r1, 0x1F movs r1, 0x1F
@ -5474,7 +5474,7 @@ sub_806455C:
ldr r1, [r4, 0x14] ldr r1, [r4, 0x14]
add r0, sp, 0x4 add r0, sp, 0x4
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
str r5, [sp] str r5, [sp]
movs r0, 0x8 movs r0, 0x8
movs r1, 0x12 movs r1, 0x12

View File

@ -1010,7 +1010,7 @@ _080690A2:
adds r0, r2 adds r0, r2
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _08069484 b _08069484
.align 2, 0 .align 2, 0
_080690E4: .4byte gDungeon _080690E4: .4byte gDungeon
@ -1283,7 +1283,7 @@ _0806930A:
adds r0, r2 adds r0, r2
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _08069352 b _08069352
.align 2, 0 .align 2, 0
_0806932C: .4byte gUnknown_202EE70 _0806932C: .4byte gUnknown_202EE70
@ -1301,7 +1301,7 @@ _08069338:
adds r0, r3 adds r0, r3
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
_08069352: _08069352:
bl GetLeader bl GetLeader
cmp r0, 0 cmp r0, 0
@ -1515,7 +1515,7 @@ _080694FC:
_0806950A: _0806950A:
adds r0, r4, 0 adds r0, r4, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_08069512: _08069512:
movs r0, 0x4 movs r0, 0x4
ldrsh r2, [r4, r0] ldrsh r2, [r4, r0]

View File

@ -135,7 +135,7 @@ _08066ECC:
_08066F1E: _08066F1E:
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08066F7E b _08066F7E
.align 2, 0 .align 2, 0
_08066F28: .4byte 0xffffff00 _08066F28: .4byte 0xffffff00
@ -167,7 +167,7 @@ _08066F46:
ldr r0, _08066F98 ldr r0, _08066F98
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, _08066F9C ldr r0, _08066F9C
ldr r0, [r0] ldr r0, [r0]
ldr r2, _08066FA0 ldr r2, _08066FA0
@ -314,7 +314,7 @@ _08067040:
_0806709E: _0806709E:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080670EE b _080670EE
.align 2, 0 .align 2, 0
_080670A8: .4byte gFormatBuffer_Items + 0x50 _080670A8: .4byte gFormatBuffer_Items + 0x50
@ -339,7 +339,7 @@ _080670CA:
ldr r0, _08067104 ldr r0, _08067104
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, _08067108 ldr r0, _08067108
ldr r0, [r0] ldr r0, [r0]
ldr r1, _0806710C ldr r1, _0806710C
@ -390,7 +390,7 @@ sub_8067110:
bl sub_80464AC bl sub_80464AC
adds r1, r0, 0 adds r1, r0, 0
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
ldr r0, [r6] ldr r0, [r6]
str r0, [sp, 0x8] str r0, [sp, 0x8]
adds r0, r5, 0 adds r0, r5, 0
@ -498,7 +498,7 @@ _08067220:
_08067230: _08067230:
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x14 movs r0, 0x14
movs r1, 0x4C movs r1, 0x4C
bl sub_803E708 bl sub_803E708
@ -677,7 +677,7 @@ _08067384:
ldr r0, _080673B8 ldr r0, _080673B8
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _080673C6 b _080673C6
.align 2, 0 .align 2, 0
_080673B0: .4byte gFormatBuffer_Items _080673B0: .4byte gFormatBuffer_Items
@ -687,7 +687,7 @@ _080673BC:
ldr r0, _080673F8 ldr r0, _080673F8
ldr r1, [r0] ldr r1, [r0]
adds r0, r6, 0 adds r0, r6, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_080673C6: _080673C6:
add r0, sp, 0x4 add r0, sp, 0x4
ldrb r0, [r0, 0x2] ldrb r0, [r0, 0x2]
@ -1198,7 +1198,7 @@ _080677B4:
ldr r0, _080677F0 ldr r0, _080677F0
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _080677F4 ldr r0, _080677F4
ldr r5, [r0] ldr r5, [r0]
ldr r0, _080677F8 ldr r0, _080677F8
@ -1380,7 +1380,7 @@ sub_8067904:
ldr r0, _08067944 ldr r0, _08067944
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08067948 ldr r0, _08067948
b _08067962 b _08067962
.align 2, 0 .align 2, 0
@ -1396,12 +1396,12 @@ _0806794C:
ldr r0, _0806796C ldr r0, _0806796C
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08067970 ldr r0, _08067970
_08067962: _08067962:
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08067A56 b _08067A56
.align 2, 0 .align 2, 0
_0806796C: .4byte gFormatBuffer_Monsters _0806796C: .4byte gFormatBuffer_Monsters
@ -1477,7 +1477,7 @@ _080679DE:
ldr r0, _08067A70 ldr r0, _08067A70
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08067A04: _08067A04:
ldrb r0, [r6, 0x7] ldrb r0, [r6, 0x7]
cmp r0, 0 cmp r0, 0

View File

@ -306,7 +306,7 @@ _0806A5CE:
bne _0806A608 bne _0806A608
adds r0, r6, 0 adds r0, r6, 0
adds r1, r6, 0 adds r1, r6, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_0806A608: _0806A608:
movs r1, 0x2 movs r1, 0x2
ldrsh r0, [r4, r1] ldrsh r0, [r4, r1]
@ -399,7 +399,7 @@ _0806A6C4:
beq _0806A6D2 beq _0806A6D2
adds r0, r6, 0 adds r0, r6, 0
mov r1, r8 mov r1, r8
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0806A6D2: _0806A6D2:
add sp, 0x4 add sp, 0x4
pop {r3} pop {r3}
@ -663,7 +663,7 @@ sub_806A898:
b _0806A8C8 b _0806A8C8
_0806A8C2: _0806A8C2:
adds r0, r4, 0 adds r0, r4, 0
bl MoveIfPossible bl AIMovement
_0806A8C8: _0806A8C8:
movs r0, 0xB6 movs r0, 0xB6
lsls r0, 1 lsls r0, 1
@ -817,7 +817,7 @@ _0806A9E0:
_0806A9E6: _0806A9E6:
ldr r1, [r0] ldr r1, [r0]
adds r0, r4, 0 adds r0, r4, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0806AA02 b _0806AA02
.align 2, 0 .align 2, 0
_0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage _0806A9F0: .4byte gPtrLinkMoveOneUseWarningMessage
@ -827,7 +827,7 @@ _0806A9F4:
ldr r0, _0806AA08 ldr r0, _0806AA08
ldr r1, [r0] ldr r1, [r0]
adds r0, r4, 0 adds r0, r4, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0806AA02: _0806AA02:
pop {r4,r5} pop {r4,r5}
pop {r0} pop {r0}
@ -1162,7 +1162,7 @@ _0806AC72:
bne _0806AC92 bne _0806AC92
adds r0, r6, 0 adds r0, r6, 0
adds r1, r4, 0 adds r1, r4, 0
bl SendImmobilizeEndMessage bl EndFrozenClassStatus
_0806AC92: _0806AC92:
adds r0, r4, 0 adds r0, r4, 0
movs r1, 0x45 movs r1, 0x45

View File

@ -359,7 +359,7 @@ _08072A0C:
ldr r0, _08072A44 ldr r0, _08072A44
mov r1, r9 mov r1, r9
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08072A48 ldr r0, _08072A48
add r1, sp, 0x40 add r1, sp, 0x40
bl strcpy bl strcpy
@ -417,7 +417,7 @@ _08072A92:
ldr r0, _08072AC0 ldr r0, _08072AC0
mov r1, r9 mov r1, r9
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08072AC4 ldr r0, _08072AC4
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9

View File

@ -148,11 +148,11 @@ _080733FC:
ldr r0, _08073438 ldr r0, _08073438
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807343C ldr r0, _0807343C
ldr r1, [r0] ldr r1, [r0]
mov r0, r8 mov r0, r8
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7 movs r0, 0x7
mov r1, r9 mov r1, r9
ands r1, r0 ands r1, r0
@ -360,11 +360,11 @@ _0807359C:
ldr r0, _08073600 ldr r0, _08073600
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _08073604 ldr r0, _08073604
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x7 movs r0, 0x7
mov r1, r8 mov r1, r8
ands r1, r0 ands r1, r0

View File

@ -165,7 +165,7 @@ _0807D634:
ldr r2, _0807D650 ldr r2, _0807D650
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807D9F4 b _0807D9F4
.align 2, 0 .align 2, 0
_0807D650: .4byte 0x00000d08 _0807D650: .4byte 0x00000d08
@ -585,7 +585,7 @@ _0807D996:
ldr r2, _0807D9C4 ldr r2, _0807D9C4
add r2, sp add r2, sp
ldr r0, [r2] ldr r0, [r2]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807D9EE b _0807D9EE
.align 2, 0 .align 2, 0
_0807D9B4: .4byte gUnknown_80F4468 _0807D9B4: .4byte gUnknown_80F4468
@ -605,7 +605,7 @@ _0807D9E0:
ldr r3, _0807DA0C ldr r3, _0807DA0C
add r3, sp add r3, sp
ldr r0, [r3] ldr r0, [r3]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807D9EE: _0807D9EE:
movs r0, 0x1 movs r0, 0x1
bl sub_807EC28 bl sub_807EC28
@ -647,7 +647,7 @@ sub_807DA14:
ldr r0, _0807DA48 ldr r0, _0807DA48
adds r1, r6, 0 adds r1, r6, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807DA4C ldr r0, _0807DA4C
b _0807DA5C b _0807DA5C
.align 2, 0 .align 2, 0
@ -818,7 +818,7 @@ _0807DB94:
_0807DBA0: _0807DBA0:
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DC54 b _0807DC54
.align 2, 0 .align 2, 0
_0807DBAC: .4byte gUnknown_80FD08C _0807DBAC: .4byte gUnknown_80FD08C
@ -878,7 +878,7 @@ _0807DBF4:
ldr r0, _0807DC2C ldr r0, _0807DC2C
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DC3A b _0807DC3A
.align 2, 0 .align 2, 0
_0807DC24: .4byte 0x0000fffc _0807DC24: .4byte 0x0000fffc
@ -888,7 +888,7 @@ _0807DC30:
ldr r0, _0807DC60 ldr r0, _0807DC60
ldr r1, [r0] ldr r1, [r0]
adds r0, r7, 0 adds r0, r7, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807DC3A: _0807DC3A:
ldr r0, _0807DC64 ldr r0, _0807DC64
ldr r0, [r0] ldr r0, [r0]
@ -953,7 +953,7 @@ _0807DCAC:
_0807DCB8: _0807DCB8:
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807DF0E b _0807DF0E
.align 2, 0 .align 2, 0
_0807DCC4: .4byte gUnknown_80FD3D0 _0807DCC4: .4byte gUnknown_80FD3D0
@ -1192,7 +1192,7 @@ _0807DE74:
ldr r0, _0807DF30 ldr r0, _0807DF30
ldr r1, [r0] ldr r1, [r0]
mov r0, r9 mov r0, r9
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r0, 0x28 movs r0, 0x28
movs r1, 0x2B movs r1, 0x2B
bl sub_803E708 bl sub_803E708
@ -1316,7 +1316,7 @@ _0807DF8E:
ldr r0, _0807DFB0 ldr r0, _0807DFB0
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
b _0807DFC2 b _0807DFC2
.align 2, 0 .align 2, 0
_0807DFA8: .4byte gDungeon _0807DFA8: .4byte gDungeon
@ -1346,7 +1346,7 @@ _0807DFD4:
ldr r0, _0807E184 ldr r0, _0807E184
mov r1, r10 mov r1, r10
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807E188 ldr r0, _0807E188
ldr r2, [r0] ldr r2, [r0]
ldr r0, [sp, 0x8] ldr r0, [sp, 0x8]

View File

@ -228,7 +228,7 @@ _0807E816:
ldr r0, _0807E884 ldr r0, _0807E884
ldr r1, [r0] ldr r1, [r0]
adds r0, r5, 0 adds r0, r5, 0
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807E844: _0807E844:
movs r5, 0 movs r5, 0
_0807E846: _0807E846:
@ -494,7 +494,7 @@ MudWaterSportEffect:
bl GetLeader bl GetLeader
ldr r1, _0807EA68 ldr r1, _0807EA68
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _0807EA8C b _0807EA8C
.align 2, 0 .align 2, 0
_0807EA5C: .4byte gUnknown_80F4EAC _0807EA5C: .4byte gUnknown_80F4EAC
@ -514,7 +514,7 @@ _0807EA6C:
bl GetLeader bl GetLeader
ldr r1, _0807EA9C ldr r1, _0807EA9C
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EA8C: _0807EA8C:
pop {r0} pop {r0}
bx r0 bx r0
@ -677,7 +677,7 @@ _0807EBA6:
bl GetLeader bl GetLeader
ldr r1, _0807EC1C ldr r1, _0807EC1C
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EBD4: _0807EBD4:
ldr r4, _0807EC14 ldr r4, _0807EC14
ldr r0, [r4] ldr r0, [r4]
@ -697,7 +697,7 @@ _0807EBD4:
bl GetLeader bl GetLeader
ldr r1, _0807EC24 ldr r1, _0807EC24
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_0807EC00: _0807EC00:
ldr r0, [sp, 0x8] ldr r0, [sp, 0x8]
add sp, 0xC add sp, 0xC
@ -1621,7 +1621,7 @@ sub_807F33C:
bl GetLeader bl GetLeader
ldr r1, _0807F428 ldr r1, _0807F428
ldr r1, [r1] ldr r1, [r1]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
movs r6, 0 movs r6, 0
_0807F360: _0807F360:
movs r5, 0 movs r5, 0
@ -1748,7 +1748,7 @@ sub_807F43C:
ldr r0, _0807F468 ldr r0, _0807F468
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F46C ldr r0, _0807F46C
b _0807F694 b _0807F694
.align 2, 0 .align 2, 0
@ -1761,7 +1761,7 @@ _0807F470:
ldr r0, _0807F488 ldr r0, _0807F488
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F48C ldr r0, _0807F48C
ldr r2, [r0] ldr r2, [r0]
mov r0, r8 mov r0, r8
@ -2046,7 +2046,7 @@ _0807F6A8:
ldr r0, _0807F860 ldr r0, _0807F860
mov r1, r8 mov r1, r8
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
ldr r0, _0807F864 ldr r0, _0807F864
ldr r2, [r0] ldr r2, [r0]
ldr r0, [sp, 0xEC] ldr r0, [sp, 0xEC]

View File

@ -206,7 +206,7 @@ _08080A26:
_08080A2E: _08080A2E:
ldr r1, [r0] ldr r1, [r0]
ldr r0, [sp, 0x14] ldr r0, [sp, 0x14]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
b _08080A46 b _08080A46
.align 2, 0 .align 2, 0
_08080A38: .4byte gUnknown_80FDACC _08080A38: .4byte gUnknown_80FDACC
@ -214,7 +214,7 @@ _08080A3C:
ldr r0, _08080A58 ldr r0, _08080A58
ldr r1, [r0] ldr r1, [r0]
ldr r0, [sp, 0x14] ldr r0, [sp, 0x14]
bl TryDisplayDungeonLoggableMessage bl LogMessageByIdWithPopupCheckUser
_08080A46: _08080A46:
add sp, 0x30 add sp, 0x30
pop {r3-r5} pop {r3-r5}

View File

@ -322,12 +322,12 @@ sub_8084448:
adds r1, r0, 0 adds r1, r0, 0
adds r0, r4, 0 adds r0, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r4, 0x50 adds r4, 0x50
adds r0, r4, 0 adds r0, r4, 0
adds r1, r5, 0 adds r1, r5, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r5, 0 adds r0, r5, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24
@ -516,12 +516,12 @@ sub_80845E0:
adds r1, r0, 0 adds r1, r0, 0
adds r0, r4, 0 adds r0, r4, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r4, 0x50 adds r4, 0x50
adds r0, r4, 0 adds r0, r4, 0
adds r1, r6, 0 adds r1, r6, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r6, 0 adds r0, r6, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24
@ -585,7 +585,7 @@ _08084680:
ldr r0, _0808469C ldr r0, _0808469C
adds r1, r7, 0 adds r1, r7, 0
movs r2, 0 movs r2, 0
bl SetMessageArgument bl SubstitutePlaceholderStringTags
adds r0, r7, 0 adds r0, r7, 0
bl sub_8070BC0 bl sub_8070BC0
lsls r0, 24 lsls r0, 24

View File

@ -3103,7 +3103,7 @@ _080A8F30:
ldrsh r1, [r0, r2] ldrsh r1, [r0, r2]
_080A8F34: _080A8F34:
adds r0, r4, 0 adds r0, r4, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
b _080A8F44 b _080A8F44
_080A8F3C: _080A8F3C:
ldr r1, _080A8F4C ldr r1, _080A8F4C

View File

@ -355,7 +355,7 @@ _080A184C:
bl sub_80A8BFC bl sub_80A8BFC
lsls r0, 16 lsls r0, 16
asrs r0, 16 asrs r0, 16
bl CanMove bl GetCanMoveFlag
b _080A171E b _080A171E
_080A185E: _080A185E:
lsls r0, r5, 16 lsls r0, r5, 16

View File

@ -753,7 +753,7 @@ _0808FDB0:
movs r3, 0 movs r3, 0
ldrsh r1, [r2, r3] ldrsh r1, [r2, r3]
adds r0, r6, 0 adds r0, r6, 0
bl CopyMonsterNametoBuffer bl CopyMonsterNameToBuffer
ldr r1, _0808FEF4 ldr r1, _0808FEF4
mov r2, r10 mov r2, r10
movs r3, 0 movs r3, 0

View File

@ -3,6 +3,6 @@
#include "structs/dungeon_entity.h" #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 #endif // GUARD_CODE_8045A00_H

View File

@ -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 sub_807A0CC(Entity * pokemon, Entity * target);
void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4); void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8 param_4);
void SendNonVolatileEndMessage(Entity * pokemon, Entity * target); 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 SendVolatileEndMessage(Entity * pokemon, Entity *target);
void SendProtectionEndMessage(Entity * pokemon, Entity *target); void SendProtectionEndMessage(Entity * pokemon, Entity *target);
void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus); void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus);

View File

@ -1,9 +1,9 @@
#ifndef GUARD_CONSTANTS_TARGETING_H #ifndef GUARD_CONSTANTS_TARGETING_H
#define GUARD_CONSTANTS_TARGETING_H #define GUARD_CONSTANTS_TARGETING_H
#define TARGETING_DECOY_NONE 0 #define DECOY_AI_NONE 0
#define TARGETING_DECOY_TEAM 1 #define DECOY_AI_TEAM 1
#define TARGETING_DECOY_WILD 2 #define DECOY_AI_WILD 2
#define TREATMENT_TREAT_AS_ALLY 0 #define TREATMENT_TREAT_AS_ALLY 0
#define TREATMENT_TREAT_AS_ENEMY 1 #define TREATMENT_TREAT_AS_ENEMY 1

View File

@ -13,7 +13,7 @@ struct AIPossibleMove
s32 weight; s32 weight;
}; };
void DecideAttack(Entity *pokemon); void ChooseAIMove(Entity *pokemon);
s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move); s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move *move);
bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range); bool8 IsTargetInLineRange(Entity *user, Entity *target, s32 range);
s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker); s32 TryAddTargetToAITargetList(s32 numPotentialTargets, s32 targetingFlags, Entity *user, Entity *target, Move *move, u32 hasStatusChecker);

View File

@ -3,7 +3,7 @@
#include "structs/dungeon_entity.h" #include "structs/dungeon_entity.h"
void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect); void AIMovement(Entity *pokemon, bool8 showRunAwayEffect);
bool8 CanTakeItem(Entity *pokemon); bool8 CanTakeItem(Entity *pokemon);
bool8 ChooseTargetPosition(Entity *pokemon); bool8 ChooseTargetPosition(Entity *pokemon);
void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect); void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect);

View File

@ -24,7 +24,7 @@ void sub_80521D0(void);
void sub_8052210(bool8 a0); 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. // 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 TryDisplayDungeonLoggableMessage2(Entity *pokemon, const u8 *str);
void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage3(Entity *attacker, Entity *target, const u8 *str);
void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str); void TryDisplayDungeonLoggableMessage4(Entity *attacker, Entity *target, const u8 *str);

View File

@ -16,7 +16,7 @@ Entity *GetPartnerEntity(void);
void sub_80854D4(void); void sub_80854D4(void);
void sub_80855E4(DungeonCallback func); void sub_80855E4(DungeonCallback func);
void sub_808563C(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_80856C8(Entity * pokemon, s32 x, s32 y);
void sub_80856E0(Entity * pokemon, s32 direction); void sub_80856E0(Entity * pokemon, s32 direction);
void sub_8085764(void); void sub_8085764(void);
@ -26,7 +26,7 @@ void ShiftCameraToPosition(Position32 *posStruct, s32 cameraSteps);
void SetFacingDirection(Entity *pokemon, s32 direction); void SetFacingDirection(Entity *pokemon, s32 direction);
void sub_8085930(s32 direction); void sub_8085930(s32 direction);
void sub_80859F0(s32 direction); void sub_80859F0(s32 direction);
bool8 IsMovingClient(Entity *entity); bool8 ShouldRunMonsterAI(Entity *entity);
void sub_8085B0C(Entity *pokemon); void sub_8085B0C(Entity *pokemon);
void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3); void sub_8085B4C(struct_8085B80 a0[], s16 *a1[], Entity *a2[], s32 a3);
void sub_80857B8(void); void sub_80857B8(void);

View File

@ -39,7 +39,7 @@ void InitializeRecruitedPokemon(void);
//u8 GetBodySize(s16 index); //u8 GetBodySize(s16 index);
void CopyMonsterNametoBuffer(u8 * buffer, s16 index); void CopyMonsterNameToBuffer(u8 * buffer, s16 index);
void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index); void CopyYellowMonsterNametoBuffer(u8 *buffer, s16 index);
void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum); void PrintColoredPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon, s32 colorNum);
void sub_808D930(u8 *buffer, s32 index); void sub_808D930(u8 *buffer, s32 index);
@ -56,7 +56,7 @@ char * GetMonSpecies(s16 index);
s32 GetMovementSpeed(s16 index); s32 GetMovementSpeed(s16 index);
u8 GetMovementType(s16 index); u8 GetMovementType(s16 index);
u8 GetRegenSpeed(s16 index); u8 GetRegenSpeed(s16 index);
bool8 CanMove(s16 index); bool8 GetCanMoveFlag(s16 index);
u8 GetChanceAsleep(s16 index); u8 GetChanceAsleep(s16 index);
u32 GetWeight(s16 index); u32 GetWeight(s16 index);
u32 GetSize(s16 index); u32 GetSize(s16 index);

View File

@ -5,6 +5,6 @@
extern const s16 gConfusedAttackChance; extern const s16 gConfusedAttackChance;
bool8 HasStatusAffectingActions(Entity *pokemon); bool8 HasStatusThatPreventsActing(Entity *pokemon);
#endif #endif

View File

@ -113,7 +113,7 @@ typedef struct Protection
typedef struct Waiting typedef struct Waiting
{ {
/* 0xC8 */ u8 waitingStatus; /* 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; u8 unkCA;
/* 0xCB */ u8 waitingStatusTurns; /* 0xCB */ u8 waitingStatusTurns;
/* 0xCC */ u8 curseDamageCountdown; /* 0xCC */ u8 curseDamageCountdown;
@ -231,7 +231,7 @@ typedef struct EntityInfo
/* 0x98 */ u32 unk98; /* 0x98 */ u32 unk98;
/* 0x9C */ u32 unk9C; /* 0x9C */ u32 unk9C;
/* 0xA0 */ s32 unkA0; /* 0xA0 */ s32 unkA0;
/* 0xA4 */ u8 clientType; /* 0xA4 */ u8 monsterBehavior;
u8 fillA5[0xA8 - 0xA5]; u8 fillA5[0xA8 - 0xA5];
// Statuses are split into groups based on which ones can't overlap. // Statuses are split into groups based on which ones can't overlap.
// See status.h for which statuses are in each group. // 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. /* 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 unkFE;
u8 unkFF; 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; /* 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 // 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. // speed-up/slow effects at once, like using Agility twice.
@ -280,7 +280,7 @@ typedef struct EntityInfo
/* 0x118 */ Moves moves; /* 0x118 */ Moves moves;
/* 0x13C */ FixedPoint belly; /* 0x13C */ FixedPoint belly;
/* 0x140 */ FixedPoint maxBelly; /* 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. /* 0x145 */ bool8 recalculateFollow; // Used by the AI to defer a movement decision until after all other Pokémon have moved.
/* 0x146 */ u8 unk146; /* 0x146 */ u8 unk146;
/* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn. /* 0x147 */ bool8 waiting; // True if an AI Pokémon decided to do nothing this turn.
@ -407,13 +407,45 @@ enum AIObjective
AI_TAKE_ITEM AI_TAKE_ITEM
}; };
enum ClientType enum MonsterBehavior
{ {
CLIENT_TYPE_NONE, BEHAVIOR_FIXED_ENEMY,
CLIENT_TYPE_CLIENT, // Used for mission clients that need rescuing. BEHAVIOR_RESCUE_TARGET, // Used for mission clients that need rescuing.
CLIENT_TYPE_PARTNER, BEHAVIOR_ALLY,
// 3 BEHAVIOR_SKARMORY,
CLIENT_TYPE_DONT_MOVE = 4 // Used for Diglett in the Skarmory boss fight. 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 enum VisualFlag

View File

@ -327,7 +327,7 @@ typedef struct Dungeon
/* 0x37F4 */ s32 unk37F4; /* 0x37F4 */ s32 unk37F4;
/* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team /* 0x37F8 */ bool8 plusIsActive[2]; // Index 0: Enemy , Index 1: Team
/* 0x37FA */ bool8 minusIsActive[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; /* 0x37FD */ u8 unk37FD;
/* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave /* 0x37FE */ bool8 deoxysDefeat; // Flag set for deoxys in Meteor Cave
/* 0x37FE */ u8 unk37FF; /* 0x37FE */ u8 unk37FF;
@ -383,7 +383,7 @@ typedef struct Dungeon
u8 fill1357A[0x1357C - 0x1357A]; u8 fill1357A[0x1357C - 0x1357A];
/* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS]; /* 0x1357C */ Entity *teamPokemon[MAX_TEAM_MEMBERS];
/* 0x1358C */ Entity *wildPokemon[DUNGEON_MAX_WILD_POKEMON]; /* 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]; /* 0x1361C */ Entity *items[DUNGEON_MAX_ITEMS];
/* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS]; /* 0x1371C */ Entity *traps[DUNGEON_MAX_TRAPS];
/* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS]; /* 0x1381C */ Entity teamPokemonEntities[MAX_TEAM_MEMBERS];

View File

@ -1066,7 +1066,7 @@ void sub_803F580(u8 a0)
if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) { if (strPtr->cameraPos.x != strPtr->cameraPosMirror.x || strPtr->cameraPos.y != strPtr->cameraPosMirror.y) {
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->allPokemon[i]; Entity *mon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(mon)) { if (EntityExists(mon)) {
sub_80402AC(mon->pos.x, mon->pos.y); sub_80402AC(mon->pos.x, mon->pos.y);
} }

View File

@ -44,7 +44,7 @@ void HandleLuminousOrbAction(Entity *pokemon)
sub_803F580(0); sub_803F580(0);
sub_8049ED4(); sub_8049ED4();
sub_8040A84(); sub_8040A84();
TryDisplayDungeonLoggableMessage(pokemon, gUnknown_80FD040); LogMessageByIdWithPopupCheckUser(pokemon, gUnknown_80FD040);
} }
void sub_8040094(u8 r0) void sub_8040094(u8 r0)

View File

@ -155,7 +155,7 @@ void sub_8041888(u8 param_1)
EntityInfo *entityInfo; EntityInfo *entityInfo;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if(EntityExists(entity)) if(EntityExists(entity))
{ {
entityInfo = GetEntInfo(entity); entityInfo = GetEntInfo(entity);

View File

@ -104,14 +104,14 @@ void sub_80427AC(void)
s32 i; s32 i;
for (i = 0; i < 20; i++) { for (i = 0; i < 20; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (EntityExists(entity)) { if (EntityExists(entity)) {
enInfo = GetEntInfo(entity); enInfo = GetEntInfo(entity);
if (enInfo->unkF3) { if (enInfo->unkF3) {
enInfo->unkF3 = FALSE; enInfo->unkF3 = FALSE;
sub_80429A0(entity); sub_80429A0(entity);
if (!enInfo->isNotTeamMember) { if (!enInfo->isNotTeamMember) {
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage); DisplayDungeonLoggableMessageTrue(entity, *gPtrFeralFoundItemMessage);
} }
} }

View File

@ -561,7 +561,7 @@ void xxx_dungeon_8042F6C(struct UnkStruct_xxx_dungeon_8042F6C *r8)
if (!r6) { if (!r6) {
s32 rnd; s32 rnd;
gDungeon->decoyActive = FALSE; gDungeon->decoyIsActive = FALSE;
rnd = DungeonRandInt(4); rnd = DungeonRandInt(4);
gDungeon->unk37FD = 0; gDungeon->unk37FD = 0;
gDungeon->deoxysDefeat = FALSE; gDungeon->deoxysDefeat = FALSE;
@ -1022,7 +1022,7 @@ void sub_8043D60(void)
unk = FALSE; unk = FALSE;
if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt)) if (IsClientOrTeamBase(monInfo->joinedAt.joinedAt))
unk = FALSE; unk = FALSE;
if (monInfo->clientType == CLIENT_TYPE_CLIENT) if (monInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
unk = FALSE; unk = FALSE;
if (unk) { if (unk) {

View File

@ -32,7 +32,7 @@ void sub_8045ACC(void)
{ {
entity = gDungeon->teamPokemon[index]; entity = gDungeon->teamPokemon[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
gDungeon->allPokemon[pokeCount] = entity; gDungeon->activeMonsterPtrs[pokeCount] = entity;
pokeCount++; pokeCount++;
} }
} }
@ -41,12 +41,12 @@ void sub_8045ACC(void)
{ {
entity = gDungeon->wildPokemon[index]; entity = gDungeon->wildPokemon[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
gDungeon->allPokemon[pokeCount] = entity; gDungeon->activeMonsterPtrs[pokeCount] = entity;
pokeCount++; pokeCount++;
} }
} }
for (; pokeCount < DUNGEON_MAX_POKEMON; 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; return -1;
} }
void SetMessageArgument(u8 *buffer, Entity *entity, u32 param_3) void SubstitutePlaceholderStringTags(u8 *buffer, Entity *entity, u32 param_3)
{ {
switch(GetEntityType(entity)) switch(GetEntityType(entity))
{ {

View File

@ -163,7 +163,7 @@ bool8 sub_8047930(Entity *pokemon, Entity *target)
bool8 flag; bool8 flag;
if (((GetEntInfo(target)->shopkeeper == TRUE) || 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; return FALSE;
} }
else { else {
@ -220,7 +220,7 @@ void sub_80479B8(char param_1, char param_2, u8 param_3, Entity *pokemon, Entity
} }
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
sub_8045BF8(gFormatBuffer_Items[0],item); 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 TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDBB8); // $m0 caught the $i0
info->heldItem = *item; info->heldItem = *item;
sub_806A6E8(target); sub_806A6E8(target);
@ -596,7 +596,7 @@ void RawstBerryItemAction(Entity *pokemon, Entity *target)
SendNonVolatileEndMessage(pokemon, target); SendNonVolatileEndMessage(pokemon, target);
else else
{ {
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
// Pointer to "But nothing happened!" // Pointer to "But nothing happened!"
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FB580); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FB580);
} }
@ -610,7 +610,7 @@ void HungerSeedItemAction(Entity *pokemon, Entity * target)
else else
{ {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
if (IQSkillIsEnabled(target, IQ_SELF_CURER)) if (IQSkillIsEnabled(target, IQ_SELF_CURER))
TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage); TryDisplayDungeonLoggableMessage3(pokemon, target, *gPtrSelfHealPreventedHungerMessage);
else else
@ -695,7 +695,7 @@ void BlastSeedItemAction(Entity *pokemon, Entity * target, u8 param_3)
uVar1 = gUnknown_80F4FA4; uVar1 = gUnknown_80F4FA4;
} }
if (entityInfo_1->immobilize.immobilizeStatus == STATUS_FROZEN) { 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); 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; uVar1 = gUnknown_80F4FA6;
} }
if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) { if (entityInfo->immobilize.immobilizeStatus == STATUS_FROZEN) {
SendImmobilizeEndMessage(pokemon, entity); EndFrozenClassStatus(pokemon, entity);
} }
sub_806F370(pokemon, entity, uVar1, 1, auStack28, 0, 0x216, 0, 0, 0); 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)) { if (CheckVariousStatuses2(entity, FALSE)) {
flag = FALSE; flag = FALSE;
} }
if (entityInfo->clientType == CLIENT_TYPE_CLIENT) { if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
flag = FALSE; flag = FALSE;
} }
if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) { if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) {
@ -894,7 +894,7 @@ bool8 sub_8048A68(Entity *param_1,Item *item)
if (CheckVariousStatuses2(entity, FALSE)) { if (CheckVariousStatuses2(entity, FALSE)) {
flag = FALSE; flag = FALSE;
} }
if (pEVar6->clientType == CLIENT_TYPE_CLIENT) { if (pEVar6->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
flag = FALSE; flag = FALSE;
} }
if (IsClientOrTeamBase(pEVar6->joinedAt.joinedAt)) { if (IsClientOrTeamBase(pEVar6->joinedAt.joinedAt)) {
@ -956,7 +956,7 @@ bool32 sub_8048B9C(Entity *entity,Item *param_2)
{ {
flag = FALSE; flag = FALSE;
} }
if(entity1Info->clientType == CLIENT_TYPE_CLIENT) if(entity1Info->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
{ {
flag = FALSE; flag = FALSE;
} }
@ -1034,14 +1034,14 @@ bool8 sub_8048D50(Entity * pokemon, Item *item)
if ((item->flags & ITEM_FLAG_STICKY) != 0) { if ((item->flags & ITEM_FLAG_STICKY) != 0) {
sub_8045BF8(gFormatBuffer_Items[0], item); sub_8045BF8(gFormatBuffer_Items[0], item);
TryDisplayDungeonLoggableMessage(pokemon,*gItemStickyDoesntWorkText); LogMessageByIdWithPopupCheckUser(pokemon,*gItemStickyDoesntWorkText);
return FALSE; return FALSE;
} }
else else
{ {
if ((entityInfo->muzzled.muzzled == TRUE) && (IsEdibleItem(item->id))) { if ((entityInfo->muzzled.muzzled == TRUE) && (IsEdibleItem(item->id))) {
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FDCA4); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FDCA4);
return FALSE; return FALSE;
} }
} }
@ -1083,27 +1083,27 @@ void GrimyFoodItemAction(Entity *pokemon, Entity * target)
void IcePartItemAction(Entity *pokemon, Entity *target, u8 r2) void IcePartItemAction(Entity *pokemon, Entity *target, u8 r2)
{ {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrIcePartCrumbledMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrIcePartCrumbledMessage);
} }
void RockPartItemAction(Entity *pokemon, Entity *target, u8 r2) void RockPartItemAction(Entity *pokemon, Entity *target, u8 r2)
{ {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrRockPartCrumbledMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrRockPartCrumbledMessage);
} }
void SteelPartItemAction(Entity *pokemon, Entity *target, u8 r2) void SteelPartItemAction(Entity *pokemon, Entity *target, u8 r2)
{ {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrSteelPartCrumbledMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrSteelPartCrumbledMessage);
} }
void WishStoneItemAction(Entity *pokemon, Entity *target, u8 r2) void WishStoneItemAction(Entity *pokemon, Entity *target, u8 r2)
{ {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrWishStoneCrumbledMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWishStoneCrumbledMessage);
} }
void MusicBoxItemAction(Entity *pokemon, Entity *target, u8 r2) void MusicBoxItemAction(Entity *pokemon, Entity *target, u8 r2)
{ {
sub_80421C0(pokemon, 0xD6); sub_80421C0(pokemon, 0xD6);
TryDisplayDungeonLoggableMessage(pokemon, *gPtrMusicBoxPlayedCrumbledMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMusicBoxPlayedCrumbledMessage);
sub_803E708(0x3C, 0x46); sub_803E708(0x3C, 0x46);
} }

View File

@ -20,7 +20,7 @@ void sub_8068768(void)
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (entity != NULL && EntityExists(entity)) if (entity != NULL && EntityExists(entity))
LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE); LoadPokemonSprite(GetEntInfo(entity)->apparentID, FALSE);

View File

@ -264,7 +264,7 @@ void DungeonHandlePlayerInput(void)
} }
} }
else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) { else if (ShouldMonsterRunAwayAndShowEffect(leader, TRUE)) {
TryDisplayDungeonLoggableMessage(leader, gUnknown_80FD4B0); LogMessageByIdWithPopupCheckUser(leader, gUnknown_80FD4B0);
sub_8044C50(1); sub_8044C50(1);
gDungeon->unk673 = 1; gDungeon->unk673 = 1;
break; break;
@ -279,7 +279,7 @@ void DungeonHandlePlayerInput(void)
} }
} }
if (i == MAX_MON_MOVES) { if (i == MAX_MON_MOVES) {
TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A28); LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A28);
break; break;
} }
@ -305,7 +305,7 @@ void DungeonHandlePlayerInput(void)
} }
} }
if (!canUseMove) { if (!canUseMove) {
TryDisplayDungeonLoggableMessage(leader, gUnknown_80F8A4C); LogMessageByIdWithPopupCheckUser(leader, gUnknown_80F8A4C);
} }
else { else {
SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER); SetMonsterActionFields(&leaderInfo->action, ACTION_USE_MOVE_PLAYER);
@ -529,7 +529,7 @@ void DungeonHandlePlayerInput(void)
if (!(canMoveFlags & 2)) { if (!(canMoveFlags & 2)) {
if (canMoveFlags & 1) { if (canMoveFlags & 1) {
if (immobilizedMsg != NULL) { if (immobilizedMsg != NULL) {
TryDisplayDungeonLoggableMessage(leader, immobilizedMsg); LogMessageByIdWithPopupCheckUser(leader, immobilizedMsg);
} }
sub_8044C50(1); sub_8044C50(1);
gDungeon->unk673 = 1; gDungeon->unk673 = 1;
@ -1545,7 +1545,7 @@ bool8 sub_805EC4C(Entity *a0, u8 a1)
if (tileMonsterInfo->isNotTeamMember if (tileMonsterInfo->isNotTeamMember
&& (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2) && (tileMonsterInfo->shopkeeper != 1 && tileMonsterInfo->shopkeeper != 2)
&& !IsClientOrTeamBase(tileMonsterInfo->joinedAt.joinedAt) && !IsClientOrTeamBase(tileMonsterInfo->joinedAt.joinedAt)
&& tileMonsterInfo->clientType != CLIENT_TYPE_CLIENT) { && tileMonsterInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET) {
return FALSE; return FALSE;
} }
@ -1668,7 +1668,7 @@ bool8 sub_805EF60(Entity *a0, EntityInfo *a1)
return FALSE; return FALSE;
if (!sub_8070BC0(a0)) if (!sub_8070BC0(a0))
return FALSE; 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; return FALSE;
SetMonsterActionFields(&a1->action, ACTION_TALK_FIELD); SetMonsterActionFields(&a1->action, ACTION_TALK_FIELD);
@ -1753,8 +1753,8 @@ void sub_805F02C(void)
sub_803F508(r7); sub_803F508(r7);
sub_8041AD0(leader); sub_8041AD0(leader);
sub_8041AE0(GetLeader()); sub_8041AE0(GetLeader());
SetMessageArgument(gFormatBuffer_Monsters[0], r7, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], r7, 0);
TryDisplayDungeonLoggableMessage(r7, gUnknown_80F9BB0); LogMessageByIdWithPopupCheckUser(r7, gUnknown_80F9BB0);
sub_807EC28(FALSE); sub_807EC28(FALSE);
r8->unk64 = 0; r8->unk64 = 0;
leaderInfo->unk64 = 0; leaderInfo->unk64 = 0;
@ -2116,7 +2116,7 @@ void ShowFieldMenu(u8 a0_, bool8 a1)
break; break;
} }
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0], GetLeader(), 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], GetLeader(), 0);
DisplayDungeonMessage(0, gUnknown_80FDE18, 1); DisplayDungeonMessage(0, gUnknown_80FDE18, 1);
} }
} }
@ -2252,7 +2252,7 @@ void DrawFieldMenu(u8 a0)
Entity *teamMon = gDungeon->teamPokemon[i]; Entity *teamMon = gDungeon->teamPokemon[i];
if (EntityExists(teamMon)) { if (EntityExists(teamMon)) {
EntityInfo *monInfo = GetEntInfo(teamMon); EntityInfo *monInfo = GetEntInfo(teamMon);
SetMessageArgument(gFormatBuffer_Monsters[0], teamMon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], teamMon, 0);
gFormatArgs[0] = monInfo->HP; gFormatArgs[0] = monInfo->HP;
gFormatArgs[1] = monInfo->maxHPStat; gFormatArgs[1] = monInfo->maxHPStat;
PrintFormattedStringOnWindow(4, yLoop, gUnknown_80F91E0, 2, 0); PrintFormattedStringOnWindow(4, yLoop, gUnknown_80F91E0, 2, 0);
@ -3652,7 +3652,7 @@ void ShowTacticsMenu(ActionContainer *a0)
monInfo->aiTarget.unkC = 0; monInfo->aiTarget.unkC = 0;
monInfo->aiTarget.aiTargetSpawnGenID = 0; monInfo->aiTarget.aiTargetSpawnGenID = 0;
if (!monInfo->isTeamLeader) { if (!monInfo->isTeamLeader) {
MoveIfPossible(teamMon, TRUE); AIMovement(teamMon, TRUE);
} }
} }
else { else {

View File

@ -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_EXISTS)) && ((itemPtr->flags & ITEM_FLAG_SET))) {
if ((itemPtr->flags & ITEM_FLAG_STICKY)) { if ((itemPtr->flags & ITEM_FLAG_STICKY)) {
sub_8045BF8(gFormatBuffer_Items[0],itemPtr); sub_8045BF8(gFormatBuffer_Items[0],itemPtr);
TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotEquip); LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotEquip);
return; return;
} }
itemPtr->flags &= ~(ITEM_FLAG_SET); itemPtr->flags &= ~(ITEM_FLAG_SET);
@ -64,22 +64,22 @@ void HandleSetItemAction(Entity *param_1, bool8 param_2)
PlaySoundEffect(0x133); PlaySoundEffect(0x133);
if (param_2 != 0) { if (param_2 != 0) {
if ((item->flags & ITEM_FLAG_STICKY)) { if ((item->flags & ITEM_FLAG_STICKY)) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D04); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D04);
} }
else { else {
if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) { if (GetItemCategory(item->id) == CATEGORY_THROWN_LINE) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE4); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE4);
} }
else else
{ {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8CE8); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8CE8);
} }
} }
} }
item->flags |= ITEM_FLAG_SET; item->flags |= ITEM_FLAG_SET;
if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) { if (((item->flags & ITEM_FLAG_STICKY)) && (param_2 != 0)) {
sub_8045BF8(gFormatBuffer_Items[0],item); 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_EXISTS)) && ((item->flags & ITEM_FLAG_SET))) {
if ((item->flags & ITEM_FLAG_STICKY)) { if ((item->flags & ITEM_FLAG_STICKY)) {
sub_8045BF8(gFormatBuffer_Items[0],item); sub_8045BF8(gFormatBuffer_Items[0],item);
TryDisplayDungeonLoggableMessage(entity,*gItemStickyCannotEquip); LogMessageByIdWithPopupCheckUser(entity,*gItemStickyCannotEquip);
return; return;
} }
item->flags &= ~(ITEM_FLAG_SET); item->flags &= ~(ITEM_FLAG_SET);
sub_8045BF8(gFormatBuffer_Items[0],item); sub_8045BF8(gFormatBuffer_Items[0],item);
PlaySoundEffect(0x133); PlaySoundEffect(0x133);
if (enableMessage) { 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))) { if ((!bVar3) && ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET))) {
sub_8045BF8(gFormatBuffer_Items[1],item); sub_8045BF8(gFormatBuffer_Items[1],item);
TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove2); LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove2);
} }
else 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_EXISTS)) {
if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) { if (((info2->heldItem).flags & ITEM_FLAG_STICKY)) {
sub_8045BF8(gFormatBuffer_Items[1],&info2->heldItem); sub_8045BF8(gFormatBuffer_Items[1],&info2->heldItem);
TryDisplayDungeonLoggableMessage(param_1,*gItemStickyCannotMove1); LogMessageByIdWithPopupCheckUser(param_1,*gItemStickyCannotMove1);
return; return;
} }
item1 = (info2->heldItem); item1 = (info2->heldItem);
@ -158,9 +158,9 @@ void HandleGiveItemAction(Entity *param_1)
sub_8045BF8(gFormatBuffer_Items[0],&item2); sub_8045BF8(gFormatBuffer_Items[0],&item2);
sub_8045BF8(gFormatBuffer_Items[1],&item1); sub_8045BF8(gFormatBuffer_Items[1],&item1);
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
TryDisplayDungeonLoggableMessage(param_1,*gMonTookAndReturnedItem); LogMessageByIdWithPopupCheckUser(param_1,*gMonTookAndReturnedItem);
if ((item2.flags & ITEM_FLAG_STICKY)) { if ((item2.flags & ITEM_FLAG_STICKY)) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0);
} }
} }
else { else {
@ -170,9 +170,9 @@ void HandleGiveItemAction(Entity *param_1)
info2->heldItem = item3; info2->heldItem = item3;
sub_8045BF8(gFormatBuffer_Items[0],&item3); sub_8045BF8(gFormatBuffer_Items[0],&item3);
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D44); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D44);
if ((item3.flags & ITEM_FLAG_STICKY)) { if ((item3.flags & ITEM_FLAG_STICKY)) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0);
} }
} }
sub_806A6E8(entity); sub_806A6E8(entity);
@ -198,24 +198,24 @@ void HandleTakeItemAction(Entity *param_1)
info = GetEntInfo(entity); info = GetEntInfo(entity);
heldItem = &info->heldItem; heldItem = &info->heldItem;
if (ItemExists(&gTeamInventoryRef->teamItems[ITEM_POWER_BAND])) { if (ItemExists(&gTeamInventoryRef->teamItems[ITEM_POWER_BAND])) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D60); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D60);
} }
else else
{ {
if (ItemSticky(heldItem)) { if (ItemSticky(heldItem)) {
sub_8045BF8(gFormatBuffer_Items[0],heldItem); sub_8045BF8(gFormatBuffer_Items[0],heldItem);
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0);
} }
else else
{ {
item = *heldItem; item = *heldItem;
item.flags &= ~(ITEM_FLAG_SET); item.flags &= ~(ITEM_FLAG_SET);
sub_8045BF8(gFormatBuffer_Items[0],&item); sub_8045BF8(gFormatBuffer_Items[0],&item);
SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
ZeroOutItem(heldItem); ZeroOutItem(heldItem);
AddItemToInventory(&item); AddItemToInventory(&item);
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8D7C); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8D7C);
sub_806A6E8(entity); sub_806A6E8(entity);
if (sub_80706A4(entity,&entity->pos) != 0) { if (sub_80706A4(entity,&entity->pos) != 0) {
sub_807D148(param_1,entity,0,0); sub_807D148(param_1,entity,0,0);
@ -243,11 +243,11 @@ void sub_8066BD4(Entity *param_1)
if (heldItem->flags & ITEM_FLAG_STICKY) if (heldItem->flags & ITEM_FLAG_STICKY)
{ {
sub_8045BF8(gFormatBuffer_Items[0],heldItem); 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)) { else if ((item->flags & (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) == (ITEM_FLAG_STICKY | ITEM_FLAG_SET)) {
sub_8045BF8(gFormatBuffer_Items[0],item); sub_8045BF8(gFormatBuffer_Items[0],item);
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8BE0); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8BE0);
} }
else else
{ {
@ -255,12 +255,12 @@ void sub_8066BD4(Entity *param_1)
item->flags &= ~(ITEM_FLAG_SET); item->flags &= ~(ITEM_FLAG_SET);
sub_8045BF8(gFormatBuffer_Items[0],heldItem); sub_8045BF8(gFormatBuffer_Items[0],heldItem);
sub_8045BF8(gFormatBuffer_Items[1],item); sub_8045BF8(gFormatBuffer_Items[1],item);
SetMessageArgument(gFormatBuffer_Monsters[1],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],entity,0);
temp = info->heldItem; temp = info->heldItem;
info->heldItem = *item; info->heldItem = *item;
*item = temp; *item = temp;
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80F8DB4); LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80F8DB4);
if (sub_80706A4(entity,&entity->pos) != 0) { if (sub_80706A4(entity,&entity->pos) != 0) {
sub_807D148(param_1,entity,0,0); sub_807D148(param_1,entity,0,0);
} }
@ -296,13 +296,13 @@ void HandlePlaceItemAction(Entity *param_1)
item = sub_8044D90(entity,0,4); item = sub_8044D90(entity,0,4);
sub_8045BF8(gFormatBuffer_Items[0],item); sub_8045BF8(gFormatBuffer_Items[0],item);
if (info->action.unk4[0].actionUseIndex == 0x80) { 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))) { 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))) { else if ((info->action.unk4[0].actionUseIndex == 0x81) && ((item->flags & ITEM_FLAG_STICKY))) {
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8BE0); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8BE0);
} }
else { else {
tile = GetTile(entity->pos.x, entity->pos.y); tile = GetTile(entity->pos.x, entity->pos.y);
@ -314,7 +314,7 @@ void HandlePlaceItemAction(Entity *param_1)
sub_8045BF8(gFormatBuffer_Items[0],item); sub_8045BF8(gFormatBuffer_Items[0],item);
if (sub_80460F8(&entity->pos,item,1) == 0) { if (sub_80460F8(&entity->pos,item,1) == 0) {
_message: _message:
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E04); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E04);
} }
else else
{ {
@ -323,8 +323,8 @@ void HandlePlaceItemAction(Entity *param_1)
item->flags = 0; item->flags = 0;
FillInventoryGaps(); FillInventoryGaps();
PlaySoundEffect(0x14d); PlaySoundEffect(0x14d);
SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80F8E28); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80F8E28);
sub_807AB38(entity,gDungeon->unk3A08); sub_807AB38(entity,gDungeon->unk3A08);
} }
} }

View File

@ -74,7 +74,7 @@ void TriggerWeatherAbilities(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
if (HasAbility(entity, ABILITY_DRIZZLE)) { if (HasAbility(entity, ABILITY_DRIZZLE)) {
gDungeon->weather.naturalWeather[WEATHER_RAIN] = 1; 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]; iVar6->abilities[abilityIndex] = local_20[randomIndex];
gDungeon->unkC = 1; gDungeon->unkC = 1;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC7C); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC7C);
sub_8042900(target); sub_8042900(target);
sub_806ABAC(pokemon,target); sub_806ABAC(pokemon,target);
@ -190,7 +190,7 @@ _0806A068:
iVar6->types[0] = type; iVar6->types[0] = type;
iVar6->types[1] = TYPE_NONE; iVar6->types[1] = TYPE_NONE;
iVar6->isColorChanged = TRUE; iVar6->isColorChanged = TRUE;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
__src = GetUnformattedTypeString(iVar6->types[0]); __src = GetUnformattedTypeString(iVar6->types[0]);
strcpy(gFormatBuffer_Items[0],__src); strcpy(gFormatBuffer_Items[0],__src);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCAC); 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[0] = uVar2_u32;
entityInfo->types[1] = 0; entityInfo->types[1] = 0;
sub_8041BBC(target); sub_8041BBC(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
typeString = GetUnformattedTypeString(uVar2_u32); typeString = GetUnformattedTypeString(uVar2_u32);
strcpy(gFormatBuffer_Items[0],typeString); strcpy(gFormatBuffer_Items[0],typeString);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCC8);
@ -301,7 +301,7 @@ void sub_806A338(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) 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)) if (EntityExists(entity) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH))
{ {
gDungeon->snatchPokemon = entity; gDungeon->snatchPokemon = entity;

View File

@ -49,7 +49,7 @@ void sub_806CC10(void)
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (EntityExists(entity)) { if (EntityExists(entity)) {
entityInfo = GetEntInfo(entity); entityInfo = GetEntInfo(entity);
@ -69,7 +69,7 @@ void sub_806CC70(void)
Entity *entity; Entity *entity;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (EntityExists(entity)) if (EntityExists(entity))
sub_806CCB4(entity, sub_806CEBC(entity)); sub_806CCB4(entity, sub_806CEBC(entity));
@ -116,7 +116,7 @@ void sub_806CD90(void)
Entity *entity; Entity *entity;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (EntityExists(entity)) if (EntityExists(entity))
sub_806CCB4(entity, sub_806CEBC(entity)); sub_806CCB4(entity, sub_806CEBC(entity));
@ -227,7 +227,7 @@ void sub_806CF60(void)
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
entity = gDungeon->allPokemon[i]; entity = gDungeon->activeMonsterPtrs[i];
if (EntityExists(entity)) if (EntityExists(entity))
sub_806CF98(entity); sub_806CF98(entity);
@ -473,7 +473,7 @@ void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *
if (r9) { if (r9) {
EntityInfo *targetInfo = GetEntInfo(target); EntityInfo *targetInfo = GetEntInfo(target);
if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) { if (targetInfo->linked.linkedStatus == STATUS_DESTINY_BOND) {
Entity *destBondTarget = gDungeon->allPokemon[targetInfo->linked.unkD8]; Entity *destBondTarget = gDungeon->activeMonsterPtrs[targetInfo->linked.unkD8];
if (destBondTarget == NULL) { if (destBondTarget == NULL) {
targetInfo->linked.linkedStatus = 0; 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) { 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); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FCA90);
sub_8042238(attacker, target); sub_8042238(attacker, target);
dmgStruct->tookNoDamage = TRUE; dmgStruct->tookNoDamage = TRUE;
return FALSE; return FALSE;
} }
if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) { if (targetData->immobilize.immobilizeStatus == STATUS_FROZEN) {
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9600);
sub_8042238(attacker, target); sub_8042238(attacker, target);
dmgStruct->tookNoDamage = TRUE; dmgStruct->tookNoDamage = TRUE;
@ -568,8 +568,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
} }
} }
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (dmgStruct->dmg == 0) { if (dmgStruct->dmg == 0) {
if (sub_8045888(attacker) && sub_8045888(target)) { if (sub_8045888(attacker) && sub_8045888(target)) {
if (targetData->unk152 == 0) { if (targetData->unk152 == 0) {
@ -715,8 +715,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
r8 = 0; r8 = 0;
targetData->unk14C = 0; targetData->unk14C = 0;
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) { if (dmgStruct->residualDmgType == 19 || dmgStruct->residualDmgType == 20) {
if (targetData->isNotTeamMember) { if (targetData->isNotTeamMember) {
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44); TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80F9E44);
@ -727,7 +727,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
} }
else if (targetData->isNotTeamMember) else if (targetData->isNotTeamMember)
{ {
if (targetData->clientType == CLIENT_TYPE_CLIENT) { if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]);
} }
else { else {
@ -742,7 +742,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) { else if (IsClientOrTeamBase(targetData->joinedAt.joinedAt)) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DAC[r8]);
} }
else if (targetData->clientType == CLIENT_TYPE_CLIENT) { else if (targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET) {
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80F9DF0[r8]);
} }
else if (sub_806A58C(recruitedMon->unkA)) { else if (sub_806A58C(recruitedMon->unkA)) {
@ -791,7 +791,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_806A390(target); sub_806A390(target);
sub_806CCB4(target, sub_806CEBC(target)); sub_806CCB4(target, sub_806CEBC(target));
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C);
sub_806F63C(target); sub_806F63C(target);
return FALSE; return FALSE;
@ -848,8 +848,8 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_806A390(target); sub_806A390(target);
sub_806CCB4(target, sub_806CEBC(target)); sub_806CCB4(target, sub_806CEBC(target));
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
SetMessageArgument(gFormatBuffer_Monsters[1], teamMember, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], teamMember, 0);
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD484);
sub_806F63C(target); sub_806F63C(target);
return FALSE; return FALSE;
@ -902,7 +902,7 @@ static bool8 HandleDealingDamageInternal(Entity *attacker, Entity *target, struc
sub_806A390(target); sub_806A390(target);
sub_806CCB4(target, sub_806CEBC(target)); sub_806CCB4(target, sub_806CEBC(target));
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C); DisplayDungeonLoggableMessageTrue(attacker, gUnknown_80FD46C);
sub_806F63C(target); sub_806F63C(target);
return FALSE; return FALSE;

View File

@ -322,7 +322,7 @@ void CalcDamage(Entity *attacker, Entity *target, u8 moveType, s32 movePower, s3
s32 flashFireStatus = GetFlashFireStatus(target); s32 flashFireStatus = GetFlashFireStatus(target);
if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) { if (flashFireStatus != FLASH_FIRE_STATUS_NONE && targetInfo->unk152 == 0 && arg_10) {
targetInfo->unk152 = 1; targetInfo->unk152 = 1;
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) {
TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger! TryDisplayDungeonLoggableMessage3(attacker, target, gUnknown_80FAE00); // Fire moves won't become stronger!
} }

View File

@ -229,7 +229,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target)
(targetInfo->id != MONSTER_JIRACHI) && (targetInfo->id != MONSTER_JIRACHI) &&
(targetInfo->id != MONSTER_RAYQUAZA) && (targetInfo->id != MONSTER_RAYQUAZA) &&
(targetInfo->id != MONSTER_DEOXYS_NORMAL) && (targetInfo->id != MONSTER_DEOXYS_NORMAL) &&
(targetInfo->id != 0MONSTER_REGIROCK && (targetInfo->id != MONSTER_REGIROCK &&
(targetInfo->id != MONSTER_REGICE) && (targetInfo->id != MONSTER_REGICE) &&
(targetInfo->id != MONSTER_REGISTEEL)) || (HasRecruitedMon(targetInfo->id) == 0)) && (targetInfo->id != MONSTER_REGISTEEL)) || (HasRecruitedMon(targetInfo->id) == 0)) &&
(sub_806F9BC(targetInfo->id) != 0)) { (sub_806F9BC(targetInfo->id) != 0)) {
@ -243,7 +243,7 @@ bool8 sub_806F660(Entity *pokemon,Entity *target)
iVar5 = -iVar5; iVar5 = -iVar5;
} }
if (((iVar5 < 2) && (targetInfo->joinedAt.joinedAt != 0x4A)) && if (((iVar5 < 2) && (targetInfo->joinedAt.joinedAt != 0x4A)) &&
(targetInfo->clientType != 1 && (CanSeeTarget(target,pokemon)) (targetInfo->monsterBehavior != 1 && (CanSeeTarget(target,pokemon))
)) { )) {
sub_806F910(); sub_806F910();
iVar4 = DungeonRandInt(1000); 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 (DisplayDungeonYesNoMessage(0,*gUnknown_80F9FE8,1) == 0) {
if (param_3->id != MONSTER_JIRACHI) { if (param_3->id != MONSTER_JIRACHI) {
TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA004); LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA004);
} }
return 0; return 0;
} }
@ -759,7 +759,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
} }
if (pokeIndex == MAX_TEAM_MEMBERS) { if (pokeIndex == MAX_TEAM_MEMBERS) {
TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA030); LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA030);
return FALSE; return FALSE;
} }
else { else {
@ -800,7 +800,7 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
sub_8097848(); sub_8097848();
if (sub_806B8CC(param_3->id,param_3->pos.x,param_3->pos.y,pokeStruct2,&local_2c,0,1) == 0) { 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; pokeStruct2->unk0 = 0;
} }
else { else {
@ -812,10 +812,10 @@ bool8 sub_806FA5C(Entity *entity1, Entity *entity2, struct unkStruct_8069D4C *pa
} }
} }
sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0); sub_808D9DC(gFormatBuffer_Monsters[0],pokeStruct2,0);
TryDisplayDungeonLoggableMessage(entity1,*gUnknown_80FA0F0); LogMessageByIdWithPopupCheckUser(entity1,*gUnknown_80FA0F0);
if (flag) { if (flag) {
leader = xxx_call_GetLeader(); leader = xxx_call_GetLeader();
SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea,friendArea); sub_8092558(gFormatBuffer_FriendArea,friendArea);
PlaySound(0xce); PlaySound(0xce);
DisplayDungeonMessage(0,*gUnknown_80FA120,1); DisplayDungeonMessage(0,*gUnknown_80FA120,1);
@ -1074,7 +1074,7 @@ bool8 sub_806FDF4(Entity *entity1,Entity *entity2,Entity **entityPtr)
} }
if (flag) { if (flag) {
leader = xxx_call_GetLeader(); leader = xxx_call_GetLeader();
SetMessageArgument(gFormatBuffer_Monsters[0],leader,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],leader,0);
sub_8092558(gFormatBuffer_FriendArea,friendArea); sub_8092558(gFormatBuffer_FriendArea,friendArea);
PlaySound(0xce); PlaySound(0xce);
DisplayDungeonMessage(0,*gUnknown_80FA120,1); DisplayDungeonMessage(0,*gUnknown_80FA120,1);

View File

@ -99,7 +99,7 @@ void sub_8071B48(void)
if (dungeon->unk662 > 900) { if (dungeon->unk662 > 900) {
entity2 = dungeon->unk17B34; entity2 = dungeon->unk17B34;
if ((EntityExists(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) { if ((EntityExists(entity2)) && (entity2->spawnGenID == dungeon->unk17B40)) {
SetMessageArgument(gFormatBuffer_Monsters[0],entity2,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity2,0);
entityPtr = entity2; entityPtr = entity2;
} }
} }
@ -449,7 +449,7 @@ void sub_8071DA4(Entity *entity)
" ldr r0, _08071FF8\n" " ldr r0, _08071FF8\n"
" mov r1, r8\n" " mov r1, r8\n"
" movs r2, 0\n" " movs r2, 0\n"
" bl SetMessageArgument\n" " bl SubstitutePlaceholderStringTags\n"
" lsls r1, r4, 24\n" " lsls r1, r4, 24\n"
" lsrs r1, 24\n" " lsrs r1, 24\n"
" ldr r0, _08071FFC\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++) for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++)
{ {
if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex); CopyTacticsNameToBuffer(gFormatBuffer_Items[0],tacticIndex);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FF730); 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->expGainedInTurn = 0;
info->unk149 = 0; info->unk149 = 0;
if ((flag == 0) && (param_4 != 0)) { if ((flag == 0) && (param_4 != 0)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F9B74);
} }
} }
@ -668,7 +668,7 @@ void LevelDownTarget(Entity *pokemon, Entity *target, u32 level)
if(!flag) if(!flag)
{ {
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80F9B94);
} }
} }

View File

@ -138,14 +138,14 @@ void sub_8073D14(Entity *entity)
return; return;
if (sub_8044B28()) if (sub_8044B28())
return; return;
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
if (entityInfo->isTeamLeader) if (entityInfo->isTeamLeader)
return; return;
if (entityInfo->shopkeeper == 1) if (entityInfo->shopkeeper == 1)
return; return;
if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt)) if (IsClientOrTeamBase(entityInfo->joinedAt.joinedAt))
return; return;
if (entityInfo->clientType == CLIENT_TYPE_CLIENT) if (entityInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
return; return;
_entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason. _entityInfo = GetEntInfo(entity); // Reloaded as a new variable for some reason.
@ -155,7 +155,7 @@ void sub_8073D14(Entity *entity)
if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) { if (ShouldMonsterRunAwayAndShowEffect(entity, TRUE)) {
sub_8045BF8(gFormatBuffer_Items[0], groundItem); sub_8045BF8(gFormatBuffer_Items[0], groundItem);
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem); DisplayDungeonLoggableMessageTrue(entity, gMonTerrifiedCouldntPickUpItem);
} }
else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) { else if (!_entityInfo->isNotTeamMember && GetItemCategory(groundItem->id) == CATEGORY_POKE) {
@ -265,7 +265,7 @@ void sub_8073D14(Entity *entity)
DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2); DisplayDungeonLoggableMessageTrue(entity, gMonPickedUpItem2);
} }
else if (AddItemToInventory(groundItem)) { else if (AddItemToInventory(groundItem)) {
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem); DisplayDungeonLoggableMessageTrue(entity, gMonCouldntPickUpItem);
} }
else { else {
@ -383,7 +383,7 @@ void sub_8074094(Entity *entity)
if (str != NULL) { if (str != NULL) {
if (sound) if (sound)
PlaySoundEffect(0x153); PlaySoundEffect(0x153);
TryDisplayDungeonLoggableMessage(entity, str); LogMessageByIdWithPopupCheckUser(entity, str);
sub_803E708(0x1E, 0x32); sub_803E708(0x1E, 0x32);
} }
} }
@ -529,7 +529,7 @@ void sub_8074094(Entity *entity)
if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) { if (entityInfo->linked.linkedStatus == STATUS_LEECH_SEED) {
if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) { if (entityInfo->linked.linkedStatusDamageCountdown == 0 || --entityInfo->linked.linkedStatusDamageCountdown == 0) {
s32 hp = gUnknown_80F4FB4; s32 hp = gUnknown_80F4FB4;
Entity *target = gDungeon->allPokemon[entityInfo->linked.unkD8]; Entity *target = gDungeon->activeMonsterPtrs[entityInfo->linked.unkD8];
entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40; entityInfo->linked.linkedStatusDamageCountdown = gUnknown_80F4F40;
if (target == NULL) { if (target == NULL) {
@ -571,11 +571,11 @@ void sub_8074094(Entity *entity)
UseAttack(NULL); UseAttack(NULL);
if (!EntityExists(entity) || sub_8044B28()) if (!EntityExists(entity) || sub_8044B28())
return; return;
SetMessageArgument(gFormatBuffer_Monsters[1], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], entity, 0);
TryDisplayDungeonLoggableMessage(entity, gUnknown_80FEB30); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FEB30);
TrySendImmobilizeSleepEndMsg(entity, entity); TrySendImmobilizeSleepEndMsg(entity, entity);
if (entityInfo->protection.protectionStatus == STATUS_PROTECT) { if (entityInfo->protection.protectionStatus == STATUS_PROTECT) {
TryDisplayDungeonLoggableMessage(entity, gPtrProtectSavedItMessage); LogMessageByIdWithPopupCheckUser(entity, gPtrProtectSavedItMessage);
} }
else { else {
DealDamageToEntity(entity, 0x270F, 0xB, 0x20E); DealDamageToEntity(entity, 0x270F, 0xB, 0x20E);
@ -611,8 +611,8 @@ void sub_8074094(Entity *entity)
if (entityInfo->charging.chargingStatusTurns == 0) { if (entityInfo->charging.chargingStatusTurns == 0) {
entityInfo->charging.chargingStatus = 0; entityInfo->charging.chargingStatus = 0;
entityInfo->unk14A = 0; entityInfo->unk14A = 0;
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
TryDisplayDungeonLoggableMessage(entity, gUnknown_80FABD8); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FABD8);
} }
} }
@ -686,7 +686,7 @@ void TickStatusHeal(Entity *entity)
if (entityInfo->immobilize.immobilizeStatus != 0) { if (entityInfo->immobilize.immobilizeStatus != 0) {
sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns); sub_80838EC(&entityInfo->immobilize.immobilizeStatusTurns);
if (entityInfo->immobilize.immobilizeStatusTurns == 0) { if (entityInfo->immobilize.immobilizeStatusTurns == 0) {
SendImmobilizeEndMessage(entity, entity); EndFrozenClassStatus(entity, entity);
} }
} }
if (!EntityExists(entity) || sub_8044B28()) if (!EntityExists(entity) || sub_8044B28())
@ -767,8 +767,8 @@ void TickStatusHeal(Entity *entity)
if (entityInfo->terrifiedTurns != 0) { if (entityInfo->terrifiedTurns != 0) {
sub_80838EC(&entityInfo->terrifiedTurns); sub_80838EC(&entityInfo->terrifiedTurns);
if (entityInfo->terrifiedTurns == 0) { if (entityInfo->terrifiedTurns == 0) {
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
TryDisplayDungeonLoggableMessage(entity, gPtrStenchWavedOffMessage); LogMessageByIdWithPopupCheckUser(entity, gPtrStenchWavedOffMessage);
} }
} }
@ -791,8 +791,8 @@ void TickStatusHeal(Entity *entity)
s32 newSpdStage = CalcSpeedStage(entity); s32 newSpdStage = CalcSpeedStage(entity);
if (oldSpdStage != newSpdStage) { if (oldSpdStage != newSpdStage) {
SetMessageArgument(gFormatBuffer_Monsters[0], entity, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], entity, 0);
TryDisplayDungeonLoggableMessage(entity, gUnknown_80FA124[newSpdStage]); LogMessageByIdWithPopupCheckUser(entity, gUnknown_80FA124[newSpdStage]);
} }
} }
} }
@ -893,7 +893,7 @@ bool8 UseAttack(Entity *a0)
gUnknown_202F378 = 1; gUnknown_202F378 = 1;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->allPokemon[i]; Entity *mon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(mon)) { if (EntityExists(mon)) {
EntityInfo *monInfo = GetEntInfo(mon); EntityInfo *monInfo = GetEntInfo(mon);
if (monInfo->numMoveTiles == 0) { if (monInfo->numMoveTiles == 0) {
@ -935,7 +935,7 @@ bool8 UseAttack(Entity *a0)
for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { for (loop = 0; loop < 24 / gUnknown_202F378; loop++) {
sub_803E46C(7); sub_803E46C(7);
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->allPokemon[i]; Entity *mon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(mon)) { if (EntityExists(mon)) {
EntityInfo *monInfo = GetEntInfo(mon); EntityInfo *monInfo = GetEntInfo(mon);
Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving]; Unk_Entity_x184 *strPtr = &monInfo->unk184[monInfo->notMoving];
@ -963,7 +963,7 @@ bool8 UseAttack(Entity *a0)
} }
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *mon = gDungeon->allPokemon[i]; Entity *mon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(mon)) { if (EntityExists(mon)) {
EntityInfo *monInfo = GetEntInfo(mon); EntityInfo *monInfo = GetEntInfo(mon);
monInfo->numMoveTiles = 0; monInfo->numMoveTiles = 0;
@ -979,7 +979,7 @@ bool8 UseAttack(Entity *a0)
for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) { for (loop = 0; loop < DUNGEON_MAX_POKEMON; loop++) {
Position monPosBefore; Position monPosBefore;
EntityInfo *monInfo; EntityInfo *monInfo;
Entity *mon = gDungeon->allPokemon[loop]; Entity *mon = gDungeon->activeMonsterPtrs[loop];
if (!EntityExists(mon)) if (!EntityExists(mon))
continue; continue;

View File

@ -30,7 +30,7 @@ void sub_8075680(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) { if ((EntityExists(entity)) && (info = GetEntInfo(entity), !info->isTeamLeader)) {
targetPos = &(info->targetPos); targetPos = &(info->targetPos);

View File

@ -216,7 +216,7 @@ void MuzzleTarget(Entity *pokemon, Entity *target)
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->muzzled.muzzled != TRUE) { if (entityInfo->muzzled.muzzled != TRUE) {
entityInfo->muzzled.muzzled = TRUE; entityInfo->muzzled.muzzled = TRUE;
entityInfo->muzzled.muzzledTurns = CalculateStatusTurns(target,gUnknown_80F4F1C, TRUE) + 1; 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) if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED)
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FBF04);
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
iVar5 = sub_803D870(auStack544, 0); iVar5 = sub_803D870(auStack544, 0);
if (iVar5 == 0) if (iVar5 == 0)
@ -299,7 +299,7 @@ void MobileStatusTarget(Entity * pokemon, Entity * target)
if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { if (entityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) {
SendTransformEndMessage(pokemon,target); SendTransformEndMessage(pokemon,target);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) { if (entityInfo->transformStatus.transformStatus != STATUS_MOBILE) {
entityInfo->transformStatus.transformStatus = STATUS_MOBILE; entityInfo->transformStatus.transformStatus = STATUS_MOBILE;
entityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F04, FALSE) + 1; 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))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->hitChanceStages[1] > 10) { if (entityInfo->hitChanceStages[1] > 10) {
entityInfo->hitChanceStages[1] = 10; entityInfo->hitChanceStages[1] = 10;
flag = TRUE; flag = TRUE;
@ -384,7 +384,7 @@ void BlindTarget(Entity *pokemon, Entity *target)
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) { if (entityInfo->eyesightStatus.eyesightStatus != STATUS_BLINKER) {
entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER; entityInfo->eyesightStatus.eyesightStatus = STATUS_BLINKER;
entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F08, TRUE) + 1;
@ -411,7 +411,7 @@ void CrossEyeVisionTarget(Entity *pokemon, Entity *target)
if(!HasSafeguardStatus(pokemon, target, TRUE)) if(!HasSafeguardStatus(pokemon, target, TRUE))
{ {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) { if (entityInfo->eyesightStatus.eyesightStatus != STATUS_CROSS_EYED) {
sub_8041E1C(target); sub_8041E1C(target);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB834);
@ -437,7 +437,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) { if (entityInfo->eyesightStatus.eyesightStatus != STATUS_EYEDROPS) {
entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS; entityInfo->eyesightStatus.eyesightStatus = STATUS_EYEDROPS;
entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1; entityInfo->eyesightStatus.eyesightStatusTurns = CalculateStatusTurns(target,gUnknown_80F4F10, FALSE) + 1;
@ -505,7 +505,7 @@ void RaiseAtkStatTarget(Entity * pokemon, Entity *target, s32 increment)
EntityInfo *entityInfo; EntityInfo *entityInfo;
if (EntityExists(target)) { if (EntityExists(target)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
oldStat = entityInfo->atk[0]; oldStat = entityInfo->atk[0];
@ -535,7 +535,7 @@ void RaiseSpAtkStatTarget(Entity * pokemon, Entity *target, s32 increment)
EntityInfo *entityInfo; EntityInfo *entityInfo;
if (EntityExists(target)) { if (EntityExists(target)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
oldStat = entityInfo->atk[1]; oldStat = entityInfo->atk[1];
@ -565,7 +565,7 @@ void RaiseDefStatTarget(Entity * pokemon, Entity *target, s32 increment)
EntityInfo *entityInfo; EntityInfo *entityInfo;
if (EntityExists(target)) { if (EntityExists(target)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
oldStat = entityInfo->def[0]; oldStat = entityInfo->def[0];
@ -595,7 +595,7 @@ void RaiseSpDefStatTarget(Entity * pokemon, Entity *target, s32 increment)
EntityInfo *entityInfo; EntityInfo *entityInfo;
if (EntityExists(target)) { if (EntityExists(target)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
oldStat = entityInfo->def[1]; oldStat = entityInfo->def[1];
@ -622,7 +622,7 @@ void LongTossStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo; EntityInfo *entityInfo;
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) { if (entityInfo->itemStatus.itemStatus != STATUS_LONG_TOSS) {
entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS; entityInfo->itemStatus.itemStatus = STATUS_LONG_TOSS;
sub_8041EA4(target); sub_8041EA4(target);
@ -639,7 +639,7 @@ void PierceStatusTarget(Entity * pokemon, Entity * target)
EntityInfo *entityInfo; EntityInfo *entityInfo;
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) { if (entityInfo->itemStatus.itemStatus != STATUS_PIERCE) {
entityInfo->itemStatus.itemStatus = STATUS_PIERCE; entityInfo->itemStatus.itemStatus = STATUS_PIERCE;
sub_8041EB4(target); sub_8041EB4(target);
@ -663,7 +663,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move *
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) { if ((entityInfo->charging.chargingStatus == newStatus) && (newStatus == STATUS_ENRAGED)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC074);
} }
@ -738,7 +738,7 @@ void CounterStatusTarget(Entity * pokemon, Entity * target, u8 newStatus)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus == newStatus) { if (entityInfo->protection.protectionStatus == newStatus) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB10C);
} }
@ -760,7 +760,7 @@ void SafeguardStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) { if (entityInfo->protection.protectionStatus != STATUS_SAFEGUARD) {
entityInfo->protection.protectionStatus = STATUS_SAFEGUARD; entityInfo->protection.protectionStatus = STATUS_SAFEGUARD;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E88, FALSE) + 1;
@ -780,7 +780,7 @@ void MistStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIST) { if (entityInfo->protection.protectionStatus != STATUS_MIST) {
entityInfo->protection.protectionStatus = STATUS_MIST; entityInfo->protection.protectionStatus = STATUS_MIST;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E8C, FALSE) + 1;
@ -800,7 +800,7 @@ void WishStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_WISH) { if (entityInfo->protection.protectionStatus != STATUS_WISH) {
entityInfo->protection.protectionStatus = STATUS_WISH; entityInfo->protection.protectionStatus = STATUS_WISH;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EB4, FALSE) + 1;
@ -820,7 +820,7 @@ void MagicCoatStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) { if (entityInfo->protection.protectionStatus != STATUS_MAGIC_COAT) {
entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT; entityInfo->protection.protectionStatus = STATUS_MAGIC_COAT;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E90, FALSE) + 1;
@ -840,7 +840,7 @@ void LightScreenStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) { if (entityInfo->protection.protectionStatus != STATUS_LIGHT_SCREEN) {
entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN; entityInfo->protection.protectionStatus = STATUS_LIGHT_SCREEN;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E84, FALSE) + 1;
@ -860,7 +860,7 @@ void ReflectStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_REFLECT) { if (entityInfo->protection.protectionStatus != STATUS_REFLECT) {
entityInfo->protection.protectionStatus = STATUS_REFLECT; entityInfo->protection.protectionStatus = STATUS_REFLECT;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4E80, FALSE) + 1; 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) { if (entityInfo->protection.protectionStatus != STATUS_PROTECT) {
entityInfo->protection.protectionStatus = STATUS_PROTECT; entityInfo->protection.protectionStatus = STATUS_PROTECT;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4ED4, FALSE) + 1; 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); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9B0);
} }
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB9D8);
} }
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
@ -901,7 +901,7 @@ void MirrorCoatStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) { if (entityInfo->protection.protectionStatus != STATUS_MIRROR_COAT) {
entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT; entityInfo->protection.protectionStatus = STATUS_MIRROR_COAT;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EE8, FALSE) + 1;
@ -921,7 +921,7 @@ void EndureStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_ENDURING) { if (entityInfo->protection.protectionStatus != STATUS_ENDURING) {
entityInfo->protection.protectionStatus = STATUS_ENDURING; entityInfo->protection.protectionStatus = STATUS_ENDURING;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EF8, FALSE) + 1;
@ -941,7 +941,7 @@ void MirrorMoveStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) { if (entityInfo->protection.protectionStatus != STATUS_MIRROR_MOVE) {
entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE; entityInfo->protection.protectionStatus = STATUS_MIRROR_MOVE;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F18, FALSE) + 1;
@ -966,7 +966,7 @@ void Conversion2StatusTarget(Entity * pokemon, Entity * target)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message); TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrForecastPreventsConversion2Message);
else else
{ {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) { if (entityInfo->protection.protectionStatus != STATUS_CONVERSION2) {
entityInfo->protection.protectionStatus = STATUS_CONVERSION2; entityInfo->protection.protectionStatus = STATUS_CONVERSION2;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1; entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F20, FALSE) + 1;
@ -987,7 +987,7 @@ void VitalThrowStatusTarget(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) { if (entityInfo->protection.protectionStatus != STATUS_VITAL_THROW) {
entityInfo->protection.protectionStatus = STATUS_VITAL_THROW; entityInfo->protection.protectionStatus = STATUS_VITAL_THROW;
entityInfo->protection.protectionStatusTurns = CalculateStatusTurns(target, gUnknown_80F4F24, FALSE) + 1; 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) { else if (param_3 != 0) {
sub_80420C8(target); sub_80420C8(target);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (statChanged) { if (statChanged) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD18);
} }
@ -1071,7 +1071,7 @@ void sub_8079F20(Entity * pokemon, Entity * target, u8 param_3, u8 param_4)
return; return;
} }
SendNonVolatileEndMessage(pokemon,target); SendNonVolatileEndMessage(pokemon,target);
SendImmobilizeEndMessage(pokemon,target); EndFrozenClassStatus(pokemon,target);
SendVolatileEndMessage(pokemon,target); SendVolatileEndMessage(pokemon,target);
SendWaitingEndMessage(pokemon,target,0); SendWaitingEndMessage(pokemon,target,0);
SendLinkedEndMessage(pokemon,target); SendLinkedEndMessage(pokemon,target);
@ -1157,7 +1157,7 @@ void SendSleepEndMessage(Entity * pokemon, Entity * target, bool8 param_3, bool8
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->sleep.sleep) { switch(entityInfo->sleep.sleep) {
case STATUS_NONE: case STATUS_NONE:
case 6: case 6:
@ -1207,7 +1207,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->nonVolatile.nonVolatileStatus) { switch(entityInfo->nonVolatile.nonVolatileStatus) {
case STATUS_NONE: case STATUS_NONE:
case 5: case 5:
@ -1228,7 +1228,7 @@ void SendNonVolatileEndMessage(Entity * pokemon, Entity * target)
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
} }
void SendImmobilizeEndMessage(Entity * pokemon, Entity *target) void EndFrozenClassStatus(Entity * pokemon, Entity *target)
{ {
bool8 isFrozen; bool8 isFrozen;
EntityInfo *entityInfo; EntityInfo *entityInfo;
@ -1238,7 +1238,7 @@ void SendImmobilizeEndMessage(Entity * pokemon, Entity *target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->immobilize.immobilizeStatus) { switch(entityInfo->immobilize.immobilizeStatus) {
case STATUS_NONE: case STATUS_NONE:
case 8: case 8:
@ -1278,7 +1278,7 @@ void SendVolatileEndMessage(Entity * pokemon, Entity *target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->volatileStatus.volatileStatus) { switch(entityInfo->volatileStatus.volatileStatus) {
case STATUS_NONE: case STATUS_NONE:
case 8: case 8:
@ -1318,50 +1318,50 @@ void SendProtectionEndMessage(Entity * pokemon, Entity *target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->protection.protectionStatus) { switch(entityInfo->protection.protectionStatus) {
case STATUS_NONE: case STATUS_NONE:
case 0xF: case 0xF:
break; break;
case STATUS_REFLECT: case STATUS_REFLECT:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA638); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA638);
break; break;
case STATUS_SAFEGUARD: case STATUS_SAFEGUARD:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA69C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA69C);
break; break;
case STATUS_LIGHT_SCREEN: case STATUS_LIGHT_SCREEN:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA658); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA658);
break; break;
case STATUS_COUNTER: case STATUS_COUNTER:
case STATUS_MINI_COUNTER: case STATUS_MINI_COUNTER:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA67C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA67C);
break; break;
case STATUS_MAGIC_COAT: case STATUS_MAGIC_COAT:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6BC); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6BC);
break; break;
case STATUS_WISH: case STATUS_WISH:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA6D4); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA6D4);
break; break;
case STATUS_PROTECT: case STATUS_PROTECT:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9C0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9C0);
break; break;
case STATUS_MIRROR_COAT: case STATUS_MIRROR_COAT:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA68); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA68);
break; break;
case STATUS_ENDURING: case STATUS_ENDURING:
TryDisplayDungeonLoggableMessage(target, *gPtrMonStoppedEnduringMessage); LogMessageByIdWithPopupCheckUser(target, *gPtrMonStoppedEnduringMessage);
break; break;
case STATUS_MIRROR_MOVE: case STATUS_MIRROR_MOVE:
TryDisplayDungeonLoggableMessage(target,*gPtrMonMirrorMoveFadedMessage); LogMessageByIdWithPopupCheckUser(target,*gPtrMonMirrorMoveFadedMessage);
break; break;
case STATUS_CONVERSION2: case STATUS_CONVERSION2:
TryDisplayDungeonLoggableMessage(target, *gPtrMonConversion2FailedMessage); LogMessageByIdWithPopupCheckUser(target, *gPtrMonConversion2FailedMessage);
break; break;
case STATUS_VITAL_THROW: case STATUS_VITAL_THROW:
TryDisplayDungeonLoggableMessage(target, *gPtrMonGaveUpVitalThrowMessage); LogMessageByIdWithPopupCheckUser(target, *gPtrMonGaveUpVitalThrowMessage);
break; break;
case STATUS_MIST: case STATUS_MIST:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB40); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB40);
break; break;
} }
entityInfo->protection.protectionStatus = STATUS_NONE; entityInfo->protection.protectionStatus = STATUS_NONE;
@ -1375,19 +1375,19 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->waitingStruct.waitingStatus) { switch(entityInfo->waitingStruct.waitingStatus) {
case STATUS_NONE: case STATUS_NONE:
case 4: case 4:
break; break;
case STATUS_CURSED: case STATUS_CURSED:
if (waitingStatus != STATUS_CURSED) { if (waitingStatus != STATUS_CURSED) {
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7BC); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7BC);
} }
break; break;
case STATUS_SNATCH: case STATUS_SNATCH:
if (waitingStatus != STATUS_SNATCH) { if (waitingStatus != STATUS_SNATCH) {
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA7DC); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA7DC);
} }
gDungeon->snatchPokemon = NULL; gDungeon->snatchPokemon = NULL;
gDungeon->unk17B3C = 0; gDungeon->unk17B3C = 0;
@ -1396,10 +1396,10 @@ void SendWaitingEndMessage(Entity * pokemon, Entity * target, u8 waitingStatus)
entityInfo->waitingStruct.waitingStatus = STATUS_NONE; entityInfo->waitingStruct.waitingStatus = STATUS_NONE;
uVar3 = sub_806CEBC(target); uVar3 = sub_806CEBC(target);
sub_806CCB4(target,uVar3); sub_806CCB4(target,uVar3);
gDungeon->decoyActive = FALSE; gDungeon->decoyIsActive = FALSE;
if (waitingStatus != STATUS_DECOY) { if (waitingStatus != STATUS_DECOY) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9A0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9A0);
} }
break; break;
} }
@ -1414,16 +1414,16 @@ void SendLinkedEndMessage(Entity * pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->linked.linkedStatus) switch(entityInfo->linked.linkedStatus)
{ {
case STATUS_NONE: case STATUS_NONE:
break; break;
case STATUS_LEECH_SEED: case STATUS_LEECH_SEED:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA79C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA79C);
break; break;
case STATUS_DESTINY_BOND: case STATUS_DESTINY_BOND:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA8C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA8C);
break; break;
} }
entityInfo->linked.linkedStatus = STATUS_NONE; entityInfo->linked.linkedStatus = STATUS_NONE;
@ -1440,22 +1440,22 @@ void SendMoveEndMessage(Entity * pokemon, Entity * target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->moveStatus.moveStatus) { switch(entityInfo->moveStatus.moveStatus) {
case STATUS_NONE: case STATUS_NONE:
case 5: case 5:
break; break;
case STATUS_SURE_SHOT: case STATUS_SURE_SHOT:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA8E0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA8E0);
break; break;
case STATUS_WHIFFER: case STATUS_WHIFFER:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA90C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA90C);
break; break;
case STATUS_SET_DAMAGE: case STATUS_SET_DAMAGE:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA934); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA934);
break; break;
case STATUS_FOCUS_ENERGY: case STATUS_FOCUS_ENERGY:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA95C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA95C);
break; break;
} }
entityInfo->moveStatus.moveStatus = STATUS_NONE; entityInfo->moveStatus.moveStatus = STATUS_NONE;
@ -1473,24 +1473,24 @@ void SendTransformEndMessage(Entity * pokemon, Entity *target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->transformStatus.transformStatus) { switch(entityInfo->transformStatus.transformStatus) {
case STATUS_NONE: case STATUS_NONE:
case 4: case 4:
break; break;
case STATUS_INVISIBLE: case STATUS_INVISIBLE:
isInvisible = TRUE; isInvisible = TRUE;
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FA9F4); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FA9F4);
break; break;
case STATUS_MOBILE: case STATUS_MOBILE:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABBC); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABBC);
break; break;
case STATUS_TRANSFORMED: case STATUS_TRANSFORMED:
entityInfo->apparentID = sub_8069F54(target, entityInfo->id); entityInfo->apparentID = sub_8069F54(target, entityInfo->id);
target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID); target->axObj.spriteFile = GetSpriteData(entityInfo->apparentID);
uVar3 = sub_806CEBC(target); uVar3 = sub_806CEBC(target);
sub_806CCB4(target,uVar3); sub_806CCB4(target,uVar3);
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAB6C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAB6C);
break; break;
} }
entityInfo->transformStatus.transformStatus = STATUS_NONE; entityInfo->transformStatus.transformStatus = STATUS_NONE;
@ -1508,19 +1508,19 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->eyesightStatus.eyesightStatus) { switch(entityInfo->eyesightStatus.eyesightStatus) {
case STATUS_NONE: case STATUS_NONE:
case 4: case 4:
break; break;
case STATUS_BLINKER: case STATUS_BLINKER:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA0C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA0C);
break; break;
case STATUS_CROSS_EYED: case STATUS_CROSS_EYED:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA2C); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA2C);
break; break;
case STATUS_EYEDROPS: case STATUS_EYEDROPS:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FAA48); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FAA48);
break; break;
} }
entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE; entityInfo->eyesightStatus.eyesightStatus = STATUS_NONE;
@ -1540,13 +1540,13 @@ void SendMuzzledEndMessage(Entity * pokemon, Entity * target)
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
switch(entityInfo->muzzled.muzzled) { switch(entityInfo->muzzled.muzzled) {
case FALSE: case FALSE:
case 2: case 2:
break; break;
case TRUE: case TRUE:
TryDisplayDungeonLoggableMessage(target,*gUnknown_80FABC0); LogMessageByIdWithPopupCheckUser(target,*gUnknown_80FABC0);
break; break;
} }
entityInfo->muzzled.muzzled = FALSE; entityInfo->muzzled.muzzled = FALSE;
@ -1559,7 +1559,7 @@ bool8 TrySendImmobilizeSleepEndMsg(Entity * pokemon, Entity * target)
bool32 msg = FALSE; bool32 msg = FALSE;
if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) { if (entityInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) {
SendImmobilizeEndMessage(pokemon, target); EndFrozenClassStatus(pokemon, target);
msg = TRUE; msg = TRUE;
} }
if (entityInfo->sleep.sleep == STATUS_SLEEP && entityInfo->sleep.sleepTurns == 0x7f) { 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.immobilizeStatus = STATUS_NONE;
entityInfo->immobilize.immobilizeStatusTurns = 0; entityInfo->immobilize.immobilizeStatusTurns = 0;
entityInfo->immobilize.immobilizeStatusDamageCountdown = 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! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA8BC); // $m0 thawed out!
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
} }

View File

@ -70,11 +70,11 @@ void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction)
else else
{ {
if (pokemon == target) { 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! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA10); // {POKEMON_0} couldn't be knocked flying!
return; return;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (HasAbility(target,ABILITY_SUCTION_CUPS)) { if (HasAbility(target,ABILITY_SUCTION_CUPS)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBCC); // {POKEMON_0} is anchored! It can't be knocked flying!
return; return;
@ -226,7 +226,7 @@ void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos)
info = GetEntInfo(target); info = GetEntInfo(target);
flag = FALSE; flag = FALSE;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (HasAbility(target,ABILITY_SUCTION_CUPS)) { if (HasAbility(target,ABILITY_SUCTION_CUPS)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAE8);
return; return;
@ -358,12 +358,12 @@ void sub_807D3CC(Entity *param_1)
} }
} }
if (flag) { if (flag) {
TryDisplayDungeonLoggableMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed LogMessageByIdWithPopupCheckUser(param_1,*gUnknown_80FD2F8); // All traps were exposed
sub_8040A84(); sub_8040A84();
sub_8049ED4(); sub_8049ED4();
} }
else { 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.
} }
} }

View File

@ -74,12 +74,12 @@ void sub_807E254(Entity *pokemon,Entity *target)
if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) { 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 TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
} }
else if(HasAbility(target, ABILITY_SUCTION_CUPS)) 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 TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
} }
else else
@ -135,7 +135,7 @@ void sub_807E378(void)
sub_806A2BC(leader,1); sub_806A2BC(leader,1);
UseAttack(leader); UseAttack(leader);
if (sub_8044B28() == 0) { if (sub_8044B28() == 0) {
TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C4C); LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C4C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0);
gDungeon->unk67A = 1; gDungeon->unk67A = 1;
} }
@ -147,7 +147,7 @@ void sub_807E378(void)
sub_806A2BC(leader,1); sub_806A2BC(leader,1);
UseAttack(leader); UseAttack(leader);
if (sub_8044B28() == 0) { if (sub_8044B28() == 0) {
TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C70); LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C70);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1);
gDungeon->unk67A = 2; gDungeon->unk67A = 2;
} }
@ -159,7 +159,7 @@ void sub_807E378(void)
sub_806A2BC(leader,1); sub_806A2BC(leader,1);
UseAttack(leader); UseAttack(leader);
if (sub_8044B28() == 0) { if (sub_8044B28() == 0) {
TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9C8C); LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9C8C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2);
gDungeon->unk67A = 3; gDungeon->unk67A = 3;
} }
@ -170,7 +170,7 @@ void sub_807E378(void)
sub_806A2BC(leader,1); sub_806A2BC(leader,1);
UseAttack(leader); UseAttack(leader);
if (sub_8044B28() == 0) { if (sub_8044B28() == 0) {
TryDisplayDungeonLoggableMessage(leader,*gUnknown_80F9CBC); LogMessageByIdWithPopupCheckUser(leader,*gUnknown_80F9CBC);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3); sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3);
gDungeon->unk67A = 4; gDungeon->unk67A = 4;
sub_8068FE0(leader,0x21e,leader); sub_8068FE0(leader,0x21e,leader);

View File

@ -29,7 +29,7 @@ void sub_8082B40(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
info = GetEntInfo(entity); info = GetEntInfo(entity);
entity->axObj.spriteFile = GetSpriteData(info->apparentID); 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) void sub_8082E04(unkStruct_8094924 *param_1, Waiting *waiting)
{ {
sub_8082FE0(param_1, &waiting->waitingStatus, 1); 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->unkCA = sub_80831DC(param_1);
waiting->waitingStatusTurns = sub_8083188(param_1); waiting->waitingStatusTurns = sub_8083188(param_1);
waiting->curseDamageCountdown = sub_8083188(param_1); waiting->curseDamageCountdown = sub_8083188(param_1);

View File

@ -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 speciesIndex = index * 0x10000 >> 0x10; // TODO: dumb way to force s16. Temp var may fix the regswap
memset(moves, 0, sizeof(moves)); memset(moves, 0, sizeof(moves));
moves[0] = MOVE_DOUBLESLAP; moves[0] = MOVE_DOUBLESLAP;
CopyMonsterNametoBuffer(buffer, speciesIndex); CopyMonsterNameToBuffer(buffer, speciesIndex);
CopyStringtoBuffer(buffer, buffer); CopyStringtoBuffer(buffer, buffer);
buffer[0] = 0x40; buffer[0] = 0x40;
sub_808CFD0(&pokemon, speciesIndex, buffer, ITEM_CHERI_BERRY, (DungeonLocation *)&loc, moves); sub_808CFD0(&pokemon, speciesIndex, buffer, ITEM_CHERI_BERRY, (DungeonLocation *)&loc, moves);

View File

@ -62,7 +62,7 @@ void sub_8044820(void)
} }
else else
{ {
entityInfo->aiNextToTarget = FALSE; entityInfo->aiAllySkip = FALSE;
movSpeed = CalcSpeedStage(entity); movSpeed = CalcSpeedStage(entity);
if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] != 0) { if (gSpeedTurns[movSpeed][gDungeon->fractionalTurn] != 0) {
if (!entityInfo->attacking) { if (!entityInfo->attacking) {
@ -88,12 +88,12 @@ void sub_8044820(void)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{ {
entity2 = gDungeon->wildPokemon[index]; entity2 = gDungeon->wildPokemon[index];
if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiNextToTarget)) if ((EntityExists(entity2)) && (entityInfo2 = GetEntInfo(entity2), entityInfo2->aiAllySkip))
{ {
sub_8074094(entity2); sub_8074094(entity2);
if (EntityExists(entity2)) { if (EntityExists(entity2)) {
sub_8071DA4(entity2); sub_8071DA4(entity2);
entityInfo2->aiNextToTarget = FALSE; entityInfo2->aiAllySkip = FALSE;
} }
} }
} }
@ -118,7 +118,7 @@ void TrySpawnMonsterAndActivatePlusMinus(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
entityInfo = GetEntInfo(entity); entityInfo = GetEntInfo(entity);
entityInfo->attacking = FALSE; entityInfo->attacking = FALSE;
@ -153,7 +153,7 @@ void sub_8044AB4(void)
if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) { if (gSpeedTurns[1][gDungeon->fractionalTurn + 1] != 0) {
for (index = 0; index < DUNGEON_MAX_POKEMON; index++) { for (index = 0; index < DUNGEON_MAX_POKEMON; index++) {
if (EntityExists(gDungeon->allPokemon[index])) { if (EntityExists(gDungeon->activeMonsterPtrs[index])) {
UseAttack(0); UseAttack(0);
break; break;
} }
@ -260,7 +260,7 @@ void SetMonsterActionFields(ActionContainer *actionPointer, u16 action)
void SetActionPassTurnOrWalk(ActionContainer *actionPointer, s16 species) void SetActionPassTurnOrWalk(ActionContainer *actionPointer, s16 species)
{ {
if (CanMove(species)) if (GetCanMoveFlag(species))
{ {
actionPointer->action = ACTION_WALK; actionPointer->action = ACTION_WALK;
} }

View File

@ -56,7 +56,7 @@ void sub_8075900(Entity *pokemon, u8 r1)
if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE)) if((GetTileAtEntitySafe(pokemon)->terrainType & TERRAIN_TYPE_IN_MONSTER_HOUSE))
{ {
// It's a monster house! // It's a monster house!
TryDisplayDungeonLoggableMessage(GetLeader(), gPtrItsaMonsterHouseMessage); LogMessageByIdWithPopupCheckUser(GetLeader(), gPtrItsaMonsterHouseMessage);
gDungeon->monsterHouseTriggeredEvent = TRUE; gDungeon->monsterHouseTriggeredEvent = TRUE;
sub_807AB38(pokemon, r1); sub_807AB38(pokemon, r1);
sub_8041888(0); sub_8041888(0);
@ -76,21 +76,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
{ {
if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED) if (pokemonInfo->immobilize.immobilizeStatus == STATUS_PETRIFIED)
{ {
SendImmobilizeEndMessage(pokemon, pokemon); EndFrozenClassStatus(pokemon, pokemon);
} }
} }
else else
{ {
pokemonInfo->targetingDecoy = TARGETING_DECOY_NONE; pokemonInfo->decoyAITracker = DECOY_AI_NONE;
if (pokemonInfo->clientType == CLIENT_TYPE_NONE || IsMovingClient(pokemon)) 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)) if (CheckVariousConditions(pokemon))
{ {
pokemonInfo->useHeldItem = FALSE; pokemonInfo->useHeldItem = FALSE;
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
TryDisplayDungeonLoggableMessage(pokemon, gPtrCouldntBeUsedMessage); LogMessageByIdWithPopupCheckUser(pokemon, gPtrCouldntBeUsedMessage);
return; return;
} }
AIDecideUseItem(pokemon); AIDecideUseItem(pokemon);
@ -99,32 +99,32 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
return; return;
} }
} }
if (!HasStatusAffectingActions(pokemon)) if (!HasStatusThatPreventsActing(pokemon))
{ {
if (gDungeon->decoyActive) if (gDungeon->decoyIsActive)
{ {
s32 i; s32 i;
Entity *target; Entity *target;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
target = gDungeon->allPokemon[i]; target = gDungeon->activeMonsterPtrs[i];
if (EntityExists(target) && if (EntityExists(target) &&
GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY && GetEntInfo(target)->waitingStruct.waitingStatus == STATUS_DECOY &&
CanSeeTarget(pokemon, target)) CanSeeTarget(pokemon, target))
{ {
bool8 enemyDecoy = GetEntInfo(target)->waitingStruct.enemyDecoy; bool8 decoyApplierNonTeamMemberFlag = GetEntInfo(target)->waitingStruct.decoyApplierNonTeamMemberFlag;
u8 targetingDecoy = TARGETING_DECOY_TEAM; u8 decoyAITracker = DECOY_AI_TEAM;
if (enemyDecoy) if (decoyApplierNonTeamMemberFlag)
{ {
targetingDecoy = TARGETING_DECOY_WILD; decoyAITracker = DECOY_AI_WILD;
} }
pokemonInfo->targetingDecoy = targetingDecoy; pokemonInfo->decoyAITracker = decoyAITracker;
break; break;
} }
} }
} }
ClearMonsterActionFields(&pokemonInfo->action); ClearMonsterActionFields(&pokemonInfo->action);
if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
{ {
SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id);
pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS);
@ -138,7 +138,7 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
{ {
if (!IQSkillIsEnabled(pokemon, IQ_DEDICATED_TRAVELER)) if (!IQSkillIsEnabled(pokemon, IQ_DEDICATED_TRAVELER))
{ {
DecideAttack(pokemon); ChooseAIMove(pokemon);
if (pokemonInfo->action.action != ACTION_NOTHING) if (pokemonInfo->action.action != ACTION_NOTHING)
{ {
return; return;
@ -149,11 +149,11 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
} }
else else
{ {
if (!CanMove(pokemonInfo->id)) if (!GetCanMoveFlag(pokemonInfo->id))
{ {
return; return;
} }
MoveIfPossible(pokemon, TRUE); AIMovement(pokemon, TRUE);
} }
} }
else else
@ -164,21 +164,21 @@ void RunMonsterAI(Entity *pokemon, u32 unused)
} }
else else
{ {
if (CanMove(pokemonInfo->id)) if (GetCanMoveFlag(pokemonInfo->id))
{ {
MoveIfPossible(pokemon, TRUE); AIMovement(pokemon, TRUE);
} }
if (pokemonInfo->action.action > ACTION_PASS_TURN) if (pokemonInfo->action.action > ACTION_PASS_TURN)
{ {
return; return;
} }
DecideAttack(pokemon); ChooseAIMove(pokemon);
if (pokemonInfo->action.action <= ACTION_PASS_TURN) if (pokemonInfo->action.action <= ACTION_PASS_TURN)
{ {
return; return;
} }
pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; pokemonInfo->aiTarget.aiNotNextToTarget = FALSE;
pokemonInfo->aiNextToTarget = FALSE; pokemonInfo->aiAllySkip = FALSE;
pokemonInfo->waiting = FALSE; pokemonInfo->waiting = FALSE;
} }
} }

View File

@ -65,7 +65,7 @@ extern void sub_804AC20(struct Position *);
extern void sub_807EC28(bool8); extern void sub_807EC28(bool8);
extern void sub_806A5B8(struct Entity *entity); extern void sub_806A5B8(struct Entity *entity);
void DecideAttack(Entity *pokemon) void ChooseAIMove(Entity *pokemon)
{ {
EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
s32 i; s32 i;
@ -422,7 +422,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; 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)) if (EntityExists(target) && CanSeeTarget(pokemon, target))
{ {
numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); 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++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
Entity *target = gDungeon->allPokemon[i]; Entity *target = gDungeon->activeMonsterPtrs[i];
if (EntityExists(target) && pokemon != target) if (EntityExists(target) && pokemon != target)
{ {
s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos); s32 direction = GetDirectionTowardsPosition(&pokemon->pos, &target->pos);
@ -491,7 +491,7 @@ s32 AIConsiderMove(struct AIPossibleMove *aiPossibleMove, Entity *pokemon, Move
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
Entity *target = gDungeon->allPokemon[i]; Entity *target = gDungeon->activeMonsterPtrs[i];
if (EntityExists(target)) if (EntityExists(target))
{ {
numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker); numPotentialTargets = TryAddTargetToAITargetList(numPotentialTargets, targetingFlags, pokemon, target, move, hasStatusChecker);
@ -674,8 +674,8 @@ bool8 IsAITargetEligible(s32 targetingFlags, Entity *user, Entity *target, Move
checkThirdParty: checkThirdParty:
hasTarget = TRUE; hasTarget = TRUE;
if (targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || if (targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER ||
targetData->clientType == CLIENT_TYPE_DONT_MOVE || targetData->monsterBehavior == BEHAVIOR_DIGLETT ||
targetData->clientType == CLIENT_TYPE_CLIENT) targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
{ {
returnFalse: returnFalse:
return FALSE; return FALSE;
@ -988,14 +988,14 @@ void HandleUseOrbAction(Entity *pokemon)
if (item->flags & ITEM_FLAG_STICKY) { if (item->flags & ITEM_FLAG_STICKY) {
sub_8045BF8(gFormatBuffer_Items[0], item); sub_8045BF8(gFormatBuffer_Items[0], item);
TryDisplayDungeonLoggableMessage(pokemon, *gItemStickyDoesntWorkText); LogMessageByIdWithPopupCheckUser(pokemon, *gItemStickyDoesntWorkText);
return; return;
} }
act = entityInfo->action; act = entityInfo->action;
if (IsBossFight()) { if (IsBossFight()) {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrMysteriousPowerPreventedUseMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrMysteriousPowerPreventedUseMessage);
r4 = TRUE; r4 = TRUE;
} }
else { else {
@ -1014,21 +1014,21 @@ void HandleUseOrbAction(Entity *pokemon)
} }
if (entityInfo->volatileStatus.volatileStatus == 1) { if (entityInfo->volatileStatus.volatileStatus == 1) {
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC714); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC714);
r4 = FALSE; r4 = FALSE;
r8 = FALSE; r8 = FALSE;
} }
else if (entityInfo->volatileStatus.volatileStatus == 7) { else if (entityInfo->volatileStatus.volatileStatus == 7) {
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC718); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC718);
r4 = FALSE; r4 = FALSE;
r8 = FALSE; r8 = FALSE;
} }
else if (entityInfo->nonVolatile.nonVolatileStatus == 4) else if (entityInfo->nonVolatile.nonVolatileStatus == 4)
{ {
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FC6A8); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FC6A8);
r4 = FALSE; r4 = FALSE;
r8 = FALSE; r8 = FALSE;
} }

View File

@ -49,7 +49,7 @@ void sub_807360C(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if(EntityExists(entity)) if(EntityExists(entity))
{ {
if(GetEntInfo(entity)->unk152 != 0) if(GetEntInfo(entity)->unk152 != 0)
@ -281,7 +281,7 @@ void GetPossibleAIThrownItemDirections(Entity *pokemon, s32 thrownAIFlag, Item *
} }
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
Entity *targetPokemon = gDungeon->allPokemon[i]; Entity *targetPokemon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(targetPokemon) && pokemon != targetPokemon) if (EntityExists(targetPokemon) && pokemon != targetPokemon)
{ {
s32 targetingFlags; s32 targetingFlags;
@ -318,7 +318,7 @@ void GetPossibleAIArcItemTargets(Entity *pokemon, Item *item, Position potential
gAIThrowItemActionChoiceCount = 0; gAIThrowItemActionChoiceCount = 0;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
Entity *targetPokemon = gDungeon->allPokemon[i]; Entity *targetPokemon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(targetPokemon) && pokemon != targetPokemon && if (EntityExists(targetPokemon) && pokemon != targetPokemon &&
CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY) CanSeeTarget(pokemon, targetPokemon) && GetTreatmentBetweenMonsters(pokemon, targetPokemon, FALSE, TRUE) == TREATMENT_TREAT_AS_ENEMY)
{ {

View File

@ -224,7 +224,7 @@ bool8 sub_8072CF4(Entity *entity)
break; break;
case ACTION_STAIRS: case ACTION_STAIRS:
if ((gDungeon->dungeonLocation.id == DUNGEON_METEOR_CAVE) && (!gDungeon->deoxysDefeat)) { 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 else
{ {
@ -282,8 +282,8 @@ bool8 sub_8072CF4(Entity *entity)
sub_80671A0(entity); sub_80671A0(entity);
break; break;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE6D4); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE6D4);
break; break;
case ACTION_TALK_FIELD: case ACTION_TALK_FIELD:
HandleTalkFieldAction(entity); HandleTalkFieldAction(entity);
@ -310,8 +310,8 @@ bool8 sub_8072CF4(Entity *entity)
HandleThrowItemAIAction(entity); HandleThrowItemAIAction(entity);
break; break;
case ACTION_SECOND_THOUGHTS: case ACTION_SECOND_THOUGHTS:
SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FE478); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FE478);
break; break;
default: default:
info->action.action = ACTION_PASS_TURN; info->action.action = ACTION_PASS_TURN;
@ -339,7 +339,7 @@ bool8 sub_8072CF4(Entity *entity)
} }
} }
if (bVar4) { if (bVar4) {
TryDisplayDungeonLoggableMessage(entity,*gUnknown_80FD2CC); LogMessageByIdWithPopupCheckUser(entity,*gUnknown_80FD2CC);
} }
} }
sub_807360C(); sub_807360C();
@ -358,7 +358,7 @@ bool8 sub_8072CF4(Entity *entity)
sub_8046D20(); sub_8046D20();
} }
sub_8041888(0); sub_8041888(0);
if (((EntityExists(entity)) && (!info->aiNextToTarget)) && (!bVar14)) { if (((EntityExists(entity)) && (!info->aiAllySkip)) && (!bVar14)) {
if (sub_80706A4(entity,&entity->pos) != '\0') { if (sub_80706A4(entity,&entity->pos) != '\0') {
sub_807D148(entity,entity,0,0); sub_807D148(entity,entity,0,0);
} }

View File

@ -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}; 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); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; pokemonInfo->aiTarget.aiNotNextToTarget = FALSE;
@ -67,7 +67,7 @@ void MoveIfPossible(Entity *pokemon, bool8 showRunAwayEffect)
{ {
pokemonInfo->action.action = ACTION_NOTHING; pokemonInfo->action.action = ACTION_NOTHING;
} }
else if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT) else if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET)
{ {
SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id);
pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS); pokemonInfo->action.direction = DungeonRandInt(NUM_DIRECTIONS);
@ -148,9 +148,9 @@ bool8 ChooseTargetPosition(Entity *pokemon)
bool8 canCrossWalls; bool8 canCrossWalls;
s32 targetDistance; s32 targetDistance;
s32 i; s32 i;
if (gDungeon->decoyActive) if (gDungeon->decoyIsActive)
{ {
possibleTargets = gDungeon->allPokemon; possibleTargets = gDungeon->activeMonsterPtrs;
maxPossibleTargets = DUNGEON_MAX_POKEMON; maxPossibleTargets = DUNGEON_MAX_POKEMON;
} }
else if (pokemonInfo->isNotTeamMember) else if (pokemonInfo->isNotTeamMember)
@ -169,9 +169,9 @@ bool8 ChooseTargetPosition(Entity *pokemon)
for (i = 0; i < maxPossibleTargets; i++) for (i = 0; i < maxPossibleTargets; i++)
{ {
Entity *target = possibleTargets[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) 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) if (!pokemonInfo->isNotTeamMember && !pokemonInfo->recalculateFollow)
{ {
pokemonInfo->aiTarget.aiNotNextToTarget = TRUE; pokemonInfo->aiTarget.aiNotNextToTarget = TRUE;
pokemonInfo->aiNextToTarget = TRUE; pokemonInfo->aiAllySkip = TRUE;
SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN);
pokemonInfo->waiting = TRUE; pokemonInfo->waiting = TRUE;
return; return;
@ -492,11 +492,11 @@ void DecideMovement(Entity *pokemon, bool8 showRunAwayEffect)
if (pokemonInfo->isTeamLeader) if (pokemonInfo->isTeamLeader)
{ {
pokemonInfo->aiTarget.aiNotNextToTarget = FALSE; pokemonInfo->aiTarget.aiNotNextToTarget = FALSE;
pokemonInfo->aiNextToTarget = FALSE; pokemonInfo->aiAllySkip = FALSE;
} }
else if (pokemonInfo->aiTarget.aiNotNextToTarget) else if (pokemonInfo->aiTarget.aiNotNextToTarget)
{ {
pokemonInfo->aiNextToTarget = TRUE; pokemonInfo->aiAllySkip = TRUE;
} }
} }
@ -511,9 +511,9 @@ bool8 AvoidEnemies(Entity *pokemon)
Entity **possibleTargets; Entity **possibleTargets;
s32 numPossibleTargets; s32 numPossibleTargets;
s32 i; s32 i;
if (gDungeon->decoyActive) if (gDungeon->decoyIsActive)
{ {
possibleTargets = gDungeon->allPokemon; possibleTargets = gDungeon->activeMonsterPtrs;
numPossibleTargets = DUNGEON_MAX_POKEMON; numPossibleTargets = DUNGEON_MAX_POKEMON;
} }
else if (pokemonInfo->isNotTeamMember) else if (pokemonInfo->isNotTeamMember)
@ -534,7 +534,7 @@ bool8 AvoidEnemies(Entity *pokemon)
if (EntityExists(target) && CanSeeTarget(pokemon, target)) if (EntityExists(target) && CanSeeTarget(pokemon, target))
{ {
s32 distance; 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; continue;
} }

View File

@ -462,7 +462,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign
{ {
EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
EntityInfo *targetData = GetEntInfo(targetPokemon); EntityInfo *targetData = GetEntInfo(targetPokemon);
u8 targetingDecoy; u8 decoyAITracker;
u8 pokemonTargetingDecoy; u8 pokemonTargetingDecoy;
bool8 pokemonIsEnemy; bool8 pokemonIsEnemy;
bool8 targetIsEnemy; bool8 targetIsEnemy;
@ -473,23 +473,23 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign
} }
if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || if (pokemonInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER ||
targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER || targetData->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER ||
pokemonInfo->clientType == CLIENT_TYPE_DONT_MOVE || pokemonInfo->monsterBehavior == BEHAVIOR_DIGLETT ||
targetData->clientType == CLIENT_TYPE_DONT_MOVE || targetData->monsterBehavior == BEHAVIOR_DIGLETT ||
pokemonInfo->clientType == CLIENT_TYPE_CLIENT || pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET ||
targetData->clientType == CLIENT_TYPE_CLIENT || targetData->monsterBehavior == BEHAVIOR_RESCUE_TARGET ||
(checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) || (checkPetrified && !pokemonInfo->isNotTeamMember && targetData->immobilize.immobilizeStatus == STATUS_PETRIFIED) ||
(!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon))) (!ignoreInvisible && targetData->transformStatus.transformStatus == STATUS_INVISIBLE && !CanSeeInvisibleMonsters(pokemon)))
{ {
return TREATMENT_IGNORE; return TREATMENT_IGNORE;
} }
pokemonTargetingDecoy = pokemonInfo->targetingDecoy; pokemonTargetingDecoy = pokemonInfo->decoyAITracker;
targetingDecoy = TARGETING_DECOY_NONE; decoyAITracker = DECOY_AI_NONE;
if (pokemonTargetingDecoy != TARGETING_DECOY_NONE) if (pokemonTargetingDecoy != DECOY_AI_NONE)
{ {
targetingDecoy = TARGETING_DECOY_WILD; decoyAITracker = DECOY_AI_WILD;
if (pokemonTargetingDecoy == TARGETING_DECOY_TEAM) if (pokemonTargetingDecoy == DECOY_AI_TEAM)
{ {
targetingDecoy = TARGETING_DECOY_TEAM; decoyAITracker = DECOY_AI_TEAM;
} }
} }
if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL) if (pokemonInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)
@ -521,7 +521,7 @@ u8 GetTreatmentBetweenMonsters(Entity *pokemon, Entity *targetPokemon, bool8 ign
{ {
targetIsDecoy = TRUE; targetIsDecoy = TRUE;
} }
return gTreatmentData[targetingDecoy][pokemonIsEnemy][targetIsEnemy][targetIsDecoy]; return gTreatmentData[decoyAITracker][pokemonIsEnemy][targetIsEnemy][targetIsDecoy];
} }
u8 sub_807167C(Entity * pokemon, Entity * target) u8 sub_807167C(Entity * pokemon, Entity * target)
@ -532,9 +532,9 @@ u8 sub_807167C(Entity * pokemon, Entity * target)
pokemonEntityData = GetEntInfo(pokemon); pokemonEntityData = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target); targetEntityInfo = GetEntInfo(target);
if (pokemonEntityData->clientType != CLIENT_TYPE_CLIENT) { if (pokemonEntityData->monsterBehavior != BEHAVIOR_RESCUE_TARGET) {
cannotUseItems = IsClientOrTeamBase(pokemonEntityData->joinedAt.joinedAt); 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); cannotUseItems = IsClientOrTeamBase(targetEntityInfo->joinedAt.joinedAt);
if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) { if (cannotUseItems || (targetEntityInfo->shopkeeper != SHOPKEEPER_MODE_NORMAL)) {
error: error:

View File

@ -80,7 +80,7 @@ bool8 CheckVariousConditions(Entity *pokemon)
{ {
EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
if (pokemonInfo->clientType == CLIENT_TYPE_CLIENT if (pokemonInfo->monsterBehavior == BEHAVIOR_RESCUE_TARGET
|| IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt) || IsClientOrTeamBase(pokemonInfo->joinedAt.joinedAt)
|| (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon)) || (!pokemonInfo->isTeamLeader && ShouldMonsterRunAway(pokemon))
|| CheckVariousStatuses2(pokemon, FALSE) || CheckVariousStatuses2(pokemon, FALSE)

File diff suppressed because it is too large Load Diff

View File

@ -182,7 +182,7 @@ static void sub_8044454(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) 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 ((EntityExists(entity)) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break; if (sub_8044B28()) break;
TickStatusHeal(entity); TickStatusHeal(entity);
@ -210,7 +210,7 @@ void sub_80444F4(Entity *pokemon)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) 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 ((EntityExists(entity)) && (pokemon != entity) && (entityInfo = GetEntInfo(entity), (entityInfo->flags & MOVEMENT_FLAG_SWAPPING_PLACES_PETRIFIED_ALLY))) {
if (sub_8044B28()) break; if (sub_8044B28()) break;
RunMonsterAI(entity, 0); RunMonsterAI(entity, 0);

View File

@ -149,7 +149,7 @@ void MusicBoxCreation(void)
sub_80416E0(&entity->pixelPos,0x10c,FALSE); sub_80416E0(&entity->pixelPos,0x10c,FALSE);
sub_80421C0(entity,0xd7); sub_80421C0(entity,0xd7);
sub_803E708(0x3c,0x41); sub_803E708(0x3c,0x41);
SetMessageArgument(gFormatBuffer_Monsters[0],entity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],entity,0);
DisplayDungeonMessage(0,*gUnknown_81053A8,1); DisplayDungeonMessage(0,*gUnknown_81053A8,1);
sub_803E708(10,0x41); sub_803E708(10,0x41);
PlaySoundEffect(0xd4); PlaySoundEffect(0xd4);

View File

@ -120,7 +120,7 @@ void sub_805229C(void)
return sub_80526D0(0x50); return sub_80526D0(0x50);
} }
void TryDisplayDungeonLoggableMessage(Entity *pokemon, const u8 *str) void LogMessageByIdWithPopupCheckUser(Entity *pokemon, const u8 *str)
{ {
if (sub_8045888(pokemon)){ if (sub_8045888(pokemon)){
DisplayMessageAddToLog(pokemon, str, TRUE); DisplayMessageAddToLog(pokemon, str, TRUE);
@ -624,7 +624,7 @@ s32 DisplayDungeonMenuMessage(struct MonDialogueSpriteInfo *monSpriteInfo, const
void sub_8052D44(s16 *ids, Entity *leader, Entity *partner) void sub_8052D44(s16 *ids, Entity *leader, Entity *partner)
{ {
if (EntityExists(leader)) { if (EntityExists(leader)) {
SetMessageArgument(gFormatBuffer_Monsters[0], leader, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], leader, 0);
ids[0] = GetEntInfo(leader)->apparentID; ids[0] = GetEntInfo(leader)->apparentID;
} }
else { else {
@ -633,7 +633,7 @@ void sub_8052D44(s16 *ids, Entity *leader, Entity *partner)
} }
if (EntityExists(partner)) { if (EntityExists(partner)) {
SetMessageArgument(gFormatBuffer_Monsters[1], partner, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], partner, 0);
ids[1] = GetEntInfo(partner)->apparentID; ids[1] = GetEntInfo(partner)->apparentID;
} }
else { else {

View File

@ -552,7 +552,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE); s16 targetFlags = GetMoveTargetAndRangeForPokemon(attacker, move, FALSE);
s32 targetFlagsAnd = targetFlags & 0xF; s32 targetFlagsAnd = targetFlags & 0xF;
if ((targetFlagsAnd == 0 || targetFlagsAnd == 4 || targetFlagsAnd == 5 || targetFlagsAnd == 2) && !r4) { 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! TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_80FC574); // protected itself!
moveHits = FALSE; moveHits = FALSE;
} }
@ -565,7 +565,7 @@ static void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move
if (moveHits) { if (moveHits) {
if (HasAbility(currTarget, ABILITY_SOUNDPROOF) && IsSoundMove(move)) { 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! TryDisplayDungeonLoggableMessage3(attacker, currTarget, gUnknown_8100524); // Soundproof suppressed the sound move!
moveHits = FALSE; moveHits = FALSE;
} }
@ -1805,18 +1805,18 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
attackerInfo->abilityEffectFlags = 0; attackerInfo->abilityEffectFlags = 0;
attackerInfo->unk159 = 0; attackerInfo->unk159 = 0;
if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) { if (attackerInfo->volatileStatus.volatileStatus == STATUS_CRINGE) {
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC714); // is cringing! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC714); // is cringing!
return FALSE; return FALSE;
} }
else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) { else if (attackerInfo->volatileStatus.volatileStatus == STATUS_INFATUATED) {
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC718); // is infatuated! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC718); // is infatuated!
return FALSE; return FALSE;
} }
else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) { else if (attackerInfo->nonVolatile.nonVolatileStatus == STATUS_PARALYSIS) {
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC6A8); // is paralyzed! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC6A8); // is paralyzed!
return FALSE; return FALSE;
} }
@ -1870,7 +1870,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
else { else {
if (!statusMoveMatch) { if (!statusMoveMatch) {
sub_80928C0(gFormatBuffer_Items[0], currMove, NULL); 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; moveUsable = FALSE;
} }
} }
@ -1885,7 +1885,7 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
assistMove.id = sub_8057144(attacker); assistMove.id = sub_8057144(attacker);
sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); 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); moveWasUsed = TryUseChosenMove(attacker, var_34, itemId, arg_0, isLinkedMove, &assistMove);
} }
else { else {
@ -1903,10 +1903,10 @@ bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s3
if (unkBefore == gUnknown_202F208) { if (unkBefore == gUnknown_202F208) {
if (itemId == 0) { if (itemId == 0) {
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC690); // The currMove failed! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC690); // The currMove failed!
} }
else { 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); assistMove.id = sub_8057144(attacker);
movePtr = &assistMove; movePtr = &assistMove;
sub_80928C0(gFormatBuffer_Items[0], &assistMove, NULL); 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); TryUseChosenMove(attacker, 0, itemId, arg_0, isLinkedMove, movePtr);
} }
@ -1966,48 +1966,48 @@ static void TriggerTargetAbilityEffect(Entity *attacker)
EntityInfo *entInfo = GetEntInfo(attacker); EntityInfo *entInfo = GetEntInfo(attacker);
if (entInfo->abilityEffectFlags & ABILITY_FLAG_ARENA_TRAP) { 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); ImmobilizedStatusTarget(attacker, attacker);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_SHADOW_TAG) { 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); ImmobilizedStatusTarget(attacker, attacker);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_MAGNET_PULL) { 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); ImmobilizedStatusTarget(attacker, attacker);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) { if (entInfo->abilityEffectFlags & ABILITY_FLAG_STATIC) {
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEF0C); // Static caused paralysis! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEF0C); // Static caused paralysis!
ParalyzeStatusTarget(attacker, attacker, TRUE); ParalyzeStatusTarget(attacker, attacker, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PRLZ) { 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); ParalyzeStatusTarget(attacker, attacker, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_POISON_POINT) { 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); PoisonedStatusTarget(attacker, attacker, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_PSN) { 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); PoisonedStatusTarget(attacker, attacker, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_EFFECT_SPORE_SLP) { 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); sub_8075C58(attacker, attacker, CalculateStatusTurns(attacker, gUnknown_80F4E74, TRUE), TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_FLAME_BODY) { 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); BurnedStatusTarget(attacker, attacker, TRUE, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_CUTE_CHARM) { 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); InfatuateStatusTarget(attacker, attacker, TRUE);
} }
if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) { if (entInfo->abilityEffectFlags & ABILITY_FLAG_STENCH) {
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FEFD0); // A horrid stench billowed out LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FEFD0); // A horrid stench billowed out
sub_80428A0(attacker); sub_80428A0(attacker);
entInfo->terrifiedTurns = gUnknown_80F5004; 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)) { if (GetEntInfo(attacker)->muzzled.muzzled == TRUE && FailsWhileMuzzled(move->id)) {
SetMessageArgument(gFormatBuffer_Monsters[0], attacker, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], attacker, 0);
TryDisplayDungeonLoggableMessage(attacker, msg); LogMessageByIdWithPopupCheckUser(attacker, msg);
sub_803E708(0xA, 0x3F); sub_803E708(0xA, 0x3F);
TryDisplayDungeonLoggableMessage(attacker, gUnknown_80FC710); // is muzzled! LogMessageByIdWithPopupCheckUser(attacker, gUnknown_80FC710); // is muzzled!
return FALSE; return FALSE;
} }
else if (!moveUsable) { else if (!moveUsable) {
SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0); SetMessageArgument_2(gFormatBuffer_Monsters[0], GetEntInfo(attacker), 0);
if (itemId == 0) { if (itemId == 0) {
sub_80928C0(gFormatBuffer_Items[0], move, NULL); sub_80928C0(gFormatBuffer_Items[0], move, NULL);
TryDisplayDungeonLoggableMessage(attacker, msg); LogMessageByIdWithPopupCheckUser(attacker, msg);
sub_803E708(0xA, 0x3F); 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 { else {
BufferItemName(gFormatBuffer_Items[0], itemId, NULL); BufferItemName(gFormatBuffer_Items[0], itemId, NULL);
TryDisplayDungeonLoggableMessage(attacker, msg); LogMessageByIdWithPopupCheckUser(attacker, msg);
sub_803E708(0xA, 0x3F); 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; return FALSE;
} }
@ -2197,7 +2197,7 @@ bool8 TryUseChosenMove(struct Entity *attacker, u32 r6, s32 itemId, u32 var_30,
if (gUnknown_202F21A != 0) { if (gUnknown_202F21A != 0) {
SendImmobilizeEndMessage(attacker, attacker); EndFrozenClassStatus(attacker, attacker);
SendLinkedEndMessage(attacker, attacker); SendLinkedEndMessage(attacker, attacker);
} }
@ -2842,7 +2842,7 @@ static void SetTargetsForMove(Entity **targetsArray, Entity *attacker, Move *mov
else if (targetFlagsAnd == 0x30) { else if (targetFlagsAnd == 0x30) {
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; 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 (EntityExists(dungeonMon) && sub_8045A70(attacker, dungeonMon)) {
if (dungeonMon == attacker) { if (dungeonMon == attacker) {
arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, attacker, move, canHitSelf); 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) { else if (targetFlagsAnd == 0x60) {
s32 i; s32 i;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { for (i = 0; i < DUNGEON_MAX_POKEMON; i++) {
Entity *dungeonMon = gDungeon->allPokemon[i]; Entity *dungeonMon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(dungeonMon)) { if (EntityExists(dungeonMon)) {
arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner); arrId = SetNewTarget(arrId, targetsArray, targetFlags, attacker, dungeonMon, move, canHitPartner);
} }
@ -2908,7 +2908,7 @@ static s32 SetNewTarget(s32 targetArrId, Entity **targetsArray, s32 targetFlags_
return targetArrId; return targetArrId;
if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER) if (targetInfo->shopkeeper == SHOPKEEPER_MODE_SHOPKEEPER)
return targetArrId; 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; return targetArrId;
if (canHitAnyone) { if (canHitAnyone) {
@ -3081,7 +3081,7 @@ u32 sub_8057144(Entity * pokemon)
nMoves = 0; nMoves = 0;
for (i = 0; i < DUNGEON_MAX_POKEMON; i++) for (i = 0; i < DUNGEON_MAX_POKEMON; i++)
{ {
Entity *dungeonMon = gDungeon->allPokemon[i]; Entity *dungeonMon = gDungeon->activeMonsterPtrs[i];
if (EntityExists(dungeonMon)) { if (EntityExists(dungeonMon)) {
Move *moves = GetEntInfo(dungeonMon)->moves.moves; Move *moves = GetEntInfo(dungeonMon)->moves.moves;
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)

View File

@ -28,7 +28,7 @@ bool8 HasSafeguardStatus(Entity * pokemon, Entity * target, bool8 displayMessage
{ {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) { if (GetEntInfo(target)->protection.protectionStatus == STATUS_SAFEGUARD) {
if (displayMessage) { if (displayMessage) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC); TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC2FC);
} }
return TRUE; return TRUE;
@ -40,7 +40,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage)
{ {
if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) { if (GetEntInfo(target)->protection.protectionStatus == STATUS_MIST) {
if (displayMessage) { if (displayMessage) {
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FC31C);
} }
return TRUE; return TRUE;
@ -48,7 +48,7 @@ bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage)
else { else {
if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) { if (HasAbility(target, ABILITY_CLEAR_BODY) || HasAbility(target, ABILITY_WHITE_SMOKE)) {
if (displayMessage) { if (displayMessage) {
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC); TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FCEFC);
} }
return TRUE; return TRUE;
@ -252,7 +252,7 @@ bool8 sub_8071A8C(Entity *pokemon)
if(EntityExists(pokemon)) if(EntityExists(pokemon))
{ {
pokemonInfo = GetEntInfo(pokemon); pokemonInfo = GetEntInfo(pokemon);
if(pokemonInfo->clientType != CLIENT_TYPE_CLIENT) if(pokemonInfo->monsterBehavior != BEHAVIOR_RESCUE_TARGET)
{ {
if(!sub_8071A8C_sub(pokemonInfo)) if(!sub_8071A8C_sub(pokemonInfo))
return TRUE; return TRUE;

View File

@ -103,7 +103,7 @@ void sub_804513C(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
gDungeon->allPokemon[index] = NULL; gDungeon->activeMonsterPtrs[index] = NULL;
} }
for (index = 0; index < DUNGEON_MAX_ITEMS; index++) for (index = 0; index < DUNGEON_MAX_ITEMS; index++)
@ -132,7 +132,7 @@ void sub_804522C(void) {
{ {
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if(EntityExists(entity)) if(EntityExists(entity))
{ {
if(entity == gDungeon->unk181e8.cameraTarget) if(entity == gDungeon->unk181e8.cameraTarget)

View File

@ -42,7 +42,7 @@ Entity *GetPartnerEntity(void)
return entity; return entity;
} }
} }
return GetEntityFromClientType(CLIENT_TYPE_PARTNER); return GetEntityFromMonsterBehavior(BEHAVIOR_ALLY);
} }
void sub_80854D4(void) void sub_80854D4(void)
@ -150,15 +150,15 @@ void sub_808563C(DungeonCallback func)
} }
} }
Entity *GetEntityFromClientType(u8 entityType) Entity *GetEntityFromMonsterBehavior(u8 entityType)
{ {
Entity * entity; Entity * entity;
s32 index; s32 index;
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if ((EntityExists(entity)) && (GetEntInfo(entity)->clientType == entityType)) return entity; if ((EntityExists(entity)) && (GetEntInfo(entity)->monsterBehavior == entityType)) return entity;
} }
return NULL; return NULL;
} }
@ -204,7 +204,7 @@ void sub_8085764(void)
for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_WILD_POKEMON; index++)
{ {
entity = gDungeon->wildPokemon[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); sub_8068FE0(entity,0x207,&stackEntity);
} }
} }
@ -219,7 +219,7 @@ void sub_80857B8(void)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
entityInfo = GetEntInfo(entity); entityInfo = GetEntInfo(entity);
if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) { if ((gDungeon->unk4 == 0) && (gDungeon->unk2 == 0)) {
@ -303,7 +303,7 @@ void sub_8085930(s32 direction)
entity = gDungeon->wildPokemon[index]; entity = gDungeon->wildPokemon[index];
if(EntityExists(entity)) if(EntityExists(entity))
{ {
if(GetEntInfo(entity)->clientType == CLIENT_TYPE_PARTNER) if(GetEntInfo(entity)->monsterBehavior == BEHAVIOR_ALLY)
{ {
if(direction >= NUM_DIRECTIONS) 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); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
switch (pokemonInfo->clientType) switch (pokemonInfo->monsterBehavior)
{ {
case CLIENT_TYPE_CLIENT: case BEHAVIOR_RESCUE_TARGET:
case 0x3: case BEHAVIOR_SKARMORY:
case 0x5: case BEHAVIOR_5:
case 0x6: case BEHAVIOR_6:
case 0x7: case BEHAVIOR_MEDICHAM:
case 0x8: case BEHAVIOR_ZAPDOS:
case 0x9: case BEHAVIOR_MOLTRES:
case 0xD: case BEHAVIOR_ARTICUNO:
case 0xE: case BEHAVIOR_GROUDON_2:
case 0xF: case BEHAVIOR_RAYQUAZA:
case 0x10: case BEHAVIOR_16:
case 0x11: case BEHAVIOR_MEWTWO:
case 0x12: case BEHAVIOR_ENTEI:
case 0x13: case BEHAVIOR_RAIKOU:
case 0x14: case BEHAVIOR_SUICUNE:
case 0x15: case BEHAVIOR_HO_OH:
case 0x16: case BEHAVIOR_LATIOS:
case 0x17: case BEHAVIOR_REGIROCK:
case 0x18: case BEHAVIOR_REGICE:
case 0x19: case BEHAVIOR_REGISTEEL:
case 0x1A: case BEHAVIOR_JIRACHI:
case 0x1B: case BEHAVIOR_LUGIA:
case 0x1C: case BEHAVIOR_KYOGRE:
case 0x1D: case BEHAVIOR_29:
case 0x1E: case BEHAVIOR_CELEBI:
case 0x1F: case BEHAVIOR_SMEARGLE:
case 0x20: case BEHAVIOR_32:
case 0x21: case BEHAVIOR_33:
case 0x22: case BEHAVIOR_34:
case 0x23: case BEHAVIOR_35:
case 0x24: case BEHAVIOR_36:
return TRUE; return TRUE;
case CLIENT_TYPE_NONE: case BEHAVIOR_FIXED_ENEMY:
case CLIENT_TYPE_PARTNER: case BEHAVIOR_ALLY:
case CLIENT_TYPE_DONT_MOVE: case BEHAVIOR_DIGLETT:
case 0xA: case BEHAVIOR_ALAKAZAM_1:
case 0xB: case BEHAVIOR_GROUDON_1:
case 0xC: case BEHAVIOR_ALAKAZAM_2:
default: default:
return FALSE; return FALSE;
} }

View File

@ -451,8 +451,8 @@ bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 para
if (targetInfo->HP > targetInfo->maxHPStat) { if (targetInfo->HP > targetInfo->maxHPStat) {
targetInfo->HP = targetInfo->maxHPStat; targetInfo->HP = targetInfo->maxHPStat;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],attacker,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],attacker,0);
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
SetExpMultplier(attackerInfo); SetExpMultplier(attackerInfo);
// $m0 and $m1 shared their HP // $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) { if (flag) {
TryDisplayDungeonLoggableMessage3(pokemon, target, gUnknown_80FD350); 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 (flashFireStatus != FLASH_FIRE_STATUS_NONE) {
if (GetEntInfo(target)->unk152 == 0) { if (GetEntInfo(target)->unk152 == 0) {
GetEntInfo(target)->unk152 = 1; GetEntInfo(target)->unk152 = 1;
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) { if (flashFireStatus == FLASH_FIRE_STATUS_MAXED) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAE00); // Fire moves won't become stronger 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; hasGrudge = FALSE;
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
if (entityInfo->grudge) { if (entityInfo->grudge) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD2B4); 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->offensiveMultipliers[index] = iVar3->offensiveMultipliers[index];
iVar4->defensiveMultipliers[index] = iVar3->defensiveMultipliers[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! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBD58); // It psyched itself up!
SetExpMultplier(iVar4); SetExpMultplier(iVar4);
return TRUE; return TRUE;
@ -2278,8 +2278,8 @@ bool8 sub_805A120(Entity * pokemon,Entity * target, Move *move, u32 param_4)
r8 = GetEntInfo(target); r8 = GetEntInfo(target);
sp = r8; sp = r8;
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
if (HasAbility(target, ABILITY_STICKY_HOLD)) { if (HasAbility(target, ABILITY_STICKY_HOLD)) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE4);
return FALSE; return FALSE;
@ -2596,8 +2596,8 @@ bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_
entityInfo = GetEntInfo(pokemon); entityInfo = GetEntInfo(pokemon);
targetEntityInfo = GetEntInfo(target); targetEntityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (HasAbility(target, ABILITY_STICKY_HOLD)) if (HasAbility(target, ABILITY_STICKY_HOLD))
{ {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCCE8); 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, SetEntityPixelPos(&stackEntity,(target->pos.x * 0x18 + 4) * 0x100,
(target->pos.y * 0x18 + 4) * 0x100); (target->pos.y * 0x18 + 4) * 0x100);
stackEntity.spawnGenID = 0; stackEntity.spawnGenID = 0;
SetMessageArgument(gFormatBuffer_Items[0],&stackEntity,0); SubstitutePlaceholderStringTags(gFormatBuffer_Items[0],&stackEntity,0);
sub_804652C(pokemon,&stackEntity,item,1,0); sub_804652C(pokemon,&stackEntity,item,1,0);
} }
@ -2774,7 +2774,7 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para
flag = TRUE; flag = TRUE;
} }
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FC5CC);
} }
return flag; 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) && GetTreatmentBetweenMonsters(pokemon,targetEntity,FALSE,FALSE) == TREATMENT_TREAT_AS_ALLY)
{ {
EntityInfo *targetInfo = GetEntInfo(targetEntity); 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); sub_807D148(pokemon,targetEntity,2,&target->pos);
flag = TRUE; flag = TRUE;
SetExpMultplier(info); SetExpMultplier(info);

View File

@ -395,7 +395,7 @@ bool8 CanUseOnSelfWithStatusChecker(Entity *pokemon, Move *move)
case MOVE_DECOY_MAKER: case MOVE_DECOY_MAKER:
case MOVE_FOLLOW_ME: case MOVE_FOLLOW_ME:
case MOVE_SUBSTITUTE: case MOVE_SUBSTITUTE:
if (gDungeon->decoyActive) if (gDungeon->decoyIsActive)
{ {
return FALSE; return FALSE;
} }

View File

@ -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) bool8 CannotSleep(Entity * pokemon, Entity * target, u8 param_3, bool8 displayMessage)
{ {
if ((!EntityExists(target)) || 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))))) { (HasSafeguardStatus(pokemon,target,displayMessage))))) {
return TRUE; 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)) { if ((entityInfo->sleep.sleep == STATUS_SLEEP) || (entityInfo->sleep.sleep == STATUS_NAPPING) || (entityInfo->sleep.sleep == STATUS_NIGHTMARE)) {
isAsleep = TRUE; isAsleep = TRUE;
} }
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
if (entityInfo->sleep.sleep != STATUS_SLEEPLESS) if (entityInfo->sleep.sleep != STATUS_SLEEPLESS)
{ {
@ -440,7 +440,7 @@ void InfatuateStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessa
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
if (!HasSafeguardStatus(pokemon,target,displayMessage)) { if (!HasSafeguardStatus(pokemon,target,displayMessage)) {
if (HasAbility(target,ABILITY_OBLIVIOUS)) { if (HasAbility(target,ABILITY_OBLIVIOUS)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (displayMessage) { if (displayMessage) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC4C);
} }
@ -731,7 +731,7 @@ void FrozenStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
return; return;
} }
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
if ((entityInfo->immobilize.immobilizeStatus != STATUS_FROZEN) && !HasSafeguardStatus(pokemon,target,displayMessage)) { 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); sub_8076CB4(entityInfo->unk9C);
} }
else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) { if (entityInfo->immobilize.immobilizeStatus != STATUS_CONSTRICTION) {
entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION; entityInfo->immobilize.immobilizeStatus = STATUS_CONSTRICTION;
entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E58,TRUE) + 1;
@ -812,10 +812,10 @@ void ImmobilizedStatusTarget(Entity * pokemon, Entity * target)
sub_8076CB4(entityInfo->unk9C); sub_8076CB4(entityInfo->unk9C);
} }
else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) { else if (entityInfo->immobilize.immobilizeStatus == STATUS_INGRAIN) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FA844);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) { if (entityInfo->immobilize.immobilizeStatus != STATUS_SHADOW_HOLD) {
entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD; entityInfo->immobilize.immobilizeStatus = STATUS_SHADOW_HOLD;
entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E54,TRUE) + 1; 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) { if (entityInfo->immobilize.immobilizeStatus == STATUS_WRAP || entityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) {
sub_8076CB4(entityInfo->unk9C); sub_8076CB4(entityInfo->unk9C);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) { if (entityInfo->immobilize.immobilizeStatus != STATUS_INGRAIN) {
entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN; entityInfo->immobilize.immobilizeStatus = STATUS_INGRAIN;
entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1; entityInfo->immobilize.immobilizeStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E60,TRUE) + 1;
@ -887,7 +887,7 @@ void WrapTarget(Entity * pokemon, Entity * target)
targetEntityInfo->unk9C = *piVar3; targetEntityInfo->unk9C = *piVar3;
*piVar3 +=1; *piVar3 +=1;
nullsub_69(pokemon, target); nullsub_69(pokemon, target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6D8);
sub_806CE94(target,8); sub_806CE94(target,8);
goto _08076C98; goto _08076C98;
@ -895,19 +895,19 @@ void WrapTarget(Entity * pokemon, Entity * target)
} }
} }
if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) { if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAP) {
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC);
} }
if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) { if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAP) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB6FC);
} }
if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) { if (pokemonEntityData->immobilize.immobilizeStatus == STATUS_WRAPPED) {
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718);
} }
if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) { if (targetEntityInfo->immobilize.immobilizeStatus == STATUS_WRAPPED) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB718);
} }
_08076C98: _08076C98:
@ -922,7 +922,7 @@ void sub_8076CB4(s32 param_1)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
entityInfo = GetEntInfo(entity); entityInfo = GetEntInfo(entity);
if (entityInfo->unk9C == param_1) { if (entityInfo->unk9C == param_1) {
@ -949,7 +949,7 @@ void PetrifiedStatusTarget(Entity * pokemon, Entity * target)
if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) { if ((u8)(targetEntityInfo->immobilize.immobilizeStatus - 3U) < 2) {
sub_8076CB4(targetEntityInfo->unk9C); sub_8076CB4(targetEntityInfo->unk9C);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) { if (targetEntityInfo->immobilize.immobilizeStatus != STATUS_PETRIFIED) {
targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED; targetEntityInfo->immobilize.immobilizeStatus = STATUS_PETRIFIED;
if (targetEntityInfo->isTeamLeader) { if (targetEntityInfo->isTeamLeader) {
@ -1003,19 +1003,19 @@ void LowerAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 de
return; return;
} }
if (HasHeldItem(target, ITEM_TWIST_BAND)) { if (HasHeldItem(target, ITEM_TWIST_BAND)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550);
} }
else { else {
if ((!HasAbility(target, ABILITY_HYPER_CUTTER)) || (index != STAT_STAGE_ATK)) goto _08076EE4; 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); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60);
} }
} }
else { else {
_08076EE4: _08076EE4:
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8041F28(target,index); sub_8041F28(target,index);
if (decrement == 1) { if (decrement == 1) {
strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); 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)) { if (!param_5 || !sub_8071728(pokemon,target,displayMessage)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8041F4C(target,index); sub_8041F4C(target,index);
if (decrement == 1) { if (decrement == 1) {
strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4); strcpy(gFormatBuffer_Items[1],*gUnknown_80FC0E4);
@ -1088,7 +1088,7 @@ void RaiseAttackStageTarget(Entity * pokemon, Entity * target, s32 index, s32 in
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8041F70(target,index); sub_8041F70(target,index);
if (index != STAT_STAGE_ATK) { if (index != STAT_STAGE_ATK) {
strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8); strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0C8);
@ -1128,7 +1128,7 @@ void RaiseDefenseStageTarget(Entity * pokemon, Entity * target, s32 index, s32 i
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8041F94(target,index); sub_8041F94(target,index);
if (index != STAT_STAGE_DEF) { if (index != STAT_STAGE_DEF) {
strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC); strcpy(gFormatBuffer_Items[0],*gUnknown_80FC0AC);

View File

@ -376,7 +376,7 @@ static void PromptNewQuestion(void)
static void PrintPersonalityTypeDescription(void) static void PrintPersonalityTypeDescription(void)
{ {
CopyMonsterNametoBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID); CopyMonsterNameToBuffer(gFormatBuffer_Monsters[0], sPersonalityTestTracker->StarterID);
CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101); CreateDialogueBoxAndPortrait(sPersonalityTypeDescriptionTable[sPersonalityTestTracker->playerNature], 0, 0, 0x101);
} }

View File

@ -140,7 +140,7 @@ void sub_808CE74(s16 species, bool8 isLeader, u8 *name)
"\tadd r4, sp, 0x58\n" "\tadd r4, sp, 0x58\n"
"\tadds r0, r4, 0\n" "\tadds r0, r4, 0\n"
"\tadds r1, r7, 0\n" "\tadds r1, r7, 0\n"
"\tbl CopyMonsterNametoBuffer\n" "\tbl CopyMonsterNameToBuffer\n"
"\tadd r0, sp, 0x4C\n" "\tadd r0, sp, 0x4C\n"
"\tadds r1, r4, 0\n" "\tadds r1, r4, 0\n"
"\tmovs r2, 0xA\n" "\tmovs r2, 0xA\n"
@ -276,7 +276,7 @@ void sub_808CFD0(PokemonStruct1 *pokemon, s16 _species, u8* name, u32 _itemID, D
if (name == NULL) { if (name == NULL) {
// HACK // HACK
register u8 *buffer asm("r0") = name_buffer; register u8 *buffer asm("r0") = name_buffer;
CopyMonsterNametoBuffer(buffer, species); CopyMonsterNameToBuffer(buffer, species);
BoundedCopyStringtoBuffer(pokemon->name, name_buffer, POKEMON_NAME_LENGTH); BoundedCopyStringtoBuffer(pokemon->name, name_buffer, POKEMON_NAME_LENGTH);
} }
else { else {

View File

@ -269,7 +269,7 @@ bool8 ComparePokemonNames(s16 a1, s16 a2)
return FALSE; return FALSE;
} }
void CopyMonsterNametoBuffer(u8 * buffer, s16 index) void CopyMonsterNameToBuffer(u8 * buffer, s16 index)
{ {
strncpy(buffer, gMonsterParameters[index].species, 0x14); strncpy(buffer, gMonsterParameters[index].species, 0x14);
} }
@ -397,7 +397,7 @@ u8 GetRegenSpeed(s16 index)
return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24; return ((u8)(gMonsterParameters[index].regenSpeed) << 25) >> 24;
} }
bool8 CanMove(s16 index) bool8 GetCanMoveFlag(s16 index)
{ {
return gMonsterParameters[index].canMove; return gMonsterParameters[index].canMove;
} }

View File

@ -213,7 +213,7 @@ void UpdateFlashFireBoost(Entity * pokemon, Entity *target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
flashFireBoost = UpdateFlashFireBoost_sub(entityInfo); flashFireBoost = UpdateFlashFireBoost_sub(entityInfo);
if (entityInfo->flashFireBoost != flashFireBoost) { if (entityInfo->flashFireBoost != flashFireBoost) {
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)) { 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); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD550);
return; return;
} }
if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) { if (HasAbility(target, ABILITY_HYPER_CUTTER) && (statStage == STAT_STAGE_ATK) && (param_4 < 0x100)) {
if (displayMessage) { if (displayMessage) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA60);
} }
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
oldMulti = entityInfo->offensiveMultipliers[statStage]; oldMulti = entityInfo->offensiveMultipliers[statStage];
if (param_4 < 0x100) { if (param_4 < 0x100) {
@ -308,7 +308,7 @@ void ChangeDefenseMultiplierTarget(Entity *pokemon, Entity *target, u32 statStag
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
oldMulti = entityInfo->defensiveMultipliers[statStage]; oldMulti = entityInfo->defensiveMultipliers[statStage];
if (param_4 < 0x100) { if (param_4 < 0x100) {
@ -345,7 +345,7 @@ void RaiseAccuracyStageTarget(Entity * pokemon, Entity * target, s32 statStage)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8042040(target,statStage); sub_8042040(target,statStage);
if (statStage != STAT_STAGE_ACCURACY) { if (statStage != STAT_STAGE_ACCURACY) {
strcpy(gFormatBuffer_Items[0],*gUnknown_80FC090); 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 (HasAbility(target, ABILITY_KEEN_EYE) && (statStage == STAT_STAGE_ACCURACY)){
if(displayMessage) if(displayMessage)
{ {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCA64);
} }
} }
else { else {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
sub_8042060(target,statStage); sub_8042060(target,statStage);
if (entityInfo->hitChanceStages[statStage] != 0) { if (entityInfo->hitChanceStages[statStage] != 0) {
entityInfo->hitChanceStages[statStage]--; entityInfo->hitChanceStages[statStage]--;
@ -407,13 +407,13 @@ void CringeStatusTarget(Entity * pokemon,Entity * target, bool8 displayMessage)
if (EntityExists(target)) { if (EntityExists(target)) {
if (!HasSafeguardStatus(pokemon, target, displayMessage)) { if (!HasSafeguardStatus(pokemon, target, displayMessage)) {
if (HasAbility(target, ABILITY_INNER_FOCUS)){ if (HasAbility(target, ABILITY_INNER_FOCUS)){
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if(displayMessage) if(displayMessage)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCC18);
} }
else { else {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE) if(entityInfo->volatileStatus.volatileStatus != STATUS_CRINGE)
{ {
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 ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) {
if (HasAbility(target, ABILITY_LIMBER)) { if (HasAbility(target, ABILITY_LIMBER)) {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (displayMessage) { if (displayMessage) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCBF8);
} }
@ -451,7 +451,7 @@ void ParalyzeStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessag
{ {
bVar6 = TRUE; bVar6 = TRUE;
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) { if (entityInfo->nonVolatile.nonVolatileStatus != STATUS_PARALYSIS) {
entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS; entityInfo->nonVolatile.nonVolatileStatus = STATUS_PARALYSIS;
entityInfo->nonVolatile.nonVolatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4E50,TRUE) + 1; 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; turns = CalculateStatusTurns(target,gUnknown_80F4E40,FALSE) + 1;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
movSpeed = CalcSpeedStage(target); movSpeed = CalcSpeedStage(target);
if (movSpeed == MAX_SPEED_STAGE) { if (movSpeed == MAX_SPEED_STAGE) {
if (displayMessage) if (displayMessage)
@ -548,7 +548,7 @@ void LowerMovementSpeedTarget(Entity * pokemon, Entity * target, s32 levels, boo
return; return;
} }
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
movSpeed = CalcSpeedStage(target); movSpeed = CalcSpeedStage(target);
if (movSpeed == 0) { if (movSpeed == 0) {
if (displayMessage) if (displayMessage)
@ -591,7 +591,7 @@ void ConfuseStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage
return; return;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (HasHeldItem(target,ITEM_PERSIM_BAND)) { if (HasHeldItem(target,ITEM_PERSIM_BAND)) {
if (displayMessage) if (displayMessage)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD500);
@ -625,7 +625,7 @@ void CowerStatusTarget(Entity * pokemon, Entity * target, bool8 displayMessage)
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,displayMessage))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) { if (entityInfo->volatileStatus.volatileStatus != STATUS_COWERING) {
entityInfo->volatileStatus.volatileStatus = STATUS_COWERING; entityInfo->volatileStatus.volatileStatus = STATUS_COWERING;
entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ECC,TRUE) + 1; 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); EntityUpdateStatusSprites(target);
gFormatArgs[0] = HP; gFormatArgs[0] = HP;
gFormatArgs[1] = maxHPStat; gFormatArgs[1] = maxHPStat;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if ((HP == 0) && (maxHPStat == 0)) { if ((HP == 0) && (maxHPStat == 0)) {
if (displayMessage_u8) if (displayMessage_u8)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB204); // $m0's HP remained unchanged
@ -729,7 +729,7 @@ void HandleScannerOrb(Entity* pokemon, Entity* target)
{ {
GetEntInfo(target)->scanning = TRUE; GetEntInfo(target)->scanning = TRUE;
nullsub_75(target); nullsub_75(target);
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEA0); // Item locations became evident
sub_803F580(0); sub_803F580(0);
sub_8040A84(); sub_8040A84();
@ -754,7 +754,7 @@ void HandleStairsOrb(Entity* pokemon, Entity* target)
{ {
GetEntInfo(target)->stairSpotter = TRUE; GetEntInfo(target)->stairSpotter = TRUE;
nullsub_76(target); nullsub_76(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAEC8);
sub_803F580(0); sub_803F580(0);
sub_8040A84(); sub_8040A84();
@ -774,7 +774,7 @@ void HandleRadarOrb(Entity* pokemon, Entity* target)
{ {
GetEntInfo(target)->powerEars = TRUE; GetEntInfo(target)->powerEars = TRUE;
nullsub_77(target); nullsub_77(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FAFAC);
sub_803F580(0); sub_803F580(0);
sub_8040A84(); sub_8040A84();
@ -800,7 +800,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage)
if (HasSafeguardStatus(pokemon,target,displayMessage)) { if (HasSafeguardStatus(pokemon,target,displayMessage)) {
return; return;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (MonsterIsType(target, TYPE_GRASS)) { if (MonsterIsType(target, TYPE_GRASS)) {
if (displayMessage) if (displayMessage)
TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage); TryDisplayDungeonLoggableMessage3(pokemon,target,*gPtrCantLeechSeedMonMessage);
@ -824,7 +824,7 @@ void HandleLeechSeed(Entity * pokemon, Entity * target, bool8 displayMessage)
} }
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
if (pokemon == gDungeon->allPokemon[index]) { if (pokemon == gDungeon->activeMonsterPtrs[index]) {
entityInfo->linked.unkD8 = index; entityInfo->linked.unkD8 = index;
entityInfo2 = GetEntInfo(pokemon); entityInfo2 = GetEntInfo(pokemon);
entityInfo->linked.unkD4 = entityInfo2->unk98; entityInfo->linked.unkD4 = entityInfo2->unk98;
@ -847,7 +847,7 @@ void sub_8078084(Entity * pokemon)
entityInfo = GetEntInfo(pokemon); entityInfo = GetEntInfo(pokemon);
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
target = gDungeon->allPokemon[index]; target = gDungeon->activeMonsterPtrs[index];
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo2 = GetEntInfo(target); entityInfo2 = GetEntInfo(target);
if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1) if((u8)(entityInfo2->linked.linkedStatus - 1) <= 1)
@ -873,7 +873,7 @@ void DestinyBondStatusTarget(Entity * pokemon, Entity * target)
if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) && if (((EntityExists(target)) && (GetEntityType(pokemon) == ENTITY_MONSTER)) &&
(GetEntityType(target) == ENTITY_MONSTER)) { (GetEntityType(target) == ENTITY_MONSTER)) {
entityInfo = GetEntInfo(pokemon); entityInfo = GetEntInfo(pokemon);
SetMessageArgument(gFormatBuffer_Monsters[0],pokemon,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],pokemon,0);
linkedStatus = &entityInfo->linked.linkedStatus; linkedStatus = &entityInfo->linked.linkedStatus;
if (entityInfo->linked.linkedStatus != STATUS_DESTINY_BOND) 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++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
if (target == gDungeon->allPokemon[index]) { if (target == gDungeon->activeMonsterPtrs[index]) {
entityInfo->linked.unkD8 = index; entityInfo->linked.unkD8 = index;
entityInfo2 = GetEntInfo(target); entityInfo2 = GetEntInfo(target);
entityInfo->linked.unkD4 = entityInfo2->unk98; entityInfo->linked.unkD4 = entityInfo2->unk98;
@ -910,7 +910,7 @@ void SureShotStatusTarget(Entity *pokemon, Entity * target, s32 turns)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) { if (entityInfo->moveStatus.moveStatus != STATUS_SURE_SHOT) {
entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT; entityInfo->moveStatus.moveStatus = STATUS_SURE_SHOT;
entityInfo->moveStatus.moveStatusTurns = turns + 1; entityInfo->moveStatus.moveStatusTurns = turns + 1;
@ -930,7 +930,7 @@ void WhifferStatusTarget(Entity *pokemon, Entity * target, s32 turns)
if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) { if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) { if (entityInfo->moveStatus.moveStatus != STATUS_WHIFFER) {
entityInfo->moveStatus.moveStatus = STATUS_WHIFFER; entityInfo->moveStatus.moveStatus = STATUS_WHIFFER;
entityInfo->moveStatus.moveStatusTurns = turns + 1; entityInfo->moveStatus.moveStatusTurns = turns + 1;
@ -950,7 +950,7 @@ void FixedDamageStatusTarget(Entity *pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) { if (entityInfo->moveStatus.moveStatus != STATUS_SET_DAMAGE) {
entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE; entityInfo->moveStatus.moveStatus = STATUS_SET_DAMAGE;
entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1; entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC4, FALSE) + 1;
@ -970,7 +970,7 @@ void FocusEnergyStatusTarget(Entity *pokemon, Entity * target)
if (EntityExists(target)) { if (EntityExists(target)) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) { if (entityInfo->moveStatus.moveStatus != STATUS_FOCUS_ENERGY) {
entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY; entityInfo->moveStatus.moveStatus = STATUS_FOCUS_ENERGY;
entityInfo->moveStatus.moveStatusTurns = CalculateStatusTurns(target, gUnknown_80F4EC8, FALSE) + 1; 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))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon, target, TRUE))) {
targetEntityInfo = GetEntInfo(target); targetEntityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) { if (targetEntityInfo->waitingStruct.waitingStatus == STATUS_DECOY) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB994);
} }
else { else {
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if ((((EntityExists(entity)) && (target != entity)) && if ((((EntityExists(entity)) && (target != entity)) &&
(u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) { (u8)(GetEntInfo(entity)->waitingStruct.waitingStatus - 2U) < 2)) {
SendWaitingEndMessage(pokemon,entity,STATUS_NONE); SendWaitingEndMessage(pokemon,entity,STATUS_NONE);
@ -1010,22 +1010,22 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
} }
} }
sub_8041D38(target); sub_8041D38(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) { if (targetEntityInfo->waitingStruct.waitingStatus != STATUS_NONE) {
SendWaitingEndMessage(pokemon,target, STATUS_DECOY); SendWaitingEndMessage(pokemon,target, STATUS_DECOY);
} }
targetEntityInfo->waitingStruct.waitingStatus = 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.unkCA = param_3;
targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED0,TRUE) + 1;
targetEntityInfo->waitingStruct.curseDamageCountdown = 0; targetEntityInfo->waitingStruct.curseDamageCountdown = 0;
sub_806CCB4(target,sub_806CEBC(target)); sub_806CCB4(target,sub_806CEBC(target));
gDungeon->decoyActive = TRUE; gDungeon->decoyIsActive = TRUE;
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB978);
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity2 = gDungeon->allPokemon[index]; entity2 = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity2)) { if (EntityExists(entity2)) {
entityInfo = GetEntInfo(entity2); entityInfo = GetEntInfo(entity2);
entityInfo->aiTarget.aiObjective = AI_STAND_STILL; entityInfo->aiTarget.aiObjective = AI_STAND_STILL;
@ -1033,7 +1033,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, u8 param_3)
entityInfo->aiTarget.aiTargetSpawnGenID = 0; entityInfo->aiTarget.aiTargetSpawnGenID = 0;
if (!entityInfo->isTeamLeader) { if (!entityInfo->isTeamLeader) {
action = entityInfo->action; action = entityInfo->action;
MoveIfPossible(entity2, TRUE); AIMovement(entity2, TRUE);
entityInfo->action = action; entityInfo->action = action;
} }
} }
@ -1070,7 +1070,7 @@ void CurseStatusTarget(Entity *pokemon, Entity * target)
targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1; targetEntityInfo->waitingStruct.waitingStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EA4,TRUE) + 1;
targetEntityInfo->waitingStruct.curseDamageCountdown = 0; targetEntityInfo->waitingStruct.curseDamageCountdown = 0;
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB004);
} }
else { else {
@ -1094,7 +1094,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) 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)) { if ((EntityExists(entity)) && (GetEntInfo(entity)->waitingStruct.waitingStatus == STATUS_SNATCH)) {
SendWaitingEndMessage(pokemon, entity, STATUS_NONE); SendWaitingEndMessage(pokemon, entity, STATUS_NONE);
} }
@ -1110,7 +1110,7 @@ void SnatchStatusTarget(Entity * pokemon, Entity * target)
gDungeon->snatchPokemon = target; gDungeon->snatchPokemon = target;
gDungeon->unk17B3C = targetEntityInfo->unk98; gDungeon->unk17B3C = targetEntityInfo->unk98;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB01C);
EntityUpdateStatusSprites(target); EntityUpdateStatusSprites(target);
} }
@ -1122,7 +1122,7 @@ void TauntStatusTarget(Entity * pokemon, Entity * target)
if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) { if ((EntityExists(target)) && (!HasSafeguardStatus(pokemon,target,TRUE))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) { if (entityInfo->volatileStatus.volatileStatus != STATUS_TAUNTED) {
entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED; entityInfo->volatileStatus.volatileStatus = STATUS_TAUNTED;
entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1; entityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4ED8,TRUE) + 1;
@ -1142,7 +1142,7 @@ void HandleStockpile(Entity * pokemon, Entity * target)
if ((EntityExists(target))) { if ((EntityExists(target))) {
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) { if (entityInfo->stockpileStage < MAX_STOCKPILE_STAGE) {
entityInfo->stockpileStage++; entityInfo->stockpileStage++;
sub_804178C(1); sub_804178C(1);
@ -1166,7 +1166,7 @@ void InvisibleStatusTarget(Entity * pokemon, Entity * target)
if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) { if (targetEntityInfo->transformStatus.transformStatus == STATUS_TRANSFORMED) {
SendTransformEndMessage(pokemon,target); SendTransformEndMessage(pokemon,target);
} }
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) { if (targetEntityInfo->transformStatus.transformStatus != STATUS_INVISIBLE) {
targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE; targetEntityInfo->transformStatus.transformStatus = STATUS_INVISIBLE;
targetEntityInfo->transformStatus.transformStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EE4,FALSE) + 1; 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)) { if (EntityExists(target) && !HasSafeguardStatus(pokemon, target, TRUE)) {
nullsub_82(target); nullsub_82(target);
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->perishSongTurns == 0) { if (entityInfo->perishSongTurns == 0) {
entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1; entityInfo->perishSongTurns = CalculateStatusTurns(target,gUnknown_80F4EEC,FALSE) + 1;
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBB04); 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 ((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)) { 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); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBBD4);
} }
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) { if (EntityInfo->volatileStatus.volatileStatus != STATUS_ENCORE) {
EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE; EntityInfo->volatileStatus.volatileStatus = STATUS_ENCORE;
EntityInfo->volatileStatus.volatileStatusTurns = CalculateStatusTurns(target,gUnknown_80F4EF4,TRUE) + 1; 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; bellyBefore = targetInfo->maxBelly;
targetInfo->maxBelly = FixedPoint_Subtract(bellyBefore, sp0); targetInfo->maxBelly = FixedPoint_Subtract(bellyBefore, sp0);
targetInfo->belly = FixedPoint_Min(targetInfo->belly, targetInfo->maxBelly); 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)) { if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->maxBelly)) {
sub_8041D9C(target); sub_8041D9C(target);
@ -1261,7 +1261,7 @@ void sub_8078A58(Entity *pokemon, Entity *target, s32 param_3, s32 param_4)
bellyBefore = targetInfo->belly; bellyBefore = targetInfo->belly;
targetInfo->belly = FixedPoint_Subtract(bellyBefore, sp8); targetInfo->belly = FixedPoint_Subtract(bellyBefore, sp8);
SetMessageArgument(gFormatBuffer_Monsters[0], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], target, 0);
if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) { if (FixedPointToInt(bellyBefore) != FixedPointToInt(targetInfo->belly)) {
nullsub_84(target); 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! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE64); // $m0's belly filled up full!
} }
if (FixedPointToInt(sp_0x20) == FixedPointToInt(targetInfo->maxBelly)) { 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! if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBDF0); // $m0's belly won't get any bigger!
} }
else { else {
sub_8041DB0(target); 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! 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; *bellyPtr = *puVar8;
} }
nullsub_85(target); nullsub_85(target);
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) { if (FixedPointToInt(oldBelly) == FixedPointToInt(*bellyPtr)) {
if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change! if (displayMessage) TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FBE14); // $m0's belly didn't change!
} }

View File

@ -226,7 +226,7 @@ bool8 HandleColorChange(Entity * pokemon, Entity * target)
entityInfo->types[0] = newType; entityInfo->types[0] = newType;
entityInfo->types[1] = TYPE_NONE; entityInfo->types[1] = TYPE_NONE;
entityInfo->isColorChanged = TRUE; entityInfo->isColorChanged = TRUE;
SetMessageArgument(gFormatBuffer_Monsters[1],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1],target,0);
typeString = GetUnformattedTypeString(newType); typeString = GetUnformattedTypeString(newType);
strcpy(gFormatBuffer_Items[0], typeString); strcpy(gFormatBuffer_Items[0], typeString);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FEB08); 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) { if (moveCounter != 0) {
SetExpMultplier(entityInfo); SetExpMultplier(entityInfo);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FDCE4);
@ -697,8 +697,8 @@ bool8 sub_805BA50(Entity * pokemon, Entity * target, Move *move, s32 param_4)
iVar3 = GetEntInfo(pokemon); iVar3 = GetEntInfo(pokemon);
iVar5 = GetEntInfo(target); iVar5 = GetEntInfo(target);
iVar6 = GetEntInfo(target); iVar6 = GetEntInfo(target);
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
SetMessageArgument(gFormatBuffer_Monsters[1], target, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[1], target, 0);
if (HasAbility(target, ABILITY_STICKY_HOLD)) { if (HasAbility(target, ABILITY_STICKY_HOLD)) {
return TRUE; return TRUE;
} }
@ -858,8 +858,8 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_
entityInfo = GetEntInfo(target); entityInfo = GetEntInfo(target);
targetID = entityInfo->id; targetID = entityInfo->id;
oldID = entityInfo->id; oldID = entityInfo->id;
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (entityInfo->clientType != CLIENT_TYPE_NONE) { if (entityInfo->monsterBehavior != BEHAVIOR_FIXED_ENEMY) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450);
return FALSE; return FALSE;
} }
@ -883,7 +883,7 @@ bool8 TransferOrbAction(Entity *pokemon, Entity * target, Move *move, s32 param_
} }
} }
else { else {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD450);
} }
return didTransfer; 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) 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) { if (gDungeon->unk66E != 0) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FD4DC); // $m0 can't escape! 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; bool8 foundTrap = FALSE;
tile = GetTileAtEntitySafe(target); tile = GetTileAtEntitySafe(target);
if (IsBossFight()) { if (IsBossFight()) {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD1EC); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD1EC);
return FALSE; return FALSE;
} }
else else
@ -1105,7 +1105,7 @@ bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4)
filledInTile = FALSE; filledInTile = FALSE;
targetInfo = GetEntInfo(target); targetInfo = GetEntInfo(target);
if (IsBossFight()) { if (IsBossFight()) {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD0B8); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD0B8);
return FALSE; return FALSE;
} }
else else
@ -1156,7 +1156,7 @@ bool8 sub_805C3F8(Entity *pokemon, Entity *target, Move *move, s32 param_4)
Item stack; Item stack;
Position posStruct = target->pos; Position posStruct = target->pos;
if(GetEntInfo(target)->clientType != CLIENT_TYPE_NONE) if(GetEntInfo(target)->monsterBehavior != BEHAVIOR_FIXED_ENEMY)
{ {
TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678); TryDisplayDungeonLoggableMessage3(pokemon, target, *gUnknown_80FF678);
return FALSE; return FALSE;

View File

@ -24,10 +24,10 @@ extern const char *gPtrInfatuatedMessage[];
extern u8 *gUnknown_80F95EC[]; extern u8 *gUnknown_80F95EC[];
extern char *gPtrMoveInterruptedMessage[]; extern char *gPtrMoveInterruptedMessage[];
bool8 HasStatusAffectingActions(Entity *pokemon) bool8 HasStatusThatPreventsActing(Entity *pokemon)
{ {
EntityInfo *pokemonInfo = GetEntInfo(pokemon); EntityInfo *pokemonInfo = GetEntInfo(pokemon);
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN);
switch (pokemonInfo->sleep.sleep) switch (pokemonInfo->sleep.sleep)
{ {
@ -39,13 +39,13 @@ bool8 HasStatusAffectingActions(Entity *pokemon)
switch (pokemonInfo->immobilize.immobilizeStatus) switch (pokemonInfo->immobilize.immobilizeStatus)
{ {
case STATUS_FROZEN: case STATUS_FROZEN:
TryDisplayDungeonLoggableMessage(pokemon, *gPtrFrozenMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrFrozenMessage);
return TRUE; return TRUE;
case STATUS_WRAP: case STATUS_WRAP:
TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedAroundMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedAroundMessage);
return TRUE; return TRUE;
case STATUS_WRAPPED: case STATUS_WRAPPED:
TryDisplayDungeonLoggableMessage(pokemon, *gPtrWrappedByMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrWrappedByMessage);
return TRUE; return TRUE;
case STATUS_PETRIFIED: case STATUS_PETRIFIED:
return TRUE; return TRUE;
@ -53,15 +53,15 @@ bool8 HasStatusAffectingActions(Entity *pokemon)
switch (pokemonInfo->volatileStatus.volatileStatus) switch (pokemonInfo->volatileStatus.volatileStatus)
{ {
case STATUS_PAUSED: case STATUS_PAUSED:
TryDisplayDungeonLoggableMessage(pokemon, *gPtrPausedMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrPausedMessage);
return TRUE; return TRUE;
case STATUS_INFATUATED: case STATUS_INFATUATED:
TryDisplayDungeonLoggableMessage(pokemon, *gPtrInfatuatedMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrInfatuatedMessage);
return TRUE; return TRUE;
} }
if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) if (pokemonInfo->charging.chargingStatus == STATUS_BIDE)
{ {
TryDisplayDungeonLoggableMessage(pokemon, *gPtrBideMessage); LogMessageByIdWithPopupCheckUser(pokemon, *gPtrBideMessage);
return TRUE; return TRUE;
} }
if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY) if (pokemonInfo->waitingStruct.waitingStatus == STATUS_DECOY)
@ -93,7 +93,7 @@ bool8 HasStatusAffectingActions(Entity *pokemon)
SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id); SetActionPassTurnOrWalk(&pokemonInfo->action, pokemonInfo->id);
return TRUE; return TRUE;
} }
DecideAttack(pokemon); ChooseAIMove(pokemon);
return TRUE; return TRUE;
} }
if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED) if (pokemonInfo->eyesightStatus.eyesightStatus == STATUS_CROSS_EYED)
@ -117,27 +117,27 @@ bool8 sub_80701A4(Entity *pokemon)
pokemonInfo = GetEntInfo(pokemon); pokemonInfo = GetEntInfo(pokemon);
flag = FALSE; flag = FALSE;
SetMessageArgument(gFormatBuffer_Monsters[0], pokemon, 0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0], pokemon, 0);
SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN); SetMonsterActionFields(&pokemonInfo->action, ACTION_PASS_TURN);
switch(pokemonInfo->sleep.sleep) switch(pokemonInfo->sleep.sleep)
{ {
case STATUS_SLEEP: case STATUS_SLEEP:
case STATUS_NIGHTMARE: case STATUS_NIGHTMARE:
case STATUS_NAPPING: case STATUS_NAPPING:
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F95EC); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F95EC);
return TRUE; return TRUE;
} }
switch(pokemonInfo->immobilize.immobilizeStatus) switch(pokemonInfo->immobilize.immobilizeStatus)
{ {
case STATUS_FROZEN: case STATUS_FROZEN:
TryDisplayDungeonLoggableMessage(pokemon,*gPtrFrozenMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrFrozenMessage);
return TRUE; return TRUE;
case STATUS_WRAP: case STATUS_WRAP:
TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedAroundMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedAroundMessage);
return TRUE; return TRUE;
case STATUS_WRAPPED: case STATUS_WRAPPED:
TryDisplayDungeonLoggableMessage(pokemon,*gPtrWrappedByMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrWrappedByMessage);
return TRUE; return TRUE;
case STATUS_PETRIFIED: case STATUS_PETRIFIED:
return TRUE; return TRUE;
@ -148,10 +148,10 @@ bool8 sub_80701A4(Entity *pokemon)
flag = TRUE; flag = TRUE;
goto _0807026C; goto _0807026C;
case STATUS_PAUSED: case STATUS_PAUSED:
TryDisplayDungeonLoggableMessage(pokemon,*gPtrPausedMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrPausedMessage);
return TRUE; return TRUE;
case STATUS_INFATUATED: case STATUS_INFATUATED:
TryDisplayDungeonLoggableMessage(pokemon,*gPtrInfatuatedMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrInfatuatedMessage);
return TRUE; return TRUE;
default: default:
case STATUS_NONE: case STATUS_NONE:
@ -159,12 +159,12 @@ bool8 sub_80701A4(Entity *pokemon)
case 8: case 8:
_0807026C: _0807026C:
if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) { if (pokemonInfo->charging.chargingStatus == STATUS_BIDE) {
TryDisplayDungeonLoggableMessage(pokemon,*gPtrBideMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrBideMessage);
return TRUE; return TRUE;
} }
else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) { else if (((pokemonInfo->charging.chargingStatus != STATUS_NONE) && (pokemonInfo->charging.chargingStatus != STATUS_CHARGING)) && (pokemonInfo->charging.chargingStatus != STATUS_ENRAGED)) {
if (flag) { if (flag) {
TryDisplayDungeonLoggableMessage(pokemon,*gPtrMoveInterruptedMessage); LogMessageByIdWithPopupCheckUser(pokemon,*gPtrMoveInterruptedMessage);
} }
else { else {
for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) { for(index = 0, move = pokemonInfo->moves.moves; index < MAX_MON_MOVES; move++, index++) {

View File

@ -44,7 +44,7 @@ s32 sub_8070828(Entity *pokemon, bool8 displayMessage)
} }
if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) { if (displayMessage && SetVisualFlags(GetEntInfo(pokemon), 0x40, flag)) {
sub_80429B4(pokemon); sub_80429B4(pokemon);
TryDisplayDungeonLoggableMessage(pokemon, *gUnknown_80FEE80); LogMessageByIdWithPopupCheckUser(pokemon, *gUnknown_80FEE80);
} }
if (flag) { if (flag) {
return 2; return 2;
@ -72,7 +72,7 @@ void SetMessageArgument_2(u8 *buffer, EntityInfo *param_2, s32 colorNum)
else else
{ {
if (param_2->isNotTeamMember) { 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); CopyYellowMonsterNametoBuffer(buffer, param_2->apparentID);
} }
else else
@ -116,7 +116,7 @@ void sub_80709C8(u8 *buffer, EntityInfo *entityInfo)
else else
{ {
if (entityInfo->isNotTeamMember) { if (entityInfo->isNotTeamMember) {
CopyMonsterNametoBuffer(buffer, entityInfo->apparentID); CopyMonsterNameToBuffer(buffer, entityInfo->apparentID);
} }
else else
{ {

View File

@ -145,7 +145,7 @@ bool8 sub_804AD34(Position *pos)
if (iVar8 != 0) { if (iVar8 != 0) {
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
sub_806CF98(entity); sub_806CF98(entity);
} }
@ -206,7 +206,7 @@ void sub_804AE84(Position *pos)
for(index = 0; index < DUNGEON_MAX_POKEMON; index++) for(index = 0; index < DUNGEON_MAX_POKEMON; index++)
{ {
entity = gDungeon->allPokemon[index]; entity = gDungeon->activeMonsterPtrs[index];
if (EntityExists(entity)) { if (EntityExists(entity)) {
sub_806CF98(entity); sub_806CF98(entity);
} }

View File

@ -280,10 +280,10 @@ void sub_807FE9C(Entity *pokemon, Position *pos, int param_3, char param_4)
sub_8049ED4(); sub_8049ED4();
sub_804225C(pokemon,pos,trapData->id); sub_804225C(pokemon,pos,trapData->id);
if (gDungeon->unk181e8.blinded) { if (gDungeon->unk181e8.blinded) {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FD7F4); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FD7F4);
} }
else { else {
TryDisplayDungeonLoggableMessage(pokemon,(gUnknown_80FD7F8)[trapData->id]); LogMessageByIdWithPopupCheckUser(pokemon,(gUnknown_80FD7F8)[trapData->id]);
} }
} }
if (target != NULL) { if (target != NULL) {
@ -539,7 +539,7 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile)
flag = FALSE; flag = FALSE;
if (target != NULL) { if (target != NULL) {
if (IsBossFight()) { if (IsBossFight()) {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED0C); // But nothing happened... LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED0C); // But nothing happened...
} }
else else
{ {
@ -559,11 +559,11 @@ void HandlePitfallTrap(Entity *pokemon, Entity *target, Tile *tile)
gDungeon->unk2 = 2; gDungeon->unk2 = 2;
return; return;
} }
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80F9728); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80F9728);
} }
else else
{ {
SetMessageArgument(gFormatBuffer_Monsters[0],target,0); SubstitutePlaceholderStringTags(gFormatBuffer_Monsters[0],target,0);
if (info->isNotTeamMember) { if (info->isNotTeamMember) {
TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall! TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80F970C); // $m0 fell into the pitfall!
} }
@ -620,11 +620,11 @@ void HandleSummonTrap(Entity *pokemon,Position *pos)
sub_80421EC(pos,0x194); sub_80421EC(pos,0x194);
if (pokemonSummonCount == 0) { if (pokemonSummonCount == 0) {
_ret: _ret:
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED04); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED04);
} }
else else
{ {
TryDisplayDungeonLoggableMessage(pokemon,*gUnknown_80FED00); LogMessageByIdWithPopupCheckUser(pokemon,*gUnknown_80FED00);
} }
} }
} }

View File

@ -238,7 +238,7 @@ void sub_8080CF0(unkStruct_8094924 *param_1)
sub_80830B4(param_1,gDungeon->plusIsActive[1]); sub_80830B4(param_1,gDungeon->plusIsActive[1]);
sub_80830B4(param_1,gDungeon->minusIsActive[0]); sub_80830B4(param_1,gDungeon->minusIsActive[0]);
sub_80830B4(param_1,gDungeon->minusIsActive[1]); 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->unk37FD);
sub_80830B4(param_1,gDungeon->deoxysDefeat); sub_80830B4(param_1,gDungeon->deoxysDefeat);
sub_80830B4(param_1,gDungeon->unk37FF); sub_80830B4(param_1,gDungeon->unk37FF);
@ -391,7 +391,7 @@ void SaveEntity(unkStruct_8094924 *param_1, Entity *param_2)
puStack_2c = &info->perishSongTurns; puStack_2c = &info->perishSongTurns;
puStack_28 = &info->unkFE; puStack_28 = &info->unkFE;
puStack_24 = &info->unkFF; puStack_24 = &info->unkFF;
puStack_90 = &info->clientType; puStack_90 = &info->monsterBehavior;
pos = info->prevPos; pos = info->prevPos;
for(counter = 0; counter < NUM_PREV_POS; counter++) 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_2c);
sub_8083060(param_1,*puStack_28); sub_8083060(param_1,*puStack_28);
sub_808183C(param_1,*puStack_24); sub_808183C(param_1,*puStack_24);
sub_8081854(param_1,info->targetingDecoy); sub_8081854(param_1,info->decoyAITracker);
SaveSpeedStage(param_1,info->speedStage); SaveSpeedStage(param_1,info->speedStage);
SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS); SaveSpeedCounters(param_1,info->speedUpCounters,NUM_SPEED_COUNTERS);
SaveSpeedCounters(param_1,info->speedDownCounters,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); SaveEntityMoves(param_1,&info->moves);
sub_8081B34(param_1,(s16 *)&info->belly); sub_8081B34(param_1,(s16 *)&info->belly);
sub_8081B34(param_1,(s16 *)&info->maxBelly); 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->recalculateFollow);
sub_80830B4(param_1,info->waiting); sub_80830B4(param_1,info->waiting);
sub_80830B4(param_1,info->unk146); 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) void SaveWaitingStatus(unkStruct_8094924 *param_1, Waiting *param_2)
{ {
sub_8082FA8(param_1, &param_2->waitingStatus, 1); sub_8082FA8(param_1, &param_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_80830B4(param_1, param_2->unkCA);
sub_8083060(param_1, param_2->waitingStatusTurns); sub_8083060(param_1, param_2->waitingStatusTurns);
sub_8083060(param_1, param_2->curseDamageCountdown); 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->plusIsActive[1] = sub_80831DC(param_1);
gDungeon->minusIsActive[0] = sub_80831DC(param_1); gDungeon->minusIsActive[0] = sub_80831DC(param_1);
gDungeon->minusIsActive[1] = 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->unk37FD = sub_80831DC(param_1);
gDungeon->deoxysDefeat = sub_80831DC(param_1); gDungeon->deoxysDefeat = sub_80831DC(param_1);
gDungeon->unk37FF = sub_80831DC(param_1); gDungeon->unk37FF = sub_80831DC(param_1);