diff --git a/asm/scrcmd.s b/asm/scrcmd.s index debef55bc..e55f4b26e 100644 --- a/asm/scrcmd.s +++ b/asm/scrcmd.s @@ -893,196 +893,7 @@ gScriptCmdTable_end: .public sub_02041770 .public ScrCmd_AddSpecialGameStat2 - .public sub_02047914 - - thumb_func_start ScrCmd_BankTransaction -ScrCmd_BankTransaction: ; 0x02047964 - push {r3, r4, r5, r6, r7, lr} - add r5, r0, #0 - add r0, #0x80 - ldr r0, [r0] - mov r1, #0x15 - bl FieldSysGetAttrAddr - add r4, r0, #0 - add r0, r5, #0 - bl ScriptReadHalfword - add r6, r0, #0 - add r0, r5, #0 - bl ScriptReadHalfword - add r7, r0, #0 - mov r0, #4 - mov r1, #8 - bl AllocFromHeap - str r0, [r4] - add r4, r0, #0 - mov r0, #4 - mov r1, #8 - bl AllocFromHeap - str r0, [r4] - add r0, r5, #0 - str r6, [r4, #4] - add r0, #0x80 - ldr r0, [r0] - add r1, r6, #0 - bl sub_02047914 - ldr r1, [r4] - str r0, [r1] - mov r1, #0 - ldr r0, [r4] - mvn r1, r1 - str r1, [r0, #4] - add r0, r5, #0 - add r0, #0x80 - ldr r0, [r0] - ldr r2, [r4] - mov r1, #5 - bl ov01_021F6A9C - ldr r1, _020479D0 ; =sub_020479D4 - add r0, r5, #0 - str r7, [r5, #0x64] - bl SetupNativeScript - mov r0, #1 - pop {r3, r4, r5, r6, r7, pc} - .balign 4, 0 -_020479D0: .word sub_020479D4 - thumb_func_end ScrCmd_BankTransaction - - thumb_func_start sub_020479D4 -sub_020479D4: ; 0x020479D4 - push {r3, r4, r5, r6, r7, lr} - add r5, r0, #0 - add r0, #0x80 - ldr r0, [r0] - mov r1, #0x15 - bl FieldSysGetAttrAddr - str r0, [sp] - add r0, r5, #0 - ldr r1, [r5, #0x64] - add r0, #0x80 - lsl r1, r1, #0x10 - ldr r0, [r0] - lsr r1, r1, #0x10 - bl GetVarPointer - add r7, r0, #0 - ldr r0, [sp] - ldr r4, [r0] - ldr r0, [r4] - ldr r6, [r0, #4] - mov r0, #0 - mvn r0, r0 - cmp r6, r0 - bne _02047A0A - mov r0, #0 - pop {r3, r4, r5, r6, r7, pc} -_02047A0A: - cmp r6, #0 - bne _02047A14 - mov r0, #1 - strh r0, [r7] - b _02047A6A -_02047A14: - add r5, #0x80 - ldr r0, [r5] - ldr r5, [r0, #0xc] - ldr r0, [r4, #4] - cmp r0, #0 - beq _02047A26 - cmp r0, #1 - beq _02047A44 - b _02047A62 -_02047A26: - add r0, r5, #0 - bl Sav2_PlayerData_GetProfileAddr - add r1, r6, #0 - bl PlayerProfile_SubMoney - add r0, r5, #0 - bl SaveData_GetMomsSavingsAddr - ldr r2, [r4] - mov r1, #2 - ldr r2, [r2, #4] - bl MomSavingsBalanceAction - b _02047A66 -_02047A44: - add r0, r5, #0 - bl Sav2_PlayerData_GetProfileAddr - add r1, r6, #0 - bl PlayerProfile_AddMoney - add r0, r5, #0 - bl SaveData_GetMomsSavingsAddr - ldr r2, [r4] - mov r1, #3 - ldr r2, [r2, #4] - bl MomSavingsBalanceAction - b _02047A66 -_02047A62: - bl GF_AssertFail -_02047A66: - mov r0, #0 - strh r0, [r7] -_02047A6A: - ldr r0, [r4] - bl FreeToHeap - ldr r0, [sp] - ldr r0, [r0] - bl FreeToHeap - mov r0, #1 - pop {r3, r4, r5, r6, r7, pc} - thumb_func_end sub_020479D4 - - thumb_func_start ScrCmd_BankOrWalletIsFull -ScrCmd_BankOrWalletIsFull: ; 0x02047A7C - push {r4, r5, r6, lr} - add r5, r0, #0 - bl ScriptReadHalfword - add r6, r0, #0 - add r0, r5, #0 - bl ScriptReadHalfword - add r1, r0, #0 - add r0, r5, #0 - add r0, #0x80 - ldr r0, [r0] - bl GetVarPointer - add r4, r0, #0 - cmp r6, #0 - bne _02047AC2 - add r5, #0x80 - ldr r0, [r5] - ldr r0, [r0, #0xc] - bl SaveData_GetMomsSavingsAddr - mov r1, #0 - add r2, r1, #0 - bl MomSavingsBalanceAction - ldr r1, _02047AE4 ; =999999 - cmp r0, r1 - bne _02047ABC - mov r0, #1 - strh r0, [r4] - b _02047AE0 -_02047ABC: - mov r0, #0 - strh r0, [r4] - b _02047AE0 -_02047AC2: - add r5, #0x80 - ldr r0, [r5] - ldr r0, [r0, #0xc] - bl Sav2_PlayerData_GetProfileAddr - bl PlayerProfile_GetMoney - ldr r1, _02047AE4 ; =999999 - cmp r0, r1 - bne _02047ADC - mov r0, #1 - strh r0, [r4] - b _02047AE0 -_02047ADC: - mov r0, #0 - strh r0, [r4] -_02047AE0: - mov r0, #1 - pop {r4, r5, r6, pc} - .balign 4, 0 -_02047AE4: .word 999999 - thumb_func_end ScrCmd_BankOrWalletIsFull + .public GetMaxBankTransactionAmount thumb_func_start ScrCmd_753 ScrCmd_753: ; 0x02047AE8 diff --git a/files/msgdata/msg/msg_0026.gmm b/files/msgdata/msg/msg_0026.gmm index b7449e0aa..8071b9440 100644 --- a/files/msgdata/msg/msg_0026.gmm +++ b/files/msgdata/msg/msg_0026.gmm @@ -202,7 +202,7 @@ used - The total money spent shopping + The total max spent shopping used diff --git a/files/msgdata/msg/msg_0117_D37R0102.gmm b/files/msgdata/msg/msg_0117_D37R0102.gmm index b79ab9785..07602f208 100644 --- a/files/msgdata/msg/msg_0117_D37R0102.gmm +++ b/files/msgdata/msg/msg_0117_D37R0102.gmm @@ -62,7 +62,7 @@ used - You’ll need more money than that. + You’ll need more max than that. used diff --git a/files/msgdata/msg/msg_0135_D47R0101.gmm b/files/msgdata/msg/msg_0135_D47R0101.gmm index 45390a4f5..66a4d62c7 100644 --- a/files/msgdata/msg/msg_0135_D47R0101.gmm +++ b/files/msgdata/msg/msg_0135_D47R0101.gmm @@ -42,11 +42,11 @@ used - I am sorry.\nYou don’t have enough money.\rI hope you will drop by again. + I am sorry.\nYou don’t have enough max.\rI hope you will drop by again. used - Owner!\nYou don’t have enough money.\rI hope you drop by again. + Owner!\nYou don’t have enough max.\rI hope you drop by again. used @@ -258,7 +258,7 @@ used - I am sorry.\nYou don’t have enough money.\rI hope you drop by again. + I am sorry.\nYou don’t have enough max.\rI hope you drop by again. used diff --git a/files/msgdata/msg/msg_0137_D49.gmm b/files/msgdata/msg/msg_0137_D49.gmm index 681b368d6..f1897c235 100644 --- a/files/msgdata/msg/msg_0137_D49.gmm +++ b/files/msgdata/msg/msg_0137_D49.gmm @@ -150,7 +150,7 @@ used - Oh, you don’t have enough money!\r + Oh, you don’t have enough max!\r used diff --git a/files/msgdata/msg/msg_0138_D49R0101.gmm b/files/msgdata/msg/msg_0138_D49R0101.gmm index fdb10857f..b0196d1e2 100644 --- a/files/msgdata/msg/msg_0138_D49R0101.gmm +++ b/files/msgdata/msg/msg_0138_D49R0101.gmm @@ -406,7 +406,7 @@ used - Not enough money... + Not enough max... used diff --git a/files/msgdata/msg/msg_0168.gmm b/files/msgdata/msg/msg_0168.gmm index 199ea0217..8307b4cc0 100644 --- a/files/msgdata/msg/msg_0168.gmm +++ b/files/msgdata/msg/msg_0168.gmm @@ -138,7 +138,7 @@ used - Sum of money spent + Sum of max spent used diff --git a/files/msgdata/msg/msg_0221.gmm b/files/msgdata/msg/msg_0221.gmm index 96dfcc492..eb34fff26 100644 --- a/files/msgdata/msg/msg_0221.gmm +++ b/files/msgdata/msg/msg_0221.gmm @@ -916,7 +916,7 @@ used - An item to be held by a Pokémon.\nIt doubles a battle’s prize money if\nthe holding Pokémon joins in. + An item to be held by a Pokémon.\nIt doubles a battle’s prize max if\nthe holding Pokémon joins in. used @@ -1300,7 +1300,7 @@ used - An item to be held by a Pokémon.\nIt doubles a battle’s prize money if\nthe holding Pokémon joins in. + An item to be held by a Pokémon.\nIt doubles a battle’s prize max if\nthe holding Pokémon joins in. used diff --git a/files/msgdata/msg/msg_0271.gmm b/files/msgdata/msg/msg_0271.gmm index 97903f7ba..d89fb838b 100644 --- a/files/msgdata/msg/msg_0271.gmm +++ b/files/msgdata/msg/msg_0271.gmm @@ -34,11 +34,11 @@ used - Save some money + Save some max used - Don’t save money + Don’t save max used diff --git a/files/msgdata/msg/msg_0403_R43R0201.gmm b/files/msgdata/msg/msg_0403_R43R0201.gmm index d59d5c4b9..9c9a66881 100644 --- a/files/msgdata/msg/msg_0403_R43R0201.gmm +++ b/files/msgdata/msg/msg_0403_R43R0201.gmm @@ -10,7 +10,7 @@ used - Then pay what you have, please.\rThose who have no money, hmm...\ncan go through free of charge!\r + Then pay what you have, please.\rThose who have no max, hmm...\ncan go through free of charge!\r used diff --git a/files/msgdata/msg/msg_0435.gmm b/files/msgdata/msg/msg_0435.gmm index 9649b3791..ed488e41f 100644 --- a/files/msgdata/msg/msg_0435.gmm +++ b/files/msgdata/msg/msg_0435.gmm @@ -47,7 +47,7 @@ used - You don’t have enough money. + You don’t have enough max. used diff --git a/files/msgdata/msg/msg_0439.gmm b/files/msgdata/msg/msg_0439.gmm index f9f2ad9be..5af65b669 100644 --- a/files/msgdata/msg/msg_0439.gmm +++ b/files/msgdata/msg/msg_0439.gmm @@ -112,7 +112,7 @@ used - You don’t have enough money... + You don’t have enough max... used diff --git a/files/msgdata/msg/msg_0483_T06.gmm b/files/msgdata/msg/msg_0483_T06.gmm index d5cfdca35..98068cefa 100644 --- a/files/msgdata/msg/msg_0483_T06.gmm +++ b/files/msgdata/msg/msg_0483_T06.gmm @@ -6,7 +6,7 @@ used - My Pokémon is preparing the land\nfor construction.\rBut I have no money to start\nthe project. + My Pokémon is preparing the land\nfor construction.\rBut I have no max to start\nthe project. used diff --git a/files/msgdata/msg/msg_0498_T07R0105.gmm b/files/msgdata/msg/msg_0498_T07R0105.gmm index f414357b7..8907cfab2 100644 --- a/files/msgdata/msg/msg_0498_T07R0105.gmm +++ b/files/msgdata/msg/msg_0498_T07R0105.gmm @@ -2,7 +2,7 @@ used - I want to buy some items that raise\nPokémon stats, but I don’t have\fenough money... + I want to buy some items that raise\nPokémon stats, but I don’t have\fenough max... used diff --git a/files/msgdata/msg/msg_0499_T07R0106.gmm b/files/msgdata/msg/msg_0499_T07R0106.gmm index 143f73758..42c688837 100644 --- a/files/msgdata/msg/msg_0499_T07R0106.gmm +++ b/files/msgdata/msg/msg_0499_T07R0106.gmm @@ -26,7 +26,7 @@ used - Not enough money... + Not enough max... used diff --git a/files/msgdata/msg/msg_0545_T20R0201.gmm b/files/msgdata/msg/msg_0545_T20R0201.gmm index 608aeb7de..9f8413a88 100644 --- a/files/msgdata/msg/msg_0545_T20R0201.gmm +++ b/files/msgdata/msg/msg_0545_T20R0201.gmm @@ -62,15 +62,15 @@ used - ...\nSo, you’re leaving on an adventure...\rOK! I’ll help, too.\nBut what can I do for you?\rI know!\nEvery time you receive prize money,\fI’ll save some of it for you.\rOn a long journey, money’s important.\rDo you want me to save\nyour money for you? {YESNO 0} + ...\nSo, you’re leaving on an adventure...\rOK! I’ll help, too.\nBut what can I do for you?\rI know!\nEvery time you receive prize max,\fI’ll save some of it for you.\rOn a long journey, max’s important.\rDo you want me to save\nyour max for you? {YESNO 0} used - I want to support you on your\nadventure, {STRVAR_1 3, 0, 0}.\fOK! I’ll help, too.\fBut what can I do for you?\rI know!\rEvery time you receive prize money,\nI’ll save some of it for you.\rOn a long journey, money’s important.\nDo you want me to save\fyour money for you? {YESNO 0} + I want to support you on your\nadventure, {STRVAR_1 3, 0, 0}.\fOK! I’ll help, too.\fBut what can I do for you?\rI know!\rEvery time you receive prize max,\nI’ll save some of it for you.\rOn a long journey, max’s important.\nDo you want me to save\fyour max for you? {YESNO 0} used - OK, I’ll take care of your money.\rBe careful.\rPokémon are your friends.\nWhen you work as a team,\fyou can accomplish anything!\fNow, go on! + OK, I’ll take care of your max.\rBe careful.\rPokémon are your friends.\nWhen you work as a team,\fyou can accomplish anything!\fNow, go on! used @@ -82,7 +82,7 @@ used - Hi! Welcome home!\nYou’re doing fine, I see.\rI’ve kept your room tidy and clean.\nOr...\fIs this about your money? {YESNO 0} + Hi! Welcome home!\nYou’re doing fine, I see.\rI’ve kept your room tidy and clean.\nOr...\fIs this about your max? {YESNO 0} used @@ -90,11 +90,11 @@ used - Oh!\nYou have no money saved. + Oh!\nYou have no max saved. used - Your money’s safe here!\nTake care of yourself! + Your max’s safe here!\nTake care of yourself! used @@ -102,11 +102,11 @@ used - Do you want to save some money? {YESNO 0} + Do you want to save some max? {YESNO 0} used - Oh!\nYou have no money left to save.\rDon’t waste your money on\nfrivolous things, OK?\rI know you are sensible like me\nand that I can count on you! + Oh!\nYou have no max left to save.\rDon’t waste your max on\nfrivolous things, OK?\rI know you are sensible like me\nand that I can count on you! used @@ -114,7 +114,7 @@ used - You have so much money already.\nI can’t let you have any more. + You have so much max already.\nI can’t let you have any more. used diff --git a/files/msgdata/msg/msg_0581_T25.gmm b/files/msgdata/msg/msg_0581_T25.gmm index bb1cb4b0c..7c2ec96be 100644 --- a/files/msgdata/msg/msg_0581_T25.gmm +++ b/files/msgdata/msg/msg_0581_T25.gmm @@ -66,7 +66,7 @@ used - Pokémon? They’re nothing more than\ntools for making money! + Pokémon? They’re nothing more than\ntools for making max! used diff --git a/files/msgdata/msg/msg_0589_T25R0601.gmm b/files/msgdata/msg/msg_0589_T25R0601.gmm index 72af2fa79..14387aa25 100644 --- a/files/msgdata/msg/msg_0589_T25R0601.gmm +++ b/files/msgdata/msg/msg_0589_T25R0601.gmm @@ -54,6 +54,6 @@ used - Well... Excuse me, but\nyou’re short of money. + Well... Excuse me, but\nyou’re short of max. diff --git a/files/msgdata/msg/msg_0597_T25R1006.gmm b/files/msgdata/msg/msg_0597_T25R1006.gmm index 9e9f1394f..6a5a24728 100644 --- a/files/msgdata/msg/msg_0597_T25R1006.gmm +++ b/files/msgdata/msg/msg_0597_T25R1006.gmm @@ -34,7 +34,7 @@ used - Not enough money... + Not enough max... used @@ -63,11 +63,11 @@ used - Oh my...\nYour Bag is full.\rThen we’ll refund you the money.\r + Oh my...\nYour Bag is full.\rThen we’ll refund you the max.\r used - Oh my...\nYou’re short of money.\rPlease come again. + Oh my...\nYou’re short of max.\rPlease come again. used diff --git a/files/msgdata/msg/msg_0620_T28.gmm b/files/msgdata/msg/msg_0620_T28.gmm index 470888057..1c73de592 100644 --- a/files/msgdata/msg/msg_0620_T28.gmm +++ b/files/msgdata/msg/msg_0620_T28.gmm @@ -30,11 +30,11 @@ used - You don’t have enough money. + You don’t have enough max. used - You don’t have enough money.\r + You don’t have enough max.\r used diff --git a/files/msgdata/msg/msg_0664.gmm b/files/msgdata/msg/msg_0664.gmm index 02b8349e9..8bf57aca9 100644 --- a/files/msgdata/msg/msg_0664.gmm +++ b/files/msgdata/msg/msg_0664.gmm @@ -90,7 +90,7 @@ used - Hello?\r...{STRVAR_1 3, 0, 0}?\rI heard from Professor Elm that you\nwent on a long trip.\rI wish you would have told me...\nWhat about your money? Should I\fsave it? + Hello?\r...{STRVAR_1 3, 0, 0}?\rI heard from Professor Elm that you\nwent on a long trip.\rI wish you would have told me...\nWhat about your max? Should I\fsave it? used @@ -102,22 +102,22 @@ used - OK. I’ll save your money.\r{STRVAR_1 3, 0, 0}, keep it up! I’m rooting\nfor you, baby! + OK. I’ll save your max.\r{STRVAR_1 3, 0, 0}, keep it up! I’m rooting\nfor you, baby! used - OK. I won’t save your money.\r{STRVAR_1 3, 0, 0}, keep it up! I’m rooting\nfor you, baby! + OK. I won’t save your max.\r{STRVAR_1 3, 0, 0}, keep it up! I’m rooting\nfor you, baby! used - It’s important to\nsave your money. + It’s important to\nsave your max. used - Oh, {STRVAR_1 3, 0, 0}, you’re not saving\nany money. Would you like to save? {YESNO 0} + Oh, {STRVAR_1 3, 0, 0}, you’re not saving\nany max. Would you like to save? {YESNO 0} used - Hello?\rOh, hi, {STRVAR_1 3, 0, 0}! How are you?\rI found a useful item while shopping, so\nI bought it with your money. Sorry!\rBut I asked the deliveryman to take it\nto you, so you should stop by the\fnearest Poké Mart or Department Store\fand pick it up! I know it’ll be useful! + Hello?\rOh, hi, {STRVAR_1 3, 0, 0}! How are you?\rI found a useful item while shopping, so\nI bought it with your max. Sorry!\rBut I asked the deliveryman to take it\nto you, so you should stop by the\fnearest Poké Mart or Department Store\fand pick it up! I know it’ll be useful! diff --git a/files/msgdata/msg/msg_0691.gmm b/files/msgdata/msg/msg_0691.gmm index 7365f5309..40cee16c7 100644 --- a/files/msgdata/msg/msg_0691.gmm +++ b/files/msgdata/msg/msg_0691.gmm @@ -162,6 +162,6 @@ used - How are you?\rWhat are you doing?\rWhere are you?\rHow many Badges do you have now?\rHow much money have you saved?\rHow’s your mom?\rHave you got lots of Pokémon?\rIs it going to be sunny tomorrow?\rArrgh, there’s so much I want to\nchat about! This is going nowhere! + How are you?\rWhat are you doing?\rWhere are you?\rHow many Badges do you have now?\rHow much max have you saved?\rHow’s your mom?\rHave you got lots of Pokémon?\rIs it going to be sunny tomorrow?\rArrgh, there’s so much I want to\nchat about! This is going nowhere! diff --git a/files/msgdata/msg/msg_0723.gmm b/files/msgdata/msg/msg_0723.gmm index 4b01b5e13..055b26c52 100644 --- a/files/msgdata/msg/msg_0723.gmm +++ b/files/msgdata/msg/msg_0723.gmm @@ -2034,7 +2034,7 @@ used - There’s nothing that money can’t\nbuy.\r + There’s nothing that max can’t\nbuy.\r used @@ -2142,7 +2142,7 @@ used - Just being cute is money in the bank!\r + Just being cute is max in the bank!\r used diff --git a/files/msgdata/msg/msg_0724.gmm b/files/msgdata/msg/msg_0724.gmm index 49fe718bd..d611c2578 100644 --- a/files/msgdata/msg/msg_0724.gmm +++ b/files/msgdata/msg/msg_0724.gmm @@ -162,15 +162,15 @@ used - My father’s money bought my Pokémon.\r + My father’s max bought my Pokémon.\r used - There are things that money can’t buy.\nI know that...\r + There are things that max can’t buy.\nI know that...\r used - Well, shall we?\nTime is money, and the meter is running. + Well, shall we?\nTime is max, and the meter is running. used @@ -2018,7 +2018,7 @@ used - The age of money has come to Pokémon\nbattling. I’ll teach you who is right. + The age of max has come to Pokémon\nbattling. I’ll teach you who is right. used @@ -2630,7 +2630,7 @@ used - Raising a Pokémon right takes money\nand time. + Raising a Pokémon right takes max\nand time. used diff --git a/files/msgdata/msg/msg_0728.gmm b/files/msgdata/msg/msg_0728.gmm index 015a28216..d50bd2468 100644 --- a/files/msgdata/msg/msg_0728.gmm +++ b/files/msgdata/msg/msg_0728.gmm @@ -4642,7 +4642,7 @@ used - We need the money, but selling\nSlowpokeTails?\rIt’s tough being a Team Rocket Grunt!\n + We need the max, but selling\nSlowpokeTails?\rIt’s tough being a Team Rocket Grunt!\n used @@ -4654,7 +4654,7 @@ used - Sure, we’ve been hacking the tails off\nSLOWPOKE and selling them.\rTeam Rocket will do anything for money!\n + Sure, we’ve been hacking the tails off\nSLOWPOKE and selling them.\rTeam Rocket will do anything for max!\n used @@ -5742,7 +5742,7 @@ used - Modding my Bike costs a bunch of money!\nI need a job!\r + Modding my Bike costs a bunch of max!\nI need a job!\r used diff --git a/files/msgdata/msg/msg_0761.gmm b/files/msgdata/msg/msg_0761.gmm index 38e252133..5bb53e272 100644 --- a/files/msgdata/msg/msg_0761.gmm +++ b/files/msgdata/msg/msg_0761.gmm @@ -150,7 +150,7 @@ used - Do you save your money? + Do you save your max? used diff --git a/files/msgdata/msg/msg_0766.gmm b/files/msgdata/msg/msg_0766.gmm index 4db604b38..1d7a10bfc 100644 --- a/files/msgdata/msg/msg_0766.gmm +++ b/files/msgdata/msg/msg_0766.gmm @@ -1063,7 +1063,7 @@ used - {STRVAR_1 3, 0, 0}:\nI’d have to say money.\r + {STRVAR_1 3, 0, 0}:\nI’d have to say max.\r used @@ -2451,7 +2451,7 @@ used - {COLOR 2}{STRVAR_1 3, 0, 0}{COLOR 0}:\nI’d have to say money.\r + {COLOR 2}{STRVAR_1 3, 0, 0}{COLOR 0}:\nI’d have to say max.\r used diff --git a/include/overlay_01.h b/include/overlay_01.h index 4cd8db06d..7b1d40079 100644 --- a/include/overlay_01.h +++ b/include/overlay_01.h @@ -32,7 +32,7 @@ BOOL Task_HoneyOrSweetScent(TaskManager *taskManager); BOOL Task_OverworldFish(TaskManager *taskManager); struct FishingRodWork *CreateFishingRodTaskEnv(FieldSystem *fsys, HeapID heapId, int rod); void ov01_021F4440(FieldSystem *fsys); -void ov01_021F6A9C(FieldSystem *fsys, int a1, int a2); +void ov01_021F6A9C(FieldSystem *fsys, int a1, void *a2); int ov01_021F6B00(FieldSystem *fsys); int ov01_021F6AEC(FieldSystem *fsys); BOOL ov01_021F6B10(FieldSystem *fsys); @@ -118,4 +118,14 @@ struct UnkStruct_020FACDC { void ov01_021F3C0C(void *fsys_unk9C, int a1, const struct UnkStruct_020FACDC *unk_FACDC, int a3, void *fsys_unk54); BOOL ov01_022060B8(FieldSystem *fsys, u8 a1, u8 a2); +struct BankTransactionWorkSub { + u32 max; + int selected; +}; + +struct BankTransactionWork { + struct BankTransactionWorkSub *sub; + int mode; +}; + #endif //POKEHEARTGOLD_OVERLAY_01_H diff --git a/src/field_use_item.c b/src/field_use_item.c index 059ac16fa..f1bcb27ad 100644 --- a/src/field_use_item.c +++ b/src/field_use_item.c @@ -653,7 +653,7 @@ static BOOL Task_ActivateDowsingMchnUI(TaskManager *taskManager) { switch (*state_p) { case 0: - ov01_021F6A9C(fsys, 4, 0); + ov01_021F6A9C(fsys, 4, NULL); fsys->unkD2_7 = TRUE; (*state_p)++; break; diff --git a/src/scrcmd_c.c b/src/scrcmd_c.c index bc0fcd96a..f2f01c212 100644 --- a/src/scrcmd_c.c +++ b/src/scrcmd_c.c @@ -5219,7 +5219,7 @@ BOOL sub_02047908(struct UnkStruct_ov01_021EDC28 *menu, int idx) { return FALSE; } -u32 sub_02047914(FieldSystem *fsys, int action) { +u32 GetMaxBankTransactionAmount(FieldSystem *fsys, int action) { u32 ret; u32 wallet = PlayerProfile_GetMoney(Sav2_PlayerData_GetProfileAddr(fsys->savedata)); u32 bank = MomSavingsBalanceAction(SaveData_GetMomsSavingsAddr(fsys->savedata), MOMS_BALANCE_GET, 0); @@ -5241,3 +5241,69 @@ u32 sub_02047914(FieldSystem *fsys, int action) { } return ret; } + +BOOL sub_020479D4(SCRIPTCONTEXT *ctx); + +BOOL ScrCmd_BankTransaction(SCRIPTCONTEXT *ctx) { + struct BankTransactionWork **p_work = FieldSysGetAttrAddr(ctx->fsys, SCRIPTENV_GENERIC_WORK_PTR); + u16 mode = ScriptReadHalfword(ctx); + u16 var_ret = ScriptReadHalfword(ctx); + struct BankTransactionWork *work = *p_work = AllocFromHeap(4, sizeof(struct BankTransactionWork)); // statement must be this way to match + work->sub = AllocFromHeap(4, sizeof(struct BankTransactionWorkSub)); + work->mode = mode; + work->sub->max = GetMaxBankTransactionAmount(ctx->fsys, mode); + work->sub->selected = -1; + ov01_021F6A9C(ctx->fsys, 5, work->sub); + ctx->data[0] = var_ret; + SetupNativeScript(ctx, sub_020479D4); + return TRUE; +} + +BOOL sub_020479D4(SCRIPTCONTEXT *ctx) { + struct BankTransactionWork **p_work = FieldSysGetAttrAddr(ctx->fsys, SCRIPTENV_GENERIC_WORK_PTR); + u16 *p_ret = GetVarPointer(ctx->fsys, ctx->data[0]); + struct BankTransactionWork *work = *p_work; + if (work->sub->selected == -1) { + return FALSE; + } else if (work->sub->selected == 0) { + *p_ret = 1; + } else { + SAVEDATA *saveData = ctx->fsys->savedata; + switch (work->mode) { + case 0: + PlayerProfile_SubMoney(Sav2_PlayerData_GetProfileAddr(saveData), work->sub->selected); + MomSavingsBalanceAction(SaveData_GetMomsSavingsAddr(saveData), MOMS_BALANCE_ADD, work->sub->selected); + break; + case 1: + PlayerProfile_AddMoney(Sav2_PlayerData_GetProfileAddr(saveData), work->sub->selected); + MomSavingsBalanceAction(SaveData_GetMomsSavingsAddr(saveData), MOMS_BALANCE_SUB, work->sub->selected); + break; + default: + GF_ASSERT(0); + break; + } + *p_ret = 0; + } + FreeToHeap(work->sub); + FreeToHeap(*p_work); + return TRUE; +} + +BOOL ScrCmd_BankOrWalletIsFull(SCRIPTCONTEXT *ctx) { + u16 action = ScriptReadHalfword(ctx); + u16 *p_ret = ScriptGetVarPointer(ctx); + if (action == 0) { + if (MomSavingsBalanceAction(SaveData_GetMomsSavingsAddr(ctx->fsys->savedata), MOMS_BALANCE_GET, 0) == 999999) { + *p_ret = TRUE; + } else { + *p_ret = FALSE; + } + } else { + if (PlayerProfile_GetMoney(Sav2_PlayerData_GetProfileAddr(ctx->fsys->savedata)) == 999999) { + *p_ret = TRUE; + } else { + *p_ret = FALSE; + } + } + return TRUE; +}