more decomp

This commit is contained in:
Seth Barberee 2024-09-13 17:54:31 -07:00
parent c280da22dd
commit 24ff46c585
16 changed files with 555 additions and 1088 deletions

View File

@ -5,927 +5,6 @@
.text
thumb_func_start sub_807CD9C
sub_807CD9C:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x34
mov r9, r0
adds r6, r1, 0
adds r4, r2, 0
movs r0, 0xA
str r0, [sp, 0x24]
bl IsCurrentFixedRoomBossFight
lsls r0, 24
cmp r0, 0
beq _0807CDC4
ldr r0, _0807CDC0
b _0807CDFE
.align 2, 0
_0807CDC0: .4byte gUnknown_80FC9E8
_0807CDC4:
cmp r9, r6
bne _0807CDE4
ldr r0, _0807CDDC
adds r1, r6, 0
movs r2, 0
bl SetMessageArgument
ldr r0, _0807CDE0
ldr r2, [r0]
adds r0, r6, 0
b _0807CE02
.align 2, 0
_0807CDDC: .4byte gAvailablePokemonNames
_0807CDE0: .4byte gUnknown_80FCA10
_0807CDE4:
ldr r0, _0807CE0C
adds r1, r6, 0
movs r2, 0
bl SetMessageArgument
adds r0, r6, 0
movs r1, 0xE
bl HasAbility
lsls r0, 24
cmp r0, 0
beq _0807CE28
ldr r0, _0807CE10
_0807CDFE:
ldr r2, [r0]
mov r0, r9
_0807CE02:
adds r1, r6, 0
bl sub_80522F4
b _0807D02A
.align 2, 0
_0807CE0C: .4byte gAvailablePokemonNames
_0807CE10: .4byte gUnknown_80FCBCC
_0807CE14:
str r0, [sp, 0x28]
b _0807CF26
_0807CE18:
ldrh r0, [r5]
movs r1, 0x3
ands r1, r0
negs r0, r1
orrs r0, r1
lsrs r0, 31
mov r10, r0
b _0807CF20
_0807CE28:
ldr r1, [r6, 0x70]
adds r2, r4, 0x4
movs r3, 0x7
adds r0, r2, 0
ands r0, r3
adds r1, 0x46
strb r0, [r1]
movs r0, 0x7
ands r2, r0
adds r0, r6, 0
movs r1, 0x6
bl sub_806CDD4
ldr r1, _0807D03C
adds r0, r6, 0
bl sub_80421C0
ldr r0, _0807D040
ldr r2, [r0]
mov r0, r9
adds r1, r6, 0
bl sub_80522F4
movs r1, 0x1
mov r10, r1
movs r2, 0
str r2, [sp, 0x28]
lsls r1, r4, 2
ldr r0, _0807D044
adds r1, r0
mov r8, r1
add r7, sp, 0x18
_0807CE68:
ldr r2, [r6, 0x4]
str r2, [sp, 0x18]
ldrh r0, [r7]
mov r3, r8
ldrh r3, [r3]
adds r0, r3
lsls r0, 16
lsrs r0, 16
ldr r1, _0807D048
ands r1, r2
orrs r1, r0
str r1, [sp, 0x18]
asrs r0, r1, 16
mov r2, r8
ldrh r2, [r2, 0x2]
adds r0, r2
lsls r0, 16
ldr r2, _0807D04C
ands r2, r1
orrs r2, r0
str r2, [sp, 0x18]
movs r3, 0
ldrsh r0, [r7, r3]
cmp r0, 0
blt _0807CF20
asrs r1, r2, 16
cmp r1, 0
blt _0807CF20
cmp r0, 0x37
bgt _0807CF20
cmp r1, 0x1F
bgt _0807CF20
mov r1, r8
movs r2, 0
ldrsh r0, [r1, r2]
lsls r0, 10
str r0, [sp, 0x2C]
movs r3, 0x2
ldrsh r0, [r1, r3]
lsls r0, 10
str r0, [sp, 0x30]
movs r4, 0x5
_0807CEBC:
adds r0, r6, 0
ldr r1, [sp, 0x2C]
ldr r2, [sp, 0x30]
bl IncreaseEntityPixelPos
adds r0, r6, 0
bl sub_8045888
lsls r0, 24
cmp r0, 0
beq _0807CED8
movs r0, 0x19
bl sub_803E46C
_0807CED8:
subs r4, 0x1
cmp r4, 0
bge _0807CEBC
movs r1, 0
ldrsh r0, [r7, r1]
ldr r1, [sp, 0x18]
asrs r1, 16
bl GetTile
adds r5, r0, 0
ldr r0, [r5, 0x10]
cmp r0, 0
bne _0807CE14
add r4, sp, 0x18
adds r0, r6, 0
adds r1, r4, 0
bl sub_80705F0
lsls r0, 24
cmp r0, 0
bne _0807CE18
movs r2, 0
ldrsh r1, [r7, r2]
movs r3, 0x2
ldrsh r2, [r4, r3]
adds r0, r6, 0
movs r3, 0x1
bl sub_80694C0
ldr r0, [sp, 0x24]
subs r0, 0x1
str r0, [sp, 0x24]
cmp r0, 0
bgt _0807CE68
movs r1, 0x1
mov r10, r1
_0807CF20:
mov r2, r10
cmp r2, 0
bne _0807CF4E
_0807CF26:
adds r1, r6, 0x4
adds r0, r6, 0
bl sub_807D068
ldr r0, _0807D050
movs r3, 0
ldrsh r2, [r0, r3]
movs r1, 0
str r1, [sp]
str r1, [sp, 0x4]
ldr r0, _0807D054
str r0, [sp, 0x8]
str r1, [sp, 0xC]
str r1, [sp, 0x10]
str r1, [sp, 0x14]
mov r0, r9
adds r1, r6, 0
movs r3, 0
bl sub_806F370
_0807CF4E:
bl sub_8044B28
lsls r0, 24
cmp r0, 0
bne _0807D02A
ldr r0, [sp, 0x28]
cmp r0, 0
beq _0807CF9E
add r4, sp, 0x1C
ldr r1, _0807D058
adds r0, r4, 0
bl InitPokemonMove
ldr r0, [sp, 0x28]
adds r1, r4, 0
bl sub_80571F0
lsls r0, 24
lsrs r4, r0, 24
cmp r4, 0
bne _0807CF9E
mov r0, r9
ldr r1, [sp, 0x28]
bl TrySendImmobilizeSleepEndMsg
ldr r0, _0807D050
movs r1, 0
ldrsh r2, [r0, r1]
str r4, [sp]
str r4, [sp, 0x4]
ldr r0, _0807D05C
str r0, [sp, 0x8]
str r4, [sp, 0xC]
str r4, [sp, 0x10]
str r4, [sp, 0x14]
mov r0, r9
ldr r1, [sp, 0x28]
movs r3, 0
bl sub_806F370
_0807CF9E:
bl sub_8044B28
lsls r0, 24
lsrs r5, r0, 24
cmp r5, 0
bne _0807D02A
adds r0, r6, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _0807D02A
adds r0, r6, 0
bl sub_806A5B8
adds r4, r6, 0x4
adds r0, r6, 0
adds r1, r4, 0
bl sub_80706A4
lsls r0, 24
cmp r0, 0
beq _0807CFD8
adds r0, r6, 0
adds r1, r6, 0
movs r2, 0
movs r3, 0
bl sub_807D148
_0807CFD8:
adds r0, r6, 0
bl EntityExists
lsls r0, 24
cmp r0, 0
beq _0807D02A
adds r0, r6, 0
movs r1, 0x8
bl sub_806CE68
ldr r0, [r6, 0x70]
ldrb r0, [r0, 0x7]
cmp r0, 0
beq _0807D014
ldr r1, _0807D060
ldr r0, [r1]
strb r5, [r0, 0x1]
ldr r0, [r1]
movs r2, 0xB8
lsls r2, 3
adds r0, r2
movs r1, 0x1
negs r1, r1
str r1, [r0]
adds r0, r4, 0
bl sub_804AC20
movs r0, 0
bl sub_807EC28
_0807D014:
adds r0, r6, 0
bl sub_806A5B8
ldr r0, _0807D060
ldr r0, [r0]
ldr r3, _0807D064
adds r0, r3
ldrb r1, [r0]
adds r0, r6, 0
bl sub_8075900
_0807D02A:
add sp, 0x34
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0807D03C: .4byte 0x000001a3
_0807D040: .4byte gUnknown_80F8A0C
_0807D044: .4byte gAdjacentTileOffsets
_0807D048: .4byte 0xffff0000
_0807D04C: .4byte 0x0000ffff
_0807D050: .4byte gUnknown_80F4F90
_0807D054: .4byte 0x00000219
_0807D058: .4byte 0x00000163
_0807D05C: .4byte 0x0000021a
_0807D060: .4byte gDungeon
_0807D064: .4byte 0x00003a08
thumb_func_end sub_807CD9C
thumb_func_start sub_807D068
sub_807D068:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0x14
adds r6, r0, 0
movs r0, 0
ldrsh r2, [r1, r0]
lsls r0, r2, 1
adds r0, r2
lsls r0, 11
movs r2, 0xC0
lsls r2, 4
adds r2, r0
mov r10, r2
movs r0, 0x2
ldrsh r1, [r1, r0]
lsls r0, r1, 1
adds r0, r1
lsls r0, 11
movs r1, 0x80
lsls r1, 5
adds r1, r0
mov r9, r1
ldr r0, [r6, 0xC]
subs r0, r2
cmp r0, 0
bge _0807D0A4
negs r0, r0
_0807D0A4:
ldr r1, [r6, 0x10]
cmp r0, 0xB
bgt _0807D0B8
mov r2, r9
subs r0, r1, r2
cmp r0, 0
bge _0807D0B4
negs r0, r0
_0807D0B4:
cmp r0, 0xB
ble _0807D11E
_0807D0B8:
movs r0, 0
mov r8, r0
ldr r5, [r6, 0xC]
adds r4, r1, 0
mov r1, r10
subs r0, r1, r5
movs r1, 0xC
bl __divsi3
str r0, [sp, 0x8]
mov r2, r9
subs r0, r2, r4
movs r1, 0xC
bl __divsi3
str r0, [sp, 0xC]
mov r0, sp
str r0, [sp, 0x10]
movs r7, 0xB
_0807D0DE:
ldr r1, [sp, 0x8]
adds r5, r1
ldr r2, [sp, 0xC]
adds r4, r2
str r5, [sp]
ldr r0, [sp, 0x10]
str r4, [r0, 0x4]
mov r0, r8
bl sin_abs_4096
lsls r1, r0, 1
adds r1, r0
lsls r1, 2
str r1, [r6, 0x1C]
adds r0, r6, 0
mov r1, sp
bl sub_804535C
adds r0, r6, 0
bl sub_8045888
lsls r0, 24
cmp r0, 0
beq _0807D114
movs r0, 0x1A
bl sub_803E46C
_0807D114:
movs r1, 0xAA
add r8, r1
subs r7, 0x1
cmp r7, 0
bge _0807D0DE
_0807D11E:
mov r2, r10
str r2, [sp]
mov r0, r9
str r0, [sp, 0x4]
movs r0, 0
str r0, [r6, 0x1C]
adds r0, r6, 0
mov r1, sp
bl sub_804535C
movs r0, 0x1A
bl sub_803E46C
add sp, 0x14
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
thumb_func_end sub_807D068
thumb_func_start sub_807D148
sub_807D148:
push {r4-r7,lr}
mov r7, r10
mov r6, r9
mov r5, r8
push {r5-r7}
sub sp, 0xC
mov r8, r0
adds r5, r1, 0
mov r9, r2
str r3, [sp, 0x4]
ldr r0, [r5, 0x70]
mov r10, r0
movs r1, 0
str r1, [sp, 0x8]
ldr r0, _0807D180
adds r1, r5, 0
movs r2, 0
bl SetMessageArgument
adds r0, r5, 0
movs r1, 0xE
bl HasAbility
lsls r0, 24
cmp r0, 0
beq _0807D188
ldr r0, _0807D184
b _0807D194
.align 2, 0
_0807D180: .4byte gAvailablePokemonNames
_0807D184: .4byte gUnknown_80FCAE8
_0807D188:
bl IsCurrentFixedRoomBossFight
lsls r0, 24
cmp r0, 0
beq _0807D1A4
ldr r0, _0807D1A0
_0807D194:
ldr r2, [r0]
mov r0, r8
adds r1, r5, 0
bl sub_80522F4
b _0807D3A8
.align 2, 0
_0807D1A0: .4byte gUnknown_80FC97C
_0807D1A4:
mov r2, r9
cmp r2, 0x1
bne _0807D1DC
ldr r0, _0807D1D0
ldr r0, [r0]
ldr r3, _0807D1D4
adds r0, r3
ldr r1, [r0]
ldr r0, [r5, 0x4]
cmp r1, r0
bne _0807D1DC
ldr r0, _0807D1D8
ldr r2, [r0]
mov r0, r8
adds r1, r5, 0
bl sub_80522F4
mov r0, r8
adds r1, r5, 0
bl PetrifiedStatusTarget
b _0807D3A8
.align 2, 0
_0807D1D0: .4byte gDungeon
_0807D1D4: .4byte 0x0000e21c
_0807D1D8: .4byte gUnknown_80FC9A0
_0807D1DC:
ldr r0, _0807D27C
ldr r2, [r0]
mov r0, r8
adds r1, r5, 0
bl sub_80522F4
adds r0, r5, 0
adds r1, r5, 0
bl TrySendImmobilizeSleepEndMsg
mov r0, r8
adds r1, r5, 0
bl sub_80421AC
adds r0, r5, 0
bl sub_8045888
lsls r0, 24
cmp r0, 0
beq _0807D252
mov r0, r10
adds r0, 0x46
ldrb r4, [r0]
ldr r1, [r5, 0x1C]
movs r2, 0x80
lsls r2, 4
adds r1, r2
str r1, [r5, 0x1C]
ldr r2, _0807D280
adds r6, r0, 0
cmp r1, r2
bgt _0807D252
movs r7, 0x7
_0807D21E:
ldr r0, _0807D284
ldr r0, [r0]
movs r1, 0x3
ands r0, r1
cmp r0, 0
bne _0807D23C
adds r4, 0x1
ands r4, r7
adds r0, r4, 0
ands r0, r7
strb r0, [r6]
adds r0, r5, 0
adds r1, r4, 0
bl sub_806CE68
_0807D23C:
movs r0, 0x22
bl sub_803E46C
ldr r1, [r5, 0x1C]
movs r3, 0x80
lsls r3, 4
adds r1, r3
str r1, [r5, 0x1C]
ldr r0, _0807D280
cmp r1, r0
ble _0807D21E
_0807D252:
mov r0, r9
cmp r0, 0x1
beq _0807D288
cmp r0, 0x1
bcc _0807D264
cmp r0, 0x2
beq _0807D2B0
cmp r0, 0x3
beq _0807D2C8
_0807D264:
mov r0, sp
bl sub_8083660
lsls r0, 24
cmp r0, 0
bne _0807D2CE
ldr r0, [r5, 0x4]
str r0, [sp]
movs r1, 0x1
str r1, [sp, 0x8]
b _0807D2CE
.align 2, 0
_0807D27C: .4byte gUnknown_80FC584
_0807D280: .4byte 0x00009fff
_0807D284: .4byte gUnknown_202EDCC
_0807D288:
ldr r0, _0807D2A8
ldr r1, [r0]
ldr r2, _0807D2AC
adds r1, r2
mov r0, sp
bl sub_808384C
lsls r0, 24
cmp r0, 0
bne _0807D2CE
ldr r0, [r5, 0x4]
str r0, [sp]
movs r3, 0x1
str r3, [sp, 0x8]
b _0807D2CE
.align 2, 0
_0807D2A8: .4byte gDungeon
_0807D2AC: .4byte 0x0000e21c
_0807D2B0:
mov r0, sp
ldr r1, [sp, 0x4]
bl sub_808384C
lsls r0, 24
cmp r0, 0
bne _0807D2CE
ldr r0, [r5, 0x4]
str r0, [sp]
movs r0, 0x1
str r0, [sp, 0x8]
b _0807D2CE
_0807D2C8:
ldr r1, [sp, 0x4]
ldr r0, [r1]
str r0, [sp]
_0807D2CE:
mov r0, sp
movs r2, 0
ldrsh r1, [r0, r2]
movs r3, 0x2
ldrsh r2, [r0, r3]
adds r0, r5, 0
movs r3, 0x1
bl sub_80694C0
adds r0, r5, 0
movs r1, 0
bl sub_804535C
adds r0, r5, 0
bl sub_807BB78
movs r0, 0x1
bl sub_803F580
adds r0, r5, 0
bl sub_8045888
lsls r0, 24
cmp r0, 0
beq _0807D340
mov r1, r10
adds r1, 0x46
ldrb r4, [r1]
movs r0, 0x9C
lsls r0, 8
str r0, [r5, 0x1C]
adds r6, r1, 0
movs r7, 0x7
_0807D310:
ldr r0, _0807D3B8
ldr r0, [r0]
movs r1, 0x3
ands r0, r1
cmp r0, 0
bne _0807D32E
adds r4, 0x1
ands r4, r7
adds r0, r4, 0
ands r0, r7
strb r0, [r6]
adds r0, r5, 0
adds r1, r4, 0
bl sub_806CE68
_0807D32E:
movs r0, 0x22
bl sub_803E46C
ldr r0, [r5, 0x1C]
ldr r1, _0807D3BC
adds r0, r1
str r0, [r5, 0x1C]
cmp r0, 0
bgt _0807D310
_0807D340:
movs r4, 0
str r4, [r5, 0x1C]
movs r0, 0x22
bl sub_803E46C
ldr r2, [sp, 0x8]
cmp r2, 0
beq _0807D35C
ldr r0, _0807D3C0
ldr r2, [r0]
mov r0, r8
adds r1, r5, 0
bl sub_80522F4
_0807D35C:
mov r3, r9
cmp r3, 0x1
bne _0807D36A
mov r0, r8
adds r1, r5, 0
bl PetrifiedStatusTarget
_0807D36A:
mov r1, r10
ldrb r0, [r1, 0x7]
cmp r0, 0
beq _0807D392
adds r0, r5, 0x4
bl sub_804AC20
ldr r1, _0807D3C4
ldr r0, [r1]
strb r4, [r0, 0x1]
ldr r0, [r1]
movs r2, 0xB8
lsls r2, 3
adds r0, r2
movs r1, 0x1
negs r1, r1
str r1, [r0]
movs r0, 0
bl sub_807EC28
_0807D392:
adds r0, r5, 0
bl sub_806A5B8
ldr r0, _0807D3C4
ldr r0, [r0]
ldr r3, _0807D3C8
adds r0, r3
ldrb r1, [r0]
adds r0, r5, 0
bl sub_8075900
_0807D3A8:
add sp, 0xC
pop {r3-r5}
mov r8, r3
mov r9, r4
mov r10, r5
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0807D3B8: .4byte gUnknown_202EDCC
_0807D3BC: .4byte 0xfffffc00
_0807D3C0: .4byte gUnknown_80FCB14
_0807D3C4: .4byte gDungeon
_0807D3C8: .4byte 0x00003a08
thumb_func_end sub_807D148
thumb_func_start sub_807D3CC
sub_807D3CC:
push {r4-r7,lr}
mov r7, r8
push {r7}
sub sp, 0x4
mov r8, r0
movs r2, 0
ldr r4, _0807D448
ldr r0, [r4]
ldr r1, _0807D44C
adds r0, r1
ldrb r6, [r0]
cmp r6, 0
bne _0807D3E8
movs r6, 0x2
_0807D3E8:
mov r0, r8
str r2, [sp]
bl GetEntityRoom
lsls r0, 24
lsrs r1, r0, 24
ldr r2, [sp]
cmp r1, 0xFF
bne _0807D450
mov r3, r8
movs r1, 0x6
ldrsh r0, [r3, r1]
subs r5, r0, r6
adds r0, r6
cmp r5, r0
bgt _0807D4A8
_0807D408:
mov r3, r8
movs r1, 0x4
ldrsh r0, [r3, r1]
subs r4, r0, r6
adds r0, r6
adds r7, r5, 0x1
cmp r4, r0
bgt _0807D438
_0807D418:
adds r0, r4, 0
adds r1, r5, 0
str r2, [sp]
bl sub_807D4E0
ldr r2, [sp]
orrs r2, r0
lsls r0, r2, 24
lsrs r2, r0, 24
adds r4, 0x1
mov r3, r8
movs r1, 0x4
ldrsh r0, [r3, r1]
adds r0, r6
cmp r4, r0
ble _0807D418
_0807D438:
adds r5, r7, 0
mov r3, r8
movs r1, 0x6
ldrsh r0, [r3, r1]
adds r0, r6
cmp r5, r0
ble _0807D408
b _0807D4A8
.align 2, 0
_0807D448: .4byte gDungeon
_0807D44C: .4byte 0x00018209
_0807D450:
lsls r0, r1, 3
subs r0, r1
lsls r0, 2
ldr r3, _0807D468
adds r0, r3
ldr r1, [r4]
adds r6, r1, r0
movs r1, 0x4
ldrsh r0, [r6, r1]
subs r5, r0, 0x1
b _0807D49E
.align 2, 0
_0807D468: .4byte 0x000104c4
_0807D46C:
movs r1, 0x2
ldrsh r0, [r6, r1]
subs r4, r0, 0x1
movs r3, 0x6
ldrsh r0, [r6, r3]
adds r0, 0x1
adds r7, r5, 0x1
cmp r4, r0
bgt _0807D49C
_0807D47E:
adds r0, r4, 0
adds r1, r5, 0
str r2, [sp]
bl sub_807D4E0
ldr r2, [sp]
orrs r2, r0
lsls r0, r2, 24
lsrs r2, r0, 24
adds r4, 0x1
movs r1, 0x6
ldrsh r0, [r6, r1]
adds r0, 0x1
cmp r4, r0
ble _0807D47E
_0807D49C:
adds r5, r7, 0
_0807D49E:
movs r3, 0x8
ldrsh r0, [r6, r3]
adds r0, 0x1
cmp r5, r0
ble _0807D46C
_0807D4A8:
cmp r2, 0
beq _0807D4C4
ldr r0, _0807D4C0
ldr r1, [r0]
mov r0, r8
bl SendMessage
bl sub_8040A84
bl sub_8049ED4
b _0807D4CE
.align 2, 0
_0807D4C0: .4byte gUnknown_80FD2F8
_0807D4C4:
ldr r0, _0807D4DC
ldr r1, [r0]
mov r0, r8
bl SendMessage
_0807D4CE:
add sp, 0x4
pop {r3}
mov r8, r3
pop {r4-r7}
pop {r0}
bx r0
.align 2, 0
_0807D4DC: .4byte gUnknown_80FD320
thumb_func_end sub_807D3CC
thumb_func_start sub_807D4E0
sub_807D4E0:
push {r4,lr}
bl GetTile
ldr r4, [r0, 0x14]
cmp r4, 0
beq _0807D506
adds r0, r4, 0
bl GetEntityType
cmp r0, 0x2
bne _0807D506
adds r1, r4, 0
adds r1, 0x20
ldrb r0, [r1]
cmp r0, 0
bne _0807D506
movs r0, 0x1
strb r0, [r1]
b _0807D508
_0807D506:
movs r0, 0
_0807D508:
pop {r4}
pop {r1}
bx r1
thumb_func_end sub_807D4E0
thumb_func_start sub_807D510
sub_807D510:
push {r4-r7,lr}

