mirror of
https://github.com/pret/pokediamond.git
synced 2026-04-26 00:11:26 -05:00
(Box)Pokemon_(Unl/L)ockEncryption -> (Box)Pokemon_(De/En)cryptData
This commit is contained in:
parent
f6ee64f854
commit
f723555ad9
|
|
@ -1843,7 +1843,7 @@ sub_0207AB0C: ; 0x0207AB0C
|
|||
add r7, r0, #0x0
|
||||
add r0, r6, #0x0
|
||||
add r5, r2, #0x0
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
str r0, [sp, #0x4]
|
||||
add r0, r6, #0x0
|
||||
mov r1, #0x5
|
||||
|
|
@ -2308,7 +2308,7 @@ _0207AF04:
|
|||
blo _0207AECC
|
||||
ldr r1, [sp, #0x4]
|
||||
add r0, r6, #0x0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
add sp, #0x8
|
||||
pop {r3-r7, pc}
|
||||
nop
|
||||
|
|
|
|||
|
|
@ -4730,10 +4730,10 @@
|
|||
.extern BoxPokemon_Init
|
||||
.extern Pokemon_Size
|
||||
.extern Pokemon_New
|
||||
.extern Pokemon_UnlockEncryption
|
||||
.extern Pokemon_LockEncryption
|
||||
.extern BoxPokemon_UnlockEncryption
|
||||
.extern BoxPokemon_LockEncryption
|
||||
.extern Pokemon_DecryptData
|
||||
.extern Pokemon_EncryptData
|
||||
.extern BoxPokemon_DecryptData
|
||||
.extern BoxPokemon_EncryptData
|
||||
.extern Pokemon_InitWithParams
|
||||
.extern Pokemon_InitWithNature
|
||||
.extern Pokemon_InitWithGenderNatureLetter
|
||||
|
|
|
|||
|
|
@ -4713,7 +4713,7 @@ _021D9B9E:
|
|||
add r1, r6, #0
|
||||
bl Party_GetMonByIndex
|
||||
add r4, r0, #0
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
add r7, r0, #0
|
||||
add r0, r4, #0
|
||||
mov r1, #0xac
|
||||
|
|
@ -4731,7 +4731,7 @@ _021D9B9E:
|
|||
_021D9BD2:
|
||||
add r0, r4, #0
|
||||
add r1, r7, #0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
cmp r5, #2
|
||||
blt _021D9BE4
|
||||
add sp, #8
|
||||
|
|
@ -5455,7 +5455,7 @@ ov14_021DA168: ; 0x021DA168
|
|||
mov r1, #0
|
||||
add r5, r0, #0
|
||||
str r1, [sp, #4]
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
str r0, [sp]
|
||||
add r0, r5, #0
|
||||
mov r1, #0xac
|
||||
|
|
@ -5483,7 +5483,7 @@ _021DA1A2:
|
|||
_021DA1A8:
|
||||
ldr r1, [sp]
|
||||
add r0, r5, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
ldr r0, [sp, #4]
|
||||
add sp, #8
|
||||
pop {r3, r4, r5, r6, r7, pc}
|
||||
|
|
@ -9189,7 +9189,7 @@ ov14_021DBEAC: ; 0x021DBEAC
|
|||
add r0, r5, #0
|
||||
add r6, r2, #0
|
||||
add r4, #0x4c
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
str r0, [sp]
|
||||
str r5, [r7, #0x4c]
|
||||
add r0, r5, #0
|
||||
|
|
@ -9323,7 +9323,7 @@ _021DBFB8:
|
|||
bl SpeciesData_Free
|
||||
ldr r1, [sp]
|
||||
add r0, r5, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
pop {r3, r4, r5, r6, r7, pc}
|
||||
|
||||
thumb_func_start ov14_021DBFF4
|
||||
|
|
@ -9371,7 +9371,7 @@ _021DC034:
|
|||
mov r0, #0x1a
|
||||
lsl r0, r0, #4
|
||||
ldr r0, [r5, r0]
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
add r6, r0, #0
|
||||
mov r0, #0x1a
|
||||
lsl r0, r0, #4
|
||||
|
|
@ -9489,7 +9489,7 @@ _021DC034:
|
|||
lsl r0, r0, #4
|
||||
ldr r0, [r5, r0]
|
||||
add r1, r6, #0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
add r0, r7, #0
|
||||
add r0, #0xa4
|
||||
ldrb r0, [r0]
|
||||
|
|
@ -18859,7 +18859,7 @@ ov14_021E0940: ; 0x021E0940
|
|||
str r2, [sp, #8]
|
||||
str r3, [sp, #0xc]
|
||||
ldr r4, [sp, #0x64]
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
lsl r0, r0, #0x18
|
||||
lsr r0, r0, #0x18
|
||||
str r0, [sp, #0x10]
|
||||
|
|
@ -18971,7 +18971,7 @@ _021E0A36:
|
|||
bl ov14_021E0B54
|
||||
ldr r1, [sp, #0x10]
|
||||
add r0, r6, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
add sp, #0x44
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
|
|
@ -18987,7 +18987,7 @@ ov14_021E0A60: ; 0x021E0A60
|
|||
str r2, [sp, #8]
|
||||
add r7, r3, #0
|
||||
ldr r4, [sp, #0x70]
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
str r0, [sp, #0x14]
|
||||
add r0, r6, #0
|
||||
mov r1, #0x4c
|
||||
|
|
@ -19079,7 +19079,7 @@ _021E0B28:
|
|||
bl ov14_021E0B54
|
||||
ldr r1, [sp, #0x14]
|
||||
add r0, r6, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
add sp, #0x40
|
||||
pop {r3, r4, r5, r6, r7, pc}
|
||||
nop
|
||||
|
|
@ -21819,7 +21819,7 @@ _021E204A:
|
|||
bl PCStorage_GetMonByIndexPair
|
||||
add r4, r4, #1
|
||||
add r5, r0, #0
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
lsl r0, r0, #0x18
|
||||
lsr r0, r0, #0x18
|
||||
str r0, [sp, #0x1c]
|
||||
|
|
@ -21876,7 +21876,7 @@ _021E20AA:
|
|||
_021E20C8:
|
||||
ldr r1, [sp, #0x1c]
|
||||
add r0, r5, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
ldr r0, [sp, #0x24]
|
||||
add r6, r6, #2
|
||||
add r0, r0, #1
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ _02254A62:
|
|||
add r1, r6, #0
|
||||
bl Party_GetMonByIndex
|
||||
add r4, r0, #0
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
add r7, r0, #0
|
||||
add r0, r4, #0
|
||||
bl sub_0206B688
|
||||
|
|
@ -342,7 +342,7 @@ _02254ABE:
|
|||
strb r0, [r5, #0x13]
|
||||
add r0, r4, #0
|
||||
add r1, r7, #0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
ldr r0, [sp]
|
||||
add r6, r6, #1
|
||||
ldr r0, [r0]
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ _02254A7A:
|
|||
str r0, [sp, #8]
|
||||
bl DaycareMon_GetBoxMon
|
||||
add r4, r0, #0
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
str r0, [sp, #0xc]
|
||||
add r0, r4, #0
|
||||
bl sub_0206B688
|
||||
|
|
@ -341,7 +341,7 @@ _02254A7A:
|
|||
str r0, [r5, #0x14]
|
||||
ldr r1, [sp, #0xc]
|
||||
add r0, r4, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
ldr r0, [sp]
|
||||
add r7, r7, #1
|
||||
ldrb r0, [r0]
|
||||
|
|
|
|||
|
|
@ -4037,7 +4037,7 @@ HOF_MonGetMetLocationStringId: ; 0x0222F6C4
|
|||
add r5, r0, #0
|
||||
add r0, r4, #0
|
||||
add r6, r2, #0
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
str r0, [sp]
|
||||
add r0, r4, #0
|
||||
mov r1, #0x79
|
||||
|
|
@ -4124,7 +4124,7 @@ _0222F778:
|
|||
_0222F77A:
|
||||
ldr r1, [sp]
|
||||
add r0, r4, #0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
add r0, r5, #0
|
||||
pop {r3, r4, r5, r6, r7, pc}
|
||||
nop
|
||||
|
|
|
|||
|
|
@ -1343,7 +1343,7 @@ ov71_0222E118: ; 0x0222E118
|
|||
push {r3, r4, r5, r6, r7, lr}
|
||||
add r5, r0, #0
|
||||
add r4, r1, #0
|
||||
bl Pokemon_UnlockEncryption
|
||||
bl Pokemon_DecryptData
|
||||
add r7, r0, #0
|
||||
add r0, r5, #0
|
||||
mov r1, #0x9a
|
||||
|
|
@ -1382,7 +1382,7 @@ ov71_0222E118: ; 0x0222E118
|
|||
add r6, r0, #0
|
||||
add r0, r5, #0
|
||||
add r1, r7, #0
|
||||
bl Pokemon_LockEncryption
|
||||
bl Pokemon_EncryptData
|
||||
ldrh r0, [r4]
|
||||
cmp r0, #0
|
||||
beq _0222E18E
|
||||
|
|
|
|||
|
|
@ -10832,7 +10832,7 @@ ov80_02232C88: ; 0x02232C88
|
|||
add r7, r2, #0
|
||||
add r6, r3, #0
|
||||
ldr r4, [sp, #0x40]
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
add r0, r5, #0
|
||||
mov r1, #0xab
|
||||
mov r2, #0
|
||||
|
|
@ -10874,7 +10874,7 @@ ov80_02232C88: ; 0x02232C88
|
|||
_02232CF2:
|
||||
add r0, r5, #0
|
||||
mov r1, #1
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
ldr r0, [sp, #0x1c]
|
||||
cmp r0, #0
|
||||
beq _02232D60
|
||||
|
|
@ -11266,7 +11266,7 @@ ov80_02233018: ; 0x02233018
|
|||
push {r3, r4, r5, r6, r7, lr}
|
||||
add r7, r0, #0
|
||||
mov r4, #0
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
ldr r5, _02233050 ; =0x02237220
|
||||
str r0, [sp]
|
||||
add r6, r4, #0
|
||||
|
|
@ -11282,7 +11282,7 @@ _02233028:
|
|||
blt _02233028
|
||||
ldr r1, [sp]
|
||||
add r0, r7, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
cmp r4, #0
|
||||
beq _0223304C
|
||||
mov r0, #1
|
||||
|
|
|
|||
|
|
@ -999,7 +999,7 @@ _0223860E:
|
|||
ldr r4, [r0, #4]
|
||||
_02238610:
|
||||
add r0, r4, #0
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
str r0, [sp, #0x20]
|
||||
add r0, sp, #0x34
|
||||
add r1, r4, #0
|
||||
|
|
@ -1051,7 +1051,7 @@ _02238648:
|
|||
bl BG_LoadCharTilesData
|
||||
ldr r1, [sp, #0x20]
|
||||
add r0, r4, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
add r0, r7, #0
|
||||
bl Heap_Free
|
||||
_02238690:
|
||||
|
|
|
|||
|
|
@ -21879,7 +21879,7 @@ MigrateBoxMon: ; 0x02237F6C
|
|||
add r0, r4, #0
|
||||
bl BoxPokemon_Init
|
||||
add r0, r4, #0
|
||||
bl BoxPokemon_UnlockEncryption
|
||||
bl BoxPokemon_DecryptData
|
||||
mov r1, #0
|
||||
str r0, [sp]
|
||||
add r0, r6, #0
|
||||
|
|
@ -22593,7 +22593,7 @@ _0223853E:
|
|||
bl BoxPokemon_SetData
|
||||
ldr r1, [sp]
|
||||
add r0, r4, #0
|
||||
bl BoxPokemon_LockEncryption
|
||||
bl BoxPokemon_EncryptData
|
||||
add sp, #0x30
|
||||
pop {r3, r4, r5, r6, r7, pc}
|
||||
nop
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void Save_HOF_RecordParty(struct HallOfFame *hof, struct Party *party, RTCDate *
|
|||
int i, j;
|
||||
for (i = 0, j = 0; i < nmons; i++) {
|
||||
struct Pokemon *mon = Party_GetMonByIndex(party, i);
|
||||
BOOL lock = Pokemon_UnlockEncryption(mon);
|
||||
BOOL lock = Pokemon_DecryptData(mon);
|
||||
if (!Pokemon_GetData(mon, MON_DATA_IS_EGG, NULL)) {
|
||||
hof_party->party[j].species = (u16)Pokemon_GetData(mon, MON_DATA_SPECIES, NULL);
|
||||
hof_party->party[j].level = (u8)Pokemon_GetData(mon, MON_DATA_LEVEL, NULL);
|
||||
|
|
@ -51,7 +51,7 @@ void Save_HOF_RecordParty(struct HallOfFame *hof, struct Party *party, RTCDate *
|
|||
}
|
||||
j++;
|
||||
}
|
||||
Pokemon_LockEncryption(mon, lock);
|
||||
Pokemon_EncryptData(mon, lock);
|
||||
}
|
||||
hof_party->year = (u16)date->year;
|
||||
hof_party->month = (u8)date->month;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ Pokemon *Pokemon_New(enum HeapID heapID) {
|
|||
return mon;
|
||||
}
|
||||
|
||||
BOOL Pokemon_UnlockEncryption(Pokemon *mon) {
|
||||
BOOL Pokemon_DecryptData(Pokemon *mon) {
|
||||
BOOL wasDecrypted = FALSE;
|
||||
|
||||
if (!mon->box.partyDecrypted) {
|
||||
|
|
@ -149,7 +149,7 @@ BOOL Pokemon_UnlockEncryption(Pokemon *mon) {
|
|||
return wasDecrypted;
|
||||
}
|
||||
|
||||
BOOL Pokemon_LockEncryption(Pokemon *mon, BOOL encrypt) {
|
||||
BOOL Pokemon_EncryptData(Pokemon *mon, BOOL encrypt) {
|
||||
BOOL wasEncrypted = FALSE;
|
||||
|
||||
if (mon->box.partyDecrypted == TRUE && encrypt == TRUE) {
|
||||
|
|
@ -163,7 +163,7 @@ BOOL Pokemon_LockEncryption(Pokemon *mon, BOOL encrypt) {
|
|||
return wasEncrypted;
|
||||
}
|
||||
|
||||
BOOL BoxPokemon_UnlockEncryption(BoxPokemon *boxMon) {
|
||||
BOOL BoxPokemon_DecryptData(BoxPokemon *boxMon) {
|
||||
BOOL wasDecrypted = FALSE;
|
||||
|
||||
if (!boxMon->boxDecrypted) {
|
||||
|
|
@ -174,7 +174,7 @@ BOOL BoxPokemon_UnlockEncryption(BoxPokemon *boxMon) {
|
|||
return wasDecrypted;
|
||||
}
|
||||
|
||||
BOOL BoxPokemon_LockEncryption(BoxPokemon *boxMon, BOOL encrypt) {
|
||||
BOOL BoxPokemon_EncryptData(BoxPokemon *boxMon, BOOL encrypt) {
|
||||
BOOL wasEncrypted = FALSE;
|
||||
|
||||
if (boxMon->boxDecrypted == TRUE && encrypt == TRUE) {
|
||||
|
|
@ -211,7 +211,7 @@ void Pokemon_InitWithParams(Pokemon *mon, int species, int level, int ivs, BOOL
|
|||
void BoxPokemon_InitWithParams(BoxPokemon *boxMon, int species, int level, int ivs, BOOL hasFixedPersonality, int personality, int otIDType, int otID) {
|
||||
u32 var1, var2;
|
||||
BoxPokemon_Init(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
if (!hasFixedPersonality) {
|
||||
personality = (LCRandom() | (LCRandom() << 16));
|
||||
}
|
||||
|
|
@ -285,7 +285,7 @@ void BoxPokemon_InitWithParams(BoxPokemon *boxMon, int species, int level, int i
|
|||
var1 = BoxPokemon_GetGender(boxMon);
|
||||
BoxPokemon_SetData(boxMon, MON_DATA_GENDER, &var1);
|
||||
BoxPokemon_SetDefaultMoves(boxMon);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
||||
void Pokemon_InitWithNature(Pokemon *mon, u16 species, u8 level, u8 ivs, u8 nature) {
|
||||
|
|
@ -338,11 +338,11 @@ void Pokemon_InitAndCalcStats(Pokemon *mon, u16 species, u8 level, u32 combinedI
|
|||
}
|
||||
|
||||
void Pokemon_CalcLevelAndStats(Pokemon *mon) {
|
||||
BOOL reencrypt = Pokemon_UnlockEncryption(mon);
|
||||
BOOL reencrypt = Pokemon_DecryptData(mon);
|
||||
int level = Pokemon_CalcLevel(mon);
|
||||
Pokemon_SetData(mon, MON_DATA_LEVEL, &level);
|
||||
Pokemon_CalcStats(mon);
|
||||
Pokemon_LockEncryption(mon, reencrypt);
|
||||
Pokemon_EncryptData(mon, reencrypt);
|
||||
}
|
||||
|
||||
void Pokemon_CalcStats(Pokemon *mon) {
|
||||
|
|
@ -352,7 +352,7 @@ void Pokemon_CalcStats(Pokemon *mon) {
|
|||
int form, species;
|
||||
int newMaxHp;
|
||||
|
||||
BOOL reencrypt = Pokemon_UnlockEncryption(mon);
|
||||
BOOL reencrypt = Pokemon_DecryptData(mon);
|
||||
|
||||
int level = Pokemon_GetData(mon, MON_DATA_LEVEL, NULL);
|
||||
maxHp = Pokemon_GetData(mon, MON_DATA_MAX_HP, NULL);
|
||||
|
|
@ -423,7 +423,7 @@ void Pokemon_CalcStats(Pokemon *mon) {
|
|||
if (hp != 0) {
|
||||
Pokemon_SetData(mon, MON_DATA_HP, &hp);
|
||||
}
|
||||
Pokemon_LockEncryption(mon, reencrypt);
|
||||
Pokemon_EncryptData(mon, reencrypt);
|
||||
}
|
||||
|
||||
u32 Pokemon_GetData(Pokemon *mon, int param, void *dest) {
|
||||
|
|
@ -1793,14 +1793,14 @@ int Species_GetValue(int species, enum SpeciesDataParam param) {
|
|||
}
|
||||
|
||||
u8 Pokemon_CalcPercentToNextLevel(Pokemon *mon) {
|
||||
BOOL recrypt = Pokemon_UnlockEncryption(mon);
|
||||
BOOL recrypt = Pokemon_DecryptData(mon);
|
||||
u16 species = Pokemon_GetData(mon, MON_DATA_SPECIES, NULL);
|
||||
u8 level = Pokemon_GetData(mon, MON_DATA_LEVEL, NULL);
|
||||
u32 curLevelExp = Species_GetExpAtLevel(species, level);
|
||||
u32 nextLevelExp = Species_GetExpAtLevel(species, level + 1);
|
||||
u32 curExp = Pokemon_GetData(mon, MON_DATA_EXPERIENCE, NULL);
|
||||
|
||||
Pokemon_LockEncryption(mon, recrypt);
|
||||
Pokemon_EncryptData(mon, recrypt);
|
||||
u8 percent = ((curExp - curLevelExp) * 100) / (nextLevelExp - curLevelExp);
|
||||
|
||||
return percent;
|
||||
|
|
@ -1850,10 +1850,10 @@ int Pokemon_CalcLevel(Pokemon *mon) {
|
|||
}
|
||||
|
||||
int BoxPokemon_CalcLevel(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
int species = BoxPokemon_GetData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
int exp = BoxPokemon_GetData(boxMon, MON_DATA_EXPERIENCE, NULL);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
return Species_CalcLevelByExp(species, exp);
|
||||
}
|
||||
|
||||
|
|
@ -1882,9 +1882,9 @@ u8 Pokemon_GetNature(Pokemon *mon) {
|
|||
}
|
||||
|
||||
u8 BoxPokemon_GetNature(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
u32 personality = BoxPokemon_GetData(boxMon, MON_DATA_PERSONALITY, NULL);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
return Personality_GetNature(personality);
|
||||
}
|
||||
|
||||
|
|
@ -2010,10 +2010,10 @@ u8 Pokemon_GetGender(Pokemon *mon) {
|
|||
}
|
||||
|
||||
u8 BoxPokemon_GetGender(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
u16 species = BoxPokemon_GetData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
u32 personality = BoxPokemon_GetData(boxMon, MON_DATA_PERSONALITY, NULL);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
return Species_GetGenderFromPersonality(species, personality);
|
||||
}
|
||||
|
||||
|
|
@ -2096,7 +2096,7 @@ void Pokemon_BuildSpriteTemplate(PokemonSpriteTemplate *template, Pokemon *mon,
|
|||
}
|
||||
|
||||
void BoxPokemon_BuildSpriteTemplate(PokemonSpriteTemplate *template, BoxPokemon *boxMon, u8 face) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
u16 species = BoxPokemon_GetData(boxMon, MON_DATA_SPECIES_OR_EGG, NULL);
|
||||
u8 gender = BoxPokemon_GetGender(boxMon);
|
||||
u8 shiny = BoxPokemon_IsShiny(boxMon);
|
||||
|
|
@ -2113,7 +2113,7 @@ void BoxPokemon_BuildSpriteTemplate(PokemonSpriteTemplate *template, BoxPokemon
|
|||
}
|
||||
|
||||
Species_BuildSpriteTemplate(template, species, gender, face, shiny, form, personality);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
||||
void Species_BuildSpriteTemplate(PokemonSpriteTemplate *template, u16 species, u8 gender, u8 face, u8 shiny, u8 form, u32 personality) {
|
||||
|
|
@ -2669,7 +2669,7 @@ u16 GetEggSpecies(u16 species) {
|
|||
void BoxPokemon_SetDefaultMoves(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt;
|
||||
u16 *levelUpLearnset = Heap_Alloc(HEAP_ID_DEFAULT, MAX_LEARNED_MOVES * sizeof(u16));
|
||||
reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
|
||||
u16 species = BoxPokemon_GetData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
int form = BoxPokemon_GetData(boxMon, MON_DATA_FORM, NULL);
|
||||
|
|
@ -2687,7 +2687,7 @@ void BoxPokemon_SetDefaultMoves(BoxPokemon *boxMon) {
|
|||
}
|
||||
}
|
||||
Heap_Free(levelUpLearnset);
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
||||
u32 Pokemon_TryAppendMove(Pokemon *mon, u16 move) {
|
||||
|
|
@ -2696,7 +2696,7 @@ u32 Pokemon_TryAppendMove(Pokemon *mon, u16 move) {
|
|||
|
||||
u32 BoxPokemon_TryAppendMove(BoxPokemon *boxMon, u16 move) {
|
||||
u32 ret = 0xFFFF;
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
|
||||
for (int i = 0; i < MAX_MON_MOVES; i++) {
|
||||
u16 slotMove = BoxPokemon_GetData(boxMon, MON_DATA_MOVE1 + i, NULL);
|
||||
|
|
@ -2710,7 +2710,7 @@ u32 BoxPokemon_TryAppendMove(BoxPokemon *boxMon, u16 move) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -2719,7 +2719,7 @@ void Pokemon_ForceAppendMove(Pokemon *mon, u16 move) {
|
|||
}
|
||||
|
||||
void BoxPokemon_ForceAppendMove(BoxPokemon *boxMon, u16 move) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
u16 moves[MAX_MON_MOVES];
|
||||
u8 pp[MAX_MON_MOVES];
|
||||
u8 ppUp[MAX_MON_MOVES];
|
||||
|
|
@ -2741,7 +2741,7 @@ void BoxPokemon_ForceAppendMove(BoxPokemon *boxMon, u16 move) {
|
|||
BoxPokemon_SetData(boxMon, MON_DATA_MOVE1_PP_UPS + i, &ppUp[i]);
|
||||
}
|
||||
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
||||
void Pokemon_SetMoveInSlot(Pokemon *mon, u16 move, u8 slot) {
|
||||
|
|
@ -3220,7 +3220,7 @@ void Pokemon_UpdateAbility(Pokemon *mon) {
|
|||
}
|
||||
|
||||
void BoxPokemon_UpdateAbility(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
int species = BoxPokemon_GetData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
int personality = BoxPokemon_GetData(boxMon, MON_DATA_PERSONALITY, NULL);
|
||||
int ability1 = Species_GetValue(species, SPECIES_DATA_ABILITY_1);
|
||||
|
|
@ -3235,7 +3235,7 @@ void BoxPokemon_UpdateAbility(BoxPokemon *boxMon) {
|
|||
} else {
|
||||
BoxPokemon_SetData(boxMon, MON_DATA_ABILITY, &ability1);
|
||||
}
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
||||
void Pokemon_SetPersonality(Pokemon *mon, u32 personality) {
|
||||
|
|
@ -3518,12 +3518,12 @@ void Pokemon_RemoveCapsule(Pokemon *mon) {
|
|||
}
|
||||
|
||||
void BoxPokemon_RestorePP(BoxPokemon *boxMon) {
|
||||
BOOL reencrypt = BoxPokemon_UnlockEncryption(boxMon);
|
||||
BOOL reencrypt = BoxPokemon_DecryptData(boxMon);
|
||||
for (int i = 0; i < MAX_MON_MOVES; i++) {
|
||||
if (BoxPokemon_GetData(boxMon, MON_DATA_MOVE1 + i, NULL) != MOVE_NONE) {
|
||||
u8 pp = BoxPokemon_GetData(boxMon, MON_DATA_MOVE1_MAX_PP + i, NULL);
|
||||
BoxPokemon_SetData(boxMon, MON_DATA_MOVE1_PP + i, &pp);
|
||||
}
|
||||
}
|
||||
BoxPokemon_LockEncryption(boxMon, reencrypt);
|
||||
BoxPokemon_EncryptData(boxMon, reencrypt);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@ u16 BoxMon_GetAlternateForm(struct BoxPokemon *boxmon);
|
|||
u32 sub_0206B6D4(u32 species, u32 is_egg, u32 form);
|
||||
|
||||
u32 sub_0206B688(struct BoxPokemon *boxmon) {
|
||||
BOOL decry = BoxPokemon_UnlockEncryption(boxmon);
|
||||
BOOL decry = BoxPokemon_DecryptData(boxmon);
|
||||
u32 species = BoxPokemon_GetData(boxmon, MON_DATA_SPECIES, NULL);
|
||||
u32 is_egg = BoxPokemon_GetData(boxmon, MON_DATA_IS_EGG, NULL);
|
||||
u32 form = BoxMon_GetAlternateForm(boxmon);
|
||||
u32 ret = sub_0206B6D4(species, is_egg, form);
|
||||
BoxPokemon_LockEncryption(boxmon, decry);
|
||||
BoxPokemon_EncryptData(boxmon, decry);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -100,11 +100,11 @@ u32 sub_0206B7BC(u32 species, u32 form, u32 is_egg) {
|
|||
}
|
||||
|
||||
u32 sub_0206B83C(struct BoxPokemon *boxmon) {
|
||||
BOOL decry = BoxPokemon_UnlockEncryption(boxmon);
|
||||
BOOL decry = BoxPokemon_DecryptData(boxmon);
|
||||
u32 form = BoxMon_GetAlternateForm(boxmon);
|
||||
u32 species = BoxPokemon_GetData(boxmon, MON_DATA_SPECIES, NULL);
|
||||
u32 is_egg = BoxPokemon_GetData(boxmon, MON_DATA_IS_EGG, NULL);
|
||||
BoxPokemon_LockEncryption(boxmon, decry);
|
||||
BoxPokemon_EncryptData(boxmon, decry);
|
||||
return sub_0206B7BC(species, form, is_egg);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -230,10 +230,10 @@ void Pokemon_Init(Pokemon *mon);
|
|||
void BoxPokemon_Init(BoxPokemon *boxMon);
|
||||
int Pokemon_Size(void);
|
||||
Pokemon *Pokemon_New(enum HeapID heapID);
|
||||
BOOL Pokemon_UnlockEncryption(Pokemon *mon);
|
||||
BOOL Pokemon_LockEncryption(Pokemon *mon, BOOL encrypt);
|
||||
BOOL BoxPokemon_UnlockEncryption(BoxPokemon *boxMon);
|
||||
BOOL BoxPokemon_LockEncryption(BoxPokemon *boxMon, BOOL encrypt);
|
||||
BOOL Pokemon_DecryptData(Pokemon *mon);
|
||||
BOOL Pokemon_EncryptData(Pokemon *mon, BOOL encrypt);
|
||||
BOOL BoxPokemon_DecryptData(BoxPokemon *boxMon);
|
||||
BOOL BoxPokemon_EncryptData(BoxPokemon *boxMon, BOOL encrypt);
|
||||
void Pokemon_InitWithParams(Pokemon *mon, int species, int level, int fixedIV, int hasFixedPersonality, int fixedPersonality, int otIdType, int fixedOtId);
|
||||
void BoxPokemon_InitWithParams(BoxPokemon *boxMon, int species, int level, int ivs, BOOL hasFixedPersonality, int personality, int otIDType, int otID);
|
||||
void Pokemon_InitWithNature(Pokemon *mon, u16 species, u8 level, u8 fixedIv, u8 nature);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user