Merge pull request #587 from Henny022p/wallet

This commit is contained in:
notyourav 2023-01-04 09:01:39 -08:00 committed by GitHub
commit 9016bc861e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 8 deletions

View File

@ -398,7 +398,11 @@ typedef struct {
extern void (*const gPlayerItemFunctions[])(Entity*);
extern const s16 gWalletSizes[];
typedef struct {
u16 size;
u16 iconStartTile;
} Wallet;
extern const Wallet gWalletSizes[];
extern const u8 gBombBagSizes[];
extern const u8 gQuiverSizes[];
extern Entity* gPlayerClones[];

View File

@ -222,8 +222,8 @@ void ModRupees(s32 delta) {
if (newRupeeCount < 0) {
newRupeeCount = 0;
} else {
if (newRupeeCount > (u16)gWalletSizes[s->walletType * 2]) {
newRupeeCount = (u16)gWalletSizes[s->walletType * 2];
if (newRupeeCount > gWalletSizes[s->walletType].size) {
newRupeeCount = gWalletSizes[s->walletType].size;
}
}
s->rupees = newRupeeCount;

View File

@ -12,7 +12,12 @@
#include "enemy.h"
#include "message.h"
const s16 gWalletSizes[] = { 100, -4000, 300, -3996, 500, -3992, 999, -3988 };
const Wallet gWalletSizes[] = {
{ 100, 0xf060 },
{ 300, 0xf064 },
{ 500, 0xf068 },
{ 999, 0xf06c },
};
const u8 gBombBagSizes[] = {
10,
30,

View File

@ -251,7 +251,6 @@ void DrawRupees(void) {
u32 temp2;
substruct_160* ptr;
substruct_160* ptr2;
const u16* ptr3;
struct_02035160* ptr4;
if ((gUnk_0200AF00.unk_1 & 0x40) != 0) {
@ -277,8 +276,7 @@ void DrawRupees(void) {
gUnk_0200AF00.unk_a = 2;
ptr4 = &gUnk_02035160;
ptr2 = &ptr4->unk_40;
ptr3 = gWalletSizes;
ptr4->unk_0.unk_0 = temp2 = *(ptr3 + (u32)gSave.stats.walletType * 2 + 1);
ptr4->unk_0.unk_0 = temp2 = gWalletSizes[gSave.stats.walletType].iconStartTile;
ptr4->unk_0.unk_2 = temp2 + 1;
ptr2->unk_0 = temp2 + 2;
ptr2->unk_2 = temp2 + 3;
@ -312,7 +310,7 @@ void DrawRupees(void) {
}
case 1:
DrawDigits(0x70, gUnk_0200AF00.rupees,
(u16)gWalletSizes[(u32)gSave.stats.walletType * 2] <= gUnk_0200AF00.rupees, 3);
gWalletSizes[(u32)gSave.stats.walletType].size <= gUnk_0200AF00.rupees, 3);
cVar1 = gUnk_0200AF00.unk_c + 1;
default:
gUnk_0200AF00.unk_c = cVar1;