8
include/code_807CD9C.h Normal file
View File

@ -0,0 +1,8 @@
#ifndef CODE_807CD9C_H
#define CODE_807CD9C_H
void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction);
void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos);
void sub_807D3CC(Entity *param_1);
#endif /* ifndef CODE_807CD9C_H */

View File

@ -4,6 +4,7 @@
#include "structs/dungeon_entity.h"
bool8 HasSafeguardStatus(Entity * param_1, Entity * param_2, bool8 displayMessage);
bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage);
bool8 sub_80717A4(Entity *pokemon, u16 moveID);
bool8 HasAbility(Entity *pokemon, u8 ability);
bool8 MonsterIsType(Entity *pokemon, u8 type);

View File

@ -275,7 +275,7 @@ typedef struct Dungeon
/* 0x3A16 */ s16 unk3A16;
/* 0x3A18 */ Tile tiles[DUNGEON_MAX_SIZE_Y][DUNGEON_MAX_SIZE_X];
Position unkE218;
Position unkE21C;
Position unkE21C; // stair location?
Position unkE220[8];
u32 unkE240;
u8 fillE244[0xE250 - 0xE244];

View File

@ -279,8 +279,9 @@ SECTIONS {
src/dungeon_ai_movement.o(.text);
src/dungeon_ai_attack.o(.text);
src/targeting_flags.o(.text);
asm/code_807CD9C.o(.text);
src/code_807CD9C.o(.text);
asm/code_807CD9C.o(.text);
src/code_807E1A0.o(.text);
src/weather.o(.text);
asm/code_807E5AC.o(.text);
src/trap.o(.text);

View File

@ -3,6 +3,7 @@
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "code_808417C.h"
#include "constants/dungeon_action.h"
#include "constants/dungeon.h"
@ -107,7 +108,6 @@ extern void PrintFieldMessage(u32, u8 *, u32);
extern void sub_8044E24(Entity *, u32, u32);
extern void sub_804245C(Entity *, Item *);
extern u8 sub_8072938(Entity *, u16);
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
extern void sub_8072008(Entity *pokemon, Entity *r1, u32 r2, u8 r3, u32);
extern void LevelDownTarget(Entity *pokemon, Entity *r1, u32 r2);
extern void sub_80522F4(Entity *pokemon, Entity *r1, const u8[]);

View File

@ -1,6 +1,7 @@
#include "global.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_807CD9C.h"
#include "dungeon_map_access.h"
#include "dungeon_movement.h"
#include "dungeon_music.h"
@ -34,7 +35,6 @@ void sub_8045BF8(u8 *, Item *);
u8 sub_80460F8(Position *, Item *, u32);
extern void sub_807AB38(Entity *, u32);
extern Entity * sub_8044DA4(Entity *param_1,int param_2);
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
extern void sub_806A6E8(Entity *);
extern void sub_8044DF0(Entity *, u32, u32);
extern void sub_8045DB4(Position *, u32);

View File

@ -1,182 +1,386 @@
#include "global.h"
#include "code_804267C.h"
#include "constants/ability.h"
#include "code_803E46C.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "constants/ability.h"
#include "constants/type.h"
#include "dungeon_ai.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "move_util.h"
#include "moves.h"
#include "code_806CD90.h"
#include "code_807CD9C.h"
#include "structs/str_dungeon.h"
#include "code_8077274_1.h"
#include "dungeon_ai.h"
#include "dungeon_engine.h"
#include "dungeon_movement.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_map_access.h"
#include "dungeon_util.h"
#include "math.h"
#include "move_effects_target.h"
#include "moves.h"
#include "move_util.h"
extern u8 UseAttack(Entity *);
extern void sub_805E804(void);
void sub_806A2BC(Entity *pokemon, u8 param_2);
extern u8 sub_8044B28(void);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern void nullsub_93(Position *);
extern void sub_80522F4(Entity *, Entity *, u8 *);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern void sub_807EC28(bool8);
extern void sub_806A5B8(Entity *);
extern u32 gUnknown_80F5FAC[];
extern u8 *gUnknown_80F9C4C[];
extern u8 *gUnknown_80F9C70[];
extern u8 *gUnknown_80F9C8C[];
extern u8 *gUnknown_80F9CBC[];
extern u32 gUnknown_202EDCC;
extern u8 gAvailablePokemonNames[];
extern u8 *gUnknown_80FCAC0[];
void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s16 param_4,s32 param_5)
extern s16 gUnknown_80F4F90;
extern u8 *gUnknown_80FCA10[];
extern u8 *gUnknown_80F8A0C[];
extern u8 *gUnknown_80FCBCC[];
extern u8 *gUnknown_80FC9E8[];
extern u8 *gUnknown_80FCB14[];
extern u8 *gUnknown_80FCAE8[];
extern u8 *gUnknown_80FC97C[];
extern u8 *gUnknown_80FC9A0[];
extern u8 *gUnknown_80FC584[];
extern u8 *gUnknown_80FD320[];
extern u8 *gUnknown_80FD2F8[];
bool8 ExposeTrap(s32 x, s32 y);
void sub_8040A84();
void sub_8049ED4();
void sub_806A5B8(Entity *);
void sub_80522F4(Entity *, Entity *, u8 *);
void sub_80421C0(Entity *, u32);
u8 sub_8045888(Entity *);
void sub_807EC28(u32);
void sub_80694C0(Entity *, s32, s32, s32);
void sub_807D068(Entity *, Position *);
u8 sub_8044B28(void);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
void sub_80421AC(Entity * pokemon, Entity * target);
void sub_807BB78(Entity *pokemon);
extern void sub_803F580(u32);
bool8 sub_808384C(Position *, Position *);
u8 sub_8083660(Position *);
void sub_807CD9C(Entity *pokemon, Entity *target, u32 direction)
{
EntityInfo *targetInfo;
u8 flag;
Move move;
s32 newHP;
s32 param_4_s32;
Tile *tile;
int iVar8;
bool8 flag;
Position sp_0x18;
Move move;
int sp_0x24;
Entity *sp_0x28;
Position32 sp_0x2C;
param_4_s32 = param_4;
if (EntityExists(target)) {
targetInfo = target->info;
InitPokemonMove(&move, MOVE_REGULAR_ATTACK);
if (!sub_80571F0(target,&move)) {
if (!targetInfo->isNotTeamMember) {
newHP = targetInfo->HP;
newHP /= 2;
if (MonsterIsType(target, TYPE_FIRE)) {
newHP /= 2;
}
if (newHP < 1) {
newHP = 1;
}
}
else {
newHP = param_5;
if (MonsterIsType(target, TYPE_FIRE)) {
newHP /= 2;
}
}
sub_806F370(pokemon,target,newHP,0,&flag,moveType,param_4_s32,0,0,0);
sp_0x24 = 10;
if (IsCurrentFixedRoomBossFight()) {
sub_80522F4(pokemon,target,*gUnknown_80FC9E8); // It couldn't be knocked flying!
return;
}
else
{
if (pokemon == target) {
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FCA10); // {ARG_POKEMON_0} couldn't be knocked flying!
return;
}
SetMessageArgument(gAvailablePokemonNames,target,0);
if (HasAbility(target,ABILITY_SUCTION_CUPS)) {
sub_80522F4(pokemon,target,*gUnknown_80FCBCC); // {ARG_POKEMON_0} is anchored! It can't be knocked flying!
return;
}
else
{
(target->info->action).direction = (direction + 4) & DIRECTION_MASK;
sub_806CDD4(target, 6, (direction + 4) & DIRECTION_MASK);
sub_80421C0(target,0x1a3);
sub_80522F4(pokemon,target,*gUnknown_80F8A0C); // {ARG_POKEMON_0} was blown away!
flag = TRUE;
sp_0x28 = NULL;
for(; sp_0x24 > 0; sp_0x24--)
{
sp_0x18 = target->pos;
sp_0x18.x += gAdjacentTileOffsets[direction].x;
sp_0x18.y += gAdjacentTileOffsets[direction].y;
if ((((sp_0x18.x < 0) || (sp_0x18.y < 0)) || (DUNGEON_MAX_SIZE_X <= sp_0x18.x)) ||
(DUNGEON_MAX_SIZE_Y <= sp_0x18.y)) goto _0807CF20;
sp_0x2C.x = gAdjacentTileOffsets[direction].x << 0xA;
sp_0x2C.y = gAdjacentTileOffsets[direction].y << 0xA;
for(iVar8 = 0; iVar8 < 6; iVar8++)
{
IncreaseEntityPixelPos(target,sp_0x2C.x,sp_0x2C.y);
if (sub_8045888(target) != 0) {
sub_803E46C(0x19);
}
}
tile = GetTile(sp_0x18.x, sp_0x18.y);
if (tile->monster != NULL) {
sp_0x28 = tile->monster;
goto _0807CF26;
}
if (sub_80705F0(target,&sp_0x18)){
flag = (tile->terrainType & 3) == 0 ? FALSE : TRUE;
goto _0807CF20;
}
sub_80694C0(target,sp_0x18.x,sp_0x18.y,1);
}
flag = TRUE;
_0807CF20:
if (!flag) {
_0807CF26:
sub_807D068(target,&target->pos);
sub_806F370(pokemon,target,gUnknown_80F4F90,0,0,0,0x219,0,0,0);
}
if (sub_8044B28()) {
return;
}
if (sp_0x28 != NULL) {
InitPokemonMove(&move,0x163);
if (!sub_80571F0(sp_0x28,&move)) {
sub_807A96C(pokemon,sp_0x28);
sub_806F370(pokemon,sp_0x28,gUnknown_80F4F90,0,0,0,0x21a,0,0,0);
}
}
if (sub_8044B28()) {
return;
}
if (!EntityExists(target)) {
return;
}
sub_806A5B8(target);
if (sub_80706A4(target,&target->pos)) {
sub_807D148(target,target,0,0);
}
if (!EntityExists(target)) {
return;
}
sub_806CE68(target,8);
if (target->info->isTeamLeader) {
gDungeon->unk1 = 0;
gDungeon->unk5C0 = -1;
sub_804AC20(&target->pos);
sub_807EC28(FALSE);
}
sub_806A5B8(target);
sub_8075900(target,gDungeon->unk3A08);
}
}
}
}
void sub_807E254(Entity *pokemon,Entity *target)
void sub_807D068(Entity *pokemon, Position *pos)
{
Position pokemonPos;
Position targetPos;
int pixelX;
int posY;
int pixelY;
int posX;
int counter;
int iVar8;
s32 diff;
Position32 local_34;
int incrementX;
int incrementY;
posX = pos->x * 0x1800 + 0xc00;
posY = pos->y * 0x1800 + 0x1000;
diff = (pokemon->pixelPos).x - posX;
if (diff < 0) {
diff = -diff;
}
if (diff < 0xc) {
diff = (pokemon->pixelPos).y - posY;
if (diff < 0) {
diff = -diff;
}
if (diff < 0xc) goto _0807D11E;
}
iVar8 = 0;
pixelX = (pokemon->pixelPos).x;
pixelY = (pokemon->pixelPos).y;
incrementX = (posX - pixelX) / 0xc;
incrementY = (posY - pixelY) / 0xc;
for(counter = 0; counter < 0xC; counter++)
{
pixelX += incrementX;
pixelY += incrementY;
local_34.x = pixelX;
local_34.y = pixelY;
pokemon->unk1C = sin_abs_4096(iVar8) * 0xc;
sub_804535C(pokemon, &local_34);
if (sub_8045888(pokemon)) {
sub_803E46C(0x1a);
}
iVar8 = iVar8 + 0xaa;
}
_0807D11E:
local_34.x = posX;
local_34.y = posY;
pokemon->unk1C = 0;
sub_804535C(pokemon,&local_34);
sub_803E46C(0x1a);
}
void sub_807D148(Entity *pokemon, Entity *target, u32 param_3, Position *pos)
{
EntityInfo *info;
u32 direction;
Position local_2c;
Position pos2;
bool8 flag;
info = target->info;
flag = FALSE;
if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) {
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
}
else if(HasAbility(target, ABILITY_SUCTION_CUPS))
{
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
}
else
{
pokemonPos.x = pokemon->pos.x;
pokemonPos.y = pokemon->pos.y;
targetPos.x = target->pos.x;
targetPos.y = target->pos.y;
nullsub_93(&pokemonPos);
nullsub_93(&targetPos);
sub_80694C0(pokemon,targetPos.x,targetPos.y,1);
sub_80694C0(target,pokemonPos.x,pokemonPos.y,1);
sub_804535C(pokemon,NULL);
sub_804535C(target,NULL);
if (EntityExists(pokemon)) {
if (pokemon->info->isTeamLeader) {
sub_804AC20(&pokemon->pos);
sub_807EC28(FALSE);
}
sub_806A5B8(pokemon);
sub_8075900(pokemon,gDungeon->unk3A08);
if (HasAbility(target,ABILITY_SUCTION_CUPS)) {
sub_80522F4(pokemon,target,*gUnknown_80FCAE8);
return;
}
if (IsCurrentFixedRoomBossFight()) {
sub_80522F4(pokemon,target,*gUnknown_80FC97C);
return;
}
if (param_3 == 1)
{
pos2 = gDungeon->unkE21C;
if(pos2.x == target->pos.x && pos2.y == target->pos.y) {
sub_80522F4(pokemon,target,*gUnknown_80FC9A0); // It's already on the stairs!
PetrifiedStatusTarget(pokemon,target);
return;
}
}
if (EntityExists(target)) {
if (target->info->isTeamLeader) {
sub_80522F4(pokemon,target,*gUnknown_80FC584); // $m0 warped!
sub_807A96C(target,target);
sub_80421AC(pokemon,target);
if (sub_8045888(target)) {
direction = (info->action).direction;
target->unk1C += + 0x800;
while ( target->unk1C < 0xa000) {
if ((gUnknown_202EDCC & 3) == 0) {
direction = (direction + 1) & DIRECTION_MASK;
info->action.direction = direction & DIRECTION_MASK;
sub_806CE68(target,direction);
}
sub_803E46C(0x22);
target->unk1C += 0x800;
}
}
switch(param_3)
{
default:
case 0:
if (!sub_8083660(&local_2c)) {
local_2c = target->pos;
flag = TRUE;
}
break;
case 1:
if (!sub_808384C(&local_2c,&gDungeon->unkE21C)) {
local_2c = target->pos;
flag = TRUE;
}
break;
case 2:
if (!sub_808384C(&local_2c,pos)) {
local_2c = target->pos;
flag = TRUE;
}
break;
case 3:
local_2c = *pos;
break;
}
sub_80694C0(target,local_2c.x,local_2c.y,1);
sub_804535C(target,0);
sub_807BB78(target);
sub_803F580(1);
if (sub_8045888(target)) {
direction = (info->action).direction;
target->unk1C = 0x9c00;
do {
if ((gUnknown_202EDCC & 3) == 0) {
direction = (direction + 1) & DIRECTION_MASK;
info->action.direction = direction & DIRECTION_MASK;
sub_806CE68(target,direction);
}
sub_803E46C(0x22);
target->unk1C -= 0x400;
} while (0 < target->unk1C);
}
target->unk1C = 0;
sub_803E46C(0x22);
if (flag) {
sub_80522F4(pokemon,target,*gUnknown_80FCB14); // But it dropped back at the same spot!
}
if (param_3 == 1) {
PetrifiedStatusTarget(pokemon,target);
}
if (info->isTeamLeader) {
sub_804AC20(&target->pos);
sub_807EC28(FALSE);
}
sub_806A5B8(target);
sub_8075900(target,gDungeon->unk3A08);
gDungeon->unk1 = 0;
gDungeon->unk5C0 = -1;
sub_807EC28(0);
}
}
sub_806A5B8(target);
sub_8075900(target,gDungeon->unk3A08);
}
void sub_807E378(void)
void sub_807D3CC(Entity *param_1)
{
u16 uVar2;
Entity *leader;
u32 room;
u8 flag;
int x;
int y;
s32 range;
RoomData *roomData;
leader = GetLeader();
if (EntityExists(leader)) {
flag = FALSE;
range = gDungeon->unk181e8.visibilityRange;
if (range == 0) {
range = 2;
}
room = GetEntityRoom(param_1);
uVar2 = gDungeon->windTurns;
if ((gDungeon->windTurns < 1) ||
(gDungeon->windTurns--, ((uVar2 - 1) << 0x10) < 1)) {
gDungeon->unk67A = 3;
}
if (gDungeon->unk67A == 0) {
if (gDungeon->windTurns < 0xfa) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C4C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0);
gDungeon->unk67A = 1;
if (room == CORRIDOR_ROOM) {
for (y = (param_1->pos).y - range; y <= ((param_1->pos).y + range); y++)
{
for (x = (param_1->pos).x - range; x <= ((param_1->pos).x + range); x++) {
flag |= ExposeTrap(x,y);
}
}
}
}
else if (gDungeon->unk67A == 1) {
if (gDungeon->windTurns < 0x96) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C70);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1);
gDungeon->unk67A = 2;
else {
roomData = &gDungeon->roomData[room];
for (y = roomData->bottomRightCornerY + -1; y <= roomData->topLeftCornerY + 1; y++) {
for (x = roomData->bottomRightCornerX + -1; x <= roomData->topLeftCornerX + 1; x++) {
flag |= ExposeTrap(x,y);
}
}
}
}
else if (gDungeon->unk67A == 2) {
if (gDungeon->windTurns < 0x32) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C8C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2);
gDungeon->unk67A = 3;
}
}
if (flag) {
SendMessage(param_1,*gUnknown_80FD2F8); // All traps were exposed
sub_8040A84();
sub_8049ED4();
}
else if (gDungeon->windTurns < 1) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9CBC);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3);
gDungeon->unk67A = 4;
sub_8068FE0(leader,0x21e,leader);
}
else {
SendMessage(param_1,*gUnknown_80FD320); // There appears to be no hidden traps.
}
}
bool8 ExposeTrap(s32 x,s32 y)
{
Tile *tile;
Entity *trap;
tile = GetTile(x,y);
trap = tile->object;
if (((trap != NULL) && (GetEntityType(trap) == ENTITY_TRAP)) && (!trap->isVisible)) {
trap->isVisible = TRUE;
return TRUE;
}
else {
return FALSE;
}
}
}

