summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-01-23 10:10:57 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2020-01-23 10:10:57 -0500
commit7824a413dea43f2c0c99c2b86af17c33378139fa (patch)
tree01c4c152ba0b751f66d790e395f72fd803e938e5 /src
parent90c99d1ce2233b775b26d743bbdb187a2071c42d (diff)
Normalize union room UnkStruct arrays; remove STAT_STAGE_ defines
Diffstat (limited to 'src')
-rw-r--r--src/pokemon.c50
-rw-r--r--src/union_room.c4
-rw-r--r--src/union_room_message.c2
3 files changed, 29 insertions, 27 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index 5b715133b..d1305861a 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -3982,49 +3982,49 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
retVal = FALSE;
}
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_ATK] < 12)
{
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] += itemEffect[cmdIndex] & 0xF;
- if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] > 12)
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] = 12;
+ gBattleMons[gActiveBattler].statStages[STAT_ATK] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_ATK] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_ATK] = 12;
retVal = FALSE;
}
break;
// in-battle stat boosting effects?
case 1:
if ((itemEffect[cmdIndex] & 0xF0)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_DEF] < 12)
{
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] += (itemEffect[cmdIndex] & 0xF0) >> 4;
- if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] > 12)
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] = 12;
+ gBattleMons[gActiveBattler].statStages[STAT_DEF] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ if (gBattleMons[gActiveBattler].statStages[STAT_DEF] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_DEF] = 12;
retVal = FALSE;
}
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_SPEED] < 12)
{
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] += itemEffect[cmdIndex] & 0xF;
- if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] > 12)
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] = 12;
+ gBattleMons[gActiveBattler].statStages[STAT_SPEED] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_SPEED] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_SPEED] = 12;
retVal = FALSE;
}
break;
// more stat boosting effects?
case 2:
if ((itemEffect[cmdIndex] & 0xF0)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_ACC] < 12)
{
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] += (itemEffect[cmdIndex] & 0xF0) >> 4;
- if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] > 12)
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] = 12;
+ gBattleMons[gActiveBattler].statStages[STAT_ACC] += (itemEffect[cmdIndex] & 0xF0) >> 4;
+ if (gBattleMons[gActiveBattler].statStages[STAT_ACC] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_ACC] = 12;
retVal = FALSE;
}
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_SPATK] < 12)
{
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] += itemEffect[cmdIndex] & 0xF;
- if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] > 12)
- gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] = 12;
+ gBattleMons[gActiveBattler].statStages[STAT_SPATK] += itemEffect[cmdIndex] & 0xF;
+ if (gBattleMons[gActiveBattler].statStages[STAT_SPATK] > 12)
+ gBattleMons[gActiveBattler].statStages[STAT_SPATK] = 12;
retVal = FALSE;
}
break;
@@ -4496,25 +4496,25 @@ bool8 PokemonItemUseNoEffect(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mo
&& !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
retVal = FALSE;
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_ATK] < 12)
retVal = FALSE;
break;
// in-battle stat boosting effects?
case 1:
if ((itemEffect[cmdIndex] & 0xF0)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_DEF] < 12)
retVal = FALSE;
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_SPEED] < 12)
retVal = FALSE;
break;
// more stat boosting effects?
case 2:
if ((itemEffect[cmdIndex] & 0xF0)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_ACC] < 12)
retVal = FALSE;
if ((itemEffect[cmdIndex] & 0xF)
- && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] < 12)
+ && gBattleMons[gActiveBattler].statStages[STAT_SPATK] < 12)
retVal = FALSE;
break;
case 3:
diff --git a/src/union_room.c b/src/union_room.c
index efb05d7ca..4e3428cc6 100644
--- a/src/union_room.c
+++ b/src/union_room.c
@@ -2526,12 +2526,12 @@ static void sub_811868C(const u8 *src)
static void sub_81186B0(struct UnkStruct_URoom * data)
{
- memcpy(&gDecompressionBuffer[0x3F00], data->field_0, sizeof(*data->field_0));
+ memcpy(&gDecompressionBuffer[0x3F00], data->field_0, 8 * sizeof(struct UnkStruct_x20));
}
static void sub_81186C8(struct UnkStruct_URoom * data)
{
- memcpy(data->field_0, &gDecompressionBuffer[0x3F00], sizeof(*data->field_0));
+ memcpy(data->field_0, &gDecompressionBuffer[0x3F00], 8 * sizeof(struct UnkStruct_x20));
}
static void sub_81186E0(u8 taskId)
diff --git a/src/union_room_message.c b/src/union_room_message.c
index 1005f1102..9ca5aa15b 100644
--- a/src/union_room_message.c
+++ b/src/union_room_message.c
@@ -10,6 +10,7 @@ ALIGNED(4) const u8 gUnknown_84571E0[] = _("The WIRELESS COMMUNICATION\nSYSTEM s
ALIGNED(4) const u8 gUnref_845721C[] = _("ともだちからの れんらくを\nまっています");
ALIGNED(4) const u8 gUnknown_8457234[] = _("{STR_VAR_1}! Awaiting\ncommunication from another player.");
ALIGNED(4) const u8 gUnknown_8457264[] = _("{STR_VAR_1}! Awaiting link!\nPress START when everyone's ready.");
+
ALIGNED(4) const u8 gJPText_SingleBattle[] = _("シングルバトルを かいさいする");
ALIGNED(4) const u8 gJPText_DoubleBattle[] = _("ダブルバトルを かいさいする");
ALIGNED(4) const u8 gJPText_MultiBattle[] = _("マルチバトルを かいさいする");
@@ -82,6 +83,7 @@ ALIGNED(4) const u8 gUnknown_84574EC[] = _("{STR_VAR_2} contacted you.\nAdd to t
ALIGNED(4) const u8 gUnknown_8457514[] = _("{STR_VAR_1}!\nAre these members OK?");
ALIGNED(4) const u8 gUnknown_8457530[] = _("Cancel {STR_VAR_1} MODE\nwith these members?");
ALIGNED(4) const u8 gUnknown_8457554[] = _("An “OK” was sent\nto {STR_VAR_1}.");
+
ALIGNED(4) const u8 gUnknown_845756C[] = _("The other TRAINER doesn't appear\nto be available now…\p");
ALIGNED(4) const u8 gUnknown_84575A4[] = _("You can't transmit with a TRAINER\nwho is too far away.\p");
ALIGNED(4) const u8 gUnknown_84575DC[] = _("The other TRAINER(S) is/are not\nready yet.\p");