summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-09-01 16:20:09 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-09-01 16:20:09 -0400
commit95e2d6975c0fc3579a9fffd8e20399d1dc408d62 (patch)
treeb859a0d34576c607060890775c587503bc6fa010
parent9f78a9adb195635f0e6fd76141cbf51e65114629 (diff)
Rename routines in pokemon.c
-rw-r--r--arm9/asm/scrcmd_12.s2
-rw-r--r--arm9/asm/unk_0202BE98.s4
-rw-r--r--arm9/asm/unk_020377F0.s2
-rw-r--r--arm9/asm/unk_020476CC.s4
-rw-r--r--arm9/asm/unk_0204B0A0.s2
-rw-r--r--arm9/asm/unk_0206C700.s4
-rw-r--r--arm9/asm/unk_0206F3FC.s4
-rw-r--r--arm9/asm/unk_02073DA8.s6
-rw-r--r--arm9/asm/unk_02079C70.s10
-rw-r--r--arm9/asm/unk_0207D5BC.s2
-rw-r--r--arm9/asm/unk_0207FD00.s12
-rw-r--r--arm9/asm/unk_02080C38.s2
-rw-r--r--arm9/global.inc36
-rw-r--r--arm9/modules/05/asm/module_05.s10
-rw-r--r--arm9/modules/06/asm/module_06.s6
-rw-r--r--arm9/modules/11/asm/module_11_thumb2.s52
-rw-r--r--arm9/modules/14/asm/module_14.s8
-rw-r--r--arm9/modules/23/asm/module_23.s2
-rw-r--r--arm9/modules/62/asm/module_62.s4
-rw-r--r--arm9/modules/71/asm/module_71.s14
-rw-r--r--arm9/modules/80/asm/module_80.s12
-rw-r--r--arm9/src/pokemon.c199
-rw-r--r--include/pokemon.h34
-rw-r--r--include/seal.h24
24 files changed, 239 insertions, 216 deletions
diff --git a/arm9/asm/scrcmd_12.s b/arm9/asm/scrcmd_12.s
index 137140a8..a434a5cb 100644
--- a/arm9/asm/scrcmd_12.s
+++ b/arm9/asm/scrcmd_12.s
@@ -625,7 +625,7 @@ _020431D4:
add r7, r0, #0x0
add r0, r4, #0x0
add r1, r7, #0x0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add r0, r7, #0x0
mov r1, #0x90
add r2, r5, #0x0
diff --git a/arm9/asm/unk_0202BE98.s b/arm9/asm/unk_0202BE98.s
index 2b1b2f16..37bc1c4e 100644
--- a/arm9/asm/unk_0202BE98.s
+++ b/arm9/asm/unk_0202BE98.s
@@ -133,10 +133,10 @@ FUN_0202BF7C: ; 0x0202BF7C
mov r1, #0xec
mul r1, r2
add r1, r3, r1
- ldr r3, _0202BF8C ; =FUN_02069A64
+ ldr r3, _0202BF8C ; =CopyBoxPokemonToPokemon
bx r3
nop
-_0202BF8C: .word FUN_02069A64
+_0202BF8C: .word CopyBoxPokemonToPokemon
thumb_func_start FUN_0202BF90
FUN_0202BF90: ; 0x0202BF90
diff --git a/arm9/asm/unk_020377F0.s b/arm9/asm/unk_020377F0.s
index d0d60821..e7d630f6 100644
--- a/arm9/asm/unk_020377F0.s
+++ b/arm9/asm/unk_020377F0.s
@@ -1687,7 +1687,7 @@ _02038386:
bl GetPartyMonByIndex
add r1, r0, #0x0
ldr r0, [r4, #0x44]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [r4, #0x60]
bl FUN_0206C92C
mov r0, #0x1a
diff --git a/arm9/asm/unk_020476CC.s b/arm9/asm/unk_020476CC.s
index 374ab418..568c4b5d 100644
--- a/arm9/asm/unk_020476CC.s
+++ b/arm9/asm/unk_020476CC.s
@@ -663,7 +663,7 @@ _02047C40:
add r1, r4, #0x0
bl GetPartyMonByIndex
add r1, r5, #0x0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add r0, r5, #0x0
mov r1, #0xa0
mov r2, #0x0
@@ -858,7 +858,7 @@ _02047DEE:
sub r1, r1, #0x1
bl GetPartyMonByIndex
ldr r1, [sp, #0x8]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r1, [sp, #0x8]
add r0, r5, #0x0
mov r2, #0x0
diff --git a/arm9/asm/unk_0204B0A0.s b/arm9/asm/unk_0204B0A0.s
index f2e46ab6..a78c13d0 100644
--- a/arm9/asm/unk_0204B0A0.s
+++ b/arm9/asm/unk_0204B0A0.s
@@ -149,7 +149,7 @@ FUN_0204B1DC: ; 0x0204B1DC
ldr r0, [r5, #0xc]
bl SavArray_PlayerParty_get
add r1, r4, #0x0
- bl FUN_02069D50
+ bl Party_UpdatePokerus
ldr r0, [r5, #0xc]
bl SavArray_Flags_get
add r6, r0, #0x0
diff --git a/arm9/asm/unk_0206C700.s b/arm9/asm/unk_0206C700.s
index c42b766a..f5a0873e 100644
--- a/arm9/asm/unk_0206C700.s
+++ b/arm9/asm/unk_0206C700.s
@@ -2096,7 +2096,7 @@ _0206D86E:
add r5, r0, #0x0
ldr r0, [r4, #0x28]
add r1, r5, #0x0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
mov r0, #0x49
lsl r0, r0, #0x2
str r0, [sp, #0x0]
@@ -2576,7 +2576,7 @@ FUN_0206DC80: ; 0x0206DC80
add r5, r0, #0x0
ldr r0, [r4, #0x28]
add r1, r5, #0x0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add r2, r4, #0x0
add r0, r5, #0x0
mov r1, #0x5
diff --git a/arm9/asm/unk_0206F3FC.s b/arm9/asm/unk_0206F3FC.s
index db3328a4..212030cc 100644
--- a/arm9/asm/unk_0206F3FC.s
+++ b/arm9/asm/unk_0206F3FC.s
@@ -5672,7 +5672,7 @@ FUN_02072080: ; 0x02072080
add r2, sp, #0x0
bl SetMonData
add r0, r5, #0x0
- bl FUN_02069EC4
+ bl Pokemon_UpdateArceusForme
ldr r1, _020720D8 ; =0x00000B25
ldr r0, _020720D4 ; =0x000005A4
ldrb r3, [r4, r1]
@@ -5715,7 +5715,7 @@ FUN_020720E0: ; 0x020720E0
add r2, sp, #0x1c
bl SetMonData
add r0, r5, #0x0
- bl FUN_02069EC4
+ bl Pokemon_UpdateArceusForme
ldr r1, _02072138 ; =0x00000B25
mov r2, #0x2c
ldrb r3, [r4, r1]
diff --git a/arm9/asm/unk_02073DA8.s b/arm9/asm/unk_02073DA8.s
index 8b8442a3..6635b399 100644
--- a/arm9/asm/unk_02073DA8.s
+++ b/arm9/asm/unk_02073DA8.s
@@ -246,7 +246,7 @@ _02073F66:
add r2, sp, #0x0
bl SetMonData
add r0, r6, #0x0
- bl FUN_02069EC4
+ bl Pokemon_UpdateArceusForme
ldr r2, _02074058 ; =0x0000069C
mov r1, #0x52
ldr r0, [r5, r2]
@@ -633,7 +633,7 @@ FUN_020742A8: ; 0x020742A8
add r2, sp, #0x0
bl SetMonData
add r0, r5, #0x0
- bl FUN_02069EC4
+ bl Pokemon_UpdateArceusForme
ldr r1, _02074330 ; =0x00000B25
mov r2, #0x2c
ldrb r3, [r4, r1]
@@ -790,7 +790,7 @@ FUN_02074428: ; 0x02074428
ldrb r1, [r4, r1]
ldr r0, [r0, #0x0]
bl GetPartyMonByIndex
- bl FUN_0206AA84
+ bl Pokemon_RemoveCapsule
ldr r0, _0207444C ; =0x000005A4
mov r1, #0x0
ldr r0, [r4, r0]
diff --git a/arm9/asm/unk_02079C70.s b/arm9/asm/unk_02079C70.s
index c701f1a8..33c0a040 100644
--- a/arm9/asm/unk_02079C70.s
+++ b/arm9/asm/unk_02079C70.s
@@ -1536,7 +1536,7 @@ _0207A896:
add r4, r0, #0x0
add r0, r6, #0x0
add r1, r4, #0x0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
b _0207A8C0
_0207A8BA:
bl FUN_0207B628
@@ -1825,7 +1825,7 @@ FUN_0207AAE0: ; 0x0207AAE0
add r4, r0, #0x0
add r0, r6, #0x0
add r1, r4, #0x0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
add r0, r5, #0x0
add r1, r4, #0x0
add r2, r7, #0x0
@@ -2163,7 +2163,7 @@ _0207AD26:
_0207ADE0:
add r0, r6, #0x0
add r1, r4, #0x0
- bl FUN_02069BC8
+ bl MonGetFlavorPreference
cmp r0, #0x1
bne _0207ADF4
add r0, r5, #0x0
@@ -2202,7 +2202,7 @@ _0207ADFE:
orr r0, r2
str r0, [r5, #0x50]
add r0, r6, #0x0
- bl FUN_02069E94
+ bl Pokemon_IsImmuneToPokerus
cmp r0, #0x1
bne _0207AE4E
ldr r1, [r5, #0x50]
@@ -2215,7 +2215,7 @@ _0207ADFE:
b _0207AE84
_0207AE4E:
add r0, r6, #0x0
- bl FUN_02069E74
+ bl Pokemon_HasPokerus
cmp r0, #0x1
bne _0207AE7C
ldr r2, [r5, #0x50]
diff --git a/arm9/asm/unk_0207D5BC.s b/arm9/asm/unk_0207D5BC.s
index ca5fef37..2546b905 100644
--- a/arm9/asm/unk_0207D5BC.s
+++ b/arm9/asm/unk_0207D5BC.s
@@ -1540,7 +1540,7 @@ FUN_0207E190: ; 0x0207E190
add r4, r0, #0x0
add r0, r6, #0x0
add r1, r4, #0x0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
mov r0, #0x91
lsl r0, r0, #0x2
ldr r0, [r5, r0]
diff --git a/arm9/asm/unk_0207FD00.s b/arm9/asm/unk_0207FD00.s
index 294b8bfc..e48ad6f9 100644
--- a/arm9/asm/unk_0207FD00.s
+++ b/arm9/asm/unk_0207FD00.s
@@ -5,14 +5,14 @@
.global UNK_020FBB48
UNK_020FBB48: ; 0x020FBB48
- .byte 0x46, 0x00, 0x41, 0x00, 0x42, 0x00, 0x43, 0x00, 0x44, 0x00, 0x45, 0x00
+ .short 0x0046, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045
.global UNK_020FBB54
UNK_020FBB54: ; 0x020FBB54
- .byte 0x47, 0x00, 0x48, 0x00, 0x49, 0x00, 0x4A, 0x00, 0x4B, 0x00, 0x4C, 0x00, 0x4D, 0x00, 0x4E, 0x00
- .byte 0x4F, 0x00, 0x50, 0x00, 0x51, 0x00, 0x52, 0x00, 0x53, 0x00, 0x54, 0x00, 0x55, 0x00, 0x56, 0x00
- .byte 0x57, 0x00, 0x58, 0x00, 0x59, 0x00, 0x5A, 0x00, 0x5B, 0x00, 0x5C, 0x00, 0x5D, 0x00, 0x5E, 0x00
- .byte 0x5F, 0x00, 0x60, 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x64, 0x00
+ .short 0x0047, 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E
+ .short 0x004F, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056
+ .short 0x0057, 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E
+ .short 0x005F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064
.text
@@ -1171,7 +1171,7 @@ FUN_02080678: ; 0x02080678
_0208068A:
ldr r0, [r5, #0xc]
add r1, r4, #0x0
- bl FUN_02069BC8
+ bl MonGetFlavorPreference
cmp r0, #0x1
bne _02080698
add r6, r4, #0x1
diff --git a/arm9/asm/unk_02080C38.s b/arm9/asm/unk_02080C38.s
index 458d4420..0f1630ed 100644
--- a/arm9/asm/unk_02080C38.s
+++ b/arm9/asm/unk_02080C38.s
@@ -930,7 +930,7 @@ _02081304:
bl FUN_02029F9C
ldr r0, [r6, #0x8]
ldr r1, [r4, #0x0]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
mov r0, #0x8
mov r1, #0x14
bl String_ctor
diff --git a/arm9/global.inc b/arm9/global.inc
index 2f9c965b..fa50aacb 100644
--- a/arm9/global.inc
+++ b/arm9/global.inc
@@ -4797,24 +4797,24 @@
.extern FUN_020698E0
.extern FUN_020698E8
.extern FUN_020699A4
-.extern FUN_02069A64
-.extern FUN_02069AEC
+.extern CopyBoxPokemonToPokemon
+.extern Party_GetMaxLevel
.extern SpeciesToSinnohDexNo
-.extern FUN_02069B60
-.extern FUN_02069B88
-.extern FUN_02069BA0
-.extern FUN_02069BB4
-.extern FUN_02069BC8
-.extern FUN_02069BE4
-.extern FUN_02069BFC
-.extern FUN_02069C4C
-.extern FUN_02069CF4
-.extern FUN_02069D50
-.extern FUN_02069DC8
-.extern FUN_02069E74
-.extern FUN_02069E94
-.extern FUN_02069EC4
-.extern FUN_02069ECC
+.extern SinnohDexNoToSpecies
+.extern CopyPokemonToPokemon
+.extern CopyPokemonToBoxPokemon
+.extern CopyBoxPokemonToBoxPokemon
+.extern MonGetFlavorPreference
+.extern GetFlavorPreferenceFromPID
+.extern Species_LoadLearnsetTable
+.extern Party_GivePokerusAtRandom
+.extern Party_MaskMonsWithPokerus
+.extern Party_UpdatePokerus
+.extern Party_SpreadPokerus
+.extern Pokemon_HasPokerus
+.extern Pokemon_IsImmuneToPokerus
+.extern Pokemon_UpdateArceusForme
+.extern BoxMon_UpdateArceusForme
.extern GetArceusTypeByHeldItemEffect
.extern LoadWotbl_HandleAlternateForme
.extern FUN_02069FB0
@@ -4831,7 +4831,7 @@
.extern FUN_0206A998
.extern FUN_0206A9AC
.extern FUN_0206AA30
-.extern FUN_0206AA84
+.extern Pokemon_RemoveCapsule
.extern RestoreBoxMonPP
.extern LoadAllWazaTbl
.extern GetWazaAttr
diff --git a/arm9/modules/05/asm/module_05.s b/arm9/modules/05/asm/module_05.s
index f9672ea0..b665a9b3 100644
--- a/arm9/modules/05/asm/module_05.s
+++ b/arm9/modules/05/asm/module_05.s
@@ -14436,7 +14436,7 @@ MOD05_021EC4F0: ; 0x021EC4F0
_021EC544:
ldr r1, [sp, #4]
add r0, r4, #0
- bl FUN_02069BB4
+ bl CopyBoxPokemonToBoxPokemon
add r0, r5, #0
mov r1, #0
bl DayCareMon_SetSteps
@@ -14599,7 +14599,7 @@ MOD05_021EC668: ; 0x021EC668
lsr r7, r0, #0x10
add r0, r5, #0
add r1, r4, #0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
add r0, r4, #0
mov r1, #0xa0
mov r2, #0
@@ -14680,7 +14680,7 @@ MOD05_021EC744: ; 0x021EC744
add r4, r0, #0
add r0, r6, #0
add r1, r4, #0
- bl FUN_02069BA0
+ bl CopyPokemonToBoxPokemon
add r0, r4, #0
mov r1, #8
mov r2, #0
@@ -15240,7 +15240,7 @@ MOD05_021ECB6C: ; 0x021ECB6C
ldr r0, [sp, #0x18]
ldr r1, [sp, #0xc]
add r2, #0x30
- bl FUN_02069BFC
+ bl Species_LoadLearnsetTable
lsl r0, r0, #0x10
lsr r0, r0, #0x10
str r0, [sp, #0x14]
@@ -16911,7 +16911,7 @@ _021ED7CE:
bl SetMonData
add r0, r6, #0
add r1, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [sp, #0x10]
bl String_dtor
add r0, r6, #0
diff --git a/arm9/modules/06/asm/module_06.s b/arm9/modules/06/asm/module_06.s
index f20313a9..02bc8f52 100644
--- a/arm9/modules/06/asm/module_06.s
+++ b/arm9/modules/06/asm/module_06.s
@@ -22218,7 +22218,7 @@ _022445A6:
ldr r0, [sp, #4]
bl GetPartyMonByIndex
add r1, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add r0, r4, #0
mov r1, #0xa0
mov r2, #0
@@ -31096,10 +31096,10 @@ MOD06_0224891C: ; 0x0224891C
bl CreateInGameTradeMon
ldr r1, [sp, #0x20]
add r0, r7, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [r5, #4]
ldr r1, [sp, #0x24]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [sp, #0x20]
bl FUN_020690E4
str r0, [r4]
diff --git a/arm9/modules/11/asm/module_11_thumb2.s b/arm9/modules/11/asm/module_11_thumb2.s
index 0c87c27f..6b184294 100644
--- a/arm9/modules/11/asm/module_11_thumb2.s
+++ b/arm9/modules/11/asm/module_11_thumb2.s
@@ -4694,7 +4694,7 @@ MOD11_0223158C: ; 0x0223158C
lsl r0, r0, #0x18
lsr r4, r0, #0x18
add r0, r5, #0
- bl FUN_02069AEC
+ bl Party_GetMaxLevel
ldr r1, _022315BC ; =MOD11_0225DC1C
lsl r0, r0, #2
ldrb r1, [r1, r4]
@@ -24749,7 +24749,7 @@ _0223B414:
lsl r1, r1, #0x18
ldr r0, [sp]
lsr r1, r1, #0x18
- bl FUN_02069CF4
+ bl Party_MaskMonsWithPokerus
cmp r0, #0
beq _0223B42E
lsl r0, r4, #0x11
@@ -38100,9 +38100,9 @@ MOD11_02241CF0: ; 0x02241CF0
mov r1, #0
bl MOD11_0222FF88
add r6, r0, #0
- bl FUN_02069C4C
+ bl Party_GivePokerusAtRandom
add r0, r6, #0
- bl FUN_02069DC8
+ bl Party_SpreadPokerus
_02241D16:
cmp r4, #0
beq _02241D20
@@ -52971,7 +52971,7 @@ _02248E3A:
str r1, [r4, r0]
ldr r0, _02248F68 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -53002,7 +53002,7 @@ _02248E76:
str r1, [r4, r0]
ldr r0, _02248F68 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -53033,7 +53033,7 @@ _02248EB2:
str r1, [r4, r0]
ldr r0, _02248F68 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -53067,7 +53067,7 @@ _02248EFC:
str r1, [r4, r0]
ldr r0, _02248F68 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -53108,7 +53108,7 @@ _02248F64: .word 0x00002DB0
_02248F68: .word 0x00002DA8
_02248F6C:
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -54103,7 +54103,7 @@ _02249708: .word 0x00002DCC
_0224970C: .word 0x00002DA8
_02249710:
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -54135,7 +54135,7 @@ _0224972C:
str r1, [r4, r0]
ldr r0, _02249A5C ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -54167,7 +54167,7 @@ _0224976A:
str r1, [r4, r0]
ldr r0, _02249A5C ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -54199,7 +54199,7 @@ _022497A8:
str r1, [r4, r0]
ldr r0, _02249A5C ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -54234,7 +54234,7 @@ _022497F4:
str r1, [r4, r0]
ldr r0, _02249A5C ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
mov r1, #0
mvn r1, r1
cmp r0, r1
@@ -55536,7 +55536,7 @@ _0224A1B6:
add r2, r4, r0
ldr r0, _0224A344 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r6, #1
cmp r0, r1
bne _0224A1F6
@@ -55572,7 +55572,7 @@ _0224A1FC:
add r2, r4, r0
ldr r0, _0224A344 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r6, #1
cmp r0, r1
bne _0224A23C
@@ -55608,7 +55608,7 @@ _0224A242:
add r2, r4, r0
ldr r0, _0224A344 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r6, #1
cmp r0, r1
bne _0224A282
@@ -55644,7 +55644,7 @@ _0224A288:
add r2, r4, r0
ldr r0, _0224A344 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r6, #1
cmp r0, r1
bne _0224A2C8
@@ -55680,7 +55680,7 @@ _0224A2CE:
add r2, r4, r0
ldr r0, _0224A344 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r6, #1
cmp r0, r1
bne _0224A30E
@@ -56300,7 +56300,7 @@ _0224A77A:
add r2, r4, r0
ldr r0, _0224A874 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r5, #1
cmp r0, r1
ldr r0, _0224A850 ; =0x00003118
@@ -56333,7 +56333,7 @@ _0224A7BC:
add r2, r4, r0
ldr r0, _0224A874 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r5, #1
cmp r0, r1
ldr r0, _0224A850 ; =0x00003118
@@ -56366,7 +56366,7 @@ _0224A7FE:
add r2, r4, r0
ldr r0, _0224A874 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r5, #1
cmp r0, r1
ldr r0, _0224A850 ; =0x00003118
@@ -56413,7 +56413,7 @@ _0224A878:
add r2, r4, r0
ldr r0, _0224AB18 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r5, #1
cmp r0, r1
ldr r0, _0224AB1C ; =0x00003118
@@ -56446,7 +56446,7 @@ _0224A8B0:
add r2, r4, r0
ldr r0, _0224AB18 ; =0x00002DA8
ldr r0, [r2, r0]
- bl FUN_02069BE4
+ bl GetFlavorPreferenceFromPID
sub r1, r5, #1
cmp r0, r1
ldr r0, _0224AB1C ; =0x00003118
@@ -71782,7 +71782,7 @@ _022521DC:
bl GetPartyMonByIndex
add r1, r0, #0
ldr r0, [sp, #0x1c]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [r4, #4]
ldrb r1, [r5, #0x1c]
add r0, r0, r6
@@ -71822,7 +71822,7 @@ _02252232:
bl GetPartyMonByIndex
add r1, r0, #0
ldr r0, [sp, #0x20]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [r4, #4]
ldrb r1, [r5, #0x1c]
add r0, r0, r7
diff --git a/arm9/modules/14/asm/module_14.s b/arm9/modules/14/asm/module_14.s
index 7b1720cb..53969b45 100644
--- a/arm9/modules/14/asm/module_14.s
+++ b/arm9/modules/14/asm/module_14.s
@@ -8885,7 +8885,7 @@ _021DBC56:
lsl r1, r1, #4
ldr r0, [r4]
ldr r1, [r5, r1]
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
mov r1, #0x49
lsl r1, r1, #2
ldr r0, [r5, r1]
@@ -9038,7 +9038,7 @@ _021DBD8E:
lsl r1, r1, #4
ldr r1, [r5, r1]
add r0, r7, r6
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
b _021DBDB0
_021DBDA2:
mov r1, #0x1a
@@ -9367,7 +9367,7 @@ _021DC034:
lsl r1, r1, #4
ldr r0, [sp]
ldr r1, [r5, r1]
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
mov r0, #0x1a
lsl r0, r0, #4
ldr r0, [r5, r0]
@@ -9633,7 +9633,7 @@ _021DC254:
cmp r0, r1
bne _021DC26A
ldr r0, [r4]
- bl FUN_02069ECC
+ bl BoxMon_UpdateArceusForme
_021DC26A:
add sp, #4
pop {r3, r4, r5, r6}
diff --git a/arm9/modules/23/asm/module_23.s b/arm9/modules/23/asm/module_23.s
index f3a4f14c..5550c76b 100644
--- a/arm9/modules/23/asm/module_23.s
+++ b/arm9/modules/23/asm/module_23.s
@@ -1032,7 +1032,7 @@ MOD23_02254F94: ; 0x02254F94
_02254FCE:
lsl r0, r4, #0x10
lsr r0, r0, #0x10
- bl FUN_02069B60
+ bl SinnohDexNoToSpecies
add r4, r0, #0
_02254FD8:
cmp r4, #0
diff --git a/arm9/modules/62/asm/module_62.s b/arm9/modules/62/asm/module_62.s
index 79190f60..73025559 100644
--- a/arm9/modules/62/asm/module_62.s
+++ b/arm9/modules/62/asm/module_62.s
@@ -4466,7 +4466,7 @@ MOD62_0222F80C: ; 0x0222F80C
add r1, #0x64
ldr r0, [r0, #4]
ldr r1, [r5, r1]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
pop {r3, r4, r5, r6, r7, pc}
_0222F832:
ldr r1, [r5]
@@ -4487,7 +4487,7 @@ _0222F83E:
ldr r1, _0222F86C ; =0x00000428
add r0, r7, #0
ldr r1, [r5, r1]
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
pop {r3, r4, r5, r6, r7, pc}
_0222F85C:
ldr r1, [r5]
diff --git a/arm9/modules/71/asm/module_71.s b/arm9/modules/71/asm/module_71.s
index 4f418110..b77c8662 100644
--- a/arm9/modules/71/asm/module_71.s
+++ b/arm9/modules/71/asm/module_71.s
@@ -6329,12 +6329,12 @@ MOD71_022309E8: ; 0x022309E8
add r1, r6, #0
bl GetPartyMonByIndex
add r1, r7, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [sp, #8]
ldr r1, [sp, #0xc]
bl GetPartyMonByIndex
add r1, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add r0, r4, #0
mov r1, #0x4c
mov r2, #0
@@ -6359,13 +6359,13 @@ _02230A40:
mov r3, #0
bl FUN_0208089C
add r0, r4, #0
- bl FUN_0206AA84
+ bl Pokemon_RemoveCapsule
ldr r1, [r5, #0x3c]
add r0, r7, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r1, [r5, #0x40]
add r0, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
bl FUN_02031190
mov r1, #1
eor r0, r1
@@ -6390,13 +6390,13 @@ _02230A98:
bl GetPartyMonByIndex
add r1, r0, #0
add r0, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [sp, #8]
ldr r1, [sp, #0xc]
bl GetPartyMonByIndex
add r1, r0, #0
add r0, r7, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
ldr r0, [r5, #0x1c]
add r1, r4, #0
bl MOD71_02230AE4
diff --git a/arm9/modules/80/asm/module_80.s b/arm9/modules/80/asm/module_80.s
index 8e74df8f..667a4ae1 100644
--- a/arm9/modules/80/asm/module_80.s
+++ b/arm9/modules/80/asm/module_80.s
@@ -13583,7 +13583,7 @@ _022342B0:
add r0, #0xbc
ldr r0, [r0]
add r1, r5, #0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
_022342BC:
ldr r0, [r4]
ldr r0, [r0, #0x1c]
@@ -14618,7 +14618,7 @@ MOD80_02234AC0: ; 0x02234AC0
push {r4, lr}
add r4, r0, #0
add r0, #0xd4
- bl FUN_0206AA84
+ bl Pokemon_RemoveCapsule
add r0, r4, #0
add r0, #0xd4
bl MOD80_0222DBC4
@@ -14939,7 +14939,7 @@ MOD80_02234CFC: ; 0x02234CFC
push {r4, lr}
add r4, r0, #0
add r0, #0xd4
- bl FUN_0206AA84
+ bl Pokemon_RemoveCapsule
add r0, r4, #0
add r0, #0xc4
ldr r1, [r0]
@@ -16076,7 +16076,7 @@ MOD80_02235534: ; 0x02235534
ldr r0, [r0, #0xc]
bl PCStorage_GetMonByIndexPair
add r1, r4, #0
- bl FUN_02069A64
+ bl CopyBoxPokemonToPokemon
add r2, r5, #0
ldr r0, [r5]
add r2, #0xb8
@@ -16104,7 +16104,7 @@ _02235590:
ldr r0, [r0, #8]
bl GetPartyMonByIndex
add r4, r0, #0
- bl FUN_0206AA84
+ bl Pokemon_RemoveCapsule
add r2, r5, #0
ldr r0, [r5]
add r2, #0xb8
@@ -17720,7 +17720,7 @@ MOD80_02236218: ; 0x02236218
bl GetPartyMonByIndex
add r1, r0, #0
add r0, r4, #0
- bl FUN_02069B88
+ bl CopyPokemonToPokemon
add sp, #8
pop {r3, r4, r5, pc}
_02236248:
diff --git a/arm9/src/pokemon.c b/arm9/src/pokemon.c
index 7931ba51..7fe8191a 100644
--- a/arm9/src/pokemon.c
+++ b/arm9/src/pokemon.c
@@ -10,7 +10,7 @@
#include "math_util.h"
#include "move_data.h"
#include "string_util.h"
-#include "text.h"
+#include "seal.h"
#include "msgdata.h"
#include "itemtool.h"
#include "constants/abilities.h"
@@ -21,8 +21,6 @@
#pragma thumb on
-extern void FUN_02029C74(const u8 *, u8 *);
-
u32 GetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr);
u32 GetBoxMonDataInternal(struct BoxPokemon * pokemon, int attr, void * ptr);
void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * ptr);
@@ -39,12 +37,12 @@ u32 FUN_020696A8(struct BoxPokemon * boxmon, u16 move);
void FUN_02069718(struct BoxPokemon * boxmon, u16 move);
void BoxMonSetMoveInSlot(struct BoxPokemon * boxmon, u16 move, u8 slot);
void FUN_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2);
-s8 FUN_02069BD0(struct BoxPokemon * boxmon, int flavor);
-s8 FUN_02069BE4(u32 personality, int flavor);
-u8 FUN_02069CF4(struct PlayerParty * party_p, u8 mask);
-BOOL FUN_02069E7C(struct BoxPokemon * boxmon);
-BOOL FUN_02069E9C(struct BoxPokemon * boxmon);
-void FUN_02069ECC(struct BoxPokemon * boxmon);
+s8 BoxMonGetFlavorPreference(struct BoxPokemon * boxmon, int flavor);
+s8 GetFlavorPreferenceFromPID(u32 personality, int flavor);
+u8 Party_MaskMonsWithPokerus(struct PlayerParty * party_p, u8 mask);
+BOOL BoxMon_HasPokerus(struct BoxPokemon * boxmon);
+BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon * boxmon);
+void BoxMon_UpdateArceusForme(struct BoxPokemon * boxmon);
void LoadWotbl_HandleAlternateForme(int species, int forme, u16 * wotbl);
void FUN_0206A054(struct BoxPokemon * boxmon, struct PlayerData * a1, u32 pokeball, u32 a3, u32 encounterType, u32 heap_id);
BOOL MonHasMove(struct Pokemon * pokemon, u16 move);
@@ -118,61 +116,62 @@ const u16 sLegendaryMonsList[] = {
SPECIES_ARCEUS,
};
-const s8 UNK_020F7F16[][5] = {
- // Atk, Def, Spd, SpA, SpD
- { 0, 0, 0, 0, 0},
- { 1, 0, 0, 0, -1},
- { 1, 0, -1, 0, 0},
- { 1, -1, 0, 0, 0},
- { 1, 0, 0, -1, 0},
- { -1, 0, 0, 0, 1},
- { 0, 0, 0, 0, 0},
- { 0, 0, -1, 0, 1},
- { 0, -1, 0, 0, 1},
- { 0, 0, 0, -1, 1},
- { -1, 0, 1, 0, 0},
- { 0, 0, 1, 0, -1},
- { 0, 0, 0, 0, 0},
- { 0, -1, 1, 0, 0},
- { 0, 0, 1, -1, 0},
- { -1, 1, 0, 0, 0},
- { 0, 1, 0, 0, -1},
- { 0, 1, -1, 0, 0},
- { 0, 0, 0, 0, 0},
- { 0, 1, 0, -1, 0},
- { -1, 0, 0, 1, 0},
- { 0, 0, 0, 1, -1},
- { 0, 0, -1, 1, 0},
- { 0, -1, 0, 1, 0},
- { 0, 0, 0, 0, 0},
+const s8 sFlavorPreferencesByNature[][5] = {
+ // Spicy, Dry, Sweet, Bitter, Sour
+ { 0, 0, 0, 0, 0 }, // NATURE_HARDY
+ { 1, 0, 0, 0, -1 }, // NATURE_LONELY
+ { 1, 0, -1, 0, 0 }, // NATURE_BRAVE
+ { 1, -1, 0, 0, 0 }, // NATURE_ADAMANT
+ { 1, 0, 0, -1, 0 }, // NATURE_NAUGHTY
+ { -1, 0, 0, 0, 1 }, // NATURE_BOLD
+ { 0, 0, 0, 0, 0 }, // NATURE_DOCILE
+ { 0, 0, -1, 0, 1 }, // NATURE_RELAXED
+ { 0, -1, 0, 0, 1 }, // NATURE_IMPISH
+ { 0, 0, 0, -1, 1 }, // NATURE_LAX
+ { -1, 0, 1, 0, 0 }, // NATURE_TIMID
+ { 0, 0, 1, 0, -1 }, // NATURE_HASTY
+ { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS
+ { 0, -1, 1, 0, 0 }, // NATURE_JOLLY
+ { 0, 0, 1, -1, 0 }, // NATURE_NAIVE
+ { -1, 1, 0, 0, 0 }, // NATURE_MODEST
+ { 0, 1, 0, 0, -1 }, // NATURE_MILD
+ { 0, 1, -1, 0, 0 }, // NATURE_QUIET
+ { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL
+ { 0, 1, 0, -1, 0 }, // NATURE_RASH
+ { -1, 0, 0, 1, 0 }, // NATURE_CALM
+ { 0, 0, 0, 1, -1 }, // NATURE_GENTLE
+ { 0, 0, -1, 1, 0 }, // NATURE_SASSY
+ { 0, -1, 0, 1, 0 }, // NATURE_CAREFUL
+ { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY
};
const s8 sNatureStatMods[][5] = {
- { 0, 0, 0, 0, 0 },
- { 1, -1, 0, 0, 0 },
- { 1, 0, -1, 0, 0 },
- { 1, 0, 0, -1, 0 },
- { 1, 0, 0, 0, -1 },
- { -1, 1, 0, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { 0, 1, -1, 0, 0 },
- { 0, 1, 0, -1, 0 },
- { 0, 1, 0, 0, -1 },
- { -1, 0, 1, 0, 0 },
- { 0, -1, 1, 0, 0 },
- { 0, 0, 0, 0, 0 },
- { 0, 0, 1, -1, 0 },
- { 0, 0, 1, 0, -1 },
- { -1, 0, 0, 1, 0 },
- { 0, -1, 0, 1, 0 },
- { 0, 0, -1, 1, 0 },
- { 0, 0, 0, 0, 0 },
- { 0, 0, 0, 1, -1 },
- { -1, 0, 0, 0, 1 },
- { 0, -1, 0, 0, 1 },
- { 0, 0, -1, 0, 1 },
- { 0, 0, 0, -1, 1 },
- { 0, 0, 0, 0, 0 },
+ // Atk, Def, Speed, SpAtk, SpDef
+ { 0, 0, 0, 0, 0 }, // NATURE_HARDY
+ { 1, -1, 0, 0, 0 }, // NATURE_LONELY
+ { 1, 0, -1, 0, 0 }, // NATURE_BRAVE
+ { 1, 0, 0, -1, 0 }, // NATURE_ADAMANT
+ { 1, 0, 0, 0, -1 }, // NATURE_NAUGHTY
+ { -1, 1, 0, 0, 0 }, // NATURE_BOLD
+ { 0, 0, 0, 0, 0 }, // NATURE_DOCILE
+ { 0, 1, -1, 0, 0 }, // NATURE_RELAXED
+ { 0, 1, 0, -1, 0 }, // NATURE_IMPISH
+ { 0, 1, 0, 0, -1 }, // NATURE_LAX
+ { -1, 0, 1, 0, 0 }, // NATURE_TIMID
+ { 0, -1, 1, 0, 0 }, // NATURE_HASTY
+ { 0, 0, 0, 0, 0 }, // NATURE_SERIOUS
+ { 0, 0, 1, -1, 0 }, // NATURE_JOLLY
+ { 0, 0, 1, 0, -1 }, // NATURE_NAIVE
+ { -1, 0, 0, 1, 0 }, // NATURE_MODEST
+ { 0, -1, 0, 1, 0 }, // NATURE_MILD
+ { 0, 0, -1, 1, 0 }, // NATURE_QUIET
+ { 0, 0, 0, 0, 0 }, // NATURE_BASHFUL
+ { 0, 0, 0, 1, -1 }, // NATURE_RASH
+ { -1, 0, 0, 0, 1 }, // NATURE_CALM
+ { 0, -1, 0, 0, 1 }, // NATURE_GENTLE
+ { 0, 0, -1, 0, 1 }, // NATURE_SASSY
+ { 0, 0, 0, -1, 1 }, // NATURE_CAREFUL
+ { 0, 0, 0, 0, 0 }, // NATURE_QUIRKY
};
void ZeroMonData(struct Pokemon * pokemon)
@@ -563,10 +562,10 @@ u32 GetMonDataInternal(struct Pokemon * pokemon, int attr, void * dest)
case MON_DATA_SPDEF:
return pokemon->party.spdef;
case MON_DATA_MAIL_STRUCT:
- Mail_copy(&pokemon->party.seal_something, dest);
+ Mail_copy(&pokemon->party.mail, dest);
return 1;
case MON_DATA_SEAL_COORDS:
- FUN_02029C74(pokemon->party.sealCoords, dest);
+ FUN_02029C74(&pokemon->party.sealCoords, dest);
return 1;
default:
return GetBoxMonDataInternal(&pokemon->box, attr, dest);
@@ -1051,10 +1050,10 @@ void SetMonDataInternal(struct Pokemon * pokemon, int attr, void * value)
pokemon->party.spdef = VALUE(u16);
break;
case MON_DATA_MAIL_STRUCT:
- Mail_copy((const struct Mail *)value, &pokemon->party.seal_something);
+ Mail_copy((const struct Mail *)value, &pokemon->party.mail);
break;
case MON_DATA_SEAL_COORDS:
- FUN_02029C74((const u8 *)value, pokemon->party.sealCoords);
+ FUN_02029C74((CapsuleArray *)value, &pokemon->party.sealCoords);
break;
default:
SetBoxMonDataInternal(&pokemon->box, attr, value);
@@ -2990,10 +2989,10 @@ BOOL MonHasMove(struct Pokemon * pokemon, u16 move)
return FALSE;
}
-void FUN_02069A64(struct BoxPokemon * src, struct Pokemon * dest)
+void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest)
{
u32 sp0 = 0;
- u8 sp4[12][2];
+ CapsuleArray sp4;
struct Mail * mail;
dest->box = *src;
if (dest->box.box_lock)
@@ -3005,12 +3004,12 @@ void FUN_02069A64(struct BoxPokemon * src, struct Pokemon * dest)
SetMonData(dest, MON_DATA_MAIL_STRUCT, mail);
FreeToHeap(mail);
SetMonData(dest, MON_DATA_CAPSULE, &sp0);
- MIi_CpuClearFast(0, sp4, sizeof(sp4));
- SetMonData(dest, MON_DATA_SEAL_COORDS, sp4);
+ MIi_CpuClearFast(0, &sp4, sizeof(sp4));
+ SetMonData(dest, MON_DATA_SEAL_COORDS, &sp4);
CalcMonLevelAndStats(dest);
}
-u8 FUN_02069AEC(struct PlayerParty * party)
+u8 Party_GetMaxLevel(struct PlayerParty * party)
{
int i;
int r7 = GetPartyCount(party);
@@ -3037,7 +3036,7 @@ u16 SpeciesToSinnohDexNo(u16 species)
return ret;
}
-u16 FUN_02069B60(u16 sinnoh_dex)
+u16 SinnohDexNoToSpecies(u16 sinnoh_dex)
{
u16 ret = SPECIES_NONE;
if (sinnoh_dex <= SINNOH_DEX_COUNT)
@@ -3045,38 +3044,38 @@ u16 FUN_02069B60(u16 sinnoh_dex)
return ret;
}
-void FUN_02069B88(struct Pokemon * src, struct Pokemon * dest)
+void CopyPokemonToPokemon(struct Pokemon * src, struct Pokemon * dest)
{
*dest = *src;
}
-void FUN_02069BA0(struct Pokemon * src, struct BoxPokemon * dest)
+void CopyPokemonToBoxPokemon(struct Pokemon * src, struct BoxPokemon * dest)
{
*dest = src->box;
}
-void FUN_02069BB4(struct BoxPokemon * src, struct BoxPokemon * dest)
+void CopyBoxPokemonToBoxPokemon(struct BoxPokemon * src, struct BoxPokemon * dest)
{
*dest = *src;
}
-s8 FUN_02069BC8(struct Pokemon * pokemon, int flavor)
+s8 MonGetFlavorPreference(struct Pokemon * pokemon, int flavor)
{
- return FUN_02069BD0(&pokemon->box, flavor);
+ return BoxMonGetFlavorPreference(&pokemon->box, flavor);
}
-s8 FUN_02069BD0(struct BoxPokemon * boxmon, int flavor)
+s8 BoxMonGetFlavorPreference(struct BoxPokemon * boxmon, int flavor)
{
u32 personality = GetBoxMonData(boxmon, MON_DATA_PERSONALITY, NULL);
- return FUN_02069BE4(personality, flavor);
+ return GetFlavorPreferenceFromPID(personality, flavor);
}
-s8 FUN_02069BE4(u32 personality, int flavor)
+s8 GetFlavorPreferenceFromPID(u32 personality, int flavor)
{
- return UNK_020F7F16[GetNatureFromPersonality(personality)][flavor];
+ return sFlavorPreferencesByNature[GetNatureFromPersonality(personality)][flavor];
}
-int FUN_02069BFC(u16 species, u32 forme, u16 * dest)
+int Species_LoadLearnsetTable(u16 species, u32 forme, u16 * dest)
{
int i;
u16 * wotbl = AllocFromHeap(0, 22 * sizeof(u16));
@@ -3089,7 +3088,7 @@ int FUN_02069BFC(u16 species, u32 forme, u16 * dest)
return i;
}
-void FUN_02069C4C(struct PlayerParty * party)
+void Party_GivePokerusAtRandom(struct PlayerParty * party)
{
int count = GetPartyCount(party);
int idx;
@@ -3105,7 +3104,7 @@ void FUN_02069C4C(struct PlayerParty * party)
idx = LCRandom() % count;
pokemon = GetPartyMonByIndex(party, idx);
} while (GetMonData(pokemon, MON_DATA_SPECIES, NULL) == SPECIES_NONE || GetMonData(pokemon, MON_DATA_IS_EGG, NULL));
- if (!FUN_02069CF4(party, (u8)MaskOfFlagNo(idx)))
+ if (!Party_MaskMonsWithPokerus(party, (u8)MaskOfFlagNo(idx)))
{
do
{
@@ -3121,7 +3120,7 @@ void FUN_02069C4C(struct PlayerParty * party)
}
}
-u8 FUN_02069CF4(struct PlayerParty * party, u8 mask)
+u8 Party_MaskMonsWithPokerus(struct PlayerParty * party, u8 mask)
{
int i = 0;
u32 flag = 1;
@@ -3152,7 +3151,7 @@ u8 FUN_02069CF4(struct PlayerParty * party, u8 mask)
return ret;
}
-void FUN_02069D50(struct PlayerParty * party, int r5)
+void Party_UpdatePokerus(struct PlayerParty * party, int r5)
{
int i;
u8 pokerus;
@@ -3178,7 +3177,7 @@ void FUN_02069D50(struct PlayerParty * party, int r5)
}
}
-void FUN_02069DC8(struct PlayerParty * party)
+void Party_SpreadPokerus(struct PlayerParty * party)
{
int count = GetPartyCount(party);
int i;
@@ -3215,22 +3214,22 @@ void FUN_02069DC8(struct PlayerParty * party)
}
}
-BOOL FUN_02069E74(struct Pokemon * pokemon)
+BOOL Pokemon_HasPokerus(struct Pokemon * pokemon)
{
- return FUN_02069E7C(&pokemon->box);
+ return BoxMon_HasPokerus(&pokemon->box);
}
-BOOL FUN_02069E7C(struct BoxPokemon * boxmon)
+BOOL BoxMon_HasPokerus(struct BoxPokemon * boxmon)
{
return !!(GetBoxMonData(boxmon, MON_DATA_POKERUS, NULL) & 0xF);
}
-BOOL FUN_02069E94(struct Pokemon * pokemon)
+BOOL Pokemon_IsImmuneToPokerus(struct Pokemon * pokemon)
{
- return FUN_02069E9C(&pokemon->box);
+ return BoxMon_IsImmuneToPokerus(&pokemon->box);
}
-BOOL FUN_02069E9C(struct BoxPokemon * boxmon)
+BOOL BoxMon_IsImmuneToPokerus(struct BoxPokemon * boxmon)
{
u8 pokerus = (u8)GetBoxMonData(boxmon, MON_DATA_POKERUS, NULL);
if (pokerus & 0xF)
@@ -3240,12 +3239,12 @@ BOOL FUN_02069E9C(struct BoxPokemon * boxmon)
return FALSE;
}
-void FUN_02069EC4(struct Pokemon * pokemon)
+void Pokemon_UpdateArceusForme(struct Pokemon * pokemon)
{
- FUN_02069ECC(&pokemon->box);
+ BoxMon_UpdateArceusForme(&pokemon->box);
}
-void FUN_02069ECC(struct BoxPokemon * boxmon)
+void BoxMon_UpdateArceusForme(struct BoxPokemon * boxmon)
{
u32 species = GetBoxMonData(boxmon, MON_DATA_SPECIES, NULL);
u32 ability = GetBoxMonData(boxmon, MON_DATA_ABILITY, NULL);
@@ -3460,7 +3459,7 @@ void FUN_0206A23C(struct Pokemon * r5, u32 personality)
struct Pokemon * sp4;
sp4 = AllocMonZeroed(0);
- FUN_02069B88(r5, sp4);
+ CopyPokemonToPokemon(r5, sp4);
r4 = &GetSubstruct(&sp4->box, r5->box.pid, 0)->blockA;
r6 = &GetSubstruct(&sp4->box, r5->box.pid, 1)->blockB;
r7 = &GetSubstruct(&sp4->box, r5->box.pid, 2)->blockC;
@@ -3721,13 +3720,13 @@ int FUN_0206AA30(int x)
}
}
-void FUN_0206AA84(struct Pokemon * pokemon)
+void Pokemon_RemoveCapsule(struct Pokemon * pokemon)
{
u8 sp0 = 0;
- u8 sp1[12][2];
- MIi_CpuClearFast(0, sp1, sizeof(sp1));
+ CapsuleArray sp1;
+ MIi_CpuClearFast(0, &sp1, sizeof(sp1));
SetMonData(pokemon, MON_DATA_CAPSULE, &sp0);
- SetMonData(pokemon, MON_DATA_SEAL_COORDS, sp1);
+ SetMonData(pokemon, MON_DATA_SEAL_COORDS, &sp1);
}
void RestoreBoxMonPP(struct BoxPokemon * boxmon)
diff --git a/include/pokemon.h b/include/pokemon.h
index a089652d..d107bf85 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -142,8 +142,8 @@ struct PartyPokemon
/* 0x096 */ u16 speed;
/* 0x098 */ u16 spatk;
/* 0x09A */ u16 spdef;
- /* 0x09C */ struct Mail seal_something; // a struct?
- /* 0x0D4 */ u8 sealCoords[0x18]; // u8 pairs?
+ /* 0x09C */ struct Mail mail;
+ /* 0x0D4 */ u8 sealCoords[8][3]; // seal coords
};
struct Pokemon {
@@ -279,21 +279,21 @@ u32 FUN_02069818(struct Pokemon * pokemon, u32 * r5, u16 * sp0);
void FUN_020698E0(struct Pokemon * pokemon, int slot1, int slot2);
void FUN_020698E8(struct BoxPokemon * boxmon, int slot1, int slot2);
void FUN_020699A4(struct Pokemon * pokemon, u32 slot);
-void FUN_02069A64(struct BoxPokemon * src, struct Pokemon * dest);
-u8 FUN_02069AEC(struct PlayerParty * party);
+void CopyBoxPokemonToPokemon(struct BoxPokemon * src, struct Pokemon * dest);
+u8 Party_GetMaxLevel(struct PlayerParty * party);
u16 SpeciesToSinnohDexNo(u16 species);
-u16 FUN_02069B60(u16 sinnoh_dex);
-void FUN_02069B88(struct Pokemon * src, struct Pokemon * dest);
-void FUN_02069BA0(struct Pokemon * src, struct BoxPokemon * dest);
-void FUN_02069BB4(struct BoxPokemon * src, struct BoxPokemon * dest);
-s8 FUN_02069BC8(struct Pokemon * pokemon, int flavor);
-int FUN_02069BFC(u16 species, u32 forme, u16 * dest);
-void FUN_02069C4C(struct PlayerParty * party);
-void FUN_02069D50(struct PlayerParty * party, int r5);
-void FUN_02069DC8(struct PlayerParty * party);
-BOOL FUN_02069E74(struct Pokemon * pokemon);
-BOOL FUN_02069E94(struct Pokemon * pokemon);
-void FUN_02069EC4(struct Pokemon * pokemon);
+u16 SinnohDexNoToSpecies(u16 sinnoh_dex);
+void CopyPokemonToPokemon(struct Pokemon * src, struct Pokemon * dest);
+void CopyPokemonToBoxPokemon(struct Pokemon * src, struct BoxPokemon * dest);
+void CopyBoxPokemonToBoxPokemon(struct BoxPokemon * src, struct BoxPokemon * dest);
+s8 MonGetFlavorPreference(struct Pokemon * pokemon, int flavor);
+int Species_LoadLearnsetTable(u16 species, u32 forme, u16 * dest);
+void Party_GivePokerusAtRandom(struct PlayerParty * party);
+void Party_UpdatePokerus(struct PlayerParty * party, int r5);
+void Party_SpreadPokerus(struct PlayerParty * party);
+BOOL Pokemon_HasPokerus(struct Pokemon * pokemon);
+BOOL Pokemon_IsImmuneToPokerus(struct Pokemon * pokemon);
+void Pokemon_UpdateArceusForme(struct Pokemon * pokemon);
void FUN_02069FB0(u32 r7, u32 r5, u32 r4, u32 r6, u32 sp18, u32 sp1C, u32 sp20);
void FUN_0206A014(struct Pokemon * pokemon, struct PlayerData * a1, u32 pokeball, u32 a3, u32 encounterType, u32 heap_id);
void FUN_0206A094(struct Pokemon * pokemon, u32 a1, u32 a2);
@@ -305,7 +305,7 @@ BOOL IsPokemonLegendaryOrMythical(u16 species);
u16 GetLegendaryMon(u32 idx);
BOOL FUN_0206A998(struct Pokemon * pokemon);
BOOL FUN_0206A9AC(struct BoxPokemon * boxmon, struct PlayerData * sb2, u32 heap_id);
-void FUN_0206AA84(struct Pokemon * pokemon);
+void Pokemon_RemoveCapsule(struct Pokemon * pokemon);
void RestoreBoxMonPP(struct BoxPokemon * boxmon);
#endif //POKEDIAMOND_POKEMON_H
diff --git a/include/seal.h b/include/seal.h
new file mode 100644
index 00000000..9e31e2e4
--- /dev/null
+++ b/include/seal.h
@@ -0,0 +1,24 @@
+#ifndef POKEDIAMOND_SEAL_H
+#define POKEDIAMOND_SEAL_H
+
+typedef u8 Coords8[3];
+typedef Coords8 CapsuleArray[8];
+
+struct SealCase
+{
+ CapsuleArray coords[12];
+ u8 padding_120[0x50];
+};
+
+u32 FUN_02029C58(void);
+void FUN_02029C60(struct SealCase * sealCase);
+void FUN_02029C74(const CapsuleArray * a0, CapsuleArray * a1);
+struct SealCase * FUN_02029C80(struct SaveBlock2 * sav2);
+CapsuleArray * FUN_02029C8C(struct SealCase * sealCase, s32 idx);
+void FUN_02029CA4(struct SealCase * sealCase, const CapsuleArray * src, s32 idx);
+Coords8 * FUN_02029CC8(CapsuleArray * a0, s32 a1);
+u8 FUN_02029CE0(Coords8 * a0);
+u8 FUN_02029CE4(Coords8 * a0);
+u8 FUN_02029CE8(Coords8 * a0);
+
+#endif //POKEDIAMOND_SEAL_H