182
src/code_807E1A0.c Normal file
View File

@ -0,0 +1,182 @@
#include "global.h"
#include "code_804267C.h"
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "constants/ability.h"
#include "constants/type.h"
#include "dungeon_ai.h"
#include "dungeon_leader.h"
#include "dungeon_map_access.h"
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "move_util.h"
#include "moves.h"
#include "structs/str_dungeon.h"
extern u8 UseAttack(Entity *);
extern void sub_805E804(void);
void sub_806A2BC(Entity *pokemon, u8 param_2);
extern u8 sub_8044B28(void);
extern void sub_8068FE0(Entity *, u32, Entity *r2);
extern void nullsub_93(Position *);
extern void sub_80522F4(Entity *, Entity *, u8 *);
extern void sub_806F370(Entity *pokemon, Entity *target, u32, u32, u8 *, u8 moveType, s32, u32, u32, u32);
extern void sub_80694C0(Entity *, s32, s32, u32);
extern void sub_807EC28(bool8);
extern void sub_806A5B8(Entity *);
extern u32 gUnknown_80F5FAC[];
extern u8 *gUnknown_80F9C4C[];
extern u8 *gUnknown_80F9C70[];
extern u8 *gUnknown_80F9C8C[];
extern u8 *gUnknown_80F9CBC[];
extern u8 gAvailablePokemonNames[];
extern u8 *gUnknown_80FCAC0[];
void sub_807E1A0(Entity *pokemon,Entity *target,u8 moveType,s16 param_4,s32 param_5)
{
EntityInfo *targetInfo;
u8 flag;
Move move;
s32 newHP;
s32 param_4_s32;
param_4_s32 = param_4;
if (EntityExists(target)) {
targetInfo = target->info;
InitPokemonMove(&move, MOVE_REGULAR_ATTACK);
if (!sub_80571F0(target,&move)) {
if (!targetInfo->isNotTeamMember) {
newHP = targetInfo->HP;
newHP /= 2;
if (MonsterIsType(target, TYPE_FIRE)) {
newHP /= 2;
}
if (newHP < 1) {
newHP = 1;
}
}
else {
newHP = param_5;
if (MonsterIsType(target, TYPE_FIRE)) {
newHP /= 2;
}
}
sub_806F370(pokemon,target,newHP,0,&flag,moveType,param_4_s32,0,0,0);
}
}
}
void sub_807E254(Entity *pokemon,Entity *target)
{
Position pokemonPos;
Position targetPos;
if (HasAbility(pokemon, ABILITY_SUCTION_CUPS)) {
SetMessageArgument(gAvailablePokemonNames,pokemon,0);
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
}
else if(HasAbility(target, ABILITY_SUCTION_CUPS))
{
SetMessageArgument(gAvailablePokemonNames,target,0);
sub_80522F4(pokemon,target,*gUnknown_80FCAC0); // $m0 is anchored! It won't switch places
}
else
{
pokemonPos.x = pokemon->pos.x;
pokemonPos.y = pokemon->pos.y;
targetPos.x = target->pos.x;
targetPos.y = target->pos.y;
nullsub_93(&pokemonPos);
nullsub_93(&targetPos);
sub_80694C0(pokemon,targetPos.x,targetPos.y,1);
sub_80694C0(target,pokemonPos.x,pokemonPos.y,1);
sub_804535C(pokemon,NULL);
sub_804535C(target,NULL);
if (EntityExists(pokemon)) {
if (pokemon->info->isTeamLeader) {
sub_804AC20(&pokemon->pos);
sub_807EC28(FALSE);
}
sub_806A5B8(pokemon);
sub_8075900(pokemon,gDungeon->unk3A08);
}
if (EntityExists(target)) {
if (target->info->isTeamLeader) {
sub_804AC20(&target->pos);
sub_807EC28(FALSE);
}
sub_806A5B8(target);
sub_8075900(target,gDungeon->unk3A08);
}
}
}
void sub_807E378(void)
{
u16 uVar2;
Entity *leader;
leader = GetLeader();
if (EntityExists(leader)) {
uVar2 = gDungeon->windTurns;
if ((gDungeon->windTurns < 1) ||
(gDungeon->windTurns--, ((uVar2 - 1) << 0x10) < 1)) {
gDungeon->unk67A = 3;
}
if (gDungeon->unk67A == 0) {
if (gDungeon->windTurns < 0xfa) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C4C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],0);
gDungeon->unk67A = 1;
}
}
}
else if (gDungeon->unk67A == 1) {
if (gDungeon->windTurns < 0x96) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C70);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],1);
gDungeon->unk67A = 2;
}
}
}
else if (gDungeon->unk67A == 2) {
if (gDungeon->windTurns < 0x32) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9C8C);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],2);
gDungeon->unk67A = 3;
}
}
}
else if (gDungeon->windTurns < 1) {
sub_805E804();
sub_806A2BC(leader,1);
UseAttack(leader);
if (sub_8044B28() == 0) {
SendMessage(leader,*gUnknown_80F9CBC);
sub_80426C8(gUnknown_80F5FAC[gDungeon->tileset],3);
gDungeon->unk67A = 4;
sub_8068FE0(leader,0x21e,leader);
}
}
}
}

