mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Label slot machine ids, fix GetPriceReduction
This commit is contained in:
parent
63c5905914
commit
5d9c31a610
@ -1107,10 +1107,10 @@
|
|||||||
.4byte \products
|
.4byte \products
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Starts up the slot machine minigame.
|
@ Starts up the slot machine minigame. id is a SLOT_MACHINE_* value that influences probabilities of certain reel outcomes.
|
||||||
.macro playslotmachine word:req
|
.macro playslotmachine id:req
|
||||||
.byte 0x89
|
.byte 0x89
|
||||||
.2byte \word
|
.2byte \id
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Sets a berry tree's specific berry and growth stage.
|
@ Sets a berry tree's specific berry and growth stage.
|
||||||
@ -1197,7 +1197,7 @@
|
|||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ Gets the price reduction for the index given.
|
@ Gets the price reduction for the index given.
|
||||||
.macro getpricereduction index:req
|
.macro getpokenewsactive index:req
|
||||||
.byte 0x96
|
.byte 0x96
|
||||||
.2byte \index
|
.2byte \index
|
||||||
.endm
|
.endm
|
||||||
|
@ -17,7 +17,7 @@ LilycoveCity_ContestLobby_OnTransition:
|
|||||||
end
|
end
|
||||||
|
|
||||||
LilycoveCity_ContestLobby_EventScript_TryShowBlendMaster::
|
LilycoveCity_ContestLobby_EventScript_TryShowBlendMaster::
|
||||||
getpricereduction POKENEWS_BLENDMASTER
|
getpokenewsactive POKENEWS_BLENDMASTER
|
||||||
compare VAR_RESULT, TRUE
|
compare VAR_RESULT, TRUE
|
||||||
goto_if_eq LilycoveCity_ContestLobby_EventScript_ShowBlendMaster
|
goto_if_eq LilycoveCity_ContestLobby_EventScript_ShowBlendMaster
|
||||||
clearflag FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT
|
clearflag FLAG_HIDE_LILYCOVE_CONTEST_HALL_BLEND_MASTER_REPLACEMENT
|
||||||
|
@ -3,7 +3,7 @@ LilycoveCity_DepartmentStoreRooftop_MapScripts::
|
|||||||
.byte 0
|
.byte 0
|
||||||
|
|
||||||
LilycoveCity_DepartmentStoreRooftop_OnTransition:
|
LilycoveCity_DepartmentStoreRooftop_OnTransition:
|
||||||
getpricereduction POKENEWS_LILYCOVE
|
getpokenewsactive POKENEWS_LILYCOVE
|
||||||
compare VAR_RESULT, TRUE
|
compare VAR_RESULT, TRUE
|
||||||
call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman
|
call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ShowSaleWoman
|
||||||
compare VAR_RESULT, FALSE
|
compare VAR_RESULT, FALSE
|
||||||
@ -51,7 +51,7 @@ LilycoveCity_DepartmentStoreRooftop_PokemartDecor_ClearOutSale:
|
|||||||
LilycoveCity_DepartmentStoreRooftop_EventScript_Man::
|
LilycoveCity_DepartmentStoreRooftop_EventScript_Man::
|
||||||
lock
|
lock
|
||||||
faceplayer
|
faceplayer
|
||||||
getpricereduction POKENEWS_LILYCOVE
|
getpokenewsactive POKENEWS_LILYCOVE
|
||||||
compare VAR_RESULT, TRUE
|
compare VAR_RESULT, TRUE
|
||||||
call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ManClearOutSale
|
call_if_eq LilycoveCity_DepartmentStoreRooftop_EventScript_ManClearOutSale
|
||||||
msgbox LilycoveCity_DepartmentStoreRooftop_Text_SetDatesForClearOutSales, MSGBOX_DEFAULT
|
msgbox LilycoveCity_DepartmentStoreRooftop_Text_SetDatesForClearOutSales, MSGBOX_DEFAULT
|
||||||
|
@ -150,7 +150,7 @@ gScriptCmdTable::
|
|||||||
.4byte ScrCmd_showmoneybox @ 0x93
|
.4byte ScrCmd_showmoneybox @ 0x93
|
||||||
.4byte ScrCmd_hidemoneybox @ 0x94
|
.4byte ScrCmd_hidemoneybox @ 0x94
|
||||||
.4byte ScrCmd_updatemoneybox @ 0x95
|
.4byte ScrCmd_updatemoneybox @ 0x95
|
||||||
.4byte ScrCmd_getpricereduction @ 0x96
|
.4byte ScrCmd_getpokenewsactive @ 0x96
|
||||||
.4byte ScrCmd_fadescreen @ 0x97
|
.4byte ScrCmd_fadescreen @ 0x97
|
||||||
.4byte ScrCmd_fadescreenspeed @ 0x98
|
.4byte ScrCmd_fadescreenspeed @ 0x98
|
||||||
.4byte ScrCmd_setflashradius @ 0x99
|
.4byte ScrCmd_setflashradius @ 0x99
|
||||||
|
@ -3,7 +3,7 @@ Roulette_EventScript_Table1::
|
|||||||
compare VAR_RESULT, FALSE
|
compare VAR_RESULT, FALSE
|
||||||
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
|
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
|
||||||
setvar VAR_0x8004, 0
|
setvar VAR_0x8004, 0
|
||||||
getpricereduction POKENEWS_GAME_CORNER
|
getpokenewsactive POKENEWS_GAME_CORNER
|
||||||
compare VAR_RESULT, FALSE
|
compare VAR_RESULT, FALSE
|
||||||
goto_if_eq Roulette_EventScript_Play
|
goto_if_eq Roulette_EventScript_Play
|
||||||
addvar VAR_0x8004, ROULETTE_SPECIAL_RATE
|
addvar VAR_0x8004, ROULETTE_SPECIAL_RATE
|
||||||
@ -15,7 +15,7 @@ Roulette_EventScript_Table2::
|
|||||||
compare VAR_RESULT, FALSE
|
compare VAR_RESULT, FALSE
|
||||||
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
|
goto_if_eq MauvilleCity_GameCorner_EventScript_NoCoinCase
|
||||||
setvar VAR_0x8004, 1
|
setvar VAR_0x8004, 1
|
||||||
getpricereduction POKENEWS_GAME_CORNER
|
getpokenewsactive POKENEWS_GAME_CORNER
|
||||||
compare VAR_RESULT, FALSE
|
compare VAR_RESULT, FALSE
|
||||||
goto_if_eq Roulette_EventScript_Play
|
goto_if_eq Roulette_EventScript_Play
|
||||||
addvar VAR_0x8004, ROULETTE_SPECIAL_RATE
|
addvar VAR_0x8004, ROULETTE_SPECIAL_RATE
|
||||||
|
@ -3,4 +3,13 @@
|
|||||||
|
|
||||||
#define SLOT_MACHINE_COUNT 12
|
#define SLOT_MACHINE_COUNT 12
|
||||||
|
|
||||||
|
// Slot machine IDs
|
||||||
|
#define SLOT_MACHINE_UNLUCKIEST 0
|
||||||
|
#define SLOT_MACHINE_UNLUCKIER 1
|
||||||
|
#define SLOT_MACHINE_UNLUCKY 2
|
||||||
|
#define SLOT_MACHINE_LUCKY 3
|
||||||
|
#define SLOT_MACHINE_LUCKIER 4
|
||||||
|
#define SLOT_MACHINE_LUCKIEST 5
|
||||||
|
#define NUM_SLOT_MACHINE_IDS 6
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_SLOT_MACHINE_H
|
#endif // GUARD_CONSTANTS_SLOT_MACHINE_H
|
||||||
|
@ -19,7 +19,7 @@ void HideBattleTowerReporter(void);
|
|||||||
void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx);
|
void ReceiveTvShowsData(void *src, u32 size, u8 masterIdx);
|
||||||
void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
|
void TryPutSpotTheCutiesOnAir(struct Pokemon *pokemon, u8 ribbonMonDataIdx);
|
||||||
u32 GetPlayerIDAsU32(void);
|
u32 GetPlayerIDAsU32(void);
|
||||||
bool8 GetPriceReduction(u8 newsKind);
|
bool8 IsPokeNewsActive(u8 newsKind);
|
||||||
void SanitizeTVShowLocationsForRuby(TVShow *shows);
|
void SanitizeTVShowLocationsForRuby(TVShow *shows);
|
||||||
size_t CountDigits(int value);
|
size_t CountDigits(int value);
|
||||||
u8 GetRibbonCount(struct Pokemon *pokemon);
|
u8 GetRibbonCount(struct Pokemon *pokemon);
|
||||||
|
@ -1330,15 +1330,40 @@ void BufferEReaderTrainerName(void)
|
|||||||
|
|
||||||
u16 GetSlotMachineId(void)
|
u16 GetSlotMachineId(void)
|
||||||
{
|
{
|
||||||
static const u8 sSlotMachineRandomSeeds[] = {12, 2, 4, 5, 1, 8, 7, 11, 3, 10, 9, 6};
|
static const u8 sSlotMachineRandomSeeds[SLOT_MACHINE_COUNT] = {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 sSlotMachineIds[SLOT_MACHINE_COUNT] = {
|
||||||
static const u8 sSlotMachineServiceDayIds[] = {3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5};
|
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];
|
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 sSlotMachineServiceDayIds[rnd % SLOT_MACHINE_COUNT];
|
||||||
}
|
|
||||||
return sSlotMachineIds[rnd % SLOT_MACHINE_COUNT];
|
return sSlotMachineIds[rnd % SLOT_MACHINE_COUNT];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1936,11 +1936,11 @@ bool8 ScrCmd_setberrytree(struct ScriptContext *ctx)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 ScrCmd_getpricereduction(struct ScriptContext *ctx)
|
bool8 ScrCmd_getpokenewsactive(struct ScriptContext *ctx)
|
||||||
{
|
{
|
||||||
u16 newsKind = VarGet(ScriptReadHalfword(ctx));
|
u16 newsKind = VarGet(ScriptReadHalfword(ctx));
|
||||||
|
|
||||||
gSpecialVar_Result = GetPriceReduction(newsKind);
|
gSpecialVar_Result = IsPokeNewsActive(newsKind);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -562,7 +562,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y)
|
|||||||
{
|
{
|
||||||
ConvertIntToDecimalStringN(
|
ConvertIntToDecimalStringN(
|
||||||
gStringVar1,
|
gStringVar1,
|
||||||
ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT),
|
ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT),
|
||||||
STR_CONV_MODE_LEFT_ALIGN,
|
STR_CONV_MODE_LEFT_ALIGN,
|
||||||
5);
|
5);
|
||||||
}
|
}
|
||||||
@ -934,7 +934,7 @@ static void Task_BuyMenu(u8 taskId)
|
|||||||
|
|
||||||
if (sMartInfo.martType == MART_TYPE_NORMAL)
|
if (sMartInfo.martType == MART_TYPE_NORMAL)
|
||||||
{
|
{
|
||||||
sShopData->totalCost = (ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT));
|
sShopData->totalCost = (ItemId_GetPrice(itemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1014,7 +1014,7 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId)
|
|||||||
|
|
||||||
if (AdjustQuantityAccordingToDPadInput(&tItemCount, sShopData->maxQuantity) == TRUE)
|
if (AdjustQuantityAccordingToDPadInput(&tItemCount, sShopData->maxQuantity) == TRUE)
|
||||||
{
|
{
|
||||||
sShopData->totalCost = (ItemId_GetPrice(tItemId) >> GetPriceReduction(POKENEWS_SLATEPORT)) * tItemCount;
|
sShopData->totalCost = (ItemId_GetPrice(tItemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)) * tItemCount;
|
||||||
BuyMenuPrintItemQuantityAndPrice(taskId);
|
BuyMenuPrintItemQuantityAndPrice(taskId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -557,10 +557,10 @@ static struct SpriteFrameImage *sImageTables_DigitalDisplay[NUM_DIG_DISPLAY_SPRI
|
|||||||
// Const rom data.
|
// Const rom data.
|
||||||
static const struct DigitalDisplaySprite *const sDigitalDisplayScenes[];
|
static const struct DigitalDisplaySprite *const sDigitalDisplayScenes[];
|
||||||
static const u16 sUnkPalette[];
|
static const u16 sUnkPalette[];
|
||||||
static const u8 sLuckyRoundProbabilities[][3];
|
static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET];
|
||||||
static const u8 sBiasTags[];
|
static const u8 sBiasTags[];
|
||||||
static const u16 sLuckyFlagSettings_Top3[];
|
static const u16 sLuckyFlagSettings_Top3[3];
|
||||||
static const u16 sLuckyFlagSettings_NotTop3[];
|
static const u16 sLuckyFlagSettings_NotTop3[5];
|
||||||
static const s16 sDigitalDisplay_SpriteCoords[][2];
|
static const s16 sDigitalDisplay_SpriteCoords[][2];
|
||||||
static const SpriteCallback sDigitalDisplay_SpriteCallbacks[];
|
static const SpriteCallback sDigitalDisplay_SpriteCallbacks[];
|
||||||
static const struct SpriteTemplate *const sSpriteTemplates_DigitalDisplay[NUM_DIG_DISPLAY_SPRITES];
|
static const struct SpriteTemplate *const sSpriteTemplates_DigitalDisplay[NUM_DIG_DISPLAY_SPRITES];
|
||||||
@ -582,8 +582,8 @@ static const struct SpriteSheet sSlotMachineSpriteSheets[22];
|
|||||||
static const struct SpritePalette sSlotMachineSpritePalettes[];
|
static const struct SpritePalette sSlotMachineSpritePalettes[];
|
||||||
static const u16 *const sDigitalDisplay_Pal;
|
static const u16 *const sDigitalDisplay_Pal;
|
||||||
static const s16 sInitialReelPositions[NUM_REELS][2];
|
static const s16 sInitialReelPositions[NUM_REELS][2];
|
||||||
static const u8 sLuckyFlagProbabilities_Top3[][6];
|
static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS];
|
||||||
static const u8 sLuckyFlagProbabilities_NotTop3[][6];
|
static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS];
|
||||||
static const u8 sReeltimeProbabilities_UnluckyGame[][17];
|
static const u8 sReeltimeProbabilities_UnluckyGame[][17];
|
||||||
static const u8 sReelTimeProbabilities_LuckyGame[][17];
|
static const u8 sReelTimeProbabilities_LuckyGame[][17];
|
||||||
static const u8 sSymToMatch[];
|
static const u8 sSymToMatch[];
|
||||||
@ -1651,24 +1651,20 @@ static void DrawLuckyFlags(void)
|
|||||||
if (IsThisRoundLucky())
|
if (IsThisRoundLucky())
|
||||||
{
|
{
|
||||||
attempts = AttemptsAtLuckyFlags_Top3();
|
attempts = AttemptsAtLuckyFlags_Top3();
|
||||||
if (attempts != 3) // if you found a lucky number
|
if (attempts != ARRAY_COUNT(sLuckyFlagSettings_Top3)) // if you found a lucky number
|
||||||
{
|
{
|
||||||
// attempts == 1: reelTime flag set
|
// attempts == 1: reelTime flag set
|
||||||
sSlotMachine->luckyFlags |= sLuckyFlagSettings_Top3[attempts];
|
sSlotMachine->luckyFlags |= sLuckyFlagSettings_Top3[attempts];
|
||||||
if (attempts != 1)
|
if (attempts != 1)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// if it's not a lucky round or you got reel time, roll for the lower lucky flags
|
// if it's not a lucky round or you got reel time, roll for the lower lucky flags
|
||||||
attempts = AttemptsAtLuckyFlags_NotTop3();
|
attempts = AttemptsAtLuckyFlags_NotTop3();
|
||||||
if (attempts != 5) // if you found a lucky number
|
if (attempts != ARRAY_COUNT(sLuckyFlagSettings_NotTop3)) // if you found a lucky number
|
||||||
{
|
|
||||||
sSlotMachine->luckyFlags |= sLuckyFlagSettings_NotTop3[attempts];
|
sSlotMachine->luckyFlags |= sLuckyFlagSettings_NotTop3[attempts];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetLuckySpins(void)
|
static void SetLuckySpins(void)
|
||||||
@ -1704,7 +1700,7 @@ static u8 AttemptsAtLuckyFlags_Top3(void)
|
|||||||
{
|
{
|
||||||
s16 count;
|
s16 count;
|
||||||
|
|
||||||
for (count = 0; count < 3; count++)
|
for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_Top3); count++)
|
||||||
{
|
{
|
||||||
s16 rval = Random() & 0xff;
|
s16 rval = Random() & 0xff;
|
||||||
s16 value = sLuckyFlagProbabilities_Top3[count][sSlotMachine->machineId];
|
s16 value = sLuckyFlagProbabilities_Top3[count][sSlotMachine->machineId];
|
||||||
@ -1718,7 +1714,7 @@ static u8 AttemptsAtLuckyFlags_NotTop3(void)
|
|||||||
{
|
{
|
||||||
s16 count;
|
s16 count;
|
||||||
|
|
||||||
for (count = 0; count < 5; count++)
|
for (count = 0; count < (int)ARRAY_COUNT(sLuckyFlagSettings_NotTop3); count++)
|
||||||
{
|
{
|
||||||
s16 rval = Random() & 0xff; // random byte
|
s16 rval = Random() & 0xff; // random byte
|
||||||
s16 value = sLuckyFlagProbabilities_NotTop3[count][sSlotMachine->machineId];
|
s16 value = sLuckyFlagProbabilities_NotTop3[count][sSlotMachine->machineId];
|
||||||
@ -4807,27 +4803,83 @@ static const s16 sInitialReelPositions[NUM_REELS][2] = {
|
|||||||
[RIGHT_REEL] = {0, 2}
|
[RIGHT_REEL] = {0, 2}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sLuckyRoundProbabilities[][3] = {
|
static const u8 sLuckyRoundProbabilities[NUM_SLOT_MACHINE_IDS][MAX_BET] = {
|
||||||
{1, 1, 12},
|
[SLOT_MACHINE_UNLUCKIEST] = {1, 1, 12},
|
||||||
{1, 1, 14},
|
[SLOT_MACHINE_UNLUCKIER] = {1, 1, 14},
|
||||||
{2, 2, 14},
|
[SLOT_MACHINE_UNLUCKY] = {2, 2, 14},
|
||||||
{2, 2, 14},
|
[SLOT_MACHINE_LUCKY] = {2, 2, 14},
|
||||||
{2, 3, 16},
|
[SLOT_MACHINE_LUCKIER] = {2, 3, 16},
|
||||||
{3, 3, 16}
|
[SLOT_MACHINE_LUCKIEST] = {3, 3, 16}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sLuckyFlagProbabilities_Top3[][6] = {
|
static const u8 sLuckyFlagProbabilities_Top3[][NUM_SLOT_MACHINE_IDS] = {
|
||||||
{25, 25, 30, 40, 40, 50},
|
{ // Probabilities for LUCKY_BIAS_777
|
||||||
{25, 25, 30, 30, 35, 35},
|
[SLOT_MACHINE_UNLUCKIEST] = 25,
|
||||||
{25, 25, 30, 25, 25, 30}
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 40,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 40,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 50
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_REELTIME
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 35,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 35
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_MIXED_777
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 25,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 30
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sLuckyFlagProbabilities_NotTop3[][6] = {
|
static const u8 sLuckyFlagProbabilities_NotTop3[][NUM_SLOT_MACHINE_IDS] = {
|
||||||
{20, 25, 25, 20, 25, 25},
|
{ // Probabilities for LUCKY_BIAS_POWER
|
||||||
{12, 15, 15, 18, 19, 22},
|
[SLOT_MACHINE_UNLUCKIEST] = 20,
|
||||||
{25, 25, 25, 30, 30, 40},
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
{25, 25, 20, 20, 15, 15},
|
[SLOT_MACHINE_UNLUCKY] = 25,
|
||||||
{40, 40, 35, 35, 40, 40}
|
[SLOT_MACHINE_LUCKY] = 20,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 25
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_AZURILL
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 12,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 15,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 15,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 18,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 19,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 22
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_LOTAD
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 25,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 30,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 40
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_CHERRY
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 25,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 20,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 20,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 15,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 15
|
||||||
|
},
|
||||||
|
{ // Probabilities for LUCKY_BIAS_REPLAY
|
||||||
|
[SLOT_MACHINE_UNLUCKIEST] = 40,
|
||||||
|
[SLOT_MACHINE_UNLUCKIER] = 40,
|
||||||
|
[SLOT_MACHINE_UNLUCKY] = 35,
|
||||||
|
[SLOT_MACHINE_LUCKY] = 35,
|
||||||
|
[SLOT_MACHINE_LUCKIER] = 40,
|
||||||
|
[SLOT_MACHINE_LUCKIEST] = 40
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sReeltimeProbabilities_UnluckyGame[][17] = {
|
static const u8 sReeltimeProbabilities_UnluckyGame[][17] = {
|
||||||
@ -5708,7 +5760,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Insert =
|
|||||||
|
|
||||||
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Stop =
|
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Stop =
|
||||||
{
|
{
|
||||||
.tileTag = 18,
|
.tileTag = GFXTAG_STOP,
|
||||||
.paletteTag = PALTAG_DIG_DISPLAY,
|
.paletteTag = PALTAG_DIG_DISPLAY,
|
||||||
.oam = &sOam_8x8,
|
.oam = &sOam_8x8,
|
||||||
.anims = sAnims_SingleFrame,
|
.anims = sAnims_SingleFrame,
|
||||||
@ -5741,7 +5793,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Lose =
|
|||||||
|
|
||||||
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus =
|
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus =
|
||||||
{
|
{
|
||||||
.tileTag = 19,
|
.tileTag = GFXTAG_BONUS,
|
||||||
.paletteTag = PALTAG_DIG_DISPLAY,
|
.paletteTag = PALTAG_DIG_DISPLAY,
|
||||||
.oam = &sOam_8x8,
|
.oam = &sOam_8x8,
|
||||||
.anims = sAnims_SingleFrame,
|
.anims = sAnims_SingleFrame,
|
||||||
@ -5752,7 +5804,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Bonus =
|
|||||||
|
|
||||||
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big =
|
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big =
|
||||||
{
|
{
|
||||||
.tileTag = 20,
|
.tileTag = GFXTAG_BIG,
|
||||||
.paletteTag = PALTAG_DIG_DISPLAY,
|
.paletteTag = PALTAG_DIG_DISPLAY,
|
||||||
.oam = &sOam_8x8,
|
.oam = &sOam_8x8,
|
||||||
.anims = sAnims_SingleFrame,
|
.anims = sAnims_SingleFrame,
|
||||||
@ -5763,7 +5815,7 @@ static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Big =
|
|||||||
|
|
||||||
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Reg =
|
static const struct SpriteTemplate sSpriteTemplate_DigitalDisplay_Reg =
|
||||||
{
|
{
|
||||||
.tileTag = 21,
|
.tileTag = GFXTAG_REG,
|
||||||
.paletteTag = PALTAG_DIG_DISPLAY,
|
.paletteTag = PALTAG_DIG_DISPLAY,
|
||||||
.oam = &sOam_8x8,
|
.oam = &sOam_8x8,
|
||||||
.anims = sAnims_SingleFrame,
|
.anims = sAnims_SingleFrame,
|
||||||
|
14
src/tv.c
14
src/tv.c
@ -145,7 +145,7 @@ static void ResolveNumberOneShow(u16);
|
|||||||
static void TryPutFishingAdviceOnAir(void);
|
static void TryPutFishingAdviceOnAir(void);
|
||||||
static u8 MonDataIdxToRibbon(u8);
|
static u8 MonDataIdxToRibbon(u8);
|
||||||
static void TryPutNumberOneOnAir(u8);
|
static void TryPutNumberOneOnAir(u8);
|
||||||
static bool8 IsPriceDiscounted(u8);
|
static bool8 ShouldApplyPokeNewsEffect(u8);
|
||||||
static void TryPutWorldOfMastersOnAir(void);
|
static void TryPutWorldOfMastersOnAir(void);
|
||||||
static void InterviewBefore_FanClubLetter(void);
|
static void InterviewBefore_FanClubLetter(void);
|
||||||
static void InterviewBefore_RecentHappenings(void);
|
static void InterviewBefore_RecentHappenings(void);
|
||||||
@ -1525,7 +1525,7 @@ void TryPutSmartShopperOnAir(void)
|
|||||||
show->smartshopperShow.itemIds[i] = gMartPurchaseHistory[i].itemId;
|
show->smartshopperShow.itemIds[i] = gMartPurchaseHistory[i].itemId;
|
||||||
show->smartshopperShow.itemAmounts[i] = gMartPurchaseHistory[i].quantity;
|
show->smartshopperShow.itemAmounts[i] = gMartPurchaseHistory[i].quantity;
|
||||||
}
|
}
|
||||||
show->smartshopperShow.priceReduced = GetPriceReduction(POKENEWS_SLATEPORT);
|
show->smartshopperShow.priceReduced = IsPokeNewsActive(POKENEWS_SLATEPORT);
|
||||||
StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName);
|
StringCopy(show->smartshopperShow.playerName, gSaveBlock2Ptr->playerName);
|
||||||
StorePlayerIdInRecordMixShow(show);
|
StorePlayerIdInRecordMixShow(show);
|
||||||
show->smartshopperShow.language = gGameLanguage;
|
show->smartshopperShow.language = gGameLanguage;
|
||||||
@ -2641,7 +2641,7 @@ void DoPokeNews(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 GetPriceReduction(u8 newsKind)
|
bool8 IsPokeNewsActive(u8 newsKind)
|
||||||
{
|
{
|
||||||
u8 i;
|
u8 i;
|
||||||
|
|
||||||
@ -2652,7 +2652,7 @@ bool8 GetPriceReduction(u8 newsKind)
|
|||||||
{
|
{
|
||||||
if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind)
|
if (gSaveBlock1Ptr->pokeNews[i].kind == newsKind)
|
||||||
{
|
{
|
||||||
if (gSaveBlock1Ptr->pokeNews[i].state == 2 && IsPriceDiscounted(newsKind))
|
if (gSaveBlock1Ptr->pokeNews[i].state == 2 && ShouldApplyPokeNewsEffect(newsKind))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -2661,7 +2661,11 @@ bool8 GetPriceReduction(u8 newsKind)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool8 IsPriceDiscounted(u8 newsKind)
|
// Returns TRUE if the effects of the given PokeNews should be applied.
|
||||||
|
// For POKENEWS_SLATEPORT / POKENEWS_LILYCOVE, only apply the effect (price reduction)
|
||||||
|
// if the player is talking to the Energy Guru / at the Dept Store Rooftop.
|
||||||
|
// For any other type of PokeNews this is always TRUE.
|
||||||
|
static bool8 ShouldApplyPokeNewsEffect(u8 newsKind)
|
||||||
{
|
{
|
||||||
switch (newsKind)
|
switch (newsKind)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user