Label slot machine ids, fix GetPriceReduction

This commit is contained in:
GriffinR
2021-11-16 13:55:02 -05:00
parent 63c5905914
commit 5d9c31a610
12 changed files with 151 additions and 61 deletions
+31 -6
View File
@@ -1330,15 +1330,40 @@ void BufferEReaderTrainerName(void)
u16 GetSlotMachineId(void)
{
static const u8 sSlotMachineRandomSeeds[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6};
static const u8 sSlotMachineIds[] = {0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5};
static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5};
static const u8 sSlotMachineRandomSeeds[SLOT_MACHINE_COUNT] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6};
static const u8 sSlotMachineIds[SLOT_MACHINE_COUNT] = {
SLOT_MACHINE_UNLUCKIEST,
SLOT_MACHINE_UNLUCKIER,
SLOT_MACHINE_UNLUCKIER,
SLOT_MACHINE_UNLUCKY,
SLOT_MACHINE_UNLUCKY,
SLOT_MACHINE_UNLUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIEST
};
static const u8 sSlotMachineServiceDayIds[SLOT_MACHINE_COUNT] = {
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKY,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIER,
SLOT_MACHINE_LUCKIEST,
SLOT_MACHINE_LUCKIEST
};
u32 rnd = gSaveBlock1Ptr->dewfordTrends[0].trendiness + gSaveBlock1Ptr->dewfordTrends[0].rand + sSlotMachineRandomSeeds[gSpecialVar_0x8004];
if (GetPriceReduction(POKENEWS_GAME_CORNER))
{
if (IsPokeNewsActive(POKENEWS_GAME_CORNER))
return sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT];
}
return sSlotMachineIds[rnd % SLOT_MACHINE_COUNT];
}