Skip to content

Commit

Permalink
Merge pull request rh-hideout#2012 from DizzyEggg/patch-1
Browse files Browse the repository at this point in the history
Berry blender's Task_HandleOpponent small fixes
  • Loading branch information
GriffinRichards authored Jul 4, 2024
2 parents 502eeda + 47533e3 commit a0a02f9
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/berry_blender.c
Original file line number Diff line number Diff line change
Expand Up @@ -1908,7 +1908,7 @@ static void Task_HandleOpponent1(u8 taskId)
static void Task_HandleOpponent2(u8 taskId)
{
u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF;
u32 arrowId = sBerryBlender->playerIdToArrowId[2] & 0xFF;
u8 arrowId = sBerryBlender->playerIdToArrowId[2];
if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40)
{
if (!gTasks[taskId].tDidInput)
Expand All @@ -1925,11 +1925,9 @@ static void Task_HandleOpponent2(u8 taskId)
}
else
{
u8 value;
if (rand > 65)
gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST;
value = rand - 41;
if (value < 25)
if (rand > 40 && rand <= 65)
gRecvCmds[2][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
if (rand < 10)
CreateOpponentMissTask(2, 5);
Expand All @@ -1953,7 +1951,7 @@ static void Task_HandleOpponent2(u8 taskId)
static void Task_HandleOpponent3(u8 taskId)
{
u32 var1 = (sBerryBlender->arrowPos + 0x1800) & 0xFFFF;
u32 arrowId = sBerryBlender->playerIdToArrowId[3] & 0xFF;
u8 arrowId = sBerryBlender->playerIdToArrowId[3];
if ((var1 >> 8) > sArrowHitRangeStart[arrowId] + 20 && (var1 >> 8) < sArrowHitRangeStart[arrowId] + 40)
{
if (gTasks[taskId].data[0] == 0)
Expand All @@ -1971,16 +1969,9 @@ static void Task_HandleOpponent3(u8 taskId)
else
{
if (rand > 60)
{
gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_BEST;
}
else
{
s8 value = rand - 56; // makes me wonder what the original code was
u8 value2 = value;
if (value2 < 5)
gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
}
else if (rand > 55 && rand <= 60)
gRecvCmds[3][BLENDER_COMM_SCORE] = LINKCMD_BLENDER_SCORE_GOOD;
if (rand < 5)
CreateOpponentMissTask(3, 5);
}
Expand Down

0 comments on commit a0a02f9

Please sign in to comment.