Merge pull request #2012 from DizzyEggg/patch-1

Berry blender's Task_HandleOpponent small fixes
This commit is contained in:
GriffinR 2024-07-04 15:02:58 -04:00 committed by GitHub
commit a0a02f9733
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
@ -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);
@ -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)
@ -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);
}