From 1bb931245b5030746b7150e3965520954d0068a7 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 23 Oct 2017 20:43:26 -0500 Subject: [PATCH] use SPEED instead of SPD in mon data constants --- include/pokemon.h | 4 ++-- src/battle_script_commands.c | 12 ++++++------ src/pokemon_1.c | 12 ++++++------ src/pokemon_2.c | 12 ++++++------ src/pokemon_size_record.c | 2 +- src/pokemon_summary_screen.c | 2 +- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index c26c28afa..6449c1998 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -43,7 +43,7 @@ #define MON_DATA_HP_IV 39 #define MON_DATA_ATK_IV 40 #define MON_DATA_DEF_IV 41 -#define MON_DATA_SPD_IV 42 +#define MON_DATA_SPEED_IV 42 #define MON_DATA_SPATK_IV 43 #define MON_DATA_SPDEF_IV 44 #define MON_DATA_IS_EGG 45 @@ -62,7 +62,7 @@ #define MON_DATA_MAX_HP 58 #define MON_DATA_ATK 59 #define MON_DATA_DEF 60 -#define MON_DATA_SPD 61 +#define MON_DATA_SPEED 61 #define MON_DATA_SPATK 62 #define MON_DATA_SPDEF 63 #define MON_DATA_MAIL 64 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a1e5767ad..28357d984 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -909,7 +909,7 @@ static const u8 sUnknown_0831C2E8[] = INCBIN_U8("graphics/battle_interface/unk_b static const u8 sRubyLevelUpStatBoxStats[] = { MON_DATA_MAX_HP, MON_DATA_SPATK, MON_DATA_ATK, - MON_DATA_SPDEF, MON_DATA_DEF, MON_DATA_SPD + MON_DATA_SPDEF, MON_DATA_DEF, MON_DATA_SPEED }; #define MON_ICON_LVLUP_BOX_TAG 0xD75A @@ -3610,7 +3610,7 @@ static void atk23_getexp(void) BATTLE_LVLUP_STATS->hp = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_MAX_HP); BATTLE_LVLUP_STATS->atk = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_ATK); BATTLE_LVLUP_STATS->def = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_DEF); - BATTLE_LVLUP_STATS->spd = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPD); + BATTLE_LVLUP_STATS->spd = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPEED); BATTLE_LVLUP_STATS->spAtk = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPATK); BATTLE_LVLUP_STATS->spDef = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPDEF); @@ -3649,8 +3649,8 @@ static void atk23_getexp(void) gBattleMons[0].attack = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_ATK); gBattleMons[0].defense = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_DEF); // Why is this duplicated? - gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPD); - gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPD); + gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPEED); + gBattleMons[0].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPEED); gBattleMons[0].spAttack = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPATK); gBattleMons[0].spDefense = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPDEF); @@ -3664,8 +3664,8 @@ static void atk23_getexp(void) gBattleMons[2].attack = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_ATK); gBattleMons[2].defense = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_DEF); // Duplicated again, but this time there's no Sp Defense - gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPD); - gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPD); + gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPEED); + gBattleMons[2].speed = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPEED); gBattleMons[2].spAttack = GetMonData(&gPlayerParty[gBattleStruct->expGetterId], MON_DATA_SPATK); } diff --git a/src/pokemon_1.c b/src/pokemon_1.c index fe7809826..79fa15343 100644 --- a/src/pokemon_1.c +++ b/src/pokemon_1.c @@ -33,7 +33,7 @@ void ZeroMonData(struct Pokemon *mon) SetMonData(mon, MON_DATA_MAX_HP, &arg); SetMonData(mon, MON_DATA_ATK, &arg); SetMonData(mon, MON_DATA_DEF, &arg); - SetMonData(mon, MON_DATA_SPD, &arg); + SetMonData(mon, MON_DATA_SPEED, &arg); SetMonData(mon, MON_DATA_SPATK, &arg); SetMonData(mon, MON_DATA_SPDEF, &arg); arg = 255; @@ -128,7 +128,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, SetBoxMonData(boxMon, MON_DATA_HP_IV, &fixedIV); SetBoxMonData(boxMon, MON_DATA_ATK_IV, &fixedIV); SetBoxMonData(boxMon, MON_DATA_DEF_IV, &fixedIV); - SetBoxMonData(boxMon, MON_DATA_SPD_IV, &fixedIV); + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &fixedIV); SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &fixedIV); SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &fixedIV); } @@ -147,7 +147,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, value = Random(); iv = value & 0x1F; - SetBoxMonData(boxMon, MON_DATA_SPD_IV, &iv); + SetBoxMonData(boxMon, MON_DATA_SPEED_IV, &iv); iv = (value & 0x3E0) >> 5; SetBoxMonData(boxMon, MON_DATA_SPATK_IV, &iv); iv = (value & 0x7C00) >> 10; @@ -234,7 +234,7 @@ void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u SetMonData(mon, MON_DATA_HP_IV, &ivs[0]); SetMonData(mon, MON_DATA_ATK_IV, &ivs[1]); SetMonData(mon, MON_DATA_DEF_IV, &ivs[2]); - SetMonData(mon, MON_DATA_SPD_IV, &ivs[3]); + SetMonData(mon, MON_DATA_SPEED_IV, &ivs[3]); SetMonData(mon, MON_DATA_SPATK_IV, &ivs[4]); SetMonData(mon, MON_DATA_SPDEF_IV, &ivs[5]); CalculateMonStats(mon); @@ -317,7 +317,7 @@ void sub_806819C(struct Pokemon *mon, struct UnknownPokemonStruct *src) value = src->defenseIV; SetMonData(mon, MON_DATA_DEF_IV, &value); value = src->speedIV; - SetMonData(mon, MON_DATA_SPD_IV, &value); + SetMonData(mon, MON_DATA_SPEED_IV, &value); value = src->spAttackIV; SetMonData(mon, MON_DATA_SPATK_IV, &value); value = src->spDefenseIV; @@ -381,7 +381,7 @@ void sub_8068338(struct Pokemon *mon, struct UnknownPokemonStruct *src, bool8 lv value = src->defenseIV; SetMonData(mon, MON_DATA_DEF_IV, &value); value = src->speedIV; - SetMonData(mon, MON_DATA_SPD_IV, &value); + SetMonData(mon, MON_DATA_SPEED_IV, &value); value = src->spAttackIV; SetMonData(mon, MON_DATA_SPATK_IV, &value); value = src->spDefenseIV; diff --git a/src/pokemon_2.c b/src/pokemon_2.c index 27441f952..e14949d48 100644 --- a/src/pokemon_2.c +++ b/src/pokemon_2.c @@ -330,7 +330,7 @@ u32 GetMonData(struct Pokemon *mon, s32 field, u8* data) if (!ret) ret = mon->defense; break; - case MON_DATA_SPD: + case MON_DATA_SPEED: ret = GetDeoxysStat(mon, STAT_SPD); if (!ret) ret = mon->speed; @@ -566,7 +566,7 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_DEF_IV: retVal = substruct3->defenseIV; break; - case MON_DATA_SPD_IV: + case MON_DATA_SPEED_IV: retVal = substruct3->speedIV; break; case MON_DATA_SPATK_IV: @@ -747,7 +747,7 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg) case MON_DATA_DEF: SET16(mon->defense); break; - case MON_DATA_SPD: + case MON_DATA_SPEED: SET16(mon->speed); break; case MON_DATA_SPATK: @@ -940,7 +940,7 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_DEF_IV: SET8(substruct3->defenseIV); break; - case MON_DATA_SPD_IV: + case MON_DATA_SPEED_IV: SET8(substruct3->speedIV); break; case MON_DATA_SPATK_IV: @@ -1329,7 +1329,7 @@ void CopyPlayerPartyMonToBattleData(u8 bank, u8 partyIndex) gBattleMons[bank].hpIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_HP_IV, NULL); gBattleMons[bank].attackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK_IV, NULL); gBattleMons[bank].defenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF_IV, NULL); - gBattleMons[bank].speedIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPD_IV, NULL); + gBattleMons[bank].speedIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED_IV, NULL); gBattleMons[bank].spAttackIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK_IV, NULL); gBattleMons[bank].spDefenseIV = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF_IV, NULL); gBattleMons[bank].personality = GetMonData(&gPlayerParty[partyIndex], MON_DATA_PERSONALITY, NULL); @@ -1339,7 +1339,7 @@ void CopyPlayerPartyMonToBattleData(u8 bank, u8 partyIndex) gBattleMons[bank].maxHP = GetMonData(&gPlayerParty[partyIndex], MON_DATA_MAX_HP, NULL); gBattleMons[bank].attack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ATK, NULL); gBattleMons[bank].defense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_DEF, NULL); - gBattleMons[bank].speed = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPD, NULL); + gBattleMons[bank].speed = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPEED, NULL); gBattleMons[bank].spAttack = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPATK, NULL); gBattleMons[bank].spDefense = GetMonData(&gPlayerParty[partyIndex], MON_DATA_SPDEF, NULL); gBattleMons[bank].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL); diff --git a/src/pokemon_size_record.c b/src/pokemon_size_record.c index 12d98bfd8..1758fba32 100644 --- a/src/pokemon_size_record.c +++ b/src/pokemon_size_record.c @@ -57,7 +57,7 @@ static u32 GetMonSizeHash(struct Pokemon *pkmn) u16 hpIV = GetMonData(pkmn, MON_DATA_HP_IV) & 0xF; u16 attackIV = GetMonData(pkmn, MON_DATA_ATK_IV) & 0xF; u16 defenseIV = GetMonData(pkmn, MON_DATA_DEF_IV) & 0xF; - u16 speedIV = GetMonData(pkmn, MON_DATA_SPD_IV) & 0xF; + u16 speedIV = GetMonData(pkmn, MON_DATA_SPEED_IV) & 0xF; u16 spAtkIV = GetMonData(pkmn, MON_DATA_SPATK_IV) & 0xF; u16 spDefIV = GetMonData(pkmn, MON_DATA_SPDEF_IV) & 0xF; u32 hibyte = ((attackIV ^ defenseIV) * hpIV) ^ (personality & 0xFF); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 37ecdc982..b3682825d 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -709,7 +709,7 @@ bool8 sub_81C00F0(struct Pokemon *a) sum->def = GetMonData(a, MON_DATA_DEF); sum->spatk = GetMonData(a, MON_DATA_SPATK); sum->spdef = GetMonData(a, MON_DATA_SPDEF); - sum->speed = GetMonData(a, MON_DATA_SPD); + sum->speed = GetMonData(a, MON_DATA_SPEED); } else {