Rupees_ChangeBy

This commit is contained in:
engineer124
2021-12-28 17:19:31 +11:00
parent 634157a555
commit 89c2af41de
17 changed files with 50 additions and 49 deletions
+9 -9
View File
@@ -199,7 +199,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
}
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
}
}
@@ -291,7 +291,7 @@ block_13:
block_15:
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
return;
block_16:
@@ -391,7 +391,7 @@ block_11:
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
return;
block_16:
@@ -461,7 +461,7 @@ block_11:
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
return;
block_16:
@@ -510,7 +510,7 @@ So let us rewrite the entire second half as a switch:
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
return;
break;
@@ -541,7 +541,7 @@ There's a couple of other obvious things here:
} else {
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
}
break;
@@ -606,7 +606,7 @@ block_7:
} else {
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
}
break;
@@ -670,7 +670,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
} else {
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
}
break;
@@ -722,7 +722,7 @@ void func_809527F8(EnMs *this, GlobalContext *globalCtx) {
} else {
func_8019F208();
func_800B8A1C((Actor *) this, globalCtx, 0x35, 90.0f, 10.0f);
func_801159EC(-0xA);
Rupees_ChangeBy(-0xA);
this->actionFunc = func_809529AC;
}
break;
+1 -1
View File
@@ -2076,7 +2076,7 @@ void Interface_SetDoAction(GlobalContext* globalCtx, u16 arg1);
void func_80115844(GlobalContext* globalCtx, s16 param_2);
s32 func_80115908(GlobalContext* globalCtx, u8 param_2);
void func_801159c0(s16 param_1);
void func_801159EC(s16 arg0);
void Rupees_ChangeBy(s16 arg0);
void func_80115A14(s32 arg0, s16 arg1);
void Interface_AddMagic(GlobalContext* globalCtx, s16 arg1);
void func_80115D5C(GameState* gamestate);
+4 -3
View File
@@ -1701,7 +1701,7 @@ u8 Item_Give(GlobalContext* globalCtx, u8 item) {
return item;
} else if ((item >= ITEM_RUPEE_GREEN) && (item <= ITEM_RUPEE_HUGE)) {
func_801159EC(sAmmoRefillCounts[item - ITEM_RUPEE_GREEN + 10]);
Rupees_ChangeBy(sAmmoRefillCounts[item - ITEM_RUPEE_GREEN + 10]);
return ITEM_NONE;
} else if (item == ITEM_LONGSHOT) {
@@ -2060,8 +2060,9 @@ void Interface_SetDoAction(GlobalContext* globalCtx, u16 action) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801159c0.s")
// Rupees_ChangeBy
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_801159EC.s")
void Rupees_ChangeBy(s16 rupeeChange) {
gSaveContext.rupeeAccumulator += rupeeChange;
}
#pragma GLOBAL_ASM("asm/non_matchings/code/z_parameter/func_80115A14.s")
@@ -1315,7 +1315,7 @@ void func_80BEF360(EnAkindonuts* this, GlobalContext* globalCtx) {
if (this->unk_32C & 0x40) {
if (Actor_HasParent(&this->actor, globalCtx)) {
this->actor.parent = NULL;
func_801159EC(this->unk_364);
Rupees_ChangeBy(this->unk_364);
this->unk_32C &= ~0x40;
this->actionFunc = func_80BEF450;
} else {
@@ -392,7 +392,7 @@ void func_809C16DC(EnAob01* this, GlobalContext* globalCtx) {
case 0x3529:
if (this->unk_2D2 & 2) {
this->unk_2D2 &= ~2;
func_801159EC(-this->unk_434);
Rupees_ChangeBy(-this->unk_434);
func_800B7298(globalCtx, NULL, 7);
globalCtx->msgCtx.unk11F22 = 0x43;
globalCtx->msgCtx.unk12023 = 4;
@@ -708,7 +708,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) {
this->unk_210 = 0x352A;
this->unk_2D2 |= 0x80;
this->unk_434 *= 3;
func_801159EC(this->unk_434);
Rupees_ChangeBy(this->unk_434);
globalCtx->msgCtx.bankRupees = this->unk_434;
break;
@@ -716,7 +716,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) {
this->unk_210 = 0x352B;
this->unk_2D2 |= 0x80;
this->unk_434 *= 2;
func_801159EC(this->unk_434);
Rupees_ChangeBy(this->unk_434);
globalCtx->msgCtx.bankRupees = this->unk_434;
break;
@@ -724,7 +724,7 @@ void func_809C28B8(EnAob01* this, GlobalContext* globalCtx) {
case 4:
case 5:
this->unk_210 = 0x352C;
func_801159EC(this->unk_434);
Rupees_ChangeBy(this->unk_434);
break;
default:
+1 -1
View File
@@ -436,7 +436,7 @@ void func_80962588(EnFu* this, GlobalContext* globalCtx) {
if (globalCtx->msgCtx.choiceIndex == 0) {
if (gSaveContext.save.playerData.rupees >= 10) {
func_8019F208();
func_801159EC(-10);
Rupees_ChangeBy(-10);
func_80963DE4(this, globalCtx);
} else {
play_sound(NA_SE_SY_ERROR);
@@ -363,7 +363,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
this->isNewAccount = true;
}
func_801159EC((s16)-globalCtx->msgCtx.bankRupeesSelected);
Rupees_ChangeBy((s16)-globalCtx->msgCtx.bankRupeesSelected);
this->previousBankValue = gSaveContext.save.roomInf[127][0] & 0xFFFF;
if (1) {} // Needed to match
gSaveContext.save.roomInf[127][0] =
@@ -432,7 +432,7 @@ void EnGinkoMan_WaitForDialogueInput(EnGinkoMan* this, GlobalContext* globalCtx)
(gSaveContext.save.roomInf[127][0] & 0xFFFF0000) |
(((gSaveContext.save.roomInf[127][0] & 0xFFFF) - globalCtx->msgCtx.bankRupeesSelected) -
this->serviceFee);
func_801159EC(globalCtx->msgCtx.bankRupeesSelected);
Rupees_ChangeBy(globalCtx->msgCtx.bankRupeesSelected);
}
} else {
func_8019F230();
+13 -13
View File
@@ -398,12 +398,12 @@ void EnGirlA_BuyBottleItem(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_FAIRY);
break;
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyArrows(GlobalContext* globalCtx, EnGirlA* this) {
func_80115A14(ITEM_BOW, this->itemParams);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyNuts(GlobalContext* globalCtx, EnGirlA* this) {
@@ -415,22 +415,22 @@ void EnGirlA_BuyNuts(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_NUTS_10);
break;
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyShieldHero(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_SHIELD_HERO);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyStick(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_STICK);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyMaskAllNight(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_MASK_ALL_NIGHT);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyBombBag(GlobalContext* globalCtx, EnGirlA* this) {
@@ -446,14 +446,14 @@ void EnGirlA_BuyBombBag(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_BOMB_BAG_40);
break;
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyBombchus(GlobalContext* globalCtx, EnGirlA* this) {
if (this->itemParams == 10) {
Item_Give(globalCtx, ITEM_BOMBCHUS_10);
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyBombs(GlobalContext* globalCtx, EnGirlA* this) {
@@ -471,12 +471,12 @@ void EnGirlA_BuyBombs(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_BOMBS_30);
break;
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyBottle(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_BOTTLE);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuySword(GlobalContext* globalCtx, EnGirlA* this) {
@@ -494,17 +494,17 @@ void EnGirlA_BuySword(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_SWORD_GREAT_FAIRY);
break;
}
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_BuyShieldMirror(GlobalContext* globalCtx, EnGirlA* this) {
Item_Give(globalCtx, ITEM_SHIELD_MIRROR);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
// Fanfare is handled by ovl_en_ossan
void EnGirlA_BuyFanfare(GlobalContext* globalCtx, EnGirlA* this) {
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
void EnGirlA_DoNothing(EnGirlA* this, GlobalContext* globalCtx) {
+4 -4
View File
@@ -622,7 +622,7 @@ s32 func_808F4150(GlobalContext* globalCtx, EnIn* this, s32 arg2, MessageContext
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.save.playerData.rupees >= globalCtx->msgCtx.unk1206C) {
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
if (!(gSaveContext.save.weekEventReg[57] & 1)) {
func_808F4108(this, globalCtx, 0x3474);
} else if (this->unk4AC & 8) {
@@ -648,7 +648,7 @@ s32 func_808F4270(GlobalContext* globalCtx, EnIn* this, s32 arg2, MessageContext
if (msgCtx->choiceIndex == 0) {
func_8019F208();
if (gSaveContext.save.playerData.rupees >= fee) {
func_801159EC(-fee);
Rupees_ChangeBy(-fee);
if (!(gSaveContext.save.weekEventReg[57] & 1)) {
if (arg4 != 0) {
func_800E8EA0(globalCtx, &this->actor, 0x3474);
@@ -796,7 +796,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
ret = true;
} else {
func_800E8EA0(globalCtx, &this->actor, 0x3469);
@@ -1048,7 +1048,7 @@ s32 func_808F4414(GlobalContext* globalCtx, EnIn* this, s32 arg2) {
if (Interface_HasEmptyBottle()) {
this->actionFunc = func_808F3C40;
func_800B8A1C(&this->actor, globalCtx, 0x92, 500.0f, 100.0f);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
ret = true;
} else {
func_800E8EA0(globalCtx, &this->actor, 0x3469);
+2 -2
View File
@@ -642,7 +642,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) {
} else {
func_8019F208();
func_80B40E74(this, globalCtx, 0xC42);
func_801159EC(-globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(-globalCtx->msgCtx.unk1206C);
}
break;
@@ -765,7 +765,7 @@ void func_80B41E18(EnKgy* this, GlobalContext* globalCtx) {
func_80B41368(this, globalCtx, 4);
if (this->unk_29C & 0x10) {
this->actor.textId = 0xC56;
func_801159EC(globalCtx->msgCtx.unk1206C);
Rupees_ChangeBy(globalCtx->msgCtx.unk1206C);
} else {
this->actor.textId = 0xC42;
}
+1 -1
View File
@@ -128,7 +128,7 @@ void EnMs_Talk(EnMs* this, GlobalContext* globalCtx) {
} else {
func_8019F208();
func_800B8A1C(&this->actor, globalCtx, GI_MAGIC_BEANS, 90.0f, 10.0f);
func_801159EC(-10);
Rupees_ChangeBy(-10);
this->actionFunc = EnMs_Sell;
}
break;
@@ -277,7 +277,7 @@ void func_809C6A04(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 3;
} else {
func_8019F208();
func_801159EC(-20);
Rupees_ChangeBy(-20);
gSaveContext.save.weekEventReg[63] |= 1;
gSaveContext.save.weekEventReg[63] &= (u8)~2;
globalCtx->msgCtx.unk11F22 = 0x43;
@@ -556,7 +556,7 @@ void func_809C7380(EnSyatekiMan* this, GlobalContext* globalCtx) {
this->unk_26A = 3;
} else {
func_8019F208();
func_801159EC(-20);
Rupees_ChangeBy(-20);
this->unk_26A = 2;
if (!(this->unk_282 & 0x10)) {
this->unk_282 |= 0x10;
@@ -416,7 +416,7 @@ s32 func_80C10E98(GlobalContext* globalCtx) {
AMMO(ITEM_BOMB) -= spB0 * 5;
AMMO(ITEM_BOW) -= spAC * 10;
func_801159EC(-((phi_s0_2 * 50) + (spA0 * 20) + (phi_s2 * 5) + spA8));
Rupees_ChangeBy(-((phi_s0_2 * 50) + (spA0 * 20) + (phi_s2 * 5) + spA8));
return true;
}
+1 -1
View File
@@ -602,7 +602,7 @@ void func_80AED610(EnTk* this, GlobalContext* globalCtx) {
break;
case 0x1413:
func_801159EC(30);
Rupees_ChangeBy(30);
gSaveContext.save.weekEventReg[60] |= 2;
func_80151938(globalCtx, 0x13FF);
break;
+2 -2
View File
@@ -474,7 +474,7 @@ void func_80B973BC(EnZot* this, GlobalContext* globalCtx) {
break;
case 0x126F:
func_801159EC(90);
Rupees_ChangeBy(90);
func_80151938(globalCtx, 0x1270);
break;
@@ -483,7 +483,7 @@ void func_80B973BC(EnZot* this, GlobalContext* globalCtx) {
func_80151938(globalCtx, 0x1277);
} else {
func_80151938(globalCtx, 0x1278);
func_801159EC(-10);
Rupees_ChangeBy(-10);
}
break;
+1 -1
View File
@@ -2132,7 +2132,7 @@
0x80115844:("func_80115844",),
0x80115908:("func_80115908",),
0x801159C0:("func_801159c0",),
0x801159EC:("func_801159EC",),
0x801159EC:("Rupees_ChangeBy",),
0x80115A14:("func_80115A14",),
0x80115D14:("Interface_AddMagic",),
0x80115D5C:("func_80115D5C",),
+1 -1
View File
@@ -1646,7 +1646,7 @@ asm/non_matchings/code/z_parameter/func_80115764.s,func_80115764,0x80115764,0x38
asm/non_matchings/code/z_parameter/func_80115844.s,func_80115844,0x80115844,0x31
asm/non_matchings/code/z_parameter/func_80115908.s,func_80115908,0x80115908,0x2E
asm/non_matchings/code/z_parameter/func_801159c0.s,func_801159c0,0x801159C0,0xB
asm/non_matchings/code/z_parameter/func_801159EC.s,func_801159EC,0x801159EC,0xA
asm/non_matchings/code/z_parameter/Rupees_ChangeBy.s,Rupees_ChangeBy,0x801159EC,0xA
asm/non_matchings/code/z_parameter/func_80115A14.s,func_80115A14,0x80115A14,0xC0
asm/non_matchings/code/z_parameter/Interface_AddMagic.s,Interface_AddMagic,0x80115D14,0x12
asm/non_matchings/code/z_parameter/func_80115D5C.s,func_80115D5C,0x80115D5C,0x16
1 asm/non_matchings/code/z_en_a_keep/EnAObj_Init.s EnAObj_Init 0x800A5AC0 0x2B
1646 asm/non_matchings/code/z_parameter/func_80115844.s func_80115844 0x80115844 0x31
1647 asm/non_matchings/code/z_parameter/func_80115908.s func_80115908 0x80115908 0x2E
1648 asm/non_matchings/code/z_parameter/func_801159c0.s func_801159c0 0x801159C0 0xB
1649 asm/non_matchings/code/z_parameter/func_801159EC.s asm/non_matchings/code/z_parameter/Rupees_ChangeBy.s func_801159EC Rupees_ChangeBy 0x801159EC 0xA
1650 asm/non_matchings/code/z_parameter/func_80115A14.s func_80115A14 0x80115A14 0xC0
1651 asm/non_matchings/code/z_parameter/Interface_AddMagic.s Interface_AddMagic 0x80115D14 0x12
1652 asm/non_matchings/code/z_parameter/func_80115D5C.s func_80115D5C 0x80115D5C 0x16