mirror of
https://github.com/pret/pokediamond.git
synced 2026-08-06 10:43:24 -05:00
Pokemon_IncreaseData
This commit is contained in:
parent
7198173b83
commit
aa6f02e6e4
|
|
@ -4745,7 +4745,7 @@
|
|||
.extern BoxPokemon_GetData
|
||||
.extern Pokemon_SetData
|
||||
.extern BoxPokemon_SetData
|
||||
.extern AddMonData
|
||||
.extern Pokemon_IncreaseData
|
||||
.extern SpeciesData_NewFromSpecies
|
||||
.extern SpeciesData_GetValue
|
||||
.extern SpeciesData_Free
|
||||
|
|
|
|||
|
|
@ -1350,7 +1350,7 @@ _022308C4:
|
|||
ldr r0, [sp, #0x18]
|
||||
ldr r2, [sp, #0x20]
|
||||
add r1, #0x3a
|
||||
bl AddMonData
|
||||
bl Pokemon_IncreaseData
|
||||
ldr r0, [sp, #0x10]
|
||||
cmp r0, r5
|
||||
beq _0223091C
|
||||
|
|
@ -1421,7 +1421,7 @@ _0223097E:
|
|||
ldr r0, [sp, #0x18]
|
||||
ldr r2, [sp, #0x20]
|
||||
add r1, #0x3a
|
||||
bl AddMonData
|
||||
bl Pokemon_IncreaseData
|
||||
ldr r0, [sp, #0x10]
|
||||
cmp r0, r5
|
||||
beq _022309B4
|
||||
|
|
@ -1561,7 +1561,7 @@ _02230AC2:
|
|||
ldr r0, [sp, #0x18]
|
||||
ldr r2, [sp, #0x20]
|
||||
mov r1, #0xa2
|
||||
bl AddMonData
|
||||
bl Pokemon_IncreaseData
|
||||
ldr r0, [sp, #0x38]
|
||||
mov r1, #0x17
|
||||
lsl r0, r0, #0x10
|
||||
|
|
@ -1729,7 +1729,7 @@ _02230C28:
|
|||
ldr r0, [sp, #0x18]
|
||||
ldr r2, [sp, #8]
|
||||
mov r1, #9
|
||||
bl AddMonData
|
||||
bl Pokemon_IncreaseData
|
||||
ldr r0, [sp, #0x10]
|
||||
cmp r0, r5
|
||||
beq _02230C3E
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ static u32 Pokemon_GetDataInternal(Pokemon *mon, int param, void *ptr);
|
|||
static u32 BoxPokemon_GetDataInternal(BoxPokemon *boxMon, int param, void *ptr);
|
||||
static void Pokemon_SetDataInternal(Pokemon *mon, int param, void *ptr);
|
||||
static void BoxPokemon_SetDataInternal(BoxPokemon *boxMon, int param, void *ptr);
|
||||
static void AddMonDataInternal(Pokemon *mon, int param, int amount);
|
||||
static void Pokemon_IncreaseDataInternal(Pokemon *mon, int param, int amount);
|
||||
void BoxPokemon_AddDataInternal(BoxPokemon *boxMon, int param, int amount);
|
||||
u32 BoxPokemon_CalcExpToNextLevel(BoxPokemon *boxMon);
|
||||
u16 Nature_ModifyStatValue(u8 nature, u16 value, u8 stat);
|
||||
|
|
@ -1297,7 +1297,7 @@ static void BoxPokemon_SetDataInternal(BoxPokemon *boxMon, int param, void *valu
|
|||
#undef VALUE
|
||||
}
|
||||
|
||||
void AddMonData(Pokemon *mon, int param, int value) {
|
||||
void Pokemon_IncreaseData(Pokemon *mon, int param, int value) {
|
||||
u32 checksum;
|
||||
if (!mon->box.partyDecrypted) {
|
||||
DECRYPT_PARTY(mon);
|
||||
|
|
@ -1309,7 +1309,7 @@ void AddMonData(Pokemon *mon, int param, int value) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
AddMonDataInternal(mon, param, value);
|
||||
Pokemon_IncreaseDataInternal(mon, param, value);
|
||||
if (!mon->box.partyDecrypted) {
|
||||
ENCRYPT_PARTY(mon);
|
||||
mon->box.checksum = CHECKSUM(&mon->box);
|
||||
|
|
@ -1317,13 +1317,11 @@ void AddMonData(Pokemon *mon, int param, int value) {
|
|||
}
|
||||
}
|
||||
|
||||
static void AddMonDataInternal(Pokemon *mon, int param, int value) {
|
||||
s32 maxHP;
|
||||
static void Pokemon_IncreaseDataInternal(Pokemon *mon, int param, int value) {
|
||||
switch (param) {
|
||||
case MON_DATA_HP:
|
||||
maxHP = mon->party.maxHP;
|
||||
if ((s32)(mon->party.hp + value) > maxHP) {
|
||||
mon->party.hp = (u16)maxHP;
|
||||
if (mon->party.hp + value > mon->party.maxHP) {
|
||||
mon->party.hp = mon->party.maxHP;
|
||||
} else {
|
||||
mon->party.hp += value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ BOOL UseItemOnPokemon(struct Pokemon *pokemon, u16 itemId, s32 moveIdx, u16 loca
|
|||
sp58 = (s32)Pokemon_GetData(pokemon, MON_DATA_LEVEL, NULL);
|
||||
if (GetItemAttr_PreloadedItemData(itemData, ITEMATTR_LEVEL_UP)) {
|
||||
if (sp58 < MAX_LEVEL) {
|
||||
AddMonData(pokemon, MON_DATA_EXPERIENCE, (int)Pokemon_CalcExpToNextLevel(pokemon));
|
||||
Pokemon_IncreaseData(pokemon, MON_DATA_EXPERIENCE, (int)Pokemon_CalcExpToNextLevel(pokemon));
|
||||
Pokemon_CalcLevelAndStats(pokemon);
|
||||
if (sp50 == 0) {
|
||||
sp5C = (s32)Pokemon_GetData(pokemon, MON_DATA_MAX_HP, NULL);
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ u32 BoxPokemon_GetData(BoxPokemon *boxMon, int param, void *ptr);
|
|||
#endif
|
||||
void Pokemon_SetData(Pokemon *mon, int param, void *ptr);
|
||||
void BoxPokemon_SetData(BoxPokemon *boxMon, int param, void *ptr);
|
||||
void AddMonData(Pokemon *mon, int param, int amount);
|
||||
void Pokemon_IncreaseData(Pokemon *mon, int param, int amount);
|
||||
SpeciesData *SpeciesData_NewFromSpecies(int species, enum HeapID heapID);
|
||||
int SpeciesData_GetValue(SpeciesData *speciesData, enum SpeciesDataParam attr);
|
||||
void SpeciesData_Free(SpeciesData *speciesData);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user