View File

@ -7,6 +7,7 @@
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "constants/dungeon_action.h"
#include "constants/dungeon.h"
#include "constants/iq_skill.h"
@ -24,7 +25,6 @@
#include "dungeon_visibility.h"
#include "pokemon_3.h"
#include "pokemon.h"
#include "code_8077274_1.h"
#include "trap.h"
extern u8 gUnknown_202F221;
@ -81,7 +81,6 @@ void HandleEatAIAction(Entity *pokemon);
bool8 sub_8044B84(void);
extern void sub_8074094(Entity *);
extern void sub_8071DA4(Entity *);
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
u32 sub_8075818(Entity *entity);
bool8 TargetLeader(Entity *pokemon)

View File

@ -4,6 +4,7 @@
#include "code_8045A00.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/status.h"
@ -200,7 +201,6 @@ extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
extern void sub_8045C28(Item *, u8 , u8);
extern void sub_805A7D4(Entity *, Entity *, Item *, Position *);
extern void MudWaterSportEffect(u32);
extern void sub_807D148(Entity *pokemon, Entity *target, u32 r2, Position *r3);
extern void sub_806EAF4(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32);
extern void sub_806A6E8(Entity *);

View File

@ -126,7 +126,6 @@ extern u8 *gUnknown_80FC270[];
extern u8 *gUnknown_80FC138[];
extern u8 *gUnknown_80FC21C[];
extern bool8 sub_8071728(Entity * pokemon, Entity * target, bool8 displayMessage);
extern void sub_8041F28(Entity *, s32);
extern void sub_8041F4C(Entity *, s32);
extern void sub_8041F70(Entity *, s32);

View File

@ -44,7 +44,6 @@ extern u32 SaveRecruitedPokemon(u8 *, u32);
extern u32 RestoreRecruitedPokemon(void* a, s32 b);
extern u32 SavePokemonStruct2(u8 *, u32);
extern u32 RestorePokemonStruct2(void* a, s32 b);
extern u32 sub_80921C4(u8 *, u32);
extern u32 sub_80954CC(void* a, s32 b);
extern u32 sub_8095624(u8 *, u32);
extern u32 RestoreMailInfo(void* a, s32 b);

View File

@ -17,6 +17,7 @@
#include "dungeon_pokemon_attributes.h"
#include "dungeon_util.h"
#include "math.h"
#include "move_effects_target.h"
#include "number_util.h"
#include "status_checks_1.h"
#include "structs/map.h"
@ -134,8 +135,6 @@ extern s32 gFormatData_202DE30[10];
extern void sub_8041D84(Entity *);
extern void sub_804178C(u32);
extern void sub_8041D5C(Entity *);
extern void RaiseAttackStageTarget(Entity *, Entity *, u32, u32);
extern void RaiseDefenseStageTarget(Entity *, Entity *, u32, u32);
extern void sub_8041D48(Entity *);
extern void sub_8041D38(Entity * pokemon);
extern u8 sub_8043D10(void);
@ -168,7 +167,6 @@ extern void sub_8041CCC(Entity *);
extern void sub_8041CB8(Entity *r0);
extern void sub_8041C1C(Entity *r0);
extern void sub_8042060(Entity *, s32);
extern bool8 sub_8071728(Entity * param_1, Entity * param_2, u8 param_3);
extern void sub_8041FB4(Entity *r0, u32 r1);
extern void sub_8041FD8(Entity *r0, u32 r1);
extern void sub_80522F4(Entity *r1, Entity *r2, u8 *);

View File

@ -6,6 +6,7 @@
#include "code_80521D0.h"
#include "code_806CD90.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "code_808417C.h"
#include "constants/ability.h"
#include "constants/move_id.h"
@ -50,7 +51,6 @@ extern void sub_8042A54(Position *);
extern void sub_8049BB0(s32, s32);
extern s16 sub_8057600(Move*, u32);
extern u32 sub_8055864(Entity *pokemon, Entity *target, Move *param_3, s32 param_4, s32 param_5);
extern void sub_807D148(Entity *pokemon, Entity *r1, u32 r2, Position *r3);
extern void sub_807DB74(Entity *);
extern void HandleLuminousOrbAction(Entity *pokemon);
extern void sub_807D510(Entity *, Entity *);
@ -61,7 +61,6 @@ extern void sub_806BB6C(Entity *, s32);
extern void sub_807E254(Entity *, Entity *, u32);
extern u32 sub_8055640(Entity *, Entity *, Move *, u32, u32);
extern void sub_806A6E8(Entity *);
extern void sub_807D3CC(Entity *, Entity *);
extern u8 sub_8069D18(Position *);
extern u8 sub_804AD34(Position *);
@ -82,7 +81,6 @@ extern void sub_8075C58(Entity *, Entity *, s32, s32);
extern void DealDamageToEntity(Entity *, s32, u32, u32);
extern bool8 sub_805755C(Entity* pokemon,u16 moveID);
extern void sub_80783C4(Entity *, Entity *, u32);
extern void sub_807CD9C(Entity *, Entity *, u32 direction);
// NOTE: Override pokemon.c types for these two funcs
@ -726,7 +724,7 @@ bool8 RockSmashMoveAction(Entity * pokemon, Entity * target, Move *move, s32 par
bool8 sub_805BA44(Entity * pokemon, Entity * target, Move *move, s32 param_4)
{
sub_807D3CC(pokemon, target);
sub_807D3CC(pokemon);
return TRUE;
}

View File

@ -5,6 +5,7 @@
#include "code_8045A00.h"
#include "code_80521D0.h"
#include "code_8077274_1.h"
#include "code_807CD9C.h"
#include "code_808417C.h"
#include "constants/trap.h"
#include "constants/type.h"
@ -92,9 +93,7 @@ void sub_8049ED4(void);
void sub_80522F4(Entity *pokemon, Entity *target, const char r2[]);
u8 sub_803D6FC(void);
Entity *sub_8045684(u8, Position *, u8);
extern void sub_807D148(Entity *pokemon, Entity *target, u32 r2, Position *r3);
extern void sub_807DF38(Entity *pokemon, Entity *target, Position *pos, u32, u8 moveType, s16);
extern void sub_807CD9C(Entity *, Entity *, u32 direction);
void sub_807FC3C(Position *pos, u32 trapID, u32 param_3)
{