diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-01-13 22:35:09 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2020-01-13 22:35:09 -0500 |
commit | a5d8b98fde96a5a38dac13472d7964e5e8872cce (patch) | |
tree | 2906af9d415a948827d4c29fbbc02475cab0588d | |
parent | 8c560386edeecf0b40b4c9f58ceaac50f4f22397 (diff) |
Sync macros to have Give/Take Add/Remove unity
-rw-r--r-- | asm/macros/event.inc | 14 | ||||
-rw-r--r-- | data/event_scripts.s | 2 | ||||
-rw-r--r-- | data/maps/CeladonCity_DepartmentStore_Roof/scripts.inc | 6 | ||||
-rw-r--r-- | data/maps/CeladonCity_GameCorner/scripts.inc | 14 | ||||
-rw-r--r-- | data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc | 6 | ||||
-rw-r--r-- | data/maps/CinnabarIsland_Gym/scripts.inc | 12 | ||||
-rw-r--r-- | data/maps/FuchsiaCity_SafariZone_Entrance/scripts.inc | 2 | ||||
-rw-r--r-- | data/maps/PewterCity_Museum_1F/scripts.inc | 2 | ||||
-rw-r--r-- | data/maps/RocketHideout_B1F/scripts.inc | 2 | ||||
-rw-r--r-- | data/maps/Route4_PokemonCenter_1F/scripts.inc | 2 | ||||
-rw-r--r-- | data/script_cmd_table.inc | 14 | ||||
-rw-r--r-- | data/scripts/obtain_item.inc | 2 | ||||
-rw-r--r-- | include/coins.h | 4 | ||||
-rw-r--r-- | src/coins.c | 4 | ||||
-rw-r--r-- | src/scrcmd.c | 18 | ||||
-rw-r--r-- | src/slot_machine.c | 10 |
16 files changed, 57 insertions, 57 deletions
diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 5526b1e50..c5be83df9 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -488,7 +488,7 @@ .endm @ Adds a quantity amount of item index to the player's PC. Both arguments can be variables. - .macro givepcitem index:req, quantity:req + .macro addpcitem index:req, quantity:req .byte 0x49 .2byte \index .2byte \quantity @@ -1018,14 +1018,14 @@ .endm @ If check is 0x00, this command adds value to the player's money. - .macro givemoney value:req, check:req + .macro addmoney value:req, check:req .byte 0x90 .4byte \value .byte \check .endm @ If check is 0x00, this command subtracts value from the player's money. - .macro takemoney value:req, check:req + .macro removemoney value:req, check:req .byte 0x91 .4byte \value .byte \check @@ -1246,12 +1246,12 @@ .2byte \out .endm - .macro givecoins count:req + .macro addcoins count:req .byte 0xb4 .2byte \count .endm - .macro takecoins word:req + .macro removecoins word:req .byte 0xb5 .2byte \word .endm @@ -1539,7 +1539,7 @@ goto_if TRUE, \dest .endm - .macro goto_if_undefeated trainer:req, dest:req + .macro goto_if_not_defeated trainer:req, dest:req checktrainerflag \trainer goto_if FALSE, \dest .endm @@ -1549,7 +1549,7 @@ call_if TRUE, \dest .endm - .macro call_if_undefeated trainer:req, dest:req + .macro call_if_not_defeated trainer:req, dest:req checktrainerflag \trainer call_if FALSE, \dest .endm diff --git a/data/event_scripts.s b/data/event_scripts.s index 6096e9c57..8feeab864 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1910,7 +1910,7 @@ CeladonCity_GameCorner_EventScript_1B2867:: @ 81B2867 compare VAR_RESULT, FALSE goto_if_eq EventScript_1B292B playse SE_SHOP - takemoney 50, 0 + removemoney 50, 0 updatemoneybox 0, 0, 0 waitse message gUnknown_81B1E24 diff --git a/data/maps/CeladonCity_DepartmentStore_Roof/scripts.inc b/data/maps/CeladonCity_DepartmentStore_Roof/scripts.inc index 1b3a35399..6b19ebe66 100644 --- a/data/maps/CeladonCity_DepartmentStore_Roof/scripts.inc +++ b/data/maps/CeladonCity_DepartmentStore_Roof/scripts.inc @@ -246,15 +246,15 @@ EventScript_16C0A5:: @ 816C0A5 end EventScript_16C0B6:: @ 816C0B6 - takemoney 200, 0 + removemoney 200, 0 return EventScript_16C0BD:: @ 816C0BD - takemoney 300, 0 + removemoney 300, 0 return EventScript_16C0C4:: @ 816C0C4 - takemoney 350, 0 + removemoney 350, 0 return EventScript_16C0CB:: @ 816C0CB diff --git a/data/maps/CeladonCity_GameCorner/scripts.inc b/data/maps/CeladonCity_GameCorner/scripts.inc index bcd05a1b9..064e939e4 100644 --- a/data/maps/CeladonCity_GameCorner/scripts.inc +++ b/data/maps/CeladonCity_GameCorner/scripts.inc @@ -52,8 +52,8 @@ EventScript_16C706:: @ 816C706 checkmoney 10000, 0 compare VAR_RESULT, FALSE goto_if_eq EventScript_16C7AC - givecoins 500 - takemoney 10000, 0 + addcoins 500 + removemoney 10000, 0 goto EventScript_16C762 end @@ -64,8 +64,8 @@ EventScript_16C734:: @ 816C734 checkmoney 1000, 0 compare VAR_RESULT, FALSE goto_if_eq EventScript_16C7AC - givecoins 50 - takemoney 1000, 0 + addcoins 50 + removemoney 1000, 0 goto EventScript_16C762 end @@ -133,7 +133,7 @@ CeladonCity_GameCorner_EventScript_16C7E7:: @ 816C7E7 checkcoins VAR_TEMP_1 compare VAR_TEMP_1, 9990 goto_if_ge EventScript_16C82B - givecoins 10 + addcoins 10 textcolor 3 msgbox gUnknown_8196B0D playse SE_SHOP @@ -194,7 +194,7 @@ CeladonCity_GameCorner_EventScript_16C89E:: @ 816C89E checkcoins VAR_TEMP_1 compare VAR_TEMP_1, 9980 goto_if_ge EventScript_16C8E2 - givecoins 20 + addcoins 20 textcolor 3 msgbox gUnknown_8196D47 playse SE_SHOP @@ -222,7 +222,7 @@ CeladonCity_GameCorner_EventScript_16C8FE:: @ 816C8FE checkcoins VAR_TEMP_1 compare VAR_TEMP_1, 9980 goto_if_ge EventScript_16C942 - givecoins 20 + addcoins 20 textcolor 3 msgbox gUnknown_8196DF8 playse SE_SHOP diff --git a/data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc b/data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc index 20427a77a..f14f92430 100644 --- a/data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc +++ b/data/maps/CeladonCity_GameCorner_PrizeRoom/scripts.inc @@ -213,7 +213,7 @@ EventScript_16CDA5:: @ 816CDA5 end EventScript_16CDB3:: @ 816CDB3 - takecoins VAR_TEMP_2 + removecoins VAR_TEMP_2 updatecoinsbox 0, 5 getspeciesname 0, VAR_TEMP_1 playfanfare MUS_FANFA1 @@ -227,7 +227,7 @@ EventScript_16CDB3:: @ 816CDB3 end EventScript_16CDE0:: @ 816CDE0 - takecoins VAR_TEMP_2 + removecoins VAR_TEMP_2 updatecoinsbox 0, 5 getspeciesname 0, VAR_TEMP_1 playfanfare MUS_FANFA1 @@ -330,7 +330,7 @@ EventScript_16CF3F:: @ 816CF3F checkitemspace VAR_TEMP_1, 1 compare VAR_RESULT, FALSE goto_if_eq EventScript_16CF79 - takecoins VAR_TEMP_2 + removecoins VAR_TEMP_2 updatecoinsbox 0, 5 giveitem VAR_TEMP_1 goto EventScript_16CC10 diff --git a/data/maps/CinnabarIsland_Gym/scripts.inc b/data/maps/CinnabarIsland_Gym/scripts.inc index 15496a023..dc4633df7 100644 --- a/data/maps/CinnabarIsland_Gym/scripts.inc +++ b/data/maps/CinnabarIsland_Gym/scripts.inc @@ -251,7 +251,7 @@ EventScript_16DC68:: @ 816DC68 EventScript_16DC6A:: @ 816DC6A call EventScript_16DC34 - goto_if_undefeated TRAINER_BURGLAR_QUINN, EventScript_16DC7A + goto_if_not_defeated TRAINER_BURGLAR_QUINN, EventScript_16DC7A releaseall end @@ -327,7 +327,7 @@ EventScript_16DD31:: @ 816DD31 EventScript_16DD41:: @ 816DD41 call EventScript_16DC34 - goto_if_undefeated TRAINER_SUPER_NERD_AVERY, EventScript_16DD51 + goto_if_not_defeated TRAINER_SUPER_NERD_AVERY, EventScript_16DD51 releaseall end @@ -412,7 +412,7 @@ EventScript_16DE0F:: @ 816DE0F EventScript_16DE1F:: @ 816DE1F call EventScript_16DC34 - goto_if_undefeated TRAINER_BURGLAR_RAMON, EventScript_16DE2F + goto_if_not_defeated TRAINER_BURGLAR_RAMON, EventScript_16DE2F releaseall end @@ -488,7 +488,7 @@ EventScript_16DEE6:: @ 816DEE6 EventScript_16DEF6:: @ 816DEF6 call EventScript_16DC34 - goto_if_undefeated TRAINER_SUPER_NERD_DEREK, EventScript_16DF06 + goto_if_not_defeated TRAINER_SUPER_NERD_DEREK, EventScript_16DF06 releaseall end @@ -564,7 +564,7 @@ EventScript_16DFBD:: @ 816DFBD EventScript_16DFCD:: @ 816DFCD call EventScript_16DC34 - goto_if_undefeated TRAINER_BURGLAR_DUSTY, EventScript_16DFDD + goto_if_not_defeated TRAINER_BURGLAR_DUSTY, EventScript_16DFDD releaseall end @@ -640,7 +640,7 @@ EventScript_16E094:: @ 816E094 EventScript_16E0A4:: @ 816E0A4 call EventScript_16DC34 - goto_if_undefeated TRAINER_SUPER_NERD_ZAC, EventScript_16E0B4 + goto_if_not_defeated TRAINER_SUPER_NERD_ZAC, EventScript_16E0B4 releaseall end diff --git a/data/maps/FuchsiaCity_SafariZone_Entrance/scripts.inc b/data/maps/FuchsiaCity_SafariZone_Entrance/scripts.inc index d3f100d76..e4ec53ca7 100644 --- a/data/maps/FuchsiaCity_SafariZone_Entrance/scripts.inc +++ b/data/maps/FuchsiaCity_SafariZone_Entrance/scripts.inc @@ -113,7 +113,7 @@ EventScript_16D3CA:: @ 816D3CA checkmoney 500, 0 compare VAR_RESULT, FALSE goto_if_eq EventScript_16D48C - takemoney 500, 0 + removemoney 500, 0 updatemoneybox 0, 0, 0 msgbox gUnknown_8197D07 textcolor 3 diff --git a/data/maps/PewterCity_Museum_1F/scripts.inc b/data/maps/PewterCity_Museum_1F/scripts.inc index 4622ee8a7..0918c6b2b 100644 --- a/data/maps/PewterCity_Museum_1F/scripts.inc +++ b/data/maps/PewterCity_Museum_1F/scripts.inc @@ -86,7 +86,7 @@ EventScript_16A402:: @ 816A402 compare VAR_TEMP_1, 2 call_if_eq EventScript_16A46B playse SE_SHOP - takemoney 50, 0 + removemoney 50, 0 updatemoneybox 0, 0, 0 waitse msgbox gUnknown_8190505 diff --git a/data/maps/RocketHideout_B1F/scripts.inc b/data/maps/RocketHideout_B1F/scripts.inc index 874e0b8e9..c27dd99f3 100644 --- a/data/maps/RocketHideout_B1F/scripts.inc +++ b/data/maps/RocketHideout_B1F/scripts.inc @@ -4,7 +4,7 @@ RocketHideout_B1F_MapScripts:: @ 8161195 .byte 0 RocketHideout_B1F_OnLoad:: @ 81611A0 - call_if_undefeated TRAINER_TEAM_ROCKET_GRUNT_12 EventScript_161233 + call_if_not_defeated TRAINER_TEAM_ROCKET_GRUNT_12 EventScript_161233 end RocketHideout_B1F_OnTransition:: @ 81611AA diff --git a/data/maps/Route4_PokemonCenter_1F/scripts.inc b/data/maps/Route4_PokemonCenter_1F/scripts.inc index bd2864629..0f310b07d 100644 --- a/data/maps/Route4_PokemonCenter_1F/scripts.inc +++ b/data/maps/Route4_PokemonCenter_1F/scripts.inc @@ -105,7 +105,7 @@ EventScript_16F86A:: @ 816F86A end EventScript_16F86F:: @ 816F86F - takemoney 500, 0 + removemoney 500, 0 updatemoneybox 0, 0, 0 playfanfare MUS_FANFA1 message Text_19DBD3 diff --git a/data/script_cmd_table.inc b/data/script_cmd_table.inc index 23cd757c2..84996a5d6 100644 --- a/data/script_cmd_table.inc +++ b/data/script_cmd_table.inc @@ -69,12 +69,12 @@ gScriptCmdTable:: @ 815F9B4 .4byte ScrCmd_setholewarp .4byte ScrCmd_getplayerxy .4byte ScrCmd_getpartysize - .4byte ScrCmd_giveitem - .4byte ScrCmd_takeitem + .4byte ScrCmd_additem + .4byte ScrCmd_removeitem .4byte ScrCmd_checkitemspace .4byte ScrCmd_checkitem .4byte ScrCmd_checkitemtype - .4byte ScrCmd_givepcitem + .4byte ScrCmd_addpcitem .4byte ScrCmd_checkpcitem .4byte ScrCmd_givedecoration .4byte ScrCmd_takedecoration @@ -145,8 +145,8 @@ gScriptCmdTable:: @ 815F9B4 .4byte ScrCmd_showcontestresults .4byte ScrCmd_contestlinktransfer .4byte ScrCmd_random - .4byte ScrCmd_givemoney - .4byte ScrCmd_takemoney + .4byte ScrCmd_addmoney + .4byte ScrCmd_removemoney .4byte ScrCmd_checkmoney .4byte ScrCmd_showmoneybox .4byte ScrCmd_hidemoneybox @@ -181,8 +181,8 @@ gScriptCmdTable:: @ 815F9B4 .4byte ScrCmd_addelevmenuitem .4byte ScrCmd_showelevmenu .4byte ScrCmd_checkcoins - .4byte ScrCmd_givecoins - .4byte ScrCmd_takecoins + .4byte ScrCmd_addcoins + .4byte ScrCmd_removecoins .4byte ScrCmd_setwildbattle .4byte ScrCmd_dowildbattle .4byte ScrCmd_setvaddress diff --git a/data/scripts/obtain_item.inc b/data/scripts/obtain_item.inc index 71a0b7e21..2452c5c5c 100644 --- a/data/scripts/obtain_item.inc +++ b/data/scripts/obtain_item.inc @@ -217,7 +217,7 @@ EventScript_TryPickUpHiddenCoins:: specialvar VAR_RESULT, Special_CheckAddCoins compare VAR_RESULT, FALSE goto_if_eq EventScript_HiddenCoinsButCaseIsFull - givecoins VAR_0x8006 + addcoins VAR_0x8006 getstdstring 1, 0x17 call EventScript_PlayFanfareObtainedItem call EventScript_FoundCoins diff --git a/include/coins.h b/include/coins.h index 83ad7d611..efe036361 100644 --- a/include/coins.h +++ b/include/coins.h @@ -8,7 +8,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y); void HideCoinsWindow(void); u16 GetCoins(void); void SetCoins(u16 coinAmount); -bool8 GiveCoins(u16 toAdd); -bool8 TakeCoins(u16 toSub); +bool8 AddCoins(u16 toAdd); +bool8 RemoveCoins(u16 toSub); #endif // GUARD_COINS_H diff --git a/src/coins.c b/src/coins.c index 2eaa31b2c..0f1828a96 100644 --- a/src/coins.c +++ b/src/coins.c @@ -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) diff --git a/src/scrcmd.c b/src/scrcmd.c index 4eaea9cef..c36270636 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -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; diff --git a/src/slot_machine.c b/src/slot_machine.c index a6515e9f7..651465ddb 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -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; |