mirror of https://github.com/zeldaret/tmc.git
Merge pull request #281 from hatal175/sub_0806D5D4
This commit is contained in:
commit
453e400945
|
|
@ -247,8 +247,7 @@ typedef struct {
|
|||
/*0x08*/ u8 filler[2];
|
||||
/*0x0a*/ u8 charm;
|
||||
/*0x0b*/ u8 unkB;
|
||||
/*0x0c*/ u8 itemOnA;
|
||||
/*0x0d*/ u8 itemOnB;
|
||||
/*0x0c*/ u8 itemButtons[2];
|
||||
/*0x0e*/ u8 bottles[4];
|
||||
/*0x12*/ u8 effect;
|
||||
/*0x13*/ u8 filler3[5];
|
||||
|
|
@ -260,6 +259,9 @@ typedef struct {
|
|||
/*0x22*/ u8 filler4[4];
|
||||
} Stats;
|
||||
|
||||
#define SLOT_A 0
|
||||
#define SLOT_B 1
|
||||
|
||||
typedef struct {
|
||||
/*0x0*/ u8 field_0x0;
|
||||
/*0x1*/ u8 behaviorID;
|
||||
|
|
|
|||
|
|
@ -37,9 +37,9 @@ extern u8 gUnk_080FE1DD[];
|
|||
u32 IsItemEquipped(u32 itemID) {
|
||||
u32 itemSlot;
|
||||
|
||||
if (itemID == gSave.stats.itemOnA)
|
||||
if (itemID == gSave.stats.itemButtons[SLOT_A])
|
||||
itemSlot = 0;
|
||||
else if (itemID == gSave.stats.itemOnB)
|
||||
else if (itemID == gSave.stats.itemButtons[SLOT_B])
|
||||
itemSlot = 1;
|
||||
else
|
||||
itemSlot = 2;
|
||||
|
|
@ -54,17 +54,17 @@ void PutItemOnSlot(u32 itemID) {
|
|||
}
|
||||
if (itemID2 - 1 < 0x1f) {
|
||||
itemSlot = 2;
|
||||
if (gSave.stats.itemOnA == 0) {
|
||||
if (gSave.stats.itemButtons[SLOT_A] == 0) {
|
||||
itemSlot = 0;
|
||||
} else if (gSave.stats.itemOnB == 0) {
|
||||
} else if (gSave.stats.itemButtons[SLOT_B] == 0) {
|
||||
itemSlot = 1;
|
||||
}
|
||||
if (itemSlot == 2) {
|
||||
u8 temp = gUnk_080FD5B4[itemID2].unk;
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemOnA].unk) {
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemButtons[SLOT_A]].unk) {
|
||||
itemSlot = 0;
|
||||
} else {
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemOnB].unk) {
|
||||
if (temp == gUnk_080FD5B4[gSave.stats.itemButtons[SLOT_B]].unk) {
|
||||
itemSlot = 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,12 +247,12 @@ void sub_080281A0(Entity* this) {
|
|||
bool32 sub_080281E0(u32 param_1) {
|
||||
bool32 ret = FALSE;
|
||||
if (GetInventoryValue(param_1) == 1) {
|
||||
if (ItemIsShield(gSave.stats.itemOnA)) {
|
||||
gSave.stats.itemOnA = 0;
|
||||
if (ItemIsShield(gSave.stats.itemButtons[SLOT_A])) {
|
||||
gSave.stats.itemButtons[SLOT_A] = 0;
|
||||
}
|
||||
|
||||
if (ItemIsShield(gSave.stats.itemOnB)) {
|
||||
gSave.stats.itemOnB = 0;
|
||||
if (ItemIsShield(gSave.stats.itemButtons[SLOT_B])) {
|
||||
gSave.stats.itemButtons[SLOT_B] = 0;
|
||||
}
|
||||
|
||||
sub_0807CAA0(param_1, 0);
|
||||
|
|
|
|||
|
|
@ -298,18 +298,16 @@ void sub_0806D514(Entity* this) {
|
|||
|
||||
ASM_FUNC("asm/non_matching/bigGoron/sub_0806D520.inc", void sub_0806D520(Entity* this, u32 param))
|
||||
|
||||
// TODO itemOnA and itemOnB would need to be in array?
|
||||
NONMATCH("asm/non_matching/bigGoron/sub_0806D5D4.inc", void sub_0806D5D4(void)) {
|
||||
void sub_0806D5D4(void) {
|
||||
u32 itemSlot;
|
||||
|
||||
InitBiggoronTimer();
|
||||
itemSlot = IsItemEquipped(0xd);
|
||||
if (itemSlot != 2) {
|
||||
((u8*)&gSave.stats.itemOnA)[itemSlot] = 0;
|
||||
gSave.stats.itemButtons[itemSlot] = 0;
|
||||
}
|
||||
sub_0807CAA0(0xd, 0);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0806D600(Entity* this, ScriptExecutionContext* context) {
|
||||
context->condition = gSave.timers[2] == 0;
|
||||
|
|
|
|||
|
|
@ -149,10 +149,10 @@ void sub_08068B84(Entity* this) {
|
|||
}
|
||||
|
||||
void sub_08068BB4(Entity* this) {
|
||||
u32 item = gSave.stats.itemOnA;
|
||||
u32 item = gSave.stats.itemButtons[SLOT_A];
|
||||
|
||||
this->field_0x68.HALF.HI = item;
|
||||
item = gSave.stats.itemOnB;
|
||||
item = gSave.stats.itemButtons[SLOT_B];
|
||||
*(&this->field_0x68.HALF.HI + 1) = item;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -176,8 +176,8 @@ u32 sub_0806DBF4(u32 param_1) {
|
|||
}
|
||||
|
||||
void sub_0806DC3C(Entity* this) {
|
||||
this->field_0x68.HALF.LO = gSave.stats.itemOnA;
|
||||
this->field_0x68.HALF.HI = gSave.stats.itemOnB;
|
||||
this->field_0x68.HALF.LO = gSave.stats.itemButtons[SLOT_A];
|
||||
this->field_0x68.HALF.HI = gSave.stats.itemButtons[SLOT_B];
|
||||
}
|
||||
|
||||
void sub_0806DC58(Entity* this) {
|
||||
|
|
|
|||
|
|
@ -3424,10 +3424,10 @@ void SurfaceAction_14(Entity* this) {
|
|||
void SurfaceAction_CloneTile(Entity* this) {
|
||||
if (gPlayerState.field_0xa0[0] == 4) {
|
||||
u32 item, n, i;
|
||||
if (ItemIsSword(gSave.stats.itemOnA)) {
|
||||
item = gSave.stats.itemOnA;
|
||||
if (ItemIsSword(gSave.stats.itemButtons[SLOT_A])) {
|
||||
item = gSave.stats.itemButtons[SLOT_A];
|
||||
} else {
|
||||
item = gSave.stats.itemOnB;
|
||||
item = gSave.stats.itemButtons[SLOT_B];
|
||||
}
|
||||
switch (item) {
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -88,8 +88,7 @@ static const SaveFile gDemoSave = {
|
|||
.stats = {
|
||||
.health = 40,
|
||||
.maxHealth = 40,
|
||||
.itemOnA = ITEM_SHIELD,
|
||||
.itemOnB = ITEM_SMITH_SWORD,
|
||||
.itemButtons = { ITEM_SHIELD, ITEM_SMITH_SWORD },
|
||||
.rupees = 5,
|
||||
},
|
||||
.fillerD0 = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue