More battle dome

This commit is contained in:
DizzyEggg 2018-08-15 23:04:46 +02:00
parent a54fa23b5f
commit e2f5e73445
9 changed files with 532 additions and 1161 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1867,7 +1867,7 @@ sub_819B484: @ 819B484
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x18]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
ldrb r1, [r4]
@ -1948,7 +1948,7 @@ _0819B572:
ldr r0, [r2]
adds r0, r4
adds r0, 0x8
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r2, [r1]
lsls r5, 4
adds r2, r5, r2
@ -1973,7 +1973,7 @@ _0819B5B8:
ldr r0, [r3]
adds r0, r4
adds r0, 0x8
ldr r5, =gUnknown_0203BC8C
ldr r5, =gFacilityTrainerMons
ldr r1, [r5]
adds r1, r7, r1
lsls r2, r6, 1
@ -2045,7 +2045,7 @@ sub_819B63C: @ 819B63C
add r0, sp, 0xC
movs r1, 0
strb r1, [r0]
ldr r2, =gUnknown_0203BC8C
ldr r2, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
str r0, [r2]
ldr r0, =gSaveBlock2Ptr
@ -2089,7 +2089,7 @@ _0819B678:
adds r4, 0xC
adds r0, r4
adds r0, 0x8
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
ldr r2, [r3]
mov r7, r8
lsls r5, r7, 4
@ -2114,7 +2114,7 @@ _0819B6D4:
ldr r0, [r1]
adds r0, r4
adds r0, 0x8
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
ldr r2, [r3]
mov r3, r8
lsls r1, r3, 4
@ -2145,7 +2145,7 @@ _0819B6D4:
ldr r0, [r2]
adds r0, r4
adds r0, 0x8
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
ldr r1, [r3]
adds r1, r5, r1
ldrb r2, [r1, 0xA]
@ -3936,7 +3936,7 @@ sub_819C5D0: @ 819C5D0
sub_819C634: @ 819C634
push {r4-r7,lr}
lsls r0, 16
ldr r2, =gUnknown_0203BC8C
ldr r2, =gFacilityTrainerMons
ldr r1, [r2]
lsrs r0, 12
adds r0, r1
@ -20059,7 +20059,7 @@ _081A4E46:
bl ZeroEnemyPartyMons
movs r1, 0
str r1, [sp, 0x18]
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x1C]
@ -22413,7 +22413,7 @@ _081A627A:
lsls r0, 16
lsrs r0, 16
mov r9, r0
ldr r4, =gUnknown_0203BC8C
ldr r4, =gFacilityTrainerMons
ldr r2, [r4]
lsls r1, r0, 4
adds r0, r1, r2
@ -22458,7 +22458,7 @@ _081A62D0:
cmp r0, r5
beq _081A6302
adds r6, r4, 0
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
mov r12, r3
mov r5, r8
ldr r3, [sp, 0x14]
@ -22493,7 +22493,7 @@ _081A631C:
ldrh r1, [r3]
cmp r1, 0
beq _081A6336
ldr r6, =gUnknown_0203BC8C
ldr r6, =gFacilityTrainerMons
ldr r0, [r6]
ldr r6, [sp, 0x24]
adds r0, r6, r0
@ -22512,7 +22512,7 @@ _081A633E:
cmp r2, r4
bne _081A636E
lsls r4, r7, 1
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
add r1, r8
ldrh r0, [r1]
@ -22573,12 +22573,12 @@ sub_81A63CC: @ 81A63CC
ands r0, r1
cmp r0, 0x2
beq _081A63FC
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
b _081A6400
.pool
_081A63FC:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
_081A6400:
str r0, [r1]
@ -22637,7 +22637,7 @@ _081A6408:
adds r1, r2
strb r0, [r1]
ldrh r1, [r6]
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r0, [r0]
lsls r1, 4
adds r1, r0
@ -22679,7 +22679,7 @@ sub_81A64C4: @ 81A64C4
ands r0, r1
cmp r0, 0x2
bne _081A6500
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
str r0, [r1]
movs r2, 0x1E
@ -22687,7 +22687,7 @@ sub_81A64C4: @ 81A64C4
b _081A6518
.pool
_081A6500:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
ldrb r1, [r2]
@ -22712,7 +22712,7 @@ _081A6522:
mov r1, sp
adds r1, 0x12
str r1, [sp, 0x1C]
ldr r2, =gUnknown_0203BC8C
ldr r2, =gFacilityTrainerMons
mov r9, r2
_081A6534:
ldr r4, =gSaveBlock2Ptr
@ -22879,7 +22879,7 @@ _081A666C:
_081A667A:
movs r2, 0
mov r8, r2
ldr r4, =gUnknown_0203BC8C
ldr r4, =gFacilityTrainerMons
mov r9, r4
_081A6682:
ldr r5, =gSaveBlock2Ptr
@ -23113,7 +23113,7 @@ _081A681A:
bne _081A6878
movs r2, 0x1
_081A6878:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
mov r1, r9
@ -23166,7 +23166,7 @@ _081A68F2:
bl sub_81A6EF0
lsls r0, 16
lsrs r7, r0, 16
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
lsls r2, r7, 4
adds r4, r2, r1
@ -23226,7 +23226,7 @@ _081A6964:
ldrh r4, [r5]
cmp r4, 0
beq _081A6994
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
mov r2, r9
adds r1, r2, r0
@ -23262,7 +23262,7 @@ _081A699C:
lsls r0, 4
adds r1, r0
strh r7, [r1]
ldr r2, =gUnknown_0203BC8C
ldr r2, =gFacilityTrainerMons
ldr r1, [r2]
add r1, r9
ldrh r0, [r1]
@ -23307,7 +23307,7 @@ sub_81A6A08: @ 81A6A08
mov r7, r8
push {r7}
sub sp, 0x18
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
movs r4, 0
@ -23326,7 +23326,7 @@ _081A6A1E:
movs r4, 0
ldr r0, =gUnknown_03006298
mov r8, r0
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r6, [r0]
ldr r1, =gBaseStats
mov r12, r1
@ -23423,7 +23423,7 @@ sub_81A6AEC: @ 81A6AEC
push {r4-r7,lr}
sub sp, 0x8
movs r7, 0
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
movs r4, 0
@ -23445,7 +23445,7 @@ _081A6B0E:
ldrh r6, [r0]
movs r5, 0
_081A6B18:
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
lsls r0, r6, 4
adds r0, r1
@ -23590,12 +23590,12 @@ sub_81A6C1C: @ 81A6C1C
ands r0, r1
cmp r0, 0x2
beq _081A6C48
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
b _081A6C4C
.pool
_081A6C48:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
_081A6C4C:
str r0, [r1]
@ -23615,7 +23615,7 @@ _081A6C50:
lsls r1, 4
adds r2, r1
ldrh r2, [r2]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r1, [r1]
lsls r2, 4
adds r2, r1
@ -23702,7 +23702,7 @@ sub_81A6CD0: @ 81A6CD0
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x24]
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x20]
@ -23727,7 +23727,7 @@ _081A6D4C:
bl sub_81A6EF0
lsls r0, 16
lsrs r5, r0, 16
ldr r7, =gUnknown_0203BC8C
ldr r7, =gFacilityTrainerMons
ldr r1, [r7]
lsls r0, r5, 4
adds r0, r1
@ -23775,7 +23775,7 @@ _081A6DA8:
cmp r4, r9
bge _081A6DDC
add r2, sp, 0xC
ldr r7, =gUnknown_0203BC8C
ldr r7, =gFacilityTrainerMons
ldr r0, [r7]
lsls r1, r5, 4
adds r0, r1, r0
@ -23784,7 +23784,7 @@ _081A6DA8:
ldrh r0, [r0]
cmp r2, r0
beq _081A6DDC
ldr r6, =gUnknown_0203BC8C
ldr r6, =gFacilityTrainerMons
adds r3, r7, 0
add r2, sp, 0xC
_081A6DC8:
@ -23805,7 +23805,7 @@ _081A6DDC:
cmp r4, r9
bge _081A6E0C
ldr r7, =gBattleFrontierHeldItems
ldr r6, =gUnknown_0203BC8C
ldr r6, =gFacilityTrainerMons
add r2, sp, 0x14
lsls r3, r5, 4
_081A6DEE:
@ -23833,7 +23833,7 @@ _081A6E0C:
mov r1, sp
adds r1, r2
adds r1, 0xC
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
ldr r4, [r3]
lsls r5, 4
mov r8, r5
@ -23875,7 +23875,7 @@ _081A6E0C:
add r0, r9
mov r8, r0
_081A6E6E:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
adds r0, r7, r0
lsls r1, r4, 1
@ -23898,7 +23898,7 @@ _081A6E6E:
movs r1, 0x20
mov r2, r10
bl SetMonData
ldr r2, =gUnknown_0203BC8C
ldr r2, =gFacilityTrainerMons
ldr r0, [r2]
adds r0, r7, r0
ldrb r2, [r0, 0xA]
@ -29517,7 +29517,7 @@ _081A9C56:
bl SetMonData
cmp r5, 0
beq _081A9CD4
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r5, r0, 24
ldr r1, [sp, 0x10]

View File

@ -22,7 +22,7 @@ sub_81B9EC0: @ 81B9EC0
mov r1, sp
adds r1, 0x18
str r1, [sp, 0x2C]
ldr r5, =gUnknown_0203BC8C
ldr r5, =gFacilityTrainerMons
ldr r4, =gSlateportBattleTentMons
movs r2, 0
adds r3, r1, 0
@ -73,7 +73,7 @@ _081B9F1E:
ldrh r0, [r1]
cmp r0, r5
beq _081B9F7C
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
lsls r0, r5, 4
adds r4, r0, r1
@ -112,7 +112,7 @@ _081B9F7C:
bge _081B9FD4
ldr r0, =gBattleFrontierHeldItems
mov r12, r0
ldr r7, =gUnknown_0203BC8C
ldr r7, =gFacilityTrainerMons
ldr r1, [sp, 0x24]
ldr r0, [sp, 0x2C]
adds r4, r1, r0
@ -155,7 +155,7 @@ _081B9FD4:
lsls r6, 4
adds r1, r6
strh r5, [r1]
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r0, [r0]
lsls r1, r5, 4
adds r1, r0
@ -208,7 +208,7 @@ sub_81BA040: @ 81BA040
ldr r1, =gUnknown_0203BC88
ldr r0, =gSlateportBattleTentTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
str r0, [r1]
ldr r7, =gSaveBlock2Ptr
@ -324,7 +324,7 @@ _081BA13E:
strh r0, [r7]
movs r2, 0
ldrh r0, [r7]
ldr r4, =gUnknown_0203BC8C
ldr r4, =gFacilityTrainerMons
ldr r3, [r4]
lsls r0, 4
adds r0, r3
@ -356,7 +356,7 @@ _081BA180:
cmp r0, r6
beq _081BA1B0
ldr r6, =gUnknown_03001298
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
mov r2, sp
_081BA198:
adds r2, 0x2
@ -386,7 +386,7 @@ _081BA1C0:
beq _081BA1DE
ldr r1, =gUnknown_03001298
ldrh r0, [r1]
ldr r6, =gUnknown_0203BC8C
ldr r6, =gFacilityTrainerMons
ldr r1, [r6]
lsls r0, 4
adds r0, r1
@ -406,7 +406,7 @@ _081BA1E6:
bne _081BA220
lsls r2, r5, 1
ldrh r0, [r7]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r4, [r1]
lsls r0, 4
adds r0, r4

View File

@ -551,7 +551,7 @@ _08162414:
bl __udivsi3
lsls r0, 16
lsrs r5, r0, 16
bl sub_8165C40
bl GetFrontierEnemyMonLevel
subs r4, 0x2
cmp r4, 0x1
bhi _08162488
@ -784,7 +784,7 @@ sub_8162614: @ 8162614
adds r6, r4, 0
lsls r1, 24
lsrs r5, r1, 24
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -962,7 +962,7 @@ sub_81627A4: @ 81627A4
lsls r0, 16
lsrs r4, r0, 16
adds r5, r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -1335,7 +1335,7 @@ GetFrontierTrainerFrontSpriteId: @ 8162AA0
lsls r0, 16
lsrs r4, r0, 16
adds r5, r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -1462,7 +1462,7 @@ GetFrontierOpponentClass: @ 8162BD8
lsls r0, 16
lsrs r4, r0, 16
adds r5, r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -1602,7 +1602,7 @@ sub_8162D34: @ 8162D34
lsls r0, 16
lsrs r4, r0, 16
adds r5, r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -1704,7 +1704,7 @@ GetFrontierTrainerName: @ 8162E20
lsls r1, 16
lsrs r5, r1, 16
movs r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r5, r0
@ -1854,7 +1854,7 @@ sub_8162F68: @ 8162F68
lsls r0, 16
lsrs r4, r0, 16
adds r5, r4, 0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r4, r0
@ -2025,7 +2025,7 @@ sub_81630C4: @ 81630C4
add r4, sp, 0x14
movs r0, 0xFF
strb r0, [r4]
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x20]
@ -2258,7 +2258,7 @@ _081632D2:
movs r1, 0xB
movs r2, 0
bl GetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r2, [r1]
lsls r1, r4, 4
adds r1, r2
@ -2291,7 +2291,7 @@ _08163308:
movs r1, 0xC
movs r2, 0
bl GetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r2, [r1]
lsls r1, r4, 4
adds r1, r2
@ -2338,7 +2338,7 @@ _08163368:
muls r0, r1
ldr r2, =gEnemyParty
adds r0, r2
ldr r5, =gUnknown_0203BC8C
ldr r5, =gFacilityTrainerMons
ldr r2, [r5]
lsls r4, 4
adds r2, r4, r2
@ -2405,7 +2405,7 @@ _081633EC:
movs r1, 0x20
add r2, sp, 0x14
bl SetMonData
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r0, [r0]
add r0, r9
ldrb r2, [r0, 0xA]
@ -2551,7 +2551,7 @@ sub_8163524: @ 8163524
adds r4, r0, 0
lsls r4, 16
lsrs r4, 16
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r6, r0, 24
ldr r0, =gUnknown_0203BC88
@ -2728,7 +2728,7 @@ _081636A4:
movs r0, 0x1F
_081636A6:
str r0, [sp, 0x18]
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x14]
@ -2759,7 +2759,7 @@ _081636CE:
muls r6, r0
ldr r1, =gEnemyParty
adds r0, r6, r1
ldr r3, =gUnknown_0203BC8C
ldr r3, =gFacilityTrainerMons
ldr r2, [r3]
mov r1, r9
lsls r4, r1, 4
@ -2784,7 +2784,7 @@ _081636CE:
mov r10, r7
adds r7, r4, 0
_08163718:
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
mov r2, r9
lsls r0, r2, 4
@ -2813,7 +2813,7 @@ _08163718:
movs r1, 0x20
add r2, sp, 0xC
bl SetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
adds r0, r7, r0
ldrb r2, [r0, 0xA]
@ -2881,7 +2881,7 @@ _081637D0:
muls r6, r7
ldr r1, =gEnemyParty
adds r0, r6, r1
ldr r7, =gUnknown_0203BC8C
ldr r7, =gFacilityTrainerMons
ldr r2, [r7]
lsls r4, 4
adds r2, r4, r2
@ -2905,7 +2905,7 @@ _081637D0:
mov r8, r4
mov r5, r8
_08163818:
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
adds r0, r5, r0
lsls r4, r7, 1
@ -2916,7 +2916,7 @@ _08163818:
adds r0, r6, r2
adds r2, r7, 0
bl sub_81A7024
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
adds r0, r5, r0
adds r0, 0x2
@ -2942,7 +2942,7 @@ _08163846:
movs r1, 0x20
add r2, sp, 0xC
bl SetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, [r1]
add r0, r8
ldrb r2, [r0, 0xA]
@ -3029,7 +3029,7 @@ _0816390A:
thumb_func_start sub_8163914
sub_8163914: @ 8163914
push {lr}
bl sub_8165C40
bl GetFrontierEnemyMonLevel
ldr r0, =gSpecialVar_0x8005
ldrh r0, [r0]
cmp r0, 0
@ -4091,7 +4091,7 @@ sub_81642A0: @ 81642A0
movs r2, 0
bl GetMonData
str r0, [sp, 0x20]
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r7, 0
ldr r0, [sp, 0x18]
lsls r0, 24
@ -4200,7 +4200,7 @@ _081643C0:
ldr r1, [sp, 0x28]
adds r0, r1
ldrh r2, [r0]
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r0, [r0]
lsls r2, 4
adds r2, r0
@ -4216,7 +4216,7 @@ _081643F4:
bge _08164430
ldr r2, =gSaveBlock2Ptr
ldr r0, [r2]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r3, [r1]
lsls r1, r6, 4
adds r1, r3
@ -4556,7 +4556,7 @@ sub_81646BC: @ 81646BC
movs r0, 0
mov r9, r0
mov r10, r0
bl sub_8165C40
bl GetFrontierEnemyMonLevel
movs r0, 0xFA
lsls r0, 1
cmp r5, r0
@ -4564,7 +4564,7 @@ sub_81646BC: @ 81646BC
subs r0, 0xC9
cmp r5, r0
bhi _081646FC
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
lsls r0, r4, 4
adds r0, r1
@ -4705,7 +4705,7 @@ sub_8164828: @ 8164828
mov r5, r8
push {r5-r7}
sub sp, 0x8
bl sub_8165C40
bl GetFrontierEnemyMonLevel
bl sub_81A39C4
lsls r0, 16
lsrs r0, 16
@ -6073,7 +6073,7 @@ sub_8165404: @ 8165404
sub sp, 0x70
lsls r0, 16
lsrs r7, r0, 16
bl sub_8165C40
bl GetFrontierEnemyMonLevel
ldr r0, =0x00000c03
cmp r7, r0
beq _08165420
@ -6228,7 +6228,7 @@ _08165564:
bls _0816556C
b _081656E8
_0816556C:
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
lsrs r0, 24
str r0, [sp, 0x50]
@ -6272,7 +6272,7 @@ _081655A6:
mov r9, r0
mov r0, r8
add r0, r9
ldr r6, =gUnknown_0203BC8C
ldr r6, =gFacilityTrainerMons
ldr r4, [r6]
lsls r5, r1, 4
adds r4, r5, r4
@ -6339,7 +6339,7 @@ _08165634:
movs r1, 0x20
ldr r2, [sp, 0x5C]
bl SetMonData
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r1, [r0]
ldr r2, [sp, 0x54]
lsls r0, r2, 4
@ -7083,8 +7083,8 @@ _08165C2A:
.pool
thumb_func_end sub_8165B88
thumb_func_start sub_8165C40
sub_8165C40: @ 8165C40
thumb_func_start GetFrontierEnemyMonLevel
GetFrontierEnemyMonLevel: @ 8165C40
push {lr}
ldr r0, =gSaveBlock2Ptr
ldr r0, [r0]
@ -7098,7 +7098,7 @@ sub_8165C40: @ 8165C40
ldr r1, =gUnknown_0203BC88
ldr r0, =gBattleFrontierTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
str r0, [r1]
ldrb r0, [r2]
@ -7114,7 +7114,7 @@ _08165C88:
lsrs r0, 24
pop {r1}
bx r1
thumb_func_end sub_8165C40
thumb_func_end GetFrontierEnemyMonLevel
thumb_func_start BattleFrontierGetOpponentLvl
BattleFrontierGetOpponentLvl: @ 8165C90
@ -7258,7 +7258,7 @@ sub_8165D78: @ 8165D78
ldr r1, =gUnknown_0203BC88
ldr r0, =gSlateportBattleTentTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gSlateportBattleTentMons
b _08165DF2
.pool
@ -7268,7 +7268,7 @@ _08165DA8:
ldr r1, =gUnknown_0203BC88
ldr r0, =gVerdanturfBattleTentTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gVerdanturfBattleTentMons
b _08165DF2
.pool
@ -7278,7 +7278,7 @@ _08165DC8:
ldr r1, =gUnknown_0203BC88
ldr r0, =gFallarborBattleTentTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gFallarborBattleTentMons
b _08165DF2
.pool
@ -7286,7 +7286,7 @@ _08165DE8:
ldr r1, =gUnknown_0203BC88
ldr r0, =gBattleFrontierTrainers
str r0, [r1]
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r0, =gBattleFrontierMons
_08165DF2:
str r0, [r1]
@ -7456,7 +7456,7 @@ _08165F44:
movs r1, 0xB
movs r2, 0
bl GetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r2, [r1]
lsls r1, r4, 4
adds r1, r2
@ -7489,7 +7489,7 @@ _08165F7A:
movs r1, 0xC
movs r2, 0
bl GetMonData
ldr r1, =gUnknown_0203BC8C
ldr r1, =gFacilityTrainerMons
ldr r2, [r1]
lsls r1, r4, 4
adds r1, r2
@ -7537,7 +7537,7 @@ _08165FDA:
muls r0, r6
ldr r1, =gEnemyParty
adds r0, r1
ldr r5, =gUnknown_0203BC8C
ldr r5, =gFacilityTrainerMons
ldr r2, [r5]
lsls r4, 4
adds r2, r4, r2
@ -7603,7 +7603,7 @@ _0816605E:
movs r1, 0x20
add r2, sp, 0x14
bl SetMonData
ldr r0, =gUnknown_0203BC8C
ldr r0, =gFacilityTrainerMons
ldr r0, [r0]
add r0, r9
ldrb r2, [r0, 0xA]
@ -7756,7 +7756,7 @@ sub_8166188: @ 8166188
ands r0, r1
cmp r0, 0
beq _081661E8
bl sub_8165C40
bl GetFrontierEnemyMonLevel
lsls r0, 24
movs r5, 0
ldr r7, =gBaseStats

