Skip to content

Commit

Permalink
requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienntindall committed Dec 24, 2023
1 parent af75586 commit 196ce4b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion include/battle/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ typedef struct BattleMessage {
u8 tag;
u16 id;
int param[6];
int unk1C;
int numDigits;
int battlerId;
} BattleMessage;

Expand Down
1 change: 1 addition & 0 deletions include/constants/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ typedef enum Terrain {
#define FIELD_CONDITION_HAIL (1 << 6)
#define FIELD_CONDITION_HAIL_PERMANENT (1 << 7)
#define FIELD_CONDITION_HAIL_ALL (FIELD_CONDITION_HAIL | FIELD_CONDITION_HAIL_PERMANENT)
#define FIELD_CONDITION_UPROAR (15 << 8)
#define FIELD_CONDITION_GRAVITY (7 << 12)
#define FIELD_CONDITION_FOG (1 << 15)
#define FIELD_CONDITION_TRICK_ROOM (7 << 16)
Expand Down
6 changes: 3 additions & 3 deletions src/battle/battle_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -6134,7 +6134,7 @@ static void Task_GetExp(SysTask *task, void *inData)
// Cache the stats from the previous level for later
data->ctx->prevLevelStats = AllocFromHeap(HEAP_ID_BATTLE, sizeof(StatStruct));
StatStruct *oldStats = data->ctx->prevLevelStats;
for (i = 0; i < 6; i++) {
for (i = 0; i < NUM_STATS; i++) {
oldStats->stats[i] = GetMonData(mon, stats.stats[i], NULL);
}

Expand Down Expand Up @@ -6211,7 +6211,7 @@ static void Task_GetExp(SysTask *task, void *inData)
msg.id = msg_0197_00948; // "+{0}"
msg.tag = TAG_NUMBERS;
msg.param[0] = GetMonData(mon, monData.stats[i], NULL) - oldStats->stats[i];
msg.unk1C = 2;
msg.numDigits = 2;

ov12_0223C4E8(data->bsys, window, msgLoader, &msg, 80, 16 * i, 0, 0, 0);
}
Expand All @@ -6229,7 +6229,7 @@ static void Task_GetExp(SysTask *task, void *inData)
msg.id = msg_0197_00949; // just a number
msg.tag = TAG_NUMBERS;
msg.param[0] = GetMonData(mon, monData.stats[i], NULL);
msg.unk1C = 3;
msg.numDigits = 3;

ov12_0223C4E8(data->bsys, window, msgLoader, &msg, 72, 16 * i, 0x2, 36, 0);
}
Expand Down
4 changes: 2 additions & 2 deletions src/battle/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ u32 TryDisobedience(BattleSystem *bsys, BattleContext *ctx, int *script) {
*script = 256;
ctx->unk_2184 |= 1;

return 2; // ???
return 2;
}

level = ctx->battleMons[ctx->battlerIdAttacker].level - level;
Expand All @@ -1876,7 +1876,7 @@ u32 TryDisobedience(BattleSystem *bsys, BattleContext *ctx, int *script) {
if (rnd < level && !(ctx->battleMons[ctx->battlerIdAttacker].status & STATUS_ALL) &&
GetBattlerAbility(ctx, ctx->battlerIdAttacker) != ABILITY_VITAL_SPIRIT &&
GetBattlerAbility(ctx, ctx->battlerIdAttacker) != ABILITY_INSOMNIA &&
!(ctx->fieldCondition & (0xF << 8))) {
!(ctx->fieldCondition & FIELD_CONDITION_UPROAR)) {
*script = 257;
return 1;
}
Expand Down
14 changes: 7 additions & 7 deletions src/battle/battle_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void BattleMessage_BufferNickname(BattleSystem *bsys, int bufferIndex, in
static void BattleMessage_BufferMove(BattleSystem *bsys, int bufferIndex, int param);
static void BattleMessage_BufferItem(BattleSystem *bsys, int bufferIndex, int param);
static void BattleMessage_BufferNumber(BattleSystem *bsys, int bufferIndex, int param);
static void BattleMessage_BufferNumbers(BattleSystem *bsys, int bufferIndex, int param, int a3);
static void BattleMessage_BufferNumbers(BattleSystem *bsys, int bufferIndex, int param, int numDigits);
static void BattleMessage_BufferType(BattleSystem *bsys, int bufferIndex, int param);
static void BattleMessage_BufferAbility(BattleSystem *bsys, int bufferIndex, int param);
static void BattleMessage_BufferStat(BattleSystem *bsys, int bufferIndex, int param);
Expand Down Expand Up @@ -1581,7 +1581,7 @@ static void BattleSystem_AdjustMessageForSide(BattleSystem *bsys, BattleMessage
}
break;
default:
GF_ASSERT(0);
GF_ASSERT(FALSE);
}
}

Expand All @@ -1607,7 +1607,7 @@ static void BattleSystem_BufferMessage(BattleSystem *bsys, BattleMessage *msg) {
BattleMessage_BufferNumber(bsys, 0, msg->param[0]);
break;
case TAG_NUMBERS:
BattleMessage_BufferNumbers(bsys, 0, msg->param[0], msg->unk1C);
BattleMessage_BufferNumbers(bsys, 0, msg->param[0], msg->numDigits);
break;
case TAG_TRNAME:
BattleMessage_BufferTrainerName(bsys, 0, msg->param[0]);
Expand Down Expand Up @@ -1858,7 +1858,7 @@ static void BattleSystem_BufferMessage(BattleSystem *bsys, BattleMessage *msg) {
BattleMessage_BufferNickname(bsys, 5, msg->param[5]);
break;
default:
GF_ASSERT(0);
GF_ASSERT(FALSE);
}
}

Expand All @@ -1879,9 +1879,9 @@ static void BattleMessage_BufferNumber(BattleSystem *bsys, int bufferIndex, int
BufferIntegerAsString(bsys->msgFormat, bufferIndex, param, 5, PRINTING_MODE_LEFT_ALIGN, TRUE);
}

static void BattleMessage_BufferNumbers(BattleSystem *bsys, int bufferIndex, int param, int a3) {
if (a3) {
BufferIntegerAsString(bsys->msgFormat, bufferIndex, param, a3, PRINTING_MODE_RIGHT_ALIGN, TRUE);
static void BattleMessage_BufferNumbers(BattleSystem *bsys, int bufferIndex, int param, int numDigits) {
if (numDigits) {
BufferIntegerAsString(bsys->msgFormat, bufferIndex, param, numDigits, PRINTING_MODE_RIGHT_ALIGN, TRUE);
} else {
BufferIntegerAsString(bsys->msgFormat, bufferIndex, param, 5, PRINTING_MODE_RIGHT_ALIGN, TRUE);
}
Expand Down

0 comments on commit 196ce4b

Please sign in to comment.