Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183.
This commit is contained in:
+44
-41
@@ -252,8 +252,8 @@ struct SlotMachine
|
||||
/*0x0E*/ s16 payout;
|
||||
/*0x10*/ s16 netCoinLoss; // coins lost to machine (but never goes below 0)
|
||||
/*0x12*/ s16 bet;
|
||||
/*0x14*/ s16 reelTimePixelOffset;
|
||||
/*0x16*/ s16 reelTimePosition;
|
||||
/*0x14*/ s16 reeltimePixelOffset;
|
||||
/*0x16*/ s16 reeltimePosition;
|
||||
/*0x18*/ s16 currReel;
|
||||
/*0x1A*/ s16 reelIncrement; // speed of reel
|
||||
/*0x1C*/ s16 reelPixelOffsets[NUM_REELS];
|
||||
@@ -584,7 +584,7 @@ static const u16 *const sDigitalDisplay_Pal;
|
||||
static const s16 sInitialReelPositions[NUM_REELS][2];
|
||||
static const u8 sLuckyFlagProbabilities_Top3[][6];
|
||||
static const u8 sLuckyFlagProbabilities_NotTop3[][6];
|
||||
static const u8 sReelTimeProbabilities_UnluckyGame[][17];
|
||||
static const u8 sReeltimeProbabilities_UnluckyGame[][17];
|
||||
static const u8 sReelTimeProbabilities_LuckyGame[][17];
|
||||
static const u8 sSymToMatch[];
|
||||
static const u8 sReelTimeTags[];
|
||||
@@ -682,7 +682,7 @@ static const struct WindowTemplate sWindowTemplate_InfoBox =
|
||||
.baseBlock = 1
|
||||
};
|
||||
|
||||
static const u8 sColors_ReelTimeHelp[] = {TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY};
|
||||
static const u8 sColors_ReeltimeHelp[] = {TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY};
|
||||
|
||||
static bool8 (*const sSlotActions[])(struct Task *task) =
|
||||
{
|
||||
@@ -985,7 +985,7 @@ static void PlaySlotMachine_Internal(u8 slotMachineIndex, MainCallback exitCallb
|
||||
{
|
||||
struct Task *task = &gTasks[CreateTask(SlotMachineDummyTask, 0xFF)];
|
||||
task->data[0] = slotMachineIndex;
|
||||
StoreWordInTwoHalfwords((u16 *)&task->data[1], (intptr_t)exitCallback);
|
||||
StoreWordInTwoHalfwords(&task->data[1], (intptr_t)exitCallback);
|
||||
}
|
||||
|
||||
|
||||
@@ -1744,13 +1744,13 @@ static u8 AttemptsAtLuckyFlags_NotTop3(void)
|
||||
|
||||
static u8 GetReelTimeProbability(u8 reelTimeDraw)
|
||||
{
|
||||
if (!sSlotMachine->luckyGame)
|
||||
return sReelTimeProbabilities_UnluckyGame[reelTimeDraw][sSlotMachine->pikaPower];
|
||||
|
||||
return sReelTimeProbabilities_LuckyGame[reelTimeDraw][sSlotMachine->pikaPower];
|
||||
if (sSlotMachine->luckyGame == FALSE)
|
||||
return sReeltimeProbabilities_UnluckyGame[reelTimeDraw][sSlotMachine->pikaPower];
|
||||
else
|
||||
return sReelTimeProbabilities_LuckyGame[reelTimeDraw][sSlotMachine->pikaPower];
|
||||
}
|
||||
|
||||
static void GetReelTimeDraw(void)
|
||||
static void GetReeltimeDraw(void)
|
||||
{
|
||||
u8 rval;
|
||||
s16 reelTimeDraw;
|
||||
@@ -1773,13 +1773,15 @@ static bool8 ShouldReelTimeMachineExplode(u16 i)
|
||||
u16 rval = Random() & 0xff;
|
||||
if (rval < sReelTimeExplodeProbability[i])
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u16 SlowReelSpeed(void)
|
||||
{
|
||||
u8 i = 0;
|
||||
u8 rval, value;
|
||||
u8 rval;
|
||||
u8 value;
|
||||
if (sSlotMachine->netCoinLoss >= 300)
|
||||
i = 4;
|
||||
else if (sSlotMachine->netCoinLoss >= 250)
|
||||
@@ -1909,7 +1911,8 @@ static bool8 IsFinalTask_RunAwardPayoutActions(void)
|
||||
{
|
||||
if (FindTaskIdByFunc(RunAwardPayoutActions) == TAIL_SENTINEL)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void RunAwardPayoutActions(u8 taskId)
|
||||
@@ -1942,7 +1945,7 @@ static bool8 AwardPayoutAction_GivePayoutToPlayer(struct Task *task)
|
||||
if (sSlotMachine->coins < MAX_COINS)
|
||||
sSlotMachine->coins++;
|
||||
task->data[1] = 8;
|
||||
if (JOY_HELD(A_BUTTON))
|
||||
if (gMain.heldKeys & A_BUTTON)
|
||||
task->data[1] = 4;
|
||||
}
|
||||
if (IsFanfareTaskInactive() && JOY_NEW(START_BUTTON))
|
||||
@@ -1997,7 +2000,7 @@ static u8 GetTag(u8 reel, s16 offset)
|
||||
|
||||
static u8 GetNearbyReelTimeTag(s16 n)
|
||||
{
|
||||
s16 newPosition = (sSlotMachine->reelTimePosition + n) % 6;
|
||||
s16 newPosition = (sSlotMachine->reeltimePosition + n) % 6;
|
||||
if (newPosition < 0)
|
||||
newPosition += 6;
|
||||
return sReelTimeTags[newPosition];
|
||||
@@ -2023,22 +2026,22 @@ s16 AdvanceSlotReelToNextTag(u8 reelIndex, s16 value)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void AdvanceReelTimeReel(s16 value)
|
||||
static void AdvanceReeltimeReel(s16 value)
|
||||
{
|
||||
sSlotMachine->reelTimePixelOffset += value;
|
||||
sSlotMachine->reelTimePixelOffset %= 120;
|
||||
sSlotMachine->reelTimePosition = 6 - sSlotMachine->reelTimePixelOffset / 20;
|
||||
sSlotMachine->reeltimePixelOffset += value;
|
||||
sSlotMachine->reeltimePixelOffset %= 120;
|
||||
sSlotMachine->reeltimePosition = 6 - sSlotMachine->reeltimePixelOffset / 20;
|
||||
}
|
||||
|
||||
s16 AdvanceReelTimeReelToNextTag(s16 value)
|
||||
s16 AdvanceReeltimeReelToNextTag(s16 value)
|
||||
{
|
||||
s16 offset = sSlotMachine->reelTimePixelOffset % 20;
|
||||
s16 offset = sSlotMachine->reeltimePixelOffset % 20;
|
||||
if (offset != 0)
|
||||
{
|
||||
if (offset < value)
|
||||
value = offset;
|
||||
AdvanceReelTimeReel(value);
|
||||
offset = sSlotMachine->reelTimePixelOffset % 20;
|
||||
AdvanceReeltimeReel(value);
|
||||
offset = sSlotMachine->reeltimePixelOffset % 20;
|
||||
}
|
||||
return offset;
|
||||
}
|
||||
@@ -3077,8 +3080,8 @@ static void Task_ReelTime(u8 taskId)
|
||||
static void ReelTime_Init(struct Task *task)
|
||||
{
|
||||
sSlotMachine->reelTimeSpinsLeft = 0;
|
||||
sSlotMachine->reelTimePixelOffset = 0;
|
||||
sSlotMachine->reelTimePosition = 0;
|
||||
sSlotMachine->reeltimePixelOffset = 0;
|
||||
sSlotMachine->reeltimePosition = 0;
|
||||
task->tState++;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 30;
|
||||
@@ -3093,7 +3096,7 @@ static void ReelTime_Init(struct Task *task)
|
||||
CreateReelTimeNumberSprites();
|
||||
CreateReelTimeShadowSprites();
|
||||
CreateReelTimeNumberGapSprite();
|
||||
GetReelTimeDraw();
|
||||
GetReeltimeDraw();
|
||||
StopMapMusic();
|
||||
PlayNewMapMusic(MUS_ROULETTE);
|
||||
}
|
||||
@@ -3116,12 +3119,12 @@ static void ReelTime_WindowEnter(struct Task *task)
|
||||
task->tState++;
|
||||
task->data[3] = 0;
|
||||
}
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
}
|
||||
|
||||
static void ReelTime_WaitStartPikachu(struct Task *task)
|
||||
{
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
if (++task->data[5] >= 60)
|
||||
{
|
||||
task->tState++;
|
||||
@@ -3141,7 +3144,7 @@ static void ReelTime_PikachuSpeedUp1(struct Task *task)
|
||||
memcpy(reelTimeBoltDelays, sReelTimeBoltDelays, sizeof(sReelTimeBoltDelays));
|
||||
memcpy(pikachuAuraFlashDelays, sPikachuAuraFlashDelays, sizeof(sPikachuAuraFlashDelays));
|
||||
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
// gradually slow down the reel
|
||||
task->data[4] -= 4;
|
||||
i = 4 - (task->data[4] >> 8);
|
||||
@@ -3159,7 +3162,7 @@ static void ReelTime_PikachuSpeedUp1(struct Task *task)
|
||||
|
||||
static void ReelTime_PikachuSpeedUp2(struct Task *task)
|
||||
{
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
if (++task->data[5] >= 80)
|
||||
{
|
||||
task->tState++;
|
||||
@@ -3171,7 +3174,7 @@ static void ReelTime_PikachuSpeedUp2(struct Task *task)
|
||||
|
||||
static void ReelTime_WaitReel(struct Task *task)
|
||||
{
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
task->data[4] = (u8)task->data[4] + 0x80;
|
||||
if (++task->data[5] >= 80)
|
||||
{
|
||||
@@ -3182,7 +3185,7 @@ static void ReelTime_WaitReel(struct Task *task)
|
||||
|
||||
static void ReelTime_CheckExplode(struct Task *task)
|
||||
{
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
task->data[4] = (u8)task->data[4] + 0x40;
|
||||
if (++task->data[5] >= 40)
|
||||
{
|
||||
@@ -3206,19 +3209,19 @@ static void ReelTime_CheckExplode(struct Task *task)
|
||||
|
||||
static void ReelTime_LandOnOutcome(struct Task *task)
|
||||
{
|
||||
s16 reelTimePixelOffset = sSlotMachine->reelTimePixelOffset % 20;
|
||||
if (reelTimePixelOffset)
|
||||
s16 reeltimePixelOffset = sSlotMachine->reeltimePixelOffset % 20;
|
||||
if (reeltimePixelOffset)
|
||||
{
|
||||
reelTimePixelOffset = AdvanceReelTimeReelToNextTag(task->data[4] >> 8);
|
||||
reeltimePixelOffset = AdvanceReeltimeReelToNextTag(task->data[4] >> 8);
|
||||
task->data[4] = (u8)task->data[4] + 0x40;
|
||||
}
|
||||
else if (GetNearbyReelTimeTag(1) != sSlotMachine->reelTimeDraw)
|
||||
{
|
||||
AdvanceReelTimeReel(task->data[4] >> 8);
|
||||
reelTimePixelOffset = sSlotMachine->reelTimePixelOffset % 20;
|
||||
AdvanceReeltimeReel(task->data[4] >> 8);
|
||||
reeltimePixelOffset = sSlotMachine->reeltimePixelOffset % 20;
|
||||
task->data[4] = (u8)task->data[4] + 0x40;
|
||||
}
|
||||
if (reelTimePixelOffset == 0 && GetNearbyReelTimeTag(1) == sSlotMachine->reelTimeDraw)
|
||||
if (reeltimePixelOffset == 0 && GetNearbyReelTimeTag(1) == sSlotMachine->reelTimeDraw)
|
||||
{
|
||||
task->data[4] = 0; // stop moving
|
||||
task->tState++;
|
||||
@@ -3441,7 +3444,7 @@ static void InfoBox_DrawWindow(struct Task *task)
|
||||
|
||||
static void InfoBox_AddText(struct Task *task)
|
||||
{
|
||||
AddTextPrinterParameterized3(1, 1, 2, 5, sColors_ReelTimeHelp, 0, gText_ReelTimeHelp);
|
||||
AddTextPrinterParameterized3(1, 1, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp);
|
||||
CopyWindowToVram(1, 3);
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0));
|
||||
task->tState++;
|
||||
@@ -3771,7 +3774,7 @@ static void CreateReelTimeNumberSprites(void)
|
||||
|
||||
static void SpriteCB_ReelTimeNumbers(struct Sprite *sprite)
|
||||
{
|
||||
s16 r0 = (u16)(sSlotMachine->reelTimePixelOffset + sprite->data[7]);
|
||||
s16 r0 = (u16)(sSlotMachine->reeltimePixelOffset + sprite->data[7]);
|
||||
r0 %= 40;
|
||||
sprite->pos1.y = r0 + 59;
|
||||
StartSpriteAnimIfDifferent(sprite, GetNearbyReelTimeTag(r0 / 20));
|
||||
@@ -4827,7 +4830,7 @@ static const u8 sLuckyFlagProbabilities_NotTop3[][6] = {
|
||||
{40, 40, 35, 35, 40, 40}
|
||||
};
|
||||
|
||||
static const u8 sReelTimeProbabilities_UnluckyGame[][17] = {
|
||||
static const u8 sReeltimeProbabilities_UnluckyGame[][17] = {
|
||||
{243, 243, 243, 80, 80, 80, 80, 40, 40, 40, 40, 40, 40, 5, 5, 5, 5},
|
||||
{ 5, 5, 5, 150, 150, 150, 150, 130, 130, 130, 130, 130, 130, 100, 100, 100, 5},
|
||||
{ 4, 4, 4, 20, 20, 20, 20, 80, 80, 80, 80, 80, 80, 100, 100, 100, 40},
|
||||
|
||||
Reference in New Issue
Block a user