View File

@ -224,6 +224,7 @@ extern const u8* const gStatNamesTable[];
extern const u8* const gPokeblockWasTooXStringTable[];
extern const u8* const gRefereeStringsTable[];
extern const u8* const gStatNamesTable2[];
extern const u8 *const gRoundsStringTable[];
extern const u8 gText_PkmnIsEvolving[];
extern const u8 gText_CongratsPkmnEvolved[];

View File

@ -337,14 +337,16 @@ struct FrontierMonData
u8 nature;
};
struct FrontierUnkStruct1
struct BattleDomeTrainer
{
u16 unk0:10;
u16 trainerId:10;
u16 unk1:1;
u16 unk2:2;
u16 unk3:3;
};
#define DOME_TOURNAMENT_TRAINERS_COUNT 16
struct BattleFrontier
{
/*0x64C*/ struct EmeraldBattleTowerRecord battleTower;
@ -404,8 +406,8 @@ struct BattleFrontier
/*0xD21*/ u8 field_D21;
/*0xD22*/ u8 field_D22;
/*0xD23*/ u8 field_D23;
/*0xD24*/ struct FrontierUnkStruct1 field_D24[16];
/*0xD64*/ u16 field_D64[16][3];
/*0xD24*/ struct BattleDomeTrainer domeTrainers[DOME_TOURNAMENT_TRAINERS_COUNT];
/*0xD64*/ u16 domeMonId[DOME_TOURNAMENT_TRAINERS_COUNT][3];
/*0xDC8*/ u16 field_DC8[2];
/*0xDCC*/ u8 filler_DCC[4];
/*0xDD0*/ u16 field_DD0[2];

View File

@ -2,47 +2,56 @@
#include "battle.h"
#include "battle_setup.h"
#include "battle_frontier_1.h"
#include "battle_message.h"
#include "event_data.h"
#include "overworld.h"
#include "util.h"
#include "malloc.h"
#include "string_util.h"
#include "random.h"
#include "constants/species.h"
#include "constants/moves.h"
#include "constants/trainers.h"
#include "constants/abilities.h"
struct Unknown_0203BC8C_Struct
{
u16 field_0;
u8 field_2;
u8 field_3;
u8 field_4;
u8 field_5;
u8 field_6;
u8 field_7;
u8 field_8;
u8 field_9;
u8 field_A;
u8 field_B;
u8 field_C;
u8 field_D;
u8 field_E;
u16 species;
u16 moves[4];
u8 itemTableId;
u8 evSpread;
u8 nature;
};
extern struct Unknown_0203BC8C_Struct *gUnknown_0203BC8C;
extern struct Unknown_0203BC8C_Struct *gFacilityTrainerMons;
extern void sub_81B8558(void);
extern u32 sub_81A39C4(void);
extern u16 sub_8162548(u8, u8);
extern u16 sub_8163524(u16);
extern u8 sub_8165C40(void);
extern u8 GetFrontierEnemyMonLevel(void);
extern void sub_8195898(u8 *dst, u16 trainerId);
extern u16 sub_81A5060(u8, u8);
extern u8 gUnknown_0203CEF8[];
extern u32 gUnknown_0203CD70;
extern u32 gUnknown_0203CD74;
extern void (* const gUnknown_0860D090[])(void);
extern const u32 gUnknown_0860D0EC[][2];
extern const u32 gUnknown_0860D0FC[][2];
extern const u16 gBattleFrontierHeldItems[];
// This file's functions.
u8 sub_8190168(u16);
u8 GetDomeTrainerMonIvs(u16 trainerId);
void sub_818F720(u16 species, s32 level, s32 ivs, u8 evBits, u8 nature, s32 *stats);
void CreateDomeTrainerMons(u16 tournamentTrainerId);
u16 TrainerIdToTournamentId(u16 trainerId);
s32 sub_818FC78(u16 tournamentTrainerId);
s32 sub_818FCBC(u16 tournamentTrainerId, bool8 arg1);
s32 sub_818FDB8(u16 tournamentTrainerId, bool8 arg1);
s32 sub_818FFC0(s32 move, s32 species, s32 arg2);
s32 sub_818FEB4(s32 *arr, bool8 arg1);
// code
void sub_818E9AC(void)
@ -219,14 +228,14 @@ void sub_818F02C(void)
gSaveBlock2Ptr->frontier.field_D0A = gSaveBlock2Ptr->frontier.chosenLvl + 1;
gSaveBlock2Ptr->frontier.field_D0B = VarGet(VAR_0x40CE) + 1;
gSaveBlock2Ptr->frontier.field_D24[0].unk0 = 0x3FF;
gSaveBlock2Ptr->frontier.field_D24[0].unk1 = 0;
gSaveBlock2Ptr->frontier.field_D24[0].unk2 = 0;
gSaveBlock2Ptr->frontier.field_D24[0].unk3 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[0].trainerId = 0x3FF;
gSaveBlock2Ptr->frontier.domeTrainers[0].unk1 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[0].unk2 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[0].unk3 = 0;
for (i = 0; i < 3; i++)
{
gSaveBlock2Ptr->frontier.field_D64[i] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_SPECIES, NULL);
gSaveBlock2Ptr->frontier.domeMonId[i] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_SPECIES, NULL);
for (j = 0; j < 4; j++)
gSaveBlock2Ptr->frontier.field_EFC[i].moves[j] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.field_CAA[i] - 1], MON_DATA_MOVE1 + j, NULL);
for (j = 0; j < 6; j++)
@ -247,12 +256,12 @@ void sub_818F02C(void)
val = sub_8162548(sub_81A39C4(), 0);
for (k = 1; k < l; k++)
{
if (gSaveBlock2Ptr->frontier.field_D24[k].unk0 == val)
if (gSaveBlock2Ptr->frontier.domeTrainers[k].trainerId == val)
break;
}
if (k != l)
{
gSaveBlock2Ptr->frontier.field_D24[var_28].unk0 = val;
gSaveBlock2Ptr->frontier.domeTrainers[var_28].trainerId = val;
break;
}
}
@ -264,12 +273,12 @@ void sub_818F02C(void)
val = sub_8162548(sub_81A39C4() + 1, 0);
for (k = 1; k < l; k++)
{
if (gSaveBlock2Ptr->frontier.field_D24[k].unk0 == val)
if (gSaveBlock2Ptr->frontier.domeTrainers[k].trainerId == val)
break;
}
if (k != l)
{
gSaveBlock2Ptr->frontier.field_D24[var_28].unk0 = val;
gSaveBlock2Ptr->frontier.domeTrainers[var_28].trainerId = val;
break;
}
}
@ -283,24 +292,24 @@ void sub_818F02C(void)
val2 = sub_8163524(val);
for (i = 0; i < l; i++)
{
if (gSaveBlock2Ptr->frontier.field_D64[i] == val2)
if (gSaveBlock2Ptr->frontier.domeMonId[i] == val2)
break;
if (var_54 == gUnknown_0203BC8C[val2].field_0)
if (var_54 == gFacilityTrainerMons[val2].field_0)
break;
if (var_50 == gUnknown_0203BC8C[val2].field_0)
if (var_50 == gFacilityTrainerMons[val2].field_0)
break;
if (gUnknown_0203BC8C[gSaveBlock2Ptr->frontier.field_D64[i]].field_A == gUnknown_0203BC8C[val2].field_A)
if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i]].field_A == gFacilityTrainerMons[val2].field_A)
break;
}
} while (i != var_38);
gSaveBlock2Ptr->frontier.field_D64[var_24] = val2;
array[var_38] = gUnknown_0203BC8C[val2].field_0;
gSaveBlock2Ptr->frontier.domeMonId[var_24] = val2;
array[var_38] = gFacilityTrainerMons[val2].field_0;
}
gSaveBlock2Ptr->frontier.field_D24[var_28].unk1 = 0;
gSaveBlock2Ptr->frontier.field_D24[var_28].unk2 = 0;
gSaveBlock2Ptr->frontier.field_D24[var_28].unk3 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[var_28].unk1 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[var_28].unk2 = 0;
gSaveBlock2Ptr->frontier.domeTrainers[var_28].unk3 = 0;
}
for (i = 0; i < 3; i++)
@ -323,7 +332,7 @@ void sub_818F02C(void)
monTypesBits >>= 1;
}
var_48 = sub_8165C40();
var_48 = GetFrontierEnemyMonLevel();
var_44[0] += (monTypesCount * var_48) / 20;
for (i = 0; i < 16; i++)
@ -331,10 +340,10 @@ void sub_818F02C(void)
u8 r8;
var_44[i + 1] = 0;
r8 = sub_8190168(gSaveBlock2Ptr->frontier.field_D24[i].unk0);
r8 = GetDomeTrainerMonIvs(gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId);
for (j = 0; j < 3; j++)
{
sub_818F720(gSaveBlock2Ptr->frontier.field_D64[i]);
sub_818F720(gSaveBlock2Ptr->frontier.domeMonId[i]);
}
}
@ -659,7 +668,7 @@ _0818F2D4:\n\
ldrh r3, [r4]\n\
cmp r3, r6\n\
beq _0818F300\n\
ldr r2, =gUnknown_0203BC8C\n\
ldr r2, =gFacilityTrainerMons\n\
ldr r1, [r2]\n\
lsls r0, r6, 4\n\
adds r2, r0, r1\n\
@ -692,7 +701,7 @@ _0818F300:\n\
ldr r2, [sp, 0x28]\n\
add r2, sp\n\
adds r2, 0x8\n\
ldr r0, =gUnknown_0203BC8C\n\
ldr r0, =gFacilityTrainerMons\n\
ldr r1, [r0]\n\
lsls r0, r6, 4\n\
adds r0, r1\n\
@ -856,7 +865,7 @@ _0818F462:\n\
subs r5, 0x1\n\
cmp r5, 0\n\
bge _0818F458\n\
bl sub_8165C40\n\
bl GetFrontierEnemyMonLevel\n\
lsls r0, 24\n\
lsrs r0, 24\n\
str r0, [sp, 0x14]\n\
@ -888,7 +897,7 @@ _0818F494:\n\
ldrh r0, [r0]\n\
lsls r0, 22\n\
lsrs r0, 22\n\
bl sub_8190168\n\
bl GetDomeTrainerMonIvs\n\
lsls r0, 24\n\
lsrs r0, 24\n\
mov r8, r0\n\
@ -906,7 +915,7 @@ _0818F4BC:\n\
adds r0, r2\n\
adds r0, r4\n\
ldrh r1, [r0]\n\
ldr r3, =gUnknown_0203BC8C\n\
ldr r3, =gFacilityTrainerMons\n\
ldr r0, [r3]\n\
lsls r1, 4\n\
adds r1, r0\n\
@ -940,7 +949,7 @@ _0818F4BC:\n\
adds r0, r1\n\
adds r0, r4\n\
ldrh r0, [r0]\n\
ldr r2, =gUnknown_0203BC8C\n\
ldr r2, =gFacilityTrainerMons\n\
ldr r1, [r2]\n\
lsls r0, 4\n\
adds r0, r1\n\
@ -1228,8 +1237,347 @@ void sub_818F904(s32 id1, s32 id2, u16 *dst)
u16 temp;
SWAP_16(dst[id1], dst[id2]);
SWAP_16(gSaveBlock2Ptr->frontier.field_D24[id1].unk0, gSaveBlock2Ptr->frontier.field_D24[id2].unk0);
SWAP_16(gSaveBlock2Ptr->frontier.domeTrainers[id1].trainerId, gSaveBlock2Ptr->frontier.domeTrainers[id2].trainerId);
for (i = 0; i < 3; i++)
SWAP_16(gSaveBlock2Ptr->frontier.field_D64[id1][i], gSaveBlock2Ptr->frontier.field_D64[id2][i]);
SWAP_16(gSaveBlock2Ptr->frontier.domeMonId[id1][i], gSaveBlock2Ptr->frontier.domeMonId[id2][i]);
}
void sub_818F9B0(void)
{
StringCopy(gStringVar1, gRoundsStringTable[gSaveBlock2Ptr->frontier.field_CB2]);
}
void sub_818F9E0(void)
{
StringCopy(gStringVar1, gRoundsStringTable[gSaveBlock2Ptr->frontier.field_CB2]);
sub_8195898(gStringVar2, gTrainerBattleOpponent_A);
}
void sub_818FA20(void)
{
gUnknown_0203CD70 = 0;
gUnknown_0203CD74 = GetMonData(&gPlayerParty[0], MON_DATA_MAX_HP, NULL);
gUnknown_0203CD74 += GetMonData(&gPlayerParty[1], MON_DATA_MAX_HP, NULL);
CalculatePlayerPartyCount();
CreateDomeTrainerMons(TrainerIdToTournamentId(gTrainerBattleOpponent_A));
}
void CreateDomeMon(u8 monPartyId, u16 tournamentTrainerId, u8 tournamentMonId, u32 otId)
{
s32 i;
u8 happiness = 0xFF;
u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // UB: Should be using trainerId instead of tournamentTrainerId. As a result, all Pokemon have ivs of 3.
u8 level = GetFrontierEnemyMonLevel();
CreateMonWithEVSpreadPersonalityOTID(&gEnemyParty[monPartyId],
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].species,
level,
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].nature,
fixedIv,
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].evSpread, otId);
happiness = 0xFF;
for (i = 0; i < 4; i++)
{
SetMonMoveSlot(&gEnemyParty[monPartyId],
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i], i);
if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i] == MOVE_FRUSTRATION)
happiness = 0;
}
SetMonData(&gEnemyParty[monPartyId], MON_DATA_FRIENDSHIP, &happiness);
SetMonData(&gEnemyParty[monPartyId], MON_DATA_HELD_ITEM,
&gBattleFrontierHeldItems[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].itemTableId]);
}
void CreateDomeTrainerMons(u16 tournamentTrainerId)
{
u8 monsCount = 0;
u32 otId = 0;
s32 i, bits;
ZeroEnemyPartyMons();
bits = sub_818FC78(tournamentTrainerId);
otId = Random32();
if (Random() % 10 > 5)
{
for (i = 0; i < 3; i++)
{
if (bits & 1)
{
CreateDomeMon(monsCount, tournamentTrainerId, i, otId);
monsCount++;
}
bits >>= 1;
}
}
else
{
for (i = 2; i >= 0; i--)
{
if (bits & 4)
{
CreateDomeMon(monsCount, tournamentTrainerId, i, otId);
monsCount++;
}
bits <<= 1;
}
}
}
s32 sub_818FC78(u16 tournamentTrainerId)
{
s32 bits;
if (Random() & 1)
{
bits = sub_818FCBC(tournamentTrainerId, FALSE);
if (bits == 0)
bits = sub_818FDB8(tournamentTrainerId, TRUE);
}
else
{
bits = sub_818FDB8(tournamentTrainerId, FALSE);
if (bits == 0)
bits = sub_818FCBC(tournamentTrainerId, TRUE);
}
return bits;
}
s32 sub_818FCBC(u16 tournamentTrainerId, bool8 arg1)
{
s32 i, moveId, playerMonId;
s32 array[3];
for (i = 0; i < 3; i++)
{
array[i] = 0;
for (moveId = 0; moveId < 4; moveId++)
{
for (playerMonId = 0; playerMonId < 3; playerMonId++)
{
if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
{
array[i] += sub_818FFC0(sub_81A5060(i, moveId),
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0);
}
else
{
array[i] += sub_818FFC0(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId],
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0);
}
}
}
}
return sub_818FEB4(array, arg1);
}
s32 sub_818FDB8(u16 tournamentTrainerId, bool8 arg1)
{
s32 i, moveId, playerMonId;
s32 array[3];
for (i = 0; i < 3; i++)
{
array[i] = 0;
for (moveId = 0; moveId < 4; moveId++)
{
for (playerMonId = 0; playerMonId < 3; playerMonId++)
{
if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
{
array[i] += sub_818FFC0(sub_81A5060(i, moveId),
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1);
}
else
{
array[i] += sub_818FFC0(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId],
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1);
}
}
}
}
return sub_818FEB4(array, arg1);
}
s32 sub_818FEB4(s32 *arr, bool8 arg1)
{
s32 i, j;
s32 bits = 0;
s32 array[3];
for (i = 0; i < 3; i++)
array[i] = i;
if (arr[0] == arr[1] && arr[0] == arr[2])
{
if (arg1)
{
i = 0;
while (i != 2)
{
u32 rand = Random() & 3;
if (rand != 3 && !(bits & gBitTable[rand]))
{
bits |= gBitTable[rand];
i++;
}
}
}
}
else
{
for (i = 0; i < 2; i++)
{
for (j = i + 1; j < 3; j++)
{
s32 temp;
if (arr[i] < arr[j])
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
if (arr[i] == arr[j] && (Random() & 1))
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp;
temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
}
for (i = 0; i < 2; i++)
{
bits |= gBitTable[array[i]];
}
}
return bits;
}
/*
s32 sub_818FFC0(s32 move, s32 species, s32 arg2)
{
u8 type1, type2, ability, moveType;
s32 i = 0;
s32 typePower = 20;
if (move == MOVE_NONE || move == 0xFFFF || gBattleMoves[move].power == 0)
return 0;
type1 = gBaseStats[species].type1;
type2 = gBaseStats[species].type2;
ability = gBaseStats[species].ability1;
moveType = gBattleMoves[move].type;
if (ability == ABILITY_LEVITATE && moveType == TYPE_GROUND)
{
if (arg2 == 1)
typePower = 8;
}
else
{
while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE)
{
if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT)
{
i += 3;
continue;
}
else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
{
// BUG: * 2 is not necessary and makes the condition always false if the ability is wonder guard.
if (TYPE_EFFECT_DEF_TYPE(i) == type1 && (ability != ABILITY_WONDER_GUARD || TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE * 2))
typePower = (TYPE_EFFECT_MULTIPLIER(i) * typePower) / 10;
if (TYPE_EFFECT_DEF_TYPE(i) == type2 && type1 != type2 && (ability != ABILITY_WONDER_GUARD || TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE * 2))
typePower = (TYPE_EFFECT_MULTIPLIER(i) * typePower) / 10;
}
i += 3;
}
}
switch (arg2)
{
case 0:
switch (typePower)
{
case 10:
case 5:
case 0:
default:
typePower = 0;
break;
case 20:
typePower = 2;
break;
case 40:
typePower = 4;
break;
case 80:
typePower = 8;
break;
}
break;
case 1:
switch (typePower)
{
default:
case 20:
typePower = 0;
break;
case 5:
typePower = 4;
break;
case 0:
typePower = 8;
break;
case 10:
typePower = 2;
break;
case 40:
typePower = -2;
break;
case 80:
typePower = -4;
break;
}
break;
case 2:
switch (typePower)
{
case 0:
typePower = -16;
break;
case 5:
typePower = -8;
break;
case 10:
default:
typePower = 0;
break;
case 20:
typePower = 4;
break;
case 40:
typePower = 12;
break;
case 80:
typePower = 20;
break;
}
break;
}
return typePower;
}*/

View File

@ -1248,7 +1248,7 @@ static const u8 sText_Round2[] = _("Round 2");
static const u8 sText_Semifinal[] = _("Semifinal");
static const u8 sText_Final[] = _("Final");
const u8 * const gRoundsStringTable[] =
const u8 *const gRoundsStringTable[] =
{
sText_Round1,
sText_Round2,

View File

@ -615,7 +615,7 @@ gUnknown_0203ABB8: @ 203ABB8
gUnknown_0203BC88: @ 203BC88
.space 0x4
gUnknown_0203BC8C: @ 203BC8C
gFacilityTrainerMons: @ 203BC8C
.space 0x4
.include "src/use_pokeblock.o"