Sync macros to have Give/Take Add/Remove unity
This commit is contained in:
+2
-2
@@ -19,7 +19,7 @@ void SetCoins(u16 coinAmount)
|
||||
gSaveBlock1Ptr->coins = coinAmount ^ gSaveBlock2Ptr->encryptionKey;
|
||||
}
|
||||
|
||||
bool8 GiveCoins(u16 toAdd)
|
||||
bool8 AddCoins(u16 toAdd)
|
||||
{
|
||||
u16 coins = GetCoins();
|
||||
if (coins >= MAX_COINS)
|
||||
@@ -39,7 +39,7 @@ bool8 GiveCoins(u16 toAdd)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool8 TakeCoins(u16 toSub)
|
||||
bool8 RemoveCoins(u16 toSub)
|
||||
{
|
||||
u16 coins = GetCoins();
|
||||
if (coins >= toSub)
|
||||
|
||||
+9
-9
@@ -463,7 +463,7 @@ bool8 ScrCmd_random(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_giveitem(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_additem(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 itemId = VarGet(ScriptReadHalfword(ctx));
|
||||
u32 quantity = VarGet(ScriptReadHalfword(ctx));
|
||||
@@ -473,7 +473,7 @@ bool8 ScrCmd_giveitem(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_takeitem(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_removeitem(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 itemId = VarGet(ScriptReadHalfword(ctx));
|
||||
u32 quantity = VarGet(ScriptReadHalfword(ctx));
|
||||
@@ -508,7 +508,7 @@ bool8 ScrCmd_checkitemtype(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_givepcitem(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_addpcitem(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 itemId = VarGet(ScriptReadHalfword(ctx));
|
||||
u16 quantity = VarGet(ScriptReadHalfword(ctx));
|
||||
@@ -1797,7 +1797,7 @@ bool8 ScrCmd_checkpartymove(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_givemoney(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_addmoney(struct ScriptContext *ctx)
|
||||
{
|
||||
u32 amount = ScriptReadWord(ctx);
|
||||
u8 ignore = ScriptReadByte(ctx);
|
||||
@@ -1807,7 +1807,7 @@ bool8 ScrCmd_givemoney(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_takemoney(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_removemoney(struct ScriptContext *ctx)
|
||||
{
|
||||
u32 amount = ScriptReadWord(ctx);
|
||||
u8 ignore = ScriptReadByte(ctx);
|
||||
@@ -2202,22 +2202,22 @@ bool8 ScrCmd_checkcoins(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_givecoins(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_addcoins(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (GiveCoins(coins) == TRUE)
|
||||
if (AddCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 ScrCmd_takecoins(struct ScriptContext *ctx)
|
||||
bool8 ScrCmd_removecoins(struct ScriptContext *ctx)
|
||||
{
|
||||
u16 coins = VarGet(ScriptReadHalfword(ctx));
|
||||
|
||||
if (TakeCoins(coins) == TRUE)
|
||||
if (RemoveCoins(coins) == TRUE)
|
||||
gSpecialVar_Result = 0;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
|
||||
+5
-5
@@ -768,7 +768,7 @@ static void MainTask_SlotsGameLoop(u8 taskId)
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
sSlotMachineState->bet++;
|
||||
TakeCoins(1);
|
||||
RemoveCoins(1);
|
||||
PlaySE(SE_REGI);
|
||||
sub_8141148(8, 0);
|
||||
sub_8141148(2, 1);
|
||||
@@ -780,7 +780,7 @@ static void MainTask_SlotsGameLoop(u8 taskId)
|
||||
if (GetCoins() >= toAdd)
|
||||
{
|
||||
sSlotMachineState->bet = 3;
|
||||
TakeCoins(toAdd);
|
||||
RemoveCoins(toAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -927,7 +927,7 @@ static void MainTask_ConfirmExitGame(u8 taskId)
|
||||
switch (Menu_ProcessInputNoWrapClearOnChoose())
|
||||
{
|
||||
case 0:
|
||||
GiveCoins(sSlotMachineState->bet);
|
||||
AddCoins(sSlotMachineState->bet);
|
||||
sub_8141148(8, 0);
|
||||
data[0] = 3;
|
||||
break;
|
||||
@@ -1008,7 +1008,7 @@ static void MainTask_WinHandlePayout(u8 taskId)
|
||||
{
|
||||
if (IsFanfareTaskInactive() && JOY_NEW(START_BUTTON))
|
||||
{
|
||||
GiveCoins(sSlotMachineState->payout);
|
||||
AddCoins(sSlotMachineState->payout);
|
||||
sSlotMachineState->payout = 0;
|
||||
}
|
||||
else
|
||||
@@ -1020,7 +1020,7 @@ static void MainTask_WinHandlePayout(u8 taskId)
|
||||
PlaySE(SE_PIN);
|
||||
if (sSlotMachineState->payout != 0)
|
||||
{
|
||||
GiveCoins(1);
|
||||
AddCoins(1);
|
||||
sSlotMachineState->payout--;
|
||||
}
|
||||
data[1] = 8;
|
||||
|
||||
Reference in New Issue
Block a user