mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
port more of slot machine
This commit is contained in:
parent
7961aa44ba
commit
0e0d103044
1304
asm/slot_machine.s
1304
asm/slot_machine.s
File diff suppressed because it is too large
Load Diff
@ -20,36 +20,36 @@ gUnknown_085A7444:: @ 85A7444
|
||||
gUnknown_085A744C:: @ 85A744C
|
||||
.byte 3, 1, 2, 0
|
||||
|
||||
gUnknown_085A7450:: @ 85A7450
|
||||
.4byte sub_812AB04
|
||||
.4byte sub_812AB38
|
||||
.4byte sub_812AB60
|
||||
.4byte sub_812ABA8
|
||||
.4byte sub_812ABC8
|
||||
.4byte sub_812ABF8
|
||||
.4byte sub_812ACF4
|
||||
.4byte sub_812AD34
|
||||
.4byte sub_812AD60
|
||||
.4byte sub_812AD80
|
||||
.4byte sub_812ADF4
|
||||
.4byte sub_812AE24
|
||||
.4byte sub_812AE4C
|
||||
.4byte sub_812AE88
|
||||
.4byte sub_812AEC4
|
||||
.4byte sub_812AFFC
|
||||
.4byte sub_812B01C
|
||||
.4byte sub_812B094
|
||||
.4byte sub_812B0D8
|
||||
.4byte sub_812B108
|
||||
.4byte sub_812B130
|
||||
.4byte sub_812B158
|
||||
.4byte sub_812B1B0
|
||||
.4byte sub_812B214
|
||||
.4byte sub_812B254
|
||||
.4byte sub_812B280
|
||||
.4byte sub_812B2C0
|
||||
.4byte sub_812B2EC
|
||||
.4byte sub_812B32C
|
||||
gUnknown_083ECAAC:: @ 85A7450
|
||||
.4byte sub_8101D5C
|
||||
.4byte sub_8101D8C
|
||||
.4byte sub_8101DB0
|
||||
.4byte sub_8101DF4
|
||||
.4byte sub_8101E10
|
||||
.4byte sub_8101E3C
|
||||
.4byte sub_8101F44
|
||||
.4byte sub_8101F60
|
||||
.4byte sub_8101F88
|
||||
.4byte sub_8101FA4
|
||||
.4byte sub_8102008
|
||||
.4byte sub_8102034
|
||||
.4byte sub_8102058
|
||||
.4byte sub_8102090
|
||||
.4byte sub_81020C8
|
||||
.4byte sub_81021E0
|
||||
.4byte sub_81021FC
|
||||
.4byte sub_8102264
|
||||
.4byte sub_81022A0
|
||||
.4byte sub_81022CC
|
||||
.4byte sub_81022F0
|
||||
.4byte sub_8102318
|
||||
.4byte sub_8102344
|
||||
.4byte sub_810239C
|
||||
.4byte sub_81023B8
|
||||
.4byte sub_81023E0_
|
||||
.4byte sub_81023FC
|
||||
.4byte sub_8102424
|
||||
.4byte sub_8102460
|
||||
|
||||
gUnknown_085A74C4:: @ 85A74C4
|
||||
.4byte sub_812BB34
|
||||
@ -203,10 +203,10 @@ gUnknown_085A766E:: @ 85A766E
|
||||
gUnknown_085A76AD:: @ 85A76AD
|
||||
.byte 1, 0, 5, 4, 3, 2, 0
|
||||
|
||||
gUnknown_085A76B4:: @ 85A76B4
|
||||
gUnknown_083ECCF8:: @ 85A76B4
|
||||
.2byte 0, 6, 0, 10, 0, 2
|
||||
|
||||
gUnknown_085A76C0:: @ 85A76C0
|
||||
gUnknown_083ECD04:: @ 85A76C0
|
||||
.byte 1, 1, 12
|
||||
.byte 1, 1, 14
|
||||
.byte 2, 2, 14
|
||||
@ -214,19 +214,19 @@ gUnknown_085A76C0:: @ 85A76C0
|
||||
.byte 2, 3, 16
|
||||
.byte 3, 3, 16
|
||||
|
||||
gUnknown_085A76D2:: @ 85A76D2
|
||||
gUnknown_083ECD16:: @ 85A76D2
|
||||
.byte 0x19, 0x19, 0x1E, 0x28, 0x28, 0x32
|
||||
.byte 0x19, 0x19, 0x1E, 0x1E, 0x23, 0x23
|
||||
.byte 0x19, 0x19, 0x1E, 0x19, 0x19, 0x1E
|
||||
|
||||
gUnknown_085A76E4:: @ 85A76E4
|
||||
gUnknown_083ECD28:: @ 85A76E4
|
||||
.byte 0x14, 0x19, 0x19, 0x14, 0x19, 0x19
|
||||
.byte 0xC, 0xF, 0xF, 0x12, 0x13, 0x16
|
||||
.byte 0x19, 0x19, 0x19, 0x1E, 0x1E, 0x28
|
||||
.byte 0x19, 0x19, 0x14, 0x14, 0xF, 0xF
|
||||
.byte 0x28, 0x28, 0x23, 0x23, 0x28, 0x28
|
||||
|
||||
gUnknown_085A7702:: @ 85A7702
|
||||
gUnknown_083ECD46:: @ 85A7702
|
||||
.byte 0xF3, 0xF3, 0xF3, 0x50, 0x50, 0x50, 0x50, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x5, 0x5, 0x5, 0x5
|
||||
.byte 0x5, 0x5, 0x5, 0x96, 0x96, 0x96, 0x96, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x64, 0x64, 0x64, 0x5
|
||||
.byte 0x4, 0x4, 0x4, 0x14, 0x14, 0x14, 0x14, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x64, 0x64, 0x64, 0x28
|
||||
@ -234,7 +234,7 @@ gUnknown_085A7702:: @ 85A7702
|
||||
.byte 0x1, 0x1, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x5, 0x5, 0x5, 0x64
|
||||
.byte 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6
|
||||
|
||||
gUnknown_085A7768:: @ 85A7768
|
||||
gUnknown_083ECDAC:: @ 85A7768
|
||||
.byte 0xF3, 0xF3, 0xF3, 0xC8, 0xC8, 0xC8, 0xC8, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x46, 0x46, 0x46, 0x05
|
||||
.byte 0x05, 0x05, 0x05, 0x19, 0x19, 0x19, 0x19, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x02, 0x06
|
||||
.byte 0x04, 0x04, 0x04, 0x19, 0x19, 0x19, 0x19, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x28, 0x28, 0x28, 0x23
|
||||
@ -242,45 +242,45 @@ gUnknown_085A7768:: @ 85A7768
|
||||
.byte 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x28, 0x28, 0x28, 0x64
|
||||
.byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x04, 0x04, 0x3C
|
||||
|
||||
gUnknown_085A77CE:: @ 85A77CE
|
||||
gUnknown_083ECE12:: @ 85A77CE
|
||||
.2byte 0x80, 0xAF, 0xC8, 0xE1, 0x100
|
||||
|
||||
gUnknown_085A77D8:: @ 85A77D8
|
||||
gUnknown_083ECE1C:: @ 85A77D8
|
||||
.byte 10, 0, 5, 0
|
||||
.byte 10, 0, 10, 0
|
||||
.byte 10, 0, 15, 0
|
||||
.byte 10, 0, 25, 0
|
||||
.byte 10, 0, 35, 0
|
||||
|
||||
gUnknown_085A77EC:: @ 85A77EC
|
||||
gUnknown_083ECE30:: @ 85A77EC
|
||||
.byte 0, 0
|
||||
.byte 5, 0
|
||||
.byte 10, 0
|
||||
.byte 15, 0
|
||||
.byte 20, 0
|
||||
|
||||
gUnknown_085A77F6:: @ 85A77F6
|
||||
gUnknown_083ECE3A:: @ 85A77F6
|
||||
.byte 6, 4, 3, 2, 5, 0, 0, 0
|
||||
|
||||
gUnknown_085A77FE:: @ 85A77FE
|
||||
gUnknown_083ECE42:: @ 85A77FE
|
||||
.byte 0x80, 0
|
||||
.byte 0x20, 0
|
||||
.byte 0x40, 0
|
||||
|
||||
gUnknown_085A7804:: @ 85A7804
|
||||
gUnknown_083ECE48:: @ 85A7804
|
||||
.byte 16, 0
|
||||
.byte 8, 0
|
||||
.byte 4, 0
|
||||
.byte 2, 0
|
||||
.byte 1, 0
|
||||
|
||||
gUnknown_085A780E:: @ 85A780E
|
||||
sSym2Match:: @ 85A780E
|
||||
.byte 7, 8, 4, 3, 0, 5, 2, 0
|
||||
|
||||
gUnknown_085A7816:: @ 85A7816
|
||||
sSlotMatchFlags:: @ 85A7816
|
||||
.2byte 1, 2, 4, 8, 16, 32, 64, 128, 256
|
||||
|
||||
gUnknown_085A7828:: @ 85A7828
|
||||
sSlotPayouts:: @ 85A7828
|
||||
.2byte 2, 4, 0, 6, 12, 3, 0x5A, 0x12C, 0x12C
|
||||
|
||||
gUnknown_085A783A:: @ 85A783A
|
||||
|
@ -2,5 +2,6 @@
|
||||
#define GUARD_MAIN_MENU_H
|
||||
|
||||
void CB2_InitMainMenu(void);
|
||||
void sub_80323CC(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f);
|
||||
|
||||
#endif // GUARD_MAIN_MENU_H
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "tv.h"
|
||||
#include "text_window.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "menu.h"
|
||||
#include "main_menu.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -155,13 +155,13 @@ bool8 sub_81020C8(struct Task *task);
|
||||
/*static*/bool8 sub_8102344(struct Task *task);
|
||||
/*static*/bool8 sub_810239C(struct Task *task);
|
||||
/*static*/bool8 sub_81023B8(struct Task *task);
|
||||
/*static*/bool8 sub_81023E0(struct Task *task);
|
||||
/*static*/bool8 sub_81023E0_(struct Task *task);
|
||||
/*static*/bool8 sub_81023FC(struct Task *task);
|
||||
/*static*/bool8 sub_8102424(struct Task *task);
|
||||
/*static*/bool8 sub_8102460(struct Task *task);
|
||||
/*static*/void sub_8102484(void);
|
||||
/*static*/void sub_81024F0(void);
|
||||
/*static*/bool8 sub_8102540(void);
|
||||
/*static*/bool8 sub_8102540_(void);
|
||||
/*static*/u8 sub_8102578(void);
|
||||
/*static*/u16 dp15_jump_random_unknown(void);
|
||||
/*static*/u8 sub_81025BC(void);
|
||||
@ -539,9 +539,33 @@ void SlotMachineSetup_3_0(void)
|
||||
ResetTasks();
|
||||
}
|
||||
|
||||
extern u16 *gUnknown_0203AAC8;
|
||||
extern u16 *gUnknown_0203AACC;
|
||||
extern u16 *gUnknown_0203AAD0;
|
||||
extern u16 *gUnknown_0203AADC;
|
||||
extern void *gUnknown_0203AAF4;
|
||||
extern void *gUnknown_0203AAF8;
|
||||
extern void *gUnknown_0203AAFC;
|
||||
extern void *gUnknown_0203AB00;
|
||||
extern void *gUnknown_0203AB04;
|
||||
extern void *gUnknown_0203AB08;
|
||||
extern void *gUnknown_0203AB0C;
|
||||
extern void *gUnknown_0203AB10;
|
||||
extern void *gUnknown_0203AB14;
|
||||
extern void *gUnknown_0203AB18;
|
||||
extern void *gUnknown_0203AB1C;
|
||||
extern void *gUnknown_0203AB20;
|
||||
extern void *gUnknown_0203AB24;
|
||||
extern void *gUnknown_0203AB28;
|
||||
extern void *gUnknown_0203AAE4;
|
||||
extern void *gUnknown_0203AAE8;
|
||||
extern void *gUnknown_0203AAEC;
|
||||
extern void *gUnknown_0203AAF0;
|
||||
extern void *gUnknown_0203AAD4;
|
||||
extern void *gUnknown_0203AAD8;
|
||||
extern void *gUnknown_0203AAE0;
|
||||
extern void *gUnknown_0203AB2C;
|
||||
extern void *gUnknown_0203AB30;
|
||||
|
||||
void SlotMachineSetup_4_0(void)
|
||||
{
|
||||
@ -694,6 +718,9 @@ bool8 sub_8101E3C(struct Task *task)
|
||||
}
|
||||
|
||||
extern const u8 gText_YouDontHaveThreeCoins[];
|
||||
extern const u8 gText_QuitTheGame[];
|
||||
extern const u8 gText_YouveGot9999Coins[];
|
||||
extern const u8 gText_YouveRunOutOfCoins[];
|
||||
|
||||
bool8 sub_8101F44(struct Task *task)
|
||||
{
|
||||
@ -885,3 +912,455 @@ bool8 sub_81021FC(struct Task *task)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8102264(struct Task *task)
|
||||
{
|
||||
if (!sub_81040C8())
|
||||
{
|
||||
sSlotMachine->state = 19;
|
||||
if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
|
||||
{
|
||||
sSlotMachine->state = 9;
|
||||
if (sSlotMachine->unk0A)
|
||||
{
|
||||
sub_8104CAC(4);
|
||||
sSlotMachine->state = 18;
|
||||
}
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81022A0(struct Task *task)
|
||||
{
|
||||
if (sub_8104E18())
|
||||
{
|
||||
sSlotMachine->state = 19;
|
||||
if (sSlotMachine->matchedSymbols & (1 << SLOT_MACHINE_MATCHED_REPLAY))
|
||||
{
|
||||
sSlotMachine->state = 9;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81022CC(struct Task *task)
|
||||
{
|
||||
sub_8103D8C(0);
|
||||
sub_8103D8C(1);
|
||||
sub_8103D8C(2);
|
||||
sSlotMachine->state = 2;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81022F0(struct Task *task)
|
||||
{
|
||||
if (++task->data[1] > 64)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
sSlotMachine->state = 19;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8102318(struct Task *task)
|
||||
{
|
||||
NewMenuHelpers_DrawDialogueFrame(0, 0);
|
||||
PrintTextOnWindow(0, 1, gText_QuitTheGame, 0, 1, 0, 0);
|
||||
CopyWindowToVram(0, 3);
|
||||
sub_80323CC(0x15, 7, 0x214, 0x180, 0xE, 0xF);
|
||||
sSlotMachine->state = 22;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8102344(struct Task *task)
|
||||
{
|
||||
s8 input = ProcessMenuInputNoWrap_();
|
||||
if (input == 0)
|
||||
{
|
||||
sub_8197434(0, TRUE);
|
||||
sub_8103D8C(0);
|
||||
sub_8103D8C(1);
|
||||
sub_8103D8C(2);
|
||||
sSlotMachine->coins += sSlotMachine->bet;
|
||||
sSlotMachine->state = 27;
|
||||
}
|
||||
else if (input == 1 || input == -1)
|
||||
{
|
||||
sub_8197434(0, TRUE);
|
||||
sSlotMachine->state = 5;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_810239C(struct Task *task)
|
||||
{
|
||||
NewMenuHelpers_DrawDialogueFrame(0, 0);
|
||||
PrintTextOnWindow(0, 1, gText_YouveGot9999Coins, 0, 1, 0, 0);
|
||||
CopyWindowToVram(0, 3);
|
||||
sSlotMachine->state = 24;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81023B8(struct Task *task)
|
||||
{
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
{
|
||||
sub_8197434(0, TRUE);
|
||||
sSlotMachine->state = 5;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81023E0_(struct Task *task)
|
||||
{
|
||||
NewMenuHelpers_DrawDialogueFrame(0, 0);
|
||||
PrintTextOnWindow(0, 1, gText_YouveRunOutOfCoins, 0, 1, 0, 0);
|
||||
CopyWindowToVram(0, 3);
|
||||
sSlotMachine->state = 26;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81023FC(struct Task *task)
|
||||
{
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
{
|
||||
sub_8197434(0, TRUE);
|
||||
sSlotMachine->state = 27;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8102424(struct Task *task)
|
||||
{
|
||||
SetCoins(sSlotMachine->coins);
|
||||
sub_80EDD78(GetCoins());
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
|
||||
sSlotMachine->state++;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_8102460(struct Task *task)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
SetMainCallback2(sSlotMachine->prevMainCb);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAF4);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAF8);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAFC);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB00);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB04);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB08);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB0C);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB10);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB14);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB18);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB1C);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB20);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB24);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB28);
|
||||
if (gUnknown_0203AAE4 != NULL)
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAE4);
|
||||
if (gUnknown_0203AAE8 != NULL)
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAE8);
|
||||
if (gUnknown_0203AAEC != NULL)
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAEC);
|
||||
if (gUnknown_0203AAF0 != NULL)
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAF0);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAC8);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AACC);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAD0);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAD4);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAD8);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AADC);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AAE0);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB2C);
|
||||
FREE_AND_SET_NULL(gUnknown_0203AB30);
|
||||
|
||||
FREE_AND_SET_NULL(sSlotMachine);
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void sub_8102484(void)
|
||||
{
|
||||
u8 r3;
|
||||
|
||||
if (sSlotMachine->unk0A == 0)
|
||||
{
|
||||
if (!(sSlotMachine->unk04 & 0xc0))
|
||||
{
|
||||
if (sub_8102540_())
|
||||
{
|
||||
r3 = sub_8102578();
|
||||
if (r3 != 3)
|
||||
{
|
||||
sSlotMachine->unk04 |= gUnknown_083ECE42[r3];
|
||||
if (r3 != 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
r3 = sub_81025BC();
|
||||
if (r3 != 5)
|
||||
{
|
||||
sSlotMachine->unk04 |= gUnknown_083ECE48[r3];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_81024F0(void)
|
||||
{
|
||||
sSlotMachine->unk06 = 0;
|
||||
if (sSlotMachine->unk04)
|
||||
sSlotMachine->unk06 = 1;
|
||||
}
|
||||
|
||||
u8 sub_810250C(u8 a0)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if (a0 & 1)
|
||||
return gUnknown_083ECE3A[i];
|
||||
a0 >>= 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool8 sub_8102540_(void)
|
||||
{
|
||||
u8 rval = Random();
|
||||
if (gUnknown_083ECD04[sSlotMachine->unk01][sSlotMachine->bet - 1] > rval)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
extern const u8 gUnknown_083ECD16[][6];
|
||||
extern const u8 gUnknown_083ECD28[][6];
|
||||
extern const u8 gUnknown_083ECD46[][17];
|
||||
extern const u8 gUnknown_083ECDAC[][17];
|
||||
|
||||
u8 sub_8102578(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
s16 rval = Random() & 0xff;
|
||||
s16 value = gUnknown_083ECD16[i][sSlotMachine->unk01];
|
||||
if (value > rval)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
u8 sub_81025BC(void)
|
||||
{
|
||||
s16 i;
|
||||
|
||||
for (i = 0; i < 5; i++)
|
||||
{
|
||||
s16 rval = Random() & 0xff;
|
||||
s16 r3 = gUnknown_083ECD28[i][sSlotMachine->unk01];
|
||||
if (i == 0 && sSlotMachine->unk03 == 1)
|
||||
{
|
||||
r3 += 10;
|
||||
if (r3 > 0x100)
|
||||
r3 = 0x100;
|
||||
}
|
||||
else if (i == 4 && sSlotMachine->unk03 == 1)
|
||||
{
|
||||
r3 -= 10;
|
||||
if (r3 < 0)
|
||||
r3 = 0;
|
||||
}
|
||||
if (r3 > rval)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
u8 sub_810264C(u8 a0)
|
||||
{
|
||||
if (sSlotMachine->unk03 == 0)
|
||||
return gUnknown_083ECD46[a0][sSlotMachine->pikaPower];
|
||||
else
|
||||
return gUnknown_083ECDAC[a0][sSlotMachine->pikaPower];
|
||||
}
|
||||
|
||||
void sub_8102680(void)
|
||||
{
|
||||
u8 rval;
|
||||
s16 i;
|
||||
|
||||
sSlotMachine->unk05 = 0;
|
||||
rval = Random();
|
||||
if (rval < sub_810264C(0))
|
||||
return;
|
||||
for (i = 5; i > 0; i--)
|
||||
{
|
||||
rval = Random();
|
||||
if (rval < sub_810264C(i))
|
||||
break;
|
||||
}
|
||||
sSlotMachine->unk05 = i;
|
||||
}
|
||||
|
||||
extern const u16 gUnknown_083ECE12[];
|
||||
extern const u16 gUnknown_083ECE1C[][2];
|
||||
extern const u16 gUnknown_083ECE30[];
|
||||
extern const u16 sSlotMatchFlags[];
|
||||
extern const u16 sSlotPayouts[];
|
||||
|
||||
bool8 sub_81026DC(u16 a0)
|
||||
{
|
||||
u16 rval = Random() & 0xff;
|
||||
if (rval < gUnknown_083ECE12[a0])
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u16 dp15_jump_random_unknown(void)
|
||||
{
|
||||
u8 r4 = 0;
|
||||
u8 rval;
|
||||
u8 value;
|
||||
if (sSlotMachine->unk10 >= 300)
|
||||
r4 = 4;
|
||||
else if (sSlotMachine->unk10 >= 250)
|
||||
r4 = 3;
|
||||
else if (sSlotMachine->unk10 >= 200)
|
||||
r4 = 2;
|
||||
else if (sSlotMachine->unk10 >= 150)
|
||||
r4 = 1;
|
||||
rval = Random() % 100;
|
||||
value = gUnknown_083ECE1C[r4][0];
|
||||
if (rval < value)
|
||||
return 4;
|
||||
rval = Random() % 100;
|
||||
value = gUnknown_083ECE1C[r4][1] + gUnknown_083ECE30[sSlotMachine->unk0B];
|
||||
if (rval < value)
|
||||
return 2;
|
||||
return 8;
|
||||
}
|
||||
|
||||
void CheckMatch(void)
|
||||
{
|
||||
sSlotMachine->matchedSymbols = 0;
|
||||
CheckMatch_CenterRow();
|
||||
if (sSlotMachine->bet > 1)
|
||||
CheckMatch_TopAndBottom();
|
||||
if (sSlotMachine->bet > 2)
|
||||
CheckMatch_Diagonals();
|
||||
}
|
||||
|
||||
void CheckMatch_CenterRow(void)
|
||||
{
|
||||
u8 c1, c2, c3, match;
|
||||
|
||||
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 2);
|
||||
c2 = GetTagOfReelSymbolOnScreenAtPos(1, 2);
|
||||
c3 = GetTagOfReelSymbolOnScreenAtPos(2, 2);
|
||||
match = GetMatchFromSymbolsInRow(c1, c2, c3);
|
||||
if (match != SLOT_MACHINE_MATCHED_NONE)
|
||||
{
|
||||
sSlotMachine->payout += sSlotPayouts[match];
|
||||
sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
|
||||
sub_8103E04(0);
|
||||
}
|
||||
}
|
||||
|
||||
void CheckMatch_TopAndBottom(void)
|
||||
{
|
||||
u8 c1, c2, c3, match;
|
||||
|
||||
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 1);
|
||||
c2 = GetTagOfReelSymbolOnScreenAtPos(1, 1);
|
||||
c3 = GetTagOfReelSymbolOnScreenAtPos(2, 1);
|
||||
match = GetMatchFromSymbolsInRow(c1, c2, c3);
|
||||
if (match != SLOT_MACHINE_MATCHED_NONE)
|
||||
{
|
||||
if (match == SLOT_MACHINE_MATCHED_1CHERRY)
|
||||
match = SLOT_MACHINE_MATCHED_2CHERRY;
|
||||
sSlotMachine->payout += sSlotPayouts[match];
|
||||
sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
|
||||
sub_8103E04(1);
|
||||
}
|
||||
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 3);
|
||||
c2 = GetTagOfReelSymbolOnScreenAtPos(1, 3);
|
||||
c3 = GetTagOfReelSymbolOnScreenAtPos(2, 3);
|
||||
match = GetMatchFromSymbolsInRow(c1, c2, c3);
|
||||
if (match != SLOT_MACHINE_MATCHED_NONE)
|
||||
{
|
||||
if (match == SLOT_MACHINE_MATCHED_1CHERRY)
|
||||
match = SLOT_MACHINE_MATCHED_2CHERRY;
|
||||
sSlotMachine->payout += sSlotPayouts[match];
|
||||
sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
|
||||
sub_8103E04(2);
|
||||
}
|
||||
}
|
||||
|
||||
void CheckMatch_Diagonals(void)
|
||||
{
|
||||
u8 c1, c2, c3, match;
|
||||
|
||||
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 1);
|
||||
c2 = GetTagOfReelSymbolOnScreenAtPos(1, 2);
|
||||
c3 = GetTagOfReelSymbolOnScreenAtPos(2, 3);
|
||||
match = GetMatchFromSymbolsInRow(c1, c2, c3);
|
||||
if (match != SLOT_MACHINE_MATCHED_NONE)
|
||||
{
|
||||
if (match != SLOT_MACHINE_MATCHED_1CHERRY)
|
||||
{
|
||||
sSlotMachine->payout += sSlotPayouts[match];
|
||||
sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
|
||||
}
|
||||
sub_8103E04(3);
|
||||
}
|
||||
c1 = GetTagOfReelSymbolOnScreenAtPos(0, 3);
|
||||
c2 = GetTagOfReelSymbolOnScreenAtPos(1, 2);
|
||||
c3 = GetTagOfReelSymbolOnScreenAtPos(2, 1);
|
||||
match = GetMatchFromSymbolsInRow(c1, c2, c3);
|
||||
if (match != SLOT_MACHINE_MATCHED_NONE)
|
||||
{
|
||||
if (match != SLOT_MACHINE_MATCHED_1CHERRY)
|
||||
{
|
||||
sSlotMachine->payout += sSlotPayouts[match];
|
||||
sSlotMachine->matchedSymbols |= sSlotMatchFlags[match];
|
||||
}
|
||||
sub_8103E04(4);
|
||||
}
|
||||
}
|
||||
|
||||
extern const u8 sSym2Match[];
|
||||
|
||||
u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3)
|
||||
{
|
||||
if (c1 == c2 && c1 == c3)
|
||||
return sSym2Match[c1];
|
||||
if (c1 == SLOT_MACHINE_TAG_7_RED && c2 == SLOT_MACHINE_TAG_7_RED && c3 == SLOT_MACHINE_TAG_7_BLUE)
|
||||
return SLOT_MACHINE_MATCHED_777_MIXED;
|
||||
if (c1 == SLOT_MACHINE_TAG_7_BLUE && c2 == SLOT_MACHINE_TAG_7_BLUE && c3 == SLOT_MACHINE_TAG_7_RED)
|
||||
return SLOT_MACHINE_MATCHED_777_MIXED;
|
||||
if (c1 == SLOT_MACHINE_TAG_CHERRY)
|
||||
return SLOT_MACHINE_MATCHED_1CHERRY;
|
||||
return SLOT_MACHINE_MATCHED_NONE;
|
||||
}
|
||||
|
||||
void sub_8102A24(void)
|
||||
{
|
||||
sub_8102A64(CreateTask(sub_8102A64, 4));
|
||||
}
|
||||
|
||||
bool8 sub_8102A44(void)
|
||||
{
|
||||
if (FindTaskIdByFunc(sub_8102A64) == 0xff)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -593,7 +593,7 @@ gUnknown_0203AB2C: @ 203AB2C
|
||||
gUnknown_0203AB30: @ 203AB30
|
||||
.space 0x4
|
||||
|
||||
gUnknown_0203AB34: @ 203AB34
|
||||
sSlotMachine: @ 203AB34
|
||||
.space 0x4
|
||||
|
||||
.include "src/battle_ai_script_commands.o"
|
||||
|
Loading…
Reference in New Issue
Block a user